glass-easel 0.2.0 → 0.3.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.
- package/.eslintignore +4 -0
- package/dist/glass_easel.all.js +2 -2
- package/dist/glass_easel.all.js.map +1 -1
- package/dist/glass_easel.d.ts +2546 -0
- package/dist/glass_easel.domlike.global.js +2 -2
- package/dist/glass_easel.domlike.global.js.map +1 -1
- package/guide/zh_CN/appendix/backend_protocol.md +164 -74
- package/jest.unit.config.js +7 -4
- package/package.json +7 -5
- package/rollup.config.ts +101 -0
- package/src/backend/backend_protocol.ts +26 -345
- package/src/backend/composed_backend_protocol.ts +10 -264
- package/src/backend/current_window_backend_context.ts +478 -0
- package/src/backend/domlike_backend_protocol.ts +9 -498
- package/src/backend/empty_backend.ts +265 -0
- package/src/backend/empty_composed_backend.ts +245 -0
- package/src/backend/index.ts +18 -0
- package/src/backend/suggested_backend_protocol.ts +62 -11
- package/src/behavior.ts +131 -442
- package/src/class_list.ts +328 -222
- package/src/component.ts +349 -184
- package/src/component_params.ts +54 -25
- package/src/component_space.ts +36 -15
- package/src/data_path.ts +22 -34
- package/src/data_proxy.ts +334 -27
- package/src/devtool.ts +89 -0
- package/src/element.ts +667 -285
- package/src/element_iterator.ts +9 -4
- package/src/event.ts +39 -20
- package/src/external_shadow_tree.ts +2 -2
- package/src/func_arr.ts +55 -101
- package/src/global_options.ts +18 -42
- package/src/index.ts +72 -73
- package/src/mutation_observer.ts +10 -7
- package/src/native_node.ts +79 -35
- package/src/node.ts +23 -30
- package/src/relation.ts +101 -12
- package/src/render.ts +5 -3
- package/src/selector.ts +9 -7
- package/src/shadow_root.ts +96 -240
- package/src/template_engine.ts +10 -7
- package/src/text_node.ts +43 -19
- package/src/tmpl/index.ts +38 -30
- package/src/tmpl/native_rendering.ts +14 -21
- package/src/tmpl/proc_gen_wrapper.ts +189 -151
- package/src/tmpl/proc_gen_wrapper_dom.ts +10 -8
- package/src/tmpl/range_list_diff.ts +30 -9
- package/src/trait_behaviors.ts +1 -1
- package/src/type_symbol.ts +36 -0
- package/src/virtual_node.ts +26 -13
- package/src/warning.ts +119 -0
- package/tests/base/composed_backend.ts +143 -142
- package/tests/base/env.ts +76 -3
- package/tests/base/match.ts +24 -22
- package/tests/base/shadow_backend.ts +917 -0
- package/tests/core/backend.test.ts +53 -1
- package/tests/core/behavior.test.ts +1 -1
- package/tests/core/data_update.test.ts +135 -0
- package/tests/core/misc.test.ts +91 -21
- package/tests/core/placeholder.test.ts +66 -25
- package/tests/core/slot.test.ts +161 -23
- package/tests/legacy/component.test.js +152 -78
- package/tests/legacy/data_path.test.js +19 -19
- package/tests/legacy/data_proxy.test.js +14 -7
- package/tests/legacy/external.test.js +8 -8
- package/tests/legacy/mutation_observer.test.js +7 -5
- package/tests/legacy/slot.test.js +2 -3
- package/tests/legacy/virtual.test.js +258 -25
- package/tests/tmpl/binding_map.test.ts +201 -195
- package/tests/tmpl/event.test.ts +138 -23
- package/tests/tmpl/expression.test.ts +15 -15
- package/tests/tmpl/lvalue.test.ts +101 -0
- package/tests/tmpl/structure.test.ts +486 -43
- package/tests/types/chaining.test.ts +27 -30
- package/tests/types/createElement.test.ts +5 -4
- package/tests/types/definition.test.ts +11 -14
- package/tsconfig.json +1 -3
- package/dist/glass_easel.all.d.ts +0 -1
- package/dist/glass_easel.domlike.global.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/types/src/backend/backend_protocol.d.ts +0 -141
- package/dist/types/src/backend/backend_protocol.d.ts.map +0 -1
- package/dist/types/src/backend/composed_backend_protocol.d.ts +0 -102
- package/dist/types/src/backend/composed_backend_protocol.d.ts.map +0 -1
- package/dist/types/src/backend/domlike_backend_protocol.d.ts +0 -100
- package/dist/types/src/backend/domlike_backend_protocol.d.ts.map +0 -1
- package/dist/types/src/backend/mode.d.ts +0 -65
- package/dist/types/src/backend/mode.d.ts.map +0 -1
- package/dist/types/src/backend/suggested_backend_protocol.d.ts +0 -30
- package/dist/types/src/backend/suggested_backend_protocol.d.ts.map +0 -1
- package/dist/types/src/behavior.d.ts +0 -434
- package/dist/types/src/behavior.d.ts.map +0 -1
- package/dist/types/src/class_list.d.ts +0 -83
- package/dist/types/src/class_list.d.ts.map +0 -1
- package/dist/types/src/component.d.ts +0 -325
- package/dist/types/src/component.d.ts.map +0 -1
- package/dist/types/src/component_params.d.ts +0 -236
- package/dist/types/src/component_params.d.ts.map +0 -1
- package/dist/types/src/component_space.d.ts +0 -211
- package/dist/types/src/component_space.d.ts.map +0 -1
- package/dist/types/src/data_path.d.ts +0 -5
- package/dist/types/src/data_path.d.ts.map +0 -1
- package/dist/types/src/data_proxy.d.ts +0 -107
- package/dist/types/src/data_proxy.d.ts.map +0 -1
- package/dist/types/src/data_utils.d.ts +0 -3
- package/dist/types/src/data_utils.d.ts.map +0 -1
- package/dist/types/src/element.d.ts +0 -365
- package/dist/types/src/element.d.ts.map +0 -1
- package/dist/types/src/element_iterator.d.ts +0 -43
- package/dist/types/src/element_iterator.d.ts.map +0 -1
- package/dist/types/src/event.d.ts +0 -105
- package/dist/types/src/event.d.ts.map +0 -1
- package/dist/types/src/external_shadow_tree.d.ts +0 -20
- package/dist/types/src/external_shadow_tree.d.ts.map +0 -1
- package/dist/types/src/func_arr.d.ts +0 -39
- package/dist/types/src/func_arr.d.ts.map +0 -1
- package/dist/types/src/global_options.d.ts +0 -120
- package/dist/types/src/global_options.d.ts.map +0 -1
- package/dist/types/src/index.d.ts +0 -43
- package/dist/types/src/index.d.ts.map +0 -1
- package/dist/types/src/mutation_observer.d.ts +0 -79
- package/dist/types/src/mutation_observer.d.ts.map +0 -1
- package/dist/types/src/native_node.d.ts +0 -11
- package/dist/types/src/native_node.d.ts.map +0 -1
- package/dist/types/src/node.d.ts +0 -48
- package/dist/types/src/node.d.ts.map +0 -1
- package/dist/types/src/relation.d.ts +0 -46
- package/dist/types/src/relation.d.ts.map +0 -1
- package/dist/types/src/render.d.ts +0 -3
- package/dist/types/src/render.d.ts.map +0 -1
- package/dist/types/src/selector.d.ts +0 -32
- package/dist/types/src/selector.d.ts.map +0 -1
- package/dist/types/src/shadow_root.d.ts +0 -174
- package/dist/types/src/shadow_root.d.ts.map +0 -1
- package/dist/types/src/template_engine.d.ts +0 -56
- package/dist/types/src/template_engine.d.ts.map +0 -1
- package/dist/types/src/text_node.d.ts +0 -44
- package/dist/types/src/text_node.d.ts.map +0 -1
- package/dist/types/src/tmpl/index.d.ts +0 -19
- package/dist/types/src/tmpl/index.d.ts.map +0 -1
- package/dist/types/src/tmpl/native_rendering.d.ts +0 -45
- package/dist/types/src/tmpl/native_rendering.d.ts.map +0 -1
- package/dist/types/src/tmpl/proc_gen_wrapper.d.ts +0 -89
- package/dist/types/src/tmpl/proc_gen_wrapper.d.ts.map +0 -1
- package/dist/types/src/tmpl/proc_gen_wrapper_dom.d.ts +0 -50
- package/dist/types/src/tmpl/proc_gen_wrapper_dom.d.ts.map +0 -1
- package/dist/types/src/tmpl/range_list_diff.d.ts +0 -19
- package/dist/types/src/tmpl/range_list_diff.d.ts.map +0 -1
- package/dist/types/src/trait_behaviors.d.ts +0 -38
- package/dist/types/src/trait_behaviors.d.ts.map +0 -1
- package/dist/types/src/virtual_node.d.ts +0 -10
- package/dist/types/src/virtual_node.d.ts.map +0 -1
- package/dist/types/tests/backend/domlike.test.d.ts +0 -2
- package/dist/types/tests/backend/domlike.test.d.ts.map +0 -1
- package/dist/types/tests/base/composed_backend.d.ts +0 -123
- package/dist/types/tests/base/composed_backend.d.ts.map +0 -1
- package/dist/types/tests/base/env.d.ts +0 -30
- package/dist/types/tests/base/env.d.ts.map +0 -1
- package/dist/types/tests/base/match.d.ts +0 -9
- package/dist/types/tests/base/match.d.ts.map +0 -1
- package/dist/types/tests/core/backend.test.d.ts +0 -2
- package/dist/types/tests/core/backend.test.d.ts.map +0 -1
- package/dist/types/tests/core/behavior.test.d.ts +0 -2
- package/dist/types/tests/core/behavior.test.d.ts.map +0 -1
- package/dist/types/tests/core/component_space.test.d.ts +0 -2
- package/dist/types/tests/core/component_space.test.d.ts.map +0 -1
- package/dist/types/tests/core/data_update.test.d.ts +0 -2
- package/dist/types/tests/core/data_update.test.d.ts.map +0 -1
- package/dist/types/tests/core/misc.test.d.ts +0 -2
- package/dist/types/tests/core/misc.test.d.ts.map +0 -1
- package/dist/types/tests/core/placeholder.test.d.ts +0 -2
- package/dist/types/tests/core/placeholder.test.d.ts.map +0 -1
- package/dist/types/tests/core/slot.test.d.ts +0 -2
- package/dist/types/tests/core/slot.test.d.ts.map +0 -1
- package/dist/types/tests/core/trait_behaviors.test.d.ts +0 -2
- package/dist/types/tests/core/trait_behaviors.test.d.ts.map +0 -1
- package/dist/types/tests/tmpl/binding_map.test.d.ts +0 -2
- package/dist/types/tests/tmpl/binding_map.test.d.ts.map +0 -1
- package/dist/types/tests/tmpl/event.test.d.ts +0 -2
- package/dist/types/tests/tmpl/event.test.d.ts.map +0 -1
- package/dist/types/tests/tmpl/expression.test.d.ts +0 -2
- package/dist/types/tests/tmpl/expression.test.d.ts.map +0 -1
- package/dist/types/tests/tmpl/lvalue.test.d.ts +0 -2
- package/dist/types/tests/tmpl/lvalue.test.d.ts.map +0 -1
- package/dist/types/tests/tmpl/native_rendering.test.d.ts +0 -2
- package/dist/types/tests/tmpl/native_rendering.test.d.ts.map +0 -1
- package/dist/types/tests/tmpl/structure.test.d.ts +0 -2
- package/dist/types/tests/tmpl/structure.test.d.ts.map +0 -1
- package/dist/types/tests/types/chaining.test.d.ts +0 -2
- package/dist/types/tests/types/chaining.test.d.ts.map +0 -1
- package/dist/types/tests/types/createElement.test.d.ts +0 -2
- package/dist/types/tests/types/createElement.test.d.ts.map +0 -1
- package/dist/types/tests/types/definition.test.d.ts +0 -2
- package/dist/types/tests/types/definition.test.d.ts.map +0 -1
- package/webpack.config.js +0 -275
- /package/src/backend/{mode.ts → shared.ts} +0 -0
|
@@ -1,365 +0,0 @@
|
|
|
1
|
-
import { MutationObserverTarget } from './mutation_observer';
|
|
2
|
-
import { Event, EventListener, EventListenerOptions, EventOptions, EventTarget } from './event';
|
|
3
|
-
import { ParsedSelector } from './selector';
|
|
4
|
-
import { BackendMode, BoundingClientRect, ScrollOffset, Observer, IntersectionStatus } from './backend/mode';
|
|
5
|
-
import { DataList, PropertyList, MethodList, ComponentInstance } from './component_params';
|
|
6
|
-
import { Node, GeneralBackendContext, GeneralBackendElement, ClassList, NativeNode, VirtualNode, ShadowRoot, ComponentDefinition, NodeCast } from '.';
|
|
7
|
-
/**
|
|
8
|
-
* The "style" attribute and class list segments
|
|
9
|
-
*
|
|
10
|
-
* This allows different modules set the "style" attribute or the class list of an element
|
|
11
|
-
* without overriding each other.
|
|
12
|
-
* The final value is the concat of all segments.
|
|
13
|
-
* When calling `setNodeStyle` or `setNodeClass` on an element,
|
|
14
|
-
* a segment can be specified.
|
|
15
|
-
*/
|
|
16
|
-
export declare const enum StyleSegmentIndex {
|
|
17
|
-
/** The main style segment, generally managed by the template engine (or manually set) */
|
|
18
|
-
MAIN = 0,
|
|
19
|
-
/** The template style segment, preserved for template engine */
|
|
20
|
-
TEMPLATE_EXTRA = 1,
|
|
21
|
-
/** The animation style segment, preserved for temporary transition */
|
|
22
|
-
ANIMATION_EXTRA = 2,
|
|
23
|
-
/** The temporary style segment, preserved for high priority styles */
|
|
24
|
-
TEMP_EXTRA = 3
|
|
25
|
-
}
|
|
26
|
-
export type DoubleLinkedList<T> = {
|
|
27
|
-
value: T;
|
|
28
|
-
prev: DoubleLinkedList<T> | null;
|
|
29
|
-
next: DoubleLinkedList<T> | null;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* A general element
|
|
33
|
-
*
|
|
34
|
-
* An element can be a `NativeNode` , a `Component` , or a `VirtualNode` .
|
|
35
|
-
*/
|
|
36
|
-
export declare class Element implements NodeCast {
|
|
37
|
-
/** @internal */
|
|
38
|
-
_$backendElement: GeneralBackendElement | null;
|
|
39
|
-
/** @internal */
|
|
40
|
-
_$destroyOnDetach: boolean;
|
|
41
|
-
/** @internal */
|
|
42
|
-
_$nodeTreeContext: GeneralBackendContext;
|
|
43
|
-
/** @internal */
|
|
44
|
-
private _$nodeId;
|
|
45
|
-
/** @internal */
|
|
46
|
-
private _$nodeAttributes;
|
|
47
|
-
/** @internal */
|
|
48
|
-
_$nodeSlot: string;
|
|
49
|
-
/** @internal */
|
|
50
|
-
_$slotName: string | null;
|
|
51
|
-
/** @internal */
|
|
52
|
-
_$slotElement: Element | null;
|
|
53
|
-
/** @internal */
|
|
54
|
-
_$slotValues: {
|
|
55
|
-
[name: string]: unknown;
|
|
56
|
-
} | null;
|
|
57
|
-
/** @internal */
|
|
58
|
-
_$subtreeSlotStart: DoubleLinkedList<Element> | null;
|
|
59
|
-
/** @internal */
|
|
60
|
-
_$subtreeSlotEnd: DoubleLinkedList<Element> | null;
|
|
61
|
-
/** @internal */
|
|
62
|
-
_$inheritSlots: boolean;
|
|
63
|
-
/** @internal */
|
|
64
|
-
_$placeholderHandler: (() => void) | undefined;
|
|
65
|
-
/** @internal */
|
|
66
|
-
_$virtual: boolean;
|
|
67
|
-
dataset: {
|
|
68
|
-
[name: string]: unknown;
|
|
69
|
-
};
|
|
70
|
-
/** @internal */
|
|
71
|
-
private _$marks;
|
|
72
|
-
/** @internal */
|
|
73
|
-
private _$attached;
|
|
74
|
-
/** The `ClassList` of the element (will never change and must not be modified!) */
|
|
75
|
-
classList: ClassList | null;
|
|
76
|
-
/** @internal */
|
|
77
|
-
private _$styleSegments;
|
|
78
|
-
/** The parent element (must not be modified directly!) */
|
|
79
|
-
parentNode: Element | null;
|
|
80
|
-
/** The child nodes (must not be modified directly!) */
|
|
81
|
-
childNodes: Node[];
|
|
82
|
-
/** The index in parentNode.childNodes (-1 if no parentNode) (must not be modified directly!) */
|
|
83
|
-
parentIndex: number;
|
|
84
|
-
/** The parent slot element in composed tree (must not be modified directly!) */
|
|
85
|
-
containingSlot: Element | null | undefined;
|
|
86
|
-
/** The slot content nodes composed tree (must not be modified directly!) */
|
|
87
|
-
slotNodes: Node[] | undefined;
|
|
88
|
-
/** The index in containingSlot.slotNodes (must not be modified directly!) */
|
|
89
|
-
slotIndex: number | undefined;
|
|
90
|
-
/** The shadow-root which owns the element (will never change and must not be modified!) */
|
|
91
|
-
ownerShadowRoot: ShadowRoot | null;
|
|
92
|
-
/** @internal */
|
|
93
|
-
_$mutationObserverTarget: MutationObserverTarget | null;
|
|
94
|
-
/** @internal */
|
|
95
|
-
_$eventTarget: EventTarget<{
|
|
96
|
-
[name: string]: unknown;
|
|
97
|
-
}>;
|
|
98
|
-
constructor();
|
|
99
|
-
protected _$initialize(virtual: boolean, backendElement: GeneralBackendElement | null, owner: ShadowRoot | null, nodeTreeContext: GeneralBackendContext): void;
|
|
100
|
-
get $$(): GeneralBackendElement | null;
|
|
101
|
-
get id(): string;
|
|
102
|
-
set id(x: unknown);
|
|
103
|
-
get slot(): string;
|
|
104
|
-
set slot(x: string);
|
|
105
|
-
get attributes(): {
|
|
106
|
-
name: string;
|
|
107
|
-
value: unknown;
|
|
108
|
-
}[];
|
|
109
|
-
get class(): string;
|
|
110
|
-
set class(classNames: string);
|
|
111
|
-
get style(): string;
|
|
112
|
-
set style(styleText: string);
|
|
113
|
-
asTextNode(): null;
|
|
114
|
-
asElement(): Element;
|
|
115
|
-
asNativeNode(): NativeNode | null;
|
|
116
|
-
asVirtualNode(): VirtualNode | null;
|
|
117
|
-
asInstanceOf<UData extends DataList, UProperty extends PropertyList, UMethod extends MethodList>(componentDefinition: ComponentDefinition<UData, UProperty, UMethod>): ComponentInstance<UData, UProperty, UMethod> | null;
|
|
118
|
-
/** Get the backend context */
|
|
119
|
-
getBackendContext(): GeneralBackendContext;
|
|
120
|
-
/** Get the backend mode */
|
|
121
|
-
getBackendMode(): BackendMode;
|
|
122
|
-
/** Get the backend element */
|
|
123
|
-
getBackendElement(): GeneralBackendElement | null;
|
|
124
|
-
/** Destroy the backend element */
|
|
125
|
-
destroyBackendElement(): void;
|
|
126
|
-
/** Destroy the backend element on next detach */
|
|
127
|
-
destroyBackendElementOnDetach(): void;
|
|
128
|
-
/** Cancel destroying backend element on detach */
|
|
129
|
-
cancelDestroyBackendElementOnDetach(): void;
|
|
130
|
-
/** Get whether the node is virtual or not */
|
|
131
|
-
isVirtual(): boolean;
|
|
132
|
-
/** Set the node class */
|
|
133
|
-
setNodeClass(classNames: string, index?: StyleSegmentIndex): void;
|
|
134
|
-
/** Set the node style */
|
|
135
|
-
setNodeStyle(styleSegment: string, index?: StyleSegmentIndex): void;
|
|
136
|
-
private static checkAndCallAttached;
|
|
137
|
-
private static checkAndCallDetached;
|
|
138
|
-
private static checkAndCallMoved;
|
|
139
|
-
private static checkChildObservers;
|
|
140
|
-
/**
|
|
141
|
-
* Get whether a node has any subtree `MutationObserver` attached to it
|
|
142
|
-
*
|
|
143
|
-
* If there is, then tree update may have more performance impact.
|
|
144
|
-
*/
|
|
145
|
-
static hasSubtreeMutationObservers(node: Element): boolean;
|
|
146
|
-
/** @internal */
|
|
147
|
-
static _$insertChildReassignSlot(shadowRoot: ShadowRoot, name: string | null, oldSlot: Element | null, newSlot: Element | null): void;
|
|
148
|
-
/** @internal */
|
|
149
|
-
static insertChildReassign(shadowParent: Element, child: Node, oldSlot: Element | null, newSlot: Element | null, ideaPosIndex: number): void;
|
|
150
|
-
private static findNearestNonVirtual;
|
|
151
|
-
private static countNonVirtual;
|
|
152
|
-
/**
|
|
153
|
-
* Iterate elements with their slots (slots-inherited nodes included)
|
|
154
|
-
*/
|
|
155
|
-
static forEachNodeInSlot(node: Node, f: (node: Node, slot: Element | null | undefined) => boolean | void): boolean;
|
|
156
|
-
/**
|
|
157
|
-
* Iterate elements in specified slot (slots-inherited nodes included)
|
|
158
|
-
*/
|
|
159
|
-
static forEachNodeInSpecificSlot(node: Node, slot: Element | undefined | null, f: (node: Node) => boolean | void): boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Iterate elements with their slots (slots-inherited nodes NOT included)
|
|
162
|
-
*/
|
|
163
|
-
static forEachSlotContentInSlot(node: Node, f: (node: Node, slot: Element | null | undefined) => boolean | void): boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Iterate elements in specified slot (slots-inherited nodes NOT included)
|
|
166
|
-
*/
|
|
167
|
-
static forEachSlotContentInSpecificSlot(node: Node, slot: Element | undefined | null, f: (node: Node) => boolean | void): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* @internal
|
|
170
|
-
* a helper for searching the first non-virtual node
|
|
171
|
-
*/
|
|
172
|
-
private static _$findFirstNonVirtualChild;
|
|
173
|
-
/**
|
|
174
|
-
* @internal
|
|
175
|
-
* A helper to find first non-virtual next sibling node
|
|
176
|
-
* return null if no next sibling exists
|
|
177
|
-
*/
|
|
178
|
-
private static _$findFirstNonVirtualSibling;
|
|
179
|
-
private static insertChildComposed;
|
|
180
|
-
/**
|
|
181
|
-
* @internal
|
|
182
|
-
* @param move whether this insertion is a slot movement
|
|
183
|
-
*/
|
|
184
|
-
private static _$updateSubtreeSlotsInsertion;
|
|
185
|
-
/**
|
|
186
|
-
* @internal
|
|
187
|
-
* @param move whether this removal is a slot movement, will fire an insertion (with move=true) after
|
|
188
|
-
*/
|
|
189
|
-
private static _$updateSubtreeSlotsRemoval;
|
|
190
|
-
/**
|
|
191
|
-
* @internal
|
|
192
|
-
* @param move whether this removal is a slot movement, will fire an insertion (with move=true) after
|
|
193
|
-
*/
|
|
194
|
-
private static _$updateSubtreeSlotsReplacement;
|
|
195
|
-
/** @internal */
|
|
196
|
-
private static _$getParentHostShadowRoot;
|
|
197
|
-
private static insertChildSingleOperation;
|
|
198
|
-
private static insertChildBatchRemoval;
|
|
199
|
-
private static insertChildBatchInsertion;
|
|
200
|
-
private static insertChildPlaceholderReplace;
|
|
201
|
-
appendChild(child: Node): void;
|
|
202
|
-
insertChildAt(child: Node, index: number): void;
|
|
203
|
-
insertBefore(child: Node, before?: Node): void;
|
|
204
|
-
removeChildAt(index: number): void;
|
|
205
|
-
removeChild(child: Node): void;
|
|
206
|
-
replaceChildAt(child: Node, index: number): void;
|
|
207
|
-
replaceChild(child: Node, relChild: Node): void;
|
|
208
|
-
insertChildren(children: Node[], index: number): void;
|
|
209
|
-
removeChildren(index: number, count: number): void;
|
|
210
|
-
selfReplaceWith(replaceWith: Element): void;
|
|
211
|
-
/** @internal */
|
|
212
|
-
protected static _$generateIdMap(node: ShadowRoot): {
|
|
213
|
-
[id: string]: Element;
|
|
214
|
-
};
|
|
215
|
-
/** Trigger an event on the element */
|
|
216
|
-
triggerEvent(name: string, detail?: unknown, options?: EventOptions): void;
|
|
217
|
-
/** Trigger an event with specified event object on the element */
|
|
218
|
-
dispatchEvent(ev: Event<unknown>): void;
|
|
219
|
-
private _$setListenerStats;
|
|
220
|
-
/** Add an event listener on the element */
|
|
221
|
-
addListener(name: string, func: EventListener<unknown>, options?: EventListenerOptions): void;
|
|
222
|
-
/** Remove an event listener on the element */
|
|
223
|
-
removeListener(name: string, func: EventListener<unknown>, options?: EventListenerOptions): void;
|
|
224
|
-
/** Get an attribute value ( `null` if not set or removed) */
|
|
225
|
-
getAttribute(name: string): unknown;
|
|
226
|
-
/** Update an attribute value */
|
|
227
|
-
updateAttribute(name: string, value: unknown): void;
|
|
228
|
-
/** Set an attribute value */
|
|
229
|
-
setAttribute(name: string, value: unknown): void;
|
|
230
|
-
/** Remove an attribute */
|
|
231
|
-
removeAttribute(name: string): void;
|
|
232
|
-
/** Set a dataset on the element */
|
|
233
|
-
setDataset(name: string, value: unknown): void;
|
|
234
|
-
/** Set a mark on the element */
|
|
235
|
-
setMark(name: string, value: unknown): void;
|
|
236
|
-
/**
|
|
237
|
-
* Collect the marks on the element
|
|
238
|
-
*
|
|
239
|
-
* The marks includes the marks on ancestors (in shadow tree) of the element.
|
|
240
|
-
* If multiple marks on different elements shares the same name,
|
|
241
|
-
* the mark value on the child-most element is accepted.
|
|
242
|
-
*/
|
|
243
|
-
collectMarks(): {
|
|
244
|
-
[name: string]: unknown;
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* Attach the element into the backend, swapping out a placeholder element in the backend.
|
|
248
|
-
*
|
|
249
|
-
* The `element` must not be a child node of another element,
|
|
250
|
-
* must not be attached before,
|
|
251
|
-
* and must not have a `ownerShadowRoot` .
|
|
252
|
-
* The `element` `targetParent` and `targetNode` must be in the same backend context.
|
|
253
|
-
* The `element` replaces the `targetNode` in the `targetParent` .
|
|
254
|
-
*/
|
|
255
|
-
static replaceDocumentElement(element: Element, targetParent: GeneralBackendElement, targetNode: GeneralBackendElement): void;
|
|
256
|
-
/**
|
|
257
|
-
* Make the element looks like attached.
|
|
258
|
-
*
|
|
259
|
-
* If the element will never be attached to backend or it has no backend element at all,
|
|
260
|
-
* this can be used to trigger `attached` life-time.
|
|
261
|
-
*/
|
|
262
|
-
static pretendAttached(element: Element): void;
|
|
263
|
-
/**
|
|
264
|
-
* Make the element looks like detached.
|
|
265
|
-
*
|
|
266
|
-
* This can be used to trigger `detached` life-time without remove the element in the backend.
|
|
267
|
-
*/
|
|
268
|
-
static pretendDetached(element: Element): void;
|
|
269
|
-
/** Check the element is attached or not */
|
|
270
|
-
static isAttached(element: Element): boolean;
|
|
271
|
-
/**
|
|
272
|
-
* Set the slot name of the element
|
|
273
|
-
*
|
|
274
|
-
* Once this method is called for an `element` ,
|
|
275
|
-
* it will be treated as a slot which can contain child nodes in composed tree.
|
|
276
|
-
* This method should not be used in components,
|
|
277
|
-
* otherwise the slot content will always be dangled.
|
|
278
|
-
*/
|
|
279
|
-
static setSlotName(element: Element, name?: string): void;
|
|
280
|
-
/**
|
|
281
|
-
* Get the slot name of the element
|
|
282
|
-
*/
|
|
283
|
-
static getSlotName(element: Element): string | undefined;
|
|
284
|
-
/**
|
|
285
|
-
* Set the virtual node to slot-inherit mode
|
|
286
|
-
*
|
|
287
|
-
* In slot-inherit mode of an element,
|
|
288
|
-
* the child nodes of the element will be treated as siblings and can have different target slot.
|
|
289
|
-
*/
|
|
290
|
-
static setInheritSlots(element: Element): void;
|
|
291
|
-
/** Get whether the slot-inherit mode is set or not */
|
|
292
|
-
static getInheritSlots(element: Element): boolean;
|
|
293
|
-
/**
|
|
294
|
-
* Set the binding slot of specific node
|
|
295
|
-
*
|
|
296
|
-
* Necessary if node belongs to a dynamic slot, which cannot be identified by slot name.
|
|
297
|
-
*/
|
|
298
|
-
static setSlotElement(node: Node, slot: Element | null): void;
|
|
299
|
-
/** @internal */
|
|
300
|
-
static _$updateContainingSlot(node: Node, containingSlot: Element | null | undefined): void;
|
|
301
|
-
/** @internal */
|
|
302
|
-
static _$spliceSlotNodes(slot: Element, before: number, deleteCount: number, insertion: Node[] | undefined): void;
|
|
303
|
-
/** @internal */
|
|
304
|
-
static _$findSlotNodeInsertPosition(slot: Element, target: Node, newPosIndex: number): number;
|
|
305
|
-
/** Get composed parent (including virtual nodes) */
|
|
306
|
-
getComposedParent(): Element | null;
|
|
307
|
-
/**
|
|
308
|
-
* Get the composed children
|
|
309
|
-
*
|
|
310
|
-
* This method always returns a new array.
|
|
311
|
-
* It is convenient but less performant.
|
|
312
|
-
* For better performance, consider using `forEachComposedChild` .
|
|
313
|
-
*/
|
|
314
|
-
getComposedChildren(): Node[];
|
|
315
|
-
/**
|
|
316
|
-
* Iterate composed child nodes (including virtual nodes)
|
|
317
|
-
*
|
|
318
|
-
* if `f` returns `false` then the iteration is interrupted.
|
|
319
|
-
* Returns `true` if that happens.
|
|
320
|
-
*/
|
|
321
|
-
forEachComposedChild(f: (node: Node) => boolean | void): boolean;
|
|
322
|
-
/**
|
|
323
|
-
* Iterate non-virtual composed child nodes
|
|
324
|
-
*
|
|
325
|
-
* if `f` returns `false` then the iteration is interrupted.
|
|
326
|
-
* Returns `true` if that happens.
|
|
327
|
-
*/
|
|
328
|
-
forEachNonVirtualComposedChild(f: (node: Node) => boolean | void): boolean;
|
|
329
|
-
/** Parse a selector string so that it can be used multiple queries */
|
|
330
|
-
static parseSelector(str: string): ParsedSelector;
|
|
331
|
-
/** Select the first descendant which matches the selector */
|
|
332
|
-
querySelector(selectorStr: string | ParsedSelector): Element | null;
|
|
333
|
-
/** Select all descendants which matches the selector */
|
|
334
|
-
querySelectorAll(selectorStr: string | ParsedSelector): Element[];
|
|
335
|
-
/** Test whether the target matches the selector */
|
|
336
|
-
static matchSelector(selectorStr: string | ParsedSelector, target: Element): boolean;
|
|
337
|
-
/** Test whether the target in this subtree matches the selector */
|
|
338
|
-
matchSelector(selectorStr: string | ParsedSelector, target: Element): boolean;
|
|
339
|
-
/**
|
|
340
|
-
* Get the bounding client rect
|
|
341
|
-
*
|
|
342
|
-
* Return zero values when the backend element is invalid or it does not have layout information.
|
|
343
|
-
*/
|
|
344
|
-
getBoundingClientRect(cb: (res: BoundingClientRect) => void): void;
|
|
345
|
-
/**
|
|
346
|
-
* Get the bounding client rect
|
|
347
|
-
*
|
|
348
|
-
* Return zero values when the backend element is invalid or it does not have layout information.
|
|
349
|
-
*/
|
|
350
|
-
getScrollOffset(cb: (res: ScrollOffset) => void): void;
|
|
351
|
-
/**
|
|
352
|
-
* Create an intersection observer
|
|
353
|
-
*
|
|
354
|
-
* The `relativeElement` is the element to calculate intersection with ( `null` for the viewport).
|
|
355
|
-
* The `relativeElementMargin` is the margins of the `relativeElement` .
|
|
356
|
-
* The `thresholds` is a list of intersection ratios to trigger the `listener` .
|
|
357
|
-
* The listener always triggers once immediately after this call.
|
|
358
|
-
*/
|
|
359
|
-
createIntersectionObserver(relativeElement: Element | null, relativeElementMargin: string, thresholds: number[], listener: (res: IntersectionStatus) => void): Observer | null;
|
|
360
|
-
/**
|
|
361
|
-
* Get an interactive context
|
|
362
|
-
*/
|
|
363
|
-
getContext(cb: (res: unknown) => void): void;
|
|
364
|
-
}
|
|
365
|
-
//# sourceMappingURL=element.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../../../src/element.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8B,sBAAsB,EAAE,MA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0B,CACxB,eAAe,EAAE,OAAO,GAAG,IAAI,EAC/B,qBAAqB,EAAE,MAAM,EAC7B,UAAU,EAAE,MAAM,EAAE,EACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,GAC1C,QAAQ,GAAG,IAAI;IAyBlB;;OAEG;IACH,UAAU,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,GAAG,IAAI;CAY7C"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Node } from './node';
|
|
2
|
-
/** The iterator direction and order */
|
|
3
|
-
export declare const enum ElementIteratorType {
|
|
4
|
-
/** Iterate all ancestors in shadow tree */
|
|
5
|
-
ShadowAncestors = "shadow-ancestors",
|
|
6
|
-
/** Iterate all ancestors in composed tree */
|
|
7
|
-
ComposedAncestors = "composed-ancestors",
|
|
8
|
-
/** Iterate all descendants in shadow tree, returning parents before their children */
|
|
9
|
-
ShadowDescendantsRootFirst = "shadow-descendants-root-first",
|
|
10
|
-
/** Iterate all descendants in shadow tree, returning parents after their children */
|
|
11
|
-
ShadowDescendantsRootLast = "shadow-descendants-root-last",
|
|
12
|
-
/** Iterate all descendants in composed tree, returning parents before their children */
|
|
13
|
-
ComposedDescendantsRootFirst = "composed-descendants-root-first",
|
|
14
|
-
/** Iterate all descendants in composed tree, returning parents after their children */
|
|
15
|
-
ComposedDescendantsRootLast = "composed-descendants-root-last"
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* An iterator for node tree traversal
|
|
19
|
-
*
|
|
20
|
-
* This iterator is convenient but seems a little slower.
|
|
21
|
-
*/
|
|
22
|
-
export declare class ElementIterator {
|
|
23
|
-
private _$node;
|
|
24
|
-
private _$nodeTypeLimit;
|
|
25
|
-
private _$composed;
|
|
26
|
-
private _$isAncestor;
|
|
27
|
-
private _$rootFirst;
|
|
28
|
-
/**
|
|
29
|
-
* Create an iterator with type specified
|
|
30
|
-
*
|
|
31
|
-
* The `nodeTypeLimit` is used to limit which kind of nodes will be returned.
|
|
32
|
-
* It limits the returned result by an `instanceof` call.
|
|
33
|
-
* The default value is `Element` ,
|
|
34
|
-
* which means only elements will be returned (text nodes will not).
|
|
35
|
-
* Consider specifying `Node` if text nodes need to be returned as well as elements.
|
|
36
|
-
* Specify `Component` will only return components.
|
|
37
|
-
*/
|
|
38
|
-
constructor(node: Node, type: ElementIteratorType, nodeTypeLimit?: unknown);
|
|
39
|
-
/** Same as constructor (for backward compatibility) */
|
|
40
|
-
static create(node: Node, type: ElementIteratorType, nodeTypeLimit?: unknown): ElementIterator;
|
|
41
|
-
forEach(f: (node: Node) => boolean): void;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=element_iterator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"element_iterator.d.ts","sourceRoot":"","sources":["../../../src/element_iterator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,uCAAuC;AACvC,0BAAkB,mBAAmB;IACnC,2CAA2C;IAC3C,eAAe,qBAAqB;IACpC,6CAA6C;IAC7C,iBAAiB,uBAAuB;IACxC,sFAAsF;IACtF,0BAA0B,kCAAkC;IAC5D,qFAAqF;IACrF,yBAAyB,iCAAiC;IAC1D,wFAAwF;IACxF,4BAA4B,oCAAoC;IAChE,uFAAuF;IACvF,2BAA2B,mCAAmC;CAC/D;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAM;IACpB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,WAAW,CAAS;IAE5B;;;;;;;;;OASG;gBACS,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,aAAa,GAAE,OAAiB;IAuCnF,uDAAuD;IACvD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,aAAa,CAAC,EAAE,OAAO,GAAG,eAAe;IAI9F,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO;CAoDnC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { FuncArrWithMeta } from './func_arr';
|
|
2
|
-
import { Element, GeneralComponent, GeneralBackendElement } from '.';
|
|
3
|
-
/**
|
|
4
|
-
* Options for an event
|
|
5
|
-
*/
|
|
6
|
-
export type EventOptions = {
|
|
7
|
-
originalEvent?: unknown;
|
|
8
|
-
bubbles?: boolean;
|
|
9
|
-
composed?: boolean;
|
|
10
|
-
capturePhase?: boolean;
|
|
11
|
-
extraFields?: {
|
|
12
|
-
[key: string]: unknown;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Options for an event listener
|
|
17
|
-
*/
|
|
18
|
-
export type EventListenerOptions = {
|
|
19
|
-
/** Always stop bubbling after this listener */
|
|
20
|
-
final?: boolean;
|
|
21
|
-
/** Mark mutated after this listener (ignored if `final` is true) */
|
|
22
|
-
mutated?: boolean;
|
|
23
|
-
/** Listen in the capture phase */
|
|
24
|
-
capture?: boolean;
|
|
25
|
-
/** The same as `capture` for compatibility */
|
|
26
|
-
useCapture?: boolean;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Event bubbling control
|
|
30
|
-
*/
|
|
31
|
-
export declare const enum EventBubbleStatus {
|
|
32
|
-
Normal = 0,
|
|
33
|
-
NoDefault = 1
|
|
34
|
-
}
|
|
35
|
-
export type EventListener<TDetail> = (ev: ShadowedEvent<TDetail>) => boolean | void;
|
|
36
|
-
export declare const enum MutLevel {
|
|
37
|
-
None = 0,
|
|
38
|
-
Mut = 1,
|
|
39
|
-
Final = 2
|
|
40
|
-
}
|
|
41
|
-
type EventFuncArr<TDetail> = {
|
|
42
|
-
mutCount: number;
|
|
43
|
-
finalCount: number;
|
|
44
|
-
funcArr: FuncArrWithMeta<EventListener<TDetail>, MutLevel>;
|
|
45
|
-
};
|
|
46
|
-
export declare const enum FinalChanged {
|
|
47
|
-
NotChanged = 0,
|
|
48
|
-
Failed = 1,
|
|
49
|
-
None = 2,
|
|
50
|
-
Final = 3,
|
|
51
|
-
Mut = 4
|
|
52
|
-
}
|
|
53
|
-
/** The target of an event */
|
|
54
|
-
export declare class EventTarget<TEvents extends {
|
|
55
|
-
[type: string]: unknown;
|
|
56
|
-
}> {
|
|
57
|
-
listeners: { [T in keyof TEvents]: EventFuncArr<TEvents[T]>; };
|
|
58
|
-
captureListeners: {
|
|
59
|
-
[T in keyof TEvents]: EventFuncArr<TEvents[T]>;
|
|
60
|
-
} | null;
|
|
61
|
-
addListener<T extends string>(name: T, func: EventListener<TEvents[T]>, options?: EventListenerOptions): FinalChanged;
|
|
62
|
-
removeListener<T extends string>(name: T, func: EventListener<TEvents[T]>, options?: EventListenerOptions): FinalChanged;
|
|
63
|
-
}
|
|
64
|
-
export type ShadowedEvent<TDetail> = Required<Event<TDetail>> & {
|
|
65
|
-
target: Element;
|
|
66
|
-
mark: {
|
|
67
|
-
[name: string]: unknown;
|
|
68
|
-
} | null;
|
|
69
|
-
currentTarget: Element;
|
|
70
|
-
};
|
|
71
|
-
export declare class Event<TDetail> {
|
|
72
|
-
type: string;
|
|
73
|
-
timeStamp: number;
|
|
74
|
-
detail: TDetail;
|
|
75
|
-
bubbles: boolean;
|
|
76
|
-
composed: boolean;
|
|
77
|
-
/** @internal */
|
|
78
|
-
private _$capturePhase;
|
|
79
|
-
/** @internal */
|
|
80
|
-
private _$originalEvent;
|
|
81
|
-
/** @internal */
|
|
82
|
-
private _$dispatched;
|
|
83
|
-
/** @internal */
|
|
84
|
-
private _$eventBubblingControl;
|
|
85
|
-
constructor(name: string, detail: TDetail, options?: EventOptions);
|
|
86
|
-
getEventBubbleStatus(): EventBubbleStatus;
|
|
87
|
-
wrapShadowedEvent(targetCaller: Element, mark: {
|
|
88
|
-
[name: string]: unknown;
|
|
89
|
-
} | null, currentTargetCaller: Element): ShadowedEvent<TDetail>;
|
|
90
|
-
getOriginalEvent(): unknown;
|
|
91
|
-
preventDefault(): void;
|
|
92
|
-
defaultPrevented(): boolean;
|
|
93
|
-
stopPropagation(): void;
|
|
94
|
-
propagationStopped(): boolean;
|
|
95
|
-
markMutated(): void;
|
|
96
|
-
mutatedMarked(): boolean;
|
|
97
|
-
callListener(currentTarget: Element, mark: Record<string, unknown> | null, target: Element, isCapture: boolean): void;
|
|
98
|
-
dispatch(target: Element, externalTarget?: GeneralBackendElement): void;
|
|
99
|
-
static dispatchEvent<TDetail>(target: Element, event: Event<TDetail>): void;
|
|
100
|
-
static dispatchExternalEvent<TDetail>(component: GeneralComponent, target: GeneralBackendElement, event: Event<TDetail>): void;
|
|
101
|
-
static triggerEvent<TDetail>(this: void, target: Element, name: string, detail: TDetail, options?: EventOptions): void;
|
|
102
|
-
static triggerExternalEvent<TDetail>(this: void, component: GeneralComponent, target: GeneralBackendElement, name: string, detail: TDetail, options?: EventOptions): void;
|
|
103
|
-
}
|
|
104
|
-
export {};
|
|
105
|
-
//# sourceMappingURL=event.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EACL,OAAO,EAEP,gBAAgB,EAEhB,qBAAqB,EAEtB,MAAM,GAAG,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;CACzC,CAAA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AE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACpC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,OAAO;IAiCpB,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,EAAE,qBAAqB;IAqFhE,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;IAIpE,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAClC,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,qBAAqB,EAC7B,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;IAKvB,MAAM,CAAC,YAAY,CAAC,OAAO,EACzB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,YAAY;IAMxB,MAAM,CAAC,oBAAoB,CAAC,OAAO,EACjC,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,qBAAqB,EAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,YAAY;CAKzB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Event, ShadowedEvent } from './event';
|
|
2
|
-
import { GeneralBackendElement } from './node';
|
|
3
|
-
/**
|
|
4
|
-
* An external shadow root
|
|
5
|
-
*
|
|
6
|
-
* It can be used to build an external component.
|
|
7
|
-
* External component is a customizable subtree that can be composed with normal components.
|
|
8
|
-
* It allows third-party frameworks to render a subtree and then compose it together.
|
|
9
|
-
* However, the subtree must be created in the same backend context.
|
|
10
|
-
*/
|
|
11
|
-
export interface ExternalShadowRoot {
|
|
12
|
-
root: GeneralBackendElement;
|
|
13
|
-
slot: GeneralBackendElement;
|
|
14
|
-
getIdMap(): {
|
|
15
|
-
[id: string]: GeneralBackendElement;
|
|
16
|
-
};
|
|
17
|
-
handleEvent<T>(target: GeneralBackendElement, event: Event<T>): void;
|
|
18
|
-
setListener<T>(elem: GeneralBackendElement, ev: string, listener: (event: ShadowedEvent<T>) => unknown): void;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=external_shadow_tree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"external_shadow_tree.d.ts","sourceRoot":"","sources":["../../../src/external_shadow_tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,IAAI,EAAE,qBAAqB,CAAA;IAC3B,QAAQ,IAAI;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,qBAAqB,CAAA;KAAE,CAAA;IACnD,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;IACpE,WAAW,CAAC,CAAC,EACX,IAAI,EAAE,qBAAqB,EAC3B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,OAAO,GAC7C,IAAI,CAAA;CACR"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { GeneralComponent } from '.';
|
|
2
|
-
export type GeneralFuncType = (this: any, ...args: any[]) => any;
|
|
3
|
-
type ErrorInfo = {
|
|
4
|
-
message: string;
|
|
5
|
-
type: string;
|
|
6
|
-
element: unknown;
|
|
7
|
-
method: unknown;
|
|
8
|
-
args: unknown[];
|
|
9
|
-
};
|
|
10
|
-
export declare class FuncArr<F extends GeneralFuncType> {
|
|
11
|
-
empty: boolean;
|
|
12
|
-
private _$type;
|
|
13
|
-
private _$arr;
|
|
14
|
-
_$avoidErrorHandler: boolean;
|
|
15
|
-
add(func: F): void;
|
|
16
|
-
remove(func: F): F | null;
|
|
17
|
-
call(caller: ThisType<F>, args: Parameters<F>, relatedComponent?: GeneralComponent): boolean;
|
|
18
|
-
static safeCallback<F extends GeneralFuncType>(this: void, type: string, method: F, caller: ThisType<F>, args: Parameters<F>, relatedComponent?: GeneralComponent, avoidErrorHandler?: boolean): ReturnType<F> | undefined;
|
|
19
|
-
static addGlobalErrorListener(this: void, func: (err: Error, info: ErrorInfo) => boolean): void;
|
|
20
|
-
static removeGlobalErrorListener(this: void, func: (err: Error, info: ErrorInfo) => boolean): void;
|
|
21
|
-
static addGlobalWarningListener(this: void, func: (msg: string) => void): void;
|
|
22
|
-
static removeGlobalWarningListener(this: void, func: (msg: string) => void): void;
|
|
23
|
-
}
|
|
24
|
-
export declare function triggerWarning(msg: string): void;
|
|
25
|
-
export declare class FuncArrWithMeta<F extends GeneralFuncType, T> {
|
|
26
|
-
empty: boolean;
|
|
27
|
-
private _$type;
|
|
28
|
-
private _$arr;
|
|
29
|
-
add(func: F, data: T): void;
|
|
30
|
-
remove(func: F): T | null;
|
|
31
|
-
call(caller: ThisType<F>, args: Parameters<F>, retainFn: (data: T) => boolean, relatedComponent?: GeneralComponent): boolean;
|
|
32
|
-
}
|
|
33
|
-
export declare const safeCallback: typeof FuncArr.safeCallback;
|
|
34
|
-
export declare const addGlobalErrorListener: typeof FuncArr.addGlobalErrorListener;
|
|
35
|
-
export declare const removeGlobalErrorListener: typeof FuncArr.removeGlobalErrorListener;
|
|
36
|
-
export declare const addGlobalWarningListener: typeof FuncArr.addGlobalWarningListener;
|
|
37
|
-
export declare const removeGlobalWarningListener: typeof FuncArr.removeGlobalWarningListener;
|
|
38
|
-
export {};
|
|
39
|
-
//# sourceMappingURL=func_arr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"func_arr.d.ts","sourceRoot":"","sources":["../../../src/func_arr.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