import { HubConnectionBuilder } from "@microsoft/signalr"; import { IDotnetifyReact } from "./react"; export { IDotnetifyReact, IRouteLinkProps, IScopeProps, IRouteTargetProps, RouteLink, RouteTarget, Scope, useConnect } from "./react"; declare const dotnetify: IDotnetify; export default dotnetify; export interface IDotnetify { react: IDotnetifyReact; vue: IDotnetifyVue; ko: any; hub: IDotnetifyHub; hubOptions: HubOptionsType; hubPath: string; hubLib: any; hubServerUrl: string; debug: boolean; debugFn: (vmId: string, direction: string, payload: any) => void; connectionStateHandler: (state: string, exception: ExceptionType, hub: IDotnetifyHub) => void; connectHandler: (args: VMConnectArgsType) => VMConnectArgsType | void; connect: (vmId: string, options?: IConnectOptions) => IDotnetifyVM; createHub: (iHubServerUrl: string, iHubPath?: string, iHubLib?: any) => IDotnetifyHub; createWebApiHub: (iBaseUrl: string, iRequestHandler: RequestHandlerType) => IDotnetifyHub; createWebSocketHub: (iUrl: string) => IDotnetifyHub; getViewModels(): IDotnetifyVM[]; } export interface IDotnetifyVue { connect(iVMId: string, iVue: any, iOptions?: IConnectOptions): IDotnetifyVM; } export interface IDotnetifyVM { $dispatch: (value: any) => void; $destroy: () => void; $routeTo: (route: RouteType) => void; onRouteEnter?: OnRouteEnterType; } export interface IConnectOptions { getState?: () => any; setState?: (state: any) => void; vmArg?: { [prop: string]: any; }; headers?: { [prop: string]: any; }; exceptionHandler?: ExceptionHandlerType; webApi?: boolean; onRouteEnter?: OnRouteEnterType; } export interface IDotnetifyHub { url: string; mode: string; reconnectDelay: number[]; reconnectRetry: number; isConnected: boolean; isHubStarted: boolean; responseEvent: IEventEmitter; reconnectedEvent: IEventEmitter; connectedEvent: IEventEmitter; connectionFailedEvent: IEventEmitter; init: (hubPath: string, hubServerUrl: string, hubLib: any) => void; startHub: (hubOptions: HubOptionsType, doneHandler: () => void, failHandler: (ex: any) => void, iForceRestart: boolean) => void; stateChanged: (handler: (state: string) => void) => void; disconnected: (handler: () => void) => void; requestVM: (vmId: string, payload: RequestPayloadType) => void; updateVM: (vmId: string, payload: any) => void; disposeVM: (vmId: string) => void; } export interface IEventEmitter { emit: (...args: any) => void; subscribe: (subscriber: any) => () => void; } export declare type HubOptionsType = { transport?: string[]; connectionBuilder?: (builder: HubConnectionBuilder) => HubConnectionBuilder; }; export declare type RequestPayloadType = { $vmArg: { [prop: string]: any; }; $headers: { [prop: string]: any; }; }; export declare type VMConnectArgsType = { vmId: string; options: IConnectOptions; hub: IDotnetifyHub; }; export declare type ExceptionType = { name: string; message: string; }; export declare type ExceptionHandlerType = (exception: ExceptionType) => void; export declare type RequestHandlerType = (url: string, request: any, payload?: any) => void; export interface IDotnetifyRouter { notFound404Url: string; urlPath: string; routedEvent: IEventEmitter; } export interface IDotnetifyVMRouter { initRouting: () => void; } export declare type RoutingStateType = { Root: string; Active: string; Templates: RoutingTemplateType[]; }; export declare type RoutingTemplateType = { Id: string; UrlPattern: string; Target: string; ViewUrl?: string; JSModuleUrl?: string; }; export declare type RouteType = { TemplateId: string; Path: string; Url?: string; RedirectRoot?: string; }; export declare type OnRouteEnterType = (path: string, template: RoutingTemplateType) => void | boolean | Promise;