@vizejs/native 0.101.0 → 0.104.0
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/index.d.ts +9 -824
- package/index.js +74 -745
- package/native-binding.js +98 -0
- package/native-targets.js +132 -0
- package/package.json +20 -10
- package/types/art.d.ts +239 -0
- package/types/cli.d.ts +4 -0
- package/types/compiler.d.ts +66 -0
- package/types/css.d.ts +55 -0
- package/types/lint.d.ts +60 -0
- package/types/sfc.d.ts +234 -0
- package/types/tokens.d.ts +73 -0
- package/types/typecheck.d.ts +87 -0
- package/types/vite.d.ts +216 -0
package/types/lint.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/** Lint options for NAPI */
|
|
4
|
+
export interface LintOptionsNapi {
|
|
5
|
+
/** Output format: "text" or "json" */
|
|
6
|
+
format?: string;
|
|
7
|
+
/** Maximum number of warnings before failing */
|
|
8
|
+
maxWarnings?: number;
|
|
9
|
+
/** Quiet mode - only show summary */
|
|
10
|
+
quiet?: boolean;
|
|
11
|
+
/** Automatically fix problems (not yet implemented) */
|
|
12
|
+
fix?: boolean;
|
|
13
|
+
/** Help display level: "full", "short", "none" */
|
|
14
|
+
helpLevel?: string;
|
|
15
|
+
/** Lint preset: "general-recommended", "essential", "incremental", "opinionated", or "nuxt" */
|
|
16
|
+
preset?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Lint result for NAPI */
|
|
20
|
+
export interface LintResultNapi {
|
|
21
|
+
/** Formatted output string */
|
|
22
|
+
output: string;
|
|
23
|
+
/** Total number of errors */
|
|
24
|
+
errorCount: number;
|
|
25
|
+
/** Total number of warnings */
|
|
26
|
+
warningCount: number;
|
|
27
|
+
/** Number of files linted */
|
|
28
|
+
fileCount: number;
|
|
29
|
+
/** Time in milliseconds */
|
|
30
|
+
timeMs: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Single-file Patina lint options for NAPI */
|
|
34
|
+
export interface PatinaLintOptionsNapi {
|
|
35
|
+
/** Filename used for diagnostics */
|
|
36
|
+
filename?: string;
|
|
37
|
+
/** Locale code: "en", "ja", or "zh" */
|
|
38
|
+
locale?: string;
|
|
39
|
+
/** Help display level: "full", "short", or "none" */
|
|
40
|
+
helpLevel?: string;
|
|
41
|
+
/** Lint preset: "general-recommended", "essential", "incremental", "opinionated", or "nuxt" */
|
|
42
|
+
preset?: string;
|
|
43
|
+
/** Optional list of Patina rule names to enable */
|
|
44
|
+
enabledRules?: Array<string>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Get Patina's currently registered rule metadata. */
|
|
48
|
+
export declare function getPatinaRules(): any;
|
|
49
|
+
|
|
50
|
+
/** Lint Vue SFC files matching patterns (native multithreading, .gitignore-aware) */
|
|
51
|
+
export declare function lint(
|
|
52
|
+
patterns: Array<string>,
|
|
53
|
+
options?: LintOptionsNapi | undefined | null,
|
|
54
|
+
): LintResultNapi;
|
|
55
|
+
|
|
56
|
+
/** Lint a single Vue SFC with Patina and return structured diagnostics. */
|
|
57
|
+
export declare function lintPatinaSfc(
|
|
58
|
+
source: string,
|
|
59
|
+
options?: PatinaLintOptionsNapi | undefined | null,
|
|
60
|
+
): any;
|
package/types/sfc.d.ts
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/** Batch compile options for NAPI */
|
|
4
|
+
export interface BatchCompileOptionsNapi {
|
|
5
|
+
ssr?: boolean;
|
|
6
|
+
vapor?: boolean;
|
|
7
|
+
customRenderer?: boolean;
|
|
8
|
+
/** Preserve TypeScript in output when true */
|
|
9
|
+
isTs?: boolean;
|
|
10
|
+
threads?: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Batch compile result for NAPI */
|
|
14
|
+
export interface BatchCompileResultNapi {
|
|
15
|
+
/** Number of files compiled successfully */
|
|
16
|
+
success: number;
|
|
17
|
+
/** Number of files that failed */
|
|
18
|
+
failed: number;
|
|
19
|
+
/** Total input bytes */
|
|
20
|
+
inputBytes: number;
|
|
21
|
+
/** Total output bytes */
|
|
22
|
+
outputBytes: number;
|
|
23
|
+
/** Compilation time in milliseconds */
|
|
24
|
+
timeMs: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Batch compile result with per-file results */
|
|
28
|
+
export interface BatchCompileResultWithFilesNapi {
|
|
29
|
+
/** Per-file compilation results */
|
|
30
|
+
results: Array<BatchFileResultNapi>;
|
|
31
|
+
/** Number of files compiled successfully */
|
|
32
|
+
successCount: number;
|
|
33
|
+
/** Number of files that failed */
|
|
34
|
+
failedCount: number;
|
|
35
|
+
/** Compilation time in milliseconds */
|
|
36
|
+
timeMs: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Input file for batch compilation with results */
|
|
40
|
+
export interface BatchFileInputNapi {
|
|
41
|
+
/** File path */
|
|
42
|
+
path: string;
|
|
43
|
+
/** Source code */
|
|
44
|
+
source: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Per-file result from batch compilation */
|
|
48
|
+
export interface BatchFileResultNapi {
|
|
49
|
+
/** File path */
|
|
50
|
+
path: string;
|
|
51
|
+
/** Generated JavaScript code */
|
|
52
|
+
code: string;
|
|
53
|
+
/** Generated CSS (if any) */
|
|
54
|
+
css?: string;
|
|
55
|
+
/** Scope ID for scoped styles */
|
|
56
|
+
scopeId: string;
|
|
57
|
+
/** Whether the file has scoped styles */
|
|
58
|
+
hasScoped: boolean;
|
|
59
|
+
/** Compilation errors */
|
|
60
|
+
errors: Array<string>;
|
|
61
|
+
/** Compilation warnings */
|
|
62
|
+
warnings: Array<string>;
|
|
63
|
+
/** Hash of template content (for HMR) */
|
|
64
|
+
templateHash?: string;
|
|
65
|
+
/** Hash of style content (for HMR) */
|
|
66
|
+
styleHash?: string;
|
|
67
|
+
/** Hash of script content (for HMR) */
|
|
68
|
+
scriptHash?: string;
|
|
69
|
+
/** Per-block style metadata */
|
|
70
|
+
styles: Array<StyleBlockNapi>;
|
|
71
|
+
/** Custom block metadata */
|
|
72
|
+
customBlocks: Array<CustomBlockNapi>;
|
|
73
|
+
/** Compile-time macro artifacts */
|
|
74
|
+
macroArtifacts: Array<MacroArtifactNapi>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface CustomBlockNapi {
|
|
78
|
+
blockType: string;
|
|
79
|
+
content: string;
|
|
80
|
+
src?: string;
|
|
81
|
+
attrs: Array<SfcBlockAttributeNapi>;
|
|
82
|
+
index: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface MacroArtifactNapi {
|
|
86
|
+
kind: string;
|
|
87
|
+
name: string;
|
|
88
|
+
source: string;
|
|
89
|
+
content: string;
|
|
90
|
+
moduleCode?: string;
|
|
91
|
+
start: number;
|
|
92
|
+
end: number;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface SfcBlockAttributeNapi {
|
|
96
|
+
name: string;
|
|
97
|
+
value?: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** SFC compile options for NAPI */
|
|
101
|
+
export interface SfcCompileOptionsNapi {
|
|
102
|
+
filename?: string;
|
|
103
|
+
sourceMap?: boolean;
|
|
104
|
+
ssr?: boolean;
|
|
105
|
+
vapor?: boolean;
|
|
106
|
+
customRenderer?: boolean;
|
|
107
|
+
/** Preserve TypeScript in output when true */
|
|
108
|
+
isTs?: boolean;
|
|
109
|
+
/** Scope ID for scoped CSS (e.g., "data-v-abc123") */
|
|
110
|
+
scopeId?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** SFC compile result for NAPI */
|
|
114
|
+
export interface SfcCompileResultNapi {
|
|
115
|
+
/** Generated JavaScript code */
|
|
116
|
+
code: string;
|
|
117
|
+
/** Generated CSS (if any) */
|
|
118
|
+
css?: string;
|
|
119
|
+
/** Compilation errors */
|
|
120
|
+
errors: Array<string>;
|
|
121
|
+
/** Compilation warnings */
|
|
122
|
+
warnings: Array<string>;
|
|
123
|
+
/** Hash of template content (for HMR) */
|
|
124
|
+
templateHash?: string;
|
|
125
|
+
/** Hash of style content (for HMR) */
|
|
126
|
+
styleHash?: string;
|
|
127
|
+
/** Hash of script content (for HMR) */
|
|
128
|
+
scriptHash?: string;
|
|
129
|
+
/** Whether the file has scoped styles */
|
|
130
|
+
hasScoped: boolean;
|
|
131
|
+
/** Per-block style metadata */
|
|
132
|
+
styles: Array<StyleBlockNapi>;
|
|
133
|
+
/** Custom block metadata */
|
|
134
|
+
customBlocks: Array<CustomBlockNapi>;
|
|
135
|
+
/** Compile-time macro artifacts */
|
|
136
|
+
macroArtifacts: Array<MacroArtifactNapi>;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** SFC parse options for NAPI */
|
|
140
|
+
export interface SfcParseOptionsNapi {
|
|
141
|
+
filename?: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface SfcSrcInfoNapi {
|
|
145
|
+
scriptSrc?: string;
|
|
146
|
+
templateSrc?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface StyleBlockNapi {
|
|
150
|
+
content: string;
|
|
151
|
+
src?: string;
|
|
152
|
+
lang?: string;
|
|
153
|
+
scoped: boolean;
|
|
154
|
+
module: boolean;
|
|
155
|
+
moduleName?: string;
|
|
156
|
+
index: number;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface TemplateAssetTagRuleNapi {
|
|
160
|
+
tag: string;
|
|
161
|
+
attrs: Array<string>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface TemplateAssetUrlNapi {
|
|
165
|
+
url: string;
|
|
166
|
+
varName: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Compile SFC (.vue file) to JavaScript - main use case */
|
|
170
|
+
export declare function compileSfc(
|
|
171
|
+
source: string,
|
|
172
|
+
options?: SfcCompileOptionsNapi | undefined | null,
|
|
173
|
+
): SfcCompileResultNapi;
|
|
174
|
+
|
|
175
|
+
/** Batch compile SFC files matching a glob pattern (native multithreading) */
|
|
176
|
+
export declare function compileSfcBatch(
|
|
177
|
+
pattern: string,
|
|
178
|
+
options?: BatchCompileOptionsNapi | undefined | null,
|
|
179
|
+
): BatchCompileResultNapi;
|
|
180
|
+
|
|
181
|
+
/** Batch compile SFC files with per-file results (in-memory, native multithreading) */
|
|
182
|
+
export declare function compileSfcBatchWithResults(
|
|
183
|
+
files: Array<BatchFileInputNapi>,
|
|
184
|
+
options?: BatchCompileOptionsNapi | undefined | null,
|
|
185
|
+
): BatchCompileResultWithFilesNapi;
|
|
186
|
+
|
|
187
|
+
export declare function collectSfcTemplateAssetUrls(
|
|
188
|
+
source: string,
|
|
189
|
+
rules?: Array<TemplateAssetTagRuleNapi> | undefined | null,
|
|
190
|
+
filename?: string | undefined | null,
|
|
191
|
+
): Array<TemplateAssetUrlNapi>;
|
|
192
|
+
|
|
193
|
+
export declare function extractSfcCustomBlocks(
|
|
194
|
+
source: string,
|
|
195
|
+
filename?: string | undefined | null,
|
|
196
|
+
): Array<CustomBlockNapi>;
|
|
197
|
+
|
|
198
|
+
export declare function extractSfcSrcInfo(
|
|
199
|
+
source: string,
|
|
200
|
+
filename?: string | undefined | null,
|
|
201
|
+
): SfcSrcInfoNapi;
|
|
202
|
+
|
|
203
|
+
export declare function extractSfcStyleBlocks(
|
|
204
|
+
source: string,
|
|
205
|
+
filename?: string | undefined | null,
|
|
206
|
+
): Array<StyleBlockNapi>;
|
|
207
|
+
|
|
208
|
+
export declare function generateSfcScopeId(
|
|
209
|
+
filename: string,
|
|
210
|
+
root?: string | undefined | null,
|
|
211
|
+
isProduction?: boolean | undefined | null,
|
|
212
|
+
source?: string | undefined | null,
|
|
213
|
+
): string;
|
|
214
|
+
|
|
215
|
+
export declare function hasSfcScopedStyle(
|
|
216
|
+
source: string,
|
|
217
|
+
filename?: string | undefined | null,
|
|
218
|
+
): boolean;
|
|
219
|
+
|
|
220
|
+
export declare function isSfcImportableAssetUrl(url: string): boolean;
|
|
221
|
+
|
|
222
|
+
/** Parse SFC (.vue file) - returns lightweight result for speed */
|
|
223
|
+
export declare function parseSfc(
|
|
224
|
+
source: string,
|
|
225
|
+
options?: SfcParseOptionsNapi | undefined | null,
|
|
226
|
+
): any;
|
|
227
|
+
|
|
228
|
+
export declare function stripSfcScopedCssComments(css: string): string;
|
|
229
|
+
|
|
230
|
+
export declare function wrapSfcScopedPreprocessorStyle(
|
|
231
|
+
content: string,
|
|
232
|
+
scoped?: string | undefined | null,
|
|
233
|
+
lang?: string | undefined | null,
|
|
234
|
+
): string;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
export interface DesignTokenNapi {
|
|
4
|
+
value: string | number;
|
|
5
|
+
type?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
attributes?: any;
|
|
8
|
+
$tier?: "primitive" | "semantic";
|
|
9
|
+
$reference?: string;
|
|
10
|
+
$resolvedValue?: string | number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface DesignTokenCategoryNapi {
|
|
14
|
+
name: string;
|
|
15
|
+
tokens: Record<string, DesignTokenNapi>;
|
|
16
|
+
subcategories?: Array<DesignTokenCategoryNapi>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface DesignTokenValidationNapi {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
error?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface FlattenedDesignTokenNapi {
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
categoryPath: Array<string>;
|
|
28
|
+
value: string | number;
|
|
29
|
+
type?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ResolvedDesignTokensNapi {
|
|
34
|
+
categories: Array<DesignTokenCategoryNapi>;
|
|
35
|
+
tokenMap: Record<string, DesignTokenNapi>;
|
|
36
|
+
tokenCount: number;
|
|
37
|
+
primitiveCount: number;
|
|
38
|
+
semanticCount: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare function buildDesignTokenMap(
|
|
42
|
+
categories: Array<DesignTokenCategoryNapi>,
|
|
43
|
+
): Record<string, DesignTokenNapi>;
|
|
44
|
+
|
|
45
|
+
export declare function findDependentDesignTokens(
|
|
46
|
+
tokenMap: Record<string, DesignTokenNapi>,
|
|
47
|
+
targetPath: string,
|
|
48
|
+
): Array<string>;
|
|
49
|
+
|
|
50
|
+
export declare function flattenDesignTokenCategories(
|
|
51
|
+
categories: Array<DesignTokenCategoryNapi>,
|
|
52
|
+
): Array<FlattenedDesignTokenNapi>;
|
|
53
|
+
|
|
54
|
+
export declare function generateDesignTokensMarkdown(
|
|
55
|
+
categories: Array<DesignTokenCategoryNapi>,
|
|
56
|
+
generatedAt?: string | undefined | null,
|
|
57
|
+
): string;
|
|
58
|
+
|
|
59
|
+
export declare function parseDesignTokensFromJson(source: string): Array<DesignTokenCategoryNapi>;
|
|
60
|
+
|
|
61
|
+
export declare function parseDesignTokensFromPath(
|
|
62
|
+
tokensPath: string,
|
|
63
|
+
): Array<DesignTokenCategoryNapi>;
|
|
64
|
+
|
|
65
|
+
export declare function resolveDesignTokenReferences(
|
|
66
|
+
categories: Array<DesignTokenCategoryNapi>,
|
|
67
|
+
): ResolvedDesignTokensNapi;
|
|
68
|
+
|
|
69
|
+
export declare function validateDesignTokenReference(
|
|
70
|
+
tokenMap: Record<string, DesignTokenNapi>,
|
|
71
|
+
reference: string,
|
|
72
|
+
selfPath?: string | undefined | null,
|
|
73
|
+
): DesignTokenValidationNapi;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
/** Batch type check result for NAPI */
|
|
4
|
+
export interface BatchTypeCheckResultNapi {
|
|
5
|
+
filesChecked: number;
|
|
6
|
+
filesWithErrors: number;
|
|
7
|
+
totalErrors: number;
|
|
8
|
+
totalWarnings: number;
|
|
9
|
+
timeMs: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** Related location for diagnostic (NAPI) */
|
|
13
|
+
export interface RelatedLocationNapi {
|
|
14
|
+
message: string;
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
filename?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Type check capabilities result */
|
|
21
|
+
export interface TypeCheckCapabilitiesNapi {
|
|
22
|
+
mode: string;
|
|
23
|
+
description: string;
|
|
24
|
+
checks: Array<TypeCheckCapabilityNapi>;
|
|
25
|
+
notes: Array<string>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Type check capabilities info */
|
|
29
|
+
export interface TypeCheckCapabilityNapi {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
severity: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Type diagnostic for NAPI */
|
|
36
|
+
export interface TypeDiagnosticNapi {
|
|
37
|
+
severity: string;
|
|
38
|
+
message: string;
|
|
39
|
+
start: number;
|
|
40
|
+
end: number;
|
|
41
|
+
code?: string;
|
|
42
|
+
help?: string;
|
|
43
|
+
related: Array<RelatedLocationNapi>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Type check options for NAPI */
|
|
47
|
+
export interface TypeCheckOptionsNapi {
|
|
48
|
+
filename?: string;
|
|
49
|
+
strict?: boolean;
|
|
50
|
+
includeVirtualTs?: boolean;
|
|
51
|
+
checkProps?: boolean;
|
|
52
|
+
checkEmits?: boolean;
|
|
53
|
+
checkTemplateBindings?: boolean;
|
|
54
|
+
checkReactivity?: boolean;
|
|
55
|
+
checkSetupContext?: boolean;
|
|
56
|
+
checkInvalidExports?: boolean;
|
|
57
|
+
checkFallthroughAttrs?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Type check result for NAPI */
|
|
61
|
+
export interface TypeCheckResultNapi {
|
|
62
|
+
diagnostics: Array<TypeDiagnosticNapi>;
|
|
63
|
+
virtualTs?: string;
|
|
64
|
+
errorCount: number;
|
|
65
|
+
warningCount: number;
|
|
66
|
+
analysisTimeMs?: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Get type checking capabilities info */
|
|
70
|
+
export declare function getTypeCheckCapabilities(): TypeCheckCapabilitiesNapi;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Perform type checking on a Vue SFC
|
|
74
|
+
*
|
|
75
|
+
* This performs AST-based type analysis without requiring a TypeScript compiler.
|
|
76
|
+
* For full type checking, use the CLI with Corsa integration.
|
|
77
|
+
*/
|
|
78
|
+
export declare function typeCheck(
|
|
79
|
+
source: string,
|
|
80
|
+
options?: TypeCheckOptionsNapi | undefined | null,
|
|
81
|
+
): TypeCheckResultNapi;
|
|
82
|
+
|
|
83
|
+
/** Batch type check SFC files matching a glob pattern (native multithreading) */
|
|
84
|
+
export declare function typeCheckBatch(
|
|
85
|
+
pattern: string,
|
|
86
|
+
options?: TypeCheckOptionsNapi | undefined | null,
|
|
87
|
+
): BatchTypeCheckResultNapi;
|
package/types/vite.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
export interface CssAliasRuleNapi {
|
|
4
|
+
find: string;
|
|
5
|
+
replacement: string;
|
|
6
|
+
isRegex: boolean;
|
|
7
|
+
flags?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface DefineReplacementNapi {
|
|
11
|
+
key: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface DynamicImportAliasRuleNapi {
|
|
16
|
+
fromPrefix: string;
|
|
17
|
+
toPrefix: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface HmrHashesNapi {
|
|
21
|
+
scriptHash?: string;
|
|
22
|
+
templateHash?: string;
|
|
23
|
+
styleHash?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ViteIdPartsNapi {
|
|
27
|
+
request: string;
|
|
28
|
+
querySuffix: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ViteDevMiddlewareRewriteNapi {
|
|
32
|
+
cleanedUrl: string;
|
|
33
|
+
fsPath: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface VitePluginRequestNapi {
|
|
37
|
+
/** Path segment before the query string. */
|
|
38
|
+
path: string;
|
|
39
|
+
/** Query suffix including the leading `?`, or an empty string. */
|
|
40
|
+
querySuffix: string;
|
|
41
|
+
/** Path normalized for macro virtual modules (`.vue.ts` -> `.vue`). */
|
|
42
|
+
normalizedVuePath: string;
|
|
43
|
+
/** For `\0...` virtual macro IDs, the real path without the virtual prefix. */
|
|
44
|
+
strippedVirtualPath?: string;
|
|
45
|
+
/** Whether this ID is a Vize-compiled virtual Vue module. */
|
|
46
|
+
isVizeVirtual: boolean;
|
|
47
|
+
/** Whether this ID is a Vize SSR virtual Vue module. */
|
|
48
|
+
isVizeSsrVirtual: boolean;
|
|
49
|
+
/** Real `.vue` path extracted from a Vize virtual Vue module ID. */
|
|
50
|
+
vizeVirtualPath?: string;
|
|
51
|
+
/** Build-safe ID with Vite's `/@fs` prefix removed when present. */
|
|
52
|
+
normalizedFsId?: string;
|
|
53
|
+
/** Whether the query contains `macro=true`. */
|
|
54
|
+
hasMacroQuery: boolean;
|
|
55
|
+
/** Whether the query contains `definePage`. */
|
|
56
|
+
hasDefinePageQuery: boolean;
|
|
57
|
+
/** Whether this is a `\0` virtual ID carrying a macro query. */
|
|
58
|
+
isMacroVirtualId: boolean;
|
|
59
|
+
/** Whether the request points at a Vue SFC after macro normalization. */
|
|
60
|
+
isVueSfcPath: boolean;
|
|
61
|
+
/** Whether the request is a Vite Vue style virtual query. */
|
|
62
|
+
isVueStyleQuery: boolean;
|
|
63
|
+
/** Style block language, defaulting to `css` for style virtual queries. */
|
|
64
|
+
styleLang?: string;
|
|
65
|
+
/** Style block index for style virtual queries. */
|
|
66
|
+
styleIndex?: number;
|
|
67
|
+
/** Scoped attribute value for style virtual queries. */
|
|
68
|
+
styleScoped?: string;
|
|
69
|
+
/** Whether the style query carries a CSS modules marker. */
|
|
70
|
+
hasStyleModule: boolean;
|
|
71
|
+
/** Extension suffix Vite should see for the style pipeline. */
|
|
72
|
+
styleVirtualSuffix?: string;
|
|
73
|
+
/** Vue boundary file kind: `client`, `server`, or undefined. */
|
|
74
|
+
boundaryKind?: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface VitePrecompileChunkOptionsNapi {
|
|
78
|
+
maxBytes?: number;
|
|
79
|
+
metadata?: Array<VitePrecompileFileMetadataEntryNapi>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface VitePrecompileDiffNapi {
|
|
83
|
+
changedFiles: Array<string>;
|
|
84
|
+
deletedFiles: Array<string>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface VitePrecompileFileMetadataEntryNapi {
|
|
88
|
+
path: string;
|
|
89
|
+
mtimeMs: number;
|
|
90
|
+
size: number;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface VitePrecompileFileMetadataNapi {
|
|
94
|
+
mtimeMs: number;
|
|
95
|
+
size: number;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export declare function applyViteDefineReplacements(
|
|
99
|
+
code: string,
|
|
100
|
+
defines: Array<DefineReplacementNapi>,
|
|
101
|
+
): string;
|
|
102
|
+
|
|
103
|
+
export declare function chunkVitePrecompileFiles(
|
|
104
|
+
files: Array<string>,
|
|
105
|
+
batchSize?: number | undefined | null,
|
|
106
|
+
options?: VitePrecompileChunkOptionsNapi | undefined | null,
|
|
107
|
+
): Array<Array<string>>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Classify a Vite plugin module request using the native Vize request model.
|
|
111
|
+
* This keeps pure query parsing and virtual module categorization in Rust while
|
|
112
|
+
* JavaScript keeps Vite hook orchestration and filesystem interactions.
|
|
113
|
+
*/
|
|
114
|
+
export declare function classifyVitePluginRequest(id: string): VitePluginRequestNapi;
|
|
115
|
+
|
|
116
|
+
export declare function createViteBareImportBases(
|
|
117
|
+
root: string,
|
|
118
|
+
importer?: string | undefined | null,
|
|
119
|
+
): Array<string>;
|
|
120
|
+
|
|
121
|
+
export declare function createViteBareImportCandidates(
|
|
122
|
+
id: string,
|
|
123
|
+
aliasRules: Array<CssAliasRuleNapi>,
|
|
124
|
+
resolvedId?: string | undefined | null,
|
|
125
|
+
): Array<string>;
|
|
126
|
+
|
|
127
|
+
export declare function createViteVirtualId(
|
|
128
|
+
realPath: string,
|
|
129
|
+
ssr?: boolean | undefined | null,
|
|
130
|
+
): string;
|
|
131
|
+
|
|
132
|
+
export declare function detectViteHmrUpdateType(
|
|
133
|
+
prev: HmrHashesNapi | undefined | null,
|
|
134
|
+
next: HmrHashesNapi,
|
|
135
|
+
): string;
|
|
136
|
+
|
|
137
|
+
export declare function diffVitePrecompileFiles(
|
|
138
|
+
files: Array<string>,
|
|
139
|
+
currentMetadata: Array<VitePrecompileFileMetadataEntryNapi>,
|
|
140
|
+
previousMetadata: Array<VitePrecompileFileMetadataEntryNapi>,
|
|
141
|
+
): VitePrecompileDiffNapi;
|
|
142
|
+
|
|
143
|
+
export declare function fromViteVirtualId(virtualId: string): string;
|
|
144
|
+
|
|
145
|
+
export declare function generateViteHmrCode(scopeId: string, updateType: string): string;
|
|
146
|
+
|
|
147
|
+
export declare function hasViteHmrChanges(
|
|
148
|
+
prev: HmrHashesNapi | undefined | null,
|
|
149
|
+
next: HmrHashesNapi,
|
|
150
|
+
): boolean;
|
|
151
|
+
|
|
152
|
+
export declare function hasVitePrecompileFileMetadataChanged(
|
|
153
|
+
previous: VitePrecompileFileMetadataNapi | undefined | null,
|
|
154
|
+
next: VitePrecompileFileMetadataNapi,
|
|
155
|
+
): boolean;
|
|
156
|
+
|
|
157
|
+
export declare function isBuiltinViteDefine(key: string): boolean;
|
|
158
|
+
|
|
159
|
+
export declare function isViteBareSpecifier(id: string): boolean;
|
|
160
|
+
|
|
161
|
+
export declare function normalizeViteFsIdForBuild(id: string): string;
|
|
162
|
+
|
|
163
|
+
export declare function normalizeViteCssModuleFilename(filename: string): string;
|
|
164
|
+
|
|
165
|
+
export declare function normalizeViteDevMiddlewareUrl(
|
|
166
|
+
reqUrl: string,
|
|
167
|
+
): ViteDevMiddlewareRewriteNapi | null;
|
|
168
|
+
|
|
169
|
+
export declare function normalizeVitePrecompileBatchSize(value?: number | undefined | null): number;
|
|
170
|
+
|
|
171
|
+
export declare function normalizeViteRequireBase(
|
|
172
|
+
importer?: string | undefined | null,
|
|
173
|
+
): string | null;
|
|
174
|
+
|
|
175
|
+
export declare function normalizeViteResolvedVuePath(id: string): string | null;
|
|
176
|
+
|
|
177
|
+
export declare function normalizeViteVirtualVueModuleId(id: string): string;
|
|
178
|
+
|
|
179
|
+
export declare function resolveViteAliasRequest(
|
|
180
|
+
id: string,
|
|
181
|
+
aliasRules: Array<CssAliasRuleNapi>,
|
|
182
|
+
): string | null;
|
|
183
|
+
|
|
184
|
+
export declare function resolveViteCssImports(
|
|
185
|
+
css: string,
|
|
186
|
+
importer: string,
|
|
187
|
+
aliasRules: Array<CssAliasRuleNapi>,
|
|
188
|
+
isDev?: boolean | undefined | null,
|
|
189
|
+
devUrlBase?: string | undefined | null,
|
|
190
|
+
): string;
|
|
191
|
+
|
|
192
|
+
export declare function resolveViteRelativeImport(id: string, importer: string): string | null;
|
|
193
|
+
|
|
194
|
+
export declare function resolveViteVuePath(
|
|
195
|
+
root: string,
|
|
196
|
+
id: string,
|
|
197
|
+
importer?: string | undefined | null,
|
|
198
|
+
): string;
|
|
199
|
+
|
|
200
|
+
export declare function rewriteViteDynamicTemplateImports(
|
|
201
|
+
code: string,
|
|
202
|
+
aliasRules: Array<DynamicImportAliasRuleNapi>,
|
|
203
|
+
): string;
|
|
204
|
+
|
|
205
|
+
export declare function rewriteViteStaticAssetUrls(
|
|
206
|
+
code: string,
|
|
207
|
+
aliasRules: Array<DynamicImportAliasRuleNapi>,
|
|
208
|
+
): string;
|
|
209
|
+
|
|
210
|
+
export declare function scopeViteCssForPipeline(css: string, scopeId: string): string;
|
|
211
|
+
|
|
212
|
+
export declare function shouldApplyViteDefineInVirtualModule(key: string): boolean;
|
|
213
|
+
|
|
214
|
+
export declare function splitViteIdQuery(id: string): ViteIdPartsNapi;
|
|
215
|
+
|
|
216
|
+
export declare function toViteBrowserImportPrefix(replacement: string): string;
|