Skip to content

Commit

Permalink
Added type to javascriptRules
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Jan 14, 2025
1 parent 606c531 commit bdcde5e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/types-dev/objects.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,9 @@ declare global {
javascriptRules?: {
/** Translations */
i18n?: boolean | Record<string, Record<ioBroker.Languages, string>> | Record<string, string>;
/** Where to load the blocks */
/** Where to load the blocks, like "rules/customRuleBlocks.js" */
url: string;
/** Blocks names */
/** Rules block name, like "ActionTelegram" */
name: string;
/** Load it as TypeScript module */
type?: 'module';
Expand Down
43 changes: 43 additions & 0 deletions schemas/io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,49 @@
]
}
},
"javascriptRules": {
"type": "object",
"properties": {
"i18n": {
"description": "Translation for the rule block",
"anyOf": [
{
"description": "Translations will be loaded from javascriptRules.url and i18n/<LANG>.json",
"const": true
},
{
"description": "Define translations here",
"type": "object",
"patternProperties": {
".+": {
"$ref": "#/definitions/multilingual"
}
}
}
]
},
"type": {
"description": "Define type='module' if rules written with TypeScript",
"type": "string",
"enum": [
"module"
]
},
"url": {
"description": "Link to module, like 'rules/customRuleBlocks.js'. That means it will loaded from admin/rules directory of the adapter",
"type": "string"
},
"name": {
"description": "Name of the module, like 'ActionTelegram'",
"type": "string"
}
},
"additionalProperties": false,
"required": [
"url",
"name"
]
},
"type": {
"description": "Type of the adapter",
"type": "string",
Expand Down

0 comments on commit bdcde5e

Please sign in to comment.