rolldown 1.0.0-beta.10-commit.81375fe → 1.0.0-beta.10-commit.885ee53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/config.cjs +2 -2
- package/dist/config.d.cts +2 -4
- package/dist/config.d.mts +2 -4
- package/dist/config.mjs +2 -2
- package/dist/experimental-index.cjs +1 -1
- package/dist/experimental-index.d.cts +12 -43
- package/dist/experimental-index.d.mts +12 -43
- package/dist/experimental-index.mjs +1 -1
- package/dist/filter-index.d.cts +2 -3
- package/dist/filter-index.d.mts +2 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +1 -1
- package/dist/parallel-plugin-worker.cjs +1 -1
- package/dist/parallel-plugin-worker.mjs +1 -1
- package/dist/parallel-plugin.d.cts +6 -7
- package/dist/parallel-plugin.d.mts +6 -7
- package/dist/parse-ast-index.d.cts +2 -2
- package/dist/parse-ast-index.d.mts +2 -2
- package/dist/shared/{binding.d-BKOi_hD7.d.cts → binding-BYafUgFF.d.cts} +731 -781
- package/dist/shared/{binding.d-CcC9cav0.d.mts → binding-Dod8fhx9.d.mts} +731 -781
- package/dist/shared/define-config-BetvTt9D.d.cts +1048 -0
- package/dist/shared/define-config-CpexVifn.d.mts +1048 -0
- package/dist/shared/{load-config-bI3e4Rt2.cjs → load-config-DTXGCmId.cjs} +1 -1
- package/dist/shared/{load-config-CFYpL6SK.mjs → load-config-WuIFSl0A.mjs} +1 -1
- package/dist/shared/{src-Bhp6Fp5n.mjs → src-BB5r5vkG.mjs} +46 -16
- package/dist/shared/{src-D0ZOjAa9.cjs → src-DrHV5x1X.cjs} +46 -16
- package/package.json +18 -17
- package/dist/shared/define-config.d-CZCq3rLo.d.cts +0 -1083
- package/dist/shared/define-config.d-OKdRAYhn.d.mts +0 -1083
|
@@ -1,314 +1,295 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _oxc_project_types0 from "@oxc-project/types";
|
|
2
2
|
|
|
3
3
|
//#region src/binding.d.ts
|
|
4
|
-
type MaybePromise<T> = T | Promise<T
|
|
5
|
-
type Nullable<T> = T | null | undefined
|
|
6
|
-
type VoidNullable<T = void> = T | null | undefined | void
|
|
7
|
-
type BindingStringOrRegex = string | RegExp
|
|
4
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
5
|
+
type Nullable<T> = T | null | undefined;
|
|
6
|
+
type VoidNullable<T = void> = T | null | undefined | void;
|
|
7
|
+
type BindingStringOrRegex = string | RegExp;
|
|
8
8
|
declare class BindingBundleEndEventData {
|
|
9
|
-
output: string
|
|
10
|
-
duration: number
|
|
11
|
-
get result(): Bundler
|
|
9
|
+
output: string;
|
|
10
|
+
duration: number;
|
|
11
|
+
get result(): Bundler;
|
|
12
12
|
}
|
|
13
13
|
declare class BindingBundleErrorEventData {
|
|
14
|
-
get result(): Bundler
|
|
15
|
-
get error(): Array<Error | BindingError
|
|
14
|
+
get result(): Bundler;
|
|
15
|
+
get error(): Array<Error | BindingError>;
|
|
16
16
|
}
|
|
17
17
|
declare class BindingError {
|
|
18
|
-
kind: string
|
|
19
|
-
message: string
|
|
18
|
+
kind: string;
|
|
19
|
+
message: string;
|
|
20
20
|
}
|
|
21
21
|
declare class BindingModuleInfo {
|
|
22
|
-
id: string
|
|
23
|
-
importers: Array<string
|
|
24
|
-
dynamicImporters: Array<string
|
|
25
|
-
importedIds: Array<string
|
|
26
|
-
dynamicallyImportedIds: Array<string
|
|
27
|
-
exports: Array<string
|
|
28
|
-
isEntry: boolean
|
|
29
|
-
get code(): string | null
|
|
22
|
+
id: string;
|
|
23
|
+
importers: Array<string>;
|
|
24
|
+
dynamicImporters: Array<string>;
|
|
25
|
+
importedIds: Array<string>;
|
|
26
|
+
dynamicallyImportedIds: Array<string>;
|
|
27
|
+
exports: Array<string>;
|
|
28
|
+
isEntry: boolean;
|
|
29
|
+
get code(): string | null;
|
|
30
30
|
}
|
|
31
31
|
declare class BindingNormalizedOptions {
|
|
32
|
-
get input(): Array<string> | Record<string, string
|
|
33
|
-
get cwd(): string | null
|
|
34
|
-
get platform(): 'node' | 'browser' | 'neutral'
|
|
35
|
-
get shimMissingExports(): boolean
|
|
36
|
-
get name(): string | null
|
|
37
|
-
get cssEntryFilenames(): string | undefined
|
|
38
|
-
get cssChunkFilenames(): string | undefined
|
|
39
|
-
get entryFilenames(): string | undefined
|
|
40
|
-
get chunkFilenames(): string | undefined
|
|
41
|
-
get assetFilenames(): string | undefined
|
|
42
|
-
get dir(): string | null
|
|
43
|
-
get file(): string | null
|
|
44
|
-
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd'
|
|
45
|
-
get exports(): 'default' | 'named' | 'none' | 'auto'
|
|
46
|
-
get esModule(): boolean | 'if-default-prop'
|
|
47
|
-
get inlineDynamicImports(): boolean
|
|
48
|
-
get sourcemap(): boolean | 'inline' | 'hidden'
|
|
49
|
-
get banner(): string | undefined | null | undefined
|
|
50
|
-
get footer(): string | undefined | null | undefined
|
|
51
|
-
get intro(): string | undefined | null | undefined
|
|
52
|
-
get outro(): string | undefined | null | undefined
|
|
53
|
-
get externalLiveBindings(): boolean
|
|
54
|
-
get extend(): boolean
|
|
55
|
-
get globals(): Record<string, string> | undefined
|
|
56
|
-
get hashCharacters(): 'base64' | 'base36' | 'hex'
|
|
57
|
-
get sourcemapDebugIds(): boolean
|
|
58
|
-
get minify(): false | BindingMinifyOptions
|
|
59
|
-
get polyfillRequire(): boolean
|
|
60
|
-
get legalComments(): 'none' | 'inline'
|
|
32
|
+
get input(): Array<string> | Record<string, string>;
|
|
33
|
+
get cwd(): string | null;
|
|
34
|
+
get platform(): 'node' | 'browser' | 'neutral';
|
|
35
|
+
get shimMissingExports(): boolean;
|
|
36
|
+
get name(): string | null;
|
|
37
|
+
get cssEntryFilenames(): string | undefined;
|
|
38
|
+
get cssChunkFilenames(): string | undefined;
|
|
39
|
+
get entryFilenames(): string | undefined;
|
|
40
|
+
get chunkFilenames(): string | undefined;
|
|
41
|
+
get assetFilenames(): string | undefined;
|
|
42
|
+
get dir(): string | null;
|
|
43
|
+
get file(): string | null;
|
|
44
|
+
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd';
|
|
45
|
+
get exports(): 'default' | 'named' | 'none' | 'auto';
|
|
46
|
+
get esModule(): boolean | 'if-default-prop';
|
|
47
|
+
get inlineDynamicImports(): boolean;
|
|
48
|
+
get sourcemap(): boolean | 'inline' | 'hidden';
|
|
49
|
+
get banner(): string | undefined | null | undefined;
|
|
50
|
+
get footer(): string | undefined | null | undefined;
|
|
51
|
+
get intro(): string | undefined | null | undefined;
|
|
52
|
+
get outro(): string | undefined | null | undefined;
|
|
53
|
+
get externalLiveBindings(): boolean;
|
|
54
|
+
get extend(): boolean;
|
|
55
|
+
get globals(): Record<string, string> | undefined;
|
|
56
|
+
get hashCharacters(): 'base64' | 'base36' | 'hex';
|
|
57
|
+
get sourcemapDebugIds(): boolean;
|
|
58
|
+
get minify(): false | BindingMinifyOptions;
|
|
59
|
+
get polyfillRequire(): boolean;
|
|
60
|
+
get legalComments(): 'none' | 'inline';
|
|
61
61
|
}
|
|
62
62
|
declare class BindingOutputAsset {
|
|
63
|
-
get fileName(): string
|
|
64
|
-
get originalFileName(): string | null
|
|
65
|
-
get originalFileNames(): Array<string
|
|
66
|
-
get source(): BindingAssetSource
|
|
67
|
-
get name(): string | null
|
|
68
|
-
get names(): Array<string
|
|
63
|
+
get fileName(): string;
|
|
64
|
+
get originalFileName(): string | null;
|
|
65
|
+
get originalFileNames(): Array<string>;
|
|
66
|
+
get source(): BindingAssetSource;
|
|
67
|
+
get name(): string | null;
|
|
68
|
+
get names(): Array<string>;
|
|
69
69
|
}
|
|
70
70
|
declare class BindingOutputChunk {
|
|
71
|
-
get isEntry(): boolean
|
|
72
|
-
get isDynamicEntry(): boolean
|
|
73
|
-
get facadeModuleId(): string | null
|
|
74
|
-
get moduleIds(): Array<string
|
|
75
|
-
get exports(): Array<string
|
|
76
|
-
get fileName(): string
|
|
77
|
-
get modules(): BindingModules
|
|
78
|
-
get imports(): Array<string
|
|
79
|
-
get dynamicImports(): Array<string
|
|
80
|
-
get code(): string
|
|
81
|
-
get map(): string | null
|
|
82
|
-
get sourcemapFileName(): string | null
|
|
83
|
-
get preliminaryFileName(): string
|
|
84
|
-
get name(): string
|
|
71
|
+
get isEntry(): boolean;
|
|
72
|
+
get isDynamicEntry(): boolean;
|
|
73
|
+
get facadeModuleId(): string | null;
|
|
74
|
+
get moduleIds(): Array<string>;
|
|
75
|
+
get exports(): Array<string>;
|
|
76
|
+
get fileName(): string;
|
|
77
|
+
get modules(): BindingModules;
|
|
78
|
+
get imports(): Array<string>;
|
|
79
|
+
get dynamicImports(): Array<string>;
|
|
80
|
+
get code(): string;
|
|
81
|
+
get map(): string | null;
|
|
82
|
+
get sourcemapFileName(): string | null;
|
|
83
|
+
get preliminaryFileName(): string;
|
|
84
|
+
get name(): string;
|
|
85
85
|
}
|
|
86
86
|
declare class BindingOutputs {
|
|
87
|
-
get chunks(): Array<BindingOutputChunk
|
|
88
|
-
get assets(): Array<BindingOutputAsset
|
|
89
|
-
get errors(): Array<Error | BindingError
|
|
87
|
+
get chunks(): Array<BindingOutputChunk>;
|
|
88
|
+
get assets(): Array<BindingOutputAsset>;
|
|
89
|
+
get errors(): Array<Error | BindingError>;
|
|
90
90
|
}
|
|
91
91
|
declare class BindingPluginContext {
|
|
92
|
-
load(specifier: string, sideEffects: BindingHookSideEffects | undefined): Promise<void
|
|
93
|
-
resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null
|
|
94
|
-
emitFile(file: BindingEmittedAsset, assetFilename?: string | undefined | null, fnSanitizedFileName?: string | undefined | null): string
|
|
95
|
-
emitChunk(file: BindingEmittedChunk): string
|
|
96
|
-
getFileName(referenceId: string): string
|
|
97
|
-
getModuleInfo(moduleId: string): BindingModuleInfo | null
|
|
98
|
-
getModuleIds(): Array<string
|
|
99
|
-
addWatchFile(file: string): void
|
|
92
|
+
load(specifier: string, sideEffects: BindingHookSideEffects | undefined): Promise<void>;
|
|
93
|
+
resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null>;
|
|
94
|
+
emitFile(file: BindingEmittedAsset, assetFilename?: string | undefined | null, fnSanitizedFileName?: string | undefined | null): string;
|
|
95
|
+
emitChunk(file: BindingEmittedChunk): string;
|
|
96
|
+
getFileName(referenceId: string): string;
|
|
97
|
+
getModuleInfo(moduleId: string): BindingModuleInfo | null;
|
|
98
|
+
getModuleIds(): Array<string>;
|
|
99
|
+
addWatchFile(file: string): void;
|
|
100
100
|
}
|
|
101
101
|
declare class BindingRenderedChunk {
|
|
102
|
-
get name(): string
|
|
103
|
-
get isEntry(): boolean
|
|
104
|
-
get isDynamicEntry(): boolean
|
|
105
|
-
get facadeModuleId(): string | null
|
|
106
|
-
get moduleIds(): Array<string
|
|
107
|
-
get exports(): Array<string
|
|
108
|
-
get fileName(): string
|
|
109
|
-
get modules(): BindingModules
|
|
110
|
-
get imports(): Array<string
|
|
111
|
-
get dynamicImports(): Array<string
|
|
102
|
+
get name(): string;
|
|
103
|
+
get isEntry(): boolean;
|
|
104
|
+
get isDynamicEntry(): boolean;
|
|
105
|
+
get facadeModuleId(): string | null;
|
|
106
|
+
get moduleIds(): Array<string>;
|
|
107
|
+
get exports(): Array<string>;
|
|
108
|
+
get fileName(): string;
|
|
109
|
+
get modules(): BindingModules;
|
|
110
|
+
get imports(): Array<string>;
|
|
111
|
+
get dynamicImports(): Array<string>;
|
|
112
112
|
}
|
|
113
113
|
declare class BindingRenderedChunkMeta {
|
|
114
|
-
get chunks(): Record<string, BindingRenderedChunk
|
|
114
|
+
get chunks(): Record<string, BindingRenderedChunk>;
|
|
115
115
|
}
|
|
116
116
|
declare class BindingRenderedModule {
|
|
117
|
-
get code(): string | null
|
|
118
|
-
get renderedExports(): Array<string
|
|
117
|
+
get code(): string | null;
|
|
118
|
+
get renderedExports(): Array<string>;
|
|
119
119
|
}
|
|
120
120
|
declare class BindingTransformPluginContext {
|
|
121
|
-
getCombinedSourcemap(): string
|
|
122
|
-
inner(): BindingPluginContext
|
|
121
|
+
getCombinedSourcemap(): string;
|
|
122
|
+
inner(): BindingPluginContext;
|
|
123
123
|
}
|
|
124
124
|
declare class BindingWatcherChangeData {
|
|
125
|
-
path: string
|
|
126
|
-
kind: string
|
|
125
|
+
path: string;
|
|
126
|
+
kind: string;
|
|
127
127
|
}
|
|
128
128
|
declare class BindingWatcherEvent {
|
|
129
|
-
eventKind(): string
|
|
130
|
-
watchChangeData(): BindingWatcherChangeData
|
|
131
|
-
bundleEndData(): BindingBundleEndEventData
|
|
132
|
-
bundleEventKind(): string
|
|
133
|
-
bundleErrorData(): BindingBundleErrorEventData
|
|
129
|
+
eventKind(): string;
|
|
130
|
+
watchChangeData(): BindingWatcherChangeData;
|
|
131
|
+
bundleEndData(): BindingBundleEndEventData;
|
|
132
|
+
bundleEventKind(): string;
|
|
133
|
+
bundleErrorData(): BindingBundleErrorEventData;
|
|
134
134
|
}
|
|
135
135
|
declare class Bundler {
|
|
136
|
-
constructor(option: BindingBundlerOptions)
|
|
137
|
-
write(): Promise<BindingOutputs
|
|
138
|
-
generate(): Promise<BindingOutputs
|
|
139
|
-
scan(): Promise<BindingOutputs
|
|
140
|
-
close(): Promise<void
|
|
141
|
-
get closed(): boolean
|
|
142
|
-
getWatchFiles(): Promise<Array<string
|
|
143
|
-
generateHmrPatch(changedFiles: Array<string>): Promise<BindingHmrOutput
|
|
144
|
-
hmrInvalidate(file: string, firstInvalidatedBy?: string | undefined | null): Promise<BindingHmrOutput
|
|
136
|
+
constructor(option: BindingBundlerOptions);
|
|
137
|
+
write(): Promise<BindingOutputs>;
|
|
138
|
+
generate(): Promise<BindingOutputs>;
|
|
139
|
+
scan(): Promise<BindingOutputs>;
|
|
140
|
+
close(): Promise<void>;
|
|
141
|
+
get closed(): boolean;
|
|
142
|
+
getWatchFiles(): Promise<Array<string>>;
|
|
143
|
+
generateHmrPatch(changedFiles: Array<string>): Promise<BindingHmrOutput>;
|
|
144
|
+
hmrInvalidate(file: string, firstInvalidatedBy?: string | undefined | null): Promise<BindingHmrOutput>;
|
|
145
145
|
}
|
|
146
146
|
declare class ParallelJsPluginRegistry {
|
|
147
|
-
id: number
|
|
148
|
-
workerCount: number
|
|
149
|
-
constructor(workerCount: number)
|
|
147
|
+
id: number;
|
|
148
|
+
workerCount: number;
|
|
149
|
+
constructor(workerCount: number);
|
|
150
150
|
}
|
|
151
151
|
declare class ParseResult {
|
|
152
|
-
get program(): Program
|
|
153
|
-
get module(): EcmaScriptModule
|
|
154
|
-
get comments(): Array<Comment
|
|
155
|
-
get errors(): Array<OxcError
|
|
152
|
+
get program(): _oxc_project_types0.Program;
|
|
153
|
+
get module(): EcmaScriptModule;
|
|
154
|
+
get comments(): Array<Comment>;
|
|
155
|
+
get errors(): Array<OxcError>;
|
|
156
156
|
}
|
|
157
157
|
declare class ResolverFactory {
|
|
158
|
-
constructor(options?: NapiResolveOptions | undefined | null)
|
|
159
|
-
static default(): ResolverFactory
|
|
158
|
+
constructor(options?: NapiResolveOptions | undefined | null);
|
|
159
|
+
static default(): ResolverFactory;
|
|
160
160
|
/** Clone the resolver using the same underlying cache. */
|
|
161
|
-
cloneWithOptions(options: NapiResolveOptions): ResolverFactory
|
|
161
|
+
cloneWithOptions(options: NapiResolveOptions): ResolverFactory;
|
|
162
162
|
/** Clear the underlying cache. */
|
|
163
|
-
clearCache(): void
|
|
163
|
+
clearCache(): void;
|
|
164
164
|
/** Synchronously resolve `specifier` at an absolute path to a `directory`. */
|
|
165
|
-
sync(directory: string, request: string): ResolveResult
|
|
165
|
+
sync(directory: string, request: string): ResolveResult;
|
|
166
166
|
/** Asynchronously resolve `specifier` at an absolute path to a `directory`. */
|
|
167
|
-
async(directory: string, request: string): Promise<ResolveResult
|
|
167
|
+
async(directory: string, request: string): Promise<ResolveResult>;
|
|
168
168
|
}
|
|
169
169
|
interface AliasItem {
|
|
170
|
-
find: string
|
|
171
|
-
replacements: Array<string
|
|
170
|
+
find: string;
|
|
171
|
+
replacements: Array<string>;
|
|
172
172
|
}
|
|
173
173
|
interface BindingAdvancedChunksOptions {
|
|
174
|
-
minSize?: number
|
|
175
|
-
minShareCount?: number
|
|
176
|
-
groups?: Array<BindingMatchGroup
|
|
177
|
-
maxSize?: number
|
|
178
|
-
minModuleSize?: number
|
|
179
|
-
maxModuleSize?: number
|
|
174
|
+
minSize?: number;
|
|
175
|
+
minShareCount?: number;
|
|
176
|
+
groups?: Array<BindingMatchGroup>;
|
|
177
|
+
maxSize?: number;
|
|
178
|
+
minModuleSize?: number;
|
|
179
|
+
maxModuleSize?: number;
|
|
180
180
|
}
|
|
181
181
|
interface BindingAssetPluginConfig {
|
|
182
|
-
isServer?: boolean
|
|
183
|
-
urlBase?: string
|
|
184
|
-
publicDir?: string
|
|
185
|
-
assetsInclude?: Array<BindingStringOrRegex
|
|
182
|
+
isServer?: boolean;
|
|
183
|
+
urlBase?: string;
|
|
184
|
+
publicDir?: string;
|
|
185
|
+
assetsInclude?: Array<BindingStringOrRegex>;
|
|
186
186
|
}
|
|
187
187
|
interface BindingAssetSource {
|
|
188
|
-
inner: string | Uint8Array
|
|
188
|
+
inner: string | Uint8Array;
|
|
189
189
|
}
|
|
190
190
|
interface BindingBuildImportAnalysisPluginConfig {
|
|
191
|
-
preloadCode: string
|
|
192
|
-
insertPreload: boolean
|
|
193
|
-
optimizeModulePreloadRelativePaths: boolean
|
|
194
|
-
renderBuiltUrl: boolean
|
|
195
|
-
isRelativeBase: boolean
|
|
191
|
+
preloadCode: string;
|
|
192
|
+
insertPreload: boolean;
|
|
193
|
+
optimizeModulePreloadRelativePaths: boolean;
|
|
194
|
+
renderBuiltUrl: boolean;
|
|
195
|
+
isRelativeBase: boolean;
|
|
196
196
|
}
|
|
197
197
|
interface BindingBuiltinPlugin {
|
|
198
|
-
__name: BindingBuiltinPluginName
|
|
199
|
-
options?: unknown
|
|
200
|
-
}
|
|
201
|
-
type BindingBuiltinPluginName =
|
|
202
|
-
'builtin:asset'|
|
|
203
|
-
'builtin:asset-import-meta-url'|
|
|
204
|
-
'builtin:build-import-analysis'|
|
|
205
|
-
'builtin:dynamic-import-vars'|
|
|
206
|
-
'builtin:import-glob'|
|
|
207
|
-
'builtin:isolated-declaration'|
|
|
208
|
-
'builtin:json'|
|
|
209
|
-
'builtin:load-fallback'|
|
|
210
|
-
'builtin:manifest'|
|
|
211
|
-
'builtin:module-federation'|
|
|
212
|
-
'builtin:module-preload-polyfill'|
|
|
213
|
-
'builtin:oxc-runtime'|
|
|
214
|
-
'builtin:reporter'|
|
|
215
|
-
'builtin:replace'|
|
|
216
|
-
'builtin:transform'|
|
|
217
|
-
'builtin:vite-resolve'|
|
|
218
|
-
'builtin:wasm-fallback'|
|
|
219
|
-
'builtin:wasm-helper'|
|
|
220
|
-
'builtin:web-worker-post';
|
|
198
|
+
__name: BindingBuiltinPluginName;
|
|
199
|
+
options?: unknown;
|
|
200
|
+
}
|
|
201
|
+
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-federation' | 'builtin:module-preload-polyfill' | 'builtin:oxc-runtime' | 'builtin:reporter' | 'builtin:replace' | 'builtin:transform' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
|
|
221
202
|
interface BindingBundlerOptions {
|
|
222
|
-
inputOptions: BindingInputOptions
|
|
223
|
-
outputOptions: BindingOutputOptions
|
|
224
|
-
parallelPluginsRegistry?: ParallelJsPluginRegistry
|
|
203
|
+
inputOptions: BindingInputOptions;
|
|
204
|
+
outputOptions: BindingOutputOptions;
|
|
205
|
+
parallelPluginsRegistry?: ParallelJsPluginRegistry;
|
|
225
206
|
}
|
|
226
207
|
interface BindingChecksOptions {
|
|
227
|
-
circularDependency?: boolean
|
|
228
|
-
eval?: boolean
|
|
229
|
-
missingGlobalName?: boolean
|
|
230
|
-
missingNameOptionForIifeExport?: boolean
|
|
231
|
-
mixedExport?: boolean
|
|
232
|
-
unresolvedEntry?: boolean
|
|
233
|
-
unresolvedImport?: boolean
|
|
234
|
-
filenameConflict?: boolean
|
|
235
|
-
commonJsVariableInEsm?: boolean
|
|
236
|
-
importIsUndefined?: boolean
|
|
237
|
-
configurationFieldConflict?: boolean
|
|
208
|
+
circularDependency?: boolean;
|
|
209
|
+
eval?: boolean;
|
|
210
|
+
missingGlobalName?: boolean;
|
|
211
|
+
missingNameOptionForIifeExport?: boolean;
|
|
212
|
+
mixedExport?: boolean;
|
|
213
|
+
unresolvedEntry?: boolean;
|
|
214
|
+
unresolvedImport?: boolean;
|
|
215
|
+
filenameConflict?: boolean;
|
|
216
|
+
commonJsVariableInEsm?: boolean;
|
|
217
|
+
importIsUndefined?: boolean;
|
|
218
|
+
configurationFieldConflict?: boolean;
|
|
238
219
|
}
|
|
239
220
|
interface BindingDebugOptions {
|
|
240
|
-
sessionId?: string
|
|
221
|
+
sessionId?: string;
|
|
241
222
|
}
|
|
242
223
|
interface BindingDeferSyncScanData {
|
|
243
224
|
/** ModuleId */
|
|
244
|
-
id: string
|
|
245
|
-
sideEffects?: BindingHookSideEffects
|
|
225
|
+
id: string;
|
|
226
|
+
sideEffects?: BindingHookSideEffects;
|
|
246
227
|
}
|
|
247
228
|
interface BindingDynamicImportVarsPluginConfig {
|
|
248
|
-
include?: Array<BindingStringOrRegex
|
|
249
|
-
exclude?: Array<BindingStringOrRegex
|
|
250
|
-
resolver?: (id: string, importer: string) => MaybePromise<string | undefined
|
|
229
|
+
include?: Array<BindingStringOrRegex>;
|
|
230
|
+
exclude?: Array<BindingStringOrRegex>;
|
|
231
|
+
resolver?: (id: string, importer: string) => MaybePromise<string | undefined>;
|
|
251
232
|
}
|
|
252
233
|
interface BindingEmittedAsset {
|
|
253
|
-
name?: string
|
|
254
|
-
fileName?: string
|
|
255
|
-
originalFileName?: string
|
|
256
|
-
source: BindingAssetSource
|
|
234
|
+
name?: string;
|
|
235
|
+
fileName?: string;
|
|
236
|
+
originalFileName?: string;
|
|
237
|
+
source: BindingAssetSource;
|
|
257
238
|
}
|
|
258
239
|
interface BindingEmittedChunk {
|
|
259
|
-
name?: string
|
|
260
|
-
fileName?: string
|
|
261
|
-
id: string
|
|
262
|
-
importer?: string
|
|
240
|
+
name?: string;
|
|
241
|
+
fileName?: string;
|
|
242
|
+
id: string;
|
|
243
|
+
importer?: string;
|
|
263
244
|
}
|
|
264
245
|
interface BindingExperimentalHmrOptions {
|
|
265
|
-
host?: string
|
|
266
|
-
port?: number
|
|
267
|
-
implement?: string
|
|
246
|
+
host?: string;
|
|
247
|
+
port?: number;
|
|
248
|
+
implement?: string;
|
|
268
249
|
}
|
|
269
250
|
interface BindingExperimentalOptions {
|
|
270
|
-
strictExecutionOrder?: boolean
|
|
271
|
-
disableLiveBindings?: boolean
|
|
272
|
-
viteMode?: boolean
|
|
273
|
-
resolveNewUrlToAsset?: boolean
|
|
274
|
-
hmr?: BindingExperimentalHmrOptions
|
|
275
|
-
attachDebugInfo?: boolean
|
|
251
|
+
strictExecutionOrder?: boolean;
|
|
252
|
+
disableLiveBindings?: boolean;
|
|
253
|
+
viteMode?: boolean;
|
|
254
|
+
resolveNewUrlToAsset?: boolean;
|
|
255
|
+
hmr?: BindingExperimentalHmrOptions;
|
|
256
|
+
attachDebugInfo?: boolean;
|
|
276
257
|
}
|
|
277
258
|
interface BindingFilterToken {
|
|
278
|
-
kind: FilterTokenKind
|
|
279
|
-
payload?: BindingStringOrRegex | number | boolean
|
|
259
|
+
kind: FilterTokenKind;
|
|
260
|
+
payload?: BindingStringOrRegex | number | boolean;
|
|
280
261
|
}
|
|
281
262
|
interface BindingHmrBoundaryOutput {
|
|
282
|
-
boundary: string
|
|
283
|
-
acceptedVia: string
|
|
263
|
+
boundary: string;
|
|
264
|
+
acceptedVia: string;
|
|
284
265
|
}
|
|
285
266
|
interface BindingHmrOutput {
|
|
286
|
-
code: string
|
|
287
|
-
filename: string
|
|
288
|
-
sourcemap?: string
|
|
289
|
-
sourcemapFilename?: string
|
|
290
|
-
hmrBoundaries: Array<BindingHmrBoundaryOutput
|
|
291
|
-
fullReload: boolean
|
|
292
|
-
firstInvalidatedBy?: string
|
|
293
|
-
isSelfAccepting: boolean
|
|
294
|
-
fullReloadReason?: string
|
|
267
|
+
code: string;
|
|
268
|
+
filename: string;
|
|
269
|
+
sourcemap?: string;
|
|
270
|
+
sourcemapFilename?: string;
|
|
271
|
+
hmrBoundaries: Array<BindingHmrBoundaryOutput>;
|
|
272
|
+
fullReload: boolean;
|
|
273
|
+
firstInvalidatedBy?: string;
|
|
274
|
+
isSelfAccepting: boolean;
|
|
275
|
+
fullReloadReason?: string;
|
|
295
276
|
}
|
|
296
277
|
interface BindingHookFilter {
|
|
297
|
-
value?: Array<Array<BindingFilterToken
|
|
278
|
+
value?: Array<Array<BindingFilterToken>>;
|
|
298
279
|
}
|
|
299
280
|
interface BindingHookLoadOutput {
|
|
300
|
-
code: string
|
|
301
|
-
sideEffects?: BindingHookSideEffects
|
|
302
|
-
map?: BindingSourcemap
|
|
303
|
-
moduleType?: string
|
|
281
|
+
code: string;
|
|
282
|
+
sideEffects?: BindingHookSideEffects;
|
|
283
|
+
map?: BindingSourcemap;
|
|
284
|
+
moduleType?: string;
|
|
304
285
|
}
|
|
305
286
|
interface BindingHookRenderChunkOutput {
|
|
306
|
-
code: string
|
|
307
|
-
map?: BindingSourcemap
|
|
287
|
+
code: string;
|
|
288
|
+
map?: BindingSourcemap;
|
|
308
289
|
}
|
|
309
290
|
interface BindingHookResolveIdExtraArgs {
|
|
310
|
-
custom?: number
|
|
311
|
-
isEntry: boolean
|
|
291
|
+
custom?: number;
|
|
292
|
+
isEntry: boolean;
|
|
312
293
|
/**
|
|
313
294
|
* - `import-statement`: `import { foo } from './lib.js';`
|
|
314
295
|
* - `dynamic-import`: `import('./lib.js')`
|
|
@@ -318,195 +299,197 @@ interface BindingHookResolveIdExtraArgs {
|
|
|
318
299
|
* - `new-url`: `new URL('./worker.js', import.meta.url)`
|
|
319
300
|
* - `hot-accept`: `import.meta.hot.accept('./lib.js', () => {})`
|
|
320
301
|
*/
|
|
321
|
-
kind: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept'
|
|
302
|
+
kind: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept';
|
|
322
303
|
}
|
|
323
304
|
interface BindingHookResolveIdOutput {
|
|
324
|
-
id: string
|
|
325
|
-
external?: BindingResolvedExternal
|
|
326
|
-
normalizeExternalId?: boolean
|
|
327
|
-
sideEffects?: BindingHookSideEffects
|
|
305
|
+
id: string;
|
|
306
|
+
external?: BindingResolvedExternal;
|
|
307
|
+
normalizeExternalId?: boolean;
|
|
308
|
+
sideEffects?: BindingHookSideEffects;
|
|
328
309
|
}
|
|
329
310
|
declare enum BindingHookSideEffects {
|
|
330
311
|
True = 0,
|
|
331
312
|
False = 1,
|
|
332
|
-
NoTreeshake = 2
|
|
313
|
+
NoTreeshake = 2,
|
|
333
314
|
}
|
|
334
315
|
interface BindingHookTransformOutput {
|
|
335
|
-
code?: string
|
|
336
|
-
sideEffects?: BindingHookSideEffects
|
|
337
|
-
map?: BindingSourcemap
|
|
338
|
-
moduleType?: string
|
|
316
|
+
code?: string;
|
|
317
|
+
sideEffects?: BindingHookSideEffects;
|
|
318
|
+
map?: BindingSourcemap;
|
|
319
|
+
moduleType?: string;
|
|
339
320
|
}
|
|
340
321
|
interface BindingImportGlobPluginConfig {
|
|
341
|
-
root?: string
|
|
342
|
-
restoreQueryExtension?: boolean
|
|
322
|
+
root?: string;
|
|
323
|
+
restoreQueryExtension?: boolean;
|
|
343
324
|
}
|
|
344
325
|
interface BindingInjectImportNamed {
|
|
345
|
-
tagNamed: true
|
|
346
|
-
imported: string
|
|
347
|
-
alias?: string
|
|
348
|
-
from: string
|
|
326
|
+
tagNamed: true;
|
|
327
|
+
imported: string;
|
|
328
|
+
alias?: string;
|
|
329
|
+
from: string;
|
|
349
330
|
}
|
|
350
331
|
interface BindingInjectImportNamespace {
|
|
351
|
-
tagNamespace: true
|
|
352
|
-
alias: string
|
|
353
|
-
from: string
|
|
332
|
+
tagNamespace: true;
|
|
333
|
+
alias: string;
|
|
334
|
+
from: string;
|
|
354
335
|
}
|
|
355
336
|
interface BindingInputItem {
|
|
356
|
-
name?: string
|
|
357
|
-
import: string
|
|
337
|
+
name?: string;
|
|
338
|
+
import: string;
|
|
358
339
|
}
|
|
359
340
|
interface BindingInputOptions {
|
|
360
|
-
external?: undefined | ((source: string, importer: string | undefined, isResolved: boolean) => boolean)
|
|
361
|
-
input: Array<BindingInputItem
|
|
362
|
-
plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[]
|
|
363
|
-
resolve?: BindingResolveOptions
|
|
364
|
-
shimMissingExports?: boolean
|
|
365
|
-
platform?: 'node' | 'browser' | 'neutral'
|
|
366
|
-
logLevel: BindingLogLevel
|
|
367
|
-
onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void
|
|
368
|
-
cwd: string
|
|
369
|
-
treeshake?: BindingTreeshake
|
|
370
|
-
moduleTypes?: Record<string, string
|
|
371
|
-
define?: Array<[string, string]
|
|
372
|
-
dropLabels?: Array<string
|
|
373
|
-
inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace
|
|
374
|
-
experimental?: BindingExperimentalOptions
|
|
375
|
-
profilerNames?: boolean
|
|
376
|
-
jsx?: BindingJsx
|
|
377
|
-
transform?: TransformOptions
|
|
378
|
-
watch?: BindingWatchOption
|
|
379
|
-
keepNames?: boolean
|
|
380
|
-
checks?: BindingChecksOptions
|
|
381
|
-
deferSyncScanData?: undefined | (() => BindingDeferSyncScanData[])
|
|
382
|
-
makeAbsoluteExternalsRelative?: BindingMakeAbsoluteExternalsRelative
|
|
383
|
-
debug?: BindingDebugOptions
|
|
384
|
-
invalidateJsSideCache?: () => void
|
|
385
|
-
markModuleLoaded?: (id: string, success: boolean) => void
|
|
341
|
+
external?: undefined | ((source: string, importer: string | undefined, isResolved: boolean) => boolean);
|
|
342
|
+
input: Array<BindingInputItem>;
|
|
343
|
+
plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[];
|
|
344
|
+
resolve?: BindingResolveOptions;
|
|
345
|
+
shimMissingExports?: boolean;
|
|
346
|
+
platform?: 'node' | 'browser' | 'neutral';
|
|
347
|
+
logLevel: BindingLogLevel;
|
|
348
|
+
onLog: (logLevel: 'debug' | 'warn' | 'info', log: BindingLog) => void;
|
|
349
|
+
cwd: string;
|
|
350
|
+
treeshake?: BindingTreeshake;
|
|
351
|
+
moduleTypes?: Record<string, string>;
|
|
352
|
+
define?: Array<[string, string]>;
|
|
353
|
+
dropLabels?: Array<string>;
|
|
354
|
+
inject?: Array<BindingInjectImportNamed | BindingInjectImportNamespace>;
|
|
355
|
+
experimental?: BindingExperimentalOptions;
|
|
356
|
+
profilerNames?: boolean;
|
|
357
|
+
jsx?: BindingJsx;
|
|
358
|
+
transform?: TransformOptions;
|
|
359
|
+
watch?: BindingWatchOption;
|
|
360
|
+
keepNames?: boolean;
|
|
361
|
+
checks?: BindingChecksOptions;
|
|
362
|
+
deferSyncScanData?: undefined | (() => BindingDeferSyncScanData[]);
|
|
363
|
+
makeAbsoluteExternalsRelative?: BindingMakeAbsoluteExternalsRelative;
|
|
364
|
+
debug?: BindingDebugOptions;
|
|
365
|
+
invalidateJsSideCache?: () => void;
|
|
366
|
+
markModuleLoaded?: (id: string, success: boolean) => void;
|
|
386
367
|
}
|
|
387
368
|
interface BindingIsolatedDeclarationPluginConfig {
|
|
388
|
-
stripInternal?: boolean
|
|
369
|
+
stripInternal?: boolean;
|
|
389
370
|
}
|
|
390
371
|
interface BindingJsonPluginConfig {
|
|
391
|
-
minify?: boolean
|
|
392
|
-
namedExports?: boolean
|
|
393
|
-
stringify?: BindingJsonPluginStringify
|
|
372
|
+
minify?: boolean;
|
|
373
|
+
namedExports?: boolean;
|
|
374
|
+
stringify?: BindingJsonPluginStringify;
|
|
394
375
|
}
|
|
395
|
-
type BindingJsonPluginStringify =
|
|
396
|
-
boolean | string
|
|
376
|
+
type BindingJsonPluginStringify = boolean | string;
|
|
397
377
|
interface BindingJsonSourcemap {
|
|
398
|
-
file?: string
|
|
399
|
-
mappings?: string
|
|
400
|
-
sourceRoot?: string
|
|
401
|
-
sources?: Array<string | undefined | null
|
|
402
|
-
sourcesContent?: Array<string | undefined | null
|
|
403
|
-
names?: Array<string
|
|
404
|
-
debugId?: string
|
|
405
|
-
x_google_ignoreList?: Array<number
|
|
378
|
+
file?: string;
|
|
379
|
+
mappings?: string;
|
|
380
|
+
sourceRoot?: string;
|
|
381
|
+
sources?: Array<string | undefined | null>;
|
|
382
|
+
sourcesContent?: Array<string | undefined | null>;
|
|
383
|
+
names?: Array<string>;
|
|
384
|
+
debugId?: string;
|
|
385
|
+
x_google_ignoreList?: Array<number>;
|
|
406
386
|
}
|
|
407
387
|
declare enum BindingJsx {
|
|
408
388
|
Disable = 0,
|
|
409
389
|
Preserve = 1,
|
|
410
390
|
React = 2,
|
|
411
|
-
ReactJsx = 3
|
|
391
|
+
ReactJsx = 3,
|
|
412
392
|
}
|
|
413
393
|
interface BindingLog {
|
|
414
|
-
code: string
|
|
415
|
-
message: string
|
|
416
|
-
id?: string
|
|
417
|
-
exporter?: string
|
|
394
|
+
code: string;
|
|
395
|
+
message: string;
|
|
396
|
+
id?: string;
|
|
397
|
+
exporter?: string;
|
|
418
398
|
}
|
|
419
399
|
declare enum BindingLogLevel {
|
|
420
400
|
Silent = 0,
|
|
421
401
|
Warn = 1,
|
|
422
402
|
Info = 2,
|
|
423
|
-
Debug = 3
|
|
424
|
-
}
|
|
425
|
-
type BindingMakeAbsoluteExternalsRelative =
|
|
426
|
-
|
|
427
|
-
|
|
403
|
+
Debug = 3,
|
|
404
|
+
}
|
|
405
|
+
type BindingMakeAbsoluteExternalsRelative = {
|
|
406
|
+
type: 'Bool';
|
|
407
|
+
field0: boolean;
|
|
408
|
+
} | {
|
|
409
|
+
type: 'IfRelativeSource';
|
|
410
|
+
};
|
|
428
411
|
interface BindingManifestPluginConfig {
|
|
429
|
-
root: string
|
|
430
|
-
outPath: string
|
|
412
|
+
root: string;
|
|
413
|
+
outPath: string;
|
|
431
414
|
}
|
|
432
415
|
interface BindingMatchGroup {
|
|
433
|
-
name: string
|
|
434
|
-
test?: string | RegExp | ((id: string) => VoidNullable<boolean>)
|
|
435
|
-
priority?: number
|
|
436
|
-
minSize?: number
|
|
437
|
-
minShareCount?: number
|
|
438
|
-
minModuleSize?: number
|
|
439
|
-
maxModuleSize?: number
|
|
440
|
-
maxSize?: number
|
|
416
|
+
name: string;
|
|
417
|
+
test?: string | RegExp | ((id: string) => VoidNullable<boolean>);
|
|
418
|
+
priority?: number;
|
|
419
|
+
minSize?: number;
|
|
420
|
+
minShareCount?: number;
|
|
421
|
+
minModuleSize?: number;
|
|
422
|
+
maxModuleSize?: number;
|
|
423
|
+
maxSize?: number;
|
|
441
424
|
}
|
|
442
425
|
interface BindingMfManifest {
|
|
443
|
-
filePath?: string
|
|
444
|
-
disableAssetsAnalyze?: boolean
|
|
445
|
-
fileName?: string
|
|
426
|
+
filePath?: string;
|
|
427
|
+
disableAssetsAnalyze?: boolean;
|
|
428
|
+
fileName?: string;
|
|
446
429
|
}
|
|
447
430
|
interface BindingMinifyOptions {
|
|
448
|
-
mangle?: boolean
|
|
449
|
-
compress?: boolean
|
|
450
|
-
removeWhitespace?: boolean
|
|
431
|
+
mangle?: boolean;
|
|
432
|
+
compress?: boolean;
|
|
433
|
+
removeWhitespace?: boolean;
|
|
451
434
|
}
|
|
452
435
|
interface BindingModuleFederationPluginOption {
|
|
453
|
-
name: string
|
|
454
|
-
filename?: string
|
|
455
|
-
exposes?: Record<string, string
|
|
456
|
-
remotes?: Array<BindingRemote
|
|
457
|
-
shared?: Record<string, BindingShared
|
|
458
|
-
runtimePlugins?: Array<string
|
|
459
|
-
manifest?: BindingMfManifest
|
|
460
|
-
getPublicPath?: string
|
|
436
|
+
name: string;
|
|
437
|
+
filename?: string;
|
|
438
|
+
exposes?: Record<string, string>;
|
|
439
|
+
remotes?: Array<BindingRemote>;
|
|
440
|
+
shared?: Record<string, BindingShared>;
|
|
441
|
+
runtimePlugins?: Array<string>;
|
|
442
|
+
manifest?: BindingMfManifest;
|
|
443
|
+
getPublicPath?: string;
|
|
461
444
|
}
|
|
462
445
|
interface BindingModules {
|
|
463
|
-
values: Array<BindingRenderedModule
|
|
464
|
-
keys: Array<string
|
|
446
|
+
values: Array<BindingRenderedModule>;
|
|
447
|
+
keys: Array<string>;
|
|
465
448
|
}
|
|
466
449
|
interface BindingModuleSideEffectsRule {
|
|
467
|
-
test?: RegExp | undefined
|
|
468
|
-
sideEffects: boolean
|
|
469
|
-
external?: boolean | undefined
|
|
450
|
+
test?: RegExp | undefined;
|
|
451
|
+
sideEffects: boolean;
|
|
452
|
+
external?: boolean | undefined;
|
|
470
453
|
}
|
|
471
454
|
interface BindingOutputOptions {
|
|
472
|
-
name?: string
|
|
473
|
-
assetFileNames?: string | ((chunk: BindingPreRenderedAsset) => string)
|
|
474
|
-
entryFileNames?: string | ((chunk: PreRenderedChunk) => string)
|
|
475
|
-
chunkFileNames?: string | ((chunk: PreRenderedChunk) => string)
|
|
476
|
-
cssEntryFileNames?: string | ((chunk: PreRenderedChunk) => string)
|
|
477
|
-
cssChunkFileNames?: string | ((chunk: PreRenderedChunk) => string)
|
|
478
|
-
sanitizeFileName?: boolean | ((name: string) => string)
|
|
479
|
-
banner?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string
|
|
480
|
-
dir?: string
|
|
481
|
-
file?: string
|
|
482
|
-
esModule?: boolean | 'if-default-prop'
|
|
483
|
-
exports?: 'default' | 'named' | 'none' | 'auto'
|
|
484
|
-
extend?: boolean
|
|
485
|
-
externalLiveBindings?: boolean
|
|
486
|
-
footer?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string
|
|
487
|
-
format?: 'es' | 'cjs' | 'iife' | 'umd' | 'app'
|
|
488
|
-
globals?: Record<string, string> | ((name: string) => string)
|
|
489
|
-
hashCharacters?: 'base64' | 'base36' | 'hex'
|
|
490
|
-
inlineDynamicImports?: boolean
|
|
491
|
-
intro?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string
|
|
492
|
-
outro?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string
|
|
493
|
-
plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[]
|
|
494
|
-
sourcemap?: 'file' | 'inline' | 'hidden'
|
|
495
|
-
sourcemapIgnoreList?: (source: string, sourcemapPath: string) => boolean
|
|
496
|
-
sourcemapDebugIds?: boolean
|
|
497
|
-
sourcemapPathTransform?: (source: string, sourcemapPath: string) => string
|
|
498
|
-
minify?: boolean | 'dce-only' | BindingMinifyOptions
|
|
499
|
-
advancedChunks?: BindingAdvancedChunksOptions
|
|
500
|
-
legalComments?: 'none' | 'inline'
|
|
501
|
-
polyfillRequire?: boolean
|
|
502
|
-
preserveModules?: boolean
|
|
503
|
-
virtualDirname?: string
|
|
504
|
-
preserveModulesRoot?: string
|
|
505
|
-
preserveEntrySignatures?: 'strict' | 'allow-extension' | 'exports-only' | false
|
|
455
|
+
name?: string;
|
|
456
|
+
assetFileNames?: string | ((chunk: BindingPreRenderedAsset) => string);
|
|
457
|
+
entryFileNames?: string | ((chunk: PreRenderedChunk) => string);
|
|
458
|
+
chunkFileNames?: string | ((chunk: PreRenderedChunk) => string);
|
|
459
|
+
cssEntryFileNames?: string | ((chunk: PreRenderedChunk) => string);
|
|
460
|
+
cssChunkFileNames?: string | ((chunk: PreRenderedChunk) => string);
|
|
461
|
+
sanitizeFileName?: boolean | ((name: string) => string);
|
|
462
|
+
banner?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string>>;
|
|
463
|
+
dir?: string;
|
|
464
|
+
file?: string;
|
|
465
|
+
esModule?: boolean | 'if-default-prop';
|
|
466
|
+
exports?: 'default' | 'named' | 'none' | 'auto';
|
|
467
|
+
extend?: boolean;
|
|
468
|
+
externalLiveBindings?: boolean;
|
|
469
|
+
footer?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string>>;
|
|
470
|
+
format?: 'es' | 'cjs' | 'iife' | 'umd' | 'app';
|
|
471
|
+
globals?: Record<string, string> | ((name: string) => string);
|
|
472
|
+
hashCharacters?: 'base64' | 'base36' | 'hex';
|
|
473
|
+
inlineDynamicImports?: boolean;
|
|
474
|
+
intro?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string>>;
|
|
475
|
+
outro?: (chunk: BindingRenderedChunk) => MaybePromise<VoidNullable<string>>;
|
|
476
|
+
plugins: (BindingBuiltinPlugin | BindingPluginOptions | undefined)[];
|
|
477
|
+
sourcemap?: 'file' | 'inline' | 'hidden';
|
|
478
|
+
sourcemapIgnoreList?: (source: string, sourcemapPath: string) => boolean;
|
|
479
|
+
sourcemapDebugIds?: boolean;
|
|
480
|
+
sourcemapPathTransform?: (source: string, sourcemapPath: string) => string;
|
|
481
|
+
minify?: boolean | 'dce-only' | BindingMinifyOptions;
|
|
482
|
+
advancedChunks?: BindingAdvancedChunksOptions;
|
|
483
|
+
legalComments?: 'none' | 'inline';
|
|
484
|
+
polyfillRequire?: boolean;
|
|
485
|
+
preserveModules?: boolean;
|
|
486
|
+
virtualDirname?: string;
|
|
487
|
+
preserveModulesRoot?: string;
|
|
488
|
+
preserveEntrySignatures?: 'strict' | 'allow-extension' | 'exports-only' | false;
|
|
506
489
|
}
|
|
507
490
|
interface BindingPluginContextResolvedId {
|
|
508
|
-
id: string
|
|
509
|
-
external: boolean | 'absolute' | 'relative'
|
|
491
|
+
id: string;
|
|
492
|
+
external: boolean | 'absolute' | 'relative';
|
|
510
493
|
}
|
|
511
494
|
interface BindingPluginContextResolveOptions {
|
|
512
495
|
/**
|
|
@@ -518,180 +501,179 @@ interface BindingPluginContextResolveOptions {
|
|
|
518
501
|
* - `new-url`: `new URL('./worker.js', import.meta.url)`
|
|
519
502
|
* - `hot-accept`: `import.meta.hot.accept('./lib.js', () => {})`
|
|
520
503
|
*/
|
|
521
|
-
importKind?: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept'
|
|
522
|
-
skipSelf?: boolean
|
|
523
|
-
custom?: number
|
|
504
|
+
importKind?: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept';
|
|
505
|
+
skipSelf?: boolean;
|
|
506
|
+
custom?: number;
|
|
524
507
|
}
|
|
525
508
|
interface BindingPluginHookMeta {
|
|
526
|
-
order?: BindingPluginOrder
|
|
509
|
+
order?: BindingPluginOrder;
|
|
527
510
|
}
|
|
528
511
|
interface BindingPluginOptions {
|
|
529
|
-
name: string
|
|
530
|
-
hookUsage: number
|
|
531
|
-
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable
|
|
532
|
-
buildStartMeta?: BindingPluginHookMeta
|
|
533
|
-
resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput
|
|
534
|
-
resolveIdMeta?: BindingPluginHookMeta
|
|
535
|
-
resolveIdFilter?: BindingHookFilter
|
|
536
|
-
resolveDynamicImport?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>) => MaybePromise<VoidNullable<BindingHookResolveIdOutput
|
|
537
|
-
resolveDynamicImportMeta?: BindingPluginHookMeta
|
|
538
|
-
load?: (ctx: BindingPluginContext, id: string) => MaybePromise<VoidNullable<BindingHookLoadOutput
|
|
539
|
-
loadMeta?: BindingPluginHookMeta
|
|
540
|
-
loadFilter?: BindingHookFilter
|
|
541
|
-
transform?: (ctx:
|
|
542
|
-
transformMeta?: BindingPluginHookMeta
|
|
543
|
-
transformFilter?: BindingHookFilter
|
|
544
|
-
moduleParsed?: (ctx: BindingPluginContext, module: BindingModuleInfo) => MaybePromise<VoidNullable
|
|
545
|
-
moduleParsedMeta?: BindingPluginHookMeta
|
|
546
|
-
buildEnd?: (ctx: BindingPluginContext, error?: (Error | BindingError)[]) => MaybePromise<VoidNullable
|
|
547
|
-
buildEndMeta?: BindingPluginHookMeta
|
|
548
|
-
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: BindingRenderedChunk, opts: BindingNormalizedOptions, meta: BindingRenderedChunkMeta) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput
|
|
549
|
-
renderChunkMeta?: BindingPluginHookMeta
|
|
550
|
-
renderChunkFilter?: BindingHookFilter
|
|
551
|
-
augmentChunkHash?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => MaybePromise<void | string
|
|
552
|
-
augmentChunkHashMeta?: BindingPluginHookMeta
|
|
553
|
-
renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void
|
|
554
|
-
renderStartMeta?: BindingPluginHookMeta
|
|
555
|
-
renderError?: (ctx: BindingPluginContext, error: (Error | BindingError)[]) => void
|
|
556
|
-
renderErrorMeta?: BindingPluginHookMeta
|
|
557
|
-
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs
|
|
558
|
-
generateBundleMeta?: BindingPluginHookMeta
|
|
559
|
-
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs
|
|
560
|
-
writeBundleMeta?: BindingPluginHookMeta
|
|
561
|
-
closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable
|
|
562
|
-
closeBundleMeta?: BindingPluginHookMeta
|
|
563
|
-
watchChange?: (ctx: BindingPluginContext, path: string, event: string) => MaybePromise<VoidNullable
|
|
564
|
-
watchChangeMeta?: BindingPluginHookMeta
|
|
565
|
-
closeWatcher?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable
|
|
566
|
-
closeWatcherMeta?: BindingPluginHookMeta
|
|
567
|
-
banner?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void
|
|
568
|
-
bannerMeta?: BindingPluginHookMeta
|
|
569
|
-
footer?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void
|
|
570
|
-
footerMeta?: BindingPluginHookMeta
|
|
571
|
-
intro?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void
|
|
572
|
-
introMeta?: BindingPluginHookMeta
|
|
573
|
-
outro?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void
|
|
574
|
-
outroMeta?: BindingPluginHookMeta
|
|
512
|
+
name: string;
|
|
513
|
+
hookUsage: number;
|
|
514
|
+
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable>;
|
|
515
|
+
buildStartMeta?: BindingPluginHookMeta;
|
|
516
|
+
resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>;
|
|
517
|
+
resolveIdMeta?: BindingPluginHookMeta;
|
|
518
|
+
resolveIdFilter?: BindingHookFilter;
|
|
519
|
+
resolveDynamicImport?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>;
|
|
520
|
+
resolveDynamicImportMeta?: BindingPluginHookMeta;
|
|
521
|
+
load?: (ctx: BindingPluginContext, id: string) => MaybePromise<VoidNullable<BindingHookLoadOutput>>;
|
|
522
|
+
loadMeta?: BindingPluginHookMeta;
|
|
523
|
+
loadFilter?: BindingHookFilter;
|
|
524
|
+
transform?: (ctx: BindingTransformPluginContext, id: string, code: string, module_type: BindingTransformHookExtraArgs) => MaybePromise<VoidNullable<BindingHookTransformOutput>>;
|
|
525
|
+
transformMeta?: BindingPluginHookMeta;
|
|
526
|
+
transformFilter?: BindingHookFilter;
|
|
527
|
+
moduleParsed?: (ctx: BindingPluginContext, module: BindingModuleInfo) => MaybePromise<VoidNullable>;
|
|
528
|
+
moduleParsedMeta?: BindingPluginHookMeta;
|
|
529
|
+
buildEnd?: (ctx: BindingPluginContext, error?: (Error | BindingError)[]) => MaybePromise<VoidNullable>;
|
|
530
|
+
buildEndMeta?: BindingPluginHookMeta;
|
|
531
|
+
renderChunk?: (ctx: BindingPluginContext, code: string, chunk: BindingRenderedChunk, opts: BindingNormalizedOptions, meta: BindingRenderedChunkMeta) => MaybePromise<VoidNullable<BindingHookRenderChunkOutput>>;
|
|
532
|
+
renderChunkMeta?: BindingPluginHookMeta;
|
|
533
|
+
renderChunkFilter?: BindingHookFilter;
|
|
534
|
+
augmentChunkHash?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => MaybePromise<void | string>;
|
|
535
|
+
augmentChunkHashMeta?: BindingPluginHookMeta;
|
|
536
|
+
renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void;
|
|
537
|
+
renderStartMeta?: BindingPluginHookMeta;
|
|
538
|
+
renderError?: (ctx: BindingPluginContext, error: (Error | BindingError)[]) => void;
|
|
539
|
+
renderErrorMeta?: BindingPluginHookMeta;
|
|
540
|
+
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>>;
|
|
541
|
+
generateBundleMeta?: BindingPluginHookMeta;
|
|
542
|
+
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>>;
|
|
543
|
+
writeBundleMeta?: BindingPluginHookMeta;
|
|
544
|
+
closeBundle?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>;
|
|
545
|
+
closeBundleMeta?: BindingPluginHookMeta;
|
|
546
|
+
watchChange?: (ctx: BindingPluginContext, path: string, event: string) => MaybePromise<VoidNullable>;
|
|
547
|
+
watchChangeMeta?: BindingPluginHookMeta;
|
|
548
|
+
closeWatcher?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>;
|
|
549
|
+
closeWatcherMeta?: BindingPluginHookMeta;
|
|
550
|
+
banner?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void;
|
|
551
|
+
bannerMeta?: BindingPluginHookMeta;
|
|
552
|
+
footer?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void;
|
|
553
|
+
footerMeta?: BindingPluginHookMeta;
|
|
554
|
+
intro?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void;
|
|
555
|
+
introMeta?: BindingPluginHookMeta;
|
|
556
|
+
outro?: (ctx: BindingPluginContext, chunk: BindingRenderedChunk) => void;
|
|
557
|
+
outroMeta?: BindingPluginHookMeta;
|
|
575
558
|
}
|
|
576
559
|
declare enum BindingPluginOrder {
|
|
577
560
|
Pre = 0,
|
|
578
|
-
Post = 1
|
|
561
|
+
Post = 1,
|
|
579
562
|
}
|
|
580
563
|
interface BindingPreRenderedAsset {
|
|
581
|
-
names: Array<string
|
|
582
|
-
originalFileNames: Array<string
|
|
583
|
-
source: BindingAssetSource
|
|
564
|
+
names: Array<string>;
|
|
565
|
+
originalFileNames: Array<string>;
|
|
566
|
+
source: BindingAssetSource;
|
|
584
567
|
}
|
|
585
568
|
interface BindingRemote {
|
|
586
|
-
type?: string
|
|
587
|
-
entry: string
|
|
588
|
-
name: string
|
|
589
|
-
entryGlobalName?: string
|
|
590
|
-
shareScope?: string
|
|
569
|
+
type?: string;
|
|
570
|
+
entry: string;
|
|
571
|
+
name: string;
|
|
572
|
+
entryGlobalName?: string;
|
|
573
|
+
shareScope?: string;
|
|
591
574
|
}
|
|
592
575
|
interface BindingReplacePluginConfig {
|
|
593
|
-
values: Record<string, string
|
|
594
|
-
delimiters?: [string, string]
|
|
595
|
-
preventAssignment?: boolean
|
|
596
|
-
objectGuards?: boolean
|
|
597
|
-
sourcemap?: boolean
|
|
576
|
+
values: Record<string, string>;
|
|
577
|
+
delimiters?: [string, string];
|
|
578
|
+
preventAssignment?: boolean;
|
|
579
|
+
objectGuards?: boolean;
|
|
580
|
+
sourcemap?: boolean;
|
|
598
581
|
}
|
|
599
582
|
interface BindingReporterPluginConfig {
|
|
600
|
-
isTty: boolean
|
|
601
|
-
isLib: boolean
|
|
602
|
-
assetsDir: string
|
|
603
|
-
chunkLimit: number
|
|
604
|
-
shouldLogInfo: boolean
|
|
605
|
-
reportCompressedSize: boolean
|
|
606
|
-
}
|
|
607
|
-
type BindingResolvedExternal =
|
|
608
|
-
boolean | string
|
|
583
|
+
isTty: boolean;
|
|
584
|
+
isLib: boolean;
|
|
585
|
+
assetsDir: string;
|
|
586
|
+
chunkLimit: number;
|
|
587
|
+
shouldLogInfo: boolean;
|
|
588
|
+
reportCompressedSize: boolean;
|
|
589
|
+
}
|
|
590
|
+
type BindingResolvedExternal = boolean | string;
|
|
609
591
|
interface BindingResolveOptions {
|
|
610
|
-
alias?: Array<AliasItem
|
|
611
|
-
aliasFields?: Array<Array<string
|
|
612
|
-
conditionNames?: Array<string
|
|
613
|
-
exportsFields?: Array<Array<string
|
|
614
|
-
extensions?: Array<string
|
|
615
|
-
extensionAlias?: Array<ExtensionAliasItem
|
|
616
|
-
mainFields?: Array<string
|
|
617
|
-
mainFiles?: Array<string
|
|
618
|
-
modules?: Array<string
|
|
619
|
-
symlinks?: boolean
|
|
620
|
-
tsconfigFilename?: string
|
|
592
|
+
alias?: Array<AliasItem>;
|
|
593
|
+
aliasFields?: Array<Array<string>>;
|
|
594
|
+
conditionNames?: Array<string>;
|
|
595
|
+
exportsFields?: Array<Array<string>>;
|
|
596
|
+
extensions?: Array<string>;
|
|
597
|
+
extensionAlias?: Array<ExtensionAliasItem>;
|
|
598
|
+
mainFields?: Array<string>;
|
|
599
|
+
mainFiles?: Array<string>;
|
|
600
|
+
modules?: Array<string>;
|
|
601
|
+
symlinks?: boolean;
|
|
602
|
+
tsconfigFilename?: string;
|
|
621
603
|
}
|
|
622
604
|
interface BindingShared {
|
|
623
|
-
version?: string
|
|
624
|
-
shareScope?: string
|
|
625
|
-
singleton?: boolean
|
|
626
|
-
requiredVersion?: string
|
|
627
|
-
strictVersion?: boolean
|
|
605
|
+
version?: string;
|
|
606
|
+
shareScope?: string;
|
|
607
|
+
singleton?: boolean;
|
|
608
|
+
requiredVersion?: string;
|
|
609
|
+
strictVersion?: boolean;
|
|
628
610
|
}
|
|
629
611
|
interface BindingSourcemap {
|
|
630
|
-
inner: string | BindingJsonSourcemap
|
|
612
|
+
inner: string | BindingJsonSourcemap;
|
|
631
613
|
}
|
|
632
614
|
interface BindingTransformHookExtraArgs {
|
|
633
|
-
moduleType: string
|
|
615
|
+
moduleType: string;
|
|
634
616
|
}
|
|
635
617
|
interface BindingTransformPluginConfig {
|
|
636
|
-
include?: Array<BindingStringOrRegex
|
|
637
|
-
exclude?: Array<BindingStringOrRegex
|
|
638
|
-
jsxRefreshInclude?: Array<BindingStringOrRegex
|
|
639
|
-
jsxRefreshExclude?: Array<BindingStringOrRegex
|
|
640
|
-
isServerConsumer?: boolean
|
|
641
|
-
runtimeResolveBase?: string
|
|
642
|
-
jsxInject?: string
|
|
643
|
-
transformOptions?: TransformOptions
|
|
618
|
+
include?: Array<BindingStringOrRegex>;
|
|
619
|
+
exclude?: Array<BindingStringOrRegex>;
|
|
620
|
+
jsxRefreshInclude?: Array<BindingStringOrRegex>;
|
|
621
|
+
jsxRefreshExclude?: Array<BindingStringOrRegex>;
|
|
622
|
+
isServerConsumer?: boolean;
|
|
623
|
+
runtimeResolveBase?: string;
|
|
624
|
+
jsxInject?: string;
|
|
625
|
+
transformOptions?: TransformOptions;
|
|
644
626
|
}
|
|
645
627
|
interface BindingTreeshake {
|
|
646
|
-
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined)
|
|
647
|
-
annotations?: boolean
|
|
648
|
-
manualPureFunctions?: Array<string
|
|
649
|
-
unknownGlobalSideEffects?: boolean
|
|
628
|
+
moduleSideEffects: boolean | BindingModuleSideEffectsRule[] | ((id: string, is_external: boolean) => boolean | undefined);
|
|
629
|
+
annotations?: boolean;
|
|
630
|
+
manualPureFunctions?: Array<string>;
|
|
631
|
+
unknownGlobalSideEffects?: boolean;
|
|
650
632
|
}
|
|
651
633
|
interface BindingViteResolvePluginConfig {
|
|
652
|
-
resolveOptions: BindingViteResolvePluginResolveOptions
|
|
653
|
-
environmentConsumer: string
|
|
654
|
-
environmentName: string
|
|
655
|
-
builtins: Array<BindingStringOrRegex
|
|
656
|
-
external: true | string[]
|
|
657
|
-
noExternal: true | Array<string | RegExp
|
|
658
|
-
dedupe: Array<string
|
|
659
|
-
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string
|
|
660
|
-
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string
|
|
634
|
+
resolveOptions: BindingViteResolvePluginResolveOptions;
|
|
635
|
+
environmentConsumer: string;
|
|
636
|
+
environmentName: string;
|
|
637
|
+
builtins: Array<BindingStringOrRegex>;
|
|
638
|
+
external: true | string[];
|
|
639
|
+
noExternal: true | Array<string | RegExp>;
|
|
640
|
+
dedupe: Array<string>;
|
|
641
|
+
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>;
|
|
642
|
+
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>;
|
|
661
643
|
}
|
|
662
644
|
interface BindingViteResolvePluginResolveOptions {
|
|
663
|
-
isBuild: boolean
|
|
664
|
-
isProduction: boolean
|
|
665
|
-
asSrc: boolean
|
|
666
|
-
preferRelative: boolean
|
|
667
|
-
isRequire?: boolean
|
|
668
|
-
root: string
|
|
669
|
-
scan: boolean
|
|
670
|
-
mainFields: Array<string
|
|
671
|
-
conditions: Array<string
|
|
672
|
-
externalConditions: Array<string
|
|
673
|
-
extensions: Array<string
|
|
674
|
-
tryIndex: boolean
|
|
675
|
-
tryPrefix?: string
|
|
676
|
-
preserveSymlinks: boolean
|
|
645
|
+
isBuild: boolean;
|
|
646
|
+
isProduction: boolean;
|
|
647
|
+
asSrc: boolean;
|
|
648
|
+
preferRelative: boolean;
|
|
649
|
+
isRequire?: boolean;
|
|
650
|
+
root: string;
|
|
651
|
+
scan: boolean;
|
|
652
|
+
mainFields: Array<string>;
|
|
653
|
+
conditions: Array<string>;
|
|
654
|
+
externalConditions: Array<string>;
|
|
655
|
+
extensions: Array<string>;
|
|
656
|
+
tryIndex: boolean;
|
|
657
|
+
tryPrefix?: string;
|
|
658
|
+
preserveSymlinks: boolean;
|
|
677
659
|
}
|
|
678
660
|
interface BindingWatchOption {
|
|
679
|
-
skipWrite?: boolean
|
|
680
|
-
include?: Array<BindingStringOrRegex
|
|
681
|
-
exclude?: Array<BindingStringOrRegex
|
|
682
|
-
buildDelay?: number
|
|
661
|
+
skipWrite?: boolean;
|
|
662
|
+
include?: Array<BindingStringOrRegex>;
|
|
663
|
+
exclude?: Array<BindingStringOrRegex>;
|
|
664
|
+
buildDelay?: number;
|
|
683
665
|
}
|
|
684
666
|
interface Comment {
|
|
685
|
-
type: 'Line' | 'Block'
|
|
686
|
-
value: string
|
|
687
|
-
start: number
|
|
688
|
-
end: number
|
|
667
|
+
type: 'Line' | 'Block';
|
|
668
|
+
value: string;
|
|
669
|
+
start: number;
|
|
670
|
+
end: number;
|
|
689
671
|
}
|
|
690
672
|
interface CompilerAssumptions {
|
|
691
|
-
ignoreFunctionLength?: boolean
|
|
692
|
-
noDocumentAll?: boolean
|
|
693
|
-
objectRestNoSymbols?: boolean
|
|
694
|
-
pureGetters?: boolean
|
|
673
|
+
ignoreFunctionLength?: boolean;
|
|
674
|
+
noDocumentAll?: boolean;
|
|
675
|
+
objectRestNoSymbols?: boolean;
|
|
676
|
+
pureGetters?: boolean;
|
|
695
677
|
/**
|
|
696
678
|
* When using public class fields, assume that they don't shadow any getter in the current class,
|
|
697
679
|
* in its subclasses or in its superclass. Thus, it's safe to assign them rather than using
|
|
@@ -733,7 +715,7 @@ interface CompilerAssumptions {
|
|
|
733
715
|
* set both `set_public_class_fields` and [`crate::TypeScriptOptions::remove_class_fields_without_initializer`]
|
|
734
716
|
* to `true`.
|
|
735
717
|
*/
|
|
736
|
-
setPublicClassFields?: boolean
|
|
718
|
+
setPublicClassFields?: boolean;
|
|
737
719
|
}
|
|
738
720
|
interface DecoratorOptions {
|
|
739
721
|
/**
|
|
@@ -745,7 +727,7 @@ interface DecoratorOptions {
|
|
|
745
727
|
* @see https://www.typescriptlang.org/tsconfig/#experimentalDecorators
|
|
746
728
|
* @default false
|
|
747
729
|
*/
|
|
748
|
-
legacy?: boolean
|
|
730
|
+
legacy?: boolean;
|
|
749
731
|
/**
|
|
750
732
|
* Enables emitting decorator metadata.
|
|
751
733
|
*
|
|
@@ -755,12 +737,12 @@ interface DecoratorOptions {
|
|
|
755
737
|
* @see https://www.typescriptlang.org/tsconfig/#emitDecoratorMetadata
|
|
756
738
|
* @default false
|
|
757
739
|
*/
|
|
758
|
-
emitDecoratorMetadata?: boolean
|
|
740
|
+
emitDecoratorMetadata?: boolean;
|
|
759
741
|
}
|
|
760
742
|
interface DynamicImport {
|
|
761
|
-
start: number
|
|
762
|
-
end: number
|
|
763
|
-
moduleRequest: Span
|
|
743
|
+
start: number;
|
|
744
|
+
end: number;
|
|
745
|
+
moduleRequest: Span;
|
|
764
746
|
}
|
|
765
747
|
interface EcmaScriptModule {
|
|
766
748
|
/**
|
|
@@ -770,93 +752,86 @@ interface EcmaScriptModule {
|
|
|
770
752
|
*
|
|
771
753
|
* Dynamic imports `import('foo')` are ignored since they can be used in non-ESM files.
|
|
772
754
|
*/
|
|
773
|
-
hasModuleSyntax: boolean
|
|
755
|
+
hasModuleSyntax: boolean;
|
|
774
756
|
/** Import statements. */
|
|
775
|
-
staticImports: Array<StaticImport
|
|
757
|
+
staticImports: Array<StaticImport>;
|
|
776
758
|
/** Export statements. */
|
|
777
|
-
staticExports: Array<StaticExport
|
|
759
|
+
staticExports: Array<StaticExport>;
|
|
778
760
|
/** Dynamic import expressions. */
|
|
779
|
-
dynamicImports: Array<DynamicImport
|
|
761
|
+
dynamicImports: Array<DynamicImport>;
|
|
780
762
|
/** Span positions` of `import.meta` */
|
|
781
|
-
importMetas: Array<Span
|
|
763
|
+
importMetas: Array<Span>;
|
|
782
764
|
}
|
|
783
765
|
declare enum EnforceExtension {
|
|
784
766
|
Auto = 0,
|
|
785
767
|
Enabled = 1,
|
|
786
|
-
Disabled = 2
|
|
768
|
+
Disabled = 2,
|
|
787
769
|
}
|
|
788
770
|
interface ErrorLabel {
|
|
789
|
-
message?: string
|
|
790
|
-
start: number
|
|
791
|
-
end: number
|
|
771
|
+
message?: string;
|
|
772
|
+
start: number;
|
|
773
|
+
end: number;
|
|
792
774
|
}
|
|
793
775
|
interface ExportExportName {
|
|
794
|
-
kind: ExportExportNameKind
|
|
795
|
-
name?: string
|
|
796
|
-
start?: number
|
|
797
|
-
end?: number
|
|
776
|
+
kind: ExportExportNameKind;
|
|
777
|
+
name?: string;
|
|
778
|
+
start?: number;
|
|
779
|
+
end?: number;
|
|
798
780
|
}
|
|
799
781
|
type ExportExportNameKind = /** `export { name } */
|
|
800
|
-
'Name'|
|
|
801
|
-
/** `export
|
|
802
|
-
'Default'|
|
|
803
|
-
/** `export * from "mod" */
|
|
782
|
+
'Name' | /** `export default expression` */
|
|
783
|
+
'Default' | /** `export * from "mod" */
|
|
804
784
|
'None';
|
|
805
785
|
interface ExportImportName {
|
|
806
|
-
kind: ExportImportNameKind
|
|
807
|
-
name?: string
|
|
808
|
-
start?: number
|
|
809
|
-
end?: number
|
|
786
|
+
kind: ExportImportNameKind;
|
|
787
|
+
name?: string;
|
|
788
|
+
start?: number;
|
|
789
|
+
end?: number;
|
|
810
790
|
}
|
|
811
791
|
type ExportImportNameKind = /** `export { name } */
|
|
812
|
-
'Name'|
|
|
813
|
-
/** `export *
|
|
814
|
-
'
|
|
815
|
-
/** `export * from "mod"` */
|
|
816
|
-
'AllButDefault'|
|
|
817
|
-
/** Does not have a specifier. */
|
|
792
|
+
'Name' | /** `export * as ns from "mod"` */
|
|
793
|
+
'All' | /** `export * from "mod"` */
|
|
794
|
+
'AllButDefault' | /** Does not have a specifier. */
|
|
818
795
|
'None';
|
|
819
796
|
interface ExportLocalName {
|
|
820
|
-
kind: ExportLocalNameKind
|
|
821
|
-
name?: string
|
|
822
|
-
start?: number
|
|
823
|
-
end?: number
|
|
797
|
+
kind: ExportLocalNameKind;
|
|
798
|
+
name?: string;
|
|
799
|
+
start?: number;
|
|
800
|
+
end?: number;
|
|
824
801
|
}
|
|
825
802
|
type ExportLocalNameKind = /** `export { name } */
|
|
826
|
-
'Name'|
|
|
827
|
-
|
|
828
|
-
'Default'|
|
|
803
|
+
'Name' | /** `export default expression` */
|
|
804
|
+
'Default' |
|
|
829
805
|
/**
|
|
830
806
|
* If the exported value is not locally accessible from within the module.
|
|
831
807
|
* `export default function () {}`
|
|
832
808
|
*/
|
|
833
809
|
'None';
|
|
834
810
|
interface ExtensionAliasItem {
|
|
835
|
-
target: string
|
|
836
|
-
replacements: Array<string
|
|
837
|
-
}
|
|
838
|
-
type FilterTokenKind =
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
'Or'|
|
|
843
|
-
'Not'|
|
|
844
|
-
'Include'|
|
|
845
|
-
'Exclude'|
|
|
846
|
-
'CleanUrl'|
|
|
847
|
-
'QueryKey'|
|
|
848
|
-
'QueryValue';
|
|
849
|
-
type HelperMode = /**
|
|
850
|
-
* Runtime mode (default): Helper functions are imported from a runtime package.
|
|
851
|
-
*
|
|
852
|
-
* Example:
|
|
811
|
+
target: string;
|
|
812
|
+
replacements: Array<string>;
|
|
813
|
+
}
|
|
814
|
+
type FilterTokenKind = 'Id' | 'Code' | 'ModuleType' | 'And' | 'Or' | 'Not' | 'Include' | 'Exclude' | 'CleanUrl' | 'QueryKey' | 'QueryValue';
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Get offset within a `Uint8Array` which is aligned on 4 GiB.
|
|
853
818
|
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
* helperName(...arguments);
|
|
857
|
-
* ```
|
|
819
|
+
* Does not check that the offset is within bounds of `buffer`.
|
|
820
|
+
* To ensure it always is, provide a `Uint8Array` of at least 4 GiB size.
|
|
858
821
|
*/
|
|
859
|
-
|
|
822
|
+
|
|
823
|
+
type HelperMode =
|
|
824
|
+
/**
|
|
825
|
+
* Runtime mode (default): Helper functions are imported from a runtime package.
|
|
826
|
+
*
|
|
827
|
+
* Example:
|
|
828
|
+
*
|
|
829
|
+
* ```js
|
|
830
|
+
* import helperName from "@oxc-project/runtime/helpers/helperName";
|
|
831
|
+
* helperName(...arguments);
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
'Runtime' |
|
|
860
835
|
/**
|
|
861
836
|
* External mode: Helper functions are accessed from a global `babelHelpers` object.
|
|
862
837
|
*
|
|
@@ -868,23 +843,21 @@ type HelperMode = /**
|
|
|
868
843
|
*/
|
|
869
844
|
'External';
|
|
870
845
|
interface Helpers {
|
|
871
|
-
mode?: HelperMode
|
|
846
|
+
mode?: HelperMode;
|
|
872
847
|
}
|
|
873
848
|
interface ImportName {
|
|
874
|
-
kind: ImportNameKind
|
|
875
|
-
name?: string
|
|
876
|
-
start?: number
|
|
877
|
-
end?: number
|
|
849
|
+
kind: ImportNameKind;
|
|
850
|
+
name?: string;
|
|
851
|
+
start?: number;
|
|
852
|
+
end?: number;
|
|
878
853
|
}
|
|
879
854
|
type ImportNameKind = /** `import { x } from "mod"` */
|
|
880
|
-
'Name'|
|
|
881
|
-
/** `import
|
|
882
|
-
'NamespaceObject'|
|
|
883
|
-
/** `import defaultExport from "mod"` */
|
|
855
|
+
'Name' | /** `import * as ns from "mod"` */
|
|
856
|
+
'NamespaceObject' | /** `import defaultExport from "mod"` */
|
|
884
857
|
'Default';
|
|
858
|
+
|
|
885
859
|
/** TypeScript Isolated Declarations for Standalone DTS Emit */
|
|
886
|
-
|
|
887
|
-
declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult
|
|
860
|
+
declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult;
|
|
888
861
|
interface IsolatedDeclarationsOptions {
|
|
889
862
|
/**
|
|
890
863
|
* Do not emit declarations for code that has an @internal annotation in its JSDoc comment.
|
|
@@ -894,46 +867,42 @@ interface IsolatedDeclarationsOptions {
|
|
|
894
867
|
*
|
|
895
868
|
* See <https://www.typescriptlang.org/tsconfig/#stripInternal>
|
|
896
869
|
*/
|
|
897
|
-
stripInternal?: boolean
|
|
898
|
-
sourcemap?: boolean
|
|
870
|
+
stripInternal?: boolean;
|
|
871
|
+
sourcemap?: boolean;
|
|
899
872
|
}
|
|
900
873
|
interface IsolatedDeclarationsResult {
|
|
901
|
-
code: string
|
|
902
|
-
map?: SourceMap
|
|
903
|
-
errors: Array<OxcError
|
|
874
|
+
code: string;
|
|
875
|
+
map?: SourceMap;
|
|
876
|
+
errors: Array<OxcError>;
|
|
904
877
|
}
|
|
905
878
|
interface JsChangedOutputs {
|
|
906
|
-
chunks: Array<JsOutputChunk
|
|
907
|
-
assets: Array<JsOutputAsset
|
|
908
|
-
deleted: Array<string
|
|
879
|
+
chunks: Array<JsOutputChunk>;
|
|
880
|
+
assets: Array<JsOutputAsset>;
|
|
881
|
+
deleted: Array<string>;
|
|
909
882
|
}
|
|
910
883
|
interface JsOutputAsset {
|
|
911
|
-
names: Array<string
|
|
912
|
-
originalFileNames: Array<string
|
|
913
|
-
filename: string
|
|
914
|
-
source: BindingAssetSource
|
|
884
|
+
names: Array<string>;
|
|
885
|
+
originalFileNames: Array<string>;
|
|
886
|
+
filename: string;
|
|
887
|
+
source: BindingAssetSource;
|
|
915
888
|
}
|
|
916
889
|
interface JsOutputChunk {
|
|
917
|
-
name: string
|
|
918
|
-
isEntry: boolean
|
|
919
|
-
isDynamicEntry: boolean
|
|
920
|
-
facadeModuleId?: string
|
|
921
|
-
moduleIds: Array<string
|
|
922
|
-
exports: Array<string
|
|
923
|
-
filename: string
|
|
924
|
-
modules: Record<string, BindingRenderedModule
|
|
925
|
-
imports: Array<string
|
|
926
|
-
dynamicImports: Array<string
|
|
927
|
-
code: string
|
|
928
|
-
map?: BindingSourcemap
|
|
929
|
-
sourcemapFilename?: string
|
|
930
|
-
preliminaryFilename: string
|
|
890
|
+
name: string;
|
|
891
|
+
isEntry: boolean;
|
|
892
|
+
isDynamicEntry: boolean;
|
|
893
|
+
facadeModuleId?: string;
|
|
894
|
+
moduleIds: Array<string>;
|
|
895
|
+
exports: Array<string>;
|
|
896
|
+
filename: string;
|
|
897
|
+
modules: Record<string, BindingRenderedModule>;
|
|
898
|
+
imports: Array<string>;
|
|
899
|
+
dynamicImports: Array<string>;
|
|
900
|
+
code: string;
|
|
901
|
+
map?: BindingSourcemap;
|
|
902
|
+
sourcemapFilename?: string;
|
|
903
|
+
preliminaryFilename: string;
|
|
931
904
|
}
|
|
932
|
-
|
|
933
|
-
* Configure how TSX and JSX are transformed.
|
|
934
|
-
*
|
|
935
|
-
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx#options}
|
|
936
|
-
*/
|
|
905
|
+
|
|
937
906
|
/**
|
|
938
907
|
* Configure how TSX and JSX are transformed.
|
|
939
908
|
*
|
|
@@ -948,7 +917,7 @@ interface JsxOptions {
|
|
|
948
917
|
*
|
|
949
918
|
* @default 'automatic'
|
|
950
919
|
*/
|
|
951
|
-
runtime?: 'classic' | 'automatic'
|
|
920
|
+
runtime?: 'classic' | 'automatic';
|
|
952
921
|
/**
|
|
953
922
|
* Emit development-specific information, such as `__source` and `__self`.
|
|
954
923
|
*
|
|
@@ -956,7 +925,7 @@ interface JsxOptions {
|
|
|
956
925
|
*
|
|
957
926
|
* @see {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx-development}
|
|
958
927
|
*/
|
|
959
|
-
development?: boolean
|
|
928
|
+
development?: boolean;
|
|
960
929
|
/**
|
|
961
930
|
* Toggles whether or not to throw an error if an XML namespaced tag name
|
|
962
931
|
* is used.
|
|
@@ -966,7 +935,7 @@ interface JsxOptions {
|
|
|
966
935
|
*
|
|
967
936
|
* @default true
|
|
968
937
|
*/
|
|
969
|
-
throwIfNamespace?: boolean
|
|
938
|
+
throwIfNamespace?: boolean;
|
|
970
939
|
/**
|
|
971
940
|
* Enables `@babel/plugin-transform-react-pure-annotations`.
|
|
972
941
|
*
|
|
@@ -976,13 +945,13 @@ interface JsxOptions {
|
|
|
976
945
|
*
|
|
977
946
|
* @default true
|
|
978
947
|
*/
|
|
979
|
-
pure?: boolean
|
|
948
|
+
pure?: boolean;
|
|
980
949
|
/**
|
|
981
950
|
* Replaces the import source when importing functions.
|
|
982
951
|
*
|
|
983
952
|
* @default 'react'
|
|
984
953
|
*/
|
|
985
|
-
importSource?: string
|
|
954
|
+
importSource?: string;
|
|
986
955
|
/**
|
|
987
956
|
* Replace the function used when compiling JSX expressions. It should be a
|
|
988
957
|
* qualified name (e.g. `React.createElement`) or an identifier (e.g.
|
|
@@ -992,7 +961,7 @@ interface JsxOptions {
|
|
|
992
961
|
*
|
|
993
962
|
* @default 'React.createElement'
|
|
994
963
|
*/
|
|
995
|
-
pragma?: string
|
|
964
|
+
pragma?: string;
|
|
996
965
|
/**
|
|
997
966
|
* Replace the component used when compiling JSX fragments. It should be a
|
|
998
967
|
* valid JSX tag name.
|
|
@@ -1001,7 +970,7 @@ interface JsxOptions {
|
|
|
1001
970
|
*
|
|
1002
971
|
* @default 'React.Fragment'
|
|
1003
972
|
*/
|
|
1004
|
-
pragmaFrag?: string
|
|
973
|
+
pragmaFrag?: string;
|
|
1005
974
|
/**
|
|
1006
975
|
* When spreading props, use `Object.assign` directly instead of an extend helper.
|
|
1007
976
|
*
|
|
@@ -1009,7 +978,7 @@ interface JsxOptions {
|
|
|
1009
978
|
*
|
|
1010
979
|
* @default false
|
|
1011
980
|
*/
|
|
1012
|
-
useBuiltIns?: boolean
|
|
981
|
+
useBuiltIns?: boolean;
|
|
1013
982
|
/**
|
|
1014
983
|
* When spreading props, use inline object with spread elements directly
|
|
1015
984
|
* instead of an extend helper or Object.assign.
|
|
@@ -1018,7 +987,7 @@ interface JsxOptions {
|
|
|
1018
987
|
*
|
|
1019
988
|
* @default false
|
|
1020
989
|
*/
|
|
1021
|
-
useSpread?: boolean
|
|
990
|
+
useSpread?: boolean;
|
|
1022
991
|
/**
|
|
1023
992
|
* Enable React Fast Refresh .
|
|
1024
993
|
*
|
|
@@ -1026,21 +995,9 @@ interface JsxOptions {
|
|
|
1026
995
|
*
|
|
1027
996
|
* @default false
|
|
1028
997
|
*/
|
|
1029
|
-
refresh?: boolean | ReactRefreshOptions
|
|
998
|
+
refresh?: boolean | ReactRefreshOptions;
|
|
1030
999
|
}
|
|
1031
|
-
|
|
1032
|
-
* Transform JavaScript code to a Vite Node runnable module.
|
|
1033
|
-
*
|
|
1034
|
-
* @param filename The name of the file being transformed.
|
|
1035
|
-
* @param sourceText the source code itself
|
|
1036
|
-
* @param options The options for the transformation. See {@link
|
|
1037
|
-
* ModuleRunnerTransformOptions} for more information.
|
|
1038
|
-
*
|
|
1039
|
-
* @returns an object containing the transformed code, source maps, and any
|
|
1040
|
-
* errors that occurred during parsing or transformation.
|
|
1041
|
-
*
|
|
1042
|
-
* @deprecated Only works for Vite.
|
|
1043
|
-
*/
|
|
1000
|
+
|
|
1044
1001
|
/**
|
|
1045
1002
|
* Transform JavaScript code to a Vite Node runnable module.
|
|
1046
1003
|
*
|
|
@@ -1054,7 +1011,7 @@ interface JsxOptions {
|
|
|
1054
1011
|
*
|
|
1055
1012
|
* @deprecated Only works for Vite.
|
|
1056
1013
|
*/
|
|
1057
|
-
declare function moduleRunnerTransform(filename: string, sourceText: string, options?: ModuleRunnerTransformOptions | undefined | null): ModuleRunnerTransformResult
|
|
1014
|
+
declare function moduleRunnerTransform(filename: string, sourceText: string, options?: ModuleRunnerTransformOptions | undefined | null): ModuleRunnerTransformResult;
|
|
1058
1015
|
interface ModuleRunnerTransformOptions {
|
|
1059
1016
|
/**
|
|
1060
1017
|
* Enable source map generation.
|
|
@@ -1065,7 +1022,7 @@ interface ModuleRunnerTransformOptions {
|
|
|
1065
1022
|
*
|
|
1066
1023
|
* @see {@link SourceMap}
|
|
1067
1024
|
*/
|
|
1068
|
-
sourcemap?: boolean
|
|
1025
|
+
sourcemap?: boolean;
|
|
1069
1026
|
}
|
|
1070
1027
|
interface ModuleRunnerTransformResult {
|
|
1071
1028
|
/**
|
|
@@ -1073,15 +1030,15 @@ interface ModuleRunnerTransformResult {
|
|
|
1073
1030
|
*
|
|
1074
1031
|
* If parsing failed, this will be an empty string.
|
|
1075
1032
|
*/
|
|
1076
|
-
code: string
|
|
1033
|
+
code: string;
|
|
1077
1034
|
/**
|
|
1078
1035
|
* The source map for the transformed code.
|
|
1079
1036
|
*
|
|
1080
1037
|
* This will be set if {@link TransformOptions#sourcemap} is `true`.
|
|
1081
1038
|
*/
|
|
1082
|
-
map?: SourceMap
|
|
1083
|
-
deps: Array<string
|
|
1084
|
-
dynamicDeps: Array<string
|
|
1039
|
+
map?: SourceMap;
|
|
1040
|
+
deps: Array<string>;
|
|
1041
|
+
dynamicDeps: Array<string>;
|
|
1085
1042
|
/**
|
|
1086
1043
|
* Parse and transformation errors.
|
|
1087
1044
|
*
|
|
@@ -1089,20 +1046,10 @@ interface ModuleRunnerTransformResult {
|
|
|
1089
1046
|
* transformed code may still be available even if there are errors in this
|
|
1090
1047
|
* list.
|
|
1091
1048
|
*/
|
|
1092
|
-
errors: Array<OxcError
|
|
1049
|
+
errors: Array<OxcError>;
|
|
1093
1050
|
}
|
|
1094
|
-
type ModuleType =
|
|
1095
|
-
|
|
1096
|
-
'json'|
|
|
1097
|
-
'wasm'|
|
|
1098
|
-
'addon';
|
|
1099
|
-
/**
|
|
1100
|
-
* Module Resolution Options
|
|
1101
|
-
*
|
|
1102
|
-
* Options are directly ported from [enhanced-resolve](https://github.com/webpack/enhanced-resolve#resolver-options).
|
|
1103
|
-
*
|
|
1104
|
-
* See [webpack resolve](https://webpack.js.org/configuration/resolve/) for information and examples
|
|
1105
|
-
*/
|
|
1051
|
+
type ModuleType = 'module' | 'commonjs' | 'json' | 'wasm' | 'addon';
|
|
1052
|
+
|
|
1106
1053
|
/**
|
|
1107
1054
|
* Module Resolution Options
|
|
1108
1055
|
*
|
|
@@ -1116,7 +1063,7 @@ interface NapiResolveOptions {
|
|
|
1116
1063
|
*
|
|
1117
1064
|
* Default `None`
|
|
1118
1065
|
*/
|
|
1119
|
-
tsconfig?: TsconfigOptions
|
|
1066
|
+
tsconfig?: TsconfigOptions;
|
|
1120
1067
|
/**
|
|
1121
1068
|
* Alias for [ResolveOptions::alias] and [ResolveOptions::fallback].
|
|
1122
1069
|
*
|
|
@@ -1125,7 +1072,7 @@ interface NapiResolveOptions {
|
|
|
1125
1072
|
* Create aliases to import or require certain modules more easily.
|
|
1126
1073
|
* A trailing $ can also be added to the given object's keys to signify an exact match.
|
|
1127
1074
|
*/
|
|
1128
|
-
alias?: Record<string, Array<string | undefined | null
|
|
1075
|
+
alias?: Record<string, Array<string | undefined | null>>;
|
|
1129
1076
|
/**
|
|
1130
1077
|
* A list of alias fields in description files.
|
|
1131
1078
|
* Specify a field, such as `browser`, to be parsed according to [this specification](https://github.com/defunctzombie/package-browser-field-spec).
|
|
@@ -1133,14 +1080,14 @@ interface NapiResolveOptions {
|
|
|
1133
1080
|
*
|
|
1134
1081
|
* Default `[]`
|
|
1135
1082
|
*/
|
|
1136
|
-
aliasFields?: (string | string[])[]
|
|
1083
|
+
aliasFields?: (string | string[])[];
|
|
1137
1084
|
/**
|
|
1138
1085
|
* Condition names for exports field which defines entry points of a package.
|
|
1139
1086
|
* The key order in the exports field is significant. During condition matching, earlier entries have higher priority and take precedence over later entries.
|
|
1140
1087
|
*
|
|
1141
1088
|
* Default `[]`
|
|
1142
1089
|
*/
|
|
1143
|
-
conditionNames?: Array<string
|
|
1090
|
+
conditionNames?: Array<string>;
|
|
1144
1091
|
/**
|
|
1145
1092
|
* If true, it will not allow extension-less files.
|
|
1146
1093
|
* So by default `require('./foo')` works if `./foo` has a `.js` extension,
|
|
@@ -1152,14 +1099,14 @@ interface NapiResolveOptions {
|
|
|
1152
1099
|
*
|
|
1153
1100
|
* Default None, which is the same as `Some(false)` when the above empty rule is not applied.
|
|
1154
1101
|
*/
|
|
1155
|
-
enforceExtension?: EnforceExtension
|
|
1102
|
+
enforceExtension?: EnforceExtension;
|
|
1156
1103
|
/**
|
|
1157
1104
|
* A list of exports fields in description files.
|
|
1158
1105
|
* Can be a path to json object such as `["path", "to", "exports"]`.
|
|
1159
1106
|
*
|
|
1160
1107
|
* Default `[["exports"]]`.
|
|
1161
1108
|
*/
|
|
1162
|
-
exportsFields?: (string | string[])[]
|
|
1109
|
+
exportsFields?: (string | string[])[];
|
|
1163
1110
|
/**
|
|
1164
1111
|
* Fields from `package.json` which are used to provide the internal requests of a package
|
|
1165
1112
|
* (requests starting with # are considered internal).
|
|
@@ -1168,13 +1115,13 @@ interface NapiResolveOptions {
|
|
|
1168
1115
|
*
|
|
1169
1116
|
* Default `[["imports"]]`.
|
|
1170
1117
|
*/
|
|
1171
|
-
importsFields?: (string | string[])[]
|
|
1118
|
+
importsFields?: (string | string[])[];
|
|
1172
1119
|
/**
|
|
1173
1120
|
* An object which maps extension to extension aliases.
|
|
1174
1121
|
*
|
|
1175
1122
|
* Default `{}`
|
|
1176
1123
|
*/
|
|
1177
|
-
extensionAlias?: Record<string, Array<string
|
|
1124
|
+
extensionAlias?: Record<string, Array<string>>;
|
|
1178
1125
|
/**
|
|
1179
1126
|
* Attempt to resolve these extensions in order.
|
|
1180
1127
|
* If multiple files share the same name but have different extensions,
|
|
@@ -1182,13 +1129,13 @@ interface NapiResolveOptions {
|
|
|
1182
1129
|
*
|
|
1183
1130
|
* Default `[".js", ".json", ".node"]`
|
|
1184
1131
|
*/
|
|
1185
|
-
extensions?: Array<string
|
|
1132
|
+
extensions?: Array<string>;
|
|
1186
1133
|
/**
|
|
1187
1134
|
* Redirect module requests when normal resolving fails.
|
|
1188
1135
|
*
|
|
1189
1136
|
* Default `[]`
|
|
1190
1137
|
*/
|
|
1191
|
-
fallback?: Record<string, Array<string | undefined | null
|
|
1138
|
+
fallback?: Record<string, Array<string | undefined | null>>;
|
|
1192
1139
|
/**
|
|
1193
1140
|
* Request passed to resolve is already fully specified and extensions or main files are not resolved for it (they are still resolved for internal requests).
|
|
1194
1141
|
*
|
|
@@ -1196,56 +1143,56 @@ interface NapiResolveOptions {
|
|
|
1196
1143
|
*
|
|
1197
1144
|
* Default `false`
|
|
1198
1145
|
*/
|
|
1199
|
-
fullySpecified?: boolean
|
|
1146
|
+
fullySpecified?: boolean;
|
|
1200
1147
|
/**
|
|
1201
1148
|
* A list of main fields in description files
|
|
1202
1149
|
*
|
|
1203
1150
|
* Default `["main"]`.
|
|
1204
1151
|
*/
|
|
1205
|
-
mainFields?: string | string[]
|
|
1152
|
+
mainFields?: string | string[];
|
|
1206
1153
|
/**
|
|
1207
1154
|
* The filename to be used while resolving directories.
|
|
1208
1155
|
*
|
|
1209
1156
|
* Default `["index"]`
|
|
1210
1157
|
*/
|
|
1211
|
-
mainFiles?: Array<string
|
|
1158
|
+
mainFiles?: Array<string>;
|
|
1212
1159
|
/**
|
|
1213
1160
|
* A list of directories to resolve modules from, can be absolute path or folder name.
|
|
1214
1161
|
*
|
|
1215
1162
|
* Default `["node_modules"]`
|
|
1216
1163
|
*/
|
|
1217
|
-
modules?: string | string[]
|
|
1164
|
+
modules?: string | string[];
|
|
1218
1165
|
/**
|
|
1219
1166
|
* Resolve to a context instead of a file.
|
|
1220
1167
|
*
|
|
1221
1168
|
* Default `false`
|
|
1222
1169
|
*/
|
|
1223
|
-
resolveToContext?: boolean
|
|
1170
|
+
resolveToContext?: boolean;
|
|
1224
1171
|
/**
|
|
1225
1172
|
* Prefer to resolve module requests as relative requests instead of using modules from node_modules directories.
|
|
1226
1173
|
*
|
|
1227
1174
|
* Default `false`
|
|
1228
1175
|
*/
|
|
1229
|
-
preferRelative?: boolean
|
|
1176
|
+
preferRelative?: boolean;
|
|
1230
1177
|
/**
|
|
1231
1178
|
* Prefer to resolve server-relative urls as absolute paths before falling back to resolve in ResolveOptions::roots.
|
|
1232
1179
|
*
|
|
1233
1180
|
* Default `false`
|
|
1234
1181
|
*/
|
|
1235
|
-
preferAbsolute?: boolean
|
|
1182
|
+
preferAbsolute?: boolean;
|
|
1236
1183
|
/**
|
|
1237
1184
|
* A list of resolve restrictions to restrict the paths that a request can be resolved on.
|
|
1238
1185
|
*
|
|
1239
1186
|
* Default `[]`
|
|
1240
1187
|
*/
|
|
1241
|
-
restrictions?: Array<Restriction
|
|
1188
|
+
restrictions?: Array<Restriction>;
|
|
1242
1189
|
/**
|
|
1243
1190
|
* A list of directories where requests of server-relative URLs (starting with '/') are resolved.
|
|
1244
1191
|
* On non-Windows systems these requests are resolved as an absolute path first.
|
|
1245
1192
|
*
|
|
1246
1193
|
* Default `[]`
|
|
1247
1194
|
*/
|
|
1248
|
-
roots?: Array<string
|
|
1195
|
+
roots?: Array<string>;
|
|
1249
1196
|
/**
|
|
1250
1197
|
* Whether to resolve symlinks to their symlinked location.
|
|
1251
1198
|
* When enabled, symlinked resources are resolved to their real path, not their symlinked location.
|
|
@@ -1253,33 +1200,40 @@ interface NapiResolveOptions {
|
|
|
1253
1200
|
*
|
|
1254
1201
|
* Default `true`
|
|
1255
1202
|
*/
|
|
1256
|
-
symlinks?: boolean
|
|
1203
|
+
symlinks?: boolean;
|
|
1257
1204
|
/**
|
|
1258
1205
|
* Whether to parse [module.builtinModules](https://nodejs.org/api/module.html#modulebuiltinmodules) or not.
|
|
1259
1206
|
* For example, "zlib" will throw [crate::ResolveError::Builtin] when set to true.
|
|
1260
1207
|
*
|
|
1261
1208
|
* Default `false`
|
|
1262
1209
|
*/
|
|
1263
|
-
builtinModules?: boolean
|
|
1210
|
+
builtinModules?: boolean;
|
|
1264
1211
|
/**
|
|
1265
1212
|
* Resolve [ResolveResult::moduleType].
|
|
1266
1213
|
*
|
|
1267
1214
|
* Default `false`
|
|
1268
1215
|
*/
|
|
1269
|
-
moduleType?: boolean
|
|
1216
|
+
moduleType?: boolean;
|
|
1270
1217
|
}
|
|
1271
1218
|
interface OxcError {
|
|
1272
|
-
severity: Severity
|
|
1273
|
-
message: string
|
|
1274
|
-
labels: Array<ErrorLabel
|
|
1275
|
-
helpMessage?: string
|
|
1276
|
-
codeframe?: string
|
|
1219
|
+
severity: Severity;
|
|
1220
|
+
message: string;
|
|
1221
|
+
labels: Array<ErrorLabel>;
|
|
1222
|
+
helpMessage?: string;
|
|
1223
|
+
codeframe?: string;
|
|
1277
1224
|
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Parse asynchronously.
|
|
1228
|
+
*
|
|
1229
|
+
* Note: This function can be slower than `parseSync` due to the overhead of spawning a thread.
|
|
1230
|
+
*/
|
|
1231
|
+
|
|
1278
1232
|
interface ParserOptions {
|
|
1279
1233
|
/** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
|
|
1280
|
-
lang?: 'js' | 'jsx' | 'ts' | 'tsx'
|
|
1234
|
+
lang?: 'js' | 'jsx' | 'ts' | 'tsx';
|
|
1281
1235
|
/** Treat the source text as `script` or `module` code. */
|
|
1282
|
-
sourceType?: 'script' | 'module' | 'unambiguous' | undefined
|
|
1236
|
+
sourceType?: 'script' | 'module' | 'unambiguous' | undefined;
|
|
1283
1237
|
/**
|
|
1284
1238
|
* Return an AST which includes TypeScript-related properties, or excludes them.
|
|
1285
1239
|
*
|
|
@@ -1287,7 +1241,7 @@ interface ParserOptions {
|
|
|
1287
1241
|
* `'ts'` is default for TS / TSX files.
|
|
1288
1242
|
* The type of the file is determined from `lang` option, or extension of provided `filename`.
|
|
1289
1243
|
*/
|
|
1290
|
-
astType?: 'js' | 'ts'
|
|
1244
|
+
astType?: 'js' | 'ts';
|
|
1291
1245
|
/**
|
|
1292
1246
|
* Emit `ParenthesizedExpression` and `TSParenthesizedType` in AST.
|
|
1293
1247
|
*
|
|
@@ -1297,7 +1251,7 @@ interface ParserOptions {
|
|
|
1297
1251
|
*
|
|
1298
1252
|
* @default true
|
|
1299
1253
|
*/
|
|
1300
|
-
preserveParens?: boolean
|
|
1254
|
+
preserveParens?: boolean;
|
|
1301
1255
|
/**
|
|
1302
1256
|
* Produce semantic errors with an additional AST pass.
|
|
1303
1257
|
* Semantic errors depend on symbols and scopes, where the parser does not construct.
|
|
@@ -1305,34 +1259,40 @@ interface ParserOptions {
|
|
|
1305
1259
|
*
|
|
1306
1260
|
* @default false
|
|
1307
1261
|
*/
|
|
1308
|
-
showSemanticErrors?: boolean
|
|
1262
|
+
showSemanticErrors?: boolean;
|
|
1309
1263
|
}
|
|
1264
|
+
|
|
1265
|
+
/** Parse synchronously. */
|
|
1266
|
+
|
|
1310
1267
|
interface PreRenderedChunk {
|
|
1311
|
-
name: string
|
|
1312
|
-
isEntry: boolean
|
|
1313
|
-
isDynamicEntry: boolean
|
|
1314
|
-
facadeModuleId?: string
|
|
1315
|
-
moduleIds: Array<string
|
|
1316
|
-
exports: Array<string
|
|
1268
|
+
name: string;
|
|
1269
|
+
isEntry: boolean;
|
|
1270
|
+
isDynamicEntry: boolean;
|
|
1271
|
+
facadeModuleId?: string;
|
|
1272
|
+
moduleIds: Array<string>;
|
|
1273
|
+
exports: Array<string>;
|
|
1317
1274
|
}
|
|
1275
|
+
|
|
1276
|
+
/** Returns `true` if raw transfer is supported on this platform. */
|
|
1277
|
+
|
|
1318
1278
|
interface ReactRefreshOptions {
|
|
1319
1279
|
/**
|
|
1320
1280
|
* Specify the identifier of the refresh registration variable.
|
|
1321
1281
|
*
|
|
1322
1282
|
* @default `$RefreshReg$`.
|
|
1323
1283
|
*/
|
|
1324
|
-
refreshReg?: string
|
|
1284
|
+
refreshReg?: string;
|
|
1325
1285
|
/**
|
|
1326
1286
|
* Specify the identifier of the refresh signature variable.
|
|
1327
1287
|
*
|
|
1328
1288
|
* @default `$RefreshSig$`.
|
|
1329
1289
|
*/
|
|
1330
|
-
refreshSig?: string
|
|
1331
|
-
emitFullSignatures?: boolean
|
|
1290
|
+
refreshSig?: string;
|
|
1291
|
+
emitFullSignatures?: boolean;
|
|
1332
1292
|
}
|
|
1333
1293
|
interface ResolveResult {
|
|
1334
|
-
path?: string
|
|
1335
|
-
error?: string
|
|
1294
|
+
path?: string;
|
|
1295
|
+
error?: string;
|
|
1336
1296
|
/**
|
|
1337
1297
|
* Module type for this path.
|
|
1338
1298
|
*
|
|
@@ -1342,54 +1302,65 @@ interface ResolveResult {
|
|
|
1342
1302
|
*
|
|
1343
1303
|
* The algorithm uses the file extension or finds the closest `package.json` with the `type` field.
|
|
1344
1304
|
*/
|
|
1345
|
-
moduleType?: ModuleType
|
|
1305
|
+
moduleType?: ModuleType;
|
|
1346
1306
|
/** `package.json` path for the given module. */
|
|
1347
|
-
packageJsonPath?: string
|
|
1307
|
+
packageJsonPath?: string;
|
|
1348
1308
|
}
|
|
1349
|
-
|
|
1350
|
-
* Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback].
|
|
1351
|
-
* Use struct because napi don't support structured union now
|
|
1352
|
-
*/
|
|
1309
|
+
|
|
1353
1310
|
/**
|
|
1354
1311
|
* Alias Value for [ResolveOptions::alias] and [ResolveOptions::fallback].
|
|
1355
1312
|
* Use struct because napi don't support structured union now
|
|
1356
1313
|
*/
|
|
1357
1314
|
interface Restriction {
|
|
1358
|
-
path?: string
|
|
1359
|
-
regex?: string
|
|
1315
|
+
path?: string;
|
|
1316
|
+
regex?: string;
|
|
1360
1317
|
}
|
|
1361
|
-
type Severity =
|
|
1362
|
-
|
|
1363
|
-
|
|
1318
|
+
type Severity = 'Error' | 'Warning' | 'Advice';
|
|
1319
|
+
|
|
1320
|
+
/**
|
|
1321
|
+
* Shutdown the tokio runtime manually.
|
|
1322
|
+
*
|
|
1323
|
+
* This is required for the wasm target with `tokio_unstable` cfg.
|
|
1324
|
+
* In the wasm runtime, the `park` threads will hang there until the tokio::Runtime is shutdown.
|
|
1325
|
+
*/
|
|
1326
|
+
|
|
1364
1327
|
interface SourceMap {
|
|
1365
|
-
file?: string
|
|
1366
|
-
mappings: string
|
|
1367
|
-
names: Array<string
|
|
1368
|
-
sourceRoot?: string
|
|
1369
|
-
sources: Array<string
|
|
1370
|
-
sourcesContent?: Array<string
|
|
1371
|
-
version: number
|
|
1372
|
-
x_google_ignoreList?: Array<number
|
|
1328
|
+
file?: string;
|
|
1329
|
+
mappings: string;
|
|
1330
|
+
names: Array<string>;
|
|
1331
|
+
sourceRoot?: string;
|
|
1332
|
+
sources: Array<string>;
|
|
1333
|
+
sourcesContent?: Array<string>;
|
|
1334
|
+
version: number;
|
|
1335
|
+
x_google_ignoreList?: Array<number>;
|
|
1373
1336
|
}
|
|
1374
1337
|
interface Span {
|
|
1375
|
-
start: number
|
|
1376
|
-
end: number
|
|
1338
|
+
start: number;
|
|
1339
|
+
end: number;
|
|
1377
1340
|
}
|
|
1341
|
+
|
|
1342
|
+
/**
|
|
1343
|
+
* Start the async runtime manually.
|
|
1344
|
+
*
|
|
1345
|
+
* This is required when the async runtime is shutdown manually.
|
|
1346
|
+
* Usually it's used in test.
|
|
1347
|
+
*/
|
|
1348
|
+
|
|
1378
1349
|
interface StaticExport {
|
|
1379
|
-
start: number
|
|
1380
|
-
end: number
|
|
1381
|
-
entries: Array<StaticExportEntry
|
|
1350
|
+
start: number;
|
|
1351
|
+
end: number;
|
|
1352
|
+
entries: Array<StaticExportEntry>;
|
|
1382
1353
|
}
|
|
1383
1354
|
interface StaticExportEntry {
|
|
1384
|
-
start: number
|
|
1385
|
-
end: number
|
|
1386
|
-
moduleRequest?: ValueSpan
|
|
1355
|
+
start: number;
|
|
1356
|
+
end: number;
|
|
1357
|
+
moduleRequest?: ValueSpan;
|
|
1387
1358
|
/** The name under which the desired binding is exported by the module`. */
|
|
1388
|
-
importName: ExportImportName
|
|
1359
|
+
importName: ExportImportName;
|
|
1389
1360
|
/** The name used to export this binding by this module. */
|
|
1390
|
-
exportName: ExportExportName
|
|
1361
|
+
exportName: ExportExportName;
|
|
1391
1362
|
/** The name that is used to locally access the exported value from within the importing module. */
|
|
1392
|
-
localName: ExportLocalName
|
|
1363
|
+
localName: ExportLocalName;
|
|
1393
1364
|
/**
|
|
1394
1365
|
* Whether the export is a TypeScript `export type`.
|
|
1395
1366
|
*
|
|
@@ -1403,13 +1374,13 @@ interface StaticExportEntry {
|
|
|
1403
1374
|
* export type { foo } from 'mod';
|
|
1404
1375
|
* ```
|
|
1405
1376
|
*/
|
|
1406
|
-
isType: boolean
|
|
1377
|
+
isType: boolean;
|
|
1407
1378
|
}
|
|
1408
1379
|
interface StaticImport {
|
|
1409
1380
|
/** Start of import statement. */
|
|
1410
|
-
start: number
|
|
1381
|
+
start: number;
|
|
1411
1382
|
/** End of import statement. */
|
|
1412
|
-
end: number
|
|
1383
|
+
end: number;
|
|
1413
1384
|
/**
|
|
1414
1385
|
* Import source.
|
|
1415
1386
|
*
|
|
@@ -1418,13 +1389,13 @@ interface StaticImport {
|
|
|
1418
1389
|
* // ^^^
|
|
1419
1390
|
* ```
|
|
1420
1391
|
*/
|
|
1421
|
-
moduleRequest: ValueSpan
|
|
1392
|
+
moduleRequest: ValueSpan;
|
|
1422
1393
|
/**
|
|
1423
1394
|
* Import specifiers.
|
|
1424
1395
|
*
|
|
1425
1396
|
* Empty for `import "mod"`.
|
|
1426
1397
|
*/
|
|
1427
|
-
entries: Array<StaticImportEntry
|
|
1398
|
+
entries: Array<StaticImportEntry>;
|
|
1428
1399
|
}
|
|
1429
1400
|
interface StaticImportEntry {
|
|
1430
1401
|
/**
|
|
@@ -1437,7 +1408,7 @@ interface StaticImportEntry {
|
|
|
1437
1408
|
* // ^^^
|
|
1438
1409
|
* ```
|
|
1439
1410
|
*/
|
|
1440
|
-
importName: ImportName
|
|
1411
|
+
importName: ImportName;
|
|
1441
1412
|
/**
|
|
1442
1413
|
* The name that is used to locally access the imported value from within the importing module.
|
|
1443
1414
|
* ```js
|
|
@@ -1447,7 +1418,7 @@ interface StaticImportEntry {
|
|
|
1447
1418
|
* // ^^^
|
|
1448
1419
|
* ```
|
|
1449
1420
|
*/
|
|
1450
|
-
localName: ValueSpan
|
|
1421
|
+
localName: ValueSpan;
|
|
1451
1422
|
/**
|
|
1452
1423
|
* Whether this binding is for a TypeScript type-only import.
|
|
1453
1424
|
*
|
|
@@ -1457,20 +1428,8 @@ interface StaticImportEntry {
|
|
|
1457
1428
|
* import { type foo } from "mod";
|
|
1458
1429
|
* ```
|
|
1459
1430
|
*/
|
|
1460
|
-
isType: boolean
|
|
1431
|
+
isType: boolean;
|
|
1461
1432
|
}
|
|
1462
|
-
/**
|
|
1463
|
-
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
|
1464
|
-
*
|
|
1465
|
-
* @param filename The name of the file being transformed. If this is a
|
|
1466
|
-
* relative path, consider setting the {@link TransformOptions#cwd} option..
|
|
1467
|
-
* @param sourceText the source code itself
|
|
1468
|
-
* @param options The options for the transformation. See {@link
|
|
1469
|
-
* TransformOptions} for more information.
|
|
1470
|
-
*
|
|
1471
|
-
* @returns an object containing the transformed code, source maps, and any
|
|
1472
|
-
* errors that occurred during parsing or transformation.
|
|
1473
|
-
*/
|
|
1474
1433
|
/**
|
|
1475
1434
|
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
|
1476
1435
|
*
|
|
@@ -1483,12 +1442,8 @@ interface StaticImportEntry {
|
|
|
1483
1442
|
* @returns an object containing the transformed code, source maps, and any
|
|
1484
1443
|
* errors that occurred during parsing or transformation.
|
|
1485
1444
|
*/
|
|
1486
|
-
declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult
|
|
1487
|
-
|
|
1488
|
-
* Options for transforming a JavaScript or TypeScript file.
|
|
1489
|
-
*
|
|
1490
|
-
* @see {@link transform}
|
|
1491
|
-
*/
|
|
1445
|
+
declare function transform(filename: string, sourceText: string, options?: TransformOptions | undefined | null): TransformResult;
|
|
1446
|
+
|
|
1492
1447
|
/**
|
|
1493
1448
|
* Options for transforming a JavaScript or TypeScript file.
|
|
1494
1449
|
*
|
|
@@ -1496,14 +1451,14 @@ declare function transform(filename: string, sourceText: string, options?: Trans
|
|
|
1496
1451
|
*/
|
|
1497
1452
|
interface TransformOptions {
|
|
1498
1453
|
/** Treat the source text as `js`, `jsx`, `ts`, or `tsx`. */
|
|
1499
|
-
lang?: 'js' | 'jsx' | 'ts' | 'tsx'
|
|
1454
|
+
lang?: 'js' | 'jsx' | 'ts' | 'tsx';
|
|
1500
1455
|
/** Treat the source text as `script` or `module` code. */
|
|
1501
|
-
sourceType?: 'script' | 'module' | 'unambiguous' | undefined
|
|
1456
|
+
sourceType?: 'script' | 'module' | 'unambiguous' | undefined;
|
|
1502
1457
|
/**
|
|
1503
1458
|
* The current working directory. Used to resolve relative paths in other
|
|
1504
1459
|
* options.
|
|
1505
1460
|
*/
|
|
1506
|
-
cwd?: string
|
|
1461
|
+
cwd?: string;
|
|
1507
1462
|
/**
|
|
1508
1463
|
* Enable source map generation.
|
|
1509
1464
|
*
|
|
@@ -1513,13 +1468,13 @@ interface TransformOptions {
|
|
|
1513
1468
|
*
|
|
1514
1469
|
* @see {@link SourceMap}
|
|
1515
1470
|
*/
|
|
1516
|
-
sourcemap?: boolean
|
|
1471
|
+
sourcemap?: boolean;
|
|
1517
1472
|
/** Set assumptions in order to produce smaller output. */
|
|
1518
|
-
assumptions?: CompilerAssumptions
|
|
1473
|
+
assumptions?: CompilerAssumptions;
|
|
1519
1474
|
/** Configure how TypeScript is transformed. */
|
|
1520
|
-
typescript?: TypeScriptOptions
|
|
1475
|
+
typescript?: TypeScriptOptions;
|
|
1521
1476
|
/** Configure how TSX and JSX are transformed. */
|
|
1522
|
-
jsx?: 'preserve' | JsxOptions
|
|
1477
|
+
jsx?: 'preserve' | JsxOptions;
|
|
1523
1478
|
/**
|
|
1524
1479
|
* Sets the target environment for the generated JavaScript.
|
|
1525
1480
|
*
|
|
@@ -1534,15 +1489,15 @@ interface TransformOptions {
|
|
|
1534
1489
|
*
|
|
1535
1490
|
* @see [esbuild#target](https://esbuild.github.io/api/#target)
|
|
1536
1491
|
*/
|
|
1537
|
-
target?: string | Array<string
|
|
1492
|
+
target?: string | Array<string>;
|
|
1538
1493
|
/** Behaviour for runtime helpers. */
|
|
1539
|
-
helpers?: Helpers
|
|
1494
|
+
helpers?: Helpers;
|
|
1540
1495
|
/** Define Plugin */
|
|
1541
|
-
define?: Record<string, string
|
|
1496
|
+
define?: Record<string, string>;
|
|
1542
1497
|
/** Inject Plugin */
|
|
1543
|
-
inject?: Record<string, string | [string, string]
|
|
1498
|
+
inject?: Record<string, string | [string, string]>;
|
|
1544
1499
|
/** Decorator plugin */
|
|
1545
|
-
decorator?: DecoratorOptions
|
|
1500
|
+
decorator?: DecoratorOptions;
|
|
1546
1501
|
}
|
|
1547
1502
|
interface TransformResult {
|
|
1548
1503
|
/**
|
|
@@ -1550,13 +1505,13 @@ interface TransformResult {
|
|
|
1550
1505
|
*
|
|
1551
1506
|
* If parsing failed, this will be an empty string.
|
|
1552
1507
|
*/
|
|
1553
|
-
code: string
|
|
1508
|
+
code: string;
|
|
1554
1509
|
/**
|
|
1555
1510
|
* The source map for the transformed code.
|
|
1556
1511
|
*
|
|
1557
1512
|
* This will be set if {@link TransformOptions#sourcemap} is `true`.
|
|
1558
1513
|
*/
|
|
1559
|
-
map?: SourceMap
|
|
1514
|
+
map?: SourceMap;
|
|
1560
1515
|
/**
|
|
1561
1516
|
* The `.d.ts` declaration file for the transformed code. Declarations are
|
|
1562
1517
|
* only generated if `declaration` is set to `true` and a TypeScript file
|
|
@@ -1567,13 +1522,13 @@ interface TransformResult {
|
|
|
1567
1522
|
* @see {@link TypeScriptOptions#declaration}
|
|
1568
1523
|
* @see [declaration tsconfig option](https://www.typescriptlang.org/tsconfig/#declaration)
|
|
1569
1524
|
*/
|
|
1570
|
-
declaration?: string
|
|
1525
|
+
declaration?: string;
|
|
1571
1526
|
/**
|
|
1572
1527
|
* Declaration source map. Only generated if both
|
|
1573
1528
|
* {@link TypeScriptOptions#declaration declaration} and
|
|
1574
1529
|
* {@link TransformOptions#sourcemap sourcemap} are set to `true`.
|
|
1575
1530
|
*/
|
|
1576
|
-
declarationMap?: SourceMap
|
|
1531
|
+
declarationMap?: SourceMap;
|
|
1577
1532
|
/**
|
|
1578
1533
|
* Helpers used.
|
|
1579
1534
|
*
|
|
@@ -1585,7 +1540,7 @@ interface TransformResult {
|
|
|
1585
1540
|
* { "_objectSpread": "@oxc-project/runtime/helpers/objectSpread2" }
|
|
1586
1541
|
* ```
|
|
1587
1542
|
*/
|
|
1588
|
-
helpersUsed: Record<string, string
|
|
1543
|
+
helpersUsed: Record<string, string>;
|
|
1589
1544
|
/**
|
|
1590
1545
|
* Parse and transformation errors.
|
|
1591
1546
|
*
|
|
@@ -1593,13 +1548,9 @@ interface TransformResult {
|
|
|
1593
1548
|
* transformed code may still be available even if there are errors in this
|
|
1594
1549
|
* list.
|
|
1595
1550
|
*/
|
|
1596
|
-
errors: Array<OxcError
|
|
1551
|
+
errors: Array<OxcError>;
|
|
1597
1552
|
}
|
|
1598
|
-
|
|
1599
|
-
* Tsconfig Options
|
|
1600
|
-
*
|
|
1601
|
-
* Derived from [tsconfig-paths-webpack-plugin](https://github.com/dividab/tsconfig-paths-webpack-plugin#options)
|
|
1602
|
-
*/
|
|
1553
|
+
|
|
1603
1554
|
/**
|
|
1604
1555
|
* Tsconfig Options
|
|
1605
1556
|
*
|
|
@@ -1612,20 +1563,20 @@ interface TsconfigOptions {
|
|
|
1612
1563
|
* * a relative path to the configuration file. It will be resolved relative to cwd.
|
|
1613
1564
|
* * an absolute path to the configuration file.
|
|
1614
1565
|
*/
|
|
1615
|
-
configFile: string
|
|
1566
|
+
configFile: string;
|
|
1616
1567
|
/**
|
|
1617
1568
|
* Support for Typescript Project References.
|
|
1618
1569
|
*
|
|
1619
1570
|
* * `'auto'`: use the `references` field from tsconfig of `config_file`.
|
|
1620
1571
|
* * `string[]`: manually provided relative or absolute path.
|
|
1621
1572
|
*/
|
|
1622
|
-
references?: 'auto' | string[]
|
|
1573
|
+
references?: 'auto' | string[];
|
|
1623
1574
|
}
|
|
1624
1575
|
interface TypeScriptOptions {
|
|
1625
|
-
jsxPragma?: string
|
|
1626
|
-
jsxPragmaFrag?: string
|
|
1627
|
-
onlyRemoveTypeImports?: boolean
|
|
1628
|
-
allowNamespaces?: boolean
|
|
1576
|
+
jsxPragma?: string;
|
|
1577
|
+
jsxPragmaFrag?: string;
|
|
1578
|
+
onlyRemoveTypeImports?: boolean;
|
|
1579
|
+
allowNamespaces?: boolean;
|
|
1629
1580
|
/**
|
|
1630
1581
|
* When enabled, type-only class fields are only removed if they are prefixed with the declare modifier:
|
|
1631
1582
|
*
|
|
@@ -1634,7 +1585,7 @@ interface TypeScriptOptions {
|
|
|
1634
1585
|
* Allowing `declare` fields is built-in support in Oxc without any option. If you want to remove class fields
|
|
1635
1586
|
* without initializer, you can use `remove_class_fields_without_initializer: true` instead.
|
|
1636
1587
|
*/
|
|
1637
|
-
allowDeclareFields?: boolean
|
|
1588
|
+
allowDeclareFields?: boolean;
|
|
1638
1589
|
/**
|
|
1639
1590
|
* When enabled, class fields without initializers are removed.
|
|
1640
1591
|
*
|
|
@@ -1669,7 +1620,7 @@ interface TypeScriptOptions {
|
|
|
1669
1620
|
*
|
|
1670
1621
|
* Defaults to `false`.
|
|
1671
1622
|
*/
|
|
1672
|
-
removeClassFieldsWithoutInitializer?: boolean
|
|
1623
|
+
removeClassFieldsWithoutInitializer?: boolean;
|
|
1673
1624
|
/**
|
|
1674
1625
|
* Also generate a `.d.ts` declaration file for TypeScript files.
|
|
1675
1626
|
*
|
|
@@ -1679,7 +1630,7 @@ interface TypeScriptOptions {
|
|
|
1679
1630
|
*
|
|
1680
1631
|
* @default false
|
|
1681
1632
|
*/
|
|
1682
|
-
declaration?: IsolatedDeclarationsOptions
|
|
1633
|
+
declaration?: IsolatedDeclarationsOptions;
|
|
1683
1634
|
/**
|
|
1684
1635
|
* Rewrite or remove TypeScript import/export declaration extensions.
|
|
1685
1636
|
*
|
|
@@ -1690,13 +1641,12 @@ interface TypeScriptOptions {
|
|
|
1690
1641
|
*
|
|
1691
1642
|
* @default false
|
|
1692
1643
|
*/
|
|
1693
|
-
rewriteImportExtensions?: 'rewrite' | 'remove' | boolean
|
|
1644
|
+
rewriteImportExtensions?: 'rewrite' | 'remove' | boolean;
|
|
1694
1645
|
}
|
|
1695
1646
|
interface ValueSpan {
|
|
1696
|
-
value: string
|
|
1697
|
-
start: number
|
|
1698
|
-
end: number
|
|
1647
|
+
value: string;
|
|
1648
|
+
start: number;
|
|
1649
|
+
end: number;
|
|
1699
1650
|
}
|
|
1700
|
-
|
|
1701
1651
|
//#endregion
|
|
1702
1652
|
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingDynamicImportVarsPluginConfig, BindingHmrOutput, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMfManifest, BindingMinifyOptions, BindingModuleFederationPluginOption, BindingRemote, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWatcherEvent, Bundler, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|