mirror of
https://gitee.com/onvia/ccc-tnt-psd2ui
synced 2024-12-28 20:47:43 +00:00
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { ImportSpecifier, ImportDefaultSpecifier, ImportNamespaceSpecifier, Program } from '@babel/types';
|
|
import MagicString, { SourceMap } from 'magic-string';
|
|
import { ParserPlugin } from '@babel/parser';
|
|
|
|
export declare function shouldTransform(src: string): boolean;
|
|
export interface RefTransformOptions {
|
|
filename?: string;
|
|
sourceMap?: boolean;
|
|
parserPlugins?: ParserPlugin[];
|
|
importHelpersFrom?: string;
|
|
}
|
|
export interface RefTransformResults {
|
|
code: string;
|
|
map: SourceMap | null;
|
|
rootRefs: string[];
|
|
importedHelpers: string[];
|
|
}
|
|
export interface ImportBinding {
|
|
local: string;
|
|
imported: string;
|
|
source: string;
|
|
specifier: ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
|
|
}
|
|
export declare function transform(src: string, { filename, sourceMap, parserPlugins, importHelpersFrom }?: RefTransformOptions): RefTransformResults;
|
|
export declare function transformAST(ast: Program, s: MagicString, offset?: number, knownRefs?: string[], knownProps?: Record<string, // public prop key
|
|
{
|
|
local: string;
|
|
default?: any;
|
|
isConst?: boolean;
|
|
}>): {
|
|
rootRefs: string[];
|
|
importedHelpers: string[];
|
|
};
|
|
|