@dcloudio/uni-app-x 0.7.62 → 0.7.63

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 (80) hide show
  1. package/package.json +1 -1
  2. package/types/app.d.ts +36 -1
  3. package/types/dom2/UniCSSProperty.d.ts +446 -0
  4. package/types/dom2/UniCSSType.d.ts +72 -0
  5. package/types/dom2/UniCommon.d.ts +40 -0
  6. package/types/dom2/UniCustomViewElement.d.ts +12 -0
  7. package/types/dom2/UniElement.d.ts +354 -0
  8. package/types/dom2/UniElementType.d.ts +37 -0
  9. package/types/dom2/UniImageElement.d.ts +102 -0
  10. package/types/dom2/UniNativeBaseView.d.ts +178 -0
  11. package/types/dom2/UniNativeCustomView.d.ts +13 -0
  12. package/types/dom2/UniNativeDefines.d.ts +435 -0
  13. package/types/dom2/UniNativeImageView.d.ts +34 -0
  14. package/types/dom2/UniNativeScrollView.d.ts +42 -0
  15. package/types/dom2/UniNativeTextView.d.ts +25 -0
  16. package/types/dom2/UniNativeView.d.ts +51 -0
  17. package/types/dom2/UniNativeViewType.d.ts +22 -0
  18. package/types/dom2/UniPage.d.ts +55 -0
  19. package/types/dom2/UniScrollViewElement.d.ts +13 -0
  20. package/types/dom2/UniTextElement.d.ts +20 -0
  21. package/types/dom2/UniTextLayout.d.ts +386 -0
  22. package/types/dom2/UniViewElement.d.ts +57 -0
  23. package/types/dom2/global.d.ts +189 -0
  24. package/types/dom2/index.d.ts +40 -0
  25. package/types/dom2/sharedData.d.ts +227 -0
  26. package/types/index.d.ts +2 -1
  27. package/types/native/DOMRect.d.ts +2 -1
  28. package/types/native/DrawableContext.d.ts +1665 -1661
  29. package/types/native/IUniElement.d.ts +3514 -2877
  30. package/types/native/SnapshotOptions.d.ts +2 -2
  31. package/types/native/UniAnimation.d.ts +11 -10
  32. package/types/native/UniEvent.d.ts +108 -3
  33. package/types/native/UniPage.d.ts +891 -887
  34. package/types/native/UniTextElement.d.ts +37 -0
  35. package/types/native/UniTextLayout.d.ts +387 -0
  36. package/types/native/UniVideoElement.d.ts +20 -17
  37. package/types/native/Worker.d.ts +19 -0
  38. package/types/native/global.d.ts +28 -68
  39. package/types/native/index.d.ts +18 -1
  40. package/types/page.d.ts +1862 -599
  41. package/types/uni/uts-plugin-api/global.d.ts +2 -0
  42. package/types/uni/uts-plugin-api/index.d.ts +2 -0
  43. package/types/uni/uts-plugin-api/lib/uni-chooseMedia/utssdk/interface.d.ts +1 -1
  44. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +10 -10
  45. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +0 -1
  46. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/global.d.ts +22 -0
  47. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/index.d.ts +10 -0
  48. package/types/uni/uts-plugin-api/lib/uni-createWorker/utssdk/interface.d.ts +524 -0
  49. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +985 -76
  50. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +79 -55
  51. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +77 -53
  52. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +458 -407
  53. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +420 -0
  54. package/types/uni/uts-plugin-api/lib/uni-location/utssdk/interface.d.ts +80 -80
  55. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/global.d.ts +12 -4
  56. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/index.d.ts +6 -2
  57. package/types/uni/uts-plugin-api/lib/uni-modal/utssdk/interface.d.ts +713 -91
  58. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +4 -0
  59. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +3 -3
  60. package/types/uni/uts-plugin-api/lib/uni-oauth-weixin/utssdk/interface.d.ts +3 -1
  61. package/types/uni/uts-plugin-api/lib/uni-recorder/utssdk/interface.d.ts +71 -1
  62. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +1 -1
  63. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/global.d.ts +56 -0
  64. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/index.d.ts +27 -0
  65. package/types/uni/uts-plugin-api/lib/uni-screenBrightness/utssdk/interface.d.ts +842 -0
  66. package/types/uni/uts-plugin-api/lib/uni-share/utssdk/interface.d.ts +11 -11
  67. package/types/uni/uts-plugin-api/lib/uni-share-weixin/utssdk/interface.d.ts +1 -1
  68. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +63 -42
  69. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +2 -2
  70. package/types/uni/uts-plugin-biz/lib/uni-facialVerify/utssdk/interface.d.ts +2 -2
  71. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/global.d.ts +4 -0
  72. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/index.d.ts +2 -0
  73. package/types/uni/uts-plugin-biz/lib/uni-live-player/utssdk/interface.d.ts +1007 -314
  74. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/global.d.ts +4 -0
  75. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/index.d.ts +2 -0
  76. package/types/uni/uts-plugin-biz/lib/uni-live-pusher/utssdk/interface.d.ts +1727 -10
  77. package/types/uni/uts-plugin-component/lib/uni-camera/utssdk/interface.d.ts +235 -30
  78. package/types/uni/uts-plugin-component/lib/uni-canvas/utssdk/interface.d.ts +1 -1
  79. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +17 -17
  80. package/uts-plugin.d.ts +11 -0
@@ -0,0 +1,227 @@
1
+ declare global {
2
+
3
+ // TODO 这两个应该在 @vue/runtime-vapor-dom2 中
4
+ type UniElementBlock = unknown
5
+ type UniNativeViewBlock = unknown
6
+
7
+ type UniSharedDataJSONObject = Record<string, any | null>
8
+ type UniSharedDataArray = Array<UniSharedDataAny>
9
+
10
+ type UniSharedDataAny =
11
+ | boolean
12
+ | number
13
+ | string
14
+ | null
15
+ | UniSharedData
16
+ | UniSharedDataJSONObject
17
+ | UniSharedDataArray
18
+ | UniSharedDataFunctionEventListener
19
+ | UniSharedDataFunctionSetTemplateRef
20
+
21
+ type UniSharedDataFunctionEventListener = (
22
+ event: /* UniSharedDataEvent */ UniEvent,
23
+ ) => void
24
+ type UniSharedDataFunctionSetTemplateRef = (elementId: number) => void
25
+
26
+ enum UniSharedDataSchedulerJobType {
27
+ /**
28
+ * 各种渲染任务,比如设置属性,样式,更新文字等
29
+ */
30
+ RENDER_EFFECT,
31
+ /**
32
+ * v-if 任务
33
+ */
34
+ V_IF,
35
+ /**
36
+ * v-for 任务
37
+ */
38
+ V_FOR,
39
+ }
40
+
41
+ type UniSharedDataSchedulerJob = {
42
+ // 指定线程执行
43
+ thread?: string
44
+ type: UniSharedDataSchedulerJobType
45
+ }
46
+
47
+ class UniSharedDataEvent {
48
+ /**
49
+ * 事件是否冒泡
50
+ */
51
+ bubbles: boolean
52
+ /**
53
+ * 事件是否可取消
54
+ */
55
+ cancelable: boolean
56
+ /**
57
+ * 事件类型
58
+ */
59
+ type: string
60
+ /**
61
+ * 触发事件的节点ID
62
+ */
63
+ target: string
64
+ /**
65
+ * 注册事件的节点ID
66
+ */
67
+ currentTarget: string
68
+ /**
69
+ * 事件创建的时间
70
+ */
71
+ timeStamp: number
72
+ }
73
+
74
+ class UniSharedData {
75
+ _flag0: number
76
+ /**
77
+ * ArkTS 层数据缓存,主要用于 ArkTS 层判断属性值是否有变化
78
+ */
79
+ _cacheProps: Map<string, UniSharedDataAny>
80
+ /**
81
+ * 是否已初始化完成,主要用于二次更新时触发响应式
82
+ */
83
+ _ready: boolean
84
+ /**
85
+ * 所属页面,用于批量执行响应式变更
86
+ */
87
+ _scope: UniSharedDataPage
88
+ /**
89
+ * 属性变更时收集 Jobs
90
+ */
91
+ _queueJobs: (key: string, value: UniSharedDataAny) => void
92
+ constructor(scope: UniSharedDataPage)
93
+ }
94
+
95
+ abstract class UniSharedDataComponent extends UniSharedData {
96
+ _page: UniPage
97
+ _reactivity: VueReactivity
98
+ /**
99
+ * 自定义组件需要透传的属性
100
+ */
101
+ inheritAttrs: UniSharedDataJSONObject
102
+ constructor(scope: UniSharedDataPage)
103
+ /**
104
+ * 由编译器动态生成的子类中的 Element 渲染器
105
+ */
106
+ abstract _renderElement(): UniElementBlock
107
+ /**
108
+ * 由编译器动态生成的子类中的 NativeView 渲染器
109
+ */
110
+ abstract _renderNativeView(): UniNativeViewBlock
111
+ }
112
+
113
+ abstract class UniSharedDataPage extends UniSharedDataComponent {
114
+ /**
115
+ * ArkTS 层存储的事件映射,key 为事件 ID,value 为事件函数,用于触发事件时执行
116
+ */
117
+ _cacheEvents: Map<number, Function>
118
+ /**
119
+ * 本次更新收集到的 Jobs,用于批量执行响应式变更
120
+ */
121
+ _jobs: Array<Array<UniSharedDataSchedulerJob[]>>
122
+ /**
123
+ * 批量执行响应式变更
124
+ */
125
+ _flushJobs: () => Promise<void> | void
126
+ /**
127
+ * c 层触发事件,调用 $cacheEvents 中存储的 ArkTS 层事件函数
128
+ */
129
+ _dispatchEvent: (id: number, event: UniSharedDataEvent) => void
130
+ /**
131
+ * 页面渲染函数
132
+ * 调用页面的 _renderElement 和 _renderNativeView
133
+ * 执行 Element 渲染器(子线程执行)和 NativeView 渲染器(主线程执行)
134
+ * 拿到两个渲染器执行后的 Block 后,插入到页面的根 NativeView 和根 Dom元素中
135
+ * 页面的根 NativeView,根 Dom 从哪里获取?
136
+ * 在 c 层实现一个简易的 UniPage?
137
+ * 在页面的 SharedData 类构造器里边,构建对应的 UniPage 对象?
138
+ */
139
+ _render: () => Promise<void>
140
+ }
141
+
142
+ enum UniSharedDataVForDirty {
143
+ /**
144
+ * 无变更
145
+ */
146
+ NONE,
147
+ /**
148
+ * 快速变更模式,读取 mount、unmount、update的列表,进行快速更新
149
+ */
150
+ FAST,
151
+ /**
152
+ * 全量模式,触发数组全量diff更新
153
+ */
154
+ FULL,
155
+ }
156
+
157
+ class UniSharedDataVForMount {
158
+ readonly index: number
159
+ constructor(index: number)
160
+ }
161
+
162
+ class UniSharedDataVForUnmount {
163
+ readonly index: number
164
+ readonly doRemove: boolean
165
+ readonly doDeregister: boolean
166
+ constructor(
167
+ /**
168
+ * 需要移除的索引值
169
+ * 重要:该索引值是oldBlocks中的索引值
170
+ */
171
+ index: number,
172
+ doRemove: boolean,
173
+ doDeregister: boolean,
174
+ )
175
+ }
176
+
177
+ class UniSharedDataVForUpdate {
178
+ readonly index: number
179
+ constructor(
180
+ /**
181
+ * 需要更新的索引值
182
+ * update((newBlocks[i] = oldBlocks[i]), getItem(source, i))
183
+ */
184
+ index: number,
185
+ )
186
+ }
187
+
188
+ class UniSharedDataVFor<T extends UniSharedData> extends UniSharedData {
189
+ data: T[]
190
+ mount: UniSharedDataVForMount[]
191
+ unmount: UniSharedDataVForUnmount[]
192
+ update: UniSharedDataVForUpdate[]
193
+ dirty: UniSharedDataVForDirty
194
+ create: () => T
195
+ constructor(scope: UniSharedDataPage, create: () => T)
196
+ }
197
+
198
+ class VueReactivity { }
199
+
200
+ // 编译宏
201
+
202
+
203
+ interface UniSharedDataRegistry { }
204
+
205
+ type InferSharedData<
206
+ T,
207
+ R extends UniSharedData = UniSharedData,
208
+ > = T extends keyof UniSharedDataRegistry ? UniSharedDataRegistry[T] : R
209
+
210
+ function useSharedData<T extends string>(
211
+ scope: UniSharedDataPage,
212
+ ): InferSharedData<T>
213
+
214
+ function useSharedDataPage<T extends string>(
215
+ pageId: number,
216
+ ): InferSharedData<T, UniSharedDataPage>
217
+
218
+ function useSharedDataComponent<T extends string>(
219
+ scope: UniSharedDataPage,
220
+ ): InferSharedData<T, UniSharedDataComponent>
221
+
222
+ function useSharedDataVFor<T, S extends UniSharedData>(
223
+ sharedDataVFor: S,
224
+ ): S
225
+ }
226
+
227
+ export { }
package/types/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  /// <reference path='./native/global.d.ts' />
2
+ /// <reference path='./dom2/global.d.ts' />
2
3
  /// <reference path='./vue/global.d.ts' />
3
4
  /// <reference path='./uni/global.d.ts' />
4
5
  /// <reference path='./uni-cloud/index.d.ts' />
5
6
  /// <reference path='./app.d.ts' />
6
7
  /// <reference path='./page.d.ts' />
7
8
  /// <reference path='./process.d.ts' />
8
- /// <reference path='./vite.d.ts' />
9
+ /// <reference path='./vite.d.ts' />
@@ -1,3 +1,4 @@
1
+
1
2
  /**
2
3
  * 一个 DOMRect 代表一个矩形。
3
4
  * @package io.dcloud.uniapp.runtime
@@ -141,7 +142,7 @@ export class DOMRect {
141
142
  * }
142
143
  * }
143
144
  */
144
- constructor (x?: number, y?: number, width?: number, height?: number);
145
+ constructor(x?: number, y?: number, width?: number, height?: number);
145
146
 
146
147
  /**
147
148
  * 矩形的宽