import { Interceptor } from "@kronos-integration/interceptor"; export type ConnectionState = Object; /** * @typedef {Object} ConnectionState */ /** * Connection endpoint. */ export declare class Endpoint { name: string; owner: Object; interceptors: Interceptor[]; /** * @param {string} name endpoint name * @param {Object} owner of the endpoint (service) * @param {Object} options * @param {function(Endpoint,Endpoint):void|undefined} [options.didConnect] called after receiver is present * @param {Interceptor[]|string[]|undefined} [options.interceptors] interceptors * @param {Endpoint} [options.connected] * @param {Array} [options.receivingInterceptors] */ constructor(name: string, owner: Object, options: Object); /** * Name as presented for humans. * @return {string} */ get displayName(): string; /** * Indicate whatever we are a default endpoint. * Default means buildin. * @return {boolean} false */ get isDefault(): boolean; /** * Indicate whatever we are a dummy endpoint. * Dummy endpoints are used duiring construction of the endpoint mesh. * @return {boolean} false */ get isDummy(): boolean; /** * Mapping of properties used in toString. * @return {Object} */ get toStringAttributes(): Object; /** * * @param {Object} options * @param {boolean} [options.includeRuntimeInfo] */ connectionNamesWithStates(options?: { includeRuntimeInfo?: boolean; }): string[]; toString(): string; get identifier(): string; /** * @return {boolean} false */ get isIn(): boolean; /** * @return {boolean} false */ get isOut(): boolean; /** * Deliver data flow direction. * @return {string|undefined} delivers data flow direction 'in', 'out', 'inout' or undefined */ get direction(): string | undefined; toJSON(): Object; /** * Additional attributes to present in json output. */ get jsonAttributes(): never[]; /** * * @param {Object} [options] * @returns {Object} */ toJSONWithOptions(options?: Object): Object; /** * @return {boolean} true if there is at least one interceptor assigned */ get hasInterceptors(): boolean; get isOpen(): boolean; /** * Can we form a connection to the other side. * in to out and out to in. * @param {Endpoint} other * @return {boolean} true if we can be connected to the other endpoint */ connectable(other: Endpoint): boolean; /** * @return {boolean} true if there is at least one connection */ get hasConnections(): boolean; /** * Are we connected to a endpoint. * @param {Endpoint} other to check for the connection * @return {boolean} true if there is a connection to the other endpoint */ isConnected(other: Endpoint): boolean; /** * Actually start with the communication. * @param {Endpoint} other * @param {boolean} [backpointer] true if this is the call from back call from the other side */ openConnection(other: Endpoint, backpointer?: boolean): void; /** * Actually stop the communication. * @param {Endpoint} other * @param {boolean} [backpointer] true if this is the call from back call from the other side */ closeConnection(other: Endpoint, backpointer?: boolean): void; /** * Opens all connections. */ openConnections(): void; /** * Closes all connections. */ closeConnections(): void; /** * @return {Iterable} */ connections(): Iterable; /** * * @param {Endpoint} connection * @param {boolean} [backpointer] true if this is the call form back call from the other side */ addConnection(connection: Endpoint, backpointer?: boolean): void; /** * Actually stop the communication. * @param {Endpoint} other * @param {boolean} [backpointer] true if this is the call form back call from the other side */ removeConnection(other: Endpoint, backpointer?: boolean): void; /** * Deliver state for a given connection. * @param {Endpoint} other * @return {ConnectionState} */ getConnectionState(other: Endpoint): ConnectionState; /** * Set state for a given connection. * @param {Endpoint} other * @param {ConnectionState} state */ setConnectionState(other: Endpoint, state: ConnectionState): void; /** * * @param {Endpoint} endpoint * @param {Endpoint} other */ didConnect(endpoint: Endpoint, other: Endpoint): void; get receivingInterceptors(): never[]; log(level: any, arg1: any): void; trace(...args: any[]): void; debug(...args: any[]): void; info(...args: any[]): void; notice(...args: any[]): void; warn(...args: any[]): void; error(...args: any[]): void; crit(...args: any[]): void; alert(...args: any[]): void; } /** * Check for Endpoint. * @param {any} object to be checked * @return {boolean} true if object is an Endpoint */ export declare function isEndpoint(object: any): boolean; /** * Instanciate interceptors from its definitions. * @param {Interceptor[]|string[]|undefined} interceptors * @param {Object} owner * @return {Interceptor[]} */ export declare function instanciateInterceptors(interceptors: Interceptor[] | string[] | undefined, owner: Object): Interceptor[];