@lcap/nasl 3.9.0-beta.7 → 3.9.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/config.d.ts +1 -1
- package/out/config.d.ts.map +1 -1
- package/out/config.js +2 -1
- package/out/config.js.map +1 -1
- package/out/generator/annotation/utils.d.ts +2 -2
- package/out/generator/annotation/utils.js +1 -1
- package/out/generator/annotation/utils.js.map +1 -1
- package/out/generator/compileComponent.d.ts.map +1 -1
- package/out/generator/compileComponent.js +2 -0
- package/out/generator/compileComponent.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +4 -2
- package/out/generator/genBundleFiles.d.ts.map +1 -1
- package/out/generator/genBundleFiles.js +24 -23
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/release-body/body.js +4 -4
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/ui-library-declaration/basic.d.ts +7 -0
- package/out/generator/ui-library-declaration/basic.d.ts.map +1 -0
- package/out/generator/ui-library-declaration/basic.js +113 -0
- package/out/generator/ui-library-declaration/basic.js.map +1 -0
- package/out/generator/ui-library-declaration/custom.d.ts +11 -0
- package/out/generator/ui-library-declaration/custom.d.ts.map +1 -0
- package/out/generator/ui-library-declaration/custom.js +149 -0
- package/out/generator/ui-library-declaration/custom.js.map +1 -0
- package/out/generator/ui-library-declaration/dependency.d.ts +8 -0
- package/out/generator/ui-library-declaration/dependency.d.ts.map +1 -0
- package/out/generator/ui-library-declaration/dependency.js +163 -0
- package/out/generator/ui-library-declaration/dependency.js.map +1 -0
- package/out/generator/ui-library-declaration/format.d.ts +30 -0
- package/out/generator/ui-library-declaration/format.d.ts.map +1 -0
- package/out/generator/ui-library-declaration/format.js +332 -0
- package/out/generator/ui-library-declaration/format.js.map +1 -0
- package/out/generator/ui-library-declaration/manifest.d.ts +5 -0
- package/out/generator/ui-library-declaration/manifest.d.ts.map +1 -0
- package/out/generator/ui-library-declaration/manifest.js +27 -0
- package/out/generator/ui-library-declaration/manifest.js.map +1 -0
- package/out/generator/ui-library-declaration/material.d.ts +4 -1
- package/out/generator/ui-library-declaration/material.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/material.js +70 -5
- package/out/generator/ui-library-declaration/material.js.map +1 -1
- package/out/generator/ui-library-declaration/types.d.ts +35 -1
- package/out/generator/ui-library-declaration/types.d.ts.map +1 -1
- package/out/generator/ui-library-declaration/utils.d.ts +3 -0
- package/out/generator/ui-library-declaration/utils.d.ts.map +1 -0
- package/out/generator/ui-library-declaration/utils.js +20 -0
- package/out/generator/ui-library-declaration/utils.js.map +1 -0
- package/out/natural/genNaturalTS.d.ts +45 -10
- package/out/natural/genNaturalTS.d.ts.map +1 -1
- package/out/natural/genNaturalTS.js +57 -33
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/getUILib.d.ts.map +1 -1
- package/out/natural/getContext/getUILib.js +6 -3
- package/out/natural/getContext/getUILib.js.map +1 -1
- package/out/natural/getContext/index.d.ts +20 -7
- package/out/natural/getContext/index.d.ts.map +1 -1
- package/out/natural/getContext/index.js +142 -22
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/getContext/naslStdlibMap.js +8 -8
- package/out/natural/getContext/naslStdlibMap.js.map +1 -1
- package/out/natural/tools.d.ts +16 -0
- package/out/natural/tools.d.ts.map +1 -1
- package/out/natural/tools.js +114 -2
- package/out/natural/tools.js.map +1 -1
- package/out/natural/transformTS2UI.d.ts.map +1 -1
- package/out/natural/transformTS2UI.js +345 -294
- package/out/natural/transformTS2UI.js.map +1 -1
- package/out/natural/transformTSCode.d.ts +3 -5
- package/out/natural/transformTSCode.d.ts.map +1 -1
- package/out/natural/transformTSCode.js +30 -1080
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/natural/transforms/registerTransform.d.ts +8 -0
- package/out/natural/transforms/registerTransform.d.ts.map +1 -0
- package/out/natural/transforms/registerTransform.js +24 -0
- package/out/natural/transforms/registerTransform.js.map +1 -0
- package/out/natural/transforms/transform2LogicItem.d.ts +25 -0
- package/out/natural/transforms/transform2LogicItem.d.ts.map +1 -0
- package/out/natural/transforms/transform2LogicItem.js +1262 -0
- package/out/natural/transforms/transform2LogicItem.js.map +1 -0
- package/out/natural/transforms/transform2TypeAnnotation.d.ts +3 -0
- package/out/natural/transforms/transform2TypeAnnotation.d.ts.map +1 -0
- package/out/natural/transforms/transform2TypeAnnotation.js +86 -0
- package/out/natural/transforms/transform2TypeAnnotation.js.map +1 -0
- package/out/natural/transforms/utils.d.ts +9 -0
- package/out/natural/transforms/utils.d.ts.map +1 -0
- package/out/natural/transforms/utils.js +59 -0
- package/out/natural/transforms/utils.js.map +1 -0
- package/out/server/translator.d.ts.map +1 -1
- package/out/server/translator.js.map +1 -1
- package/out/templator/block2nasl/jsx2nasl/index.d.ts +6 -0
- package/out/templator/block2nasl/jsx2nasl/index.d.ts.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/index.js +15 -0
- package/out/templator/block2nasl/jsx2nasl/index.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.d.ts +4 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.d.ts.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.js +213 -0
- package/out/templator/block2nasl/jsx2nasl/transform-expression2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.d.ts +15 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.d.ts.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.js +201 -0
- package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.d.ts +5 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.d.ts.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.js +186 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tstype2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.d.ts +29 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.d.ts.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.js +336 -0
- package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.js.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/utils.d.ts +3 -0
- package/out/templator/block2nasl/jsx2nasl/utils.d.ts.map +1 -0
- package/out/templator/block2nasl/jsx2nasl/utils.js +26 -0
- package/out/templator/block2nasl/jsx2nasl/utils.js.map +1 -0
- package/out/templator/block2nasl/transformBlock2Nasl.d.ts +11 -0
- package/out/templator/block2nasl/transformBlock2Nasl.d.ts.map +1 -0
- package/out/templator/block2nasl/transformBlock2Nasl.js +122 -0
- package/out/templator/block2nasl/transformBlock2Nasl.js.map +1 -0
- package/out/templator/block2nasl/viewMergeBlock.d.ts +10 -0
- package/out/templator/block2nasl/viewMergeBlock.d.ts.map +1 -0
- package/out/templator/block2nasl/viewMergeBlock.js +110 -0
- package/out/templator/block2nasl/viewMergeBlock.js.map +1 -0
- package/package.json +16 -13
- package/sandbox-natural/stdlib/nasl.core.d.ts +54 -0
- package/sandbox-natural/stdlib/nasl.oql.d.ts +22 -0
- package/sandbox-natural/stdlib/nasl.ui.d.ts +78 -0
- package/sandbox-natural/stdlib/nasl.ui.h5.d.ts +1684 -1643
- package/sandbox-natural/stdlib/nasl.ui.h5.json +15746 -15045
- package/sandbox-natural/stdlib/nasl.ui.pc.d.ts +5341 -5154
- package/sandbox-natural/stdlib/nasl.ui.pc.json +31176 -30681
- package/sandbox-natural/stdlib/{nasl.util.ts → nasl.util.d.ts} +49 -43
- package/sandbox-natural/stdlib/nasl.core.ts +0 -36
- package/sandbox-natural/stdlib/nasl.oql.ts +0 -14
- package/sandbox-natural/stdlib/nasl.ui.pre.d.ts +0 -90
- package/sandbox-natural/stdlib/nasl.ui.ts +0 -63
|
@@ -1,19 +1,27 @@
|
|
|
1
|
+
/** 循环函数ForEach
|
|
2
|
+
* 这是唯一一个可以在逻辑中使用的循环函数,用于遍历列表中的元素,禁止使用for、forEach等其他循环语句。
|
|
3
|
+
*/
|
|
4
|
+
declare function ForEach<T>(list: List<T>, start: Integer, end: Integer, fn: (item: T, index: Integer) => void): void;
|
|
5
|
+
|
|
6
|
+
/* 基本运算函数,用于数学计算 */
|
|
7
|
+
declare function plus(left: Decimal, right: Decimal): Decimal;
|
|
8
|
+
declare function minus(left: Decimal, right: Decimal): Decimal;
|
|
9
|
+
declare function multiply(left: Decimal, right: Decimal): Decimal;
|
|
10
|
+
declare function divide(left: Decimal, right: Decimal): Decimal;
|
|
11
|
+
declare function remainder(left: Decimal, right: Decimal): Decimal;
|
|
12
|
+
|
|
1
13
|
declare namespace nasl.util {
|
|
2
|
-
|
|
14
|
+
/* 类型转换与格式化函数 */
|
|
3
15
|
export function Convert(value: null): <T extends never>() => T;
|
|
4
|
-
export function FormatNumber(doubleValue: Decimal |
|
|
5
|
-
|
|
6
|
-
* @example nasl.util.FormatDateTime(dataTime1, 'yyyy-MM-dd HH:mm:ss', 'global')
|
|
7
|
-
*/
|
|
16
|
+
export function FormatNumber(doubleValue: Decimal | Long, digits: Long, showGroups: Boolean): String;
|
|
17
|
+
// @example nasl.util.FormatDateTime(dataTime1, 'yyyy-MM-dd HH:mm:ss', 'global')
|
|
8
18
|
export function FormatDateTime(dateTime: DateTime, formatter: String, timeZone: string): String;
|
|
9
19
|
export function FormatDate(date: Date, formatter: String): String;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
export function FromString<T extends Decimal | Date | Time | DateTime | Integer | Boolean>(value: String): T;
|
|
20
|
+
// @example nasl.util.FromString<Date>(variable1)
|
|
21
|
+
export function FromString<T extends Decimal | Date | Time | DateTime | Long | Boolean>(value: String): T;
|
|
14
22
|
export function ToString(value: Any): String;
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
/* 字符串函数 */
|
|
17
25
|
export function Length(str1: String): Decimal;
|
|
18
26
|
export function Length<K, V>(str1: Map<K, V>): Decimal;
|
|
19
27
|
export function Length<T>(str1: List<T>): Decimal;
|
|
@@ -22,24 +30,28 @@ declare namespace nasl.util {
|
|
|
22
30
|
export function LastIndexOf(str: String, search: String, ignoreCase: Boolean): Decimal;
|
|
23
31
|
export function Replace(str: String, search: String, replace: String): String;
|
|
24
32
|
export function Split(str: String, seperator: String): List<String>;
|
|
25
|
-
export function SubString(str: String, start: Decimal, length:
|
|
33
|
+
export function SubString(str: String, start: Decimal, length: Long): String;
|
|
26
34
|
export function ToLower(str1: String): String;
|
|
27
35
|
export function ToUpper(str1: String): String;
|
|
28
36
|
export function Trim(str1: String): String;
|
|
29
37
|
|
|
30
|
-
|
|
38
|
+
/* 日期与时间函数 */
|
|
31
39
|
export function CurrDate(): Date;
|
|
32
40
|
export function CurrDateTime(): DateTime;
|
|
33
41
|
export function CurrTime(): Time;
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
// 计算两个日期时间之间的差值,calcType 支持年、季度、月、周、天、时分秒,默认为 'd'
|
|
43
|
+
export function DateDiff<T extends Date | Time | DateTime>(dateTime1: T, dateTime2: T, calcType: 'y' | 'q' | 'M' | 'w' | 'd' | 'h' | 'm' | 's', isAbs: Boolean): Decimal;
|
|
44
|
+
// 为指定日期时间调整增加(减少)时间
|
|
36
45
|
export function AlterDateTime<T extends Date | DateTime>(dateTime: T, option: 'Increase' | 'Decrease', amount: Long, unit: 'day' | 'week' | 'month' | 'quarter' | 'year'): T;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
/** 按指定维度计算日期的序号。当输入为 DateTime 类型时,会把数据转到提供的时区的当地时间进行计算
|
|
47
|
+
* @param dateTime: 日期或日期时间
|
|
48
|
+
* @param metric: 计算维度,格式为'小日期单位-大日期单位'。日期单位包括:'year'、'quarter'、'month'、'week'、'day'。如设置 'week-year',则返回当前日期是所在年的第几周, 'day-week',则返回当前日期是所在周的第几天。
|
|
49
|
+
*/
|
|
50
|
+
export function GetDateCount<T extends Date | DateTime>(dateTime: T, metric: 'week-year'): Time;
|
|
51
|
+
// 按“星期几”获取指定日期范围内的日子。当输入为 DateTime 类型时,会把数据转到提供的时区的当地时间进行计算。target 取值范围 [1,2,3,4,5,6,7]
|
|
52
|
+
export function GetSpecificDaysOfWeek<T extends Date | DateTime>(startDate: T, endDate: T, target: List<Long>): List<T>;
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
/* 列表(List)函数 */
|
|
43
55
|
export function Add<T, K extends T>(list: List<T>, item: K): void;
|
|
44
56
|
export function AddAll<T>(list: List<T>, addList: List<T>): Decimal;
|
|
45
57
|
export function Contains<T, K extends T>(list: List<T>, item: K): Boolean;
|
|
@@ -58,15 +70,15 @@ declare namespace nasl.util {
|
|
|
58
70
|
export function ListReverse<T>(list: List<T>): void;
|
|
59
71
|
export function ListSlice<T>(list: List<T>, start: Decimal, end: Decimal): List<T>;
|
|
60
72
|
export function ListSort<T>(list: List<T>, by: (item: T) => any, sort: Boolean): void;
|
|
61
|
-
export function ListSum<T extends
|
|
73
|
+
export function ListSum<T extends Long | Decimal>(list: List<T>): T;
|
|
62
74
|
export function ListToMap<T, K extends Boolean | Decimal | Decimal | String, V>(map: List<T>, byKey: (elem: T) => K, byVal: (elem: T) => V): Map<K, V>;
|
|
63
75
|
export function ListTransform<T0, T>(list: List<T0>, by: (elem: T0) => T): List<T>;
|
|
64
76
|
export function Get<T>(list: List<T>, index: Decimal): T;
|
|
65
77
|
export function Remove<T, K extends T>(list: List<T>, item: K): void;
|
|
66
|
-
export function RemoveAt<T>(list: List<T>, index:
|
|
78
|
+
export function RemoveAt<T>(list: List<T>, index: Long): T;
|
|
67
79
|
export function Set<T, K extends T>(list: List<T>, index: Decimal, item: K): T;
|
|
68
80
|
|
|
69
|
-
|
|
81
|
+
/* 映射(Map)函数 */
|
|
70
82
|
export function MapContains<K, V>(map: Map<K, V>, key: K): Boolean;
|
|
71
83
|
export function MapGet<K, V>(map: Map<K, V>, key: K): V;
|
|
72
84
|
export function MapPut<K, V>(map: Map<K, V>, key: K, value: V): void;
|
|
@@ -74,61 +86,55 @@ declare namespace nasl.util {
|
|
|
74
86
|
export function MapRemove<K, V>(map: Map<K, V>, key: K): void;
|
|
75
87
|
export function MapValues<K, V>(map: Map<K, V>): List<V>;
|
|
76
88
|
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @example nasl.util.EnumToList<app.enums.
|
|
89
|
+
/* 枚举函数,项目中可使用的枚举类型均定义在 app.enums 中 */
|
|
90
|
+
/** 将指定枚举转换枚举value和text的List集合
|
|
91
|
+
* @example nasl.util.EnumToList<app.enums.UserSourceEnum>();
|
|
80
92
|
*/
|
|
81
93
|
export function EnumToList<T extends Enums>(): List<{ text: String, value: String; }>;
|
|
82
|
-
//
|
|
94
|
+
// 返回枚举指定value的标题字符串
|
|
83
95
|
export function EnumValueToText<T extends Enums>(value: any): String;
|
|
84
96
|
// 在指定枚举中找到与参数相同的枚举值并返回
|
|
85
97
|
export function StringToEnumValue<T extends Enums>(value: String): T;
|
|
86
98
|
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* 整数/小数 操作
|
|
99
|
+
/* 数学函数 */
|
|
100
|
+
/** 整数/小数 操作
|
|
90
101
|
* @param mode: 'HalfUp' | 'TowardsZero' | 'TowardsInfinity' === '四舍五入' | '截断、向零取整,如 -2.6 取整为 -2' | '进位、向正负无穷取整,如 -1.1 取整为 -2'
|
|
91
102
|
*/
|
|
92
103
|
export function Round(value: Decimal, mode: 'HalfUp' | 'TowardsZero' | 'TowardsInfinity'): Decimal;
|
|
93
|
-
|
|
94
|
-
// 其他函数
|
|
104
|
+
/* 其他函数 */
|
|
95
105
|
export function Clear<T>(struct: T): T;
|
|
96
106
|
export function Clone<T>(struct: T): T;
|
|
107
|
+
// 判断参数是否为有效值,null、空字符串、纯空格、长度为0的集合均不被视为有效值,传入多个参数时,判断是否全部都是有效值 */
|
|
97
108
|
export function HasValue(...args: Any[]): Boolean;
|
|
98
109
|
// RandomInt 生成的数字为整数,如果需要指定位数的随机数,需要在数字前按照位数要求补 0
|
|
99
|
-
export function RandomInt(start:
|
|
110
|
+
export function RandomInt(start: Long, end: Long): Long;
|
|
100
111
|
|
|
101
112
|
// New 系列函数使用
|
|
102
|
-
/**
|
|
103
|
-
* T 类型必填
|
|
113
|
+
/** 生成新的列表,T 类型必填
|
|
104
114
|
* @example const variable1 = nasl.util.NewList<Boolean | Long>([true, false, 1])
|
|
105
115
|
*/
|
|
106
116
|
export function NewList<T>(args: T[]): List<T>;
|
|
107
|
-
/**
|
|
108
|
-
* T 类型必填
|
|
117
|
+
/** 生成新的映射,K、T 类型必填
|
|
109
118
|
* @example const variable1 = nasl.util.NewMap<String, Long>({'123': 456})
|
|
110
119
|
*/
|
|
111
120
|
export function NewMap<K, T>(args: any): Map<K, T>;
|
|
112
|
-
/**
|
|
113
|
-
* T 类型必填
|
|
121
|
+
/** 生成新的数据实体,T 类型必填
|
|
114
122
|
* class Entity1 { id: Long; property1: String; property2: String;}
|
|
115
123
|
* @example const variable1 = nasl.util.NewEntity<Entity1>({id: 123, property1: '123', property2: '456'})
|
|
116
124
|
*/
|
|
117
125
|
export function NewEntity<T>(arg: T): T;
|
|
118
|
-
/**
|
|
119
|
-
* T 类型必填
|
|
126
|
+
/** 生成新的结构体,T 类型必填
|
|
120
127
|
* class Structure1 { id: Long; property1: String; property2: String;}
|
|
121
128
|
* @example const variable1 = nasl.util.NewStructure<Structure1>({id: 123, property1: '123', property2: '456'})
|
|
122
129
|
*/
|
|
123
130
|
export function NewStructure<T>(arg: T): T;
|
|
124
|
-
/**
|
|
131
|
+
/** 生成新的匿名结构体, 无需定义类型
|
|
125
132
|
* @example const variable1 = nasl.util.NewAnonymousStructure({property1: '123', property2: '456'})
|
|
126
133
|
*/
|
|
127
134
|
export function NewAnonymousStructure(arg: Any): Any;
|
|
128
135
|
|
|
129
136
|
export function jsonSerialize(arg: Any): String;
|
|
130
|
-
/**
|
|
131
|
-
* T 为返回值类型,必填
|
|
137
|
+
/** JSON 反序列化, T 为返回值类型,必填
|
|
132
138
|
* @example nasl.util.jsonDeserialize<Boolean>(variable1);
|
|
133
139
|
*/
|
|
134
140
|
export function jsonDeserialize<T>(arg: String): T;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
type Any = any;
|
|
2
|
-
type Long = number;
|
|
3
|
-
type Integer = number;
|
|
4
|
-
type Decimal = number;
|
|
5
|
-
// type Boolean = boolean;
|
|
6
|
-
// type String = string;
|
|
7
|
-
// type Date = globalThis.Date;
|
|
8
|
-
|
|
9
|
-
class Time {
|
|
10
|
-
accept: 'Time';
|
|
11
|
-
}
|
|
12
|
-
class DateTime {
|
|
13
|
-
accept: 'DateTime';
|
|
14
|
-
}
|
|
15
|
-
type List<T> = Array<T>;
|
|
16
|
-
|
|
17
|
-
interface Entity<T> {
|
|
18
|
-
get(id: Integer): T; // 只能获取一条 Entity 数据,返回一个 Entity 对象
|
|
19
|
-
create(entity: T): T;
|
|
20
|
-
update(entity: T): T;
|
|
21
|
-
delete(id: Integer): void;
|
|
22
|
-
createOrUpdate(body: T): T;
|
|
23
|
-
batchCreate(list: List<T>): List<T>;
|
|
24
|
-
batchUpdate(list: List<T>): List<T>;
|
|
25
|
-
batchDelete(list: List<Integer>): void;
|
|
26
|
-
}
|
|
27
|
-
declare function EntityRelation(property: any): any;
|
|
28
|
-
declare const createEntity: <T>() => Entity<T>;
|
|
29
|
-
|
|
30
|
-
declare function ForEach<T>(list: List<T>, start: Integer, end: Integer, fn: (item: T, index: Integer) => void): void;
|
|
31
|
-
|
|
32
|
-
declare function plus(left: Decimal, right: Decimal): Decimal;
|
|
33
|
-
declare function minus(left: Decimal, right: Decimal): Decimal;
|
|
34
|
-
declare function multiply(left: Decimal, right: Decimal): Decimal;
|
|
35
|
-
declare function divide(left: Decimal, right: Decimal): Decimal;
|
|
36
|
-
declare function remainder(left: Decimal, right: Decimal): Decimal;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare namespace nasl.oql {
|
|
2
|
-
/**
|
|
3
|
-
* 数据查询:当前为服务端逻辑时可使用此方法
|
|
4
|
-
* @param sql 数据查询需要的 SQL
|
|
5
|
-
* @returns 返回类型中的 T 为 sql 根据 SQL 中 select 的字段推导
|
|
6
|
-
*
|
|
7
|
-
* 所有变量格式为:${variable},不能用''包裹,不能用函数处理。
|
|
8
|
-
* 优先使用数据库的查询和数据操纵能力,例如 JOIN、SUM、GROUP_BY 等
|
|
9
|
-
* @example `SELECT * FROM Student WHERE id = ${id}`
|
|
10
|
-
* @example `SELECT OrderProduct.*, Product.price as price FROM OrderProduct JOIN Product WHERE orderId = ${id}`
|
|
11
|
-
* @example `SELECT SUM(OrderProduct.amount * Product.price) as total FROM OrderProduct JOIN Product WHERE orderId = ${orderId}`
|
|
12
|
-
*/
|
|
13
|
-
export function query<T>(sql: string): List<T>;
|
|
14
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
declare namespace nasl.ui {
|
|
2
|
-
export class ViewComponent { }
|
|
3
|
-
|
|
4
|
-
export class ViewComponentOptions {
|
|
5
|
-
@Prop({
|
|
6
|
-
title: '显示条件',
|
|
7
|
-
description: '是否展示组件',
|
|
8
|
-
})
|
|
9
|
-
_if: nasl.core.Boolean;
|
|
10
|
-
|
|
11
|
-
@Prop({
|
|
12
|
-
title: '工具提示',
|
|
13
|
-
description: '在鼠标悬停时显示的文字',
|
|
14
|
-
})
|
|
15
|
-
_tooltip: nasl.core.String;
|
|
16
|
-
|
|
17
|
-
@Prop({
|
|
18
|
-
title: '样式',
|
|
19
|
-
description: '任意组件的样式,使用 inline CSS',
|
|
20
|
-
})
|
|
21
|
-
_staticStyle: nasl.core.String;
|
|
22
|
-
|
|
23
|
-
@Prop({
|
|
24
|
-
title: '动态文本颜色',
|
|
25
|
-
description: '动态调整文本颜色,CSS 的 color 值',
|
|
26
|
-
})
|
|
27
|
-
_color: nasl.color.String;
|
|
28
|
-
|
|
29
|
-
@Prop({
|
|
30
|
-
title: '动态背景颜色',
|
|
31
|
-
description: '动态调整背景颜色,CSS 的 background-color 值',
|
|
32
|
-
})
|
|
33
|
-
_backgroundColor: nasl.color.String;
|
|
34
|
-
|
|
35
|
-
@Prop({
|
|
36
|
-
title: '动态背景图片',
|
|
37
|
-
description: '动态调整背景图片,CSS 的 background-image 值',
|
|
38
|
-
})
|
|
39
|
-
_backgroundImage: nasl.color.String;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface MouseEvent {
|
|
43
|
-
altKey: nasl.core.Boolean;
|
|
44
|
-
button: nasl.core.Integer;
|
|
45
|
-
clientX: nasl.core.Integer;
|
|
46
|
-
clientY: nasl.core.Integer;
|
|
47
|
-
ctrlKey: nasl.core.Boolean;
|
|
48
|
-
metaKey: nasl.core.Boolean;
|
|
49
|
-
movementX: nasl.core.Integer;
|
|
50
|
-
movementY: nasl.core.Integer;
|
|
51
|
-
offsetX: nasl.core.Integer;
|
|
52
|
-
offsetY: nasl.core.Integer;
|
|
53
|
-
pageX: nasl.core.Integer;
|
|
54
|
-
pageY: nasl.core.Integer;
|
|
55
|
-
screenX: nasl.core.Integer;
|
|
56
|
-
screenY: nasl.core.Integer;
|
|
57
|
-
which: nasl.core.Integer;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface FocusEvent {
|
|
61
|
-
cancelBubble: nasl.core.Boolean;
|
|
62
|
-
detail: nasl.core.String;
|
|
63
|
-
layerX: nasl.core.Integer;
|
|
64
|
-
layerY: nasl.core.Integer;
|
|
65
|
-
pageX: nasl.core.Integer;
|
|
66
|
-
pageY: nasl.core.Integer;
|
|
67
|
-
which: nasl.core.Integer;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface ValidateResult {
|
|
71
|
-
rawValue: nasl.core.String;
|
|
72
|
-
value: nasl.core.String;
|
|
73
|
-
trigger: nasl.core.String;
|
|
74
|
-
muted: nasl.core.String;
|
|
75
|
-
valid: nasl.core.Boolean;
|
|
76
|
-
touched: nasl.core.Boolean;
|
|
77
|
-
dirty: nasl.core.Boolean;
|
|
78
|
-
firstError: nasl.core.String;
|
|
79
|
-
triggerValid: nasl.core.Boolean;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function showMessage(text: Any): void;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 跳转到指定页面
|
|
86
|
-
* @example nasl.ui.destination('pageType.some_view.sub1_view', param1, param2);
|
|
87
|
-
* pageType 为 namespace,如 pc 或者 m,必填
|
|
88
|
-
*/
|
|
89
|
-
export function destination(path: String, ...args: Any[]): void;
|
|
90
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
declare namespace nasl.ui {
|
|
2
|
-
export interface MouseEvent { }
|
|
3
|
-
|
|
4
|
-
export interface ValidateResult { valid: Boolean; }
|
|
5
|
-
|
|
6
|
-
export class Button {
|
|
7
|
-
constructor(options?: {
|
|
8
|
-
color?: 'default' | 'primary',
|
|
9
|
-
text?: String,
|
|
10
|
-
onClick?: () => any,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class Form {
|
|
15
|
-
constructor(options?: {});
|
|
16
|
-
|
|
17
|
-
validate(): ValidateResult;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export class Modal {
|
|
21
|
-
constructor(options?: {});
|
|
22
|
-
|
|
23
|
-
open(): void;
|
|
24
|
-
close(): void;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class TableView {
|
|
28
|
-
constructor(options?: {});
|
|
29
|
-
|
|
30
|
-
reload(): void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export class Select {
|
|
34
|
-
constructor(options?: {});
|
|
35
|
-
|
|
36
|
-
reload(): void;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class InfoList {
|
|
40
|
-
constructor(options?: {});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export class Collapse {
|
|
44
|
-
constructor(options?: {});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export class Input {
|
|
48
|
-
constructor(options?: {});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class NumberInput {
|
|
52
|
-
constructor(options?: {});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function showMessage(text: Any): void;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* 跳转到指定页面
|
|
59
|
-
* @example nasl.ui.destination('pageType.some_view.sub1_view', param1, param2);
|
|
60
|
-
* pageType 为 namespace,如 pc 或者 m,必填
|
|
61
|
-
*/
|
|
62
|
-
export function destination(path: String, ...args: Any[]): void;
|
|
63
|
-
}
|