node-red-contrib-password-g.../lib/PasswordGeneratorNodeInit.ts

22 lines
609 B
TypeScript
Raw Normal View History

2021-07-09 03:49:18 +02:00
import * as nodered from "node-red";
import { PasswordGeneratorNodeProperties } from "./PasswordGeneratorNodeDef";
declare const RED: nodered.EditorRED;
const nodeName = "password-generator";
2021-07-11 06:16:21 +02:00
2021-07-09 03:49:18 +02:00
RED.nodes.registerType<PasswordGeneratorNodeProperties>(nodeName, {
category: "function",
color: "#a6bbcf",
defaults: {
name: { value: "" },
2021-07-11 06:16:21 +02:00
length: { value: "", required: true, validate: RED.validators.number() },
2021-07-09 03:49:18 +02:00
setTo: { value: "" },
},
inputs: 1,
outputs: 1,
icon: "fas fa-not-equal",
label: function () {
return this.name || nodeName;
},
2021-07-11 06:16:21 +02:00
});