@gi-tcg/gts-transpiler 0.2.0 → 0.3.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/dist/index.d.ts +7 -1
- package/dist/index.js +424 -182
- package/package.json +3 -3
- package/src/config.ts +86 -2
- package/src/index.ts +10 -2
- package/src/parse/gts_plugin.ts +18 -11
- package/src/parse/index.ts +15 -5
- package/src/parse/loose_plugin.ts +2 -2
- package/src/parse/record_call_lparen_plugin.ts +85 -0
- package/src/transform/gts.ts +23 -45
- package/src/transform/volar/collect_tokens.ts +44 -18
- package/src/transform/volar/index.ts +16 -28
- package/src/transform/volar/mappings.ts +45 -26
- package/src/transform/volar/printer.ts +123 -0
- package/src/transform/volar/replacements.ts +89 -11
- package/src/transform/volar/walker.ts +52 -95
- package/src/types.ts +16 -4
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,12 @@ declare class GtsTranspilerError extends Error {
|
|
|
19
19
|
readonly position: SourceLocation2 | null;
|
|
20
20
|
constructor(message: string, position: SourceLocation2 | null);
|
|
21
21
|
}
|
|
22
|
+
interface PathPolyfill {
|
|
23
|
+
isAbsolute(filePath: string): boolean;
|
|
24
|
+
dirname(filePath: string): string;
|
|
25
|
+
resolve(...segments: string[]): string;
|
|
26
|
+
}
|
|
27
|
+
declare const path: PathPolyfill;
|
|
22
28
|
interface GtsConfig extends TranspileOption {}
|
|
23
29
|
type ReadFileFn = (path: string, encoding: "utf8") => string;
|
|
24
30
|
type ReadFileAsyncFn = (path: string, encoding: "utf8") => Promise<string>;
|
|
@@ -36,4 +42,4 @@ declare function resolveGtsConfig(filePath: string, inlineConfig: GtsConfig, opt
|
|
|
36
42
|
declare function resolveGtsConfigSync(filePath: string, inlineConfig: GtsConfig, options: ResolveGtsConfigSyncOptions): Required<GtsConfig>;
|
|
37
43
|
declare function transpile(source: string, filename: string, option: TranspileOption): TranspileResult;
|
|
38
44
|
declare function transpileForVolar(source: string, filename: string, option: TranspileOption): VolarMappingResult;
|
|
39
|
-
export { transpileForVolar, transpile, resolveGtsConfigSync, resolveGtsConfig, VolarMappingResult, TranspileResult, TranspileOption, GtsTranspilerError, GtsConfig };
|
|
45
|
+
export { transpileForVolar, transpile, resolveGtsConfigSync, resolveGtsConfig, path, VolarMappingResult, TranspileResult, TranspileOption, PathPolyfill, GtsTranspilerError, GtsConfig };
|