-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
75 lines (66 loc) · 1.59 KB
/
types.ts
File metadata and controls
75 lines (66 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type {
Node,
Span,
IdentifierName,
IdentifierReference,
BindingIdentifier,
LabelIdentifier,
TSIndexSignatureName,
} from 'oxc-parser'
export type RewriteSpecifier =
| '.js'
| '.mjs'
| '.cjs'
| '.ts'
| '.mts'
| '.cts'
| ((value: string) => string | null | undefined)
export type ModuleOptions = {
target: 'module' | 'commonjs'
sourceType?: 'auto' | 'module' | 'commonjs'
transformSyntax?: boolean
liveBindings?: 'strict' | 'loose' | 'off'
rewriteSpecifier?: RewriteSpecifier
dirFilename?: 'inject' | 'preserve' | 'error'
importMeta?: 'preserve' | 'shim' | 'error'
requireSource?: 'builtin' | 'create-require'
cjsDefault?: 'module-exports' | 'auto' | 'none'
topLevelAwait?: 'error' | 'wrap' | 'preserve'
out?: string
inPlace?: boolean
}
export type SpannedNode = Node & Span
export type ExportsMeta = {
hasExportsBeenReassigned: boolean
hasDefaultExportBeenReassigned: boolean
hasDefaultExportBeenAssigned: boolean
defaultExportValue: unknown
}
export type CjsExport = {
key: string
writes: SpannedNode[]
fromIdentifier?: string
via: Set<'exports' | 'module.exports'>
reassignments: SpannedNode[]
hasGetter?: boolean
}
export type IdentMeta = {
/*
`var` can be redeclared in the same scope.
*/
declare: SpannedNode[]
read: SpannedNode[]
}
export type Scope = {
type: string
name: string
node: Node
idents: Set<string>
}
export type FormatterOptions = Omit<ModuleOptions, 'out' | 'inPlace'>
export type Identifier =
| IdentifierName
| IdentifierReference
| BindingIdentifier
| LabelIdentifier
| TSIndexSignatureName