保誠-保戶業務員媒合平台
HelenHuang
2022-06-09 23b60dc1975db38c280d8a123aff97544d1673e0
PAMapp/node_modules/@types/node/diagnostics_channel.d.ts
@@ -20,7 +20,7 @@
 * should generally include the module name to avoid collisions with data from
 * other modules.
 * @experimental
 * @see [source](https://github.com/nodejs/node/blob/v16.9.0/lib/diagnostics_channel.js)
 * @see [source](https://github.com/nodejs/node/blob/v17.0.0/lib/diagnostics_channel.js)
 */
declare module 'diagnostics_channel' {
    /**
@@ -57,7 +57,7 @@
     * @return The named channel object
     */
    function channel(name: string): Channel;
    type ChannelListener = (name: string, message: unknown) => void;
    type ChannelListener = (message: unknown, name: string) => void;
    /**
     * The class `Channel` represents an individual named channel within the data
     * pipeline. It is use to track subscribers and to publish messages when there
@@ -90,6 +90,24 @@
        readonly hasSubscribers: boolean;
        private constructor(name: string);
        /**
         * Publish a message to any subscribers to the channel. This will
         * trigger message handlers synchronously so they will execute within
         * the same context.
         *
         * ```js
         * import diagnostics_channel from 'diagnostics_channel';
         *
         * const channel = diagnostics_channel.channel('my-channel');
         *
         * channel.publish({
         *   some: 'message'
         * });
         * ```
         * @since v15.1.0, v14.17.0
         * @param message The message to send to the channel subscribers
         */
        publish(message: unknown): void;
        /**
         * Register a message handler to subscribe to this channel. This message handler
         * will be run synchronously whenever a message is published to the channel. Any
         * errors thrown in the message handler will trigger an `'uncaughtException'`.