import { traverse } from 'estree-toolkit'; import type { Node } from 'estree'; import type { Program as EsProgram } from 'estree'; export type TransmogrificationMode = 'sync' | 'async'; interface TransmogrificationState { mode: TransmogrificationMode; } export type Visitors = Parameters>[1]; /** * Transforms async-generator code into either the async or synchronous alternatives that are * ~semantically equivalent. For example, this template: * * * * Is compiled into the following JavaScript, intended for execution during SSR & stripped down * for the purposes of this example: * * async function* __lwcTmpl(props, attrs, slottedContent, Cmp, instance) { * yield '
foobar
'; * const childProps = {}; * const childAttrs = {}; * yield* generateChildMarkup("x-child", childProps, childAttrs, childSlottedContentGenerator); * } * * When transmogrified in async-mode, the above generated template function becomes the following: * * async function __lwcTmpl($$emit, props, attrs, slottedContent, Cmp, instance) { * $$emit('
foobar
'); * const childProps = {}; * const childAttrs = {}; * await generateChildMarkup($$emit, "x-child", childProps, childAttrs, childSlottedContentGenerator); * } * * When transmogrified in sync-mode, the template function becomes the following: * * function __lwcTmpl($$emit, props, attrs, slottedContent, Cmp, instance) { * $$emit('
foobar
'); * const childProps = {}; * const childAttrs = {}; * generateChildMarkup($$emit, "x-child", childProps, childAttrs, childSlottedContentGenerator); * } * * There are tradeoffs for each of these modes. Notably, the async-yield variety is the easiest to transform * into either of the other varieties and, for that reason, is the variety that is "authored" by the SSR compiler. */ export declare function transmogrify(compiledComponentAst: EsProgram, mode?: TransmogrificationMode): EsProgram; export {}; //# sourceMappingURL=transmogrify.d.ts.map