import type { TsNode } from "../../ir/tsIR.js"; import type { FunctionParameter } from "../../types.js"; /** * The exported node wrapper's parameter list — what * `async function main(name = \`fallback\`, { messages, callbacks } = {})` * is built from: the node's own parameters, with their defaults so TS * callers can omit them, plus the trailing options object. * * A default is emitted into the parameter list only when it stands on * its own — a literal, or an array or object of literals. That is not * every default: the elements of `xs: number[] = [LIMIT]`, and the * interpolations of `s: string = "up to ${LIMIT}"`, are names, and a * name compiles to a read of the global store through `__globals()`. * A parameter default is evaluated before the call, so it would run * before `runNode` installs the async-context frame, and `__globals()` * returns undefined with no frame — `TypeError: Cannot read properties * of undefined` on `worker()`. Those parameters get `undefined` here * instead, and the node body fills them. * * Nothing is lost by that: the body defaults any `__state.data` slot * that is undefined, which is the site every invocation path funnels * through. The literal case keeps its default only because a signature * that states it reads better for a TypeScript caller. */ export declare function nodeWrapperParams(args: FunctionParameter[], processNode: (node: NonNullable) => TsNode): { name: string; typeAnnotation?: string; defaultValue?: TsNode; }[];