/** * Which runtime a Web program carries, and which of the compiler's own helpers * a Web lowering replaces. * * D115 P4 R3d: every one of these is a seam `JavaScriptEmitter` already asks * about — "does this module need the file-type helper", "what does an `is` * check on `Element` compile to" — so the family answers for Web and leaves the * base's answer to the host, which is the one thing a collaborator cannot call * for itself. */ import type { Expression, ValueType } from "@velarscript/compiler/extension"; import { type WebLookEntry as LookEntry } from "../ast.ts"; /** * What runtime-import selection reads on the emitter, plus the four base-class * answers a collaborator has no `super` of its own to ask for. `webOutput` and * the two `needs…` flags are live: `emitTypeCheck` sets one while statements * are still being emitted, and `additionalHelpers` reads it afterwards. */ export interface RuntimeImportHost { readonly lookKeywordProperties: ReadonlySet; needsFileTypeHelper: boolean; readonly needsLookArithmeticRuntime: boolean; readonly webOutput: boolean; baseDetachedTaskHelpers(): readonly string[]; baseIsCheck(type: ValueType, value: string): string; baseReactiveBridgeHelpers(needsJavaScriptCallBoundary: boolean, needsCollections: boolean, usedIdentifiers: ReadonlySet): readonly string[]; baseTypeCheck(type: ValueType, value: string, state: string): string; requireRuntimeModule(source: string): void; usesSharedRuntimeModules(): boolean; } export declare function emitTypeCheck(host: RuntimeImportHost, type: ValueType, value: string, state: string): string; export declare function emitIsCheck(host: RuntimeImportHost, type: ValueType, value: string): string; export declare function additionalHelpers(host: RuntimeImportHost): readonly string[]; export declare function reactiveBridgeHelpers(host: RuntimeImportHost, needsJavaScriptCallBoundary: boolean, needsCollections: boolean, usedIdentifiers: ReadonlySet): readonly string[]; export declare function includesErrorNormalizationRuntime(host: RuntimeImportHost): boolean; export declare function detachedTaskHelpers(host: RuntimeImportHost): readonly string[]; export declare function visitLookExpressions(entries: readonly LookEntry[], visit: (expression: Expression) => void): void; export declare function containsUnitLiteral(value: unknown): boolean; export declare function containsWebSyntax(value: unknown): boolean; //# sourceMappingURL=runtime-imports.d.ts.map