swc/packages/core/binding.d.ts
Donny/강동윤 f960d52364
refactor(bindings): Make @swc/core a subpackage (#8625)
**Description:**

This is for consistency and future extensions.
2024-05-18 09:23:06 +09:00

93 lines
2.0 KiB
TypeScript

/* auto-generated by NAPI-RS */
/* eslint-disable */
export class Compiler {
constructor();
}
export type JsCompiler = Compiler;
export function bundle(
confItems: Buffer,
signal?: AbortSignal | undefined | null
): Promise<{ [index: string]: { code: string; map?: string } }>;
export function getTargetTriple(): string;
export function initCustomTraceSubscriber(
traceOutFilePath?: string | undefined | null
): void;
export function minify(
code: Buffer,
opts: Buffer,
signal?: AbortSignal | undefined | null
): Promise<TransformOutput>;
export function minifySync(code: Buffer, opts: Buffer): TransformOutput;
export function parse(
src: string,
options: Buffer,
filename?: string | undefined | null,
signal?: AbortSignal | undefined | null
): Promise<string>;
export function parseFile(
path: string,
options: Buffer,
signal?: AbortSignal | undefined | null
): Promise<string>;
export function parseFileSync(path: string, opts: Buffer): string;
export function parseSync(
src: string,
opts: Buffer,
filename?: string | undefined | null
): string;
export function print(
programJson: string,
options: Buffer,
signal?: AbortSignal | undefined | null
): Promise<TransformOutput>;
export function printSync(program: string, options: Buffer): TransformOutput;
export function transform(
src: string,
isModule: boolean,
options: Buffer,
signal?: AbortSignal | undefined | null
): Promise<TransformOutput>;
export function transformFile(
src: string,
isModule: boolean,
options: Buffer,
signal?: AbortSignal | undefined | null
): Promise<TransformOutput>;
export function transformFileSync(
s: string,
isModule: boolean,
opts: Buffer
): TransformOutput;
export interface TransformOutput {
code: string;
map?: string;
}
/** Hack for `Type Generation` */
export interface TransformOutput {
code: string;
map?: string;
}
export function transformSync(
s: string,
isModule: boolean,
opts: Buffer
): TransformOutput;