@vizejs/native 0.166.0 → 0.168.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.
Files changed (3) hide show
  1. package/index.d.ts +941 -9
  2. package/index.js +759 -62
  3. package/package.json +9 -9
package/index.d.ts CHANGED
@@ -1,12 +1,944 @@
1
1
  /* auto-generated by NAPI-RS */
2
2
  /* eslint-disable */
3
+ export declare function applyViteDefineReplacements(
4
+ code: string,
5
+ defines: Array<DefineReplacementNapi>,
6
+ ): string;
3
7
 
4
- export * from "./types/art";
5
- export * from "./types/cli";
6
- export * from "./types/compiler";
7
- export * from "./types/css";
8
- export * from "./types/lint";
9
- export * from "./types/sfc";
10
- export * from "./types/tokens";
11
- export * from "./types/typecheck";
12
- export * from "./types/vite";
8
+ /** Art descriptor for NAPI */
9
+ export interface ArtDescriptorNapi {
10
+ filename: string;
11
+ metadata: ArtMetadataNapi;
12
+ variants: Array<ArtVariantNapi>;
13
+ hasScriptSetup: boolean;
14
+ hasScript: boolean;
15
+ styleCount: number;
16
+ }
17
+
18
+ /** Art metadata for NAPI */
19
+ export interface ArtMetadataNapi {
20
+ title: string;
21
+ description?: string;
22
+ component?: string;
23
+ category?: string;
24
+ tags: Array<string>;
25
+ status: string;
26
+ order?: number;
27
+ }
28
+
29
+ /** Art parse options for NAPI */
30
+ export interface ArtParseOptionsNapi {
31
+ filename?: string;
32
+ }
33
+
34
+ /** Transform Art to Storybook CSF 3.0 */
35
+ export declare function artToCsf(
36
+ source: string,
37
+ options?: ArtParseOptionsNapi | undefined | null,
38
+ ): CsfOutputNapi;
39
+
40
+ /** Art variant for NAPI */
41
+ export interface ArtVariantNapi {
42
+ name: string;
43
+ template: string;
44
+ isDefault: boolean;
45
+ skipVrt: boolean;
46
+ }
47
+
48
+ export interface AutogenConfigNapi {
49
+ maxVariants?: number;
50
+ includeDefault?: boolean;
51
+ includeBooleanToggles?: boolean;
52
+ includeEnumVariants?: boolean;
53
+ includeBoundaryValues?: boolean;
54
+ includeEmptyStrings?: boolean;
55
+ }
56
+
57
+ export interface AutogenOutputNapi {
58
+ variants: Array<GeneratedVariantNapi>;
59
+ artFileContent: string;
60
+ componentName: string;
61
+ }
62
+
63
+ export interface BatchCompileOptionsNapi {
64
+ ssr?: boolean;
65
+ vapor?: boolean;
66
+ customRenderer?: boolean;
67
+ vueParserQuirks?: boolean;
68
+ /** Preserve TypeScript in output when true */
69
+ isTs?: boolean;
70
+ threads?: number;
71
+ }
72
+
73
+ export interface BatchCompileResultNapi {
74
+ success: number;
75
+ failed: number;
76
+ inputBytes: number;
77
+ outputBytes: number;
78
+ timeMs: number;
79
+ }
80
+
81
+ export interface BatchCompileResultWithFilesNapi {
82
+ results: Array<BatchFileResultNapi>;
83
+ successCount: number;
84
+ failedCount: number;
85
+ timeMs: number;
86
+ }
87
+
88
+ export interface BatchFileInputNapi {
89
+ path: string;
90
+ source: string;
91
+ }
92
+
93
+ export interface BatchFileResultNapi {
94
+ path: string;
95
+ code: string;
96
+ css?: string;
97
+ scopeId: string;
98
+ hasScoped: boolean;
99
+ errors: Array<string>;
100
+ warnings: Array<string>;
101
+ templateHash?: string;
102
+ styleHash?: string;
103
+ scriptHash?: string;
104
+ styles: Array<StyleBlockNapi>;
105
+ customBlocks: Array<CustomBlockNapi>;
106
+ macroArtifacts: Array<MacroArtifactNapi>;
107
+ }
108
+
109
+ /** Batch type check result for NAPI */
110
+ export interface BatchTypeCheckResultNapi {
111
+ filesChecked: number;
112
+ filesWithErrors: number;
113
+ totalErrors: number;
114
+ totalWarnings: number;
115
+ timeMs: number;
116
+ }
117
+
118
+ export declare function buildDesignTokenMap(categories: string): string;
119
+
120
+ /** Catalog entry for NAPI */
121
+ export interface CatalogEntryNapi {
122
+ title: string;
123
+ description?: string;
124
+ category?: string;
125
+ tags: Array<string>;
126
+ status: string;
127
+ variantCount: number;
128
+ docPath: string;
129
+ sourcePath: string;
130
+ }
131
+
132
+ /** Catalog output for NAPI */
133
+ export interface CatalogOutputNapi {
134
+ markdown: string;
135
+ filename: string;
136
+ componentCount: number;
137
+ categories: Array<string>;
138
+ tags: Array<string>;
139
+ }
140
+
141
+ export declare function chunkVitePrecompileFiles(
142
+ files: Array<string>,
143
+ batchSize?: number | undefined | null,
144
+ options?: VitePrecompileChunkOptionsNapi | undefined | null,
145
+ ): Array<Array<string>>;
146
+
147
+ export declare function classifyVitePluginRequest(id: string): VitePluginRequestNapi;
148
+
149
+ export declare function collectSfcTemplateAssetUrls(
150
+ source: string,
151
+ rules?: Array<TemplateAssetTagRuleNapi> | undefined | null,
152
+ filename?: string | undefined | null,
153
+ ): Array<TemplateAssetUrlNapi>;
154
+
155
+ /** Compile Vue template to VDom render function */
156
+ export declare function compile(
157
+ template: string,
158
+ options?: CompilerOptions | undefined | null,
159
+ ): CompileResult;
160
+
161
+ export declare function compileCss(
162
+ source: string,
163
+ options?: CssCompileOptionsNapi | undefined | null,
164
+ ): CssCompileResultNapi;
165
+
166
+ /** Compile result */
167
+ export interface CompileResult {
168
+ /** Generated code */
169
+ code: string;
170
+ /** Preamble code (imports) */
171
+ preamble: string;
172
+ /** AST (serialized as JSON) */
173
+ ast: any;
174
+ /** Source map */
175
+ map?: any;
176
+ /** Used helpers */
177
+ helpers: Array<string>;
178
+ /** Template strings for Vapor mode static parts */
179
+ templates?: Array<string>;
180
+ }
181
+
182
+ /** Compiler options for bindings */
183
+ export interface CompilerOptions {
184
+ /** Output mode: "module" or "function" */
185
+ mode?: string;
186
+ /** Whether to prefix identifiers */
187
+ prefixIdentifiers?: boolean;
188
+ /** Whether to hoist static nodes */
189
+ hoistStatic?: boolean;
190
+ /** Whether to cache event handlers */
191
+ cacheHandlers?: boolean;
192
+ /** Scope ID for scoped CSS */
193
+ scopeId?: string;
194
+ /** Whether in SSR mode */
195
+ ssr?: boolean;
196
+ /** Whether to generate source map */
197
+ sourceMap?: boolean;
198
+ /** Filename for source map */
199
+ filename?: string;
200
+ /** Output mode: "vdom" or "vapor" */
201
+ outputMode?: string;
202
+ /** Whether the template contains TypeScript */
203
+ isTs?: boolean;
204
+ /** Whether the template targets a custom renderer instead of the DOM. */
205
+ customRenderer?: boolean;
206
+ /** Enable Vue parser quirk compatibility for known edge cases. */
207
+ vueParserQuirks?: boolean;
208
+ /**
209
+ * Script extension handling: "preserve" (keep TypeScript) or "downcompile" (transpile to JS)
210
+ * Defaults to "downcompile"
211
+ */
212
+ scriptExt?: string;
213
+ }
214
+
215
+ export declare function compileSfc(
216
+ source: string,
217
+ options?: SfcCompileOptionsNapi | undefined | null,
218
+ ): SfcCompileResultNapi;
219
+
220
+ /**
221
+ * Compiles a glob of Vue SFCs and returns aggregate stats for the native API.
222
+ *
223
+ * This stats-only surface is intentionally optimized differently from
224
+ * `compileSfcBatchWithResults`: because no per-file code crosses the JS/native
225
+ * boundary, repeated SFC bodies are grouped before parallel compilation. The
226
+ * representative compile produces one output length, and the counters are
227
+ * multiplied by the number of files that shared the same safe key.
228
+ */
229
+ export declare function compileSfcBatch(
230
+ pattern: string,
231
+ options?: BatchCompileOptionsNapi | undefined | null,
232
+ ): BatchCompileResultNapi;
233
+
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
+ export declare function createViteBareImportBases(
246
+ root: string,
247
+ importer?: string | undefined | null,
248
+ ): Array<string>;
249
+
250
+ export declare function createViteBareImportCandidates(
251
+ id: string,
252
+ aliasRules: Array<CssAliasRuleNapi>,
253
+ resolvedId?: string | undefined | null,
254
+ ): Array<string>;
255
+
256
+ export declare function createViteVirtualId(
257
+ realPath: string,
258
+ ssr?: boolean | undefined | null,
259
+ ): string;
260
+
261
+ /** CSF output for NAPI */
262
+ export interface CsfOutputNapi {
263
+ code: string;
264
+ filename: string;
265
+ }
266
+
267
+ export interface CssAliasRuleNapi {
268
+ find: string;
269
+ replacement: string;
270
+ isRegex: boolean;
271
+ flags?: string;
272
+ }
273
+
274
+ export interface CssAstResultNapi {
275
+ ast?: any;
276
+ errors: Array<string>;
277
+ warnings: Array<string>;
278
+ }
279
+
280
+ export interface CssCompileOptionsNapi {
281
+ filename?: string;
282
+ scoped?: boolean;
283
+ scopeId?: string;
284
+ sourceMap?: boolean;
285
+ minify?: boolean;
286
+ cssModules?: boolean;
287
+ customMedia?: boolean;
288
+ targets?: CssTargetsNapi;
289
+ }
290
+
291
+ export interface CssCompileResultNapi {
292
+ code: string;
293
+ map?: string;
294
+ cssVars: Array<string>;
295
+ errors: Array<string>;
296
+ warnings: Array<string>;
297
+ }
298
+
299
+ export interface CssTargetsNapi {
300
+ chrome?: number;
301
+ firefox?: number;
302
+ safari?: number;
303
+ edge?: number;
304
+ ios?: number;
305
+ android?: number;
306
+ }
307
+
308
+ export interface CustomBlockNapi {
309
+ blockType: string;
310
+ content: string;
311
+ src?: string;
312
+ attrs: Array<SfcBlockAttributeNapi>;
313
+ index: number;
314
+ }
315
+
316
+ /** Declaration generation options for NAPI */
317
+ export interface DeclarationOptionsNapi {
318
+ filename?: string;
319
+ }
320
+
321
+ /** Declaration generation result for NAPI */
322
+ export interface DeclarationResultNapi {
323
+ code: string;
324
+ }
325
+
326
+ export interface DefineReplacementNapi {
327
+ key: string;
328
+ value: string;
329
+ }
330
+
331
+ export declare function detectViteHmrUpdateType(
332
+ prev: HmrHashesNapi | undefined | null,
333
+ next: HmrHashesNapi,
334
+ ): string;
335
+
336
+ export declare function diffVitePrecompileFiles(
337
+ files: Array<string>,
338
+ currentMetadata: Array<VitePrecompileFileMetadataEntryNapi>,
339
+ previousMetadata: Array<VitePrecompileFileMetadataEntryNapi>,
340
+ ): VitePrecompileDiffNapi;
341
+
342
+ /** Doc options for NAPI */
343
+ export interface DocOptionsNapi {
344
+ includeSource?: boolean;
345
+ includeTemplates?: boolean;
346
+ includeMetadata?: boolean;
347
+ includeToc?: boolean;
348
+ tocThreshold?: number;
349
+ basePath?: string;
350
+ title?: string;
351
+ }
352
+
353
+ /** Doc output for NAPI */
354
+ export interface DocOutputNapi {
355
+ markdown: string;
356
+ filename: string;
357
+ title: string;
358
+ category?: string;
359
+ variantCount: number;
360
+ }
361
+
362
+ export interface DynamicImportAliasRuleNapi {
363
+ fromPrefix: string;
364
+ toPrefix: string;
365
+ }
366
+
367
+ export declare function extractSfcCustomBlocks(
368
+ source: string,
369
+ filename?: string | undefined | null,
370
+ ): Array<CustomBlockNapi>;
371
+
372
+ export declare function extractSfcSrcInfo(
373
+ source: string,
374
+ filename?: string | undefined | null,
375
+ ): SfcSrcInfoNapi;
376
+
377
+ export declare function extractSfcStyleBlocks(
378
+ source: string,
379
+ filename?: string | undefined | null,
380
+ ): Array<StyleBlockNapi>;
381
+
382
+ export declare function findDependentDesignTokens(
383
+ tokenMap: string,
384
+ targetPath: string,
385
+ ): Array<string>;
386
+
387
+ export declare function flattenDesignTokenCategories(categories: string): string;
388
+
389
+ /** Format options for NAPI. */
390
+ export interface FormatOptionsNapi {
391
+ printWidth?: number;
392
+ tabWidth?: number;
393
+ useTabs?: boolean;
394
+ semi?: boolean;
395
+ singleQuote?: boolean;
396
+ sortAttributes?: boolean;
397
+ singleAttributePerLine?: boolean;
398
+ maxAttributesPerLine?: number;
399
+ normalizeDirectiveShorthands?: boolean;
400
+ }
401
+
402
+ /** Format result for NAPI. */
403
+ export interface FormatResultNapi {
404
+ code: string;
405
+ changed: boolean;
406
+ }
407
+
408
+ /** Format a Vue SFC source string. */
409
+ export declare function formatSfc(
410
+ source: string,
411
+ options?: FormatOptionsNapi | undefined | null,
412
+ ): FormatResultNapi;
413
+
414
+ export declare function fromViteVirtualId(virtualId: string): string;
415
+
416
+ /** Generate catalog from multiple Art sources (high-performance batch) */
417
+ export declare function generateArtCatalog(
418
+ sources: Array<string>,
419
+ docOptions?: DocOptionsNapi | undefined | null,
420
+ ): CatalogOutputNapi;
421
+
422
+ /** Generate component documentation from Art source */
423
+ export declare function generateArtDoc(
424
+ source: string,
425
+ artOptions?: ArtParseOptionsNapi | undefined | null,
426
+ docOptions?: DocOptionsNapi | undefined | null,
427
+ ): DocOutputNapi;
428
+
429
+ /** Batch generate docs with parallel processing */
430
+ export declare function generateArtDocsBatch(
431
+ sources: Array<string>,
432
+ docOptions?: DocOptionsNapi | undefined | null,
433
+ ): Array<DocOutputNapi>;
434
+
435
+ /** Generate props palette from Art source */
436
+ export declare function generateArtPalette(
437
+ source: string,
438
+ artOptions?: ArtParseOptionsNapi | undefined | null,
439
+ paletteOptions?: PaletteOptionsNapi | undefined | null,
440
+ ): PaletteOutputNapi;
441
+
442
+ /** Generate a Vue SFC `.d.ts` declaration from Croquis analysis. */
443
+ export declare function generateDeclaration(
444
+ source: string,
445
+ options?: DeclarationOptionsNapi | undefined | null,
446
+ ): DeclarationResultNapi;
447
+
448
+ export declare function generateDesignTokensMarkdown(
449
+ categories: string,
450
+ generatedAt?: string | undefined | null,
451
+ ): string;
452
+
453
+ export interface GeneratedVariantNapi {
454
+ name: string;
455
+ isDefault: boolean;
456
+ props: any;
457
+ description?: string;
458
+ }
459
+
460
+ export declare function generateSfcScopeId(
461
+ filename: string,
462
+ root?: string | undefined | null,
463
+ isProduction?: boolean | undefined | null,
464
+ source?: string | undefined | null,
465
+ ): string;
466
+
467
+ /** Generate .art.vue variants from component prop definitions */
468
+ export declare function generateVariants(
469
+ componentPath: string,
470
+ props: Array<PropDefinitionNapi>,
471
+ config?: AutogenConfigNapi | undefined | null,
472
+ ): AutogenOutputNapi;
473
+
474
+ export declare function generateViteHmrCode(scopeId: string, updateType: string): string;
475
+
476
+ /** Get Patina's currently registered rule metadata. */
477
+ export declare function getPatinaRules(): any;
478
+
479
+ /** Get type checking capabilities info */
480
+ export declare function getTypeCheckCapabilities(): TypeCheckCapabilitiesNapi;
481
+
482
+ export declare function hasSfcScopedStyle(
483
+ source: string,
484
+ filename?: string | undefined | null,
485
+ ): boolean;
486
+
487
+ export declare function hasViteHmrChanges(
488
+ prev: HmrHashesNapi | undefined | null,
489
+ next: HmrHashesNapi,
490
+ ): boolean;
491
+
492
+ export declare function hasVitePrecompileFileMetadataChanged(
493
+ previous: VitePrecompileFileMetadataNapi | undefined | null,
494
+ next: VitePrecompileFileMetadataNapi,
495
+ ): boolean;
496
+
497
+ export interface HmrHashesNapi {
498
+ scriptHash?: string;
499
+ templateHash?: string;
500
+ styleHash?: string;
501
+ }
502
+
503
+ export declare function isBuiltinViteDefine(key: string): boolean;
504
+
505
+ export declare function isSfcImportableAssetUrl(url: string): boolean;
506
+
507
+ export declare function isViteBareSpecifier(id: string): boolean;
508
+
509
+ /** Lint Vue SFC files matching patterns (native multithreading, .gitignore-aware) */
510
+ export declare function lint(
511
+ patterns: Array<string>,
512
+ options?: LintOptionsNapi | undefined | null,
513
+ ): LintResultNapi;
514
+
515
+ /** Lint options for NAPI */
516
+ export interface LintOptionsNapi {
517
+ /** Output format: "text", "ansi", "plain", "json", "stylish", "markdown", "html", or "agent" */
518
+ format?: string;
519
+ /** Maximum number of warnings before failing */
520
+ maxWarnings?: number;
521
+ /** Quiet mode - only show summary */
522
+ quiet?: boolean;
523
+ /** Automatically fix problems (not yet implemented) */
524
+ fix?: boolean;
525
+ /** Help display level: "full", "short", "none" */
526
+ helpLevel?: string;
527
+ /** Lint preset: "general-recommended", "essential", "incremental", "ecosystem", "opinionated", or "nuxt" */
528
+ preset?: string;
529
+ }
530
+
531
+ /** Lint a single Vue SFC with Patina and return structured diagnostics. */
532
+ export declare function lintPatinaSfc(
533
+ source: string,
534
+ options?: PatinaLintOptionsNapi | undefined | null,
535
+ ): any;
536
+
537
+ /** Lint result for NAPI */
538
+ export interface LintResultNapi {
539
+ /** Formatted output string */
540
+ output: string;
541
+ /** Total number of errors */
542
+ errorCount: number;
543
+ /** Total number of warnings */
544
+ warningCount: number;
545
+ /** Number of files linted */
546
+ fileCount: number;
547
+ /** Time in milliseconds */
548
+ timeMs: number;
549
+ }
550
+
551
+ export interface MacroArtifactNapi {
552
+ kind: string;
553
+ name: string;
554
+ source: string;
555
+ content: string;
556
+ moduleCode?: string;
557
+ start: number;
558
+ end: number;
559
+ }
560
+
561
+ export declare function normalizeViteCssModuleFilename(filename: string): string;
562
+
563
+ export declare function normalizeViteDevMiddlewareUrl(
564
+ reqUrl: string,
565
+ ): ViteDevMiddlewareRewriteNapi | null;
566
+
567
+ export declare function normalizeViteFsIdForBuild(id: string): string;
568
+
569
+ export declare function normalizeVitePrecompileBatchSize(value?: number | undefined | null): number;
570
+
571
+ export declare function normalizeViteRequireBase(
572
+ importer?: string | undefined | null,
573
+ ): string | null;
574
+
575
+ export declare function normalizeViteResolvedVuePath(id: string): string | null;
576
+
577
+ export declare function normalizeViteVirtualVueModuleId(id: string): string;
578
+
579
+ /** Palette options for NAPI */
580
+ export interface PaletteOptionsNapi {
581
+ inferOptions?: boolean;
582
+ minSelectValues?: number;
583
+ maxSelectValues?: number;
584
+ groupByType?: boolean;
585
+ }
586
+
587
+ /** Palette output for NAPI */
588
+ export interface PaletteOutputNapi {
589
+ title: string;
590
+ controls: Array<PropControlNapi>;
591
+ groups: Array<string>;
592
+ json: string;
593
+ typescript: string;
594
+ }
595
+
596
+ /** Parse Art file (*.art.vue) */
597
+ export declare function parseArt(
598
+ source: string,
599
+ options?: ArtParseOptionsNapi | undefined | null,
600
+ ): ArtDescriptorNapi;
601
+
602
+ export declare function parseCssAst(
603
+ source: string,
604
+ options?: CssCompileOptionsNapi | undefined | null,
605
+ ): CssAstResultNapi;
606
+
607
+ export declare function parseDesignTokensFromJson(source: string): string;
608
+
609
+ export declare function parseDesignTokensFromPath(tokensPath: string): string;
610
+
611
+ export declare function parseSfc(
612
+ source: string,
613
+ options?: SfcParseOptionsNapi | undefined | null,
614
+ ): any;
615
+
616
+ /** Parse template to AST only */
617
+ export declare function parseTemplate(
618
+ template: string,
619
+ options?: CompilerOptions | undefined | null,
620
+ ): any;
621
+
622
+ /** Single-file Patina lint options for NAPI */
623
+ export interface PatinaLintOptionsNapi {
624
+ /** Filename used for diagnostics */
625
+ filename?: string;
626
+ /** Locale code: "en", "ja", or "zh" */
627
+ locale?: string;
628
+ /** Help display level: "full", "short", or "none" */
629
+ helpLevel?: string;
630
+ /** Lint preset: "general-recommended", "essential", "incremental", "ecosystem", "opinionated", or "nuxt" */
631
+ preset?: string;
632
+ /** Optional list of Patina rule names to enable */
633
+ enabledRules?: Array<string>;
634
+ }
635
+
636
+ export declare function printCssAst(
637
+ ast: any,
638
+ options?: CssCompileOptionsNapi | undefined | null,
639
+ ): CssCompileResultNapi;
640
+
641
+ /** Prop control for NAPI */
642
+ export interface PropControlNapi {
643
+ name: string;
644
+ control: string;
645
+ defaultValue?: any;
646
+ description?: string;
647
+ required: boolean;
648
+ options: Array<SelectOptionNapi>;
649
+ range?: RangeConfigNapi;
650
+ group?: string;
651
+ }
652
+
653
+ export interface PropDefinitionNapi {
654
+ name: string;
655
+ propType: string;
656
+ required: boolean;
657
+ defaultValue?: any;
658
+ }
659
+
660
+ /** Range config for NAPI */
661
+ export interface RangeConfigNapi {
662
+ min: number;
663
+ max: number;
664
+ step?: number;
665
+ }
666
+
667
+ /** Related location for diagnostic (NAPI) */
668
+ export interface RelatedLocationNapi {
669
+ message: string;
670
+ start: number;
671
+ end: number;
672
+ filename?: string;
673
+ }
674
+
675
+ export declare function resolveDesignTokenReferences(categories: string): string;
676
+
677
+ export declare function resolveViteAliasRequest(
678
+ id: string,
679
+ aliasRules: Array<CssAliasRuleNapi>,
680
+ ): string | null;
681
+
682
+ export declare function resolveViteCssImports(
683
+ css: string,
684
+ importer: string,
685
+ aliasRules: Array<CssAliasRuleNapi>,
686
+ isDev?: boolean | undefined | null,
687
+ devUrlBase?: string | undefined | null,
688
+ ): string;
689
+
690
+ export declare function resolveViteRelativeImport(id: string, importer: string): string | null;
691
+
692
+ export declare function resolveViteVuePath(
693
+ root: string,
694
+ id: string,
695
+ importer?: string | undefined | null,
696
+ ): string;
697
+
698
+ export declare function rewriteViteDynamicTemplateImports(
699
+ code: string,
700
+ aliasRules: Array<DynamicImportAliasRuleNapi>,
701
+ ): string;
702
+
703
+ export declare function rewriteViteImportMetaGlobBase(
704
+ code: string,
705
+ importer: string,
706
+ root: string,
707
+ ): string;
708
+
709
+ export declare function rewriteViteStaticAssetUrls(
710
+ code: string,
711
+ aliasRules: Array<DynamicImportAliasRuleNapi>,
712
+ ): string;
713
+
714
+ export declare function runCli(args: Array<string>): void;
715
+
716
+ export declare function scopeViteCssForPipeline(css: string, scopeId: string): string;
717
+
718
+ /** Select option for NAPI */
719
+ export interface SelectOptionNapi {
720
+ label: string;
721
+ value: any;
722
+ }
723
+
724
+ export interface SfcBlockAttributeNapi {
725
+ name: string;
726
+ value?: string;
727
+ }
728
+
729
+ export interface SfcCompileOptionsNapi {
730
+ filename?: string;
731
+ sourceMap?: boolean;
732
+ ssr?: boolean;
733
+ vapor?: boolean;
734
+ customRenderer?: boolean;
735
+ vueParserQuirks?: boolean;
736
+ /** Preserve TypeScript in output when true */
737
+ isTs?: boolean;
738
+ /** Scope ID for scoped CSS (e.g., "data-v-abc123") */
739
+ scopeId?: string;
740
+ }
741
+
742
+ export interface SfcCompileResultNapi {
743
+ code: string;
744
+ css?: string;
745
+ errors: Array<string>;
746
+ warnings: Array<string>;
747
+ templateHash?: string;
748
+ styleHash?: string;
749
+ scriptHash?: string;
750
+ hasScoped: boolean;
751
+ styles: Array<StyleBlockNapi>;
752
+ customBlocks: Array<CustomBlockNapi>;
753
+ macroArtifacts: Array<MacroArtifactNapi>;
754
+ }
755
+
756
+ export interface SfcParseOptionsNapi {
757
+ filename?: string;
758
+ }
759
+
760
+ export interface SfcSrcInfoNapi {
761
+ scriptSrc?: string;
762
+ templateSrc?: string;
763
+ }
764
+
765
+ export declare function shouldApplyViteDefineInVirtualModule(key: string): boolean;
766
+
767
+ export declare function splitViteIdQuery(id: string): ViteIdPartsNapi;
768
+
769
+ export declare function stripSfcScopedCssComments(css: string): string;
770
+
771
+ export interface StyleBlockNapi {
772
+ content: string;
773
+ src?: string;
774
+ lang?: string;
775
+ scoped: boolean;
776
+ module: boolean;
777
+ moduleName?: string;
778
+ index: number;
779
+ }
780
+
781
+ export interface TemplateAssetTagRuleNapi {
782
+ tag: string;
783
+ attrs: Array<string>;
784
+ }
785
+
786
+ export interface TemplateAssetUrlNapi {
787
+ url: string;
788
+ varName: string;
789
+ }
790
+
791
+ export declare function toViteBrowserImportPrefix(replacement: string): string;
792
+
793
+ export declare function transformViteCssVarsForPipeline(css: string, scopeId: string): string;
794
+
795
+ /**
796
+ * Perform type checking on a Vue SFC
797
+ *
798
+ * This performs AST-based type analysis without requiring a TypeScript compiler.
799
+ * For full type checking, use the CLI with Corsa integration.
800
+ */
801
+ export declare function typeCheck(
802
+ source: string,
803
+ options?: TypeCheckOptionsNapi | undefined | null,
804
+ ): TypeCheckResultNapi;
805
+
806
+ /** Batch type check SFC files matching a glob pattern (native multithreading) */
807
+ export declare function typeCheckBatch(
808
+ pattern: string,
809
+ options?: TypeCheckOptionsNapi | undefined | null,
810
+ ): BatchTypeCheckResultNapi;
811
+
812
+ /** Type check capabilities result */
813
+ export interface TypeCheckCapabilitiesNapi {
814
+ mode: string;
815
+ description: string;
816
+ checks: Array<TypeCheckCapabilityNapi>;
817
+ notes: Array<string>;
818
+ }
819
+
820
+ /** Type check capabilities info */
821
+ export interface TypeCheckCapabilityNapi {
822
+ name: string;
823
+ description: string;
824
+ severity: string;
825
+ }
826
+
827
+ /** Type check options for NAPI */
828
+ export interface TypeCheckOptionsNapi {
829
+ filename?: string;
830
+ strict?: boolean;
831
+ includeVirtualTs?: boolean;
832
+ checkProps?: boolean;
833
+ checkEmits?: boolean;
834
+ checkTemplateBindings?: boolean;
835
+ checkReactivity?: boolean;
836
+ checkSetupContext?: boolean;
837
+ checkInvalidExports?: boolean;
838
+ checkFallthroughAttrs?: boolean;
839
+ legacyVue2?: boolean;
840
+ }
841
+
842
+ /** Type check result for NAPI */
843
+ export interface TypeCheckResultNapi {
844
+ diagnostics: Array<TypeDiagnosticNapi>;
845
+ virtualTs?: string;
846
+ errorCount: number;
847
+ warningCount: number;
848
+ analysisTimeMs?: number;
849
+ }
850
+
851
+ /** Type diagnostic for NAPI */
852
+ export interface TypeDiagnosticNapi {
853
+ severity: string;
854
+ message: string;
855
+ start: number;
856
+ end: number;
857
+ code?: string;
858
+ help?: string;
859
+ related: Array<RelatedLocationNapi>;
860
+ }
861
+
862
+ export declare function validateDesignTokenReference(
863
+ tokenMap: string,
864
+ reference: string,
865
+ selfPath?: string | undefined | null,
866
+ ): string;
867
+
868
+ export interface ViteDevMiddlewareRewriteNapi {
869
+ cleanedUrl: string;
870
+ fsPath: string;
871
+ }
872
+
873
+ export interface ViteIdPartsNapi {
874
+ request: string;
875
+ querySuffix: string;
876
+ }
877
+
878
+ export interface VitePluginRequestNapi {
879
+ /** Path segment before the query string. */
880
+ path: string;
881
+ /** Query suffix including the leading `?`, or an empty string. */
882
+ querySuffix: string;
883
+ /** Path normalized for macro virtual modules (`.vue.ts` -> `.vue`). */
884
+ normalizedVuePath: string;
885
+ /** For `\0...` virtual macro IDs, the real path without the virtual prefix. */
886
+ strippedVirtualPath?: string;
887
+ /** Whether this ID is a Vize-compiled virtual Vue module. */
888
+ isVizeVirtual: boolean;
889
+ /** Whether this ID is a Vize SSR virtual Vue module. */
890
+ isVizeSsrVirtual: boolean;
891
+ /** Real `.vue` path extracted from a Vize virtual Vue module ID. */
892
+ vizeVirtualPath?: string;
893
+ /** Build-safe ID with Vite's `/@fs` prefix removed when present. */
894
+ normalizedFsId?: string;
895
+ /** Whether the query contains `macro=true`. */
896
+ hasMacroQuery: boolean;
897
+ /** Whether the query contains `definePage`. */
898
+ hasDefinePageQuery: boolean;
899
+ /** Whether this is a `\0` virtual ID carrying a macro query. */
900
+ isMacroVirtualId: boolean;
901
+ /** Whether the request points at a Vue SFC after macro normalization. */
902
+ isVueSfcPath: boolean;
903
+ /** Whether the request is a Vite Vue style virtual query. */
904
+ isVueStyleQuery: boolean;
905
+ /** Style block language, defaulting to `css` for style virtual queries. */
906
+ styleLang?: string;
907
+ /** Style block index for style virtual queries. */
908
+ styleIndex?: number;
909
+ /** Scoped attribute value for style virtual queries. */
910
+ styleScoped?: string;
911
+ /** Whether the style query carries a CSS modules marker. */
912
+ hasStyleModule: boolean;
913
+ /** Extension suffix Vite should see for the style pipeline. */
914
+ styleVirtualSuffix?: string;
915
+ /** Vue boundary file kind: `client`, `server`, or undefined. */
916
+ boundaryKind?: string;
917
+ }
918
+
919
+ export interface VitePrecompileChunkOptionsNapi {
920
+ maxBytes?: number;
921
+ metadata?: Array<VitePrecompileFileMetadataEntryNapi>;
922
+ }
923
+
924
+ export interface VitePrecompileDiffNapi {
925
+ changedFiles: Array<string>;
926
+ deletedFiles: Array<string>;
927
+ }
928
+
929
+ export interface VitePrecompileFileMetadataEntryNapi {
930
+ path: string;
931
+ mtimeMs: number;
932
+ size: number;
933
+ }
934
+
935
+ export interface VitePrecompileFileMetadataNapi {
936
+ mtimeMs: number;
937
+ size: number;
938
+ }
939
+
940
+ export declare function wrapSfcScopedPreprocessorStyle(
941
+ content: string,
942
+ scoped?: string | undefined | null,
943
+ lang?: string | undefined | null,
944
+ ): string;