hyperscript-rxjs 1.3.14 → 1.3.16
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/dist/hyperscript-rxjs.cjs +4114 -0
- package/dist/hyperscript-rxjs.d.ts +980 -954
- package/package.json +19 -19
- package/dist/hyperscript-rxjs.js +0 -1
- package/dist/tsdoc-metadata.json +0 -11
@@ -1,672 +1,731 @@
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
2
|
+
import { HyperscriptExtensions as HyperscriptExtensions_2 } from './HyperscriptExtensions.d.ts';
|
2
3
|
import { Observable } from 'rxjs';
|
3
|
-
import { Observer } from 'rxjs';
|
4
|
+
import { Observer as Observer_2 } from 'rxjs';
|
4
5
|
import { Subject } from 'rxjs';
|
5
6
|
import { Subscription } from 'rxjs';
|
6
7
|
|
7
|
-
export declare function a(props
|
8
|
+
export declare function a(props?: {
|
9
|
+
[_: string]: any;
|
10
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLAnchorElement>;
|
8
11
|
|
9
|
-
export declare function
|
12
|
+
export declare function abbr(props?: {
|
13
|
+
[_: string]: any;
|
14
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
10
15
|
|
11
|
-
export declare function
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
export declare function address(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
16
|
-
|
17
|
-
export declare function address(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
16
|
+
export declare function address(props?: {
|
17
|
+
[_: string]: any;
|
18
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
18
19
|
|
19
20
|
/**
|
20
|
-
*
|
21
|
-
*
|
22
|
-
* @param
|
23
|
-
* @
|
24
|
-
* @returns A tuple where the first element is an array of the first `n` elements (in reverse order),
|
25
|
-
* and the second element is the remaining elements of the array.
|
21
|
+
* @template T
|
22
|
+
* @param {Array<T>} array - 要处理的原数组
|
23
|
+
* @param {number} n - 要取出的元素个数
|
24
|
+
* @returns {[Array<T>, Array<T>]} - [已取出的元素数组, 剩余元素数组]
|
26
25
|
*/
|
27
|
-
export declare function advance<T>(array: T
|
28
|
-
|
29
|
-
export declare function area(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLAreaElement>;
|
26
|
+
export declare function advance<T>(array: Array<T>, n: number): [Array<T>, Array<T>];
|
30
27
|
|
31
|
-
export declare function area(
|
28
|
+
export declare function area(props?: {
|
29
|
+
[_: string]: any;
|
30
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLAreaElement>;
|
32
31
|
|
33
32
|
/**
|
34
|
-
*
|
35
|
-
*
|
36
|
-
* @param
|
37
|
-
* @param
|
38
|
-
* @param index - The position at which to insert the element (default is the end of the array).
|
33
|
+
* insert a element at position in place.
|
34
|
+
* @param {any} array
|
35
|
+
* @param {any} item
|
36
|
+
* @param {any} index
|
39
37
|
*/
|
40
|
-
export declare function arrayInsert
|
38
|
+
export declare function arrayInsert(array: any, item: any, index?: any): void;
|
41
39
|
|
42
40
|
/**
|
43
|
-
*
|
44
|
-
*
|
45
|
-
* @
|
46
|
-
* @param
|
41
|
+
* remove a element in place
|
42
|
+
*
|
43
|
+
* @template T
|
44
|
+
* @param {T[]} array
|
45
|
+
* @param {number} index
|
47
46
|
*/
|
48
47
|
export declare function arrayRemove<T>(array: T[], index?: number): void;
|
49
48
|
|
50
|
-
export declare function article(props
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
export declare function aside(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
55
|
-
|
56
|
-
export declare function aside(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
57
|
-
|
58
|
-
/**
|
59
|
-
* 将 RxJS 订阅对象附加到 DOM 节点上,便于管理。
|
60
|
-
* @private
|
61
|
-
* @param elem - 要附加订阅的 DOM 节点。
|
62
|
-
* @param subscription - 要附加的 RxJS Subscription 对象。
|
63
|
-
* @throws 如果参数无效会抛出错误。
|
64
|
-
*/
|
65
|
-
export declare function attachSubscriptionToNode(
|
66
|
-
elem: Node & { subscription?: Subscription },
|
67
|
-
subscription: Subscription
|
68
|
-
): void;
|
69
|
-
|
70
|
-
export declare function audio(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLAudioElement>;
|
49
|
+
export declare function article(props?: {
|
50
|
+
[_: string]: any;
|
51
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
71
52
|
|
72
|
-
export declare function
|
53
|
+
export declare function aside(props?: {
|
54
|
+
[_: string]: any;
|
55
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
73
56
|
|
74
|
-
export declare function
|
75
|
-
|
76
|
-
|
57
|
+
export declare function attachSubscriptionToNode(elem: Node & {
|
58
|
+
subscription?: Subscription;
|
59
|
+
}, subscription: Subscription): void;
|
77
60
|
|
78
|
-
export declare function
|
61
|
+
export declare function audio(props?: {
|
62
|
+
[_: string]: any;
|
63
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLAudioElement>;
|
79
64
|
|
80
|
-
export declare function
|
65
|
+
export declare function b(props?: {
|
66
|
+
[_: string]: any;
|
67
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
81
68
|
|
82
|
-
export declare function
|
69
|
+
export declare function bdi(props?: {
|
70
|
+
[_: string]: any;
|
71
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
83
72
|
|
84
|
-
export declare function bdo(
|
73
|
+
export declare function bdo(props?: {
|
74
|
+
[_: string]: any;
|
75
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
85
76
|
|
86
77
|
/**
|
87
|
-
* 绑定选项卡的激活状态到 tabIndex
|
88
|
-
*
|
89
|
-
*
|
90
|
-
*
|
78
|
+
* 绑定选项卡的激活状态到 `tabIndex`。
|
79
|
+
*
|
80
|
+
* `bindTabIndex` 函数将选项卡的导航按钮和内容面板与 `tabIndex` 绑定,
|
81
|
+
* 实现动态切换选项卡的功能。
|
82
|
+
*
|
83
|
+
* @param {HTMLElement} tabRoot - 选项卡的根容器,包含导航栏和内容面板。
|
84
|
+
* @param {BehaviorSubject<number>} tabIndex$ - 表示当前激活选项卡索引的 BehaviorSubject。
|
85
|
+
*
|
91
86
|
*/
|
92
|
-
export declare function bindTabIndex(
|
93
|
-
tabRoot: HTMLElement,
|
94
|
-
tabIndex$: BehaviorSubject<number>
|
95
|
-
): void;
|
87
|
+
export declare function bindTabIndex(tabRoot: HTMLElement, tabIndex$: BehaviorSubject<number>): void;
|
96
88
|
|
97
89
|
/**
|
98
|
-
* 一个包含所有 HTML
|
99
|
-
*
|
90
|
+
* 一个包含所有 HTML 块级元素标签名称的集合。
|
91
|
+
*
|
92
|
+
* 块级元素是 HTML 中的一类元素,它们通常会独占一行,并且可以包含内联元素或其他块级元素。
|
93
|
+
* 该集合中的标签名称均为大写,便于快速判断某个元素是否为块级元素。
|
94
|
+
*
|
95
|
+
* 常见的块级元素包括:
|
96
|
+
* - 文本结构元素:`P`、`H1`-`H6`、`ADDRESS` 等。
|
97
|
+
* - 列表元素:`UL`、`OL`、`LI`、`DL`、`DT`、`DD`。
|
98
|
+
* - 容器元素:`DIV`、`SECTION`、`ARTICLE`、`ASIDE`、`NAV` 等。
|
99
|
+
* - 表单元素:`FORM`、`FIELDSET`。
|
100
|
+
* - 表格元素:`TABLE`。
|
101
|
+
* - 其他:`BLOCKQUOTE`、`PRE`、`FIGURE` 等。
|
102
|
+
*
|
103
|
+
* @constant {Set<string>} blockLevelFamily
|
100
104
|
*/
|
101
105
|
export declare const blockLevelFamily: Set<string>;
|
102
106
|
|
103
|
-
export declare function blockquote(props
|
107
|
+
export declare function blockquote(props?: {
|
108
|
+
[_: string]: any;
|
109
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLQuoteElement>;
|
104
110
|
|
105
|
-
export declare function
|
111
|
+
export declare function br(props?: {
|
112
|
+
[_: string]: any;
|
113
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLBRElement>;
|
106
114
|
|
107
|
-
export declare function
|
115
|
+
export declare function button(props?: {
|
116
|
+
[_: string]: any;
|
117
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLButtonElement>;
|
108
118
|
|
109
|
-
export declare function
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
export declare function button(...childNodes: any[]): HyperscriptExtensions<HTMLButtonElement>;
|
114
|
-
|
115
|
-
export declare function caption(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
116
|
-
|
117
|
-
export declare function caption(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
119
|
+
export declare function caption(props?: {
|
120
|
+
[_: string]: any;
|
121
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
118
122
|
|
119
123
|
/**
|
120
|
-
*
|
121
|
-
|
122
|
-
|
123
|
-
*
|
124
|
+
* @typedef {import("./HyperscriptExtensions.d.ts").HyperscriptExtensions<HTMLInputElement>} HyperscriptInputElement
|
125
|
+
*/
|
126
|
+
/**
|
127
|
+
* 创建一个支持 RxJS 的复选框组件。
|
128
|
+
*
|
129
|
+
* @param {{checked?:BehaviorSubject<boolean>, [key: string]: any}} props - 复选框的属性对象。
|
130
|
+
* @returns {HyperscriptInputElement} - 返回一个复选框元素。
|
124
131
|
*/
|
125
132
|
export declare function checkbox(props: {
|
126
|
-
checked?: BehaviorSubject<boolean
|
127
|
-
[key: string]: any
|
128
|
-
}):
|
133
|
+
checked?: BehaviorSubject<boolean>;
|
134
|
+
[key: string]: any;
|
135
|
+
}): HyperscriptInputElement;
|
129
136
|
|
130
137
|
/**
|
131
|
-
*
|
132
|
-
*
|
133
|
-
* @
|
134
|
-
* @param possibilities - 一个对象,键为可能性名称,值为对应的 HTML 元素或 HTML 元素数组。
|
135
|
-
* @returns 包含所有可能性的 HTML 元素数组。
|
138
|
+
* @param {Observable<string>} chosen$
|
139
|
+
* @param {Record<string, HTMLElement | HTMLElement[]>} possibilities
|
140
|
+
* @returns {HTMLElement[]}
|
136
141
|
*/
|
137
|
-
export declare function choice(
|
138
|
-
chosen$: Observable<string>,
|
139
|
-
possibilities: Record<string, HTMLElement | HTMLElement[]>
|
140
|
-
): HTMLElement[];
|
141
|
-
|
142
|
-
export declare function cite(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
143
|
-
|
144
|
-
export declare function cite(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
145
|
-
|
146
|
-
export declare function code(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
142
|
+
export declare function choice(chosen$: Observable<string>, possibilities: Record<string, HTMLElement | HTMLElement[]>): HTMLElement[];
|
147
143
|
|
148
|
-
export declare function
|
144
|
+
export declare function cite(props?: {
|
145
|
+
[_: string]: any;
|
146
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
149
147
|
|
150
|
-
export declare function
|
148
|
+
export declare function code(props?: {
|
149
|
+
[_: string]: any;
|
150
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
151
151
|
|
152
|
-
export declare function col(
|
152
|
+
export declare function col(props?: {
|
153
|
+
[_: string]: any;
|
154
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableColElement>;
|
153
155
|
|
154
|
-
export declare function colgroup(props
|
155
|
-
|
156
|
-
|
156
|
+
export declare function colgroup(props?: {
|
157
|
+
[_: string]: any;
|
158
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableColElement>;
|
157
159
|
|
158
160
|
/**
|
159
|
-
*
|
160
|
-
*
|
161
|
-
*
|
162
|
-
*
|
163
|
-
* @
|
164
|
-
* @
|
161
|
+
* 显示或隐藏包含的元素。
|
162
|
+
*
|
163
|
+
* `collapse` 函数通过绑定 `hidden` 属性,实现一组 HTML 元素的动态显示或隐藏。
|
164
|
+
*
|
165
|
+
* @param {Observable<boolean>} hidden$ - 一个可观察对象(如 BehaviorSubject),用于控制元素的 `hidden` 属性。
|
166
|
+
* @param {...HTMLElement|HTMLElement[]} elements - 一个或多个 HTML 元素,或者包含 HTML 元素的数组。
|
167
|
+
* @returns {HTMLElement[]} - 处理后的元素数组。
|
168
|
+
*
|
169
|
+
* @throws {Error} 如果 `elements` 中包含非元素节点(如 TextNode)。
|
170
|
+
*
|
165
171
|
*/
|
166
|
-
export declare function collapse(
|
167
|
-
hidden$: Observable<boolean>,
|
168
|
-
...elements: (HTMLElement | HTMLElement[])[]
|
169
|
-
): HTMLElement[];
|
172
|
+
export declare function collapse(hidden$: Observable<boolean>, ...elements: (HTMLElement | HTMLElement[])[]): HTMLElement[];
|
170
173
|
|
171
174
|
/**
|
172
|
-
*
|
173
|
-
*
|
174
|
-
* @
|
175
|
-
* @param
|
176
|
-
* @
|
175
|
+
* 比较两个日期对象的大小。
|
176
|
+
*
|
177
|
+
* @public
|
178
|
+
* @param {Date} a - 第一个日期
|
179
|
+
* @param {Date} b - 第二个日期
|
180
|
+
* @returns {number} 如果 a > b 返回正数,a < b 返回负数,相等返回 0
|
177
181
|
*/
|
178
182
|
export declare function compareDate(a: Date, b: Date): number;
|
179
183
|
|
180
184
|
/**
|
181
|
-
*
|
182
|
-
*
|
183
|
-
*
|
184
|
-
*
|
185
|
-
* @param
|
186
|
-
* @
|
187
|
-
* @returns A negative number if `entry1` is less than `entry2`, 0 if they are equal, or a positive number if `entry1` is greater than `entry2`.
|
185
|
+
* 比较两个 entries(key-value 对)。依据他们的 key path。
|
186
|
+
*
|
187
|
+
* @public
|
188
|
+
* @param {[(number|string)[], any]} entry1 - 第一个 entry,key 为 key path(键路径数组)
|
189
|
+
* @param {[(number|string)[], any]} entry2 - 第二个 entry,key 为 key path(键路径数组)
|
190
|
+
* @returns {number} 若 entry1 < entry2 返回负数,相等返回 0,大于返回正数
|
188
191
|
*/
|
189
|
-
export declare function compareEntries(
|
190
|
-
entry1: [(number | string)[], any],
|
191
|
-
entry2: [(number | string)[], any]
|
192
|
-
): number;
|
192
|
+
export declare function compareEntries([keypath1]: [(number | string)[], any], [keypath2]: [(number | string)[], any]): number;
|
193
193
|
|
194
194
|
/**
|
195
|
+
*
|
195
196
|
* Compares two values and returns a number indicating their relative order.
|
196
|
-
*
|
197
|
-
*
|
198
|
-
* -
|
199
|
-
*
|
200
|
-
* @param a - The first value to compare (can be a `number` or `string`).
|
201
|
-
* @param b - The second value to compare (can be a `number` or `string`).
|
202
|
-
* @returns A negative number if `a` is less than `b`, 0 if they are equal, or a positive number if `a` is greater than `b`.
|
197
|
+
* @param {number|string} a - The first value to compare.
|
198
|
+
* @param {number|string} b - The second value to compare.
|
199
|
+
* @returns {number} -1 if a < b, 1 if a > b, or 0 if they are equal.
|
200
|
+
*
|
203
201
|
*/
|
204
202
|
export declare function compareKey(a: number | string, b: number | string): number;
|
205
203
|
|
206
204
|
/**
|
207
|
-
*
|
208
|
-
*
|
209
|
-
*
|
210
|
-
*
|
211
|
-
*
|
212
|
-
*
|
213
|
-
*
|
214
|
-
* @param a - The first key path (array of keys) to compare.
|
215
|
-
* @param b - The second key path (array of keys) to compare.
|
216
|
-
* @returns A negative number if `a` is less than `b`, 0 if they are equal, or a positive number if `a` is greater than `b`.
|
205
|
+
* 比较两个 key path(键路径数组)。
|
206
|
+
*
|
207
|
+
* @public
|
208
|
+
* @param {(number|string)[]} a - 第一个 key path
|
209
|
+
* @param {(number|string)[]} b - 第二个 key path
|
210
|
+
* @returns {number} 若 a < b 返回负数,相等返回 0,大于返回正数
|
217
211
|
*/
|
218
212
|
export declare function compareKeyPath(a: (number | string)[], b: (number | string)[]): number;
|
219
213
|
|
220
214
|
/**
|
221
|
-
*
|
222
|
-
*
|
223
|
-
*
|
224
|
-
* - Supports comparison of `number` and `bigint` types.
|
225
|
-
*
|
226
|
-
* @param a - The first value to compare (can be `number` or `bigint`).
|
227
|
-
* @param b - The second value to compare (can be `number` or `bigint`).
|
228
|
-
* @returns A negative number if `a` is less than `b`, 0 if they are equal, or a positive number if `a` is greater than `b`.
|
215
|
+
* 可以比较NaN,Infinity,number,bigint
|
216
|
+
* @param {number|bigint} a
|
217
|
+
* @param {number|bigint} b
|
229
218
|
*/
|
230
219
|
export declare function compareNumber(a: number | bigint, b: number | bigint): number;
|
231
220
|
|
232
221
|
/**
|
233
222
|
* 用于比较和操作数组及集合的工具类。
|
223
|
+
*
|
224
|
+
* @public
|
234
225
|
* @template T
|
235
226
|
*/
|
236
227
|
export declare class Comparer<T> {
|
228
|
+
/**
|
229
|
+
* @param {(a: T, b: T) => number} compare - 比较函数
|
230
|
+
*/
|
237
231
|
constructor(compare: (a: T, b: T) => number);
|
238
|
-
|
232
|
+
compare: (a: T, b: T) => number;
|
239
233
|
/**
|
240
234
|
* 使用实例的比较函数对数组进行排序。
|
241
|
-
* @param array - 要排序的数组
|
242
|
-
* @returns 排序后的数组
|
235
|
+
* @param {T[]} array - 要排序的数组
|
236
|
+
* @returns {T[]} 排序后的数组
|
243
237
|
*/
|
244
238
|
sort(array: T[]): T[];
|
245
|
-
|
246
239
|
/**
|
247
240
|
* 移除数组中的重复值。
|
248
|
-
* @param array - 要处理的数组
|
249
|
-
* @returns 去重后的新数组
|
241
|
+
* @param {T[]} array - 要处理的数组
|
242
|
+
* @returns {T[]} 去重后的新数组
|
250
243
|
*/
|
251
244
|
distinct(array: T[]): T[];
|
252
|
-
|
245
|
+
/**
|
246
|
+
* 将已排序的数组转为集合(去重)。
|
247
|
+
* @param {T[]} array - 已排序的数组
|
248
|
+
* @returns {T[]} 唯一元素数组
|
249
|
+
*/
|
250
|
+
sortedArrayToSet(array: T[]): T[];
|
253
251
|
/**
|
254
252
|
* 根据 getKey 生成的 key 对数组元素分组。
|
255
253
|
* @template U
|
256
|
-
* @param array - 要分组的数组
|
257
|
-
* @param getKey - 生成分组 key 的函数
|
258
|
-
* @returns 分组后的对象或数组
|
254
|
+
* @param {U[]} array - 要分组的数组
|
255
|
+
* @param {(item:U) => T} getKey - 生成分组 key 的函数
|
256
|
+
* @returns {[T, U[]][]} 分组后的对象或数组
|
259
257
|
*/
|
260
258
|
groupBy<U>(array: U[], getKey: (item: U) => T): [T, U[]][];
|
261
|
-
|
262
259
|
/**
|
263
260
|
* 对已排序的数组按 key 分组。
|
264
261
|
* @template V
|
265
|
-
* @param array - 已排序的数组
|
266
|
-
* @returns 分组结果
|
262
|
+
* @param {[T,V][]} array - 已排序的数组
|
263
|
+
* @returns {[T, V[]][]} 分组结果
|
267
264
|
*/
|
268
265
|
groupSortedEntries<V>(array: [T, V][]): [T, V[]][];
|
269
|
-
|
270
266
|
/**
|
271
|
-
*
|
272
|
-
* @param array1 - 第一个数组
|
273
|
-
* @param array2 - 第二个数组
|
274
|
-
* @returns array1 中有而 array2 中没有的元素
|
267
|
+
* 计算两个数组的差集。数组元素是升序排列
|
268
|
+
* @param {T[]} array1 - 第一个数组
|
269
|
+
* @param {T[]} array2 - 第二个数组
|
270
|
+
* @returns {T[]} array1 中有而 array2 中没有的元素
|
275
271
|
*/
|
276
272
|
differenceSet(array1: T[], array2: T[]): T[];
|
277
|
-
|
278
|
-
/**
|
279
|
-
* 在集合(数组)中查找元素的索引。
|
280
|
-
* @param set - 要查找的数组
|
281
|
-
* @param element - 要查找的元素
|
282
|
-
* @returns 元素在集合中的索引,未找到返回 -1
|
283
|
-
*/
|
284
|
-
findIndexInSet(set: T[], element: T): number;
|
285
|
-
|
286
273
|
/**
|
287
274
|
* 计算两个数组的交集。
|
288
|
-
* @param array1 - 第一个数组
|
289
|
-
* @param array2 - 第二个数组
|
290
|
-
* @returns 同时存在于 array1 和 array2 的元素
|
275
|
+
* @param {T[]} array1 - 第一个数组
|
276
|
+
* @param {T[]} array2 - 第二个数组
|
277
|
+
* @returns {T[]} 同时存在于 array1 和 array2 的元素
|
291
278
|
*/
|
292
279
|
intersectSet(array1: T[], array2: T[]): T[];
|
293
|
-
|
280
|
+
/**
|
281
|
+
* 计算两个数组的并集(去重)。
|
282
|
+
* @param {T[]} array1 - 第一个数组
|
283
|
+
* @param {T[]} array2 - 第二个数组
|
284
|
+
* @returns {T[]} 两个数组的唯一元素合集
|
285
|
+
*/
|
286
|
+
unionSet(array1: T[], array2: T[]): T[];
|
287
|
+
/**
|
288
|
+
* 在集合(数组)中查找元素的索引。
|
289
|
+
* @param {T[]} set - 要查找的数组
|
290
|
+
* @param {T} element - 要查找的元素
|
291
|
+
* @returns {number} 元素在集合中的索引,未找到返回 -1
|
292
|
+
*/
|
293
|
+
findIndexInSet(set: T[], element: T): number;
|
294
294
|
/**
|
295
295
|
* 判断两个数组作为集合是否相等。
|
296
|
-
* @param array1 - 第一个数组
|
297
|
-
* @param array2 - 第二个数组
|
298
|
-
* @returns 如果集合相等返回 true,否则返回 false
|
296
|
+
* @param {T[]} array1 - 第一个数组
|
297
|
+
* @param {T[]} array2 - 第二个数组
|
298
|
+
* @returns {boolean} 如果集合相等返回 true,否则返回 false
|
299
299
|
*/
|
300
300
|
isEqualset(array1: T[], array2: T[]): boolean;
|
301
|
-
|
302
301
|
/**
|
303
302
|
* 判断第一个数组是否为第二个数组的子集。
|
304
|
-
* @param array1 - 第一个数组
|
305
|
-
* @param array2 - 第二个数组
|
306
|
-
* @returns 如果 array1 是 array2 的子集返回 true,否则返回 false
|
303
|
+
* @param {T[]} array1 - 第一个数组
|
304
|
+
* @param {T[]} array2 - 第二个数组
|
305
|
+
* @returns {boolean} 如果 array1 是 array2 的子集返回 true,否则返回 false
|
307
306
|
*/
|
308
307
|
isSubset(array1: T[], array2: T[]): boolean;
|
309
|
-
|
310
308
|
/**
|
311
309
|
* 判断第一个数组是否为第二个数组的超集。
|
312
|
-
* @param array1 - 第一个数组
|
313
|
-
* @param array2 - 第二个数组
|
314
|
-
* @returns 如果 array1 是 array2 的超集返回 true,否则返回 false
|
310
|
+
* @param {T[]} array1 - 第一个数组
|
311
|
+
* @param {T[]} array2 - 第二个数组
|
312
|
+
* @returns {boolean} 如果 array1 是 array2 的超集返回 true,否则返回 false
|
315
313
|
*/
|
316
314
|
isSuperset(array1: T[], array2: T[]): boolean;
|
317
|
-
|
318
|
-
/**
|
319
|
-
* 计算两个数组的并集(去重)。
|
320
|
-
* @param array1 - 第一个数组
|
321
|
-
* @param array2 - 第二个数组
|
322
|
-
* @returns 两个数组的唯一元素合集
|
323
|
-
*/
|
324
|
-
unionSet(array1: T[], array2: T[]): T[];
|
325
|
-
|
326
|
-
/**
|
327
|
-
* 将已排序的数组转为集合(去重)。
|
328
|
-
* @param array - 已排序的数组
|
329
|
-
* @returns 唯一元素数组
|
330
|
-
*/
|
331
|
-
sortedArrayToSet(array: T[]): T[];
|
332
315
|
}
|
333
316
|
|
334
|
-
|
335
|
-
* 函数优先的管道组合工具(从右向左执行)。
|
336
|
-
* @public
|
337
|
-
* @param fns - 要组合的函数列表。
|
338
|
-
* @returns 组合后的函数(无参数时返回恒等函数 x => x)。
|
339
|
-
* @throws {TypeError} 当参数包含非函数时抛出错误。
|
340
|
-
*/
|
341
|
-
export declare function compose(
|
342
|
-
...fns: Array<(arg: any) => any>
|
343
|
-
): (input: any) => any;
|
344
|
-
|
345
|
-
/**
|
346
|
-
* 条件分支函数,根据分支依次判断并执行。
|
347
|
-
* @public
|
348
|
-
* @param branches - 分支数组,每个分支可以是函数或 [predicate, action] 形式的数组。
|
349
|
-
* @returns 一个函数,调用时会依次判断分支并返回第一个匹配的结果。
|
350
|
-
*/
|
351
|
-
export declare function cond<T extends any[], R>(
|
352
|
-
branches: (
|
353
|
-
| ((...args: T) => R | undefined | void | null | false)
|
354
|
-
| [ (...args: T) => any, (...args: [...T, any]) => R ]
|
355
|
-
)[]
|
356
|
-
): (...args: T) => R | undefined;
|
317
|
+
export declare function compose(...fns: ((arg: any) => any)[]): (arg: any) => any;
|
357
318
|
|
358
|
-
export declare function
|
319
|
+
export declare function cond(branches: Array<Function | [Function, Function]>): (...args: any[]) => any;
|
359
320
|
|
360
|
-
export declare function data(
|
321
|
+
export declare function data(props?: {
|
322
|
+
[_: string]: any;
|
323
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLDataElement>;
|
361
324
|
|
362
|
-
export declare function datalist(props
|
325
|
+
export declare function datalist(props?: {
|
326
|
+
[_: string]: any;
|
327
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLDataListElement>;
|
363
328
|
|
364
|
-
export declare function
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
export declare function dd(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
329
|
+
export declare function dd(props?: {
|
330
|
+
[_: string]: any;
|
331
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
369
332
|
|
333
|
+
/**
|
334
|
+
* 深度(嵌套)数据结构类,用于处理按键路径排序的键值对集合。
|
335
|
+
* 提供了多种操作方法,包括集合操作、序列操作和数据转换。
|
336
|
+
*
|
337
|
+
* @template T
|
338
|
+
*
|
339
|
+
*/
|
370
340
|
export declare class Deep<T> {
|
341
|
+
/**
|
342
|
+
*
|
343
|
+
* @param {{[_:string|number]:any}} obj
|
344
|
+
* @param {(value: any, key: string | number, keyPath: (string | number)[]) => boolean} [filter]
|
345
|
+
* @returns
|
346
|
+
*/
|
347
|
+
static fromObject(obj: {
|
348
|
+
[_: string | number]: any;
|
349
|
+
}, filter?: (value: any, key: string | number, keyPath: (string | number)[]) => boolean): Deep<any>;
|
350
|
+
/**
|
351
|
+
* @template T
|
352
|
+
* @param {{[_:string|number]:any}} obj
|
353
|
+
* @returns {Deep<BehaviorSubject<T>>}
|
354
|
+
*/
|
355
|
+
static fromBehaviorSubject<T_1>(obj: {
|
356
|
+
[_: string | number]: any;
|
357
|
+
}): Deep<BehaviorSubject<T_1>>;
|
358
|
+
/**
|
359
|
+
* @template T
|
360
|
+
* @param {{[_:string|number]:any}} obj
|
361
|
+
* @returns
|
362
|
+
*/
|
363
|
+
static fromObservable<T_1>(obj: {
|
364
|
+
[_: string | number]: any;
|
365
|
+
}): Deep<any>;
|
366
|
+
/**
|
367
|
+
* 构造函数。
|
368
|
+
*
|
369
|
+
* @param {[(string|number)[], T][]} entries - 按键路径排序的键值对数组。键值对已经按keypath排序。
|
370
|
+
*/
|
371
371
|
constructor(entries: [(string | number)[], T][]);
|
372
|
-
|
373
|
-
|
374
|
-
|
372
|
+
_entries: [(string | number)[], T][];
|
373
|
+
_keys: (string | number)[][];
|
374
|
+
get entries(): [(string | number)[], T][];
|
375
|
+
get keys(): (string | number)[][];
|
375
376
|
getValues(): T[];
|
376
|
-
|
377
377
|
/**
|
378
378
|
* 将深度数据结构转换为普通对象。
|
379
|
-
*
|
379
|
+
*
|
380
380
|
* @returns {Record<string|number, any>} 转换后的普通对象。
|
381
381
|
*/
|
382
382
|
toObject(): Record<string | number, any>;
|
383
|
-
|
383
|
+
/**
|
384
|
+
*
|
385
|
+
* @param {(string|number)[]} searchKeyPath
|
386
|
+
* @returns
|
387
|
+
*/
|
384
388
|
findIndex(searchKeyPath: (string | number)[]): number;
|
385
|
-
|
389
|
+
/**
|
390
|
+
*
|
391
|
+
* @param {(string|number)[][]} keys
|
392
|
+
* @returns
|
393
|
+
*/
|
386
394
|
structuralEqual(keys: (string | number)[][]): boolean;
|
395
|
+
/**
|
396
|
+
*
|
397
|
+
* @param {(string|number)[][]} keys
|
398
|
+
* @returns
|
399
|
+
*/
|
387
400
|
structuralSubset(keys: (string | number)[][]): boolean;
|
401
|
+
/**
|
402
|
+
*
|
403
|
+
* @param {(string|number)[][]} keys
|
404
|
+
* @returns
|
405
|
+
*/
|
388
406
|
structuralSuperset(keys: (string | number)[][]): boolean;
|
389
|
-
|
390
|
-
|
391
|
-
|
407
|
+
/**
|
408
|
+
* @param {(string|number)[][]} keys
|
409
|
+
* @this {Deep<T>}
|
410
|
+
* @returns {Deep<T>}
|
411
|
+
*/
|
412
|
+
intersect(this: Deep<T>, keys: (string | number)[][]): Deep<T>;
|
413
|
+
/**
|
414
|
+
*
|
415
|
+
* @param {(string|number)[][]} keys
|
416
|
+
* @this {Deep<T>}
|
417
|
+
* @returns {Deep<T>}
|
418
|
+
*/
|
419
|
+
difference(this: Deep<T>, keys: (string | number)[][]): Deep<T>;
|
392
420
|
/**
|
393
421
|
* 后来者赢(参数赢)
|
394
|
-
* @param entries
|
422
|
+
* @param {[(string | number)[], T][]} entries
|
423
|
+
* @returns
|
395
424
|
*/
|
396
|
-
union(entries: [(string | number)[], T][]): Deep<
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
425
|
+
union(entries: [(string | number)[], T][]): Deep<any>;
|
426
|
+
/**
|
427
|
+
*
|
428
|
+
* @template U
|
429
|
+
* @param {(value: [(string | number)[], T], index: number, array: [(string | number)[], T][]) => U} callbackfn 返回的是值,而不是键值对,KeyPath保持不变
|
430
|
+
* @param {Deep<T>} [thisArg]
|
431
|
+
* @this {Deep<T>}
|
432
|
+
* @returns {Deep<U>}
|
433
|
+
*
|
434
|
+
*/
|
435
|
+
map<U>(this: Deep<T>, callbackfn: (value: [(string | number)[], T], index: number, array: [(string | number)[], T][]) => U, thisArg?: Deep<T>): Deep<U>;
|
436
|
+
/**
|
437
|
+
*
|
438
|
+
* @param {(value: [(string | number)[], T], index: number, array: [(string | number)[], T][]) => boolean} predicate
|
439
|
+
* @param {Deep<T>} [thisArg]
|
440
|
+
* @returns
|
441
|
+
*/
|
442
|
+
filter(predicate: (value: [(string | number)[], T], index: number, array: [(string | number)[], T][]) => boolean, thisArg?: Deep<T>): Deep<T>;
|
443
|
+
/**
|
444
|
+
*
|
445
|
+
* @param { (value: [(string | number)[], T], index: number, array: [(string | number)[], T][]) => void} callbackfn
|
446
|
+
* @param {Deep<T>} [thisArg]
|
447
|
+
* @returns
|
448
|
+
*/
|
449
|
+
forEach(callbackfn: (value: [(string | number)[], T], index: number, array: [(string | number)[], T][]) => void, thisArg?: Deep<T>): void;
|
450
|
+
/**
|
451
|
+
* 修改部分个别数值
|
452
|
+
* @param {Record<string|number,any>} obj
|
453
|
+
* @this {Deep<T>}
|
454
|
+
* @returns
|
455
|
+
*/
|
456
|
+
freshValue(this: Deep<T>, obj: Record<string | number, any>): Deep<any>;
|
457
|
+
/**
|
458
|
+
* 按列替换数值
|
459
|
+
* @template U
|
460
|
+
* @param {U[]} values
|
461
|
+
* @this {Deep<T>}
|
462
|
+
* @returns {Deep<U>}
|
463
|
+
*/
|
464
|
+
replaceValue<U>(this: Deep<T>, values: U[]): Deep<U>;
|
465
|
+
/**
|
466
|
+
* 按列替换数值,保留原有数值
|
467
|
+
* @template U
|
468
|
+
* @param {U[]} values
|
469
|
+
* @this {Deep<T>}
|
470
|
+
* @returns {Deep<[T,U]>}
|
471
|
+
*/
|
472
|
+
zipValue<U>(this: Deep<T>, values: U[]): Deep<[T, U]>;
|
473
|
+
/**
|
474
|
+
* 返回Observable of 总体的当前值
|
475
|
+
* @template U
|
476
|
+
* @this {Deep<Observable<U>>}
|
477
|
+
* @returns {Observable<Deep<U>>}
|
478
|
+
*/
|
479
|
+
combineLatest<U>(this: Deep<Observable<U>>): Observable<Deep<U>>;
|
480
|
+
/**
|
481
|
+
* 返回发射消息的那一个成员的路径以及新值。
|
482
|
+
* @template U
|
483
|
+
* @this {Deep<Observable<U>>}
|
484
|
+
* @returns {Observable<[(string|number)[], U]>}
|
485
|
+
*/
|
486
|
+
merge<U>(this: Deep<Observable<U>>): Observable<[(string | number)[], U]>;
|
424
487
|
}
|
425
488
|
|
426
489
|
/**
|
427
|
-
*
|
428
|
-
*
|
429
|
-
* @
|
430
|
-
* @
|
431
|
-
* @
|
490
|
+
* 默认比较函数,适用于可比较的基本类型。
|
491
|
+
*
|
492
|
+
* @public
|
493
|
+
* @template T
|
494
|
+
* @param {T} a - 第一个值
|
495
|
+
* @param {T} b - 第二个值
|
496
|
+
* @returns {number} 如果 a > b 返回 1,a < b 返回 -1,相等返回 0
|
432
497
|
*/
|
433
498
|
export declare function defaultCompare<T>(a: T, b: T): number;
|
434
499
|
|
435
|
-
/**
|
436
|
-
* A comparer instance using the default comparison logic.
|
437
|
-
*/
|
438
500
|
export declare const defaultComparer: Comparer<any>;
|
439
501
|
|
440
|
-
export declare function del(props
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
export declare function details(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLDetailsElement>;
|
502
|
+
export declare function del(props?: {
|
503
|
+
[_: string]: any;
|
504
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLModElement>;
|
445
505
|
|
446
|
-
export declare function details(
|
506
|
+
export declare function details(props?: {
|
507
|
+
[_: string]: any;
|
508
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLDetailsElement>;
|
447
509
|
|
448
|
-
export declare function dfn(props
|
510
|
+
export declare function dfn(props?: {
|
511
|
+
[_: string]: any;
|
512
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
449
513
|
|
450
|
-
export declare function
|
514
|
+
export declare function dialog(props?: {
|
515
|
+
[_: string]: any;
|
516
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLDialogElement>;
|
451
517
|
|
452
|
-
export declare function
|
518
|
+
export declare function div(props?: {
|
519
|
+
[_: string]: any;
|
520
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLDivElement>;
|
453
521
|
|
454
|
-
export declare function
|
522
|
+
export declare function dl(props?: {
|
523
|
+
[_: string]: any;
|
524
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLDListElement>;
|
455
525
|
|
456
|
-
export declare function
|
526
|
+
export declare function dt(props?: {
|
527
|
+
[_: string]: any;
|
528
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
457
529
|
|
458
|
-
export declare function
|
530
|
+
export declare function em(props?: {
|
531
|
+
[_: string]: any;
|
532
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
459
533
|
|
460
|
-
export declare
|
461
|
-
|
462
|
-
export declare function dl(...childNodes: any[]): HyperscriptExtensions<HTMLDListElement>;
|
463
|
-
|
464
|
-
export declare function dt(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
465
|
-
|
466
|
-
export declare function dt(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
467
|
-
|
468
|
-
export declare function em(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
469
|
-
|
470
|
-
export declare function em(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
534
|
+
export declare const entryComparer: Comparer<[(string | number)[], any]>;
|
471
535
|
|
472
536
|
/**
|
473
|
-
*
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
* 从扁平化的数据集构建嵌套的 JavaScript 对象或数组。
|
479
|
-
*
|
480
|
-
* @param entries - 扁平化的键值对数组。每个元素为 [keyPath, value],keyPath 是 (string | number)[]。
|
481
|
-
* @returns 嵌套的对象或数组。
|
537
|
+
* 从扁平化的数据集构建嵌套的 JavaScript 对象。
|
538
|
+
*
|
539
|
+
* @param {[ (string | number)[], any ][]} entries - 扁平化的键值对数组。
|
540
|
+
* 每个键值对的格式为 `[keyPath, value]`,其中 `keyPath` 是一个表示嵌套路径的数组。
|
541
|
+
* @returns {object | any[]} - 返回嵌套的 JavaScript 对象或数组。
|
482
542
|
*/
|
483
|
-
export declare function erectObject(
|
484
|
-
entries: [ (string | number)[], any ][]
|
485
|
-
): object | any[];
|
486
|
-
|
487
|
-
export declare function fieldset(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLFieldSetElement>;
|
488
|
-
|
489
|
-
export declare function fieldset(...childNodes: any[]): HyperscriptExtensions<HTMLFieldSetElement>;
|
543
|
+
export declare function erectObject(entries: [(string | number)[], any][]): object | any[];
|
490
544
|
|
491
|
-
export declare function
|
545
|
+
export declare function fieldset(props?: {
|
546
|
+
[_: string]: any;
|
547
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLFieldSetElement>;
|
492
548
|
|
493
|
-
export declare function figcaption(
|
549
|
+
export declare function figcaption(props?: {
|
550
|
+
[_: string]: any;
|
551
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
494
552
|
|
495
|
-
export declare function figure(props
|
496
|
-
|
497
|
-
|
553
|
+
export declare function figure(props?: {
|
554
|
+
[_: string]: any;
|
555
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
498
556
|
|
499
557
|
/**
|
500
|
-
*
|
501
|
-
*
|
502
|
-
* @
|
503
|
-
* @
|
504
|
-
*
|
505
|
-
* @param
|
506
|
-
* @
|
558
|
+
* 查找数组中最后一个满足条件的元素索引。
|
559
|
+
*
|
560
|
+
* @public
|
561
|
+
* @template T
|
562
|
+
* @param {T[]} array - 要查找的数组
|
563
|
+
* @param {(value: T, index: number) => boolean} callbackFn - 判断函数,返回 true 表示找到
|
564
|
+
* @param {number} [lastIndex=array.length-1] - 可选,查找的起始索引(从后往前)
|
565
|
+
* @returns {number} - 最后一个满足条件的元素索引,未找到返回 -1
|
507
566
|
*/
|
508
|
-
export declare function findLastIndex<T>(
|
509
|
-
array: T[],
|
510
|
-
callbackFn: (value: T, index: number) => boolean,
|
511
|
-
lastIndex?: number
|
512
|
-
): number;
|
567
|
+
export declare function findLastIndex<T>(array: T[], callbackFn: (value: T, index: number) => boolean, lastIndex?: number): number;
|
513
568
|
|
514
|
-
|
515
|
-
* Flattens an object or array into an array of key paths and values.
|
516
|
-
*
|
517
|
-
* @param data - The object or array to flatten.
|
518
|
-
* @param isLeaf - A function that determines whether a property should be treated as a leaf node.
|
519
|
-
* If the function returns true, the property is treated as a leaf node.
|
520
|
-
* The function receives (value, key, keyPath) as arguments.
|
521
|
-
* @returns An array of tuples, where each tuple contains a key path (array of string or number) and the corresponding value.
|
522
|
-
*/
|
523
|
-
export declare function flat(
|
524
|
-
data: Record<string | number, any>,
|
525
|
-
isLeaf: (
|
526
|
-
value: any,
|
527
|
-
key: string | number,
|
528
|
-
keyPath: (string | number)[]) => boolean
|
529
|
-
): [(string | number)[], any][];
|
569
|
+
export declare function flat(data: any, isLeaf?: (value: any, key: string | number, keyPath: (string | number)[]) => boolean): [(string | number)[], any][];
|
530
570
|
|
531
571
|
/**
|
532
572
|
* 动态切换两个元素或元素数组的显示状态。
|
533
|
-
*
|
534
|
-
*
|
535
|
-
*
|
536
|
-
*
|
537
|
-
*
|
573
|
+
*
|
574
|
+
* `flip` 函数根据 `yinHidden$` 的值动态控制 `yinElement` 和 `yangElement` 的显示状态:
|
575
|
+
* - 当 `yinHidden$` 为 `true` 时,隐藏 `yinElement`,显示 `yangElement`。
|
576
|
+
* - 当 `yinHidden$` 为 `false` 时,显示 `yinElement`,隐藏 `yangElement`。
|
577
|
+
*
|
578
|
+
* @param {Observable<boolean>} yinHidden$ - 一个 Observable,表示 `yinElement` 是否隐藏。
|
579
|
+
* @param {HTMLElement|HTMLElement[]} yin - 需要动态控制显示状态的第一个元素或元素数组。
|
580
|
+
* @param {HTMLElement|HTMLElement[]} yang - 需要动态控制显示状态的第二个元素或元素数组。
|
581
|
+
* @returns {HTMLElement[]} - 包含所有元素的数组。
|
582
|
+
*
|
538
583
|
*/
|
539
|
-
export declare function flip(
|
540
|
-
yinHidden$: Observable<boolean>,
|
541
|
-
yin: HTMLElement | HTMLElement[],
|
542
|
-
yang: HTMLElement | HTMLElement[]
|
543
|
-
): HTMLElement[];
|
584
|
+
export declare function flip(yinHidden$: Observable<boolean>, yin: HTMLElement | HTMLElement[], yang: HTMLElement | HTMLElement[]): HTMLElement[];
|
544
585
|
|
545
586
|
/**
|
546
|
-
*
|
587
|
+
* 通用折叠(递归归约)函数。
|
588
|
+
*
|
547
589
|
* @public
|
548
|
-
* @param
|
549
|
-
* @param acc -
|
550
|
-
* @param seed -
|
551
|
-
* @returns
|
590
|
+
* @param {(this:any, acc: any, seed: any) => [*, *]|[any]|[]|null|undefined} fn - 处理函数,返回 [新acc, 新seed] 或 [新acc]
|
591
|
+
* @param {*} acc - 初始累加值
|
592
|
+
* @param {*} seed - 初始种子
|
593
|
+
* @returns {*} 折叠后的结果
|
594
|
+
* @this *
|
552
595
|
*/
|
553
|
-
export declare function fold
|
554
|
-
fn: (acc: A, seed: S) => [A, S] | [A] | [] | null | undefined,
|
555
|
-
acc: A,
|
556
|
-
seed: S
|
557
|
-
): A;
|
596
|
+
export declare function fold(this: any, fn: (this: any, acc: any, seed: any) => [any, any] | [any] | [] | null | undefined, acc: any, seed: any): any;
|
558
597
|
|
559
|
-
export declare function footer(props
|
598
|
+
export declare function footer(props?: {
|
599
|
+
[_: string]: any;
|
600
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
560
601
|
|
561
|
-
export declare function
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
export declare function form(...childNodes: any[]): HyperscriptExtensions<HTMLFormElement>;
|
602
|
+
export declare function form(props?: {
|
603
|
+
[_: string]: any;
|
604
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLFormElement>;
|
566
605
|
|
567
606
|
/**
|
568
|
-
*
|
569
|
-
*
|
570
|
-
* @param childNodes - 要插入的子节点,可以是单个节点、多个节点或节点数组。
|
571
|
-
* @returns
|
572
|
-
* @throws 如果传入的子节点不是有效的 DOM
|
607
|
+
* 用途:插入一组元素,不必使用循环语句,fragment 用后即弃。
|
608
|
+
*
|
609
|
+
* @param {...Node|Node[]} childNodes - 要插入的子节点,可以是单个节点、多个节点或节点数组。
|
610
|
+
* @returns {DocumentFragment} - 返回包含所有子节点的 DocumentFragment。
|
611
|
+
* @throws {Error} 如果传入的子节点不是有效的 DOM 节点。
|
573
612
|
*/
|
574
|
-
export declare function fragment(
|
575
|
-
...childNodes: (Node | Node[])[]
|
576
|
-
): DocumentFragment;
|
613
|
+
export declare function fragment(...childNodes: (Node | Node[])[]): DocumentFragment;
|
577
614
|
|
578
615
|
/**
|
579
616
|
* 获取 HTML 元素的默认 CSS `display` 值。
|
580
|
-
*
|
581
|
-
*
|
582
|
-
*
|
617
|
+
*
|
618
|
+
* 根据元素的标签名称 (`tagName`),返回其对应的默认 `display` 属性值。
|
619
|
+
* 支持表格相关标签、块级元素、内联元素等常见 HTML 标签。
|
620
|
+
*
|
621
|
+
* @param {HTMLElement} elem - 要获取 `display` 值的 HTML 元素。
|
622
|
+
* @returns {string} - 元素的默认 `display` 值:
|
623
|
+
* - 表格相关标签:
|
624
|
+
* - `TBODY` -> `'table-row-group'`
|
625
|
+
* - `THEAD` -> `'table-header-group'`
|
626
|
+
* - `TFOOT` -> `'table-footer-group'`
|
627
|
+
* - `TR` -> `'table-row'`
|
628
|
+
* - `TD`、`TH` -> `'table-cell'`
|
629
|
+
* - `COLGROUP` -> `'table-column-group'`
|
630
|
+
* - `COL` -> `'table-column'`
|
631
|
+
* - `CAPTION` -> `'table-caption'`
|
632
|
+
* - 块级元素 -> `'block'`
|
633
|
+
* - 内联元素 -> `'inline'`
|
634
|
+
* - 未知标签 -> `'unset'`
|
635
|
+
*
|
583
636
|
*/
|
584
637
|
export declare function getDisplay(elem: HTMLElement): string;
|
585
638
|
|
586
639
|
/**
|
587
640
|
* 根据属性路径数组读取对象的嵌套属性值。
|
588
|
-
*
|
589
|
-
* @param
|
590
|
-
* @
|
591
|
-
* @
|
592
|
-
* @throws 如果路径中的某一级属性不存在或输入无效会抛出错误。
|
641
|
+
* @param {Record<string | number, any>} obj - 要读取属性的对象。
|
642
|
+
* @param {(string | number)[]} keyPath - 属性路径数组,例如 ['a', 'b'] 表示 obj.a.b。
|
643
|
+
* @returns {any} - 返回目标属性的值,如果路径为空数组,则返回对象本身。
|
644
|
+
* @throws {Error} 如果路径中的某一级属性不存在或输入无效。
|
593
645
|
*/
|
594
|
-
export declare function getNestedProperty(
|
595
|
-
obj: Record<string | number, any>,
|
596
|
-
keyPath: (string | number)[]
|
597
|
-
): any;
|
646
|
+
export declare function getNestedProperty(obj: Record<string | number, any>, keyPath: (string | number)[]): any;
|
598
647
|
|
599
648
|
/**
|
600
|
-
*
|
601
|
-
*
|
602
|
-
*
|
603
|
-
* @
|
649
|
+
* Groups an array of flattened entries by their first level key.
|
650
|
+
* This function is memory-optimized and adapted from `groupArrayBy`.
|
651
|
+
*
|
652
|
+
* @param {[ (string | number)[], any ][]} flatEntries - Array of flattened entries to be grouped.
|
653
|
+
* Each entry is of the form [[key, ...keyPath], value] where:
|
654
|
+
* - The first element is an array representing the key path (first element is primary key)
|
655
|
+
* - The second element is the associated value
|
656
|
+
* @returns {[ string | number, [ (string | number)[], any ][] ][]} An array of grouped entries where:
|
657
|
+
* - Each entry is a tuple [key, group]
|
658
|
+
* - key is the first-level grouping key (string|number)
|
659
|
+
* - group is an array of entries sharing that key, each of form [keyPath, value]
|
660
|
+
*
|
604
661
|
*/
|
605
|
-
export declare function groupByFirstLevelKey(
|
606
|
-
flatEntries: [ (string | number)[], any ][]
|
607
|
-
): [ string | number, [ (string | number)[], any ][] ][];
|
608
|
-
|
609
|
-
export declare function h1(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
610
|
-
|
611
|
-
export declare function h1(...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
612
|
-
|
613
|
-
export declare function h2(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
662
|
+
export declare function groupByFirstLevelKey(flatEntries: [(string | number)[], any][]): [string | number, [(string | number)[], any][]][];
|
614
663
|
|
615
|
-
export declare function
|
664
|
+
export declare function h1(props?: {
|
665
|
+
[_: string]: any;
|
666
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
616
667
|
|
617
|
-
export declare function
|
668
|
+
export declare function h2(props?: {
|
669
|
+
[_: string]: any;
|
670
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
618
671
|
|
619
|
-
export declare function h3(
|
672
|
+
export declare function h3(props?: {
|
673
|
+
[_: string]: any;
|
674
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
620
675
|
|
621
|
-
export declare function h4(props
|
676
|
+
export declare function h4(props?: {
|
677
|
+
[_: string]: any;
|
678
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
622
679
|
|
623
|
-
export declare function
|
680
|
+
export declare function h5(props?: {
|
681
|
+
[_: string]: any;
|
682
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
624
683
|
|
625
|
-
export declare function
|
684
|
+
export declare function h6(props?: {
|
685
|
+
[_: string]: any;
|
686
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHeadingElement>;
|
626
687
|
|
627
|
-
export declare function
|
688
|
+
export declare function header(props?: {
|
689
|
+
[_: string]: any;
|
690
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
628
691
|
|
629
|
-
export declare function
|
692
|
+
export declare function hgroup(props?: {
|
693
|
+
[_: string]: any;
|
694
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
630
695
|
|
631
|
-
export declare function
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
export declare function header(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
636
|
-
|
637
|
-
export declare function hgroup(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
638
|
-
|
639
|
-
export declare function hgroup(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
640
|
-
|
641
|
-
export declare function hr(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLHRElement>;
|
642
|
-
|
643
|
-
export declare function hr(...childNodes: any[]): HyperscriptExtensions<HTMLHRElement>;
|
696
|
+
export declare function hr(props?: {
|
697
|
+
[_: string]: any;
|
698
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLHRElement>;
|
644
699
|
|
700
|
+
/**
|
701
|
+
* @typedef {import("./HyperscriptExtensions.d.ts").HyperscriptExtensions<HTMLElement>} HyperscriptElement
|
702
|
+
*/
|
645
703
|
/**
|
646
704
|
* Creates an HTML element with extended event handling capabilities
|
647
705
|
* @public
|
648
|
-
* @param elemName The HTML element tag name
|
649
|
-
* @param args Optional properties and child nodes
|
650
|
-
* @returns The created element with extended methods
|
651
|
-
* @throws If elemName is not a valid HTML element tag name
|
706
|
+
* @param {string} elemName - The HTML element tag name
|
707
|
+
* @param {...any} args - Optional properties and child nodes
|
708
|
+
* @returns {HyperscriptElement} The created element with extended methods
|
709
|
+
* @throws {Error} If elemName is not a valid HTML element tag name
|
652
710
|
*/
|
653
|
-
export declare function hyperscript(
|
654
|
-
|
655
|
-
|
656
|
-
): HyperscriptExtensions<HTMLElement>;
|
711
|
+
export declare function hyperscript(elemName: string, ...args: any[]): HyperscriptElement;
|
712
|
+
|
713
|
+
export declare type HyperscriptElement = HyperscriptExtensions_2<HTMLElement>;
|
657
714
|
|
658
|
-
declare type HyperscriptExtensions<T extends HTMLElement> =
|
715
|
+
export declare type HyperscriptExtensions<T extends HTMLElement> = HyperscriptExtensions_2<T>;
|
716
|
+
|
717
|
+
declare type HyperscriptExtensions_3<T extends HTMLElement> =
|
659
718
|
T & {
|
660
719
|
|
661
720
|
pipeEvent(
|
662
721
|
event: string,
|
663
722
|
subscriber: (input$: Observable<Event>) => Subscription
|
664
|
-
):
|
723
|
+
): HyperscriptExtensions_3<T>;
|
665
724
|
|
666
725
|
subscribeEvent(
|
667
726
|
event: string,
|
668
|
-
observer: ((value: Event) => void) | Partial<
|
669
|
-
):
|
727
|
+
observer: ((value: Event) => void) | Partial<Observer_2<Event>>
|
728
|
+
): HyperscriptExtensions_3<T>;
|
670
729
|
|
671
730
|
unsubscribe(): void;
|
672
731
|
|
@@ -674,66 +733,72 @@ T & {
|
|
674
733
|
|
675
734
|
};
|
676
735
|
|
677
|
-
export declare
|
736
|
+
export declare type HyperscriptInputElement = HyperscriptExtensions_2<HTMLInputElement>;
|
737
|
+
|
738
|
+
declare type HyperscriptInputElement_2 = HyperscriptExtensions_3<HTMLInputElement>;
|
678
739
|
|
679
|
-
export declare
|
740
|
+
export declare type HyperscriptSelectElement = HyperscriptExtensions_2<HTMLSelectElement>;
|
680
741
|
|
681
|
-
|
742
|
+
declare type HyperscriptSelectElement_2 = HyperscriptExtensions_3<HTMLSelectElement>;
|
682
743
|
|
683
|
-
|
744
|
+
declare type HyperscriptTextAreaElement = HyperscriptExtensions_3<HTMLTextAreaElement>;
|
745
|
+
|
746
|
+
export declare function i(props?: {
|
747
|
+
[_: string]: any;
|
748
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
749
|
+
|
750
|
+
export declare function img(props?: {
|
751
|
+
[_: string]: any;
|
752
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLImageElement>;
|
684
753
|
|
685
754
|
/**
|
686
|
-
* 一个包含所有 HTML
|
687
|
-
*
|
755
|
+
* 一个包含所有 HTML 内联元素标签名称的集合。
|
756
|
+
*
|
757
|
+
* 内联元素是 HTML 中的一类元素,它们不会独占一行,通常用于包裹文本或其他内联元素。
|
758
|
+
* 该集合中的标签名称均为大写,便于快速判断某个元素是否为内联元素。
|
759
|
+
*
|
760
|
+
* 常见的内联元素包括:
|
761
|
+
* - 文本样式:`B`、`I`、`U`、`STRONG`、`EM`、`MARK` 等。
|
762
|
+
* - 链接和交互:`A`、`BUTTON`、`LABEL`、`INPUT`、`SELECT`、`TEXTAREA` 等。
|
763
|
+
* - 媒体和嵌入:`IMG`、`SVG`、`VIDEO`、`AUDIO`、`CANVAS` 等。
|
764
|
+
* - 其他:`SPAN`、`BR`、`WBR`、`CODE`、`Q` 等。
|
765
|
+
*
|
766
|
+
* @constant {Set<string>} inlineFamily
|
688
767
|
*/
|
689
768
|
export declare const inlineFamily: Set<string>;
|
690
769
|
|
691
|
-
export declare function input(props
|
692
|
-
|
693
|
-
|
770
|
+
export declare function input(props?: {
|
771
|
+
[_: string]: any;
|
772
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLInputElement>;
|
694
773
|
|
695
|
-
export declare function ins(props
|
696
|
-
|
697
|
-
|
774
|
+
export declare function ins(props?: {
|
775
|
+
[_: string]: any;
|
776
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLModElement>;
|
698
777
|
|
699
778
|
/**
|
700
|
-
*
|
701
|
-
*
|
702
|
-
* @param
|
703
|
-
* @
|
704
|
-
* @
|
705
|
-
* @throws 如果 obj 不是对象或 keys 不是数组会抛出 TypeError。
|
779
|
+
* Creates an object composed of the picked object properties.
|
780
|
+
* @param {Record<string,any>} obj - Source object
|
781
|
+
* @param {string[]} keys - Array of property keys to pick
|
782
|
+
* @returns {Record<string,any>} New object with picked properties
|
783
|
+
* @throws {TypeError} If obj is not an object or keys is not an array
|
706
784
|
*/
|
707
|
-
export declare function intersectObject(
|
708
|
-
obj: Record<string,any>,
|
709
|
-
keys: string[]
|
710
|
-
): Record<string,any>;
|
785
|
+
export declare function intersectObject(obj: Record<string, any>, keys: string[]): Record<string, any>;
|
711
786
|
|
712
|
-
|
713
|
-
* 判断对象是否为空对象(非数组、非 null,且无自有属性)。
|
714
|
-
*
|
715
|
-
* @param obj - 要判断的对象。
|
716
|
-
* @returns 如果是空对象返回 true,否则返回 false。
|
717
|
-
*/
|
718
|
-
export declare function isEmptyObject(obj: unknown): boolean;
|
787
|
+
export declare function isEmptyObject(obj: unknown): obj is Record<never, never>;
|
719
788
|
|
720
789
|
/**
|
721
|
-
*
|
722
|
-
*
|
723
|
-
*
|
724
|
-
* @param value - The value to check
|
725
|
-
* @returns True if the value is a plain object, false otherwise
|
726
|
-
*
|
790
|
+
* 检查一个值是否是普通对象(Plain Object)
|
791
|
+
* @param {unknown} value - 要检查的值
|
792
|
+
* @returns {value is object} - 返回是否是普通对象的类型谓词
|
727
793
|
*/
|
728
|
-
export declare function isPlainObject(
|
729
|
-
value: unknown
|
730
|
-
): value is Record<string, any>;
|
794
|
+
export declare function isPlainObject(value: unknown): value is object;
|
731
795
|
|
732
796
|
/**
|
733
|
-
*
|
734
|
-
*
|
735
|
-
* @
|
736
|
-
* @
|
797
|
+
* 判断输入的字符串数组是否为从0开始的连续数字区间(如 ['0','1','2',...])。
|
798
|
+
*
|
799
|
+
* @public
|
800
|
+
* @param {string[]} keys - 要检查的字符串数组
|
801
|
+
* @returns {boolean} - 如果是从0开始的连续数字区间返回 true,否则返回 false
|
737
802
|
*/
|
738
803
|
export declare function isRange(keys: string[]): boolean;
|
739
804
|
|
@@ -742,671 +807,632 @@ export declare function isRange(keys: string[]): boolean;
|
|
742
807
|
*
|
743
808
|
* `isRxType` 函数用于判断给定的对象是否为 RxJS 的 `Observable` 或 `Subscription` 类型。
|
744
809
|
*
|
745
|
-
* @param obj - 要检查的对象。
|
746
|
-
* @returns 如果对象是 `Observable` 或 `Subscription`,返回 `true`;否则返回 `false`。
|
810
|
+
* @param {any} obj - 要检查的对象。
|
811
|
+
* @returns {boolean} - 如果对象是 `Observable` 或 `Subscription`,返回 `true`;否则返回 `false`。
|
812
|
+
*
|
747
813
|
*/
|
748
814
|
export declare function isRxType(obj: any): boolean;
|
749
815
|
|
750
|
-
export declare function kbd(props
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
/**
|
755
|
-
* A comparer instance for comparing keys.
|
756
|
-
*/
|
757
|
-
export declare const keyComparer: Comparer<number | string>;
|
758
|
-
|
759
|
-
/**
|
760
|
-
* A comparer instance for comparing key paths.
|
761
|
-
*/
|
762
|
-
export declare const keyPathComparer: Comparer<(number | string)[]>;
|
763
|
-
|
764
|
-
export declare function label(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLLabelElement>;
|
765
|
-
|
766
|
-
export declare function label(...childNodes: any[]): HyperscriptExtensions<HTMLLabelElement>;
|
767
|
-
|
768
|
-
export declare function legend(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLLegendElement>;
|
816
|
+
export declare function kbd(props?: {
|
817
|
+
[_: string]: any;
|
818
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
769
819
|
|
770
|
-
export declare
|
820
|
+
export declare const keyComparer: Comparer<string | number>;
|
771
821
|
|
772
|
-
export declare
|
822
|
+
export declare const keyPathComparer: Comparer<(string | number)[]>;
|
773
823
|
|
774
|
-
export declare function
|
824
|
+
export declare function label(props?: {
|
825
|
+
[_: string]: any;
|
826
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLLabelElement>;
|
775
827
|
|
776
|
-
export declare function
|
828
|
+
export declare function legend(props?: {
|
829
|
+
[_: string]: any;
|
830
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLLegendElement>;
|
777
831
|
|
778
|
-
export declare function
|
832
|
+
export declare function li(props?: {
|
833
|
+
[_: string]: any;
|
834
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLLIElement>;
|
779
835
|
|
780
|
-
export declare function
|
836
|
+
export declare function main(props?: {
|
837
|
+
[_: string]: any;
|
838
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
781
839
|
|
782
|
-
export declare function mark(
|
840
|
+
export declare function mark(props?: {
|
841
|
+
[_: string]: any;
|
842
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
783
843
|
|
784
|
-
export declare function menu(props
|
844
|
+
export declare function menu(props?: {
|
845
|
+
[_: string]: any;
|
846
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLMenuElement>;
|
785
847
|
|
786
|
-
export declare function
|
848
|
+
export declare function menuitem(props?: {
|
849
|
+
[_: string]: any;
|
850
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
787
851
|
|
788
|
-
export declare function
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
export declare function meter(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLMeterElement>;
|
793
|
-
|
794
|
-
export declare function meter(...childNodes: any[]): HyperscriptExtensions<HTMLMeterElement>;
|
852
|
+
export declare function meter(props?: {
|
853
|
+
[_: string]: any;
|
854
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLMeterElement>;
|
795
855
|
|
796
856
|
/**
|
797
|
-
*
|
798
|
-
* 必须手动添加控件更新 BehaviorSubject 的事件。
|
799
|
-
*
|
800
|
-
* @param props - 配置对象,包含 <select> 元素的属性。
|
801
|
-
* @param options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
|
802
|
-
* @returns 创建的 <select> 元素。
|
803
|
-
* @throws 如果 props 不是对象,或者 options 中的选项未正确定义 selected 属性会抛出错误。
|
857
|
+
* @typedef {import("./HyperscriptExtensions.d.ts").HyperscriptExtensions<HTMLSelectElement>} HyperscriptSelectElement
|
804
858
|
*/
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
859
|
+
/**
|
860
|
+
* 创建一个支持多选功能的 <select> 元素,并绑定选项的选中状态。必须手动添加控件更新BehaviorSubject的事件。
|
861
|
+
*
|
862
|
+
* @param {{oninput?: (e:Event)=>void, onchange?: (e:Event)=>void, [key: string]: any}} props - 配置对象,包含 <select> 元素的属性。
|
863
|
+
* @param {...HTMLOptionElement} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
|
864
|
+
* 每个选项需要包含一个 `selected` 属性,该属性是一个 BehaviorSubject ,用于绑定选中状态。
|
865
|
+
* @returns {HyperscriptSelectElement} - 创建的 <select> 元素。
|
866
|
+
* @throws {Error} 如果 `props` 不是对象,或者 `options` 中的选项未正确定义 `selected` 属性。
|
867
|
+
*
|
868
|
+
*/
|
869
|
+
export declare function multiselect(props: {
|
870
|
+
oninput?: (e: Event) => void;
|
871
|
+
onchange?: (e: Event) => void;
|
872
|
+
[key: string]: any;
|
873
|
+
}, ...options: HTMLOptionElement[]): HyperscriptSelectElement;
|
814
874
|
|
815
|
-
export declare function nav(
|
875
|
+
export declare function nav(props?: {
|
876
|
+
[_: string]: any;
|
877
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
816
878
|
|
817
879
|
/**
|
818
|
-
*
|
819
|
-
*
|
820
|
-
* @
|
821
|
-
* @returns 一个 Observable,发出扁平化后的对象。
|
880
|
+
*
|
881
|
+
* @param {Record<string|number, any>} model
|
882
|
+
* @returns {Observable<Record<string|number, any>>}
|
822
883
|
*/
|
823
|
-
export declare function nestedCombineLatest(
|
824
|
-
model: Record<string|number, any>,
|
825
|
-
): Observable<Record<string|number, any>>;
|
884
|
+
export declare function nestedCombineLatest(model: Record<string | number, any>): Observable<Record<string | number, any>>;
|
826
885
|
|
827
886
|
/**
|
828
|
-
*
|
829
|
-
*
|
830
|
-
* @
|
831
|
-
* @returns 合并后的 Observable。
|
887
|
+
*
|
888
|
+
* @param {Record<string|number, any>} model
|
889
|
+
* @returns {Observable<[(string | number)[], any]>}
|
832
890
|
*/
|
833
|
-
export declare function nestedMerge(
|
834
|
-
model: Record<string|number, any>
|
835
|
-
): Observable<[ (string | number)[], any ]>;
|
891
|
+
export declare function nestedMerge(model: Record<string | number, any>): Observable<[(string | number)[], any]>;
|
836
892
|
|
837
893
|
/**
|
838
894
|
* 规范化子节点,将非节点转换为文本节点。
|
839
|
-
*
|
840
|
-
* @param childNodes - 子节点数组。
|
841
|
-
* @returns 返回规范化后的节点数组。
|
895
|
+
*
|
896
|
+
* @param {any[]} childNodes - 子节点数组。
|
897
|
+
* @returns {Node[]} - 返回规范化后的节点数组。
|
842
898
|
*/
|
843
|
-
export declare function normalizeChildNodes(
|
844
|
-
childNodes: any[]
|
845
|
-
): Node[];
|
899
|
+
export declare function normalizeChildNodes(childNodes: any[]): Node[];
|
846
900
|
|
847
901
|
/**
|
848
902
|
* 创建一个支持双向绑定的数字输入框。
|
849
|
-
*
|
850
|
-
*
|
851
|
-
* @
|
852
|
-
* @
|
903
|
+
*
|
904
|
+
* `numberbox` 是一个自定义的输入框组件,支持通过 RxJS 的 `BehaviorSubject` 实现数字值的双向绑定。
|
905
|
+
* @public
|
906
|
+
* @param {{ number: BehaviorSubject<number>; [key: string]: any;}} props - 配置对象,包含输入框的属性。
|
907
|
+
* @returns {HyperscriptInputElement} - 创建的数字输入框元素。
|
908
|
+
* @throws {Error} 如果 `props` 不是对象,或者 `number` 不是 `BehaviorSubject` 实例。
|
909
|
+
*
|
853
910
|
*/
|
854
911
|
export declare function numberbox(props: {
|
855
912
|
number: BehaviorSubject<number>;
|
856
913
|
[key: string]: any;
|
857
|
-
}):
|
914
|
+
}): HyperscriptInputElement_2;
|
858
915
|
|
859
916
|
/**
|
860
917
|
* ObservableArray 是一个可观察的数组,支持 insertBefore、removeChild、replaceChild 操作,
|
861
918
|
* 并通过 RxJS Subject 通知变化,适用于响应式 DOM 操作场景。
|
919
|
+
*
|
920
|
+
* @template T
|
921
|
+
* @extends Array<T>
|
862
922
|
*/
|
863
|
-
export declare class ObservableArray<T
|
923
|
+
export declare class ObservableArray<T> extends Array<T> {
|
924
|
+
/**
|
925
|
+
* @constructor 创建一个 ObservableArray 实例。禁止传参。
|
926
|
+
* @param {()=>T} newItem
|
927
|
+
* @throws {Error} 如果传入参数则抛出异常。
|
928
|
+
*/
|
864
929
|
constructor(newItem: () => T);
|
865
|
-
|
930
|
+
newitem: () => T;
|
866
931
|
/**
|
867
932
|
* 变化通知的 Subject。
|
868
|
-
*
|
933
|
+
* @type {Subject<any[]>}
|
869
934
|
*/
|
870
|
-
action$: Subject<[
|
871
|
-
|
935
|
+
action$: Subject<any[]>;
|
872
936
|
/**
|
873
937
|
* 插入元素事件流,发出 [item, index]。
|
938
|
+
* @type {import('rxjs').Observable<[T, number]>}
|
874
939
|
*/
|
875
940
|
insertBefore$: Observable<[T, number]>;
|
876
|
-
|
877
941
|
/**
|
878
942
|
* 删除元素事件流,发出 index。
|
943
|
+
* @type {import('rxjs').Observable<number>}
|
879
944
|
*/
|
880
945
|
removeChild$: Observable<number>;
|
881
|
-
|
882
946
|
/**
|
883
947
|
* 替换元素事件流,发出 [item, index]。
|
948
|
+
* @type {import('rxjs').Observable<[T, number]>}
|
884
949
|
*/
|
885
950
|
replaceChild$: Observable<[T, number]>;
|
886
|
-
|
887
951
|
/**
|
888
952
|
* 在指定位置插入元素,并通知变化。
|
889
|
-
* @param item 要插入的元素
|
890
|
-
* @param index 插入位置,默认为数组末尾
|
953
|
+
* @param {T} item 要插入的元素
|
954
|
+
* @param {number} [index=this.length] 插入位置,默认为数组末尾
|
891
955
|
*/
|
892
956
|
insertBefore(item: T, index?: number): void;
|
893
|
-
|
894
957
|
/**
|
895
958
|
* 删除指定位置的元素,并通知变化。
|
896
|
-
* @param index 删除位置,默认为数组末尾
|
959
|
+
* @param {number} [index=this.length-1] 删除位置,默认为数组末尾
|
897
960
|
*/
|
898
961
|
removeChild(index?: number): void;
|
899
|
-
|
900
962
|
/**
|
901
963
|
* 替换指定位置的元素,并通知变化。
|
902
|
-
* @param item 新元素
|
903
|
-
* @param index 替换位置
|
964
|
+
* @param {T} item 新元素
|
965
|
+
* @param {number} index 替换位置
|
904
966
|
*/
|
905
967
|
replaceChild(item: T, index: number): void;
|
906
|
-
|
907
968
|
/**
|
908
969
|
* 附加一个默认子元素
|
909
970
|
*/
|
910
971
|
appendChild(): void;
|
911
972
|
}
|
912
973
|
|
913
|
-
export declare
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
export declare function optgroup(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLOptGroupElement>;
|
918
|
-
|
919
|
-
export declare function optgroup(...childNodes: any[]): HyperscriptExtensions<HTMLOptGroupElement>;
|
974
|
+
export declare type ObservableTextNode = Text & {
|
975
|
+
subscription?: Subscription;
|
976
|
+
unsubscribe?: () => void;
|
977
|
+
};
|
920
978
|
|
921
|
-
export declare
|
979
|
+
export declare type Observer<T> = Observer_2<T>;
|
922
980
|
|
923
|
-
export declare function
|
981
|
+
export declare function ol(props?: {
|
982
|
+
[_: string]: any;
|
983
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLOListElement>;
|
924
984
|
|
925
|
-
export declare function
|
985
|
+
export declare function optgroup(props?: {
|
986
|
+
[_: string]: any;
|
987
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLOptGroupElement>;
|
926
988
|
|
927
|
-
export declare function
|
989
|
+
export declare function option(props?: {
|
990
|
+
[_: string]: any;
|
991
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLOptionElement>;
|
928
992
|
|
929
|
-
export declare function
|
993
|
+
export declare function output(props?: {
|
994
|
+
[_: string]: any;
|
995
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLOutputElement>;
|
930
996
|
|
931
|
-
export declare function p(
|
997
|
+
export declare function p(props?: {
|
998
|
+
[_: string]: any;
|
999
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLParagraphElement>;
|
932
1000
|
|
933
1001
|
/**
|
934
1002
|
* 解析 hyperscript 风格的参数,返回 props 和 childNodes。
|
935
|
-
*
|
936
|
-
* @param args - hyperscript 风格的参数数组。
|
937
|
-
* @returns 包含 props(对象)和 childNodes(数组)的对象。
|
1003
|
+
*
|
1004
|
+
* @param {any[]} args - hyperscript 风格的参数数组。
|
1005
|
+
* @returns {{ props: Record<string, any>, childNodes: any[] }} 包含 props(对象)和 childNodes(数组)的对象。
|
938
1006
|
* @throws 如果参数不是数组会抛出错误。
|
939
1007
|
*/
|
940
|
-
export declare function parseHyperscriptArgs(
|
941
|
-
|
942
|
-
|
1008
|
+
export declare function parseHyperscriptArgs(args: any[]): {
|
1009
|
+
props: Record<string, any>;
|
1010
|
+
childNodes: any[];
|
1011
|
+
};
|
943
1012
|
|
944
1013
|
/**
|
945
1014
|
* 解析嵌套的 DOM 属性路径,并返回目标对象和属性名。
|
946
|
-
*
|
947
|
-
* @param props -
|
948
|
-
* @param obj - 起始对象,通常是一个 DOM 元素。
|
949
|
-
* @returns [
|
950
|
-
* @throws
|
1015
|
+
*
|
1016
|
+
* @param {string} props - 属性路径,是 DOM API 的属性,不需要引号包裹,支持嵌套属性(如 "style.color")。
|
1017
|
+
* @param {Record<string, any>} obj - 起始对象,通常是一个 DOM 元素。
|
1018
|
+
* @returns {[Record<string, any>, string]} - 返回一个数组,表示叶节点,其中第一个元素是目标对象,第二个元素是属性名。(如 [obj.style, "color"])。
|
1019
|
+
* @throws {Error} 如果路径中的某一级属性不存在或输入无效。
|
951
1020
|
*/
|
952
|
-
export declare function parsePropName(
|
953
|
-
props: string,
|
954
|
-
obj: Record<string, any>
|
955
|
-
): [Record<string, any>, string];
|
1021
|
+
export declare function parsePropName(props: string, obj: Record<string, any>): [Record<string, any>, string];
|
956
1022
|
|
957
1023
|
/**
|
958
|
-
*
|
959
|
-
* 拾取对象中的
|
960
|
-
*
|
961
|
-
* @param model -
|
962
|
-
* @returns
|
963
|
-
* @throws
|
964
|
-
*
|
1024
|
+
*
|
1025
|
+
* 拾取对象中的BehaviorSubject值,作爲葉子節點,忽略其他值。
|
1026
|
+
*
|
1027
|
+
* @param {Record<string|number,any> & { pickeys?: string [] }} model - 输入的数据结构,可以是对象、数组或BehaviorSubject
|
1028
|
+
* @returns {Record<string|number,any>} - 返回只包含BehaviorSubject当前值的结构
|
1029
|
+
* @throws {Error} 当输入不包含任何BehaviorSubject或结构不符合预期时抛出错误
|
965
1030
|
*/
|
966
|
-
export declare function pickBehaviorSubject(
|
967
|
-
|
968
|
-
): Record<string | number, any>;
|
1031
|
+
export declare function pickBehaviorSubject(model: Record<string | number, any> & {
|
1032
|
+
pickeys?: string[];
|
1033
|
+
}): Record<string | number, any>;
|
969
1034
|
|
970
|
-
|
971
|
-
* 数据优先的管道处理工具(从左向右执行)。
|
972
|
-
* 适合一次性数据处理流程。
|
973
|
-
* @public
|
974
|
-
* @param initialValue - 初始值。
|
975
|
-
* @param fns - 要应用的函数管道(从左向右执行)。
|
976
|
-
* @returns 经过管道处理后的结果。
|
977
|
-
* @throws {TypeError} 当参数包含非函数时抛出错误。
|
978
|
-
*/
|
979
|
-
export declare function pipe(
|
980
|
-
initialValue: any,
|
981
|
-
...fns: Array<(arg: any) => any>
|
982
|
-
): any;
|
1035
|
+
export declare function pipe(initialValue: any, ...fns: ((arg: any) => any)[]): any;
|
983
1036
|
|
984
1037
|
/**
|
985
1038
|
* 为指定的 DOM 元素订阅事件流,并通过 pipe 对事件流进行处理。
|
986
|
-
*
|
987
|
-
* @param elem - 要订阅事件的 DOM 元素。
|
988
|
-
* @returns
|
989
|
-
* @throws
|
1039
|
+
*
|
1040
|
+
* @param {HTMLElement} elem - 要订阅事件的 DOM 元素。
|
1041
|
+
* @returns {(e:string,s:(event$: Observable<Event>) => Subscription)=>HTMLElement} - 返回一个函数,该函数接受事件名称和处理函数,用于订阅和处理事件。
|
1042
|
+
* @throws {Error} 如果参数无效。
|
990
1043
|
*/
|
991
|
-
export declare function pipeEvent(
|
992
|
-
elem: HTMLElement
|
993
|
-
): (
|
994
|
-
event: string,
|
995
|
-
subscriber: (event$: Observable<Event>) => Subscription
|
996
|
-
) => HTMLElement;
|
1044
|
+
export declare function pipeEvent(elem: HTMLElement): (e: string, s: (event$: Observable<Event>) => Subscription) => HTMLElement;
|
997
1045
|
|
998
1046
|
/**
|
999
|
-
*
|
1000
|
-
*
|
1001
|
-
* @param
|
1002
|
-
* @
|
1003
|
-
* @
|
1004
|
-
* @throws 当路径不存在时抛出 TypeError。
|
1047
|
+
* 获取对象的嵌套属性
|
1048
|
+
* @param {Record<string | number, any>} obj - 源对象/数组
|
1049
|
+
* @param {(string|number)[]} keyPath - 属性访问路径数组
|
1050
|
+
* @returns {any} 路径对应的属性值
|
1051
|
+
* @throws {TypeError} 当路径不存在时抛出错误
|
1005
1052
|
*/
|
1006
|
-
export declare function pluckProperty(
|
1007
|
-
obj: Record<string | number, any>,
|
1008
|
-
keyPath: (string | number)[]
|
1009
|
-
): any;
|
1010
|
-
|
1011
|
-
export declare function pre(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLPreElement>;
|
1012
|
-
|
1013
|
-
export declare function pre(...childNodes: any[]): HyperscriptExtensions<HTMLPreElement>;
|
1053
|
+
export declare function pluckProperty(obj: Record<string | number, any>, keyPath: (string | number)[]): any;
|
1014
1054
|
|
1015
|
-
export declare function
|
1055
|
+
export declare function pre(props?: {
|
1056
|
+
[_: string]: any;
|
1057
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLPreElement>;
|
1016
1058
|
|
1017
|
-
export declare function progress(
|
1059
|
+
export declare function progress(props?: {
|
1060
|
+
[_: string]: any;
|
1061
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLProgressElement>;
|
1018
1062
|
|
1019
|
-
export declare function q(props
|
1020
|
-
|
1021
|
-
|
1063
|
+
export declare function q(props?: {
|
1064
|
+
[_: string]: any;
|
1065
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLQuoteElement>;
|
1022
1066
|
|
1023
1067
|
/**
|
1024
|
-
*
|
1025
|
-
*
|
1026
|
-
* @
|
1027
|
-
* @
|
1028
|
-
* @
|
1068
|
+
* 将对象序列化为 URL 查询字符串(支持嵌套对象和多类型字段)。
|
1069
|
+
*
|
1070
|
+
* @public
|
1071
|
+
* @param {Object} data - 要序列化的对象
|
1072
|
+
* @returns {string} 查询字符串(如 "?a=1&b=2"),无有效字段时返回空字符串
|
1029
1073
|
*/
|
1030
|
-
export declare function queryStringify(data:
|
1074
|
+
export declare function queryStringify(data: Object): string;
|
1031
1075
|
|
1032
1076
|
/**
|
1033
|
-
*
|
1034
|
-
*
|
1035
|
-
* @param
|
1036
|
-
* @returns
|
1037
|
-
* @throws 如果 props 不是对象,或者 checked 不是 BehaviorSubject 会抛出错误。
|
1077
|
+
* 单选按钮
|
1078
|
+
* @public
|
1079
|
+
* @param {{checked: BehaviorSubject<boolean>; [key: string]: any}} props
|
1080
|
+
* @returns {HyperscriptInputElement}
|
1038
1081
|
*/
|
1039
1082
|
export declare function radio(props: {
|
1040
|
-
checked: BehaviorSubject<boolean
|
1041
|
-
[key: string]: any
|
1042
|
-
}):
|
1083
|
+
checked: BehaviorSubject<boolean>;
|
1084
|
+
[key: string]: any;
|
1085
|
+
}): HyperscriptInputElement_2;
|
1043
1086
|
|
1044
1087
|
/**
|
1045
|
-
*
|
1046
|
-
*
|
1047
|
-
* @
|
1048
|
-
* @
|
1088
|
+
* 创建一个从 0 到 length-1 的数字数组。
|
1089
|
+
*
|
1090
|
+
* @public
|
1091
|
+
* @param {number} length - 要创建的数组长度
|
1092
|
+
* @returns {number[]} - 从 0 到 length-1 的数字数组
|
1049
1093
|
*/
|
1050
1094
|
export declare function rangeArray(length: number): number[];
|
1051
1095
|
|
1052
|
-
export declare function rb(props
|
1053
|
-
|
1054
|
-
|
1096
|
+
export declare function rb(props?: {
|
1097
|
+
[_: string]: any;
|
1098
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1055
1099
|
|
1056
1100
|
/**
|
1057
|
-
*
|
1058
|
-
*
|
1059
|
-
*
|
1060
|
-
* @param
|
1061
|
-
* @
|
1101
|
+
* Updates a reactive model with new values from a source object.
|
1102
|
+
* Recursively synchronizes BehaviorSubject, ObservableArray, array and object contents.
|
1103
|
+
*
|
1104
|
+
* @param {Record<string | number, any>} model - The reactive model to update (can be BehaviorSubject, ObservableArray, array or object)
|
1105
|
+
* @param {Record<string | number, any>} src - The new values to restore, should match the structure of the model
|
1106
|
+
* @returns
|
1062
1107
|
*/
|
1063
|
-
export declare function restore(
|
1064
|
-
model: Record<string | number, any>,
|
1065
|
-
src: Record<string | number, any>
|
1066
|
-
): Record<string | number, any>;
|
1067
|
-
|
1068
|
-
export declare function rp(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1069
|
-
|
1070
|
-
export declare function rp(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1108
|
+
export declare function restore(model: Record<string | number, any>, src: Record<string | number, any>): void;
|
1071
1109
|
|
1072
|
-
export declare function
|
1110
|
+
export declare function rp(props?: {
|
1111
|
+
[_: string]: any;
|
1112
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1073
1113
|
|
1074
|
-
export declare function rt(
|
1114
|
+
export declare function rt(props?: {
|
1115
|
+
[_: string]: any;
|
1116
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1075
1117
|
|
1076
|
-
export declare function rtc(props
|
1118
|
+
export declare function rtc(props?: {
|
1119
|
+
[_: string]: any;
|
1120
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1077
1121
|
|
1078
|
-
export declare function
|
1122
|
+
export declare function ruby(props?: {
|
1123
|
+
[_: string]: any;
|
1124
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1079
1125
|
|
1080
|
-
export declare function
|
1126
|
+
export declare function s(props?: {
|
1127
|
+
[_: string]: any;
|
1128
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1081
1129
|
|
1082
|
-
export declare function
|
1130
|
+
export declare function samp(props?: {
|
1131
|
+
[_: string]: any;
|
1132
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1083
1133
|
|
1084
|
-
export declare function
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
export declare function samp(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1089
|
-
|
1090
|
-
export declare function samp(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1091
|
-
|
1092
|
-
export declare function section(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1093
|
-
|
1094
|
-
export declare function section(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1134
|
+
export declare function section(props?: {
|
1135
|
+
[_: string]: any;
|
1136
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1095
1137
|
|
1096
1138
|
/**
|
1097
|
-
* 创建一个支持 RxJS 数据绑定的 <select>
|
1098
|
-
*
|
1099
|
-
* @param props - 配置对象,包含 <select>
|
1100
|
-
* @param options - 一个或多个 <option>
|
1101
|
-
* @returns 创建的 <select> 元素。
|
1102
|
-
* @throws 如果 props 不是对象,或者 selectedIndex
|
1103
|
-
*/
|
1104
|
-
export declare function select(
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
},
|
1110
|
-
...options: HTMLOptionElement[]
|
1111
|
-
): HyperscriptExtensions<HTMLSelectElement>;
|
1112
|
-
|
1113
|
-
export declare function select(
|
1114
|
-
props: {
|
1115
|
-
selectedIndex?: BehaviorSubject<number>,
|
1116
|
-
value?: BehaviorSubject<string>,
|
1117
|
-
[key: string]: any
|
1118
|
-
},
|
1119
|
-
options: HTMLOptionElement[]
|
1120
|
-
): HyperscriptExtensions<HTMLSelectElement>;
|
1139
|
+
* 创建一个支持 RxJS 数据绑定的 <select> 元素。仅单选选择框。
|
1140
|
+
*
|
1141
|
+
* @param {{ selectedIndex?: BehaviorSubject<number>, value?: BehaviorSubject<string>, [key: string]: any }} props - 配置对象,包含 <select> 元素的属性。
|
1142
|
+
* @param {...HTMLOptionElement} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
|
1143
|
+
* @returns {HyperscriptSelectElement} - 创建的 <select> 元素。
|
1144
|
+
* @throws {Error} 如果 `props` 不是对象,或者 `selectedIndex` 或 `value` 不是 BehaviorSubject。
|
1145
|
+
*/
|
1146
|
+
export declare function select(props: {
|
1147
|
+
selectedIndex?: BehaviorSubject<number>;
|
1148
|
+
value?: BehaviorSubject<string>;
|
1149
|
+
[key: string]: any;
|
1150
|
+
}, ...options: HTMLOptionElement[]): HyperscriptSelectElement_2;
|
1121
1151
|
|
1122
1152
|
/**
|
1123
|
-
*
|
1124
|
-
*
|
1125
|
-
*
|
1126
|
-
*
|
1127
|
-
* @param
|
1128
|
-
* @param
|
1129
|
-
* @
|
1130
|
-
* @
|
1131
|
-
*
|
1153
|
+
*
|
1154
|
+
* 设置一个元素对象的任意嵌套路径属性的值,如果是CSS类名,值为真则添加类名,值为假则移除类名。如果是普通属性或嵌套属性则设置改属性值。
|
1155
|
+
*
|
1156
|
+
* @param {HTMLElement} root - 要设置属性的 DOM 元素。
|
1157
|
+
* @param {string} key - 属性名称,支持普通属性、嵌套属性(如 "style.color")或以 "." 开头的类名(如 ".active")。
|
1158
|
+
* @param {*} value - 要设置的属性值。如果是布尔值,用于控制类名的添加或移除。
|
1159
|
+
* @returns {HTMLElement} - 返回元素本身,支持链式调用。
|
1160
|
+
* @throws {Error} 如果参数无效或设置失败。
|
1161
|
+
*
|
1132
1162
|
*/
|
1133
|
-
export declare function setProp(
|
1134
|
-
root: HTMLElement,
|
1135
|
-
key: string,
|
1136
|
-
value: any
|
1137
|
-
): HTMLElement;
|
1163
|
+
export declare function setProp(root: HTMLElement, key: string, value: any): HTMLElement;
|
1138
1164
|
|
1139
1165
|
/**
|
1140
1166
|
* 为 DOM 元素设置属性,包括静态属性和动态属性(Observable)。
|
1141
|
-
*
|
1142
|
-
* @param element - 要设置属性的 DOM 元素。
|
1143
|
-
* @param props - 包含属性键值对的对象,其中值可以是普通值或 Observable。
|
1144
|
-
* @returns 返回元素本身,支持链式调用。
|
1145
|
-
* @throws
|
1167
|
+
*
|
1168
|
+
* @param {HTMLElement} element - 要设置属性的 DOM 元素。
|
1169
|
+
* @param {Object} props - 包含属性键值对的对象,其中值可以是普通值或 Observable。
|
1170
|
+
* @returns {HTMLElement} - 返回元素本身,支持链式调用。
|
1171
|
+
* @throws {Error} 如果参数无效或设置属性失败。
|
1146
1172
|
*/
|
1147
|
-
export declare function setProps(
|
1148
|
-
element: HTMLElement,
|
1149
|
-
props: Record<string, any | Observable<any>>
|
1150
|
-
): HTMLElement;
|
1151
|
-
|
1152
|
-
export declare function small(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1173
|
+
export declare function setProps(element: HTMLElement, props: Object): HTMLElement;
|
1153
1174
|
|
1154
|
-
export declare function small(
|
1175
|
+
export declare function small(props?: {
|
1176
|
+
[_: string]: any;
|
1177
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1155
1178
|
|
1156
|
-
export declare function span(props
|
1157
|
-
|
1158
|
-
|
1179
|
+
export declare function span(props?: {
|
1180
|
+
[_: string]: any;
|
1181
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLSpanElement>;
|
1159
1182
|
|
1160
1183
|
/**
|
1161
1184
|
* 将对象属性按类型分为两部分:可观察对象(Observable)与普通值(非 Observable)。
|
1162
|
-
*
|
1163
|
-
* @param obj - 要分割的对象,其属性值可能是 Observable 或普通值。
|
1164
|
-
* @returns
|
1165
|
-
* @throws
|
1185
|
+
*
|
1186
|
+
* @param {Record<string,any>} obj - 要分割的对象,其属性值可能是 Observable 或普通值。
|
1187
|
+
* @returns {[Record<string, Observable<any>>, Record<string, any>]} - 返回一个数组,第一个对象包含所有 Observable 属性,第二个对象包含所有非 Observable 属性。
|
1188
|
+
* @throws {Error} 如果参数不是一个非空对象。
|
1166
1189
|
*/
|
1167
|
-
export declare function splitObjectByObservable(
|
1168
|
-
obj: Record<string, any>
|
1169
|
-
): [Record<string, Observable<any>>, Record<string, any>];
|
1170
|
-
|
1171
|
-
export declare function strong(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1190
|
+
export declare function splitObjectByObservable(obj: Record<string, any>): [Record<string, Observable<any>>, Record<string, any>];
|
1172
1191
|
|
1173
|
-
export declare function strong(
|
1192
|
+
export declare function strong(props?: {
|
1193
|
+
[_: string]: any;
|
1194
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1174
1195
|
|
1175
|
-
export declare function sub(props
|
1176
|
-
|
1177
|
-
|
1196
|
+
export declare function sub(props?: {
|
1197
|
+
[_: string]: any;
|
1198
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1178
1199
|
|
1200
|
+
/**
|
1201
|
+
* @template T
|
1202
|
+
* @typedef { import('rxjs').Observer<T> } Observer
|
1203
|
+
*/
|
1179
1204
|
/**
|
1180
1205
|
* 为指定的 DOM 元素订阅事件流,并将订阅与元素绑定,便于管理。
|
1181
|
-
*
|
1182
|
-
* @param elem - 要订阅事件的 DOM 元素。
|
1183
|
-
* @returns
|
1184
|
-
* @throws
|
1206
|
+
*
|
1207
|
+
* @param {HTMLElement} elem - 要订阅事件的 DOM 元素。
|
1208
|
+
* @returns {(e:string, o:((value: Event) => void) | Partial<Observer<Event>>) => HTMLElement} - 返回一个函数,该函数接受事件名称和观察者,用于订阅事件。
|
1209
|
+
* @throws {Error} 如果参数无效。
|
1210
|
+
*
|
1185
1211
|
*/
|
1186
|
-
export declare function subscribeEvent(
|
1187
|
-
elem: HTMLElement
|
1188
|
-
): (
|
1189
|
-
event: string,
|
1190
|
-
observer: ((value: Event) => void) | Partial<Observer<Event>>
|
1191
|
-
) => HTMLElement;
|
1212
|
+
export declare function subscribeEvent(elem: HTMLElement): (e: string, o: ((value: Event) => void) | Partial<Observer<Event>>) => HTMLElement;
|
1192
1213
|
|
1193
1214
|
/**
|
1194
|
-
*
|
1195
|
-
*
|
1196
|
-
*
|
1197
|
-
* @
|
1198
|
-
* @param
|
1199
|
-
* @
|
1200
|
-
* @
|
1215
|
+
*
|
1216
|
+
* 订阅一个 BehaviorSubject,将其发出的值动态设置为指定 DOM 元素的属性值。
|
1217
|
+
*
|
1218
|
+
* @template T
|
1219
|
+
* @param {HTMLElement} element - 要设置属性的 DOM 元素。
|
1220
|
+
* @param {string} key - 属性名称,支持普通属性、嵌套属性(如 "style.color")或以 "." 开头的类名(如 ".active")。
|
1221
|
+
* @param {Observable<T>} value$ - 一个 RxJS Observable ,用于发出属性值。
|
1222
|
+
* @returns {HTMLElement} - 返回元素本身,支持链式调用。
|
1223
|
+
* @throws {Error} 如果参数无效或订阅失败。
|
1201
1224
|
*/
|
1202
|
-
export declare function subscribeProp(
|
1203
|
-
element: HTMLElement,
|
1204
|
-
key: string,
|
1205
|
-
value$: Observable<any>
|
1206
|
-
): HTMLElement;
|
1207
|
-
|
1208
|
-
export declare function summary(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1209
|
-
|
1210
|
-
export declare function summary(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1225
|
+
export declare function subscribeProp<T>(element: HTMLElement, key: string, value$: Observable<T>): HTMLElement;
|
1211
1226
|
|
1212
|
-
export declare function
|
1227
|
+
export declare function summary(props?: {
|
1228
|
+
[_: string]: any;
|
1229
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1213
1230
|
|
1214
|
-
export declare function sup(
|
1231
|
+
export declare function sup(props?: {
|
1232
|
+
[_: string]: any;
|
1233
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1215
1234
|
|
1216
1235
|
/**
|
1217
1236
|
* 创建静态选项卡组件。
|
1218
|
-
*
|
1219
|
-
*
|
1220
|
-
*
|
1221
|
-
*
|
1222
|
-
* @
|
1237
|
+
*
|
1238
|
+
* `tabControl` 函数生成一个静态选项卡组件,其中选项卡的数量和顺序是固定的。
|
1239
|
+
* 每个选项卡由一个导航按钮和一个对应的内容面板组成。
|
1240
|
+
*
|
1241
|
+
* @param {{ tabIndex: BehaviorSubject<number>, [key: string]: any}} props - 选项卡组件的属性。
|
1242
|
+
* @param {Array<string|HTMLElement>} tabs - 导航按钮的内容数组,可以是字符串或 HTML 元素。
|
1243
|
+
* @param {Array<string|HTMLElement>} panels - 内容面板的内容数组,可以是字符串或 HTML 元素。
|
1244
|
+
* @returns {HTMLElement} - 返回一个包含导航栏和内容面板的选项卡组件。
|
1223
1245
|
*/
|
1224
|
-
export declare function tabControl(
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
},
|
1229
|
-
tabs: Array<string | HTMLElement>,
|
1230
|
-
panels: Array<string | HTMLElement>
|
1231
|
-
): HTMLElement;
|
1232
|
-
|
1233
|
-
export declare function table(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLTableElement>;
|
1246
|
+
export declare function tabControl(props: {
|
1247
|
+
tabIndex: BehaviorSubject<number>;
|
1248
|
+
[key: string]: any;
|
1249
|
+
}, tabs: Array<string | HTMLElement>, panels: Array<string | HTMLElement>): HTMLElement;
|
1234
1250
|
|
1235
|
-
export declare function table(
|
1251
|
+
export declare function table(props?: {
|
1252
|
+
[_: string]: any;
|
1253
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableElement>;
|
1236
1254
|
|
1237
1255
|
/**
|
1238
1256
|
* 选项卡的导航按钮。
|
1239
|
-
*
|
1240
|
-
*
|
1241
|
-
*
|
1257
|
+
*
|
1258
|
+
* `tabNavItem` 函数生成一个选项卡的导航按钮,通常用于选项卡的导航栏中。
|
1259
|
+
*
|
1260
|
+
* @param {...(string|HTMLElement)} source - 按钮的内容,可以是字符串或 HTML 元素。
|
1261
|
+
* @returns {HTMLElement} - 返回一个带有 `nav-item` 样式类的 `<li>` 元素,内部包含一个按钮。
|
1262
|
+
*
|
1242
1263
|
*/
|
1243
|
-
export declare function tabNavItem(
|
1244
|
-
...source: (string | HTMLElement)[]
|
1245
|
-
): HTMLElement;
|
1264
|
+
export declare function tabNavItem(...source: (string | HTMLElement)[]): HTMLElement;
|
1246
1265
|
|
1247
1266
|
/**
|
1248
1267
|
* 选项卡的内容面板。
|
1249
|
-
*
|
1250
|
-
*
|
1251
|
-
*
|
1268
|
+
*
|
1269
|
+
* `tabPanel` 函数生成一个选项卡的内容区域,用于显示与选项卡对应的内容。
|
1270
|
+
*
|
1271
|
+
* @param {...(string|HTMLElement)} source - 面板的内容,可以是字符串或 HTML 元素。
|
1272
|
+
* @returns {HTMLElement} - 返回一个带有 `tab-pane` 样式类的 `<div>` 元素。
|
1273
|
+
*
|
1252
1274
|
*/
|
1253
|
-
export declare function tabPanel(
|
1254
|
-
...source: (string | HTMLElement)[]
|
1255
|
-
): HTMLElement;
|
1275
|
+
export declare function tabPanel(...source: (string | HTMLElement)[]): HTMLElement;
|
1256
1276
|
|
1257
1277
|
/**
|
1258
1278
|
* 选项卡组件的基础框架。
|
1259
|
-
*
|
1260
|
-
*
|
1261
|
-
*
|
1279
|
+
*
|
1280
|
+
* `tabRoot` 函数生成一个包含导航栏和内容面板的容器结构,
|
1281
|
+
* 用于构建选项卡组件的基础部分。
|
1282
|
+
*
|
1283
|
+
* @param {Object} props - 传递给根容器 `<div>` 的属性(如 `id`、`className` 等)。
|
1284
|
+
* @returns {HTMLElement} - 返回一个包含导航栏和内容面板的 `<div>` 元素。
|
1285
|
+
*
|
1262
1286
|
*/
|
1263
|
-
export declare function tabRoot(props:
|
1264
|
-
|
1265
|
-
export declare function tbody(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLTableSectionElement>;
|
1287
|
+
export declare function tabRoot(props: Object): HTMLElement;
|
1266
1288
|
|
1267
|
-
export declare function tbody(
|
1289
|
+
export declare function tbody(props?: {
|
1290
|
+
[_: string]: any;
|
1291
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableSectionElement>;
|
1268
1292
|
|
1269
|
-
export declare function td(props
|
1270
|
-
|
1271
|
-
|
1293
|
+
export declare function td(props?: {
|
1294
|
+
[_: string]: any;
|
1295
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableCellElement>;
|
1272
1296
|
|
1273
1297
|
/**
|
1274
1298
|
* 创建一个支持 RxJS 数据绑定的 <textarea> 元素。
|
1275
|
-
*
|
1276
|
-
* @param props - 配置对象,包含 <textarea>
|
1277
|
-
* @returns 创建的 <textarea> 元素。
|
1278
|
-
* @throws 如果 props 不是对象,或者 value 不是 BehaviorSubject
|
1279
|
-
*/
|
1280
|
-
export declare function textarea(
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
}
|
1285
|
-
): HyperscriptExtensions<HTMLTextAreaElement>;
|
1299
|
+
*
|
1300
|
+
* @param {{value:BehaviorSubject<string>, [key:string]:any}} props - 配置对象,包含 <textarea> 元素的属性。
|
1301
|
+
* @returns {HyperscriptTextAreaElement} - 创建的 <textarea> 元素。
|
1302
|
+
* @throws {Error} 如果 `props` 不是对象,或者 `value` 不是 BehaviorSubject。
|
1303
|
+
*/
|
1304
|
+
export declare function textarea(props: {
|
1305
|
+
value: BehaviorSubject<string>;
|
1306
|
+
[key: string]: any;
|
1307
|
+
}): HyperscriptTextAreaElement;
|
1286
1308
|
|
1287
1309
|
/**
|
1288
1310
|
* 创建一个支持 RxJS 数据绑定的 <input type="text"> 元素。
|
1289
|
-
*
|
1290
|
-
* @param props - 配置对象,包含 <input>
|
1291
|
-
* @returns 创建的 <input type="text"> 元素。
|
1292
|
-
* @throws 如果 props 不是对象,或者 value 不是 BehaviorSubject
|
1311
|
+
*
|
1312
|
+
* @param {{value: BehaviorSubject<string>, [key: string]: any}} props - 配置对象,包含 <input> 元素的属性。
|
1313
|
+
* @returns {HyperscriptInputElement} - 创建的 <input type="text"> 元素。
|
1314
|
+
* @throws {Error} 如果 `props` 不是对象,或者 `value` 不是 BehaviorSubject。
|
1293
1315
|
*/
|
1294
1316
|
export declare function textbox(props: {
|
1295
|
-
value: BehaviorSubject<string
|
1296
|
-
[key: string]: any
|
1297
|
-
}):
|
1317
|
+
value: BehaviorSubject<string>;
|
1318
|
+
[key: string]: any;
|
1319
|
+
}): HyperscriptInputElement_2;
|
1298
1320
|
|
1299
1321
|
/**
|
1300
|
-
*
|
1301
|
-
*
|
1302
|
-
* @param text - Observable<any> | any。
|
1303
|
-
* @returns 文本节点,若为动态文本节点则带有 unsubscribe 方法。
|
1322
|
+
* @typedef {Text & {subscription?: Subscription, unsubscribe?: ()=>void}} ObservableTextNode
|
1304
1323
|
*/
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1324
|
+
/**
|
1325
|
+
* 创建一个文本节点。
|
1326
|
+
* 支持静态文本和动态更新的文本(通过 RxJS Observable)。
|
1327
|
+
*
|
1328
|
+
* - 如果传入的是字符串,则创建一个静态文本节点。
|
1329
|
+
* - 如果传入的是 RxJS Observable,则创建一个动态文本节点,并根据 Observable 的值实时更新文本内容。
|
1330
|
+
* - 动态文本节点支持通过 `unsubscribe` 方法取消订阅。
|
1331
|
+
*
|
1332
|
+
* @param {any} text Observable<any> | any。
|
1333
|
+
* @returns {ObservableTextNode}
|
1334
|
+
*
|
1335
|
+
*/
|
1336
|
+
export declare function textNode(text: any): ObservableTextNode;
|
1316
1337
|
|
1317
|
-
export declare function
|
1338
|
+
export declare function tfoot(props?: {
|
1339
|
+
[_: string]: any;
|
1340
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableSectionElement>;
|
1318
1341
|
|
1319
|
-
export declare function
|
1342
|
+
export declare function th(props?: {
|
1343
|
+
[_: string]: any;
|
1344
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableCellElement>;
|
1320
1345
|
|
1321
|
-
export declare function
|
1346
|
+
export declare function thead(props?: {
|
1347
|
+
[_: string]: any;
|
1348
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableSectionElement>;
|
1322
1349
|
|
1323
|
-
export declare function time(
|
1350
|
+
export declare function time(props?: {
|
1351
|
+
[_: string]: any;
|
1352
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTimeElement>;
|
1324
1353
|
|
1325
1354
|
/**
|
1326
1355
|
* 将扁平化的键值对数组转换为嵌套的 JavaScript 对象或数组。
|
1327
1356
|
*
|
1328
|
-
* @param
|
1329
|
-
*
|
1357
|
+
* @param {[ (string | number)[], any ][]} flatEntries - 扁平化的键值对数组。
|
1358
|
+
* 每个键值对的格式为 `[keyPath, value]`,其中 `keyPath` 是一个表示嵌套路径的数组。假设输入的键值对数组已经按照键路径(keyPath)排好顺序。
|
1359
|
+
* @returns {Record<string|number, any>} - 返回嵌套的 JavaScript 对象或数组。
|
1360
|
+
*
|
1330
1361
|
*/
|
1331
|
-
export declare function tojs(
|
1332
|
-
flatEntries: [ (string | number)[], any ][]
|
1333
|
-
): Record<string|number, any>;
|
1334
|
-
|
1335
|
-
export declare function tr(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLTableRowElement>;
|
1336
|
-
|
1337
|
-
export declare function tr(...childNodes: any[]): HyperscriptExtensions<HTMLTableRowElement>;
|
1362
|
+
export declare function tojs(flatEntries: [(string | number)[], any][]): Record<string | number, any>;
|
1338
1363
|
|
1339
|
-
export declare function
|
1364
|
+
export declare function tr(props?: {
|
1365
|
+
[_: string]: any;
|
1366
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTableRowElement>;
|
1340
1367
|
|
1341
|
-
export declare function track(
|
1368
|
+
export declare function track(props?: {
|
1369
|
+
[_: string]: any;
|
1370
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLTrackElement>;
|
1342
1371
|
|
1343
|
-
export declare function tt(props
|
1372
|
+
export declare function tt(props?: {
|
1373
|
+
[_: string]: any;
|
1374
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1344
1375
|
|
1345
|
-
export declare function tt(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1346
|
-
|
1347
|
-
/**
|
1348
|
-
* JavaScript 基本数据类型名称数组
|
1349
|
-
* typeof 返回的所有类型字符串
|
1350
|
-
*/
|
1351
1376
|
export declare const types: string[];
|
1352
1377
|
|
1353
|
-
export declare function u(props
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
export declare function ul(props: { [_: string]: any }, ...childNodes: any[]): HyperscriptExtensions<HTMLUListElement>;
|
1378
|
+
export declare function u(props?: {
|
1379
|
+
[_: string]: any;
|
1380
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1358
1381
|
|
1359
|
-
export declare function ul(
|
1382
|
+
export declare function ul(props?: {
|
1383
|
+
[_: string]: any;
|
1384
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLUListElement>;
|
1360
1385
|
|
1361
1386
|
/**
|
1362
1387
|
* 通过不断调用 fn 生成值,直到 fn 返回 falsy。
|
1388
|
+
*
|
1363
1389
|
* @public
|
1364
|
-
* @
|
1365
|
-
* @param seed -
|
1366
|
-
* @
|
1390
|
+
* @template T, S
|
1391
|
+
* @param {(seed: S) => [T, S] | false | null | undefined} fn - 生成函数,接收当前 seed,返回 [value, nextSeed] 或 falsy。
|
1392
|
+
* @param {S} seed - 初始种子值。
|
1393
|
+
* @returns {Array<T>} 由 fn 生成的所有 value 组成的数组。
|
1394
|
+
* @this *
|
1367
1395
|
*/
|
1368
|
-
export declare function unfold<T, S>(
|
1369
|
-
fn: (seed: S) => [T, S] | false | null | undefined,
|
1370
|
-
seed: S
|
1371
|
-
): T[];
|
1396
|
+
export declare function unfold<T, S>(this: any, fn: (seed: S) => [T, S] | false | null | undefined, seed: S): Array<T>;
|
1372
1397
|
|
1373
1398
|
/**
|
1374
|
-
*
|
1375
|
-
*
|
1376
|
-
* @
|
1377
|
-
* @
|
1399
|
+
* 将任意 JS 值序列化为“无引号 JSON”字符串(仅对键名和部分字符串值去引号)。
|
1400
|
+
*
|
1401
|
+
* @public
|
1402
|
+
* @param {*} value - 要序列化的值
|
1403
|
+
* @returns {string} 序列化后的字符串
|
1378
1404
|
*/
|
1379
1405
|
export declare function unquotedJsonStringify(value: any): string;
|
1380
1406
|
|
1381
1407
|
/**
|
1382
|
-
*
|
1383
|
-
*
|
1384
|
-
*
|
1385
|
-
* @param args -
|
1386
|
-
* @returns
|
1408
|
+
* 简易unwrap参数数组。如果子节点是单个数组,则解构为子节点,否则返回原数组。
|
1409
|
+
*
|
1410
|
+
* @template T
|
1411
|
+
* @param {(T|T[])[]} args - 子节点数组。
|
1412
|
+
* @returns {T[]} - 解构后的子节点数组。
|
1387
1413
|
*/
|
1388
|
-
export declare function unwrapArgs<T>(
|
1389
|
-
args: (T|T[])[]
|
1390
|
-
): T[];
|
1414
|
+
export declare function unwrapArgs<T>(args: (T | T[])[]): T[];
|
1391
1415
|
|
1392
|
-
export declare function video(props
|
1416
|
+
export declare function video(props?: {
|
1417
|
+
[_: string]: any;
|
1418
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLVideoElement>;
|
1393
1419
|
|
1394
|
-
export declare function
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
export declare function wbr(...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1420
|
+
export declare function wbr(props?: {
|
1421
|
+
[_: string]: any;
|
1422
|
+
}, ...childNodes: any[]): HyperscriptExtensions<HTMLElement>;
|
1399
1423
|
|
1400
1424
|
/**
|
1401
|
-
*
|
1402
|
-
*
|
1403
|
-
*
|
1404
|
-
*
|
1405
|
-
* @
|
1406
|
-
* @
|
1407
|
-
* @
|
1408
|
-
* @
|
1425
|
+
* 合并两个数组为一个元组数组。
|
1426
|
+
*
|
1427
|
+
* 如果数组长度不同,将以较长的数组为基准,短数组对应位置为 undefined。
|
1428
|
+
*
|
1429
|
+
* @public
|
1430
|
+
* @template T, U
|
1431
|
+
* @param {T[]} a - 第一个数组
|
1432
|
+
* @param {U[]} b - 第二个数组
|
1433
|
+
* @returns {Array<[T, U]>} - 合并后的元组数组
|
1434
|
+
* @throws {Error} 如果 a 或 b 不是数组
|
1409
1435
|
*/
|
1410
|
-
export declare function zipArray<T, U>(a: T[], b: U[]): [T, U]
|
1436
|
+
export declare function zipArray<T, U>(a: T[], b: U[]): Array<[T, U]>;
|
1411
1437
|
|
1412
1438
|
export { }
|