diff --git a/packages/node_modules/@node-red/editor-client/src/types/node-red/func.d.ts b/packages/node_modules/@node-red/editor-client/src/types/node-red/func.d.ts index ab120318e..3c3ee7849 100644 --- a/packages/node_modules/@node-red/editor-client/src/types/node-red/func.d.ts +++ b/packages/node_modules/@node-red/editor-client/src/types/node-red/func.d.ts @@ -27,7 +27,7 @@ interface NodeStatus { /** The shape property can be: ring or dot */ shape?: string, /** The text to display */ - text?: string + text?: string|boolean|number } declare class node { @@ -35,48 +35,33 @@ declare class node { * Send 1 or more messages asynchronously * @param {object | object[]} msg The msg object * @param {Boolean} [clone=true] Flag to indicate the `msg` should be cloned. Default = `true` - * @example Send 1 msg to output 1 - * ```javascript - * node.send({ payload: "a" }); - * ``` - * @example Send 2 msg to 2 outputs - * ```javascript - * node.send([{ payload: "output1" }, { payload: "output2" }]); - * ``` - * @example Send 3 msg to output 1 - * ```javascript - * node.send([[{ payload: 1 }, { payload: 2 }, { payload: 3 }]]); - * ``` * @see node-red documentation [writing-functions: sending messages asynchronously](https://nodered.org/docs/user-guide/writing-functions#sending-messages-asynchronously) */ - static send(msg:object, clone?:Boolean); + static send(msg:object|object[], clone?:Boolean): void; /** Inform runtime this instance has completed its operation */ static done(); /** Send an error to the console and debug side bar. Include `msg` in the 2nd parameter to trigger the catch node. */ static error(err:string|Error, msg?:object); /** Log a warn message to the console and debug sidebar */ - static warn(warning:string|Object); + static warn(warning:string|object); /** Log an info message to the console (not sent to sidebar)' */ - static log(info:string|Object); - /** Set the status icon and text underneath the node. + static log(info:string|object); + /** Sets the status icon and text underneath the node. * @param {NodeStatus} status - The status object `{fill, shape, text}` - * @example clear node status - * ```javascript - * node.status({}); - * ``` - * @example set node status to red ring with text - * ```javascript - * node.status({fill:"red",shape:"ring",text:"error"}) - * ``` * @see node-red documentation [writing-functions: adding-status](https://nodered.org/docs/user-guide/writing-functions#adding-status) */ static status(status:NodeStatus); + /** Sets the status text underneath the node. + * @param {string} status - The status to display + * @see node-red documentation [writing-functions: adding-status](https://nodered.org/docs/user-guide/writing-functions#adding-status) + */ + static status(status:string|boolean|number); /** the id of this node */ public readonly id:string; /** the name of this node */ public readonly name:string; /** the number of outputs of this node */ - public readonly outputCount:Number; + public readonly outputCount:number; } declare class context { /** Get a value from context */