@thienvu18/designable-shared 2.0.1 → 2.0.2
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/esm/animation.d.ts +8 -2
- package/esm/animation.js +29 -30
- package/esm/array.d.ts +163 -37
- package/esm/array.js +104 -87
- package/esm/clone.d.ts +4 -4
- package/esm/clone.js +79 -86
- package/esm/compose.d.ts +3 -1
- package/esm/compose.js +6 -6
- package/esm/coordinate.d.ts +120 -76
- package/esm/coordinate.js +480 -411
- package/esm/element.d.ts +11 -6
- package/esm/element.js +123 -125
- package/esm/event.d.ts +162 -75
- package/esm/event.js +197 -197
- package/esm/globalThisPolyfill.d.ts +1 -1
- package/esm/globalThisPolyfill.js +14 -17
- package/esm/index.d.ts +17 -17
- package/esm/index.js +17 -17
- package/esm/instanceof.d.ts +1 -1
- package/esm/instanceof.js +9 -10
- package/esm/keycode.d.ts +145 -145
- package/esm/keycode.js +149 -149
- package/esm/lru.d.ts +50 -47
- package/esm/lru.js +236 -245
- package/esm/observer.d.ts +7 -7
- package/esm/observer.js +37 -40
- package/esm/request-idle.d.ts +9 -6
- package/esm/request-idle.js +6 -6
- package/esm/scroller.d.ts +24 -8
- package/esm/scroller.js +78 -75
- package/esm/subscribable.d.ts +10 -10
- package/esm/subscribable.js +39 -40
- package/esm/types.d.ts +13 -13
- package/esm/types.js +19 -20
- package/esm/uid.d.ts +1 -1
- package/esm/uid.js +7 -7
- package/lib/animation.d.ts +8 -2
- package/lib/animation.js +34 -35
- package/lib/array.d.ts +163 -37
- package/lib/array.js +129 -101
- package/lib/clone.d.ts +4 -4
- package/lib/clone.js +84 -91
- package/lib/compose.d.ts +3 -1
- package/lib/compose.js +10 -10
- package/lib/coordinate.d.ts +120 -76
- package/lib/coordinate.js +538 -440
- package/lib/element.d.ts +11 -6
- package/lib/element.js +139 -133
- package/lib/event.d.ts +162 -75
- package/lib/event.js +206 -202
- package/lib/globalThisPolyfill.d.ts +1 -1
- package/lib/globalThisPolyfill.js +17 -20
- package/lib/index.d.ts +17 -17
- package/lib/index.js +49 -33
- package/lib/instanceof.d.ts +1 -1
- package/lib/instanceof.js +13 -14
- package/lib/keycode.d.ts +145 -145
- package/lib/keycode.js +153 -153
- package/lib/lru.d.ts +50 -47
- package/lib/lru.js +240 -249
- package/lib/observer.d.ts +7 -7
- package/lib/observer.js +41 -44
- package/lib/request-idle.d.ts +9 -6
- package/lib/request-idle.js +14 -11
- package/lib/scroller.d.ts +24 -8
- package/lib/scroller.js +89 -81
- package/lib/subscribable.d.ts +10 -10
- package/lib/subscribable.js +43 -44
- package/lib/types.d.ts +13 -13
- package/lib/types.js +40 -28
- package/lib/uid.d.ts +1 -1
- package/lib/uid.js +11 -11
- package/package.json +1 -1
package/esm/element.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { Point } from './coordinate'
|
|
2
|
-
export declare const calcElementOuterWidth: (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const
|
|
1
|
+
import { Point } from './coordinate'
|
|
2
|
+
export declare const calcElementOuterWidth: (
|
|
3
|
+
innerWidth: number,
|
|
4
|
+
style: CSSStyleDeclaration
|
|
5
|
+
) => number
|
|
6
|
+
export declare const calcElementLayout: (
|
|
7
|
+
element: Element
|
|
8
|
+
) => 'vertical' | 'horizontal'
|
|
9
|
+
export declare const calcElementTranslate: (element: HTMLElement) => Point
|
|
10
|
+
export declare const calcElementRotate: (element: HTMLElement) => number
|
|
11
|
+
export declare const calcElementScale: (element: HTMLElement) => number
|
package/esm/element.js
CHANGED
|
@@ -1,135 +1,133 @@
|
|
|
1
|
-
import { Point } from './coordinate'
|
|
1
|
+
import { Point } from './coordinate'
|
|
2
2
|
const InlineLayoutTagNames = new Set([
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
])
|
|
3
|
+
'A',
|
|
4
|
+
'ABBR',
|
|
5
|
+
'ACRONYM',
|
|
6
|
+
'AUDIO',
|
|
7
|
+
'B',
|
|
8
|
+
'BDI',
|
|
9
|
+
'BDO',
|
|
10
|
+
'BIG',
|
|
11
|
+
'BR',
|
|
12
|
+
'BUTTON',
|
|
13
|
+
'CANVAS',
|
|
14
|
+
'CITE',
|
|
15
|
+
'CODE',
|
|
16
|
+
'DATA',
|
|
17
|
+
'DATALIST',
|
|
18
|
+
'DEL',
|
|
19
|
+
'DFN',
|
|
20
|
+
'EM',
|
|
21
|
+
'EMBED',
|
|
22
|
+
'I',
|
|
23
|
+
'IFRAME',
|
|
24
|
+
'IMG',
|
|
25
|
+
'INS',
|
|
26
|
+
'KBD',
|
|
27
|
+
'LABEL',
|
|
28
|
+
'MAP',
|
|
29
|
+
'MARK',
|
|
30
|
+
'METER',
|
|
31
|
+
'NOSCRIPT',
|
|
32
|
+
'OBJECT',
|
|
33
|
+
'OUTPUT',
|
|
34
|
+
'PICTURE',
|
|
35
|
+
'PROGRESS',
|
|
36
|
+
'Q',
|
|
37
|
+
'RUBY',
|
|
38
|
+
'S',
|
|
39
|
+
'SAMP',
|
|
40
|
+
'SELECT',
|
|
41
|
+
'SLOT',
|
|
42
|
+
'SMALL',
|
|
43
|
+
'STRONG',
|
|
44
|
+
'SUB',
|
|
45
|
+
'SUP',
|
|
46
|
+
'SVG',
|
|
47
|
+
'TEMPLATE',
|
|
48
|
+
'TEXTAREA',
|
|
49
|
+
'TIME',
|
|
50
|
+
'U',
|
|
51
|
+
'TT',
|
|
52
|
+
'VAR',
|
|
53
|
+
'VIDEO',
|
|
54
|
+
'WBR',
|
|
55
|
+
'INPUT',
|
|
56
|
+
'SPAN',
|
|
57
|
+
])
|
|
58
58
|
export const calcElementOuterWidth = (innerWidth, style) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
return (
|
|
60
|
+
innerWidth +
|
|
61
|
+
parseFloat(style.marginLeft) +
|
|
62
|
+
parseFloat(style.marginRight) +
|
|
63
|
+
parseFloat(style.paddingLeft) +
|
|
64
|
+
parseFloat(style.paddingRight) +
|
|
65
|
+
parseFloat(style.borderLeftWidth) +
|
|
66
|
+
parseFloat(style.borderRightWidth)
|
|
67
|
+
)
|
|
68
|
+
}
|
|
67
69
|
export const calcElementLayout = (element) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
if (!element) return 'vertical'
|
|
71
|
+
const parent = element.parentElement
|
|
72
|
+
if (!parent) return 'vertical'
|
|
73
|
+
const tagName = element.tagName
|
|
74
|
+
const parentTagName = parent.tagName
|
|
75
|
+
const style = getComputedStyle(element)
|
|
76
|
+
const parentStyle = getComputedStyle(parent)
|
|
77
|
+
const isNotFullWidth = () => {
|
|
78
|
+
const innerWidth = element.getBoundingClientRect().width
|
|
79
|
+
const outerWidth = calcElementOuterWidth(innerWidth, style)
|
|
80
|
+
const parentInnerWidth = parent.getBoundingClientRect().width
|
|
81
|
+
return outerWidth.toFixed(0) < parentInnerWidth.toFixed(0)
|
|
82
|
+
}
|
|
83
|
+
if (tagName === 'TH' || tagName === 'TD') {
|
|
84
|
+
if (parentTagName === 'TR') return 'horizontal'
|
|
85
|
+
}
|
|
86
|
+
if (parentStyle.display === 'flex' && parentStyle.flexDirection === 'row')
|
|
87
|
+
return 'horizontal'
|
|
88
|
+
if (parentStyle.display === 'grid') {
|
|
89
|
+
if (isNotFullWidth()) {
|
|
90
|
+
return 'horizontal'
|
|
86
91
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (
|
|
92
|
+
}
|
|
93
|
+
if (InlineLayoutTagNames.has(tagName)) {
|
|
94
|
+
if (style.display === 'block') {
|
|
95
|
+
if (style.float === 'left' || style.float === 'right') {
|
|
90
96
|
if (isNotFullWidth()) {
|
|
91
|
-
|
|
97
|
+
return 'horizontal'
|
|
92
98
|
}
|
|
99
|
+
}
|
|
100
|
+
return 'vertical'
|
|
93
101
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (isNotFullWidth()) {
|
|
98
|
-
return 'horizontal';
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return 'vertical';
|
|
102
|
-
}
|
|
103
|
-
return 'horizontal';
|
|
104
|
-
}
|
|
105
|
-
};
|
|
102
|
+
return 'horizontal'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
106
105
|
export const calcElementTranslate = (element) => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
106
|
+
const transform = element?.style?.transform
|
|
107
|
+
if (transform) {
|
|
108
|
+
const [x, y] = transform
|
|
109
|
+
.match(
|
|
110
|
+
/translate(?:3d)?\(\s*([-\d.]+)[a-z]+?[\s,]+([-\d.]+)[a-z]+?(?:[\s,]+([-\d.]+))?[a-z]+?\s*\)/
|
|
111
|
+
)
|
|
112
|
+
?.slice(1, 3) ?? [0, 0]
|
|
113
|
+
return new Point(Number(x), Number(y))
|
|
114
|
+
} else {
|
|
115
|
+
return new Point(Number(element.offsetLeft), Number(element.offsetTop))
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
118
|
export const calcElementRotate = (element) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
};
|
|
119
|
+
const transform = element?.style?.transform
|
|
120
|
+
if (transform) {
|
|
121
|
+
return Number(transform.match(/rotate\(\s*([-\d.]+)/)?.[1] ?? 0)
|
|
122
|
+
} else {
|
|
123
|
+
return 0
|
|
124
|
+
}
|
|
125
|
+
}
|
|
127
126
|
export const calcElementScale = (element) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
127
|
+
const transform = element?.style?.transform
|
|
128
|
+
if (transform) {
|
|
129
|
+
return Number(transform.match(/scale\(\s*([-\d.]+)/)?.[1] ?? 0)
|
|
130
|
+
} else {
|
|
131
|
+
return 0
|
|
132
|
+
}
|
|
133
|
+
}
|
package/esm/event.d.ts
CHANGED
|
@@ -1,96 +1,183 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type EventOptions =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ISubscriber, Subscribable } from './subscribable'
|
|
2
|
+
export type EventOptions =
|
|
3
|
+
| boolean
|
|
4
|
+
| (AddEventListenerOptions &
|
|
5
|
+
EventListenerOptions & {
|
|
6
|
+
mode?: 'onlyOne' | 'onlyParent' | 'onlyChild'
|
|
7
|
+
})
|
|
8
|
+
export type EventContainer = Window | HTMLElement | HTMLDocument
|
|
9
|
+
export type EventDriverContainer = HTMLElement | HTMLDocument
|
|
7
10
|
export interface IEventEffect<T> {
|
|
8
|
-
|
|
11
|
+
(engine: T): void
|
|
9
12
|
}
|
|
10
13
|
export interface IEventDriver {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
container: EventDriverContainer
|
|
15
|
+
contentWindow: Window
|
|
16
|
+
attach(container: EventDriverContainer): void
|
|
17
|
+
detach(container: EventDriverContainer): void
|
|
18
|
+
dispatch<T extends ICustomEvent<any> = any>(event: T): void | boolean
|
|
19
|
+
subscribe<T extends ICustomEvent<any> = any>(subscriber: ISubscriber<T>): void
|
|
20
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
21
|
+
type: K,
|
|
22
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
23
|
+
options?: boolean | EventOptions
|
|
24
|
+
): void
|
|
25
|
+
addEventListener(
|
|
26
|
+
type: string,
|
|
27
|
+
listener: EventListenerOrEventListenerObject,
|
|
28
|
+
options?: boolean | EventOptions
|
|
29
|
+
): void
|
|
30
|
+
addEventListener(type: any, listener: any, options: any): void
|
|
31
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(
|
|
32
|
+
type: K,
|
|
33
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
34
|
+
options?: boolean | EventOptions
|
|
35
|
+
): void
|
|
36
|
+
removeEventListener(
|
|
37
|
+
type: string,
|
|
38
|
+
listener: EventListenerOrEventListenerObject,
|
|
39
|
+
options?: boolean | EventOptions
|
|
40
|
+
): void
|
|
41
|
+
removeEventListener(type: any, listener: any, options?: any): void
|
|
42
|
+
batchAddEventListener<K extends keyof HTMLElementEventMap>(
|
|
43
|
+
type: K,
|
|
44
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
45
|
+
options?: boolean | EventOptions
|
|
46
|
+
): void
|
|
47
|
+
batchAddEventListener(
|
|
48
|
+
type: string,
|
|
49
|
+
listener: EventListenerOrEventListenerObject,
|
|
50
|
+
options?: boolean | EventOptions
|
|
51
|
+
): void
|
|
52
|
+
batchAddEventListener(type: any, listener: any, options?: any): void
|
|
53
|
+
batchRemoveEventListener<K extends keyof HTMLElementEventMap>(
|
|
54
|
+
type: K,
|
|
55
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
56
|
+
options?: boolean | EventOptions
|
|
57
|
+
): void
|
|
58
|
+
batchRemoveEventListener(
|
|
59
|
+
type: string,
|
|
60
|
+
listener: EventListenerOrEventListenerObject,
|
|
61
|
+
options?: boolean | EventOptions
|
|
62
|
+
): void
|
|
63
|
+
batchRemoveEventListener(type: any, listener: any, options: any): void
|
|
29
64
|
}
|
|
30
65
|
export interface IEventDriverClass<T> {
|
|
31
|
-
|
|
66
|
+
new (engine: T, context?: any): IEventDriver
|
|
32
67
|
}
|
|
33
68
|
export interface ICustomEvent<EventData = any, EventContext = any> {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
69
|
+
type: string
|
|
70
|
+
data?: EventData
|
|
71
|
+
context?: EventContext
|
|
37
72
|
}
|
|
38
73
|
export interface CustomEventClass {
|
|
39
|
-
|
|
74
|
+
new (...args: any[]): any
|
|
40
75
|
}
|
|
41
76
|
export interface IEventProps<T = Event> {
|
|
42
|
-
|
|
43
|
-
|
|
77
|
+
drivers?: IEventDriverClass<T>[]
|
|
78
|
+
effects?: IEventEffect<T>[]
|
|
44
79
|
}
|
|
45
80
|
/**
|
|
46
81
|
* 事件驱动器基类
|
|
47
82
|
*/
|
|
48
|
-
export declare class EventDriver<Engine extends Event = Event, Context = any>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
export declare class EventDriver<Engine extends Event = Event, Context = any>
|
|
84
|
+
implements IEventDriver
|
|
85
|
+
{
|
|
86
|
+
engine: Engine
|
|
87
|
+
container: EventDriverContainer
|
|
88
|
+
contentWindow: Window
|
|
89
|
+
context: Context
|
|
90
|
+
constructor(engine: Engine, context?: Context)
|
|
91
|
+
dispatch<T extends ICustomEvent<any> = any>(event: T): boolean
|
|
92
|
+
subscribe<T extends ICustomEvent<any> = any>(
|
|
93
|
+
subscriber: ISubscriber<T>
|
|
94
|
+
): {
|
|
95
|
+
(): void
|
|
96
|
+
[UNSUBSCRIBE_ID_SYMBOL]: number
|
|
97
|
+
}
|
|
98
|
+
subscribeTo<T extends CustomEventClass>(
|
|
99
|
+
type: T,
|
|
100
|
+
subscriber: ISubscriber<InstanceType<T>>
|
|
101
|
+
): {
|
|
102
|
+
(): void
|
|
103
|
+
[UNSUBSCRIBE_ID_SYMBOL]: number
|
|
104
|
+
}
|
|
105
|
+
subscribeWith<T extends ICustomEvent = ICustomEvent>(
|
|
106
|
+
type: string | string[],
|
|
107
|
+
subscriber: ISubscriber<T>
|
|
108
|
+
): {
|
|
109
|
+
(): void
|
|
110
|
+
[UNSUBSCRIBE_ID_SYMBOL]: number
|
|
111
|
+
}
|
|
112
|
+
attach(container: EventDriverContainer): void
|
|
113
|
+
detach(container: EventDriverContainer): void
|
|
114
|
+
eventTarget(type: string): Window | EventDriverContainer
|
|
115
|
+
addEventListener<K extends keyof HTMLElementEventMap>(
|
|
116
|
+
type: K,
|
|
117
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
118
|
+
options?: boolean | EventOptions
|
|
119
|
+
): void
|
|
120
|
+
addEventListener(
|
|
121
|
+
type: string,
|
|
122
|
+
listener: EventListenerOrEventListenerObject,
|
|
123
|
+
options?: boolean | EventOptions
|
|
124
|
+
): void
|
|
125
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(
|
|
126
|
+
type: K,
|
|
127
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
128
|
+
options?: boolean | EventOptions
|
|
129
|
+
): void
|
|
130
|
+
removeEventListener(
|
|
131
|
+
type: string,
|
|
132
|
+
listener: EventListenerOrEventListenerObject,
|
|
133
|
+
options?: boolean | EventOptions
|
|
134
|
+
): void
|
|
135
|
+
batchAddEventListener<K extends keyof HTMLElementEventMap>(
|
|
136
|
+
type: K,
|
|
137
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
138
|
+
options?: boolean | EventOptions
|
|
139
|
+
): void
|
|
140
|
+
batchAddEventListener(
|
|
141
|
+
type: string,
|
|
142
|
+
listener: EventListenerOrEventListenerObject,
|
|
143
|
+
options?: boolean | EventOptions
|
|
144
|
+
): void
|
|
145
|
+
batchRemoveEventListener<K extends keyof HTMLElementEventMap>(
|
|
146
|
+
type: K,
|
|
147
|
+
listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
|
|
148
|
+
options?: boolean | EventOptions
|
|
149
|
+
): void
|
|
150
|
+
batchRemoveEventListener(
|
|
151
|
+
type: string,
|
|
152
|
+
listener: EventListenerOrEventListenerObject,
|
|
153
|
+
options?: boolean | EventOptions
|
|
154
|
+
): void
|
|
78
155
|
}
|
|
79
156
|
/**
|
|
80
157
|
* 事件引擎
|
|
81
158
|
*/
|
|
82
159
|
export declare class Event extends Subscribable<ICustomEvent<any>> {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
160
|
+
private drivers
|
|
161
|
+
private containers
|
|
162
|
+
constructor(props?: IEventProps)
|
|
163
|
+
subscribeTo<T extends CustomEventClass>(
|
|
164
|
+
type: T,
|
|
165
|
+
subscriber: ISubscriber<InstanceType<T>>
|
|
166
|
+
): {
|
|
167
|
+
(): void
|
|
168
|
+
[UNSUBSCRIBE_ID_SYMBOL]: number
|
|
169
|
+
}
|
|
170
|
+
subscribeWith<T extends ICustomEvent = ICustomEvent>(
|
|
171
|
+
type: string | string[],
|
|
172
|
+
subscriber: ISubscriber<T>
|
|
173
|
+
): {
|
|
174
|
+
(): void
|
|
175
|
+
[UNSUBSCRIBE_ID_SYMBOL]: number
|
|
176
|
+
}
|
|
177
|
+
attachEvents(
|
|
178
|
+
container: EventContainer,
|
|
179
|
+
contentWindow?: Window,
|
|
180
|
+
context?: any
|
|
181
|
+
): any
|
|
182
|
+
detachEvents(container?: EventContainer): any
|
|
96
183
|
}
|