@opra/common
Version:
Opra common package
27 lines (26 loc) • 1.13 kB
TypeScript
import type { StrictOmit, Type } from 'ts-gems';
import { ResponsiveMap } from '../../helpers/index.js';
import { OpraSchema } from '../../schema/index.js';
import type { ApiDocument } from '../api-document';
import { ApiBase } from '../common/api-base.js';
import { WSController } from './ws-controller.js';
import { WSOperation } from './ws-operation.js';
export declare namespace WSApi {
interface InitArguments extends ApiBase.InitArguments, StrictOmit<OpraSchema.WSApi, 'controllers'> {
}
}
/**
* @class WSApi
*/
export declare class WSApi extends ApiBase {
protected _controllerReverseMap: WeakMap<Type, WSController | null>;
readonly owner: ApiDocument;
readonly transport = "ws";
controllers: ResponsiveMap<WSController>;
constructor(init: WSApi.InitArguments);
findController(controller: Type): WSController | undefined;
findController(name: string): WSController | undefined;
findOperation(controller: Type, operationName: string): WSOperation | undefined;
findOperation(controllerName: string, operationName: string): WSOperation | undefined;
toJSON(): OpraSchema.WSApi;
}