@hysc/meeting 3.0.26 → 3.0.28

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 (144) hide show
  1. package/esm/boom-core/src/BoomCore/BCClient/clientEventType.d.ts +418 -0
  2. package/esm/boom-meeting/src/BMChat/BMMessageInfo.d.ts +4 -0
  3. package/esm/boom-meeting/src/BMRoom/RoomEvent.d.ts +1 -0
  4. package/esm/boom-meeting/src/BMStream/BMSpeaker.d.ts +2 -2
  5. package/esm/boom-meeting/src/BMStream/BMStreamModel.d.ts +27 -6
  6. package/esm/boom-meeting/src/bjy-common/function/debounce.d.ts +9 -0
  7. package/esm/boom-meeting/src/bjy-common/function/isDef.d.ts +1 -0
  8. package/esm/boom-meeting/src/bjy-common/function/isUndef.d.ts +1 -0
  9. package/esm/boom-meeting/src/bjy-common/function/throttling.d.ts +9 -0
  10. package/esm/boom-meeting/src/bjy-common/function/toNumber.d.ts +1 -0
  11. package/esm/boom-meeting/src/bjy-common/type/api.d.ts +66 -0
  12. package/esm/boom-meeting/src/bjy-common/type/options.d.ts +7 -0
  13. package/esm/boom-meeting/src/bjy-common/type/type.d.ts +90 -0
  14. package/esm/boom-meeting/src/bjy-common/util/NextTask.d.ts +28 -0
  15. package/esm/boom-meeting/src/bjy-common/util/Sleep.d.ts +14 -0
  16. package/esm/boom-meeting/src/bjy-common/util/Timer.d.ts +13 -0
  17. package/esm/boom-meeting/src/bjy-common/util/browser.d.ts +6 -0
  18. package/esm/boom-meeting/src/bjy-common/util/holder.d.ts +6 -0
  19. package/esm/boom-meeting/src/bjy-common/util/network.d.ts +4 -0
  20. package/esm/boom-meeting/src/bjy-common/util/os.d.ts +14 -0
  21. package/esm/boom-meeting/src/error/errorMap.d.ts +70 -0
  22. package/esm/boom-meeting/src/type/customStats.d.ts +119 -0
  23. package/esm/boom-meeting/src/type/index.d.ts +9 -0
  24. package/esm/boom-meeting/src/type/stream.d.ts +15 -0
  25. package/esm/boom-meeting/src/type/user.d.ts +9 -0
  26. package/esm/boom-meeting/src/util/PackLoss.d.ts +7 -0
  27. package/esm/boom-meeting/src/util/Privileges.d.ts +20 -0
  28. package/esm/boom-meeting/src/util/ReportCollector.d.ts +22 -0
  29. package/esm/boom-meeting/src/util/Stutter.d.ts +19 -0
  30. package/esm/boom-meeting/src/util/base64.d.ts +4 -0
  31. package/esm/boom-meeting/src/util/checkPermissions.d.ts +1 -0
  32. package/esm/boom-meeting/src/util/checkSystemRequirements.d.ts +1 -0
  33. package/esm/boom-meeting/src/util/devices.d.ts +2 -0
  34. package/esm/boom-meeting/src/util/formatUserId.d.ts +2 -0
  35. package/esm/boom-meeting/src/util/is.d.ts +70 -0
  36. package/esm/boom-meeting/src/util/peerToPeerProbe.d.ts +9 -0
  37. package/esm/boom-meeting/src/util/request.d.ts +45 -0
  38. package/esm/boom-meeting/src/util/sortUtils.d.ts +10 -0
  39. package/esm/boom-meeting/src/util/util.d.ts +1 -0
  40. package/esm/index.js +3 -3
  41. package/esm/index.js.map +3 -3
  42. package/esm/src/BMChat/BMMessageInfo.d.ts +31 -31
  43. package/esm/src/BMRoom/BMRoom.d.ts +4 -3
  44. package/esm/src/BMRoom/RoomEvent.d.ts +1 -1
  45. package/esm/src/BMRoom/attachEvents.d.ts +7 -2
  46. package/esm/src/BMStream/BMSpeaker.d.ts +44 -44
  47. package/esm/src/BMStream/BMStreamModel.d.ts +269 -269
  48. package/esm/src/BMStream/BMStreamModelVM.d.ts +2 -2
  49. package/esm/src/BMStream/getHTMLMediaStreamOptions.d.ts +35 -35
  50. package/esm/src/EventHandler.d.ts +20 -0
  51. package/esm/src/bjy-common/function/debounce.d.ts +9 -9
  52. package/esm/src/bjy-common/function/execute.d.ts +9 -9
  53. package/esm/src/bjy-common/function/isDef.d.ts +1 -1
  54. package/esm/src/bjy-common/function/isNative.d.ts +1 -1
  55. package/esm/src/bjy-common/function/isUndef.d.ts +1 -1
  56. package/esm/src/bjy-common/function/nextTick.d.ts +2 -2
  57. package/esm/src/bjy-common/function/throttling.d.ts +9 -9
  58. package/esm/src/bjy-common/function/toNumber.d.ts +1 -1
  59. package/esm/src/bjy-common/function/toString.d.ts +1 -1
  60. package/esm/src/bjy-common/type/api.d.ts +66 -66
  61. package/esm/src/bjy-common/type/options.d.ts +7 -7
  62. package/esm/src/bjy-common/type/type.d.ts +90 -90
  63. package/esm/src/bjy-common/util/CustomEvent.d.ts +30 -30
  64. package/esm/src/bjy-common/util/Emitter.d.ts +57 -57
  65. package/esm/src/bjy-common/util/NextTask.d.ts +28 -28
  66. package/esm/src/bjy-common/util/Sleep.d.ts +14 -14
  67. package/esm/src/bjy-common/util/Timer.d.ts +13 -13
  68. package/esm/src/bjy-common/util/array.d.ts +96 -96
  69. package/esm/src/bjy-common/util/browser.d.ts +6 -6
  70. package/esm/src/bjy-common/util/constant.d.ts +50 -50
  71. package/esm/src/bjy-common/util/holder.d.ts +6 -6
  72. package/esm/src/bjy-common/util/is.d.ts +49 -49
  73. package/esm/src/bjy-common/util/keypath.d.ts +41 -41
  74. package/esm/src/bjy-common/util/logger.d.ts +42 -42
  75. package/esm/src/bjy-common/util/network.d.ts +4 -4
  76. package/esm/src/bjy-common/util/object.d.ts +83 -83
  77. package/esm/src/bjy-common/util/os.d.ts +14 -14
  78. package/esm/src/bjy-common/util/string.d.ts +102 -102
  79. package/esm/src/error/errorMap.d.ts +70 -70
  80. package/esm/src/type/customStats.d.ts +119 -119
  81. package/esm/src/type/index.d.ts +9 -9
  82. package/esm/src/type/stream.d.ts +15 -15
  83. package/esm/src/type/user.d.ts +9 -9
  84. package/esm/src/util/PackLoss.d.ts +7 -7
  85. package/esm/src/util/Privileges.d.ts +20 -20
  86. package/esm/src/util/ReportCollector.d.ts +22 -22
  87. package/esm/src/util/Stutter.d.ts +19 -19
  88. package/esm/src/util/base64.d.ts +4 -4
  89. package/esm/src/util/checkPermissions.d.ts +1 -1
  90. package/esm/src/util/checkSystemRequirements.d.ts +1 -1
  91. package/esm/src/util/devices.d.ts +2 -2
  92. package/esm/src/util/formatUserId.d.ts +2 -2
  93. package/esm/src/util/is.d.ts +70 -70
  94. package/esm/src/util/peerToPeerProbe.d.ts +9 -9
  95. package/esm/src/util/request.d.ts +45 -45
  96. package/esm/src/util/roomUtils.d.ts +9 -9
  97. package/esm/src/util/sortUtils.d.ts +10 -10
  98. package/esm/src/util/util.d.ts +77 -76
  99. package/package.json +3 -3
  100. package/umd/boom-core/src/BoomCore/BCClient/clientEventType.d.ts +418 -0
  101. package/umd/boom-meeting/src/BMChat/BMMessageInfo.d.ts +4 -0
  102. package/umd/boom-meeting/src/BMRoom/RoomEvent.d.ts +1 -0
  103. package/umd/boom-meeting/src/BMStream/BMSpeaker.d.ts +2 -2
  104. package/umd/boom-meeting/src/BMStream/BMStreamModel.d.ts +27 -6
  105. package/umd/boom-meeting/src/bjy-common/function/debounce.d.ts +9 -0
  106. package/umd/boom-meeting/src/bjy-common/function/isDef.d.ts +1 -0
  107. package/umd/boom-meeting/src/bjy-common/function/isUndef.d.ts +1 -0
  108. package/umd/boom-meeting/src/bjy-common/function/throttling.d.ts +9 -0
  109. package/umd/boom-meeting/src/bjy-common/function/toNumber.d.ts +1 -0
  110. package/umd/boom-meeting/src/bjy-common/type/api.d.ts +66 -0
  111. package/umd/boom-meeting/src/bjy-common/type/options.d.ts +7 -0
  112. package/umd/boom-meeting/src/bjy-common/type/type.d.ts +90 -0
  113. package/umd/boom-meeting/src/bjy-common/util/NextTask.d.ts +28 -0
  114. package/umd/boom-meeting/src/bjy-common/util/Sleep.d.ts +14 -0
  115. package/umd/boom-meeting/src/bjy-common/util/Timer.d.ts +13 -0
  116. package/umd/boom-meeting/src/bjy-common/util/browser.d.ts +6 -0
  117. package/umd/boom-meeting/src/bjy-common/util/holder.d.ts +6 -0
  118. package/umd/boom-meeting/src/bjy-common/util/network.d.ts +4 -0
  119. package/umd/boom-meeting/src/bjy-common/util/os.d.ts +14 -0
  120. package/umd/boom-meeting/src/error/errorMap.d.ts +70 -0
  121. package/umd/boom-meeting/src/type/customStats.d.ts +119 -0
  122. package/umd/boom-meeting/src/type/index.d.ts +9 -0
  123. package/umd/boom-meeting/src/type/stream.d.ts +15 -0
  124. package/umd/boom-meeting/src/type/user.d.ts +9 -0
  125. package/umd/boom-meeting/src/util/PackLoss.d.ts +7 -0
  126. package/umd/boom-meeting/src/util/Privileges.d.ts +20 -0
  127. package/umd/boom-meeting/src/util/ReportCollector.d.ts +22 -0
  128. package/umd/boom-meeting/src/util/Stutter.d.ts +19 -0
  129. package/umd/boom-meeting/src/util/base64.d.ts +4 -0
  130. package/umd/boom-meeting/src/util/checkPermissions.d.ts +1 -0
  131. package/umd/boom-meeting/src/util/checkSystemRequirements.d.ts +1 -0
  132. package/umd/boom-meeting/src/util/devices.d.ts +2 -0
  133. package/umd/boom-meeting/src/util/formatUserId.d.ts +2 -0
  134. package/umd/boom-meeting/src/util/is.d.ts +70 -0
  135. package/umd/boom-meeting/src/util/peerToPeerProbe.d.ts +9 -0
  136. package/umd/boom-meeting/src/util/request.d.ts +45 -0
  137. package/umd/boom-meeting/src/util/sortUtils.d.ts +10 -0
  138. package/umd/boom-meeting/src/util/util.d.ts +1 -0
  139. package/umd/index.js +3 -3
  140. package/umd/src/BMRoom/BMRoom.d.ts +4 -3
  141. package/umd/src/BMRoom/attachEvents.d.ts +7 -2
  142. package/umd/src/BMStream/BMStreamModelVM.d.ts +2 -2
  143. package/umd/src/EventHandler.d.ts +20 -0
  144. package/umd/src/util/util.d.ts +1 -0
@@ -1,9 +1,9 @@
1
- /**
2
- * 任性地执行一个函数,不管它有没有、是不是
3
- *
4
- * @param fn 调用的函数
5
- * @param context 执行函数时的 this 指向
6
- * @param args 调用函数的参数,多参数时传入数组
7
- * @return 调用函数的返回值
8
- */
9
- export default function (fn: any, context?: any, args?: any): any;
1
+ /**
2
+ * 任性地执行一个函数,不管它有没有、是不是
3
+ *
4
+ * @param fn 调用的函数
5
+ * @param context 执行函数时的 this 指向
6
+ * @param args 调用函数的参数,多参数时传入数组
7
+ * @return 调用函数的返回值
8
+ */
9
+ export default function (fn: any, context?: any, args?: any): any;
@@ -1 +1 @@
1
- export default function (target: any): boolean;
1
+ export default function (target: any): boolean;
@@ -1 +1 @@
1
- export default function (target: any): boolean;
1
+ export default function (target: any): boolean;
@@ -1 +1 @@
1
- export default function (target: any): boolean;
1
+ export default function (target: any): boolean;
@@ -1,2 +1,2 @@
1
- declare let nextTick: Function;
2
- export default nextTick;
1
+ declare let nextTick: Function;
2
+ export default nextTick;
@@ -1,9 +1,9 @@
1
- /**
2
- * 节流调用
3
- *
4
- * @param fn 需要节制调用的函数
5
- * @param delay 调用的时间间隔,单位毫秒
6
- * @param immediate 是否立即触发
7
- * @return 节流函数
8
- */
9
- export default function (fn: Function, delay: number, immediate?: boolean): Function;
1
+ /**
2
+ * 节流调用
3
+ *
4
+ * @param fn 需要节制调用的函数
5
+ * @param delay 调用的时间间隔,单位毫秒
6
+ * @param immediate 是否立即触发
7
+ * @return 节流函数
8
+ */
9
+ export default function (fn: Function, delay: number, immediate?: boolean): Function;
@@ -1 +1 @@
1
- export default function (target: any, defaultValue?: number): number;
1
+ export default function (target: any, defaultValue?: number): number;
@@ -1 +1 @@
1
- export default function (target: any, defaultValue?: string): string;
1
+ export default function (target: any, defaultValue?: string): string;
@@ -1,66 +1,66 @@
1
- import { Data, ValueHolder } from './type';
2
- export interface ArrayApi {
3
- each<T>(array: T[], callback: (item: T, index: number) => boolean | void, reversed?: boolean): void;
4
- push<T>(array: T[], target: T | T[]): void;
5
- unshift<T>(array: T[], target: T | T[]): void;
6
- indexOf<T>(array: T[], target: T, strict?: boolean): number;
7
- last<T>(array: T[]): T | void;
8
- pop<T>(array: T[]): T | void;
9
- remove<T>(array: T[], target: T, strict?: boolean): number;
10
- has<T>(array: T[], target: T, strict?: boolean): boolean;
11
- toArray<T>(array: T[] | ArrayLike<T>): T[];
12
- toObject(array: any[], key?: string | null, value?: any): object;
13
- join(array: string[], separator: string): string;
14
- falsy(array: any): boolean;
15
- }
16
- export interface IsApi {
17
- func(value: any): boolean;
18
- array(value: any): boolean;
19
- object(value: any): boolean;
20
- string(value: any): boolean;
21
- number(value: any): boolean;
22
- boolean(value: any): boolean;
23
- numeric(value: any): boolean;
24
- }
25
- export interface LoggerApi {
26
- DEBUG: number;
27
- INFO: number;
28
- WARN: number;
29
- ERROR: number;
30
- FATAL: number;
31
- debug(msg: string, tag?: string): void;
32
- info(msg: string, tag?: string): void;
33
- warn(msg: string, tag?: string): void;
34
- error(msg: string, tag?: string): void;
35
- fatal(msg: string, tag?: string): void;
36
- }
37
- export interface ObjectApi {
38
- keys(object: Data): string[];
39
- sort(object: Data, desc?: boolean): string[];
40
- each(object: Data, callback: (value: any, key: string) => boolean | void): void;
41
- clear(object: Data): void;
42
- extend(original: Data, object: Data): Data;
43
- merge(object1: Data | void, object2: Data | void): Data | void;
44
- copy(object: any, deep?: boolean): any;
45
- get(object: any, keypath: string): ValueHolder | undefined;
46
- set(object: Data, keypath: string, value: any, autofill?: boolean): void;
47
- has(object: Data, key: string | number): boolean;
48
- falsy(object: any): boolean;
49
- }
50
- export interface StringApi {
51
- camelize(str: string): string;
52
- hyphenate(str: string): string;
53
- capitalize(str: string): string;
54
- trim(str: any): string;
55
- slice(str: string, start: number, end?: number): string;
56
- indexOf(str: string, part: string, start?: number): number;
57
- lastIndexOf(str: string, part: string, end?: number): number;
58
- startsWith(str: string, part: string): boolean;
59
- endsWith(str: string, part: string): boolean;
60
- charAt(str: string, index?: number): string;
61
- codeAt(str: string, index?: number): number;
62
- upper(str: string): string;
63
- lower(str: string): string;
64
- has(str: string, part: string): boolean;
65
- falsy(str: any): boolean;
66
- }
1
+ import { Data, ValueHolder } from './type';
2
+ export interface ArrayApi {
3
+ each<T>(array: T[], callback: (item: T, index: number) => boolean | void, reversed?: boolean): void;
4
+ push<T>(array: T[], target: T | T[]): void;
5
+ unshift<T>(array: T[], target: T | T[]): void;
6
+ indexOf<T>(array: T[], target: T, strict?: boolean): number;
7
+ last<T>(array: T[]): T | void;
8
+ pop<T>(array: T[]): T | void;
9
+ remove<T>(array: T[], target: T, strict?: boolean): number;
10
+ has<T>(array: T[], target: T, strict?: boolean): boolean;
11
+ toArray<T>(array: T[] | ArrayLike<T>): T[];
12
+ toObject(array: any[], key?: string | null, value?: any): object;
13
+ join(array: string[], separator: string): string;
14
+ falsy(array: any): boolean;
15
+ }
16
+ export interface IsApi {
17
+ func(value: any): boolean;
18
+ array(value: any): boolean;
19
+ object(value: any): boolean;
20
+ string(value: any): boolean;
21
+ number(value: any): boolean;
22
+ boolean(value: any): boolean;
23
+ numeric(value: any): boolean;
24
+ }
25
+ export interface LoggerApi {
26
+ DEBUG: number;
27
+ INFO: number;
28
+ WARN: number;
29
+ ERROR: number;
30
+ FATAL: number;
31
+ debug(msg: string, tag?: string): void;
32
+ info(msg: string, tag?: string): void;
33
+ warn(msg: string, tag?: string): void;
34
+ error(msg: string, tag?: string): void;
35
+ fatal(msg: string, tag?: string): void;
36
+ }
37
+ export interface ObjectApi {
38
+ keys(object: Data): string[];
39
+ sort(object: Data, desc?: boolean): string[];
40
+ each(object: Data, callback: (value: any, key: string) => boolean | void): void;
41
+ clear(object: Data): void;
42
+ extend(original: Data, object: Data): Data;
43
+ merge(object1: Data | void, object2: Data | void): Data | void;
44
+ copy(object: any, deep?: boolean): any;
45
+ get(object: any, keypath: string): ValueHolder | undefined;
46
+ set(object: Data, keypath: string, value: any, autofill?: boolean): void;
47
+ has(object: Data, key: string | number): boolean;
48
+ falsy(object: any): boolean;
49
+ }
50
+ export interface StringApi {
51
+ camelize(str: string): string;
52
+ hyphenate(str: string): string;
53
+ capitalize(str: string): string;
54
+ trim(str: any): string;
55
+ slice(str: string, start: number, end?: number): string;
56
+ indexOf(str: string, part: string, start?: number): number;
57
+ lastIndexOf(str: string, part: string, end?: number): number;
58
+ startsWith(str: string, part: string): boolean;
59
+ endsWith(str: string, part: string): boolean;
60
+ charAt(str: string, index?: number): string;
61
+ codeAt(str: string, index?: number): number;
62
+ upper(str: string): string;
63
+ lower(str: string): string;
64
+ has(str: string, part: string): boolean;
65
+ falsy(str: any): boolean;
66
+ }
@@ -1,7 +1,7 @@
1
- import { Task } from './type';
2
- export interface EmitterOptions extends Task {
3
- ns?: string;
4
- num?: number;
5
- max?: number;
6
- count?: number;
7
- }
1
+ import { Task } from './type';
2
+ export interface EmitterOptions extends Task {
3
+ ns?: string;
4
+ num?: number;
5
+ max?: number;
6
+ count?: number;
7
+ }
@@ -1,90 +1,90 @@
1
- export declare type Data = Record<string, any>;
2
- export declare type ThisTask<This> = (this: This) => void;
3
- export declare type ThisListener<This> = (this: This, event: CustomEventInterface, data?: Data) => false | void;
4
- export declare type Listener = (event: CustomEventInterface, data?: Data) => false | void;
5
- export declare type NativeListener = (event: CustomEventInterface | Event) => false | void;
6
- export declare type ValueHolder = {
7
- keypath?: string;
8
- value: any;
9
- };
10
- export declare type Task = {
11
- fn: Function;
12
- ctx?: any;
13
- };
14
- export interface CustomEventInterface {
15
- type: string;
16
- phase: number;
17
- ns?: string;
18
- target?: any;
19
- originalEvent?: CustomEventInterface | Event;
20
- isPrevented?: true;
21
- isStoped?: true;
22
- listener?: Function;
23
- /**
24
- * 阻止事件的默认行为
25
- */
26
- preventDefault(): this;
27
- /**
28
- * 停止事件广播
29
- */
30
- stopPropagation(): this;
31
- prevent(): this;
32
- stop(): this;
33
- }
34
- export interface OS {
35
- /**
36
- * os 平台
37
- */
38
- name: string;
39
- /**
40
- * os 版本号
41
- */
42
- version: string;
43
- /**
44
- * 是否是 ios 系统
45
- */
46
- ios?: boolean;
47
- /**
48
- * 系统判断
49
- */
50
- iphone?: boolean;
51
- ipad?: boolean;
52
- itouch?: boolean;
53
- android?: boolean;
54
- wp?: boolean;
55
- windows?: boolean;
56
- linux?: boolean;
57
- mac?: boolean;
58
- }
59
- export interface Browser {
60
- /**
61
- * browser 平台
62
- */
63
- name: string;
64
- /**
65
- * browser 版本号
66
- */
67
- version: string;
68
- /**
69
- * 浏览器判断
70
- */
71
- alipay?: boolean;
72
- wechat?: boolean;
73
- baiduApp?: boolean;
74
- baidu?: boolean;
75
- uc?: boolean;
76
- qq?: boolean;
77
- qqApp?: boolean;
78
- ie?: boolean;
79
- edge?: boolean;
80
- chrome?: boolean;
81
- firefox?: boolean;
82
- opera?: boolean;
83
- safari?: boolean;
84
- }
85
- export interface Network {
86
- /**
87
- * 网络类型
88
- */
89
- name: string;
90
- }
1
+ export declare type Data = Record<string, any>;
2
+ export declare type ThisTask<This> = (this: This) => void;
3
+ export declare type ThisListener<This> = (this: This, event: CustomEventInterface, data?: Data) => false | void;
4
+ export declare type Listener = (event: CustomEventInterface, data?: Data) => false | void;
5
+ export declare type NativeListener = (event: CustomEventInterface | Event) => false | void;
6
+ export declare type ValueHolder = {
7
+ keypath?: string;
8
+ value: any;
9
+ };
10
+ export declare type Task = {
11
+ fn: Function;
12
+ ctx?: any;
13
+ };
14
+ export interface CustomEventInterface {
15
+ type: string;
16
+ phase: number;
17
+ ns?: string;
18
+ target?: any;
19
+ originalEvent?: CustomEventInterface | Event;
20
+ isPrevented?: true;
21
+ isStoped?: true;
22
+ listener?: Function;
23
+ /**
24
+ * 阻止事件的默认行为
25
+ */
26
+ preventDefault(): this;
27
+ /**
28
+ * 停止事件广播
29
+ */
30
+ stopPropagation(): this;
31
+ prevent(): this;
32
+ stop(): this;
33
+ }
34
+ export interface OS {
35
+ /**
36
+ * os 平台
37
+ */
38
+ name: string;
39
+ /**
40
+ * os 版本号
41
+ */
42
+ version: string;
43
+ /**
44
+ * 是否是 ios 系统
45
+ */
46
+ ios?: boolean;
47
+ /**
48
+ * 系统判断
49
+ */
50
+ iphone?: boolean;
51
+ ipad?: boolean;
52
+ itouch?: boolean;
53
+ android?: boolean;
54
+ wp?: boolean;
55
+ windows?: boolean;
56
+ linux?: boolean;
57
+ mac?: boolean;
58
+ }
59
+ export interface Browser {
60
+ /**
61
+ * browser 平台
62
+ */
63
+ name: string;
64
+ /**
65
+ * browser 版本号
66
+ */
67
+ version: string;
68
+ /**
69
+ * 浏览器判断
70
+ */
71
+ alipay?: boolean;
72
+ wechat?: boolean;
73
+ baiduApp?: boolean;
74
+ baidu?: boolean;
75
+ uc?: boolean;
76
+ qq?: boolean;
77
+ qqApp?: boolean;
78
+ ie?: boolean;
79
+ edge?: boolean;
80
+ chrome?: boolean;
81
+ firefox?: boolean;
82
+ opera?: boolean;
83
+ safari?: boolean;
84
+ }
85
+ export interface Network {
86
+ /**
87
+ * 网络类型
88
+ */
89
+ name: string;
90
+ }
@@ -1,30 +1,30 @@
1
- import { CustomEventInterface } from '../type/type';
2
- export default class CustomEvent implements CustomEventInterface {
3
- static PHASE_CURRENT: number;
4
- static PHASE_UPWARD: number;
5
- static PHASE_DOWNWARD: number;
6
- type: string;
7
- phase: number;
8
- ns?: string;
9
- target?: any;
10
- originalEvent?: CustomEventInterface | Event;
11
- isPrevented?: true;
12
- isStoped?: true;
13
- listener?: Function;
14
- /**
15
- * 构造函数
16
- *
17
- * 可以传事件名称,也可以传原生事件对象
18
- */
19
- constructor(type: string, originalEvent?: CustomEventInterface | Event);
20
- /**
21
- * 阻止事件的默认行为
22
- */
23
- preventDefault(): this;
24
- /**
25
- * 停止事件广播
26
- */
27
- stopPropagation(): this;
28
- prevent(): this;
29
- stop(): this;
30
- }
1
+ import { CustomEventInterface } from '../type/type';
2
+ export default class CustomEvent implements CustomEventInterface {
3
+ static PHASE_CURRENT: number;
4
+ static PHASE_UPWARD: number;
5
+ static PHASE_DOWNWARD: number;
6
+ type: string;
7
+ phase: number;
8
+ ns?: string;
9
+ target?: any;
10
+ originalEvent?: CustomEventInterface | Event;
11
+ isPrevented?: true;
12
+ isStoped?: true;
13
+ listener?: Function;
14
+ /**
15
+ * 构造函数
16
+ *
17
+ * 可以传事件名称,也可以传原生事件对象
18
+ */
19
+ constructor(type: string, originalEvent?: CustomEventInterface | Event);
20
+ /**
21
+ * 阻止事件的默认行为
22
+ */
23
+ preventDefault(): this;
24
+ /**
25
+ * 停止事件广播
26
+ */
27
+ stopPropagation(): this;
28
+ prevent(): this;
29
+ stop(): this;
30
+ }
@@ -1,57 +1,57 @@
1
- import { NativeListener } from '../type/type';
2
- import { EmitterOptions } from '../type/options';
3
- declare type Namespace = {
4
- type: string;
5
- ns?: string;
6
- };
7
- export default class Emitter {
8
- /**
9
- * 是否开启命名空间
10
- */
11
- ns: boolean;
12
- /**
13
- * 已注册的事件监听
14
- */
15
- listeners: Record<string, EmitterOptions[]>;
16
- /**
17
- * 原生事件监听,一个事件对应一个 listener
18
- */
19
- nativeListeners?: Record<string, NativeListener>;
20
- constructor(ns?: boolean);
21
- /**
22
- * 发射事件
23
- *
24
- * @param type 事件名称或命名空间
25
- * @param args 事件处理函数的参数列表
26
- * @param filter 自定义过滤器
27
- */
28
- fire(type: string | Namespace, args: any[] | void, filter?: (namespace: Namespace, args: any[] | void, options: EmitterOptions) => boolean | void): boolean;
29
- /**
30
- * 注册监听
31
- *
32
- * @param type
33
- * @param listener
34
- */
35
- on(type: string | Namespace, listener: Function | EmitterOptions): void;
36
- /**
37
- * 取消监听
38
- *
39
- * @param type
40
- * @param listener
41
- */
42
- off(type?: string | Namespace, listener?: Function): void;
43
- /**
44
- * 是否已监听某个事件
45
- *
46
- * @param type
47
- * @param listener
48
- */
49
- has(type: string | Namespace, listener?: Function): boolean;
50
- /**
51
- * 把事件类型解析成命名空间格式
52
- *
53
- * @param type
54
- */
55
- parse(type: string): Namespace;
56
- }
57
- export {};
1
+ import { NativeListener } from '../type/type';
2
+ import { EmitterOptions } from '../type/options';
3
+ declare type Namespace = {
4
+ type: string;
5
+ ns?: string;
6
+ };
7
+ export default class Emitter {
8
+ /**
9
+ * 是否开启命名空间
10
+ */
11
+ ns: boolean;
12
+ /**
13
+ * 已注册的事件监听
14
+ */
15
+ listeners: Record<string, EmitterOptions[]>;
16
+ /**
17
+ * 原生事件监听,一个事件对应一个 listener
18
+ */
19
+ nativeListeners?: Record<string, NativeListener>;
20
+ constructor(ns?: boolean);
21
+ /**
22
+ * 发射事件
23
+ *
24
+ * @param type 事件名称或命名空间
25
+ * @param args 事件处理函数的参数列表
26
+ * @param filter 自定义过滤器
27
+ */
28
+ fire(type: string | Namespace, args: any[] | void, filter?: (namespace: Namespace, args: any[] | void, options: EmitterOptions) => boolean | void): boolean;
29
+ /**
30
+ * 注册监听
31
+ *
32
+ * @param type
33
+ * @param listener
34
+ */
35
+ on(type: string | Namespace, listener: Function | EmitterOptions): void;
36
+ /**
37
+ * 取消监听
38
+ *
39
+ * @param type
40
+ * @param listener
41
+ */
42
+ off(type?: string | Namespace, listener?: Function): void;
43
+ /**
44
+ * 是否已监听某个事件
45
+ *
46
+ * @param type
47
+ * @param listener
48
+ */
49
+ has(type: string | Namespace, listener?: Function): boolean;
50
+ /**
51
+ * 把事件类型解析成命名空间格式
52
+ *
53
+ * @param type
54
+ */
55
+ parse(type: string): Namespace;
56
+ }
57
+ export {};
@@ -1,28 +1,28 @@
1
- import { Task } from '../type/type';
2
- export default class NextTask {
3
- /**
4
- * 全局单例
5
- */
6
- static shared(): NextTask;
7
- /**
8
- * 异步队列
9
- */
10
- tasks: Task[];
11
- constructor();
12
- /**
13
- * 在队尾添加异步任务
14
- */
15
- append(func: Function, context?: any): void;
16
- /**
17
- * 在队首添加异步任务
18
- */
19
- prepend(func: Function, context?: any): void;
20
- /**
21
- * 清空异步队列
22
- */
23
- clear(): void;
24
- /**
25
- * 立即执行异步任务,并清空队列
26
- */
27
- run(): void;
28
- }
1
+ import { Task } from '../type/type';
2
+ export default class NextTask {
3
+ /**
4
+ * 全局单例
5
+ */
6
+ static shared(): NextTask;
7
+ /**
8
+ * 异步队列
9
+ */
10
+ tasks: Task[];
11
+ constructor();
12
+ /**
13
+ * 在队尾添加异步任务
14
+ */
15
+ append(func: Function, context?: any): void;
16
+ /**
17
+ * 在队首添加异步任务
18
+ */
19
+ prepend(func: Function, context?: any): void;
20
+ /**
21
+ * 清空异步队列
22
+ */
23
+ clear(): void;
24
+ /**
25
+ * 立即执行异步任务,并清空队列
26
+ */
27
+ run(): void;
28
+ }
@@ -1,14 +1,14 @@
1
- /**
2
- * @file 等待操作
3
- * @author zhaogaoxing
4
- */
5
- export default class Sleep {
6
- private timeout;
7
- private timer;
8
- private resolve;
9
- private reject;
10
- private startTime;
11
- constructor(timeout: number);
12
- then(res: (value?: number) => void, rej: (value?: number) => void): void;
13
- stop(reslove?: boolean): void;
14
- }
1
+ /**
2
+ * @file 等待操作
3
+ * @author zhaogaoxing
4
+ */
5
+ export default class Sleep {
6
+ private timeout;
7
+ private timer;
8
+ private resolve;
9
+ private reject;
10
+ private startTime;
11
+ constructor(timeout: number);
12
+ then(res: (value?: number) => void, rej: (value?: number) => void): void;
13
+ stop(reslove?: boolean): void;
14
+ }