/** * @typedef InPortOptions * @property {any} [default] * @property {Array} [values] * @property {boolean} [control] * @property {boolean} [triggering] */ /** * @callback HasValidationCallback * @param {import("./IP").default} ip * @returns {boolean} */ /** * @typedef {import("./BasePort").BaseOptions & InPortOptions} PortOptions */ export default class InPort extends BasePort { /** * @param {PortOptions} [options] */ constructor(options?: PortOptions); options: PortOptions; /** * @param {import("./IP").default} packet * @param {number|null} [index] */ handleIP(packet: import("./IP").default, index?: number | null): void; /** * @param {string} event * @param {any} payload * @param {number} [id] */ handleSocketEvent(event: string, payload: any, id?: number): boolean; hasDefault(): boolean; prepareBuffer(): void; /** @type {Object>>} */ indexedScopedBuffer: { [x: string]: { [x: number]: Array; }; }; /** @type {Object>} */ indexedIipBuffer: { [x: number]: Array; }; /** @type {Object>} */ indexedBuffer: { [x: number]: Array; }; /** @type {Object>} */ scopedBuffer: { [x: string]: Array; }; /** @type {Array} */ iipBuffer: Array; /** @type {Array} */ buffer: Array; /** * @param {import("./IP").default} ip * @returns {Array} */ prepareBufferForIP(ip: import("./IP").default): Array; /** * @param {any} data */ validateData(data: any): void; /** * @param {string|null} scope * @param {number|null} index * @param {boolean} [initial] * @returns {Array} */ getBuffer(scope: string | null, index: number | null, initial?: boolean): Array; /** * @param {string|null} scope * @param {number|null} index * @param {boolean} [initial] * @returns {import("./IP").default|void} */ getFromBuffer(scope: string | null, index: number | null, initial?: boolean): import("./IP").default | void; /** * Fetches a packet from the port * @param {string|null} scope * @param {number|null} [index] */ get(scope: string | null, index?: number | null): void | import("./IP").default; /** * Fetches a packet from the port * @param {string|null} scope * @param {number|null} index * @param {HasValidationCallback} validate * @param {boolean} [initial] */ hasIPinBuffer(scope: string | null, index: number | null, validate: HasValidationCallback, initial?: boolean): boolean; /** * @param {number|null} index * @param {HasValidationCallback} validate */ hasIIP(index: number | null, validate: HasValidationCallback): boolean; /** * Returns true if port contains packet(s) matching the validator * @param {string|null} scope * @param {number|null|HasValidationCallback} index * @param {HasValidationCallback} [validate] */ has(scope: string | null, index: number | null | HasValidationCallback, validate?: HasValidationCallback): boolean; /** * Returns the number of data packets in an inport * @param {string|null} scope * @param {number|null} [index] * @returns {number} */ length(scope: string | null, index?: number | null): number; /** * Tells if buffer has packets or not * @param {string|null} scope */ ready(scope: string | null): boolean; clear(): void; } export type InPortOptions = { default?: any; values?: Array; control?: boolean; triggering?: boolean; }; export type HasValidationCallback = (ip: import("./IP").default) => boolean; export type PortOptions = import("./BasePort").BaseOptions & InPortOptions; import BasePort from "./BasePort.js";