@spcsn/taro 0.1.0
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/README.md +12 -0
- package/dist/index.js +147 -0
- package/dist/index.js.map +1 -0
- package/index.js +9 -0
- package/package.json +86 -0
- package/types/api/ad/index.d.ts +197 -0
- package/types/api/ai/face.d.ts +133 -0
- package/types/api/ai/inference.d.ts +129 -0
- package/types/api/ai/visionkit.d.ts +874 -0
- package/types/api/alipay/index.d.ts +69 -0
- package/types/api/base/crypto.d.ts +104 -0
- package/types/api/base/debug.d.ts +329 -0
- package/types/api/base/env.d.ts +19 -0
- package/types/api/base/index.d.ts +102 -0
- package/types/api/base/performance.d.ts +258 -0
- package/types/api/base/system.d.ts +742 -0
- package/types/api/base/update.d.ts +130 -0
- package/types/api/base/weapp/app-event.d.ts +265 -0
- package/types/api/base/weapp/life-cycle.d.ts +155 -0
- package/types/api/canvas/index.d.ts +2162 -0
- package/types/api/cloud/index.d.ts +2622 -0
- package/types/api/data-analysis/index.d.ts +122 -0
- package/types/api/device/accelerometer.d.ts +102 -0
- package/types/api/device/accessibility.d.ts +26 -0
- package/types/api/device/battery.d.ts +46 -0
- package/types/api/device/bluetooth-ble.d.ts +601 -0
- package/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/types/api/device/bluetooth.d.ts +463 -0
- package/types/api/device/calendar.d.ts +98 -0
- package/types/api/device/clipboard.d.ts +81 -0
- package/types/api/device/compass.d.ts +105 -0
- package/types/api/device/contact.d.ts +110 -0
- package/types/api/device/gyroscope.d.ts +85 -0
- package/types/api/device/iBeacon.d.ts +168 -0
- package/types/api/device/keyboard.d.ts +97 -0
- package/types/api/device/memory.d.ts +52 -0
- package/types/api/device/motion.d.ts +88 -0
- package/types/api/device/network.d.ts +172 -0
- package/types/api/device/nfc.d.ts +1238 -0
- package/types/api/device/phone.d.ts +30 -0
- package/types/api/device/scan.d.ts +111 -0
- package/types/api/device/screen.d.ts +217 -0
- package/types/api/device/sms.d.ts +26 -0
- package/types/api/device/vibrate.d.ts +51 -0
- package/types/api/device/wifi.d.ts +301 -0
- package/types/api/ext/index.d.ts +64 -0
- package/types/api/files/index.d.ts +1472 -0
- package/types/api/framework/index.d.ts +51 -0
- package/types/api/location/index.d.ts +517 -0
- package/types/api/media/audio.d.ts +1013 -0
- package/types/api/media/background-audio.d.ts +291 -0
- package/types/api/media/camera.d.ts +207 -0
- package/types/api/media/editor.d.ts +239 -0
- package/types/api/media/image.d.ts +469 -0
- package/types/api/media/live.d.ts +461 -0
- package/types/api/media/map.d.ts +638 -0
- package/types/api/media/media-recorder.d.ts +117 -0
- package/types/api/media/recorder.d.ts +317 -0
- package/types/api/media/video-decoder.d.ts +117 -0
- package/types/api/media/video-processing.d.ts +84 -0
- package/types/api/media/video.d.ts +527 -0
- package/types/api/media/voip.d.ts +393 -0
- package/types/api/navigate/index.d.ts +327 -0
- package/types/api/network/download.d.ts +173 -0
- package/types/api/network/mdns.d.ts +191 -0
- package/types/api/network/request.d.ts +480 -0
- package/types/api/network/tcp.d.ts +181 -0
- package/types/api/network/udp.d.ts +218 -0
- package/types/api/network/upload.d.ts +201 -0
- package/types/api/network/websocket.d.ts +383 -0
- package/types/api/open-api/account.d.ts +51 -0
- package/types/api/open-api/address.d.ts +68 -0
- package/types/api/open-api/authorize.d.ts +80 -0
- package/types/api/open-api/card.d.ts +110 -0
- package/types/api/open-api/channels.d.ts +225 -0
- package/types/api/open-api/customer-service.d.ts +45 -0
- package/types/api/open-api/device-voip.d.ts +103 -0
- package/types/api/open-api/facial.d.ts +98 -0
- package/types/api/open-api/favorites.d.ts +101 -0
- package/types/api/open-api/group.d.ts +59 -0
- package/types/api/open-api/invoice.d.ts +87 -0
- package/types/api/open-api/license-plate.d.ts +27 -0
- package/types/api/open-api/login.d.ts +115 -0
- package/types/api/open-api/my-miniprogram.d.ts +28 -0
- package/types/api/open-api/privacy.d.ts +107 -0
- package/types/api/open-api/redpackage.d.ts +24 -0
- package/types/api/open-api/settings.d.ts +174 -0
- package/types/api/open-api/soter.d.ts +184 -0
- package/types/api/open-api/sticker.d.ts +83 -0
- package/types/api/open-api/subscribe-message.d.ts +305 -0
- package/types/api/open-api/user-info.d.ts +182 -0
- package/types/api/open-api/werun.d.ts +101 -0
- package/types/api/payment/index.d.ts +119 -0
- package/types/api/qq/index.d.ts +354 -0
- package/types/api/route/index.d.ts +324 -0
- package/types/api/share/index.d.ts +354 -0
- package/types/api/skyline/index.d.ts +345 -0
- package/types/api/storage/background-fetch.d.ts +131 -0
- package/types/api/storage/cache-manager.d.ts +249 -0
- package/types/api/storage/index.d.ts +405 -0
- package/types/api/swan/bookshelf.d.ts +307 -0
- package/types/api/swan/download-package.d.ts +80 -0
- package/types/api/swan/index.d.ts +251 -0
- package/types/api/swan/pay.d.ts +139 -0
- package/types/api/taro.extend.d.ts +233 -0
- package/types/api/taro.hooks.d.ts +148 -0
- package/types/api/ui/animation.d.ts +427 -0
- package/types/api/ui/background.d.ts +69 -0
- package/types/api/ui/custom-component.d.ts +23 -0
- package/types/api/ui/fonts.d.ts +77 -0
- package/types/api/ui/interaction.d.ts +281 -0
- package/types/api/ui/menu.d.ts +29 -0
- package/types/api/ui/navigation-bar.d.ts +130 -0
- package/types/api/ui/pull-down-refresh.d.ts +50 -0
- package/types/api/ui/scroll.d.ts +114 -0
- package/types/api/ui/sticky.d.ts +32 -0
- package/types/api/ui/tab-bar.d.ts +196 -0
- package/types/api/ui/window.d.ts +71 -0
- package/types/api/worker/index.d.ts +83 -0
- package/types/api/wxml/index.d.ts +540 -0
- package/types/compile/compiler.d.ts +32 -0
- package/types/compile/config/h5.d.ts +134 -0
- package/types/compile/config/harmony.d.ts +118 -0
- package/types/compile/config/index.d.ts +8 -0
- package/types/compile/config/manifest.d.ts +155 -0
- package/types/compile/config/mini.d.ts +118 -0
- package/types/compile/config/plugin.d.ts +34 -0
- package/types/compile/config/project.d.ts +338 -0
- package/types/compile/config/rn.d.ts +85 -0
- package/types/compile/config/util.d.ts +179 -0
- package/types/compile/hooks.d.ts +13 -0
- package/types/compile/index.d.ts +11 -0
- package/types/compile/viteCompilerContext.d.ts +167 -0
- package/types/global.d.ts +428 -0
- package/types/index.d.ts +190 -0
- package/types/taro.api.d.ts +130 -0
- package/types/taro.component.d.ts +168 -0
- package/types/taro.config.d.ts +712 -0
- package/types/taro.lifecycle.d.ts +220 -0
- package/types/taro.runtime.d.ts +9 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import Taro from '../../index'
|
|
2
|
+
|
|
3
|
+
declare module '../../index' {
|
|
4
|
+
/** `EditorContext` 实例,可通过 `Taro.createSelectorQuery` 获取。
|
|
5
|
+
* `EditorContext` 通过 `id` 跟一个 `editor` 组件绑定,操作对应的 `editor` 组件。
|
|
6
|
+
* @supported weapp
|
|
7
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.html
|
|
8
|
+
*/
|
|
9
|
+
interface EditorContext {
|
|
10
|
+
/** 编辑器失焦,同时收起键盘。
|
|
11
|
+
* @supported weapp
|
|
12
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.blur.html
|
|
13
|
+
*/
|
|
14
|
+
blur(option?: EditorContext.BlurOption): void
|
|
15
|
+
/** 清空编辑器内容
|
|
16
|
+
* @supported weapp
|
|
17
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.clear.html
|
|
18
|
+
*/
|
|
19
|
+
clear(option?: EditorContext.ClearOption): void
|
|
20
|
+
/** 修改样式
|
|
21
|
+
*
|
|
22
|
+
* ****
|
|
23
|
+
*
|
|
24
|
+
* ## 支持设置的样式列表
|
|
25
|
+
* | name | value |
|
|
26
|
+
* | ------| ------ |
|
|
27
|
+
* | bold | |
|
|
28
|
+
* | italic | |
|
|
29
|
+
* | underline | |
|
|
30
|
+
* | strike | |
|
|
31
|
+
* | ins | |
|
|
32
|
+
* | script | sub / super |
|
|
33
|
+
* | header | H1 / H2 / h3 / H4 / h5 / H6 |
|
|
34
|
+
* | align | left / center / right / justify |
|
|
35
|
+
* | direction | rtl |
|
|
36
|
+
* | indent | -1 / +1 |
|
|
37
|
+
* | list | ordered / bullet / check |
|
|
38
|
+
* | color | hex color |
|
|
39
|
+
* | backgroundColor| hex color |
|
|
40
|
+
* | margin/marginTop/marginBottom/marginLeft/marginRight | css style |
|
|
41
|
+
* | padding/paddingTop/paddingBottom/paddingLeft/paddingRight | css style |
|
|
42
|
+
* | font/fontSize/fontStyle/fontVariant/fontWeight/fontFamily | css style |
|
|
43
|
+
* | lineHeight | css style |
|
|
44
|
+
* | letterSpacing | css style |
|
|
45
|
+
* | textDecoration | css style |
|
|
46
|
+
* | textIndent | css style |
|
|
47
|
+
*
|
|
48
|
+
* 对已经应用样式的选区设置会取消样式。css style 表示 css 中规定的允许值。
|
|
49
|
+
* @supported weapp
|
|
50
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.format.html
|
|
51
|
+
*/
|
|
52
|
+
format(
|
|
53
|
+
/** 属性 */
|
|
54
|
+
name: string,
|
|
55
|
+
/** 值 */
|
|
56
|
+
value?: string,
|
|
57
|
+
): void
|
|
58
|
+
/** 获取编辑器内容
|
|
59
|
+
* @supported weapp
|
|
60
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.getContents.html
|
|
61
|
+
*/
|
|
62
|
+
getContents(option?: EditorContext.GetContentsOption): void
|
|
63
|
+
/** 获取编辑器已选区域内的纯文本内容。当编辑器失焦或未选中一段区间时,返回内容为空。
|
|
64
|
+
* @supported weapp
|
|
65
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.getSelectionText.html
|
|
66
|
+
*/
|
|
67
|
+
getSelectionText(option?: EditorContext.getSelectionText.Option): void
|
|
68
|
+
/** 插入分割线
|
|
69
|
+
* @supported weapp
|
|
70
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertDivider.html
|
|
71
|
+
*/
|
|
72
|
+
insertDivider(option?: EditorContext.InsertDividerOption): void
|
|
73
|
+
/** 插入图片。
|
|
74
|
+
*
|
|
75
|
+
* 地址为临时文件时,获取的编辑器html格式内容中 `<img>` 标签增加属性 data-local,delta 格式内容中图片 attributes 属性增加 data-local 字段,该值为传入的临时文件地址。
|
|
76
|
+
*
|
|
77
|
+
* 开发者可选择在提交阶段上传图片到服务器,获取到网络地址后进行替换。替换时对于html内容应替换掉 `<img>` 的 src 值,对于 delta 内容应替换掉 `insert { image: abc }` 值。
|
|
78
|
+
* @supported weapp
|
|
79
|
+
* @example
|
|
80
|
+
* ```tsx
|
|
81
|
+
* this.editorCtx.insertImage({
|
|
82
|
+
* src: 'xx',
|
|
83
|
+
* width: '100px',
|
|
84
|
+
* height: '50px',
|
|
85
|
+
* extClass: className
|
|
86
|
+
* })
|
|
87
|
+
* ```
|
|
88
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertImage.html
|
|
89
|
+
*/
|
|
90
|
+
insertImage(option: EditorContext.InsertImageOption): void
|
|
91
|
+
/** 覆盖当前选区,设置一段文本
|
|
92
|
+
* @supported weapp
|
|
93
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertText.html
|
|
94
|
+
*/
|
|
95
|
+
insertText(option: EditorContext.InsertTextOption): void
|
|
96
|
+
/** 恢复
|
|
97
|
+
* @supported weapp
|
|
98
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.redo.html
|
|
99
|
+
*/
|
|
100
|
+
redo(option?: EditorContext.RedoOption): void
|
|
101
|
+
/** 清除当前选区的样式
|
|
102
|
+
* @supported weapp
|
|
103
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.removeFormat.html
|
|
104
|
+
*/
|
|
105
|
+
removeFormat(option?: EditorContext.RemoveFormatOption): void
|
|
106
|
+
/** 使得编辑器光标处滚动到窗口可视区域内。
|
|
107
|
+
* @supported weapp
|
|
108
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.scrollIntoView.html
|
|
109
|
+
*/
|
|
110
|
+
scrollIntoView(): void
|
|
111
|
+
/** 初始化编辑器内容,html和delta同时存在时仅delta生效
|
|
112
|
+
* @supported weapp
|
|
113
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.setContents.html
|
|
114
|
+
*/
|
|
115
|
+
setContents(option: EditorContext.SetContentsOption): void
|
|
116
|
+
/** 撤销
|
|
117
|
+
* @supported weapp
|
|
118
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.undo.html
|
|
119
|
+
*/
|
|
120
|
+
undo(option?: EditorContext.UndoOption): void
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
namespace EditorContext {
|
|
124
|
+
interface BlurOption {
|
|
125
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
126
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
127
|
+
/** 接口调用失败的回调函数 */
|
|
128
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
129
|
+
/** 接口调用成功的回调函数 */
|
|
130
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
131
|
+
}
|
|
132
|
+
interface ClearOption {
|
|
133
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
134
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
135
|
+
/** 接口调用失败的回调函数 */
|
|
136
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
137
|
+
/** 接口调用成功的回调函数 */
|
|
138
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
139
|
+
}
|
|
140
|
+
interface GetContentsOption {
|
|
141
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
142
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
143
|
+
/** 接口调用失败的回调函数 */
|
|
144
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
145
|
+
/** 接口调用成功的回调函数 */
|
|
146
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
147
|
+
}
|
|
148
|
+
namespace getSelectionText {
|
|
149
|
+
interface Option {
|
|
150
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
151
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
152
|
+
/** 接口调用失败的回调函数 */
|
|
153
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
154
|
+
/** 接口调用成功的回调函数 */
|
|
155
|
+
success?: (res: SuccessCallbackResult) => void
|
|
156
|
+
}
|
|
157
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
158
|
+
/** 纯文本内容 */
|
|
159
|
+
text: string
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
interface InsertDividerOption {
|
|
163
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
164
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
165
|
+
/** 接口调用失败的回调函数 */
|
|
166
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
167
|
+
/** 接口调用成功的回调函数 */
|
|
168
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
169
|
+
}
|
|
170
|
+
interface InsertImageOption {
|
|
171
|
+
/** 图片地址,仅支持 http(s)、base64、云图片(2.8.0)、临时文件(2.8.3)。 */
|
|
172
|
+
src: string
|
|
173
|
+
/** 插入图片后是否自动换行,默认换行 */
|
|
174
|
+
nowrap?: boolean
|
|
175
|
+
/** 图像无法显示时的替代文本 */
|
|
176
|
+
alt?: string
|
|
177
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
178
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
179
|
+
/** data 被序列化为 name=value;name1=value2 的格式挂在属性 data-custom 上 */
|
|
180
|
+
data?: TaroGeneral.IAnyObject
|
|
181
|
+
/** 添加到图片 img 标签上的类名 */
|
|
182
|
+
extClass?: string
|
|
183
|
+
/** 接口调用失败的回调函数 */
|
|
184
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
185
|
+
/** 图片高度 (pixels/百分比) */
|
|
186
|
+
height?: string
|
|
187
|
+
/** 接口调用成功的回调函数 */
|
|
188
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
189
|
+
/** 图片宽度(pixels/百分比) */
|
|
190
|
+
width?: string
|
|
191
|
+
}
|
|
192
|
+
interface InsertTextOption {
|
|
193
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
194
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
195
|
+
/** 接口调用失败的回调函数 */
|
|
196
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
197
|
+
/** 接口调用成功的回调函数 */
|
|
198
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
199
|
+
/** 文本内容 */
|
|
200
|
+
text?: string
|
|
201
|
+
}
|
|
202
|
+
interface RedoOption {
|
|
203
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
204
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
205
|
+
/** 接口调用失败的回调函数 */
|
|
206
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
207
|
+
/** 接口调用成功的回调函数 */
|
|
208
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
209
|
+
}
|
|
210
|
+
interface RemoveFormatOption {
|
|
211
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
212
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
213
|
+
/** 接口调用失败的回调函数 */
|
|
214
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
215
|
+
/** 接口调用成功的回调函数 */
|
|
216
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
217
|
+
}
|
|
218
|
+
interface SetContentsOption {
|
|
219
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
220
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
221
|
+
/** 表示内容的delta对象 */
|
|
222
|
+
delta?: TaroGeneral.IAnyObject
|
|
223
|
+
/** 接口调用失败的回调函数 */
|
|
224
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
225
|
+
/** 带标签的HTML内容 */
|
|
226
|
+
html?: string
|
|
227
|
+
/** 接口调用成功的回调函数 */
|
|
228
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
229
|
+
}
|
|
230
|
+
interface UndoOption {
|
|
231
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
232
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
233
|
+
/** 接口调用失败的回调函数 */
|
|
234
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
235
|
+
/** 接口调用成功的回调函数 */
|
|
236
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|