@dcloudio/uni-app-x 0.7.99 → 0.7.101

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-app-x",
3
- "version": "0.7.99",
3
+ "version": "0.7.101",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "main": "index.d.ts",
@@ -17,52 +17,52 @@ declare global {
17
17
  | UniSharedDataFunctionEventListener
18
18
  | UniSharedDataFunctionSetTemplateRef
19
19
 
20
- type UniSharedDataFunctionEventListener = (event : UniEvent) => void
21
- type UniSharedDataFunctionSetTemplateRef = (el : UniElement) => void
20
+ type UniSharedDataFunctionEventListener = (event: UniEvent) => void
21
+ type UniSharedDataFunctionSetTemplateRef = (el: UniElement) => void
22
22
 
23
23
  class UniSharedData {
24
24
  /**
25
25
  * 所属文件
26
26
  * @internal
27
27
  */
28
- _filename ?: string | null
28
+ _filename?: string | null
29
29
  /**
30
30
  * ArkTS/Kotlin/JavaScript 层数据缓存,主要用于判断属性值是否有变化
31
31
  * @internal
32
32
  */
33
- _cacheProps : Map<string, UniSharedDataAny>
33
+ _cacheProps: Map<string, UniSharedDataAny>
34
34
  /**
35
35
  * 所属页面,用于批量执行响应式变更
36
36
  * @internal
37
37
  */
38
- _scope : UniSharedDataPage
38
+ _scope: UniSharedDataPage
39
39
  /**
40
40
  * 是否已初始化完成,主要用于二次更新时触发响应式
41
41
  * @internal
42
42
  */
43
- _setReady() : void
43
+ _setReady(): void
44
44
  /**
45
45
  * 属性变更时收集 Jobs
46
46
  * @internal
47
47
  */
48
- _queueJobs : (key : string) => void
48
+ _queueJobs: (key: string) => void
49
49
  /**
50
50
  * 设置 callMethod,用于 script cpp 调用 $callMethod 方法
51
51
  * @internal
52
52
  */
53
- _setCallMethod(fn : (...args : any[]) => void) : void
53
+ _setCallMethod(fn: (...args: any[]) => void): void
54
54
  /**
55
55
  * 重置当前数据对象的所有标记位
56
56
  * @internal
57
57
  */
58
- _resetFlags() : void
59
- constructor(scope : UniSharedDataPage)
58
+ _resetFlags(): void
59
+ constructor(scope: UniSharedDataPage)
60
60
  }
61
61
 
62
62
  enum UniSharedDataComponentStyleIsolation {
63
63
  Isolated,
64
64
  App,
65
- AppAndPage
65
+ AppAndPage,
66
66
  }
67
67
 
68
68
  enum UniSharedDataComponentRenderer {
@@ -77,79 +77,103 @@ declare global {
77
77
  }
78
78
 
79
79
  interface UniSharedDataComponentOptions {
80
- vueId : number
81
- styleIsolation : UniSharedDataComponentStyleIsolation
82
- renderer : UniSharedDataComponentRenderer
83
- flatten : UniSharedDataComponentFlatten
80
+ vueId: number
81
+ styleIsolation: UniSharedDataComponentStyleIsolation
82
+ renderer: UniSharedDataComponentRenderer
83
+ flatten: UniSharedDataComponentFlatten
84
84
  }
85
85
 
86
86
  abstract class UniSharedDataComponent extends UniSharedData {
87
87
  /**
88
88
  * 组件的类名
89
89
  */
90
- static className : string
90
+ static className: string
91
91
  /**
92
92
  * 当前页面或组件的样式表
93
93
  * @internal
94
94
  */
95
- static styleSheet : Map<string, Map<string, Map<number, any>>>
95
+ static styleSheet: Map<string, Map<string, Map<number, any>>>
96
96
  /**
97
97
  * vue实例ID
98
98
  * @internal
99
99
  */
100
- _vueId : number
100
+ _vueId: number
101
101
  /**
102
102
  * 当前页面或组件关联的 UniPage 对象
103
103
  * @internal
104
104
  */
105
- _page : UniPage
105
+ _page: UniPage
106
106
  /**
107
107
  * 当前组件所在的上下文,主要用于查找上下文组件的样式表
108
108
  * @internal
109
109
  */
110
- _ctx : UniSharedDataComponent | null
110
+ _ctx: UniSharedDataComponent | null
111
111
  /**
112
112
  * 当前组件或页面样式隔离策略
113
113
  */
114
- _styleIsolation : UniSharedDataComponentStyleIsolation
114
+ _styleIsolation: UniSharedDataComponentStyleIsolation
115
115
  /**
116
116
  * 当前组件实例是否拍平
117
117
  */
118
- _flatten : UniSharedDataComponentFlatten
118
+ _flatten: UniSharedDataComponentFlatten
119
119
  /**
120
120
  * 当前组件或页面渲染类型,页面也有可能作为组件来渲染
121
121
  */
122
- _renderer : UniSharedDataComponentRenderer
122
+ _renderer: UniSharedDataComponentRenderer
123
123
  /**
124
124
  * 自定义组件需要透传的属性
125
125
  * @internal
126
126
  */
127
- _inheritAttrs : UniSharedDataJSONObject
128
- constructor(scope : UniSharedDataPage, options : UniSharedDataComponentOptions)
127
+ _inheritAttrs: UniSharedDataJSONObject
128
+ constructor(scope: UniSharedDataPage, options: UniSharedDataComponentOptions)
129
129
  /**
130
130
  * 自定义组件需要透传的属性,需要暴露给前端设置: set_inheritAttrs()
131
131
  * @param attrs
132
132
  */
133
- set_inheritAttrs(attrs : UniSharedDataJSONObject) : void
133
+ set_inheritAttrs(attrs: UniSharedDataJSONObject): void
134
134
  /**
135
135
  * 监听组件根节点样式变更
136
136
  * @internal
137
137
  */
138
- useComputedStyle(options : {
139
- properties : number[]
140
- filterProperties ?: boolean | null
141
- callback : (result : Array<[string, any | null]>) => void
142
- }) : Map<string, any | null>
138
+ useComputedStyle(options: {
139
+ properties: number[]
140
+ filterProperties?: boolean | null
141
+ callback: (result: Array<[string, any | null]>) => void
142
+ }): Map<string, any | null>
143
+ /**
144
+ * 目前仅限 android 平台
145
+ * 文本布局缓存数组
146
+ * @internal
147
+ */
148
+ _textLayouts: Array<[number, number, number]>
149
+ /**
150
+ * 目前仅限 android 平台
151
+ * 创建文本布局(先缓存,后批量同步至kotlin层)
152
+ * 接收三个参数:nodeId, fid, eid
153
+ * 内部存储为数组解构_textLayouts[[nodeId, fid, eid]]
154
+ * 应该统一存储在scope中(即页面上)
155
+ * @internal
156
+ */
157
+ _createTextLayout(nodeId: number, fid: number, eid: number): void
158
+ /**
159
+ * 目前仅限 android 平台
160
+ * 批量同步文本布局至kotlin层,kotlin层会根据_textLayouts数组进行处理(编译器生成指定函数switch执行具体的创建逻辑)
161
+ * 需要确保调用时机(确保在排版之前同步触发):
162
+ * 当页面首次渲染时,在调用c层renderElement之后同步调用
163
+ * 当页面二次更新时,在flushJobs中所有element jobs执行完之后调用
164
+ * @internal
165
+ */
166
+ _flushTextLayouts(): void
143
167
  /**
144
168
  * 由编译器动态生成的子类中的 Element 渲染器
145
169
  * @internal
146
170
  */
147
- abstract _renderElement() : UniElementBlock
171
+ abstract _renderElement(): UniElementBlock
148
172
  /**
149
173
  * 由编译器动态生成的子类中的 NativeView 渲染器
150
174
  * @internal
151
175
  */
152
- abstract _renderNativeView() : UniNativeViewBlock
176
+ abstract _renderNativeView(): UniNativeViewBlock
153
177
  }
154
178
 
155
179
  abstract class UniSharedDataPage extends UniSharedDataComponent {
@@ -158,29 +182,29 @@ declare global {
158
182
  * key 是组件class名称
159
183
  * @internal
160
184
  */
161
- _styleSheetCache : Map<string, Map<string, Map<string, Map<string, unknown>>>>
185
+ _styleSheetCache: Map<string, Map<string, Map<string, Map<string, unknown>>>>
162
186
  /**
163
187
  * 本次更新收集到的element Jobs,用于批量执行响应式变更(c层)
164
188
  * @internal
165
189
  */
166
- _elementJobs : Array<ReactiveEffect<any | null>>
190
+ _elementJobs: Array<ReactiveEffect<any | null>>
167
191
  /**
168
192
  * 本次更新收集到的kotlin element Jobs,用于批量执行响应式变更
169
193
  * @internal
170
194
  */
171
- _kotlinElementJobs : Array<ReactiveEffect<any | null>>
195
+ _kotlinElementJobs: Array<ReactiveEffect<any | null>>
172
196
  /**
173
197
  * 本次更新收集到的nativeView Jobs,用于批量执行响应式变更
174
198
  * @internal
175
199
  */
176
- _nativeViewJobs : Array<ReactiveEffect<any | null>>
200
+ _nativeViewJobs: Array<ReactiveEffect<any | null>>
177
201
 
178
- constructor(pageId : number, options : UniSharedDataComponentOptions)
202
+ constructor(pageId: number, options: UniSharedDataComponentOptions)
179
203
  /**
180
204
  * 批量执行响应式变更
181
205
  * @internal
182
206
  */
183
- _flushJobs : () => Promise<void> | void
207
+ _flushJobs: () => Promise<void> | void
184
208
  /**
185
209
  * 页面渲染函数
186
210
  * 调用页面的 _renderElement 和 _renderNativeView
@@ -188,7 +212,7 @@ declare global {
188
212
  * 拿到两个渲染器执行后的 Block 后,插入到页面的根 NativeView 和根 Dom元素中
189
213
  * @internal
190
214
  */
191
- _render : () => Promise<void>
215
+ _render: () => Promise<void>
192
216
  }
193
217
 
194
218
  abstract class UniSharedDataApp extends UniSharedData {
@@ -196,7 +220,7 @@ declare global {
196
220
  * 当前应用全局样式
197
221
  * @internal
198
222
  */
199
- static styleSheet : Map<string, Map<string, Map<number, any>>>
223
+ static styleSheet: Map<string, Map<string, Map<number, any>>>
200
224
  }
201
225
 
202
226
  enum UniSharedDataVForDirty {
@@ -215,7 +239,7 @@ declare global {
215
239
  }
216
240
 
217
241
  type UniSharedDataVForMount = {
218
- readonly index : number
242
+ readonly index: number
219
243
  }
220
244
 
221
245
  type UniSharedDataVForUnmount = {
@@ -223,9 +247,9 @@ declare global {
223
247
  * 需要移除的索引值
224
248
  * 重要:该索引值是oldBlocks中的索引值
225
249
  */
226
- readonly index : number
227
- readonly doRemove : boolean
228
- readonly doDeregister : boolean
250
+ readonly index: number
251
+ readonly doRemove: boolean
252
+ readonly doDeregister: boolean
229
253
  }
230
254
 
231
255
  type UniSharedDataVForUpdate = {
@@ -233,21 +257,21 @@ declare global {
233
257
  * 需要更新的索引值
234
258
  * update((newBlocks[index] = oldBlocks[oldIndex]), getItem(source, i))
235
259
  */
236
- readonly index : number
260
+ readonly index: number
237
261
  /**
238
262
  * 旧索引值
239
263
  */
240
- readonly oldIndex : number
264
+ readonly oldIndex: number
241
265
  }
242
266
 
243
267
  class UniSharedDataVFor<T extends UniSharedData> extends UniSharedData {
244
- setData(data : T[]) : void
245
- setMount(mount : UniSharedDataVForMount[]) : void
246
- setUnmount(unmount : UniSharedDataVForUnmount[]) : void
247
- setUpdate(update : UniSharedDataVForUpdate[]) : void
248
- setDirty(dirty : UniSharedDataVForDirty) : void
249
- create : () => T
250
- constructor(scope : UniSharedDataPage)
268
+ setData(data: T[]): void
269
+ setMount(mount: UniSharedDataVForMount[]): void
270
+ setUnmount(unmount: UniSharedDataVForUnmount[]): void
271
+ setUpdate(update: UniSharedDataVForUpdate[]): void
272
+ setDirty(dirty: UniSharedDataVForDirty): void
273
+ create: () => T
274
+ constructor(scope: UniSharedDataPage)
251
275
  }
252
276
 
253
277
  class VueReactivity { }
@@ -258,18 +282,21 @@ declare global {
258
282
 
259
283
  type InferSharedData<T, R extends UniSharedData = UniSharedData> = T extends keyof UniSharedDataRegistry ? UniSharedDataRegistry[T] : R
260
284
 
261
- function useSharedData<T extends string>(scope : UniSharedDataPage) : InferSharedData<T>
285
+ function useSharedData<T extends string>(scope: UniSharedDataPage): InferSharedData<T>
262
286
 
263
- function useSharedDataPage<T extends string>(pageIdOrScope : number | UniSharedDataPage, options : UniSharedDataComponentOptions) : InferSharedData<T, UniSharedDataPage>
287
+ function useSharedDataPage<T extends string>(
288
+ pageIdOrScope: number | UniSharedDataPage,
289
+ options: UniSharedDataComponentOptions,
290
+ ): InferSharedData<T, UniSharedDataPage>
264
291
 
265
292
  function useSharedDataComponent<T extends string>(
266
- scope : UniSharedDataPage,
267
- options : UniSharedDataComponentOptions
268
- ) : InferSharedData<T, UniSharedDataComponent>
293
+ scope: UniSharedDataPage,
294
+ options: UniSharedDataComponentOptions,
295
+ ): InferSharedData<T, UniSharedDataComponent>
269
296
 
270
- function useSharedDataVFor<T, S extends UniSharedData>(sharedDataVFor : S) : S
297
+ function useSharedDataVFor<T, S extends UniSharedData>(sharedDataVFor: S): S
271
298
 
272
- function useSharedDataRecycleVFor<T, S extends UniSharedData>(sharedDataVFor : S) : S
299
+ function useSharedDataRecycleVFor<T, S extends UniSharedData>(sharedDataVFor: S): S
273
300
  }
274
301
 
275
302
  export { }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 组件截图成功的返回数据
2
+ * 截图成功的返回数据
3
3
  */
4
4
  export type TakeSnapshotSuccess = {
5
5
  /**
@@ -9,7 +9,7 @@ export type TakeSnapshotSuccess = {
9
9
  }
10
10
 
11
11
  /**
12
- * 组件截图失败的返回数据
12
+ * 截图失败的返回数据
13
13
  */
14
14
  export type TakeSnapshotFail = {
15
15
  errMsg: string
@@ -31,7 +31,7 @@ export type TakeSnapshotCompleteCallback = (res: any) => void
31
31
 
32
32
 
33
33
  /**
34
- * 组件截图的参数配置选项
34
+ * 截图的参数配置选项
35
35
  */
36
36
  export type TakeSnapshotOptions = {
37
37
 
@@ -1178,6 +1178,12 @@ declare global {
1178
1178
  * }
1179
1179
  */
1180
1180
  querySelectorAll(selector: string.cssSelectorString): UniElement[]
1181
+
1182
+ /**
1183
+ * 对当前页面进行截图
1184
+ * @param options 截图的参数对象
1185
+ */
1186
+ takeSnapshot(options: TakeSnapshotOptions): void;
1181
1187
  }
1182
1188
  }
1183
1189
 
@@ -176,8 +176,8 @@ export type NavigateToOptions = {
176
176
  * },
177
177
  * "harmony": {
178
178
  * "osVer": "3.0",
179
- * "uniVer": "x",
180
- * "unixVer": "x"
179
+ * "uniVer": "4.61",
180
+ * "unixVer": "5.0"
181
181
  * }
182
182
  * },
183
183
  * "web": {
@@ -234,7 +234,7 @@ export type NavigateToOptions = {
234
234
  * "harmony": {
235
235
  * "osVer": "3.0",
236
236
  * "uniVer": "x",
237
- * "unixVer": "x"
237
+ * "unixVer": "5.0"
238
238
  * }
239
239
  * },
240
240
  * "web": {
@@ -262,7 +262,7 @@ export type NavigateToOptions = {
262
262
  * "harmony": {
263
263
  * "osVer": "3.0",
264
264
  * "uniVer": "x",
265
- * "unixVer": "x"
265
+ * "unixVer": "5.0"
266
266
  * }
267
267
  * },
268
268
  * "web": {
@@ -290,7 +290,7 @@ export type NavigateToOptions = {
290
290
  * "harmony": {
291
291
  * "osVer": "3.0",
292
292
  * "uniVer": "x",
293
- * "unixVer": "x"
293
+ * "unixVer": "5.0"
294
294
  * }
295
295
  * },
296
296
  * "web": {
@@ -318,7 +318,7 @@ export type NavigateToOptions = {
318
318
  * "harmony": {
319
319
  * "osVer": "3.0",
320
320
  * "uniVer": "x",
321
- * "unixVer": "x"
321
+ * "unixVer": "5.0"
322
322
  * }
323
323
  * },
324
324
  * "web": {
@@ -346,7 +346,7 @@ export type NavigateToOptions = {
346
346
  * "harmony": {
347
347
  * "osVer": "3.0",
348
348
  * "uniVer": "x",
349
- * "unixVer": "x"
349
+ * "unixVer": "5.0"
350
350
  * }
351
351
  * },
352
352
  * "web": {
@@ -374,7 +374,7 @@ export type NavigateToOptions = {
374
374
  * "harmony": {
375
375
  * "osVer": "3.0",
376
376
  * "uniVer": "x",
377
- * "unixVer": "x"
377
+ * "unixVer": "5.0"
378
378
  * }
379
379
  * },
380
380
  * "web": {
@@ -402,7 +402,7 @@ export type NavigateToOptions = {
402
402
  * "harmony": {
403
403
  * "osVer": "3.0",
404
404
  * "uniVer": "x",
405
- * "unixVer": "x"
405
+ * "unixVer": "5.0"
406
406
  * }
407
407
  * },
408
408
  * "web": {
@@ -1971,8 +1971,8 @@ export type NavigateBackOptions = {
1971
1971
  * },
1972
1972
  * "harmony": {
1973
1973
  * "osVer": "3.0",
1974
- * "uniVer": "x",
1975
- * "unixVer": "x"
1974
+ * "uniVer": "4.61",
1975
+ * "unixVer": "5.0"
1976
1976
  * }
1977
1977
  * },
1978
1978
  * "web": {
@@ -2027,7 +2027,7 @@ export type NavigateBackOptions = {
2027
2027
  * "harmony": {
2028
2028
  * "osVer": "3.0",
2029
2029
  * "uniVer": "x",
2030
- * "unixVer": "x"
2030
+ * "unixVer": "5.0"
2031
2031
  * }
2032
2032
  * },
2033
2033
  * "web": {
@@ -2054,7 +2054,7 @@ export type NavigateBackOptions = {
2054
2054
  * "harmony": {
2055
2055
  * "osVer": "3.0",
2056
2056
  * "uniVer": "x",
2057
- * "unixVer": "x"
2057
+ * "unixVer": "5.0"
2058
2058
  * }
2059
2059
  * },
2060
2060
  * "web": {
@@ -2081,7 +2081,7 @@ export type NavigateBackOptions = {
2081
2081
  * "harmony": {
2082
2082
  * "osVer": "3.0",
2083
2083
  * "uniVer": "x",
2084
- * "unixVer": "x"
2084
+ * "unixVer": "5.0"
2085
2085
  * }
2086
2086
  * },
2087
2087
  * "web": {
@@ -2108,7 +2108,7 @@ export type NavigateBackOptions = {
2108
2108
  * "harmony": {
2109
2109
  * "osVer": "3.0",
2110
2110
  * "uniVer": "x",
2111
- * "unixVer": "x"
2111
+ * "unixVer": "5.0"
2112
2112
  * }
2113
2113
  * },
2114
2114
  * "web": {
@@ -2135,7 +2135,7 @@ export type NavigateBackOptions = {
2135
2135
  * "harmony": {
2136
2136
  * "osVer": "3.0",
2137
2137
  * "uniVer": "x",
2138
- * "unixVer": "x"
2138
+ * "unixVer": "5.0"
2139
2139
  * }
2140
2140
  * },
2141
2141
  * "web": {
@@ -2162,7 +2162,7 @@ export type NavigateBackOptions = {
2162
2162
  * "harmony": {
2163
2163
  * "osVer": "3.0",
2164
2164
  * "uniVer": "x",
2165
- * "unixVer": "x"
2165
+ * "unixVer": "5.0"
2166
2166
  * }
2167
2167
  * },
2168
2168
  * "web": {
@@ -2189,7 +2189,7 @@ export type NavigateBackOptions = {
2189
2189
  * "harmony": {
2190
2190
  * "osVer": "3.0",
2191
2191
  * "uniVer": "x",
2192
- * "unixVer": "x"
2192
+ * "unixVer": "5.0"
2193
2193
  * }
2194
2194
  * },
2195
2195
  * "web": {
@@ -2,6 +2,7 @@
2
2
  /// <reference path='./lib/uni-video-global/utssdk/global.d.ts' />
3
3
  /// <reference path='./lib/uni-rich-text-global/utssdk/global.d.ts' />
4
4
  /// <reference path='./lib/uni-progress-global/utssdk/global.d.ts' />
5
+ /// <reference path='./lib/uni-page-container-global/utssdk/global.d.ts' />
5
6
  /// <reference path='./lib/uni-navigator-global/utssdk/global.d.ts' />
6
7
  /// <reference path='./lib/uni-match-media-global/utssdk/global.d.ts' />
7
8
  /// <reference path='./lib/uni-form-global/utssdk/global.d.ts' />
@@ -2,6 +2,7 @@ export * from './lib/uni-web-view-global/utssdk'
2
2
  export * from './lib/uni-video-global/utssdk'
3
3
  export * from './lib/uni-rich-text-global/utssdk'
4
4
  export * from './lib/uni-progress-global/utssdk'
5
+ export * from './lib/uni-page-container-global/utssdk'
5
6
  export * from './lib/uni-navigator-global/utssdk'
6
7
  export * from './lib/uni-match-media-global/utssdk'
7
8
  export * from './lib/uni-form-global/utssdk'
@@ -0,0 +1,9 @@
1
+ // 本文件为自动构建生成
2
+ import {
3
+ UniPageContainerElement as UniPageContainerElementOrigin,
4
+ } from './interface'
5
+
6
+ declare global {
7
+ type UniPageContainerElement = UniPageContainerElementOrigin
8
+ }
9
+
@@ -0,0 +1,5 @@
1
+ // 本文件为自动构建生成
2
+ export {
3
+ UniPageContainerElement,
4
+ } from './interface'
5
+
@@ -0,0 +1,2 @@
1
+ export class UniPageContainerElement extends UniVueElement {
2
+ }