@gi-tcg/gts-transpiler 0.1.1 → 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.
@@ -0,0 +1,45 @@
1
+ import { SourceMap as SourceMap2 } from "magic-string";
2
+ interface TranspileOption {
3
+ runtimeImportSource?: string;
4
+ providerImportSource?: string;
5
+ shortcutFunctionPreludes?: string[];
6
+ queryBindings?: string[];
7
+ }
8
+ import { CodeMapping } from "@volar/language-core";
9
+ interface VolarMappingResult {
10
+ code: string;
11
+ mappings: CodeMapping[];
12
+ }
13
+ interface TranspileResult {
14
+ code: string;
15
+ sourceMap: SourceMap2;
16
+ }
17
+ import { SourceLocation as SourceLocation2 } from "estree";
18
+ declare class GtsTranspilerError extends Error {
19
+ readonly position: SourceLocation2 | null;
20
+ constructor(message: string, position: SourceLocation2 | null);
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;
28
+ interface GtsConfig extends TranspileOption {}
29
+ type ReadFileFn = (path: string, encoding: "utf8") => string;
30
+ type ReadFileAsyncFn = (path: string, encoding: "utf8") => Promise<string>;
31
+ interface ResolveGtsConfigSyncOptions {
32
+ readFileFn: ReadFileFn;
33
+ cwd?: string;
34
+ stopDir?: string;
35
+ }
36
+ interface ResolveGtsConfigAsyncOptions {
37
+ readFileFn: ReadFileAsyncFn;
38
+ cwd?: string;
39
+ stopDir?: string;
40
+ }
41
+ declare function resolveGtsConfig(filePath: string, inlineConfig: GtsConfig, options: ResolveGtsConfigAsyncOptions): Promise<Required<GtsConfig>>;
42
+ declare function resolveGtsConfigSync(filePath: string, inlineConfig: GtsConfig, options: ResolveGtsConfigSyncOptions): Required<GtsConfig>;
43
+ declare function transpile(source: string, filename: string, option: TranspileOption): TranspileResult;
44
+ declare function transpileForVolar(source: string, filename: string, option: TranspileOption): VolarMappingResult;
45
+ export { transpileForVolar, transpile, resolveGtsConfigSync, resolveGtsConfig, path, VolarMappingResult, TranspileResult, TranspileOption, PathPolyfill, GtsTranspilerError, GtsConfig };