@weapp-vite/volar 2.0.7 → 2.1.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/README.md +45 -38
- package/dist/constants.d.ts +31 -0
- package/dist/index.cjs +427 -182
- package/dist/index.mjs +427 -182
- package/dist/jsonBlock.d.ts +24 -0
- package/dist/scriptSetup.d.ts +38 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type ts from 'typescript';
|
|
2
|
+
export declare function normalizeFilename(filename?: string): string;
|
|
3
|
+
export declare function inferConfigType(filename?: string): "App" | "Page" | "Component" | "Plugin" | "Sitemap" | "Theme";
|
|
4
|
+
export declare function normalizeLang(lang?: string): string;
|
|
5
|
+
export declare function getEmbeddedCodesFromCustomBlocks(sfc: {
|
|
6
|
+
customBlocks: ReadonlyArray<{
|
|
7
|
+
type: string;
|
|
8
|
+
lang?: string;
|
|
9
|
+
}>;
|
|
10
|
+
}): {
|
|
11
|
+
id: string;
|
|
12
|
+
lang: string;
|
|
13
|
+
}[];
|
|
14
|
+
export declare function resolveEmbeddedJsonBlock(fileName: string, sfc: {
|
|
15
|
+
customBlocks: ReadonlyArray<{
|
|
16
|
+
type: string;
|
|
17
|
+
lang?: string;
|
|
18
|
+
content: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
}>;
|
|
21
|
+
}, embeddedCode: {
|
|
22
|
+
id: string;
|
|
23
|
+
content: any[];
|
|
24
|
+
}, tsModule: typeof ts | undefined, hasSchematicsTypes: boolean): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type ts from 'typescript';
|
|
2
|
+
export declare function collectWxsModuleNames(templateContent?: string): string[];
|
|
3
|
+
export declare function createWxsModuleDeclarations(moduleNames: string[]): string;
|
|
4
|
+
export declare function appendWxsDeclarations(code: string, moduleNames: string[]): string;
|
|
5
|
+
export declare function appendScriptSetupDeclarations(code: string, declarations: string): string;
|
|
6
|
+
export declare function createSyntheticScriptSetup(moduleNames: string[]): {
|
|
7
|
+
type: string;
|
|
8
|
+
content: string;
|
|
9
|
+
loc: {
|
|
10
|
+
source: string;
|
|
11
|
+
start: {
|
|
12
|
+
column: number;
|
|
13
|
+
line: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
};
|
|
16
|
+
end: {
|
|
17
|
+
column: number;
|
|
18
|
+
line: number;
|
|
19
|
+
offset: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
attrs: {
|
|
23
|
+
setup: boolean;
|
|
24
|
+
lang: string;
|
|
25
|
+
};
|
|
26
|
+
lang: string;
|
|
27
|
+
setup: boolean;
|
|
28
|
+
name: string;
|
|
29
|
+
} | undefined;
|
|
30
|
+
export declare function syncScriptBlockSource(block: {
|
|
31
|
+
content: string;
|
|
32
|
+
attrs?: Record<string, string | true>;
|
|
33
|
+
loc: {
|
|
34
|
+
source: string;
|
|
35
|
+
};
|
|
36
|
+
} | null | undefined): void;
|
|
37
|
+
export declare function createDefineOptionsTemplateDeclarations(code: string, tsModule: typeof ts, lang: string): string;
|
|
38
|
+
export declare function resolveScriptSetupLang(lang?: string): "js" | "ts";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/volar",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Volar plugin for weapp-vite - Provides IntelliSense and type checking for WeChat mini-program config blocks",
|
|
5
5
|
"author": "ice breaker <1324318532@qq.com>",
|
|
6
6
|
"license": "MIT",
|