@vizejs/native 0.78.0 → 0.81.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 +638 -5
- package/index.js +723 -272
- package/package.json +9 -9
package/index.d.ts
CHANGED
|
@@ -1,12 +1,645 @@
|
|
|
1
|
-
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/** Art descriptor for NAPI */
|
|
4
|
+
export interface ArtDescriptorNapi {
|
|
5
|
+
filename: string;
|
|
6
|
+
metadata: ArtMetadataNapi;
|
|
7
|
+
variants: Array<ArtVariantNapi>;
|
|
8
|
+
hasScriptSetup: boolean;
|
|
9
|
+
hasScript: boolean;
|
|
10
|
+
styleCount: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Art metadata for NAPI */
|
|
14
|
+
export interface ArtMetadataNapi {
|
|
15
|
+
title: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
component?: string;
|
|
18
|
+
category?: string;
|
|
19
|
+
tags: Array<string>;
|
|
20
|
+
status: string;
|
|
21
|
+
order?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Art parse options for NAPI */
|
|
25
|
+
export interface ArtParseOptionsNapi {
|
|
26
|
+
filename?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Transform Art to Storybook CSF 3.0 */
|
|
30
|
+
export declare function artToCsf(
|
|
31
|
+
source: string,
|
|
32
|
+
options?: ArtParseOptionsNapi | undefined | null,
|
|
33
|
+
): CsfOutputNapi;
|
|
34
|
+
|
|
35
|
+
/** Art variant for NAPI */
|
|
36
|
+
export interface ArtVariantNapi {
|
|
37
|
+
name: string;
|
|
38
|
+
template: string;
|
|
39
|
+
isDefault: boolean;
|
|
40
|
+
skipVrt: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface AutogenConfigNapi {
|
|
44
|
+
maxVariants?: number;
|
|
45
|
+
includeDefault?: boolean;
|
|
46
|
+
includeBooleanToggles?: boolean;
|
|
47
|
+
includeEnumVariants?: boolean;
|
|
48
|
+
includeBoundaryValues?: boolean;
|
|
49
|
+
includeEmptyStrings?: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AutogenOutputNapi {
|
|
53
|
+
variants: Array<GeneratedVariantNapi>;
|
|
54
|
+
artFileContent: string;
|
|
55
|
+
componentName: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Batch compile options for NAPI */
|
|
59
|
+
export interface BatchCompileOptionsNapi {
|
|
60
|
+
ssr?: boolean;
|
|
61
|
+
vapor?: boolean;
|
|
62
|
+
customRenderer?: boolean;
|
|
63
|
+
/** Preserve TypeScript in output when true */
|
|
64
|
+
isTs?: boolean;
|
|
65
|
+
threads?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Batch compile result for NAPI */
|
|
69
|
+
export interface BatchCompileResultNapi {
|
|
70
|
+
/** Number of files compiled successfully */
|
|
71
|
+
success: number;
|
|
72
|
+
/** Number of files that failed */
|
|
73
|
+
failed: number;
|
|
74
|
+
/** Total input bytes */
|
|
75
|
+
inputBytes: number;
|
|
76
|
+
/** Total output bytes */
|
|
77
|
+
outputBytes: number;
|
|
78
|
+
/** Compilation time in milliseconds */
|
|
79
|
+
timeMs: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Batch compile result with per-file results */
|
|
83
|
+
export interface BatchCompileResultWithFilesNapi {
|
|
84
|
+
/** Per-file compilation results */
|
|
85
|
+
results: Array<BatchFileResultNapi>;
|
|
86
|
+
/** Number of files compiled successfully */
|
|
87
|
+
successCount: number;
|
|
88
|
+
/** Number of files that failed */
|
|
89
|
+
failedCount: number;
|
|
90
|
+
/** Compilation time in milliseconds */
|
|
91
|
+
timeMs: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Input file for batch compilation with results */
|
|
95
|
+
export interface BatchFileInputNapi {
|
|
96
|
+
/** File path */
|
|
97
|
+
path: string;
|
|
98
|
+
/** Source code */
|
|
99
|
+
source: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Per-file result from batch compilation */
|
|
103
|
+
export interface BatchFileResultNapi {
|
|
104
|
+
/** File path */
|
|
105
|
+
path: string;
|
|
106
|
+
/** Generated JavaScript code */
|
|
107
|
+
code: string;
|
|
108
|
+
/** Generated CSS (if any) */
|
|
109
|
+
css?: string;
|
|
110
|
+
/** Scope ID for scoped styles */
|
|
111
|
+
scopeId: string;
|
|
112
|
+
/** Whether the file has scoped styles */
|
|
113
|
+
hasScoped: boolean;
|
|
114
|
+
/** Compilation errors */
|
|
115
|
+
errors: Array<string>;
|
|
116
|
+
/** Compilation warnings */
|
|
117
|
+
warnings: Array<string>;
|
|
118
|
+
/** Hash of template content (for HMR) */
|
|
119
|
+
templateHash?: string;
|
|
120
|
+
/** Hash of style content (for HMR) */
|
|
121
|
+
styleHash?: string;
|
|
122
|
+
/** Hash of script content (for HMR) */
|
|
123
|
+
scriptHash?: string;
|
|
124
|
+
/** Compile-time macro artifacts */
|
|
125
|
+
macroArtifacts: Array<MacroArtifactNapi>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Batch type check result for NAPI */
|
|
129
|
+
export interface BatchTypeCheckResultNapi {
|
|
130
|
+
filesChecked: number;
|
|
131
|
+
filesWithErrors: number;
|
|
132
|
+
totalErrors: number;
|
|
133
|
+
totalWarnings: number;
|
|
134
|
+
timeMs: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** Catalog entry for NAPI */
|
|
138
|
+
export interface CatalogEntryNapi {
|
|
139
|
+
title: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
category?: string;
|
|
142
|
+
tags: Array<string>;
|
|
143
|
+
status: string;
|
|
144
|
+
variantCount: number;
|
|
145
|
+
docPath: string;
|
|
146
|
+
sourcePath: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Catalog output for NAPI */
|
|
150
|
+
export interface CatalogOutputNapi {
|
|
151
|
+
markdown: string;
|
|
152
|
+
filename: string;
|
|
153
|
+
componentCount: number;
|
|
154
|
+
categories: Array<string>;
|
|
155
|
+
tags: Array<string>;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Compile Vue template to VDom render function */
|
|
159
|
+
export declare function compile(
|
|
160
|
+
template: string,
|
|
161
|
+
options?: CompilerOptions | undefined | null,
|
|
162
|
+
): CompileResult;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Compile a CSS string with scoped CSS, v-bind() extraction, and optional minification.
|
|
166
|
+
* Unlike `compileSfc`, the `scopeId` is used as-is without stripping the "data-v-" prefix.
|
|
167
|
+
* Callers must pass the full attribute name (e.g., "data-v-abc123").
|
|
168
|
+
*/
|
|
169
|
+
export declare function compileCss(
|
|
170
|
+
source: string,
|
|
171
|
+
options?: CssCompileOptionsNapi | undefined | null,
|
|
172
|
+
): CssCompileResultNapi;
|
|
173
|
+
|
|
174
|
+
/** Compile result */
|
|
175
|
+
export interface CompileResult {
|
|
176
|
+
/** Generated code */
|
|
177
|
+
code: string;
|
|
178
|
+
/** Preamble code (imports) */
|
|
179
|
+
preamble: string;
|
|
180
|
+
/** AST (serialized as JSON) */
|
|
181
|
+
ast: any;
|
|
182
|
+
/** Source map */
|
|
183
|
+
map?: any;
|
|
184
|
+
/** Used helpers */
|
|
185
|
+
helpers: Array<string>;
|
|
186
|
+
/** Template strings for Vapor mode static parts */
|
|
187
|
+
templates?: Array<string>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Compiler options for bindings */
|
|
191
|
+
export interface CompilerOptions {
|
|
192
|
+
/** Output mode: "module" or "function" */
|
|
193
|
+
mode?: string;
|
|
194
|
+
/** Whether to prefix identifiers */
|
|
195
|
+
prefixIdentifiers?: boolean;
|
|
196
|
+
/** Whether to hoist static nodes */
|
|
197
|
+
hoistStatic?: boolean;
|
|
198
|
+
/** Whether to cache event handlers */
|
|
199
|
+
cacheHandlers?: boolean;
|
|
200
|
+
/** Scope ID for scoped CSS */
|
|
201
|
+
scopeId?: string;
|
|
202
|
+
/** Whether in SSR mode */
|
|
203
|
+
ssr?: boolean;
|
|
204
|
+
/** Whether to generate source map */
|
|
205
|
+
sourceMap?: boolean;
|
|
206
|
+
/** Filename for source map */
|
|
207
|
+
filename?: string;
|
|
208
|
+
/** Output mode: "vdom" or "vapor" */
|
|
209
|
+
outputMode?: string;
|
|
210
|
+
/** Whether the template contains TypeScript */
|
|
211
|
+
isTs?: boolean;
|
|
212
|
+
/** Whether the template targets a custom renderer instead of the DOM. */
|
|
213
|
+
customRenderer?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Script extension handling: "preserve" (keep TypeScript) or "downcompile" (transpile to JS)
|
|
216
|
+
* Defaults to "downcompile"
|
|
217
|
+
*/
|
|
218
|
+
scriptExt?: string;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Compile SFC (.vue file) to JavaScript - main use case */
|
|
222
|
+
export declare function compileSfc(
|
|
223
|
+
source: string,
|
|
224
|
+
options?: SfcCompileOptionsNapi | undefined | null,
|
|
225
|
+
): SfcCompileResultNapi;
|
|
226
|
+
|
|
227
|
+
/** Batch compile SFC files matching a glob pattern (native multithreading) */
|
|
228
|
+
export declare function compileSfcBatch(
|
|
229
|
+
pattern: string,
|
|
230
|
+
options?: BatchCompileOptionsNapi | undefined | null,
|
|
231
|
+
): BatchCompileResultNapi;
|
|
232
|
+
|
|
233
|
+
/** Batch compile SFC files with per-file results (in-memory, native multithreading) */
|
|
234
|
+
export declare function compileSfcBatchWithResults(
|
|
235
|
+
files: Array<BatchFileInputNapi>,
|
|
236
|
+
options?: BatchCompileOptionsNapi | undefined | null,
|
|
237
|
+
): BatchCompileResultWithFilesNapi;
|
|
238
|
+
|
|
239
|
+
/** Compile Vue template to Vapor mode */
|
|
240
|
+
export declare function compileVapor(
|
|
241
|
+
template: string,
|
|
242
|
+
options?: CompilerOptions | undefined | null,
|
|
243
|
+
): CompileResult;
|
|
244
|
+
|
|
245
|
+
/** CSF output for NAPI */
|
|
246
|
+
export interface CsfOutputNapi {
|
|
247
|
+
code: string;
|
|
248
|
+
filename: string;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** CSS compile options for NAPI */
|
|
252
|
+
export interface CssCompileOptionsNapi {
|
|
253
|
+
/** Filename for error reporting */
|
|
254
|
+
filename?: string;
|
|
255
|
+
/** Whether to apply scoped CSS transformation */
|
|
256
|
+
scoped?: boolean;
|
|
257
|
+
/** Scope ID for scoped CSS (e.g., "data-v-abc123"). Must be the full attribute name. */
|
|
258
|
+
scopeId?: string;
|
|
259
|
+
/** Whether to generate source maps */
|
|
260
|
+
sourceMap?: boolean;
|
|
261
|
+
/** Whether to minify the output */
|
|
262
|
+
minify?: boolean;
|
|
263
|
+
/** Whether to enable CSS Modules transforms */
|
|
264
|
+
cssModules?: boolean;
|
|
265
|
+
/** Whether to enable custom media query resolution */
|
|
266
|
+
customMedia?: boolean;
|
|
267
|
+
/** Browser targets for autoprefixing */
|
|
268
|
+
targets?: CssTargetsNapi;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** CSS compile result for NAPI */
|
|
272
|
+
export interface CssCompileResultNapi {
|
|
273
|
+
/** Compiled CSS code */
|
|
274
|
+
code: string;
|
|
275
|
+
/** Source map (if requested) */
|
|
276
|
+
map?: string;
|
|
277
|
+
/** CSS variables found (from v-bind()) */
|
|
278
|
+
cssVars: Array<string>;
|
|
279
|
+
/** Errors during compilation */
|
|
280
|
+
errors: Array<string>;
|
|
281
|
+
/** Warnings during compilation */
|
|
282
|
+
warnings: Array<string>;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** Browser targets for CSS autoprefixing */
|
|
286
|
+
export interface CssTargetsNapi {
|
|
287
|
+
chrome?: number;
|
|
288
|
+
firefox?: number;
|
|
289
|
+
safari?: number;
|
|
290
|
+
edge?: number;
|
|
291
|
+
ios?: number;
|
|
292
|
+
android?: number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/** Declaration generation options for NAPI */
|
|
296
|
+
export interface DeclarationOptionsNapi {
|
|
297
|
+
filename?: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/** Declaration generation result for NAPI */
|
|
301
|
+
export interface DeclarationResultNapi {
|
|
302
|
+
code: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/** Doc options for NAPI */
|
|
306
|
+
export interface DocOptionsNapi {
|
|
307
|
+
includeSource?: boolean;
|
|
308
|
+
includeTemplates?: boolean;
|
|
309
|
+
includeMetadata?: boolean;
|
|
310
|
+
includeToc?: boolean;
|
|
311
|
+
tocThreshold?: number;
|
|
312
|
+
basePath?: string;
|
|
313
|
+
title?: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** Doc output for NAPI */
|
|
317
|
+
export interface DocOutputNapi {
|
|
318
|
+
markdown: string;
|
|
319
|
+
filename: string;
|
|
320
|
+
title: string;
|
|
321
|
+
category?: string;
|
|
322
|
+
variantCount: number;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/** Format options for NAPI. */
|
|
326
|
+
export interface FormatOptionsNapi {
|
|
327
|
+
printWidth?: number;
|
|
328
|
+
tabWidth?: number;
|
|
329
|
+
useTabs?: boolean;
|
|
330
|
+
semi?: boolean;
|
|
331
|
+
singleQuote?: boolean;
|
|
332
|
+
sortAttributes?: boolean;
|
|
333
|
+
singleAttributePerLine?: boolean;
|
|
334
|
+
maxAttributesPerLine?: number;
|
|
335
|
+
normalizeDirectiveShorthands?: boolean;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/** Format result for NAPI. */
|
|
339
|
+
export interface FormatResultNapi {
|
|
340
|
+
code: string;
|
|
341
|
+
changed: boolean;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/** Format a Vue SFC source string. */
|
|
345
|
+
export declare function formatSfc(
|
|
346
|
+
source: string,
|
|
347
|
+
options?: FormatOptionsNapi | undefined | null,
|
|
348
|
+
): FormatResultNapi;
|
|
349
|
+
|
|
350
|
+
/** Generate catalog from multiple Art sources (high-performance batch) */
|
|
351
|
+
export declare function generateArtCatalog(
|
|
352
|
+
sources: Array<string>,
|
|
353
|
+
docOptions?: DocOptionsNapi | undefined | null,
|
|
354
|
+
): CatalogOutputNapi;
|
|
355
|
+
|
|
356
|
+
/** Generate component documentation from Art source */
|
|
357
|
+
export declare function generateArtDoc(
|
|
358
|
+
source: string,
|
|
359
|
+
artOptions?: ArtParseOptionsNapi | undefined | null,
|
|
360
|
+
docOptions?: DocOptionsNapi | undefined | null,
|
|
361
|
+
): DocOutputNapi;
|
|
362
|
+
|
|
363
|
+
/** Batch generate docs with parallel processing */
|
|
364
|
+
export declare function generateArtDocsBatch(
|
|
365
|
+
sources: Array<string>,
|
|
366
|
+
docOptions?: DocOptionsNapi | undefined | null,
|
|
367
|
+
): Array<DocOutputNapi>;
|
|
368
|
+
|
|
369
|
+
/** Generate props palette from Art source */
|
|
370
|
+
export declare function generateArtPalette(
|
|
371
|
+
source: string,
|
|
372
|
+
artOptions?: ArtParseOptionsNapi | undefined | null,
|
|
373
|
+
paletteOptions?: PaletteOptionsNapi | undefined | null,
|
|
374
|
+
): PaletteOutputNapi;
|
|
375
|
+
|
|
376
|
+
/** Generate a Vue SFC `.d.ts` declaration from Croquis analysis. */
|
|
377
|
+
export declare function generateDeclaration(
|
|
378
|
+
source: string,
|
|
379
|
+
options?: DeclarationOptionsNapi | undefined | null,
|
|
380
|
+
): DeclarationResultNapi;
|
|
381
|
+
|
|
382
|
+
export interface GeneratedVariantNapi {
|
|
383
|
+
name: string;
|
|
384
|
+
isDefault: boolean;
|
|
385
|
+
props: any;
|
|
386
|
+
description?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/** Generate .art.vue variants from component prop definitions */
|
|
390
|
+
export declare function generateVariants(
|
|
391
|
+
componentPath: string,
|
|
392
|
+
props: Array<PropDefinitionNapi>,
|
|
393
|
+
config?: AutogenConfigNapi | undefined | null,
|
|
394
|
+
): AutogenOutputNapi;
|
|
395
|
+
|
|
396
|
+
/** Get Patina's currently registered rule metadata. */
|
|
397
|
+
export declare function getPatinaRules(): any;
|
|
398
|
+
|
|
399
|
+
/** Get type checking capabilities info */
|
|
400
|
+
export declare function getTypeCheckCapabilities(): TypeCheckCapabilitiesNapi;
|
|
401
|
+
|
|
402
|
+
/** Lint Vue SFC files matching patterns (native multithreading, .gitignore-aware) */
|
|
403
|
+
export declare function lint(
|
|
404
|
+
patterns: Array<string>,
|
|
405
|
+
options?: LintOptionsNapi | undefined | null,
|
|
406
|
+
): LintResultNapi;
|
|
407
|
+
|
|
408
|
+
/** Lint options for NAPI */
|
|
409
|
+
export interface LintOptionsNapi {
|
|
410
|
+
/** Output format: "text" or "json" */
|
|
411
|
+
format?: string;
|
|
412
|
+
/** Maximum number of warnings before failing */
|
|
413
|
+
maxWarnings?: number;
|
|
414
|
+
/** Quiet mode - only show summary */
|
|
415
|
+
quiet?: boolean;
|
|
416
|
+
/** Automatically fix problems (not yet implemented) */
|
|
417
|
+
fix?: boolean;
|
|
418
|
+
/** Help display level: "full", "short", "none" */
|
|
419
|
+
helpLevel?: string;
|
|
420
|
+
/** Lint preset: "general-recommended", "essential", "incremental", "opinionated", or "nuxt" */
|
|
421
|
+
preset?: string;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** Lint a single Vue SFC with Patina and return structured diagnostics. */
|
|
425
|
+
export declare function lintPatinaSfc(
|
|
426
|
+
source: string,
|
|
427
|
+
options?: PatinaLintOptionsNapi | undefined | null,
|
|
428
|
+
): any;
|
|
429
|
+
|
|
430
|
+
/** Lint result for NAPI */
|
|
431
|
+
export interface LintResultNapi {
|
|
432
|
+
/** Formatted output string */
|
|
433
|
+
output: string;
|
|
434
|
+
/** Total number of errors */
|
|
435
|
+
errorCount: number;
|
|
436
|
+
/** Total number of warnings */
|
|
437
|
+
warningCount: number;
|
|
438
|
+
/** Number of files linted */
|
|
439
|
+
fileCount: number;
|
|
440
|
+
/** Time in milliseconds */
|
|
441
|
+
timeMs: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export interface MacroArtifactNapi {
|
|
445
|
+
kind: string;
|
|
446
|
+
name: string;
|
|
447
|
+
source: string;
|
|
448
|
+
content: string;
|
|
449
|
+
moduleCode?: string;
|
|
450
|
+
start: number;
|
|
451
|
+
end: number;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** Palette options for NAPI */
|
|
455
|
+
export interface PaletteOptionsNapi {
|
|
456
|
+
inferOptions?: boolean;
|
|
457
|
+
minSelectValues?: number;
|
|
458
|
+
maxSelectValues?: number;
|
|
459
|
+
groupByType?: boolean;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/** Palette output for NAPI */
|
|
463
|
+
export interface PaletteOutputNapi {
|
|
464
|
+
title: string;
|
|
465
|
+
controls: Array<PropControlNapi>;
|
|
466
|
+
groups: Array<string>;
|
|
467
|
+
json: string;
|
|
468
|
+
typescript: string;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/** Parse Art file (*.art.vue) */
|
|
472
|
+
export declare function parseArt(
|
|
473
|
+
source: string,
|
|
474
|
+
options?: ArtParseOptionsNapi | undefined | null,
|
|
475
|
+
): ArtDescriptorNapi;
|
|
476
|
+
|
|
477
|
+
/** Parse SFC (.vue file) - returns lightweight result for speed */
|
|
478
|
+
export declare function parseSfc(
|
|
479
|
+
source: string,
|
|
480
|
+
options?: SfcParseOptionsNapi | undefined | null,
|
|
481
|
+
): any;
|
|
482
|
+
|
|
483
|
+
/** Parse template to AST only */
|
|
484
|
+
export declare function parseTemplate(
|
|
485
|
+
template: string,
|
|
486
|
+
options?: CompilerOptions | undefined | null,
|
|
487
|
+
): any;
|
|
488
|
+
|
|
489
|
+
/** Single-file Patina lint options for NAPI */
|
|
490
|
+
export interface PatinaLintOptionsNapi {
|
|
491
|
+
/** Filename used for diagnostics */
|
|
2
492
|
filename?: string;
|
|
493
|
+
/** Locale code: "en", "ja", or "zh" */
|
|
494
|
+
locale?: string;
|
|
495
|
+
/** Help display level: "full", "short", or "none" */
|
|
496
|
+
helpLevel?: string;
|
|
497
|
+
/** Lint preset: "general-recommended", "essential", "incremental", "opinionated", or "nuxt" */
|
|
498
|
+
preset?: string;
|
|
499
|
+
/** Optional list of Patina rule names to enable */
|
|
500
|
+
enabledRules?: Array<string>;
|
|
3
501
|
}
|
|
4
502
|
|
|
5
|
-
|
|
503
|
+
/** Prop control for NAPI */
|
|
504
|
+
export interface PropControlNapi {
|
|
505
|
+
name: string;
|
|
506
|
+
control: string;
|
|
507
|
+
defaultValue?: any;
|
|
508
|
+
description?: string;
|
|
509
|
+
required: boolean;
|
|
510
|
+
options: Array<SelectOptionNapi>;
|
|
511
|
+
range?: RangeConfigNapi;
|
|
512
|
+
group?: string;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export interface PropDefinitionNapi {
|
|
516
|
+
name: string;
|
|
517
|
+
propType: string;
|
|
518
|
+
required: boolean;
|
|
519
|
+
defaultValue?: any;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/** Range config for NAPI */
|
|
523
|
+
export interface RangeConfigNapi {
|
|
524
|
+
min: number;
|
|
525
|
+
max: number;
|
|
526
|
+
step?: number;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** Related location for diagnostic (NAPI) */
|
|
530
|
+
export interface RelatedLocationNapi {
|
|
531
|
+
message: string;
|
|
532
|
+
start: number;
|
|
533
|
+
end: number;
|
|
534
|
+
filename?: string;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/** Select option for NAPI */
|
|
538
|
+
export interface SelectOptionNapi {
|
|
539
|
+
label: string;
|
|
540
|
+
value: any;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/** SFC compile options for NAPI */
|
|
544
|
+
export interface SfcCompileOptionsNapi {
|
|
545
|
+
filename?: string;
|
|
546
|
+
sourceMap?: boolean;
|
|
547
|
+
ssr?: boolean;
|
|
548
|
+
vapor?: boolean;
|
|
549
|
+
customRenderer?: boolean;
|
|
550
|
+
/** Preserve TypeScript in output when true */
|
|
551
|
+
isTs?: boolean;
|
|
552
|
+
/** Scope ID for scoped CSS (e.g., "data-v-abc123") */
|
|
553
|
+
scopeId?: string;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/** SFC compile result for NAPI */
|
|
557
|
+
export interface SfcCompileResultNapi {
|
|
558
|
+
/** Generated JavaScript code */
|
|
6
559
|
code: string;
|
|
560
|
+
/** Generated CSS (if any) */
|
|
561
|
+
css?: string;
|
|
562
|
+
/** Compilation errors */
|
|
563
|
+
errors: Array<string>;
|
|
564
|
+
/** Compilation warnings */
|
|
565
|
+
warnings: Array<string>;
|
|
566
|
+
/** Hash of template content (for HMR) */
|
|
567
|
+
templateHash?: string;
|
|
568
|
+
/** Hash of style content (for HMR) */
|
|
569
|
+
styleHash?: string;
|
|
570
|
+
/** Hash of script content (for HMR) */
|
|
571
|
+
scriptHash?: string;
|
|
572
|
+
/** Compile-time macro artifacts */
|
|
573
|
+
macroArtifacts: Array<MacroArtifactNapi>;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** SFC parse options for NAPI */
|
|
577
|
+
export interface SfcParseOptionsNapi {
|
|
578
|
+
filename?: string;
|
|
7
579
|
}
|
|
8
580
|
|
|
9
|
-
|
|
581
|
+
/**
|
|
582
|
+
* Perform type checking on a Vue SFC
|
|
583
|
+
*
|
|
584
|
+
* This performs AST-based type analysis without requiring a TypeScript compiler.
|
|
585
|
+
* For full type checking, use the CLI with Corsa integration.
|
|
586
|
+
*/
|
|
587
|
+
export declare function typeCheck(
|
|
10
588
|
source: string,
|
|
11
|
-
options?:
|
|
12
|
-
):
|
|
589
|
+
options?: TypeCheckOptionsNapi | undefined | null,
|
|
590
|
+
): TypeCheckResultNapi;
|
|
591
|
+
|
|
592
|
+
/** Batch type check SFC files matching a glob pattern (native multithreading) */
|
|
593
|
+
export declare function typeCheckBatch(
|
|
594
|
+
pattern: string,
|
|
595
|
+
options?: TypeCheckOptionsNapi | undefined | null,
|
|
596
|
+
): BatchTypeCheckResultNapi;
|
|
597
|
+
|
|
598
|
+
/** Type check capabilities result */
|
|
599
|
+
export interface TypeCheckCapabilitiesNapi {
|
|
600
|
+
mode: string;
|
|
601
|
+
description: string;
|
|
602
|
+
checks: Array<TypeCheckCapabilityNapi>;
|
|
603
|
+
notes: Array<string>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/** Type check capabilities info */
|
|
607
|
+
export interface TypeCheckCapabilityNapi {
|
|
608
|
+
name: string;
|
|
609
|
+
description: string;
|
|
610
|
+
severity: string;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/** Type check options for NAPI */
|
|
614
|
+
export interface TypeCheckOptionsNapi {
|
|
615
|
+
filename?: string;
|
|
616
|
+
strict?: boolean;
|
|
617
|
+
includeVirtualTs?: boolean;
|
|
618
|
+
checkProps?: boolean;
|
|
619
|
+
checkEmits?: boolean;
|
|
620
|
+
checkTemplateBindings?: boolean;
|
|
621
|
+
checkReactivity?: boolean;
|
|
622
|
+
checkSetupContext?: boolean;
|
|
623
|
+
checkInvalidExports?: boolean;
|
|
624
|
+
checkFallthroughAttrs?: boolean;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/** Type check result for NAPI */
|
|
628
|
+
export interface TypeCheckResultNapi {
|
|
629
|
+
diagnostics: Array<TypeDiagnosticNapi>;
|
|
630
|
+
virtualTs?: string;
|
|
631
|
+
errorCount: number;
|
|
632
|
+
warningCount: number;
|
|
633
|
+
analysisTimeMs?: number;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/** Type diagnostic for NAPI */
|
|
637
|
+
export interface TypeDiagnosticNapi {
|
|
638
|
+
severity: string;
|
|
639
|
+
message: string;
|
|
640
|
+
start: number;
|
|
641
|
+
end: number;
|
|
642
|
+
code?: string;
|
|
643
|
+
help?: string;
|
|
644
|
+
related: Array<RelatedLocationNapi>;
|
|
645
|
+
}
|