import { ListenerFn } from "eventemitter3"; import { Disposer, MetaframeId, MetaframePipeId, MetapageId } from "./core"; import { MetapageEvents } from "./events"; import { MinimumClientMessage } from "./jsonrpc"; import { MetapageIFrameRpcClient } from "./MetapageIFrameRpcClient"; import { MetapageShared } from "./Shared"; import { MetaframeInputMap, MetaframeInstance, MetapageInstanceInputs, PipeInput, PipeUpdateBlob } from "./v0_4"; import { MetapageOptionsV1 } from "./v1"; import { MetapageDefinition, MetapageMetadataV2 } from "./v2"; import { VersionsMetapage } from "./versions"; interface MetapageStatePartial { inputs: MetapageInstanceInputs; outputs: MetapageInstanceInputs; } export interface MetapageState { metaframes: MetapageStatePartial; } export type InjectSecretsPayload = { frameSecrets: { [metaframeName: string]: { hashParams?: { [name: string]: string; }; queryParams?: { [name: string]: string; }; }; }; }; export declare const getLibraryVersionMatching: (version: string) => VersionsMetapage; export declare const matchPipe: (outputName: string, source?: string) => boolean; type MetaframeInputTargetsFromOutput = { metaframe: MetaframeId; pipe: MetaframePipeId; }; type CachedInputLookupMap = { [key: string]: { [key: MetaframeId]: MetaframeInputTargetsFromOutput[]; }; }; type MetaframeClients = { [key: MetaframeId]: MetapageIFrameRpcClient; }; export declare class Metapage extends MetapageShared { static readonly version: "0.3" | "1" | "2" | "0.2"; static readonly DEFINITION = MetapageEvents.Definition; static readonly DEFINITION_UPDATE = MetapageEvents.DefinitionUpdate; static readonly ERROR = MetapageEvents.Error; static readonly INPUTS = MetapageEvents.Inputs; static readonly MESSAGE = MetapageEvents.Message; static readonly OUTPUTS = MetapageEvents.Outputs; static readonly STATE = MetapageEvents.State; static deserializeInputs: (inputs: MetaframeInputMap) => Promise; static serializeInputs: (inputs: MetaframeInputMap) => Promise; static from(metaPageDef: any, opts?: { debug?: boolean; }): Promise; _id: MetapageId; _state: MetapageState; _metaframes: MetaframeClients; debug: boolean; _consoleBackgroundColor: string; _originalSecretHashParams: { [metaframeId: string]: { [secretKey: string]: string | undefined; }; }; _originalSecretQueryParams: { [metaframeId: string]: { [secretKey: string]: string | undefined; }; }; _injectedSecrets: { [metaframeId: string]: { [key: string]: string; }; }; _injectedQuerySecrets: { [metaframeId: string]: { [key: string]: string; }; }; _internalReceivedMessageCounter: number; _cachedInputLookupMap: CachedInputLookupMap; _inputMap: { [key: string]: PipeInput[]; }; constructor(opts?: MetapageOptionsV1); isDisposed(): boolean; addListenerReturnDisposer(event: MetapageEvents, listener: ListenerFn): Disposer; onInputs(cb: (inputs: MetapageInstanceInputs) => void): Disposer; onOutputs(cb: (outputs: MetapageInstanceInputs) => void): Disposer; onState(cb: (state: MetapageState) => void): Disposer; setDebugFromUrlParams(): Metapage; getState(): MetapageState; setState(newState: MetapageState): void; getStateMetaframes(): MetapageStatePartial; getDefinition(): MetapageDefinition; injectSecrets(secrets: InjectSecretsPayload): void; private _getDefinitionWithoutSecrets; private _applyDefinition; setDefinition(def: any, state?: MetapageState): Promise; updateDefinition(def: any, state?: MetapageState): Promise; setMetadata(metadata: MetapageMetadataV2): void; _emitDefinitionEvent(): void; private _emitDefinitionUpdateEvent; addPipe(target: MetaframeId, input: PipeInput): void; removeMetaframe(metaframeId: MetaframeId): void; removeAll(): void; metaframes(): { [key: string]: MetapageIFrameRpcClient; }; metaframeIds(): MetaframeId[]; getMetaframeIds(): MetaframeId[]; getMetaframes(): { [key: string]: MetapageIFrameRpcClient; }; getMetaframe(id: MetaframeId): MetapageIFrameRpcClient | undefined; addMetaframe(metaframeId: MetaframeId, definition: MetaframeInstance): MetapageIFrameRpcClient; dispose(): void; log(o: any, color?: string, backgroundColor?: string): void; error(err: any): void; emitErrorMessage(err: string): void; getInputsFromOutput(source: MetaframeId, outputPipeId: MetaframePipeId): MetaframeInputTargetsFromOutput[]; isValidJSONRpcMessage(message: MinimumClientMessage): boolean | "" | undefined; setInput(iframeId: MetaframeId | MetapageInstanceInputs, inputPipeId?: MetaframePipeId | MetaframeInputMap, value?: PipeUpdateBlob): void; setMetaframeClientInputAndSentClientEvent(iframeId: MetaframeId | MetapageInstanceInputs, inputPipeId?: MetaframePipeId | MetaframeInputMap, value?: PipeUpdateBlob): void; setInputs(iframeId: MetaframeId | MetapageInstanceInputs, inputPipeId?: MetaframePipeId | MetaframeInputMap, value?: PipeUpdateBlob): void; setOutputStateOnlyMetapageInstanceInputs(metapageInputs: MetapageInstanceInputs): void; setOutputStateOnlyMetaframeInputValue(metaframeId: MetaframeId, inputPipeId: MetaframePipeId, value?: PipeUpdateBlob): void; setOutputStateOnlyMetaframeInputMap(metaframeId: MetaframeId, metaframeValuesNew: MetaframeInputMap): void; setInputStateOnlyMetapageInstanceInputs(metapageInputs: MetapageInstanceInputs): void; setInputStateOnlyMetaframeInputValue(metaframeId: MetaframeId, inputPipeId: MetaframePipeId, value?: PipeUpdateBlob): void; setInputStateOnlyMetaframeInputMap(metaframeId: MetaframeId, metaframeValuesNew: MetaframeInputMap): void; _setStateOnlyMetaframeInputValue(isInputs: boolean, metaframeId: MetaframeId, metaframePipeId: MetaframePipeId, value?: PipeUpdateBlob): void; _setStateOnlyMetaframeInputMap(isInputs: boolean, metaframeId: MetaframeId, metaframeValuesNew: MetaframeInputMap): void; _setStateOnlyMetaframes(isInputs: boolean, inputsMetaframesNew: MetapageInstanceInputs): void; setMetaframeOutputs(metaframeId: MetaframeId, outputs: MetaframeInputMap): void; setOutputs(outputs: MetapageInstanceInputs): void; onMessage(e: MessageEvent): void; onMessageJsonRpc(jsonrpc: MinimumClientMessage): void; logInternal(o: any, color?: string, backgroundColor?: string): void; } export {}; //# sourceMappingURL=Metapage.d.ts.map