vite-plugin-top-level-await
Version:
Transform code to support top-level await in normal browsers for Vite.
19 lines (18 loc) • 1.85 kB
TypeScript
import * as SWC from "@swc/core";
export declare function makeIdentifier(name: string): SWC.Identifier;
export declare function makeVariablesDeclaration(names: string[]): SWC.VariableDeclaration;
export declare function makeVariableInitDeclaration(name: string, value: SWC.Expression): SWC.VariableDeclaration;
export declare function makeStatement(expression: SWC.Expression): SWC.ExpressionStatement;
export declare function makeAssignmentExpression(left: SWC.Pattern, right: SWC.Expression): SWC.AssignmentExpression;
export declare function makeAssignmentStatement(left: SWC.Pattern, right: SWC.Expression): SWC.ExpressionStatement;
export declare function makeImportSpecifier(name: string, as: string): SWC.ImportSpecifier;
export declare function makeArrayExpression(items: SWC.Expression[]): SWC.ArrayExpression;
export declare function makeTryCatchStatement(tryStatements: SWC.Statement[], catchStatements: SWC.Statement[]): SWC.TryStatement;
export declare function makeArrowFunction(args: string[], statements: SWC.Statement[], async?: boolean): SWC.ArrowFunctionExpression;
export declare function makeParenthesisExpression(expression: SWC.Expression): SWC.ParenthesisExpression;
export declare function makeCallExpression(functionExpression: SWC.Expression, args?: SWC.Expression[]): SWC.CallExpression;
export declare function makeReturnStatement(expression: SWC.Expression): SWC.ReturnStatement;
export declare function makeMemberExpression(object: SWC.Expression | string, member: string): SWC.MemberExpression;
export declare function makeExportListDeclaration(map: [exportName: string, identifier: string][]): SWC.ExportNamedDeclaration;
export declare function makeAwaitExpression(expression: SWC.Expression): SWC.AwaitExpression;
export declare function makeImportDeclaration(source: SWC.StringLiteral): SWC.ImportDeclaration;