gis-common 5.0.3 → 5.0.4
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.
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
interface
|
|
1
|
+
export interface DispatcherEvent {
|
|
2
2
|
type: string;
|
|
3
|
-
message: any
|
|
4
|
-
target?:
|
|
3
|
+
message: Record<string, any>;
|
|
4
|
+
target?: EventDispatcher;
|
|
5
5
|
}
|
|
6
|
+
export type EventDispatcherHandler = (event: DispatcherEvent) => void;
|
|
6
7
|
export default class EventDispatcher {
|
|
7
8
|
private _listeners;
|
|
8
9
|
private _mutex;
|
|
9
10
|
private _context;
|
|
10
|
-
addEventListener(type: string, listener:
|
|
11
|
-
hasEventListener(type: string, listener:
|
|
12
|
-
removeEventListener(type: string, listener:
|
|
13
|
-
dispatchEvent(event:
|
|
11
|
+
addEventListener(type: string, listener: EventDispatcherHandler, context?: any, mutexStatus?: boolean): EventDispatcher;
|
|
12
|
+
hasEventListener(type: string, listener: EventDispatcherHandler): boolean;
|
|
13
|
+
removeEventListener(type: string, listener: EventDispatcherHandler): void;
|
|
14
|
+
dispatchEvent(event: DispatcherEvent): void;
|
|
14
15
|
removeAllListener(): void;
|
|
15
|
-
on(type: string, listener:
|
|
16
|
-
off(type: string, listener:
|
|
16
|
+
on(type: string, listener: EventDispatcherHandler, context?: any, mutexStatus?: boolean): any;
|
|
17
|
+
off(type: string, listener: EventDispatcherHandler): any;
|
|
17
18
|
}
|
|
18
|
-
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
type EventName = 'change' | 'error';
|
|
2
2
|
interface FullScreenAPI {
|
|
3
|
-
request(element: HTMLElement | undefined, options
|
|
3
|
+
request(element: HTMLElement | undefined, options?: FullscreenOptions): Promise<void>;
|
|
4
4
|
exit(): Promise<void>;
|
|
5
|
-
toggle(element: HTMLElement, options
|
|
5
|
+
toggle(element: HTMLElement, options?: FullscreenOptions): Promise<void>;
|
|
6
6
|
onchange(callback: (event: Event) => void): void;
|
|
7
7
|
onerror(callback: (event: Event) => void): void;
|
|
8
8
|
on(event: EventName, callback: (event: Event) => void): void;
|
|
@@ -6,7 +6,7 @@ declare const _default: {
|
|
|
6
6
|
* @param args 一个或多个源对象,用于提供要复制的属性。
|
|
7
7
|
* @returns 返回目标对象,包含所有复制的属性。
|
|
8
8
|
*/
|
|
9
|
-
assign<T
|
|
9
|
+
assign<T extends Record<string, any>>(dest: Record<string, any>, ...args: any[]): Record<string, any>;
|
|
10
10
|
/**
|
|
11
11
|
* 深度合并对象,并返回合并后的对象
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
* @param sources 待合并的对象列表
|
|
15
15
|
* @returns 合并后的对象
|
|
16
16
|
*/
|
|
17
|
-
deepAssign<T extends Record<string, any>>(target:
|
|
17
|
+
deepAssign<T extends Record<string, any>>(target: Record<string, any>, ...sources: any[]): any;
|
|
18
18
|
clone<T>(obj: T): T;
|
|
19
19
|
/**
|
|
20
20
|
* 深拷贝一个对象到另一个对象
|
|
@@ -23,7 +23,7 @@ declare const _default: {
|
|
|
23
23
|
* @param srcObj 源对象,深拷贝的来源对象
|
|
24
24
|
* @returns 深拷贝后的目标对象
|
|
25
25
|
*/
|
|
26
|
-
deepClone<T
|
|
26
|
+
deepClone<T extends Record<string, any>>(destObj: Record<string, any>, srcObj: T): Record<string, any>;
|
|
27
27
|
isEqual<T>(a: T, b: T): boolean;
|
|
28
28
|
parse(str: any): any;
|
|
29
29
|
};
|