/** @packageDocumentation * @module RpcInterface */ import { BeEvent } from "@bentley/bentleyjs-core"; /** @alpha */ export declare type RpcPushMessageListener = (message: T) => void; /** Defines a transport for push messages. * @alpha */ export declare abstract class RpcPushTransport { onMessage?: (channelId: string, messageData: any) => void; } /** Defines a source of push messages. * @alpha */ export declare class RpcPushService { /** The push service for the dedicated backend (for example, an electron or mobile app). */ static dedicated: RpcPushService; readonly name: string; constructor(name: string); } /** Defines a named stream of push messages. * @alpha */ export declare class RpcPushChannel { /** @internal */ static enabled: boolean; private static _channels; static setup(transport: RpcPushTransport): void; private static notifySubscribers; private _subscribers; readonly name: string; readonly service: RpcPushService; get id(): string; get enabled(): boolean; subscribe(): RpcPushSubscription; private static formatId; private constructor(); /** Creates a new RpcPushChannel. * @throws IModelError if a channel with the specified name and service already exist. */ static create(name: string, service?: RpcPushService): RpcPushChannel; /** Obtains an RpcPushChannel, creating it if one with the specified name and service does not already exists. */ static obtain(name: string, service?: RpcPushService): RpcPushChannel; private static get; private _refCount; dispose(): void; get isDisposed(): boolean; } /** Receives push messages from the backend. * @alpha */ export declare class RpcPushSubscription { readonly channel: RpcPushChannel; readonly onMessage: BeEvent>; /** @internal */ constructor(channel: RpcPushChannel); } /** Sends push messages to the frontend. * @alpha */ export declare abstract class RpcPushConnection { static for(_channel: RpcPushChannel, _client?: unknown): RpcPushConnection; readonly channel: RpcPushChannel; readonly client: unknown; abstract send(messageData: T): Promise; protected constructor(channel: RpcPushChannel, client: unknown); } //# sourceMappingURL=RpcPush.d.ts.map