UNPKG

@nasl/types

Version:

NASL types for TypeScript Declaration

1,347 lines (1,346 loc) 44.8 kB
{ "$schema": "http://json-schema.org/draft-07/schema#", "$ref": "#/definitions/UILib", "definitions": { "UILib": { "type": "array", "items": { "$ref": "#/definitions/ViewComponentDeclaration" } }, "ViewComponentDeclaration": { "type": "object", "properties": { "concept": { "type": "string", "const": "ViewComponentDeclaration" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "页面组件名称" }, "kebabName": { "type": "string", "description": "页面组件中划线名称" }, "title": { "type": "string", "description": "页面组件标题" }, "group": { "type": "string", "description": "所在分组" }, "icon": { "type": "string", "description": "页面组件图标" }, "description": { "type": "string", "description": "页面组件描述" }, "tsTypeParams": { "type": "string", "description": "关于 TS 的 typeParams" }, "props": { "type": "array", "items": { "$ref": "#/definitions/PropDeclaration" }, "description": "组件属性列表" }, "readableProps": { "type": "array", "items": { "$ref": "#/definitions/PropDeclaration" }, "description": "可访问的组件属性列表" }, "events": { "type": "array", "items": { "$ref": "#/definitions/EventDeclaration" }, "description": "组件事件列表" }, "slots": { "type": "array", "items": { "$ref": "#/definitions/SlotDeclaration" }, "description": "插槽列表" }, "methods": { "type": "array", "items": { "$ref": "#/definitions/LogicDeclaration" }, "description": "逻辑列表" }, "children": { "type": "array", "items": { "$ref": "#/definitions/ViewComponentDeclaration" }, "description": "页面组件列表" }, "blocks": { "type": "array", "items": { "$ref": "#/definitions/ViewBlockWithImage" }, "description": "页面组件的代码块列表" }, "themeVariables": { "type": "array", "items": { "$ref": "#/definitions/ThemeVariable" }, "description": "主题变量" }, "i18nMap": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "string" } }, "description": "国际化配置列表" } }, "required": [ "concept", "name", "kebabName", "title", "group", "icon", "props", "readableProps", "events", "slots", "methods", "children", "blocks", "themeVariables" ], "additionalProperties": false, "description": "页面组件" }, "PropDeclaration": { "type": "object", "properties": { "concept": { "type": "string", "const": "PropDeclaration" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "组件属性名称" }, "title": { "type": "string", "description": "组件属性标题" }, "group": { "type": "string", "enum": [ "基础信息", "数据属性", "主要属性", "交互属性", "状态属性", "样式属性", "工具属性", "高级属性" ], "description": "组件属性分组" }, "icon": { "type": "string", "description": "组件属性图标" }, "description": { "type": "string", "description": "组件属性描述" }, "tsType": { "type": "string", "description": "类型\n\n直接写 TS 类型" }, "sync": { "type": "boolean", "description": "是否支持双向绑定" }, "implicitToString": { "type": "boolean", "description": "是否将任意类型隐式转换成String\n\n仅在属性类型为 string(不包括字符串枚举)的情况下,且 sync 为 falsy 时可配置" }, "settable": { "type": "boolean", "description": "允许该组件在逻辑中设置" }, "isDataSource": { "type": "boolean", "description": "该属性是否为数据源" }, "tooltipLink": { "type": "string", "description": "工具提示链接" }, "docDescription": { "type": "string", "description": "文档描述" }, "bindHide": { "type": "boolean", "description": "隐藏绑定属性按钮" }, "bindOpen": { "type": "boolean", "description": "绑定属性并打开弹窗" }, "tabKind": { "type": "string", "enum": [ "property", "style" ], "description": "所在的 tab 页" }, "setter": { "$ref": "#/definitions/BaseSetter", "description": "属性设置器" }, "layout": { "type": "string", "enum": [ "block", "inline" ], "description": "属性在面板中的布局方式\n\nblock 表示标题与设置器分行展示;inline 表示同一行展示" }, "defaultValue": { "$ref": "#/definitions/DefaultValue", "description": "默认值" }, "tsDesignerValue": { "type": "string", "description": "渲染时的设计值" }, "tsIf": { "type": "string", "description": "是否显隐\n\n用 TS 写表达式,在 IDE 中直接 eval" }, "tsDisabledIf": { "type": "string", "description": "是否禁用\n\n用 TS 写表达式,在 IDE 中直接 eval" }, "tsOnChange": { "type": "string", "description": "在属性切换时发生的事件\n\n用 TS 写表达式,在 IDE 中直接 eval" } }, "required": [ "concept", "name", "title", "group", "tsType", "sync", "bindHide", "bindOpen", "tabKind", "setter", "layout" ], "additionalProperties": false, "description": "组件属性" }, "BaseSetter": { "anyOf": [ { "$ref": "#/definitions/CustomSetter" }, { "$ref": "#/definitions/InputSetter" }, { "$ref": "#/definitions/SwitchSetter" }, { "$ref": "#/definitions/EnumSelectSetter" }, { "$ref": "#/definitions/CapsulesSetter" }, { "$ref": "#/definitions/NumberInputSetter" }, { "$ref": "#/definitions/IconSetter" }, { "$ref": "#/definitions/ImageSetter" }, { "$ref": "#/definitions/PropertySelectSetter" }, { "$ref": "#/definitions/PropertyTransformSetter" }, { "$ref": "#/definitions/AnonymousFunctionSetter" } ], "description": "设置器基类" }, "CustomSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "CustomSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "自定义属性设置器名称" }, "argumentMap": { "type": "object", "additionalProperties": { "type": "string" }, "description": "参数映射" } }, "required": [ "concept", "name", "argumentMap" ], "additionalProperties": false, "description": "自定义属性设置器" }, "InputSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "InputSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "placeholder": { "type": "string", "description": "占位文本" }, "autoClear": { "type": "boolean", "description": "空值自动删除" } }, "required": [ "concept" ], "additionalProperties": false, "description": "输入框设置器" }, "SwitchSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "SwitchSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" } }, "required": [ "concept" ], "additionalProperties": false, "description": "切换设置器" }, "EnumSelectSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "EnumSelectSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "options": { "type": "array", "items": { "$ref": "#/definitions/SetterOption" }, "description": "枚举选项列表" }, "multiple": { "type": "boolean", "description": "是否多选" }, "clearable": { "type": "boolean", "description": "是否可清空" } }, "required": [ "concept", "options" ], "additionalProperties": false, "description": "枚举选择设置器" }, "SetterOption": { "type": "object", "properties": { "concept": { "type": "string", "const": "SetterOption" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "value": { "type": "string", "description": "选项值" }, "title": { "type": "string", "description": "选项标题" }, "icon": { "type": "string", "description": "选项图标" }, "tooltip": { "type": "string", "description": "选项工具提示" }, "tsIf": { "type": "string", "description": "是否显隐\n\n用 TS 写表达式,在 IDE 中直接 eval" }, "tsDisabledIf": { "type": "string", "description": "是否禁用\n\n用 TS 写表达式,在 IDE 中直接 eval" } }, "required": [ "concept", "value", "title" ], "additionalProperties": false, "description": "设置器枚举选项" }, "CapsulesSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "CapsulesSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "options": { "type": "array", "items": { "$ref": "#/definitions/SetterOption" }, "description": "枚举选项列表" }, "multiple": { "type": "boolean", "description": "是否多选" } }, "required": [ "concept", "options" ], "additionalProperties": false, "description": "胶囊设置器" }, "NumberInputSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "NumberInputSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "placement": { "type": "string", "description": "按钮位置" }, "min": { "type": "number", "description": "最小值" }, "max": { "type": "number", "description": "最大值" }, "precision": { "type": "number", "description": "精度" }, "placeholder": { "type": "string", "description": "占位文本" } }, "required": [ "concept" ], "additionalProperties": false, "description": "数字输入设置器" }, "IconSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "IconSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "title": { "type": "string", "description": "图标标题" }, "customIconFont": { "type": "string", "description": "使用自定义 iconfont 库" }, "hideUploadIcon": { "type": "boolean", "description": "隐藏上传图标功能" } }, "required": [ "concept" ], "additionalProperties": false, "description": "图标设置器" }, "ImageSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "ImageSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" } }, "required": [ "concept" ], "additionalProperties": false, "description": "图片设置器" }, "PropertySelectSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "PropertySelectSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" } }, "required": [ "concept" ], "additionalProperties": false, "description": "属性选择设置器" }, "PropertyTransformSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "PropertyTransformSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" } }, "required": [ "concept" ], "additionalProperties": false, "description": "属性选择设置器" }, "AnonymousFunctionSetter": { "type": "object", "properties": { "concept": { "type": "string", "const": "AnonymousFunctionSetter" }, "changedTime": { "type": "number", "description": "节点变更时间" } }, "required": [ "concept" ], "additionalProperties": false, "description": "匿名函数设置器" }, "DefaultValue": { "type": "object", "properties": { "concept": { "type": "string", "const": "DefaultValue" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "expression": { "$ref": "#/definitions/LogicItem", "description": "根表达式" }, "playground": { "type": "array", "items": { "$ref": "#/definitions/LogicItem" }, "description": "草稿态" } }, "required": [ "concept", "playground" ], "additionalProperties": false, "description": "默认值" }, "LogicItem": { "anyOf": [ { "$ref": "#/definitions/NullLiteral" }, { "$ref": "#/definitions/BooleanLiteral" }, { "$ref": "#/definitions/StringLiteral" }, { "$ref": "#/definitions/NumericLiteral" }, { "$ref": "#/definitions/NewList" } ], "description": "逻辑项" }, "NullLiteral": { "type": "object", "properties": { "concept": { "type": "string", "const": "NullLiteral" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "label": { "type": "string", "description": "逻辑项标题" }, "description": { "type": "string", "description": "逻辑项描述" }, "folded": { "type": "boolean", "description": "是否折叠" }, "offsetX": { "type": "number", "description": "offsetX" }, "offsetY": { "type": "number", "description": "offsetY" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型标注" } }, "required": [ "concept" ], "additionalProperties": false, "description": "空字面量" }, "TypeAnnotation": { "type": "object", "properties": { "concept": { "type": "string", "const": "TypeAnnotation" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "typeKind": { "type": "string", "enum": [ "primitive", "reference", "generic", "typeParam", "function", "union", "anonymousStructure" ], "description": "类型种类" }, "typeNamespace": { "type": "string", "description": "类型命名空间" }, "typeName": { "type": "string", "description": "类型名称" }, "typeArguments": { "type": "array", "items": { "$ref": "#/definitions/TypeAnnotation" }, "description": "类型参数" }, "returnType": { "type": "array", "items": { "$ref": "#/definitions/TypeAnnotation" }, "description": "返回类型" }, "properties": { "type": "array", "items": { "$ref": "#/definitions/StructureProperty" }, "description": "匿名数据结构属性" }, "ruleMap": { "type": "object", "additionalProperties": { "type": "number" }, "description": "规则对象" } }, "required": [ "concept", "typeKind" ], "additionalProperties": false, "description": "类型标注" }, "StructureProperty": { "type": "object", "properties": { "concept": { "type": "string", "const": "StructureProperty" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "数据结构属性名称" }, "label": { "type": "string", "description": "数据结构属性标题" }, "description": { "type": "string", "description": "数据结构属性描述" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型" }, "defaultValue": { "$ref": "#/definitions/DefaultValue", "description": "默认值\n\ndefaultValue结构体" }, "jsonName": { "type": "string", "description": "数据结构字段 JSON 的序列化别名\n\nJSON 字符串别名" } }, "required": [ "concept", "name" ], "additionalProperties": false, "description": "数据结构属性" }, "BooleanLiteral": { "type": "object", "properties": { "concept": { "type": "string", "const": "BooleanLiteral" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "label": { "type": "string", "description": "逻辑项标题" }, "description": { "type": "string", "description": "逻辑项描述" }, "folded": { "type": "boolean", "description": "是否折叠" }, "offsetX": { "type": "number", "description": "offsetX" }, "offsetY": { "type": "number", "description": "offsetY" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型标注" }, "value": { "type": "string", "description": "字面量的值" } }, "required": [ "concept", "value" ], "additionalProperties": false, "description": "布尔型字面量" }, "StringLiteral": { "type": "object", "properties": { "concept": { "type": "string", "const": "StringLiteral" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "label": { "type": "string", "description": "逻辑项标题" }, "description": { "type": "string", "description": "逻辑项描述" }, "folded": { "type": "boolean", "description": "是否折叠" }, "offsetX": { "type": "number", "description": "offsetX" }, "offsetY": { "type": "number", "description": "offsetY" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型标注" }, "value": { "type": "string", "description": "字面量的值" }, "i18nKey": { "type": "string", "description": "国际化键" } }, "required": [ "concept", "value" ], "additionalProperties": false, "description": "字符串字面量" }, "NumericLiteral": { "type": "object", "properties": { "concept": { "type": "string", "const": "NumericLiteral" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "label": { "type": "string", "description": "逻辑项标题" }, "description": { "type": "string", "description": "逻辑项描述" }, "folded": { "type": "boolean", "description": "是否折叠" }, "offsetX": { "type": "number", "description": "offsetX" }, "offsetY": { "type": "number", "description": "offsetY" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型标注" }, "value": { "type": "string", "description": "字面量的值" } }, "required": [ "concept", "value" ], "additionalProperties": false, "description": "数字字面量" }, "NewList": { "type": "object", "properties": { "concept": { "type": "string", "const": "NewList" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "label": { "type": "string", "description": "逻辑项标题" }, "description": { "type": "string", "description": "逻辑项描述" }, "folded": { "type": "boolean", "description": "是否折叠" }, "offsetX": { "type": "number", "description": "offsetX" }, "offsetY": { "type": "number", "description": "offsetY" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型标注" }, "items": { "type": "array", "items": { "$ref": "#/definitions/LogicItem" }, "description": "成员表达式" } }, "required": [ "concept", "items" ], "additionalProperties": false, "description": "列表构造器" }, "EventDeclaration": { "type": "object", "properties": { "concept": { "type": "string", "const": "EventDeclaration" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "组件事件名称" }, "title": { "type": "string", "description": "组件事件标题" }, "description": { "type": "string", "description": "组件事件描述" }, "tsType": { "type": "string", "description": "类型\n\n直接写 TS 类型,这里是个函数类型" } }, "required": [ "concept", "name", "title", "tsType" ], "additionalProperties": false, "description": "组件事件" }, "SlotDeclaration": { "type": "object", "properties": { "concept": { "type": "string", "const": "SlotDeclaration" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "插槽名称" }, "title": { "type": "string", "description": "插槽标题" }, "description": { "type": "string", "description": "插槽描述" }, "tsType": { "type": "string", "description": "类型\n\n直接写 TS 类型" }, "params": { "type": "array", "items": { "$ref": "#/definitions/Param" }, "description": "输入参数列表" }, "emptyBackground": { "type": "string", "description": "空的占位图" }, "snippets": { "type": "array", "items": { "$ref": "#/definitions/ViewBlockWithImage" }, "description": "插槽代码块" } }, "required": [ "concept", "name", "title", "tsType", "params", "snippets" ], "additionalProperties": false, "description": "插槽" }, "Param": { "type": "object", "properties": { "concept": { "type": "string", "const": "Param" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "输入参数名称" }, "description": { "type": "string", "description": "输入参数描述" }, "spread": { "type": "boolean", "description": "是否为展开参数" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型" }, "defaultValue": { "$ref": "#/definitions/DefaultValue", "description": "默认值" } }, "required": [ "concept", "name" ], "additionalProperties": false, "description": "输入参数" }, "ViewBlockWithImage": { "type": "object", "properties": { "concept": { "type": "string", "const": "ViewBlockWithImage" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "title": { "type": "string", "description": "标题" }, "code": { "type": "string", "description": "代码" }, "description": { "type": "string", "description": "描述" }, "screenshot": { "type": "string", "description": "截图" }, "drawing": { "type": "string", "description": "手绘" } }, "required": [ "concept", "title", "code", "screenshot", "drawing" ], "additionalProperties": false, "description": "带截图的代码块" }, "LogicDeclaration": { "type": "object", "properties": { "concept": { "type": "string", "const": "LogicDeclaration" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "逻辑名称" }, "title": { "type": "string", "description": "逻辑标题" }, "description": { "type": "string", "description": "逻辑描述" }, "typeParams": { "type": "array", "items": { "$ref": "#/definitions/TypeParam" }, "description": "类型参数列表" }, "params": { "type": "array", "items": { "$ref": "#/definitions/Param" }, "description": "输入参数列表" }, "returns": { "type": "array", "items": { "$ref": "#/definitions/Return" }, "description": "输出参数列表" } }, "required": [ "concept", "name", "title", "description", "params", "returns" ], "additionalProperties": false, "description": "逻辑声明" }, "TypeParam": { "type": "object", "properties": { "concept": { "type": "string", "const": "TypeParam" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "类型名称" }, "displayName": { "type": "string", "description": "展示名称" } }, "required": [ "concept", "name" ], "additionalProperties": false, "description": "类型参数" }, "Return": { "type": "object", "properties": { "concept": { "type": "string", "const": "Return" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "输出参数名称" }, "description": { "type": "string", "description": "输出参数描述" }, "typeAnnotation": { "$ref": "#/definitions/TypeAnnotation", "description": "类型" }, "defaultValue": { "$ref": "#/definitions/DefaultValue", "description": "默认值" } }, "required": [ "concept", "name" ], "additionalProperties": false, "description": "输出参数" }, "ThemeVariable": { "type": "object", "properties": { "concept": { "type": "string", "const": "ThemeVariable" }, "changedTime": { "type": "number", "description": "节点变更时间" }, "name": { "type": "string", "description": "主题变量名称" } }, "required": [ "concept", "name" ], "additionalProperties": false, "description": "主题变量" } } }