@lcap/nasl 3.10.2-beta.4 → 3.10.2-beta.5

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.
@@ -18,16 +18,16 @@ declare namespace nasl.util {
18
18
  export function ToString(value: Any): String;
19
19
 
20
20
  /* 字符串函数 */
21
- export function Length(str1: String): Decimal;
22
- export function Length<K, V>(str1: Map<K, V>): Decimal;
23
- export function Length<T>(str1: List<T>): Decimal;
21
+ export function Length(str1: String): Long;
22
+ export function Length<K, V>(str1: Map<K, V>): Long;
23
+ export function Length<T>(str1: List<T>): Long;
24
24
  /* 用于查找字符串中指定字段所在位置,常用的场景包括字符串匹配、字符串替换、数据校验等 */
25
- export function IndexOf(str: String, search: String, formIndex: Decimal, ignoreCase: Boolean): Decimal;
25
+ export function IndexOf(str: String, search: String, formIndex: Long, ignoreCase: Boolean): Long;
26
26
  export function Join(list: List<Any>, separator: String): String;
27
- export function LastIndexOf(str: String, search: String, ignoreCase: Boolean): Decimal;
27
+ export function LastIndexOf(str: String, search: String, ignoreCase: Boolean): Long;
28
28
  export function Replace(str: String, search: String, replace: String): String;
29
29
  export function Split(str: String, separator: String, trail: nasl.core.Boolean): List<String>;
30
- export function SubString(str: String, start: Decimal, length: Long): String;
30
+ export function SubString(str: String, start: Long, length: Long): String;
31
31
  export function ToLower(str1: String): String;
32
32
  export function ToUpper(str1: String): String;
33
33
  export function Trim(str1: String): String;
@@ -44,7 +44,7 @@ declare namespace nasl.util {
44
44
  * @param isAbs: 是否返回绝对值,默认为 true
45
45
  * @returns 根据计算类型返回对应的差值
46
46
  */
47
- export function DateDiff<T extends Date | Time | DateTime>(dateTime1: T, dateTime2: T, calcType: 'y' | 'q' | 'm' | 'w' | 'd' | 'h' | 'm' | 's', isAbs: Boolean): Decimal;
47
+ export function DateDiff<T extends Date | Time | DateTime>(dateTime1: T, dateTime2: T, calcType: 'y' | 'q' | 'm' | 'w' | 'd' | 'h' | 'm' | 's', isAbs: Boolean): Long;
48
48
  /* 为指定日期时间调整增加(减少)时间 */
49
49
  export function AlterDateTime<T extends Date | DateTime>(dateTime: T, option: 'Increase' | 'Decrease', amount: Long, unit: 'day' | 'week' | 'month' | 'quarter' | 'year'): T;
50
50
  /**
@@ -65,30 +65,30 @@ declare namespace nasl.util {
65
65
 
66
66
  // 列表(List)函数
67
67
  export function ListAdd<T, K extends T>(list: List<T>, item: K): void;
68
- export function ListAddAll<T>(list: List<T>, addList: List<T>): Decimal;
68
+ export function ListAddAll<T>(list: List<T>, addList: List<T>): Long;
69
69
  export function ListContains<T, K extends T>(list: List<T>, item: K): Boolean;
70
- export function ListInsert<T, K extends T>(list: List<T>, index: Decimal, item: K): void;
70
+ export function ListInsert<T, K extends T>(list: List<T>, index: Long, item: K): void;
71
71
  export function ListDistinct<T>(list: List<T>): void;
72
72
  export function ListDistinctBy<A>(list: List<A>, by: List<{ items: Array<(elem: A) => any>; }>): List<A>;
73
73
  export function ListFilter<T>(list: List<T>, by: (item: T) => Boolean): List<T>;
74
74
  export function ListFind<T>(list: List<T>, by: (item: T) => Boolean): T;
75
- export function ListFindIndex<T>(list: List<T>, by: (item: T) => Boolean): Decimal;
75
+ export function ListFindIndex<T>(list: List<T>, by: (item: T) => Boolean): Long;
76
76
  export function ListFlatten<T>(list: List<List<T>>): List<T>;
77
- export function ListGroupBy<A, K extends Boolean | Decimal | Decimal | String>(list: List<A>, by: (elem: A) => K): Map<K, List<A>>;
77
+ export function ListGroupBy<A, K extends Boolean | Long | Decimal | String>(list: List<A>, by: (elem: A) => K): Map<K, List<A>>;
78
78
  export function ListHead<T>(list: List<T>): T;
79
79
  export function ListLast<T>(list: List<T>): T;
80
- export function ListMax<T extends Decimal | Decimal | String>(list: List<T>): T;
81
- export function ListMin<T extends Decimal | Decimal | String>(list: List<T>): T;
80
+ export function ListMax<T extends Long | Decimal | String>(list: List<T>): T;
81
+ export function ListMin<T extends Long | Decimal | String>(list: List<T>): T;
82
82
  export function ListReverse<T>(list: List<T>): void;
83
- export function ListSlice<T>(list: List<T>, start: Decimal, end: Decimal): List<T>;
83
+ export function ListSlice<T>(list: List<T>, start: Long, end: Long): List<T>;
84
84
  export function ListSort<T>(list: List<T>, by: (item: T) => any, sort: Boolean): void;
85
85
  export function ListSum<T extends Long | Decimal>(list: List<T>): T;
86
- 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>;
86
+ export function ListToMap<T, K extends Boolean | Long | Decimal | String, V>(map: List<T>, byKey: (elem: T) => K, byVal: (elem: T) => V): Map<K, V>;
87
87
  export function ListTransform<T0, T>(list: List<T0>, by: (elem: T0) => T): List<T>;
88
- export function ListGet<T>(list: List<T>, index: Decimal): T;
88
+ export function ListGet<T>(list: List<T>, index: Long): T;
89
89
  export function ListRemove<T, K extends T>(list: List<T>, item: K): void;
90
90
  export function ListRemoveAt<T>(list: List<T>, index: Long): T;
91
- export function ListSet<T, K extends T>(list: List<T>, index: Decimal, item: K): T;
91
+ export function ListSet<T, K extends T>(list: List<T>, index: Long, item: K): T;
92
92
 
93
93
  /* 映射(Map)函数 */
94
94
  export function MapContains<K, V>(map: Map<K, V>, key: K): Boolean;
@@ -110,7 +110,7 @@ declare namespace nasl.util {
110
110
  * 整数/小数 操作
111
111
  * @param mode: 'HalfUp' | 'TowardsZero' | 'TowardsInfinity' === '四舍五入' | '截断、向零取整,如 -2.6 取整为 -2' | '进位、向正负无穷取整,如 -1.1 取整为 -2'
112
112
  */
113
- export function Round(value: Decimal, mode: 'HalfUp' | 'TowardsZero' | 'TowardsInfinity'): Decimal;
113
+ export function Round(value: Decimal, mode: 'HalfUp' | 'TowardsZero' | 'TowardsInfinity'): Long;
114
114
 
115
115
  // 其他函数
116
116
  /**