import { EventType } from '@wix/public-editor-platform-interfaces'; declare class EventEmitter { static biEvents: { PLATFORM_WORKER_SPAWN: number; PLATFORM_APP_RUNNER_INIT_APP_API: number; PLATFORM_APP_RUNNER_RUN_APP: number; PLATFORM_APP_RUNNER_REMOVE_APP: number; PLATFORM_WORKER_APP_BUNDLE_LOAD: number; PLATFORM_WORKER_APP_BUNDLE_EXECUTE: number; PLATFORM_IFRAME_INIT: number; PLATFORM_APP_API_INIT: number; PLATFORM_APP_API_GET: number; }; static EventSteps: { Start: string; End: string; Error: string; }; private uid; private callbacks; private inTransaction; private isSilent; private queue; silent(isSilent?: boolean): void; startTransaction(): void; commit(): void; notify(event: TEvent): void; subscribe(callback: (event: TEvent) => void): () => void; notifyWithStep(event: TEvent, step: string): void; withEvent(event: TEvent, cb: () => TResult | Promise): Promise; } interface IMetaBase { bi?: { evid: number; }; error?: any; step?: string; } interface IPlatformEventBase { type: TType; payload: TPayload; meta: TMeta & IMetaBase; } type IPlatformPrivateEventBase = IPlatformEventBase; type IPlatformAppEventBase = IPlatformEventBase; declare enum PlatformPrivateEvent { WorkerSpawn = "WorkerSpawn", HostEvent = "HostEvent", ApplicationsSpecsReceived = "ApplicationsSpecsReceived", InitApplicationApi = "InitApplicationApi", RunApplication = "RunApplication", getApplicationApi = "getApplicationApi", IframeInit = "IframeInit" } declare enum PlatformLifecycleEvent { EditorReady = "EditorReady" } type IPlatformWorkerSpawnEvent = IPlatformPrivateEventBase; type IPlatformEditorReadyLifecycleEvent = IPlatformPrivateEventBase; type IPlatformHostEvent = IPlatformPrivateEventBase; type IPlatformApplicationsSpecsReceived = IPlatformPrivateEventBase; type IPlatformRunApplication = IPlatformPrivateEventBase; type IPlatformGetApplicationApi = IPlatformPrivateEventBase; type IPlatformInitApplicationApi = IPlatformPrivateEventBase; type IPlatformIframeInit = IPlatformPrivateEventBase; type IPlatformPrivateEvent = IPlatformWorkerSpawnEvent | IPlatformEditorReadyLifecycleEvent | IPlatformHostEvent | IPlatformApplicationsSpecsReceived | IPlatformRunApplication | IPlatformGetApplicationApi | IPlatformInitApplicationApi | IPlatformIframeInit; declare class PlatformPrivateEventFactories { createWorkerSpawnEvent({ url, workerId, strategy, }: { url: string; workerId: string; strategy: string; }): IPlatformWorkerSpawnEvent; createRunApplicationEvent(app: { appDefinitionId: string; type: string; }): IPlatformRunApplication; createGetApplicationApiEvent(targetAppDefId: string, scope: 'private' | 'public'): IPlatformGetApplicationApi; createInitApplicationApiEvent(appDefinitionId: string): IPlatformInitApplicationApi; createIframeInitEvent(frameUrl: string, iframeId: string): IPlatformIframeInit; } declare class PlatformPrivateEventEmitter extends EventEmitter { factories: PlatformPrivateEventFactories; notify(event: IPlatformPrivateEvent): void; } declare enum PlatformAppEvent { ApplicationInit = "ApplicationInit", ApplicationExecute = "ApplicationExecute", ApplicationRemoved = "ApplicationRemoved", ApplicationLoad = "ApplicationLoad", ApplicationApiInit = "ApplicationApiInit", CustomEvent = "CustomEvent", HostEvent = "HostEvent", EditorReady = "EditorReady" } type IPlatformAppInitEvent = IPlatformAppEventBase; type IPlatformAppCustomEvent = IPlatformAppEventBase, {}>; type IPlatformAppHostEvent = IPlatformAppEventBase, {}>; type IPlatformAppExecuteEvent = IPlatformAppEventBase; type IPlatformEditorReadyEvent = IPlatformEventBase; type IPlatformApplicationRemovedEvent = IPlatformAppEventBase; type IPlatformAppLoadEvent = IPlatformAppEventBase; type IPlatformApplicationApiInitEvent = IPlatformAppEventBase; type IPlatformAppEvent = IPlatformAppInitEvent | IPlatformAppCustomEvent | IPlatformAppHostEvent | IPlatformAppExecuteEvent | IPlatformAppLoadEvent | IPlatformApplicationRemovedEvent | IPlatformApplicationApiInitEvent; declare class PlatformAppEventsFactories { createApplicationRemovedEvent(appDefinitionId: string): IPlatformApplicationRemovedEvent; createApplicationLoadEvent(app: { appDefinitionId: string; appType: string; }, url: string): IPlatformAppLoadEvent; createApplicationExecuteEvent(app: { appDefinitionId: string; appType: string; }, url: string): IPlatformAppExecuteEvent; createApplicationApiInitEvent(appDefinitionId: string, scope: 'private' | 'public'): IPlatformApplicationApiInitEvent; } declare class PlatformAppEventEmitter extends EventEmitter { factories: PlatformAppEventsFactories; } /** * The events bridge between DM and private events */ declare class DMEventsBridge { private events; static allowedEvents: EventType[]; private mapToPlatformHostEvent; constructor(events: PlatformPrivateEventEmitter); /** * Notify by event from Worker Manager (platform infrastructure) */ notify(_event: any): void; } export { DMEventsBridge, EventEmitter, PlatformAppEvent, PlatformAppEventEmitter, PlatformLifecycleEvent, PlatformPrivateEvent, PlatformPrivateEventEmitter }; export type { IPlatformAppCustomEvent, IPlatformAppEvent, IPlatformAppExecuteEvent, IPlatformAppHostEvent, IPlatformAppInitEvent, IPlatformAppLoadEvent, IPlatformApplicationApiInitEvent, IPlatformApplicationRemovedEvent, IPlatformApplicationsSpecsReceived, IPlatformEditorReadyEvent, IPlatformEditorReadyLifecycleEvent, IPlatformGetApplicationApi, IPlatformHostEvent, IPlatformIframeInit, IPlatformInitApplicationApi, IPlatformPrivateEvent, IPlatformRunApplication, IPlatformWorkerSpawnEvent };