import { ObjectValue, Value, type PropertyKeyValue } from './value.mts'; import { ExecutionContext } from './execution-context/ExecutionContext.mts'; import { ThrowCompletion, type PlainCompletion, type ValueCompletion, NormalCompletion } from './completion.mts'; import { ScriptRecord, type ParseScriptHostDefined } from './parse.mts'; import { CyclicModuleRecord, SourceTextModuleRecord, SyntheticModuleRecord, type ModuleRecordHostDefined, type ModuleRecordHostDefinedPublic } from './modules.mts'; import type { PromiseObject } from './intrinsics/Promise.mts'; import type { ParseNode } from './parser/ParseNode.mts'; import type { ModuleCache } from './utils/module.mts'; import { Realm, GlobalEnvironmentRecord, type Intrinsics } from '#self'; /** https://tc39.es/ecma262/#sec-weakref-execution */ export declare function gc(): void; /** https://tc39.es/ecma262/#sec-jobs */ export declare function runJobQueue(): void; export interface ManagedRealmHostDefined { getImportMetaProperties?(module: ModuleRecordHostDefinedPublic): readonly { readonly Key: PropertyKeyValue; readonly Value: Value; }[]; finalizeImportMeta?(meta: ObjectValue, module: ModuleRecordHostDefinedPublic): PlainCompletion; resolverCache?: ModuleCache; randomSeed?(): string; attachingInspector?: unknown; attachingInspectorReportError?(realm: Realm, error: Value): void; /** * See https://tc39.es/ecma262/#sec-HostLoadImportedModule * In case of * * and * new ShadowRealm().importValue('./foo.mjs', 'default') * a Realm instead of a ModuleRecord or ScriptRecord is passed as the referrer. */ specifier?: string | undefined; /** The name displayed in the inspector. */ name?: string | undefined; } export declare class ManagedRealm extends Realm { TemplateMap: { Site: ParseNode.TemplateLiteral; Array: ObjectValue; }[]; AgentSignifier: unknown; Intrinsics: Intrinsics; randomState: BigUint64Array | undefined; GlobalObject: ObjectValue; GlobalEnv: GlobalEnvironmentRecord; HostDefined: ManagedRealmHostDefined; topContext: ExecutionContext; active: boolean; /** https://tc39.es/ecma262/#sec-initializehostdefinedrealm */ constructor(HostDefined?: ManagedRealmHostDefined, customizations?: (record: Realm) => [global: ObjectValue | undefined, thisValue: ObjectValue | undefined]); scope(inspectorPreview?: boolean): Disposable | null; scope(cb: () => T, inspectorPreview?: boolean): T; compileScript(sourceText: string, hostDefined?: ParseScriptHostDefined): PlainCompletion; compileModule(sourceText: string, hostDefined?: ModuleRecordHostDefined): NormalCompletion | ThrowCompletion; evaluateScript(sourceText: string | ScriptRecord, options: { specifier?: string; doNotTrackScriptId?: boolean; } | undefined, callback: (completion: NormalCompletion | ThrowCompletion) => void): ValueCompletion | undefined; /** * Evaluate a script (skip the debugger). */ evaluateScriptSkipDebugger(sourceText: string | ScriptRecord, options?: { specifier?: string; doNotTrackScriptId?: boolean; }): ValueCompletion; evaluateModule(sourceText: string | T, specifier: string | undefined, finish: (completion: ValueCompletion) => void): void; createJSONModule(sourceText: string): PlainCompletion; createTextModule(sourceText: string): PlainCompletion; createBytesModule(content: Uint8Array): PlainCompletion; } //# sourceMappingURL=api.d.mts.map