@ray-js/api 1.7.82 → 1.7.83
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/@types/api-extend.d.ts +189 -202
- package/lib/DeviceKit-4.13.1.d.ts +2 -1
- package/lib/DeviceKit-4.13.1.js +2 -1
- package/lib/WearKit-3.1.0.d.ts +6 -0
- package/lib/WearKit-3.1.0.js +10 -0
- package/package.json +5 -5
package/@types/api-extend.d.ts
CHANGED
|
@@ -1,110 +1,103 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
type OriginRequestCloudParams = Parameters<typeof ty.apiRequestByAtop>[0]
|
|
2
|
+
type OriginRequestCloudParams = Parameters<typeof ty.apiRequestByAtop>[0];
|
|
3
3
|
type RequestCloudParams = Omit<OriginRequestCloudParams, 'postData'> & {
|
|
4
|
-
data: OriginRequestCloudParams['postData']
|
|
5
|
-
}
|
|
6
|
-
type RequestCloudReturn = ReturnType<typeof ty.apiRequestByAtop
|
|
4
|
+
data: OriginRequestCloudParams['postData'];
|
|
5
|
+
};
|
|
6
|
+
type RequestCloudReturn = ReturnType<typeof ty.apiRequestByAtop>;
|
|
7
7
|
|
|
8
|
-
type IAnyObject = Record<string, any
|
|
8
|
+
type IAnyObject = Record<string, any>;
|
|
9
9
|
/** 启动参数 */
|
|
10
10
|
interface LaunchOptionsApp {
|
|
11
11
|
/** 启动小程序的路径 (代码包路径) */
|
|
12
|
-
path: string
|
|
12
|
+
path: string;
|
|
13
13
|
/** 启动小程序的 query 参数 */
|
|
14
|
-
query: IAnyObject
|
|
15
|
-
[key: string]: any
|
|
14
|
+
query: IAnyObject;
|
|
15
|
+
[key: string]: any;
|
|
16
16
|
}
|
|
17
17
|
interface GeneralCallbackResult {
|
|
18
|
-
[key: string]: any
|
|
18
|
+
[key: string]: any;
|
|
19
19
|
}
|
|
20
20
|
/** 小程序切前台事件的监听函数 */
|
|
21
21
|
type OnAppShowListeners = (
|
|
22
22
|
/** 启动参数 */
|
|
23
|
-
options?: LaunchOptionsApp
|
|
24
|
-
) => void
|
|
23
|
+
options?: LaunchOptionsApp,
|
|
24
|
+
) => void;
|
|
25
25
|
|
|
26
|
-
type OnThemeChangelisteners = (result: OnThemeChangeListenerResult) => void
|
|
27
|
-
type OffThemeChangelisteners = (result: OnThemeChangeListenerResult) => void
|
|
28
|
-
type OnWindowResizeListeners = (result: OnWindowResizeListenerResult) => void
|
|
29
|
-
type OffWindowResizeListeners = (result: OnWindowResizeListenerResult) => void
|
|
26
|
+
type OnThemeChangelisteners = (result: OnThemeChangeListenerResult) => void;
|
|
27
|
+
type OffThemeChangelisteners = (result: OnThemeChangeListenerResult) => void;
|
|
28
|
+
type OnWindowResizeListeners = (result: OnWindowResizeListenerResult) => void;
|
|
29
|
+
type OffWindowResizeListeners = (result: OnWindowResizeListenerResult) => void;
|
|
30
30
|
|
|
31
31
|
interface OnWindowResizeListenerResult {
|
|
32
|
-
type: string
|
|
33
|
-
size: { windowWidth: number; windowHeight: number }
|
|
32
|
+
type: string;
|
|
33
|
+
size: { windowWidth: number; windowHeight: number };
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface Callback {
|
|
37
|
-
success?: (res?: any) => void
|
|
38
|
-
fail?: (res?: any) => void
|
|
39
|
-
complete?: (res?: any) => void
|
|
37
|
+
success?: (res?: any) => void;
|
|
38
|
+
fail?: (res?: any) => void;
|
|
39
|
+
complete?: (res?: any) => void;
|
|
40
40
|
}
|
|
41
41
|
interface PageScrollToProps extends Callback {
|
|
42
|
-
scrollTop?: number
|
|
43
|
-
duration?: number
|
|
44
|
-
selector?: string
|
|
42
|
+
scrollTop?: number;
|
|
43
|
+
duration?: number;
|
|
44
|
+
selector?: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
interface CreateAnimationProps {
|
|
48
|
-
duration: number
|
|
49
|
-
timingFunction:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
| 'ease-in'
|
|
53
|
-
| 'ease-out'
|
|
54
|
-
| 'ease-in-out'
|
|
55
|
-
| 'step-start'
|
|
56
|
-
| 'step-end'
|
|
57
|
-
delay: number
|
|
58
|
-
transformOrigin: string
|
|
48
|
+
duration: number;
|
|
49
|
+
timingFunction: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'step-start' | 'step-end';
|
|
50
|
+
delay: number;
|
|
51
|
+
transformOrigin: string;
|
|
59
52
|
}
|
|
60
53
|
|
|
61
54
|
interface NodesRef {
|
|
62
|
-
fields(e: any, t: any): SelectorQuery
|
|
63
|
-
boundingClientRect(e?: any): SelectorQuery
|
|
64
|
-
scrollOffset(e?: any): SelectorQuery
|
|
55
|
+
fields(e: any, t: any): SelectorQuery;
|
|
56
|
+
boundingClientRect(e?: any): SelectorQuery;
|
|
57
|
+
scrollOffset(e?: any): SelectorQuery;
|
|
65
58
|
}
|
|
66
59
|
interface SelectorQuery {
|
|
67
|
-
select: (e: any) => NodesRef
|
|
68
|
-
selectAll: (e: any) => NodesRef
|
|
69
|
-
selectViewport: () => NodesRef
|
|
70
|
-
exec: (e: any) => void
|
|
60
|
+
select: (e: any) => NodesRef;
|
|
61
|
+
selectAll: (e: any) => NodesRef;
|
|
62
|
+
selectViewport: () => NodesRef;
|
|
63
|
+
exec: (e: any) => void;
|
|
71
64
|
}
|
|
72
65
|
|
|
73
66
|
interface CreateIntersectionObserverProps {
|
|
74
|
-
thresholds?: number[]
|
|
75
|
-
initialRatio?: number
|
|
76
|
-
observeAll?: boolean
|
|
67
|
+
thresholds?: number[];
|
|
68
|
+
initialRatio?: number;
|
|
69
|
+
observeAll?: boolean;
|
|
77
70
|
}
|
|
78
71
|
|
|
79
72
|
interface IntersectionMargin {
|
|
80
|
-
left?: number
|
|
81
|
-
right?: number
|
|
82
|
-
bottom?: number
|
|
83
|
-
top?: number
|
|
73
|
+
left?: number;
|
|
74
|
+
right?: number;
|
|
75
|
+
bottom?: number;
|
|
76
|
+
top?: number;
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
interface IntersectionObserveRect {
|
|
87
|
-
left?: number
|
|
88
|
-
right?: number
|
|
89
|
-
bottom?: number
|
|
90
|
-
top?: number
|
|
91
|
-
width?: number
|
|
92
|
-
height?: number
|
|
80
|
+
left?: number;
|
|
81
|
+
right?: number;
|
|
82
|
+
bottom?: number;
|
|
83
|
+
top?: number;
|
|
84
|
+
width?: number;
|
|
85
|
+
height?: number;
|
|
93
86
|
}
|
|
94
87
|
interface IntersectionObserveCbParam {
|
|
95
|
-
id: string
|
|
96
|
-
dataset: Record<string, any
|
|
97
|
-
intersectionRatio: number
|
|
98
|
-
intersectionRect: IntersectionObserveRect
|
|
99
|
-
boundingClientRect: IntersectionObserveRect
|
|
100
|
-
relativeRect: IntersectionObserveRect
|
|
101
|
-
time: number
|
|
88
|
+
id: string;
|
|
89
|
+
dataset: Record<string, any>;
|
|
90
|
+
intersectionRatio: number;
|
|
91
|
+
intersectionRect: IntersectionObserveRect;
|
|
92
|
+
boundingClientRect: IntersectionObserveRect;
|
|
93
|
+
relativeRect: IntersectionObserveRect;
|
|
94
|
+
time: number;
|
|
102
95
|
}
|
|
103
96
|
interface IntersectionObserver {
|
|
104
|
-
observe(targetSelector: string, cb: (e: IntersectionObserveCbParam) => void): IntersectionObserver
|
|
105
|
-
disconnect(): void
|
|
106
|
-
relativeTo(selector: string, margin: IntersectionMargin): IntersectionObserver
|
|
107
|
-
relativeToViewport(margin: IntersectionMargin): IntersectionObserver
|
|
97
|
+
observe(targetSelector: string, cb: (e: IntersectionObserveCbParam) => void): IntersectionObserver;
|
|
98
|
+
disconnect(): void;
|
|
99
|
+
relativeTo(selector: string, margin: IntersectionMargin): IntersectionObserver;
|
|
100
|
+
relativeToViewport(margin: IntersectionMargin): IntersectionObserver;
|
|
108
101
|
}
|
|
109
102
|
|
|
110
103
|
interface OnThemeChangeListenerResult {
|
|
@@ -113,80 +106,80 @@ interface OnThemeChangeListenerResult {
|
|
|
113
106
|
* 可选值:
|
|
114
107
|
* - 'dark': 深色主题;
|
|
115
108
|
* - 'light': 浅色主题; */
|
|
116
|
-
theme: 'dark' | 'light'
|
|
109
|
+
theme: 'dark' | 'light';
|
|
117
110
|
}
|
|
118
111
|
|
|
119
112
|
interface setNavigationBarBackParam {
|
|
120
|
-
type: 'system' | 'custom'
|
|
113
|
+
type: 'system' | 'custom';
|
|
121
114
|
}
|
|
122
115
|
|
|
123
116
|
interface CanvasGetImageDataProps extends Callback {
|
|
124
|
-
canvasId: string
|
|
125
|
-
x: number
|
|
126
|
-
y: number
|
|
127
|
-
width: number
|
|
128
|
-
height: number
|
|
129
|
-
success(res: { width: number; height: number; data: Array }): void
|
|
117
|
+
canvasId: string;
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
success(res: { width: number; height: number; data: Array }): void;
|
|
130
123
|
}
|
|
131
124
|
|
|
132
125
|
interface CanvasPutImageDataProps extends Callback {
|
|
133
|
-
canvasId: string
|
|
134
|
-
x: number
|
|
135
|
-
y: number
|
|
136
|
-
width: number
|
|
137
|
-
height: number
|
|
138
|
-
data: Array
|
|
126
|
+
canvasId: string;
|
|
127
|
+
x: number;
|
|
128
|
+
y: number;
|
|
129
|
+
width: number;
|
|
130
|
+
height: number;
|
|
131
|
+
data: Array;
|
|
139
132
|
}
|
|
140
133
|
|
|
141
134
|
interface VideoContext {
|
|
142
|
-
play(): void
|
|
143
|
-
pause(): void
|
|
144
|
-
stop(): void
|
|
145
|
-
playbackRate(rate: number): void
|
|
146
|
-
seek(position: number): void
|
|
147
|
-
sendDanmu(data: { text: string; color: string }): void
|
|
135
|
+
play(): void;
|
|
136
|
+
pause(): void;
|
|
137
|
+
stop(): void;
|
|
138
|
+
playbackRate(rate: number): void;
|
|
139
|
+
seek(position: number): void;
|
|
140
|
+
sendDanmu(data: { text: string; color: string }): void;
|
|
148
141
|
}
|
|
149
142
|
|
|
150
143
|
interface NativeVideoContext {
|
|
151
|
-
play(): void
|
|
152
|
-
pause(): void
|
|
153
|
-
stop(): void
|
|
154
|
-
playbackRate(rate: number): void
|
|
155
|
-
seek(position: number): void
|
|
144
|
+
play(): void;
|
|
145
|
+
pause(): void;
|
|
146
|
+
stop(): void;
|
|
147
|
+
playbackRate(rate: number): void;
|
|
148
|
+
seek(position: number): void;
|
|
156
149
|
}
|
|
157
150
|
|
|
158
151
|
interface AddMarker extends Callback {
|
|
159
|
-
markers: any[]
|
|
160
|
-
clear?: boolean
|
|
152
|
+
markers: any[];
|
|
153
|
+
clear?: boolean;
|
|
161
154
|
}
|
|
162
155
|
interface RemoveMarkers extends Callback {
|
|
163
|
-
markerIds: string[]
|
|
164
|
-
clear?: boolean
|
|
156
|
+
markerIds: string[];
|
|
157
|
+
clear?: boolean;
|
|
165
158
|
}
|
|
166
159
|
interface GetScale extends Callback {
|
|
167
|
-
success({ scale: number }): void
|
|
160
|
+
success({ scale: number }): void;
|
|
168
161
|
}
|
|
169
162
|
interface GetCenterLocation extends Callback {
|
|
170
|
-
iconPath?: string
|
|
171
|
-
clear?: boolean
|
|
172
|
-
success({ longitude: number, latitude: number }): void
|
|
163
|
+
iconPath?: string;
|
|
164
|
+
clear?: boolean;
|
|
165
|
+
success({ longitude: number, latitude: number }): void;
|
|
173
166
|
}
|
|
174
167
|
interface MoveToLocation extends Callback {
|
|
175
|
-
longitude: number
|
|
176
|
-
latitude: number
|
|
168
|
+
longitude: number;
|
|
169
|
+
latitude: number;
|
|
177
170
|
}
|
|
178
171
|
interface MoveAlong extends Callback {
|
|
179
|
-
markerId: number
|
|
180
|
-
path: Array<{ longitude: number; latitude: number }
|
|
181
|
-
duration: number
|
|
172
|
+
markerId: number;
|
|
173
|
+
path: Array<{ longitude: number; latitude: number }>;
|
|
174
|
+
duration: number;
|
|
182
175
|
}
|
|
183
176
|
interface MapContext {
|
|
184
|
-
addMarkers(data: AddMarker): void
|
|
185
|
-
removeMarkers(data: RemoveMarkers): void
|
|
186
|
-
getScale(data: GetScale): void
|
|
187
|
-
getCenterLocation(data: GetCenterLocation): void
|
|
188
|
-
moveToLocation(data: MoveToLocation): void
|
|
189
|
-
moveAlong(data: MoveAlong): void
|
|
177
|
+
addMarkers(data: AddMarker): void;
|
|
178
|
+
removeMarkers(data: RemoveMarkers): void;
|
|
179
|
+
getScale(data: GetScale): void;
|
|
180
|
+
getCenterLocation(data: GetCenterLocation): void;
|
|
181
|
+
moveToLocation(data: MoveToLocation): void;
|
|
182
|
+
moveAlong(data: MoveAlong): void;
|
|
190
183
|
}
|
|
191
184
|
|
|
192
185
|
interface IpcContext {
|
|
@@ -210,6 +203,7 @@ interface IpcContext {
|
|
|
210
203
|
setPTZControllable(res: Callback & { pTZControllable?: 0 | 1 }): void;
|
|
211
204
|
closeFloatingWindow(res?: Callback): void;
|
|
212
205
|
openFloatingWindow(res?: Callback): void;
|
|
206
|
+
showSmallMonitor(res: Callback & { show: boolean }): void;
|
|
213
207
|
getVideoInfo(res?: Callback): void;
|
|
214
208
|
isMuted(res?: Callback): void;
|
|
215
209
|
isConnected(res?: Callback): void;
|
|
@@ -265,17 +259,17 @@ interface IpcContext {
|
|
|
265
259
|
verticalStripAspect: number;
|
|
266
260
|
},
|
|
267
261
|
): void;
|
|
268
|
-
/**
|
|
262
|
+
/**
|
|
269
263
|
* 设置是否锁定 VR 球面画面(重力感应)
|
|
270
264
|
* @param options.locked - 是否锁定重力感应
|
|
271
265
|
*/
|
|
272
266
|
setVRViewLocked(options: Callback & { locked: boolean }): void;
|
|
273
|
-
/**
|
|
274
|
-
* 获取 VR 球面画面锁定状态
|
|
267
|
+
/**
|
|
268
|
+
* 获取 VR 球面画面锁定状态
|
|
275
269
|
*/
|
|
276
270
|
getVRViewLocked(options: Callback): void;
|
|
277
|
-
/**
|
|
278
|
-
* 图片展示(VR)
|
|
271
|
+
/**
|
|
272
|
+
* 图片展示(VR)
|
|
279
273
|
* @param options.path - 图片远程路径
|
|
280
274
|
* @param options.encryptKey - 图片加密 key
|
|
281
275
|
*/
|
|
@@ -285,49 +279,44 @@ interface IpcContext {
|
|
|
285
279
|
interface CameraContext {
|
|
286
280
|
takePhoto(
|
|
287
281
|
res: Callback & {
|
|
288
|
-
quality?: 'normal' | 'high' | 'low'
|
|
289
|
-
success(res: { tempImagePath: string }): void
|
|
290
|
-
}
|
|
291
|
-
): void
|
|
292
|
-
setZoom(res: Callback & { zoom: number; success(res: { zoom: number }): void }): void
|
|
282
|
+
quality?: 'normal' | 'high' | 'low';
|
|
283
|
+
success(res: { tempImagePath: string }): void;
|
|
284
|
+
},
|
|
285
|
+
): void;
|
|
286
|
+
setZoom(res: Callback & { zoom: number; success(res: { zoom: number }): void }): void;
|
|
293
287
|
}
|
|
294
288
|
|
|
295
289
|
interface WebviewContext {
|
|
296
|
-
postMessage(options: { data: Record<string, any> }): void
|
|
297
|
-
reload(options: Callback): void
|
|
290
|
+
postMessage(options: { data: Record<string, any> }): void;
|
|
291
|
+
reload(options: Callback): void;
|
|
298
292
|
}
|
|
299
293
|
|
|
300
294
|
interface SocketTask {
|
|
301
|
-
send(option: {
|
|
302
|
-
data: string | ArrayBuffer
|
|
303
|
-
success?: () => void
|
|
304
|
-
fail?: () => void
|
|
305
|
-
complete?: () => void
|
|
306
|
-
}): void
|
|
295
|
+
send(option: { data: string | ArrayBuffer; success?: () => void; fail?: () => void; complete?: () => void }): void;
|
|
307
296
|
close(option: {
|
|
308
|
-
code?: number
|
|
309
|
-
reason?: string
|
|
310
|
-
success?: () => void
|
|
311
|
-
fail?: () => void
|
|
312
|
-
complete?: () => void
|
|
313
|
-
}): void
|
|
314
|
-
onOpen(callback: () => void): void
|
|
315
|
-
onClose(callback: () => void): void
|
|
316
|
-
onError(callback: () => void): void
|
|
317
|
-
onMessage(callback: (res: { data: string | ArrayBuffer }) => void): void
|
|
297
|
+
code?: number;
|
|
298
|
+
reason?: string;
|
|
299
|
+
success?: () => void;
|
|
300
|
+
fail?: () => void;
|
|
301
|
+
complete?: () => void;
|
|
302
|
+
}): void;
|
|
303
|
+
onOpen(callback: () => void): void;
|
|
304
|
+
onClose(callback: () => void): void;
|
|
305
|
+
onError(callback: () => void): void;
|
|
306
|
+
onMessage(callback: (res: { data: string | ArrayBuffer }) => void): void;
|
|
318
307
|
}
|
|
319
308
|
|
|
320
309
|
interface ConnectSocketProps {
|
|
321
|
-
url: string
|
|
322
|
-
protocols?: string[]
|
|
323
|
-
header?: Record<string, string
|
|
324
|
-
timeout?: number
|
|
325
|
-
tcpNoDelay?: boolean
|
|
326
|
-
perMessageDeflate?: boolean
|
|
327
|
-
forceCellularNetwork?: boolean
|
|
328
|
-
success?: () => void
|
|
329
|
-
fail?: () => void
|
|
330
|
-
complete?: () => void
|
|
310
|
+
url: string;
|
|
311
|
+
protocols?: string[];
|
|
312
|
+
header?: Record<string, string>;
|
|
313
|
+
timeout?: number;
|
|
314
|
+
tcpNoDelay?: boolean;
|
|
315
|
+
perMessageDeflate?: boolean;
|
|
316
|
+
forceCellularNetwork?: boolean;
|
|
317
|
+
success?: () => void;
|
|
318
|
+
fail?: () => void;
|
|
319
|
+
complete?: () => void;
|
|
331
320
|
}
|
|
332
321
|
|
|
333
322
|
declare namespace ty {
|
|
@@ -337,7 +326,7 @@ declare namespace ty {
|
|
|
337
326
|
* @since xxx@1.2.10
|
|
338
327
|
* @plugin xxx@1.1.2
|
|
339
328
|
*/
|
|
340
|
-
export function requestCloud(params: RequestCloudParams): RequestCloudReturn
|
|
329
|
+
export function requestCloud(params: RequestCloudParams): RequestCloudReturn;
|
|
341
330
|
|
|
342
331
|
/**
|
|
343
332
|
* 请求小程序
|
|
@@ -345,59 +334,57 @@ declare namespace ty {
|
|
|
345
334
|
* @since xxx@1.2.10
|
|
346
335
|
* @plugin xxx@1.1.2
|
|
347
336
|
*/
|
|
348
|
-
export function requestCloud<T>(params: RequestCloudParams): Promise<T
|
|
337
|
+
export function requestCloud<T>(params: RequestCloudParams): Promise<T>;
|
|
349
338
|
|
|
350
|
-
export function onAppShow(listeners: OnAppShowListeners)
|
|
351
|
-
export function offAppShow(listeners?: (res: GeneralCallbackResult) => void)
|
|
352
|
-
export function onAppHide(listener: (res: GeneralCallbackResult) => void)
|
|
353
|
-
export function offAppHide(listeners?: (res: GeneralCallbackResult) => void)
|
|
354
|
-
export function onWindowResize(listeners: OnWindowResizeListeners)
|
|
355
|
-
export function offWindowResize(listeners?: OffWindowResizeListeners)
|
|
339
|
+
export function onAppShow(listeners: OnAppShowListeners);
|
|
340
|
+
export function offAppShow(listeners?: (res: GeneralCallbackResult) => void);
|
|
341
|
+
export function onAppHide(listener: (res: GeneralCallbackResult) => void);
|
|
342
|
+
export function offAppHide(listeners?: (res: GeneralCallbackResult) => void);
|
|
343
|
+
export function onWindowResize(listeners: OnWindowResizeListeners);
|
|
344
|
+
export function offWindowResize(listeners?: OffWindowResizeListeners);
|
|
356
345
|
export function onError(
|
|
357
346
|
listeners: (
|
|
358
347
|
/** 错误信息,包含堆栈 */
|
|
359
|
-
error?: string
|
|
360
|
-
) => void
|
|
361
|
-
)
|
|
362
|
-
export function offError(listeners?: (res: GeneralCallbackResult) => void)
|
|
363
|
-
export function onAppEvent(listener: (res: GeneralCallbackResult) => void)
|
|
364
|
-
export function offAppEvent(listener?: (res: GeneralCallbackResult) => void)
|
|
365
|
-
export function onThemeChange(listener: OnThemeChangelisteners)
|
|
366
|
-
export function offThemeChange(listener?: OffThemeChangelisteners)
|
|
367
|
-
export function onPageNotFound(listeners: ({ url: string, query: CommonObject }) => void)
|
|
368
|
-
export function onNavigationBarBack(callback: (res?: any) => void)
|
|
369
|
-
export function offNavigationBarBack(callback: (res?: any) => void)
|
|
370
|
-
export function setNavigationBarBack(param: setNavigationBarBackParam)
|
|
348
|
+
error?: string,
|
|
349
|
+
) => void,
|
|
350
|
+
);
|
|
351
|
+
export function offError(listeners?: (res: GeneralCallbackResult) => void);
|
|
352
|
+
export function onAppEvent(listener: (res: GeneralCallbackResult) => void);
|
|
353
|
+
export function offAppEvent(listener?: (res: GeneralCallbackResult) => void);
|
|
354
|
+
export function onThemeChange(listener: OnThemeChangelisteners);
|
|
355
|
+
export function offThemeChange(listener?: OffThemeChangelisteners);
|
|
356
|
+
export function onPageNotFound(listeners: ({ url: string, query: CommonObject }) => void);
|
|
357
|
+
export function onNavigationBarBack(callback: (res?: any) => void);
|
|
358
|
+
export function offNavigationBarBack(callback: (res?: any) => void);
|
|
359
|
+
export function setNavigationBarBack(param: setNavigationBarBackParam);
|
|
371
360
|
/**
|
|
372
361
|
* 0.10.3
|
|
373
362
|
*/
|
|
374
|
-
export function createAnimation(param: CreateAnimationProps): IAnimation
|
|
375
|
-
export function pageScrollTo(param: PageScrollToProps): void
|
|
376
|
-
export function createSelectorQuery(): SelectorQuery
|
|
377
|
-
export function createIntersectionObserver(
|
|
378
|
-
|
|
379
|
-
):
|
|
380
|
-
export function
|
|
381
|
-
export function
|
|
382
|
-
export function
|
|
383
|
-
export function
|
|
384
|
-
export function
|
|
385
|
-
export function
|
|
386
|
-
export function
|
|
387
|
-
export function createCameraContext(): CameraContext
|
|
388
|
-
export function createWebviewContext(mapId: string): WebviewContext
|
|
363
|
+
export function createAnimation(param: CreateAnimationProps): IAnimation;
|
|
364
|
+
export function pageScrollTo(param: PageScrollToProps): void;
|
|
365
|
+
export function createSelectorQuery(): SelectorQuery;
|
|
366
|
+
export function createIntersectionObserver(param: CreateIntersectionObserverProps): IntersectionObserver;
|
|
367
|
+
export function createCanvasContext(canvasId: string): any;
|
|
368
|
+
export function canvasGetImageData(param: CanvasGetImageDataProps): void;
|
|
369
|
+
export function canvasPutImageData(param: CanvasPutImageDataProps): void;
|
|
370
|
+
export function createVideoContext(id: string): VideoContext;
|
|
371
|
+
export function createNativeVideoContext(id: string): NativeVideoContext;
|
|
372
|
+
export function createMapContext(mapId: string): MapContext;
|
|
373
|
+
export function createIpcPlayerContext(deviceId: string): IpcContext;
|
|
374
|
+
export function createCameraContext(): CameraContext;
|
|
375
|
+
export function createWebviewContext(mapId: string): WebviewContext;
|
|
389
376
|
export type env = {
|
|
390
|
-
USER_DATA_PATH: string
|
|
391
|
-
}
|
|
392
|
-
export function connectSocket(param: ConnectSocketProps): SocketTask
|
|
377
|
+
USER_DATA_PATH: string;
|
|
378
|
+
};
|
|
379
|
+
export function connectSocket(param: ConnectSocketProps): SocketTask;
|
|
393
380
|
|
|
394
|
-
type IRegionCode = 'AY' | 'AZ' | 'EU' | 'IN' | 'UE' | 'WE' | 'RU'
|
|
381
|
+
type IRegionCode = 'AY' | 'AZ' | 'EU' | 'IN' | 'UE' | 'WE' | 'RU';
|
|
395
382
|
|
|
396
383
|
/**
|
|
397
384
|
* 获取当前小程序的区域码
|
|
398
385
|
* @returns 区域码 可选值:AY, AZ, EU, IN, RU, UE, WE
|
|
399
386
|
*/
|
|
400
|
-
export function getRegionCode(): IRegionCode
|
|
387
|
+
export function getRegionCode(): IRegionCode;
|
|
401
388
|
|
|
402
389
|
/**
|
|
403
390
|
* @description对页面内的唯一元素进行截图
|
|
@@ -413,28 +400,28 @@ declare namespace ty {
|
|
|
413
400
|
* 注意: 可能由于页面样式的复杂度因素,截图结果可能会有所不同,如遇到此类问题,可尝试调整页面样式
|
|
414
401
|
*/
|
|
415
402
|
export function snapshot(params: {
|
|
416
|
-
selector?: string
|
|
417
|
-
backgroundColor?: string
|
|
418
|
-
format?: string
|
|
419
|
-
quality?: number
|
|
403
|
+
selector?: string;
|
|
404
|
+
backgroundColor?: string;
|
|
405
|
+
format?: string;
|
|
406
|
+
quality?: number;
|
|
420
407
|
success?: (params: {
|
|
421
408
|
/** 截图的临时文件路径 */
|
|
422
|
-
tempFilePath: string
|
|
423
|
-
}) => void
|
|
409
|
+
tempFilePath: string;
|
|
410
|
+
}) => void;
|
|
424
411
|
fail?: (params: {
|
|
425
|
-
errorMsg: string
|
|
426
|
-
errorCode: string | number
|
|
412
|
+
errorMsg: string;
|
|
413
|
+
errorCode: string | number;
|
|
427
414
|
innerError?: {
|
|
428
|
-
errorCode: string | number
|
|
429
|
-
errorMsg: string
|
|
430
|
-
}
|
|
431
|
-
}) => void
|
|
432
|
-
complete?: () => void
|
|
433
|
-
}): void
|
|
415
|
+
errorCode: string | number;
|
|
416
|
+
errorMsg: string;
|
|
417
|
+
};
|
|
418
|
+
}) => void;
|
|
419
|
+
complete?: () => void;
|
|
420
|
+
}): void;
|
|
434
421
|
}
|
|
435
422
|
|
|
436
423
|
declare namespace WechatMiniprogram {
|
|
437
424
|
interface Wx {
|
|
438
|
-
requestCloud(params: RequestCloudParams): RequestCloudReturn
|
|
425
|
+
requestCloud(params: RequestCloudParams): RequestCloudReturn;
|
|
439
426
|
}
|
|
440
427
|
}
|
|
@@ -1145,7 +1145,8 @@ export declare const validDeviceOnlineType: typeof ty.device.validDeviceOnlineTy
|
|
|
1145
1145
|
export declare const publishDpsBase: typeof ty.device.publishDps;
|
|
1146
1146
|
/**
|
|
1147
1147
|
* @public
|
|
1148
|
-
* @since @ray-js/ray
|
|
1148
|
+
* @since @ray-js/ray 1.7.68
|
|
1149
|
+
* @remarks 如 @ray-js/ray < 1.7.68,可使用别名 `publishDpsBase`,用法一致
|
|
1149
1150
|
* @example 基础调用
|
|
1150
1151
|
* ```tsx
|
|
1151
1152
|
* import { device } from '@ray-js/ray';
|
package/lib/DeviceKit-4.13.1.js
CHANGED
|
@@ -1257,7 +1257,8 @@ export const publishDpsBase = factory('publishDps', {
|
|
|
1257
1257
|
});
|
|
1258
1258
|
/**
|
|
1259
1259
|
* @public
|
|
1260
|
-
* @since @ray-js/ray
|
|
1260
|
+
* @since @ray-js/ray 1.7.68
|
|
1261
|
+
* @remarks 如 @ray-js/ray < 1.7.68,可使用别名 `publishDpsBase`,用法一致
|
|
1261
1262
|
* @example 基础调用
|
|
1262
1263
|
* ```tsx
|
|
1263
1264
|
* import { device } from '@ray-js/ray';
|
package/lib/WearKit-3.1.0.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/// <reference path="../@types/WearKit.d.ts" />
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
* @since @ray-js/ray 1.7.14
|
|
5
|
+
* @deprecated @ray-js/ray 1.7.82起废弃,改用 startAudioRecording
|
|
6
|
+
*/
|
|
7
|
+
export declare const startRecordTransfer: typeof ty.wear.startRecordTransfer;
|
|
2
8
|
/**
|
|
3
9
|
* @public
|
|
4
10
|
* @since @ray-js/ray 1.7.14
|
package/lib/WearKit-3.1.0.js
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import { createFactory } from './utils';
|
|
4
4
|
const factory = createFactory('WearKit');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
* @since @ray-js/ray 1.7.14
|
|
9
|
+
* @deprecated @ray-js/ray 1.7.82起废弃,改用 startAudioRecording
|
|
10
|
+
*/
|
|
11
|
+
export const startRecordTransfer = factory('startRecordTransfer', {
|
|
12
|
+
namespace: 'wear'
|
|
13
|
+
});
|
|
14
|
+
|
|
5
15
|
/**
|
|
6
16
|
* @public
|
|
7
17
|
* @since @ray-js/ray 1.7.14
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/api",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.83",
|
|
4
4
|
"description": "Ray universal api",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"watch": "ray start --type=component"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ray-js/framework": "1.7.
|
|
33
|
-
"@ray-js/router": "1.7.
|
|
32
|
+
"@ray-js/framework": "1.7.83",
|
|
33
|
+
"@ray-js/router": "1.7.83",
|
|
34
34
|
"base64-browser": "^1.0.1",
|
|
35
35
|
"query-string": "^7.1.3"
|
|
36
36
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@ray-js/wechat": "^0.3.13"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@ray-js/cli": "1.7.
|
|
41
|
+
"@ray-js/cli": "1.7.83",
|
|
42
42
|
"art-template": "^4.13.4",
|
|
43
43
|
"fs-extra": "^10.1.0",
|
|
44
44
|
"miniprogram-api-typings": "^3.12.3",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"access": "public",
|
|
49
49
|
"registry": "https://registry.npmjs.org"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "f431d6e9c446b1f0668fcb11f04c5df98a3c0ac2"
|
|
52
52
|
}
|