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