transone 0.1.0

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.
Files changed (43) hide show
  1. package/README.md +17 -0
  2. package/dist/core/app.d.ts +114 -0
  3. package/dist/core/component/base.d.ts +79 -0
  4. package/dist/core/component/index.d.ts +4 -0
  5. package/dist/core/component.d.ts +1 -0
  6. package/dist/core/document.d.ts +32 -0
  7. package/dist/core/form.d.ts +24 -0
  8. package/dist/core/index.d.ts +9 -0
  9. package/dist/core/model.d.ts +18 -0
  10. package/dist/core/reactive/scheduler.d.ts +32 -0
  11. package/dist/core/reactive/types.d.ts +24 -0
  12. package/dist/core/reactive.d.ts +77 -0
  13. package/dist/core/renderer/element-strategy.d.ts +32 -0
  14. package/dist/core/renderer/props.d.ts +9 -0
  15. package/dist/core/renderer/types.d.ts +37 -0
  16. package/dist/core/renderer.d.ts +43 -0
  17. package/dist/core/template.d.ts +50 -0
  18. package/dist/core/vnode.d.ts +104 -0
  19. package/dist/dom/index.d.ts +612 -0
  20. package/dist/dom/index.js +4 -0
  21. package/dist/dom/index.js.map +10 -0
  22. package/dist/index-3t506ckz.js +12 -0
  23. package/dist/index-3t506ckz.js.map +25 -0
  24. package/dist/index-mbmajrpr.js +26 -0
  25. package/dist/index-mbmajrpr.js.map +11 -0
  26. package/dist/index.d.ts +7 -0
  27. package/dist/index.js +4 -0
  28. package/dist/index.js.map +11 -0
  29. package/dist/router/history.d.ts +5 -0
  30. package/dist/router/index.d.ts +112 -0
  31. package/dist/router/index.js +4 -0
  32. package/dist/router/index.js.map +9 -0
  33. package/dist/router/instance.d.ts +26 -0
  34. package/dist/router/matcher.d.ts +7 -0
  35. package/dist/style/StyleManager.d.ts +18 -0
  36. package/dist/style/class-style.d.ts +0 -0
  37. package/dist/style/id-style.d.ts +0 -0
  38. package/dist/style/index.d.ts +2 -0
  39. package/dist/style/index.js +4 -0
  40. package/dist/style/index.js.map +9 -0
  41. package/dist/style/sheet.d.ts +13 -0
  42. package/dist/style/style.d.ts +0 -0
  43. package/package.json +59 -0
@@ -0,0 +1,612 @@
1
+ /**
2
+ * 零依赖最小 DOM 实现。
3
+ *
4
+ * 供 SSR(CLI 项目渲染、docs 静态构建)与测试环境使用,
5
+ * 覆盖 TSone 框架与测试实际依赖的 DOM 面(节点树、事件、CSS 选择器、
6
+ * innerHTML 序列化/解析、history/location/localStorage 等)。
7
+ * 仅面向本项目所需场景,不追求完整浏览器兼容。
8
+ */
9
+ export declare const enum DomNodeType {
10
+ ELEMENT_NODE = 1,
11
+ TEXT_NODE = 3,
12
+ COMMENT_NODE = 8,
13
+ DOCUMENT_NODE = 9,
14
+ DOCUMENT_FRAGMENT_NODE = 11
15
+ }
16
+ export declare class DOMException extends Error {
17
+ readonly code: number;
18
+ constructor(message: string, name?: string);
19
+ }
20
+ type EventListenerRecord = ((event: Event) => void) | {
21
+ handleEvent(event: Event): void;
22
+ };
23
+ interface ListenerEntry {
24
+ listener: EventListenerRecord;
25
+ capture: boolean;
26
+ once: boolean;
27
+ passive: boolean;
28
+ }
29
+ /**
30
+ * EventTarget 基类:addEventListener / removeEventListener / dispatchEvent。
31
+ */
32
+ export declare class EventTarget {
33
+ private readonly listenerMap;
34
+ addEventListener(type: string, listener: EventListenerRecord | null, options?: boolean | AddEventListenerOptions): void;
35
+ removeEventListener(type: string, listener: EventListenerRecord | null, options?: boolean | EventListenerOptions): void;
36
+ dispatchEvent(event: Event): boolean;
37
+ /** @internal 返回本节点的监听器。 */
38
+ getListeners(type: string): ListenerEntry[];
39
+ }
40
+ export declare class Event {
41
+ static readonly NONE = 0;
42
+ static readonly CAPTURING_PHASE = 1;
43
+ static readonly AT_TARGET = 2;
44
+ static readonly BUBBLING_PHASE = 3;
45
+ readonly type: string;
46
+ readonly bubbles: boolean;
47
+ readonly cancelable: boolean;
48
+ readonly composed: boolean;
49
+ target: EventTarget | null;
50
+ currentTarget: EventTarget | null;
51
+ eventPhase: number;
52
+ defaultPrevented: boolean;
53
+ readonly isTrusted = false;
54
+ readonly timeStamp: number;
55
+ cancelBubble: boolean;
56
+ /** @internal */
57
+ dispatched: boolean;
58
+ /** @internal */
59
+ private propagationStopped;
60
+ /** @internal */
61
+ private immediateStopped;
62
+ /** @internal */
63
+ private canceled;
64
+ constructor(type: string, init?: EventInit);
65
+ preventDefault(): void;
66
+ stopPropagation(): void;
67
+ stopImmediatePropagation(): void;
68
+ /** @internal */
69
+ propagationPrevented(): boolean;
70
+ /** @internal */
71
+ immediatePrevented(): boolean;
72
+ /** @internal */
73
+ wasCanceled(): boolean;
74
+ }
75
+ export declare class CustomEvent<T = unknown> extends Event {
76
+ readonly detail: T;
77
+ constructor(type: string, init?: CustomEventInit<T>);
78
+ }
79
+ export declare class MouseEvent extends Event {
80
+ readonly clientX: number;
81
+ readonly clientY: number;
82
+ readonly button: number;
83
+ readonly buttons: number;
84
+ readonly relatedTarget: unknown;
85
+ constructor(type: string, init?: MouseEventInit);
86
+ }
87
+ export declare class KeyboardEvent extends Event {
88
+ readonly key: string;
89
+ readonly code: string;
90
+ readonly shiftKey: boolean;
91
+ readonly ctrlKey: boolean;
92
+ readonly altKey: boolean;
93
+ readonly metaKey: boolean;
94
+ constructor(type: string, init?: KeyboardEventInit);
95
+ }
96
+ export declare class DOMTokenList implements Iterable<string> {
97
+ private readonly element;
98
+ private readonly attributeName;
99
+ constructor(element: Element, attributeName?: string);
100
+ get length(): number;
101
+ get value(): string;
102
+ set value(value: string);
103
+ item(index: number): string | null;
104
+ contains(token: string): boolean;
105
+ add(...tokens: string[]): void;
106
+ remove(...tokens: string[]): void;
107
+ toggle(token: string, force?: boolean): boolean;
108
+ replace(oldToken: string, newToken: string): boolean;
109
+ [Symbol.iterator](): Iterator<string>;
110
+ forEach(callback: (value: string, index: number, list: DOMTokenList) => void): void;
111
+ toString(): string;
112
+ private tokens;
113
+ private setTokens;
114
+ }
115
+ /**
116
+ * 创建 CSSStyleDeclaration 代理,支持任意 camelCase 属性访问与赋值。
117
+ */
118
+ export declare function createStyleDeclaration(): CSSStyleDeclaration;
119
+ /**
120
+ * 类数组节点列表:支持 .length、.item()、数值索引与迭代。
121
+ */
122
+ export declare class NodeList<T extends Node = Node> implements Iterable<T> {
123
+ /** @internal */
124
+ private readonly items;
125
+ constructor(items?: T[]);
126
+ get length(): number;
127
+ item(index: number): T | null;
128
+ [Symbol.iterator](): Iterator<T>;
129
+ forEach(callback: (value: T, index: number, list: NodeList<T>) => void): void;
130
+ entries(): IterableIterator<[number, T]>;
131
+ keys(): IterableIterator<number>;
132
+ values(): IterableIterator<T>;
133
+ toArray(): T[];
134
+ }
135
+ /**
136
+ * Node 基类:节点树、父子关系、文本内容。
137
+ */
138
+ export declare class Node extends EventTarget {
139
+ static readonly ELEMENT_NODE = DomNodeType.ELEMENT_NODE;
140
+ static readonly TEXT_NODE = DomNodeType.TEXT_NODE;
141
+ static readonly COMMENT_NODE = DomNodeType.COMMENT_NODE;
142
+ static readonly DOCUMENT_NODE = DomNodeType.DOCUMENT_NODE;
143
+ static readonly DOCUMENT_FRAGMENT_NODE = DomNodeType.DOCUMENT_FRAGMENT_NODE;
144
+ readonly nodeType: number;
145
+ readonly nodeName: string;
146
+ parentNode: Node | null;
147
+ ownerDocument: Document | null;
148
+ /** @internal */
149
+ childList: Node[];
150
+ constructor(nodeType: number, nodeName: string);
151
+ get parentElement(): Element | null;
152
+ get childNodes(): NodeList<Node>;
153
+ get firstChild(): Node | null;
154
+ get lastChild(): Node | null;
155
+ get nextSibling(): Node | null;
156
+ get previousSibling(): Node | null;
157
+ get textContent(): string;
158
+ set textContent(value: string);
159
+ hasChildNodes(): boolean;
160
+ appendChild<T extends Node>(node: T): T;
161
+ insertBefore<T extends Node>(node: T, reference: Node | null): T;
162
+ removeChild<T extends Node>(node: T): T;
163
+ replaceChild<T extends Node>(newChild: T, oldChild: Node): T;
164
+ replaceChildren(...nodes: Node[]): void;
165
+ contains(node: Node | null): boolean;
166
+ remove(): void;
167
+ cloneNode(deep?: boolean): Node;
168
+ /** @internal */
169
+ protected createClone(): Node;
170
+ getRootNode(): Node;
171
+ get isConnected(): boolean;
172
+ }
173
+ /**
174
+ * Element:标签节点。
175
+ */
176
+ export declare class Element extends Node {
177
+ readonly namespaceURI: string | null;
178
+ /** @internal */
179
+ private readonly attributeList;
180
+ /** @internal */
181
+ private styleValue;
182
+ /** @internal */
183
+ private classListValue;
184
+ /** @internal */
185
+ private datasetProxy;
186
+ constructor(tagName: string, namespaceURI?: string | null);
187
+ get tagName(): string;
188
+ get localName(): string;
189
+ get id(): string;
190
+ set id(value: string);
191
+ get className(): string;
192
+ set className(value: string);
193
+ get classList(): DOMTokenList;
194
+ get style(): CSSStyleDeclaration;
195
+ get dataset(): Record<string, string>;
196
+ get children(): NodeList<Element>;
197
+ get firstElementChild(): Element | null;
198
+ get lastElementChild(): Element | null;
199
+ get childElementCount(): number;
200
+ get attributes(): NamedNodeMap;
201
+ getAttribute(name: string): string | null;
202
+ getAttributeNames(): string[];
203
+ setAttribute(name: string, value: unknown): void;
204
+ removeAttribute(name: string): void;
205
+ hasAttribute(name: string): boolean;
206
+ toggleAttribute(name: string, force?: boolean): boolean;
207
+ hasAttributes(): boolean;
208
+ get innerHTML(): string;
209
+ set innerHTML(value: string);
210
+ get outerHTML(): string;
211
+ get value(): string;
212
+ set value(value: string);
213
+ querySelector(selector: string): Element | null;
214
+ querySelectorAll(selector: string): NodeList<Element>;
215
+ getElementsByTagName(tagName: string): NodeList<Element>;
216
+ matches(selector: string): boolean;
217
+ closest(selector: string): Element | null;
218
+ getBoundingClientRect(): DOMRect;
219
+ scrollIntoView(): void;
220
+ focus(): void;
221
+ blur(): void;
222
+ click(): void;
223
+ append(...nodes: (Node | string)[]): void;
224
+ prepend(...nodes: (Node | string)[]): void;
225
+ before(...nodes: (Node | string)[]): void;
226
+ after(...nodes: (Node | string)[]): void;
227
+ replaceWith(...nodes: (Node | string)[]): void;
228
+ setAttributeNS(_namespace: string, name: string, value: unknown): void;
229
+ removeAttributeNS(_namespace: string, name: string): void;
230
+ hasAttributeNS(_namespace: string, name: string): boolean;
231
+ getAttributeNS(_namespace: string, name: string): string | null;
232
+ /** @internal */
233
+ findAttribute(name: string): {
234
+ name: string;
235
+ value: string;
236
+ } | undefined;
237
+ /** @internal */
238
+ attributeEntries(): Array<{
239
+ name: string;
240
+ value: string;
241
+ }>;
242
+ /** @internal 供序列化读取内联样式。 */
243
+ inlineStyleText(): string;
244
+ /** @internal */
245
+ protected createClone(): Node;
246
+ }
247
+ export declare class HTMLElement extends Element {
248
+ constructor(tagName: string);
249
+ /** 页面语言(属性反射,无值回退空串)。 */
250
+ get lang(): string;
251
+ set lang(value: string);
252
+ /** 是否隐藏(布尔属性反射)。 */
253
+ get hidden(): boolean;
254
+ set hidden(value: boolean);
255
+ /** 键盘焦点顺序(数字属性反射;0 表示按文档顺序)。 */
256
+ get tabIndex(): number;
257
+ set tabIndex(value: number);
258
+ /** 布局尺寸与偏移;无排版引擎时恒为 0,测试可覆盖 getBoundingClientRect。 */
259
+ get offsetWidth(): number;
260
+ get offsetHeight(): number;
261
+ get offsetLeft(): number;
262
+ get offsetTop(): number;
263
+ }
264
+ export declare class NamedNodeMap implements Iterable<{
265
+ name: string;
266
+ value: string;
267
+ }> {
268
+ private readonly element;
269
+ constructor(element: Element);
270
+ get length(): number;
271
+ item(index: number): {
272
+ name: string;
273
+ value: string;
274
+ } | null;
275
+ getNamedItem(name: string): {
276
+ name: string;
277
+ value: string;
278
+ } | null;
279
+ setNamedItem(attr: {
280
+ name: string;
281
+ value: string;
282
+ }): void;
283
+ removeNamedItem(name: string): void;
284
+ [Symbol.iterator](): Iterator<{
285
+ name: string;
286
+ value: string;
287
+ }>;
288
+ }
289
+ export declare class HTMLOptionElement extends HTMLElement {
290
+ /** @internal */
291
+ private selectedValue;
292
+ constructor(tagName?: string);
293
+ get value(): string;
294
+ set value(value: string);
295
+ get text(): string;
296
+ get label(): string;
297
+ get selected(): boolean;
298
+ set selected(value: boolean);
299
+ /** @internal */
300
+ setSelectedRaw(value: boolean): void;
301
+ /** @internal */
302
+ hasSelectedValue(): boolean;
303
+ }
304
+ export declare class HTMLSelectElement extends HTMLElement {
305
+ constructor(tagName?: string);
306
+ get disabled(): boolean;
307
+ set disabled(value: boolean);
308
+ get multiple(): boolean;
309
+ set multiple(value: boolean);
310
+ get options(): HTMLOptionsCollection;
311
+ get selectedOptions(): NodeList<HTMLOptionElement>;
312
+ get selectedIndex(): number;
313
+ set selectedIndex(index: number);
314
+ get value(): string;
315
+ set value(value: string);
316
+ add(option: HTMLOptionElement): void;
317
+ removeOption(index: number): void;
318
+ }
319
+ export declare class HTMLOptionsCollection implements Iterable<HTMLOptionElement> {
320
+ private readonly items;
321
+ constructor(items: HTMLOptionElement[]);
322
+ get length(): number;
323
+ item(index: number): HTMLOptionElement | null;
324
+ get value(): string;
325
+ get selectedIndex(): number;
326
+ toArray(): HTMLOptionElement[];
327
+ [Symbol.iterator](): Iterator<HTMLOptionElement>;
328
+ }
329
+ export declare class HTMLInputElement extends HTMLElement {
330
+ /** @internal */
331
+ private inputValue;
332
+ /** @internal */
333
+ private checkedValue;
334
+ constructor(tagName?: string);
335
+ get type(): string;
336
+ set type(value: string);
337
+ get name(): string;
338
+ set name(value: string);
339
+ get value(): string;
340
+ set value(value: string);
341
+ get defaultValue(): string;
342
+ get checked(): boolean;
343
+ set checked(value: boolean);
344
+ get disabled(): boolean;
345
+ set disabled(value: boolean);
346
+ get placeholder(): string;
347
+ set placeholder(value: string);
348
+ get accept(): string;
349
+ get multiple(): boolean;
350
+ set multiple(value: boolean);
351
+ set accept(value: string);
352
+ get min(): string;
353
+ set min(value: string);
354
+ get max(): string;
355
+ set max(value: string);
356
+ get step(): string;
357
+ set step(value: string);
358
+ /** @internal */
359
+ protected createClone(): Node;
360
+ }
361
+ export declare class HTMLTextAreaElement extends HTMLElement {
362
+ /** @internal */
363
+ private textareaValue;
364
+ constructor(tagName?: string);
365
+ get value(): string;
366
+ set value(value: string);
367
+ get name(): string;
368
+ set name(value: string);
369
+ get disabled(): boolean;
370
+ set disabled(value: boolean);
371
+ get placeholder(): string;
372
+ set placeholder(value: string);
373
+ }
374
+ export declare class HTMLButtonElement extends HTMLElement {
375
+ constructor(tagName?: string);
376
+ get disabled(): boolean;
377
+ set disabled(value: boolean);
378
+ get type(): string;
379
+ }
380
+ export declare class HTMLTableCellElement extends HTMLElement {
381
+ constructor(tagName?: string);
382
+ get colSpan(): number;
383
+ set colSpan(value: number);
384
+ }
385
+ export declare class HTMLLabelElement extends HTMLElement {
386
+ constructor(tagName?: string);
387
+ get htmlFor(): string;
388
+ set htmlFor(value: string);
389
+ }
390
+ export declare class HTMLImageElement extends HTMLElement {
391
+ constructor(tagName?: string);
392
+ get src(): string;
393
+ set src(value: string);
394
+ get alt(): string;
395
+ set alt(value: string);
396
+ }
397
+ export declare class HTMLStyleElement extends HTMLElement {
398
+ constructor(tagName?: string);
399
+ }
400
+ export declare class HTMLAnchorElement extends HTMLElement {
401
+ constructor(tagName?: string);
402
+ get href(): string;
403
+ set href(value: string);
404
+ }
405
+ export declare class Text extends Node {
406
+ data: string;
407
+ constructor(data?: string);
408
+ get nodeValue(): string;
409
+ set nodeValue(value: string);
410
+ get textContent(): string;
411
+ set textContent(value: string);
412
+ get wholeText(): string;
413
+ /** @internal */
414
+ protected createClone(): Node;
415
+ }
416
+ export declare class Comment extends Node {
417
+ data: string;
418
+ constructor(data?: string);
419
+ get nodeValue(): string;
420
+ set nodeValue(value: string);
421
+ /** @internal */
422
+ protected createClone(): Node;
423
+ }
424
+ export declare class DocumentFragment extends Node {
425
+ constructor();
426
+ }
427
+ export interface DomDocumentImplementation {
428
+ createHTMLDocument(title?: string): Document;
429
+ createDocument(): Document;
430
+ createDocumentType(): never;
431
+ hasFeature(): boolean;
432
+ }
433
+ export declare class DomDOMImplementation implements DomDocumentImplementation {
434
+ createDocument(): Document;
435
+ createDocumentType(): never;
436
+ hasFeature(): boolean;
437
+ createHTMLDocument(title?: string): Document;
438
+ }
439
+ export declare class Document extends Node {
440
+ readonly defaultView: DomWindow | null;
441
+ readonly implementation: DomDocumentImplementation;
442
+ private activeElementRef;
443
+ constructor();
444
+ get activeElement(): Element | null;
445
+ /** @internal 由 Element.focus()/blur() 维护。 */
446
+ setActiveElement(element: Element | null): void;
447
+ createElement(tagName: string): HTMLElement;
448
+ createElementNS(namespaceURI: string, tagName: string): HTMLElement;
449
+ createTextNode(data: string): Text;
450
+ createComment(data: string): Comment;
451
+ createDocumentFragment(): DocumentFragment;
452
+ createEvent(type: string): Event;
453
+ get documentElement(): HTMLElement;
454
+ get head(): HTMLElement;
455
+ get body(): HTMLElement;
456
+ get title(): string;
457
+ set title(value: string);
458
+ querySelector(selector: string): Element | null;
459
+ querySelectorAll(selector: string): NodeList<Element>;
460
+ getElementById(id: string): Element | null;
461
+ getElementsByTagName(tagName: string): NodeList<Element>;
462
+ /** @internal */
463
+ protected createClone(): Node;
464
+ private ensureDocumentChild;
465
+ }
466
+ /**
467
+ * History / Location / Storage 等浏览器环境对象。
468
+ */
469
+ export declare class Location {
470
+ /** @internal */
471
+ private url;
472
+ constructor(url: string);
473
+ get href(): string;
474
+ set href(value: string);
475
+ get origin(): string;
476
+ get protocol(): string;
477
+ get host(): string;
478
+ get hostname(): string;
479
+ get port(): string;
480
+ get pathname(): string;
481
+ set pathname(value: string);
482
+ get search(): string;
483
+ set search(value: string);
484
+ get hash(): string;
485
+ set hash(value: string);
486
+ get username(): string;
487
+ get password(): string;
488
+ assign(value: string): void;
489
+ replace(value: string): void;
490
+ reload(): void;
491
+ toString(): string;
492
+ /** @internal */
493
+ getHashPath(): string;
494
+ /** @internal */
495
+ getHrefWithoutHash(): string;
496
+ }
497
+ export declare class History {
498
+ /** @internal */
499
+ private readonly windowRef;
500
+ /** @internal */
501
+ private entries;
502
+ /** @internal */
503
+ private index;
504
+ /** @internal */
505
+ scrollRestoration: 'auto' | 'manual';
506
+ constructor(windowRef: DomWindow);
507
+ get length(): number;
508
+ get state(): unknown;
509
+ pushState(state: unknown, _unusedTitle: string, url?: string): void;
510
+ replaceState(state: unknown, _unusedTitle: string, url?: string): void;
511
+ back(): void;
512
+ forward(): void;
513
+ go(delta?: number): void;
514
+ }
515
+ export declare class Storage {
516
+ private readonly store;
517
+ get length(): number;
518
+ key(index: number): string | null;
519
+ getItem(key: string): string | null;
520
+ setItem(key: string, value: string): void;
521
+ removeItem(key: string): void;
522
+ clear(): void;
523
+ }
524
+ export declare class Navigator {
525
+ readonly userAgent = "TSone/0.5.1";
526
+ readonly platform = "TSone";
527
+ readonly language = "zh-CN";
528
+ readonly languages: string[];
529
+ readonly onLine = true;
530
+ readonly maxTouchPoints = 0;
531
+ }
532
+ export interface MediaQueryList {
533
+ readonly media: string;
534
+ readonly matches: boolean;
535
+ onchange: ((event: Event) => void) | null;
536
+ addEventListener(type: string, listener: EventListenerRecord): void;
537
+ removeEventListener(type: string, listener: EventListenerRecord): void;
538
+ addListener(listener: EventListenerRecord): void;
539
+ removeListener(listener: EventListenerRecord): void;
540
+ dispatchEvent(event: Event): boolean;
541
+ }
542
+ export declare function createMatchMedia(_windowRef: DomWindow, query: string): MediaQueryList;
543
+ export declare class ResizeObserver {
544
+ observe(): void;
545
+ unobserve(): void;
546
+ disconnect(): void;
547
+ }
548
+ export declare const DOM_GLOBAL_KEYS: readonly string[];
549
+ /**
550
+ * DomWindow:模拟的浏览器 window 环境。
551
+ */
552
+ export declare class DomWindow extends EventTarget {
553
+ readonly innerWidth = 1024;
554
+ readonly innerHeight = 768;
555
+ setTimeout(handler: () => void, timeout?: number): ReturnType<typeof setTimeout>;
556
+ clearTimeout(id: ReturnType<typeof setTimeout>): void;
557
+ readonly window: DomWindow;
558
+ readonly document: Document;
559
+ readonly location: Location;
560
+ readonly history: History;
561
+ readonly localStorage: Storage;
562
+ readonly navigator: Navigator;
563
+ readonly Node: typeof Node;
564
+ readonly Text: typeof Text;
565
+ readonly Comment: typeof Comment;
566
+ readonly Element: typeof Element;
567
+ readonly HTMLElement: typeof HTMLElement;
568
+ readonly HTMLInputElement: typeof HTMLInputElement;
569
+ readonly HTMLTextAreaElement: typeof HTMLTextAreaElement;
570
+ readonly HTMLSelectElement: typeof HTMLSelectElement;
571
+ readonly HTMLButtonElement: typeof HTMLButtonElement;
572
+ readonly HTMLOptionElement: typeof HTMLOptionElement;
573
+ readonly HTMLStyleElement: typeof HTMLStyleElement;
574
+ readonly HTMLAnchorElement: typeof HTMLAnchorElement;
575
+ readonly DocumentFragment: typeof DocumentFragment;
576
+ readonly Document: typeof Document;
577
+ readonly Event: typeof Event;
578
+ readonly MouseEvent: typeof MouseEvent;
579
+ readonly KeyboardEvent: typeof KeyboardEvent;
580
+ readonly CustomEvent: typeof CustomEvent;
581
+ readonly EventTarget: typeof EventTarget;
582
+ readonly DOMException: typeof DOMException;
583
+ readonly NodeList: typeof NodeList;
584
+ constructor(options?: {
585
+ url?: string;
586
+ });
587
+ matchMedia(query: string): MediaQueryList;
588
+ getComputedStyle(element: Element): CSSStyleDeclaration;
589
+ requestAnimationFrame(callback: FrameRequestCallback): number;
590
+ cancelAnimationFrame(handle: number): void;
591
+ /** @internal */
592
+ setLocationUrl(url: string): void;
593
+ /** @internal 安装到目标对象上的全局属性名。 */
594
+ installKeys(): string[];
595
+ }
596
+ export interface DomWindowOptions {
597
+ url?: string;
598
+ }
599
+ /**
600
+ * 创建隔离的 DOM window 环境。
601
+ */
602
+ export declare function createDomWindow(options?: DomWindowOptions): DomWindow;
603
+ /**
604
+ * 将 DOM window 的全局属性安装到目标对象(默认 globalThis),
605
+ * 返回可恢复旧值的函数。
606
+ */
607
+ export declare function installDomGlobals(windowRef: DomWindow, target?: Record<string, unknown>): () => void;
608
+ /**
609
+ * 解析 HTML 片段为节点列表(innerHTML setter 用)。
610
+ */
611
+ export declare function parseHtmlFragment(source: string, documentRef: Document | null): Node[];
612
+ export {};