@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.
Files changed (73) hide show
  1. package/esm/animation.d.ts +8 -2
  2. package/esm/animation.js +29 -30
  3. package/esm/array.d.ts +163 -37
  4. package/esm/array.js +104 -87
  5. package/esm/clone.d.ts +4 -4
  6. package/esm/clone.js +79 -86
  7. package/esm/compose.d.ts +3 -1
  8. package/esm/compose.js +6 -6
  9. package/esm/coordinate.d.ts +120 -76
  10. package/esm/coordinate.js +480 -411
  11. package/esm/element.d.ts +11 -6
  12. package/esm/element.js +123 -125
  13. package/esm/event.d.ts +162 -75
  14. package/esm/event.js +197 -197
  15. package/esm/globalThisPolyfill.d.ts +1 -1
  16. package/esm/globalThisPolyfill.js +14 -17
  17. package/esm/index.d.ts +17 -17
  18. package/esm/index.js +17 -17
  19. package/esm/instanceof.d.ts +1 -1
  20. package/esm/instanceof.js +9 -10
  21. package/esm/keycode.d.ts +145 -145
  22. package/esm/keycode.js +149 -149
  23. package/esm/lru.d.ts +50 -47
  24. package/esm/lru.js +236 -245
  25. package/esm/observer.d.ts +7 -7
  26. package/esm/observer.js +37 -40
  27. package/esm/request-idle.d.ts +9 -6
  28. package/esm/request-idle.js +6 -6
  29. package/esm/scroller.d.ts +24 -8
  30. package/esm/scroller.js +78 -75
  31. package/esm/subscribable.d.ts +10 -10
  32. package/esm/subscribable.js +39 -40
  33. package/esm/types.d.ts +13 -13
  34. package/esm/types.js +19 -20
  35. package/esm/uid.d.ts +1 -1
  36. package/esm/uid.js +7 -7
  37. package/lib/animation.d.ts +8 -2
  38. package/lib/animation.js +34 -35
  39. package/lib/array.d.ts +163 -37
  40. package/lib/array.js +129 -101
  41. package/lib/clone.d.ts +4 -4
  42. package/lib/clone.js +84 -91
  43. package/lib/compose.d.ts +3 -1
  44. package/lib/compose.js +10 -10
  45. package/lib/coordinate.d.ts +120 -76
  46. package/lib/coordinate.js +538 -440
  47. package/lib/element.d.ts +11 -6
  48. package/lib/element.js +139 -133
  49. package/lib/event.d.ts +162 -75
  50. package/lib/event.js +206 -202
  51. package/lib/globalThisPolyfill.d.ts +1 -1
  52. package/lib/globalThisPolyfill.js +17 -20
  53. package/lib/index.d.ts +17 -17
  54. package/lib/index.js +49 -33
  55. package/lib/instanceof.d.ts +1 -1
  56. package/lib/instanceof.js +13 -14
  57. package/lib/keycode.d.ts +145 -145
  58. package/lib/keycode.js +153 -153
  59. package/lib/lru.d.ts +50 -47
  60. package/lib/lru.js +240 -249
  61. package/lib/observer.d.ts +7 -7
  62. package/lib/observer.js +41 -44
  63. package/lib/request-idle.d.ts +9 -6
  64. package/lib/request-idle.js +14 -11
  65. package/lib/scroller.d.ts +24 -8
  66. package/lib/scroller.js +89 -81
  67. package/lib/subscribable.d.ts +10 -10
  68. package/lib/subscribable.js +43 -44
  69. package/lib/types.d.ts +13 -13
  70. package/lib/types.js +40 -28
  71. package/lib/uid.d.ts +1 -1
  72. package/lib/uid.js +11 -11
  73. 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: (innerWidth: number, style: CSSStyleDeclaration) => number;
3
- export declare const calcElementLayout: (element: Element) => "vertical" | "horizontal";
4
- export declare const calcElementTranslate: (element: HTMLElement) => Point;
5
- export declare const calcElementRotate: (element: HTMLElement) => number;
6
- export declare const calcElementScale: (element: HTMLElement) => number;
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
- '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
- ]);
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
- return (innerWidth +
60
- parseFloat(style.marginLeft) +
61
- parseFloat(style.marginRight) +
62
- parseFloat(style.paddingLeft) +
63
- parseFloat(style.paddingRight) +
64
- parseFloat(style.borderLeftWidth) +
65
- parseFloat(style.borderRightWidth));
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
- if (!element)
69
- return 'vertical';
70
- const parent = element.parentElement;
71
- if (!parent)
72
- 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')
85
- return 'horizontal';
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
- if (parentStyle.display === 'flex' && parentStyle.flexDirection === 'row')
88
- return 'horizontal';
89
- if (parentStyle.display === 'grid') {
92
+ }
93
+ if (InlineLayoutTagNames.has(tagName)) {
94
+ if (style.display === 'block') {
95
+ if (style.float === 'left' || style.float === 'right') {
90
96
  if (isNotFullWidth()) {
91
- return 'horizontal';
97
+ return 'horizontal'
92
98
  }
99
+ }
100
+ return 'vertical'
93
101
  }
94
- if (InlineLayoutTagNames.has(tagName)) {
95
- if (style.display === 'block') {
96
- if (style.float === 'left' || style.float === 'right') {
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
- const transform = element?.style?.transform;
108
- if (transform) {
109
- const [x, y] = transform
110
- .match(/translate(?:3d)?\(\s*([-\d.]+)[a-z]+?[\s,]+([-\d.]+)[a-z]+?(?:[\s,]+([-\d.]+))?[a-z]+?\s*\)/)
111
- ?.slice(1, 3) ?? [0, 0];
112
- return new Point(Number(x), Number(y));
113
- }
114
- else {
115
- return new Point(Number(element.offsetLeft), Number(element.offsetTop));
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
- const transform = element?.style?.transform;
120
- if (transform) {
121
- return Number(transform.match(/rotate\(\s*([-\d.]+)/)?.[1] ?? 0);
122
- }
123
- else {
124
- return 0;
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
- const transform = element?.style?.transform;
129
- if (transform) {
130
- return Number(transform.match(/scale\(\s*([-\d.]+)/)?.[1] ?? 0);
131
- }
132
- else {
133
- return 0;
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 { Subscribable, ISubscriber } from './subscribable';
2
- export type EventOptions = boolean | (AddEventListenerOptions & EventListenerOptions & {
3
- mode?: 'onlyOne' | 'onlyParent' | 'onlyChild';
4
- });
5
- export type EventContainer = Window | HTMLElement | HTMLDocument;
6
- export type EventDriverContainer = HTMLElement | HTMLDocument;
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
- (engine: T): void;
11
+ (engine: T): void
9
12
  }
10
13
  export interface IEventDriver {
11
- container: EventDriverContainer;
12
- contentWindow: Window;
13
- attach(container: EventDriverContainer): void;
14
- detach(container: EventDriverContainer): void;
15
- dispatch<T extends ICustomEvent<any> = any>(event: T): void | boolean;
16
- subscribe<T extends ICustomEvent<any> = any>(subscriber: ISubscriber<T>): void;
17
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
18
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
19
- addEventListener(type: any, listener: any, options: any): void;
20
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
21
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
22
- removeEventListener(type: any, listener: any, options?: any): void;
23
- batchAddEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
24
- batchAddEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
25
- batchAddEventListener(type: any, listener: any, options?: any): void;
26
- batchRemoveEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
27
- batchRemoveEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
28
- batchRemoveEventListener(type: any, listener: any, options: any): void;
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
- new (engine: T, context?: any): IEventDriver;
66
+ new (engine: T, context?: any): IEventDriver
32
67
  }
33
68
  export interface ICustomEvent<EventData = any, EventContext = any> {
34
- type: string;
35
- data?: EventData;
36
- context?: EventContext;
69
+ type: string
70
+ data?: EventData
71
+ context?: EventContext
37
72
  }
38
73
  export interface CustomEventClass {
39
- new (...args: any[]): any;
74
+ new (...args: any[]): any
40
75
  }
41
76
  export interface IEventProps<T = Event> {
42
- drivers?: IEventDriverClass<T>[];
43
- effects?: IEventEffect<T>[];
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> implements IEventDriver {
49
- engine: Engine;
50
- container: EventDriverContainer;
51
- contentWindow: Window;
52
- context: Context;
53
- constructor(engine: Engine, context?: Context);
54
- dispatch<T extends ICustomEvent<any> = any>(event: T): boolean;
55
- subscribe<T extends ICustomEvent<any> = any>(subscriber: ISubscriber<T>): {
56
- (): void;
57
- [UNSUBSCRIBE_ID_SYMBOL]: number;
58
- };
59
- subscribeTo<T extends CustomEventClass>(type: T, subscriber: ISubscriber<InstanceType<T>>): {
60
- (): void;
61
- [UNSUBSCRIBE_ID_SYMBOL]: number;
62
- };
63
- subscribeWith<T extends ICustomEvent = ICustomEvent>(type: string | string[], subscriber: ISubscriber<T>): {
64
- (): void;
65
- [UNSUBSCRIBE_ID_SYMBOL]: number;
66
- };
67
- attach(container: EventDriverContainer): void;
68
- detach(container: EventDriverContainer): void;
69
- eventTarget(type: string): Window | EventDriverContainer;
70
- addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
71
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
72
- removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
73
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
74
- batchAddEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
75
- batchAddEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
76
- batchRemoveEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventOptions): void;
77
- batchRemoveEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventOptions): void;
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
- private drivers;
84
- private containers;
85
- constructor(props?: IEventProps);
86
- subscribeTo<T extends CustomEventClass>(type: T, subscriber: ISubscriber<InstanceType<T>>): {
87
- (): void;
88
- [UNSUBSCRIBE_ID_SYMBOL]: number;
89
- };
90
- subscribeWith<T extends ICustomEvent = ICustomEvent>(type: string | string[], subscriber: ISubscriber<T>): {
91
- (): void;
92
- [UNSUBSCRIBE_ID_SYMBOL]: number;
93
- };
94
- attachEvents(container: EventContainer, contentWindow?: Window, context?: any): any;
95
- detachEvents(container?: EventContainer): any;
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
  }