import { ChannelOutgoing, ChannelTransport, ToSchema } from '@yandex-int/messenger.channels'; import { ClientApi, WidgetApi } from '@yandex-int/messenger.sdk/private'; import { Event } from '@yandex-int/messenger.utils'; import { AbstractWidget } from '../../AbstractWidget'; declare type ScopeParams = { [ClientApi.API_SCOPE]: ClientApi.InitParams; }; declare function channelFactory(channelId: string, transportFactory: (callback: (transport: ChannelTransport) => void) => void, initParams: ClientApi.InitParams): ChannelOutgoing, ToSchema, ToSchema, {}, {}, ScopeParams, object>; declare type ChannelType = ReturnType; export interface CloseEvent { isCriticalError: boolean; error: Maybe; } export declare class WidgetTransport { private widgetId; private channelTransportFactory; private initParams; private events; private handlers; private channelInstance; /** * Вызывается при внутренней перезагрузке дочернего окна, * например при авторизации */ readonly onReloaded: Event; /** * Вызывается при закрытии транспорта */ readonly onClose: Event; constructor(widgetId: string, channelTransportFactory: (callback: (transport: ChannelTransport) => void) => void, initParams: ClientApi.InitParams, events: E, handlers: H); get channel(): ChannelType; destroy(): void; isConnectionClosed(): boolean; private handleConnectionEstablished; private handleClose; private handleEvent; private handleRequest; } export {};