/** * Copyright 2024 Mytra Control S.L. All rights reserved. * * Use of this source code is governed by an MIT-style license that can be found in the LICENSE file * or at https://opensource.org/licenses/MIT. */ import { Layer } from '@mdf.js/core'; import { LoggerInstance } from '@mdf.js/logger'; import { Server } from 'http'; import { Config } from './types'; export declare class Port extends Layer.Provider.Port { /** Server handler */ private readonly instance; /** Server terminator */ private readonly terminator; /** * Implementation of functionalities of an HTTP port instance. * @param config - Port configuration options * @param logger - Port logger, to be used internally */ constructor(config: Config, logger: LoggerInstance); /** Return the underlying port instance */ get client(): Server; /** Return the port state as a boolean value, true if the port is available, false in otherwise */ get state(): boolean; /** Initialize the port instance */ start(): Promise; /** Stop the port instance */ stop(): Promise; /** Close the port instance */ close(): Promise; /** Callback function for `error` event */ private readonly onErrorEvent; /** Callback function for `connection` event */ private readonly onConnectionEvent; /** * Transforms a ErrnoException instance to a Crash instance * @param error - Error to be parsed * @returns */ private errorParse; /** * Adapts the `server` instance events to standard Port events * @param instance - Server instance over which the events should be wrapped */ private eventsWrapping; /** * Clean all the events handlers * @param instance - Server instance over which the events should be cleaned */ private eventsUnwrapping; } //# sourceMappingURL=Port.d.ts.map