@dcloudio/uni-app-x 0.7.14 → 0.7.15
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/options.d.ts +1 -1
- package/package.json +1 -1
- package/types/native/CSSStyleDeclaration.d.ts +0 -72
- package/types/native/CanvasRenderingContext2D.d.ts +378 -0
- package/types/native/DOMRect.d.ts +0 -180
- package/types/native/DrawableContext.d.ts +161 -628
- package/types/native/IUniElement.d.ts +335 -1919
- package/types/native/Path2D.d.ts +74 -0
- package/types/native/SnapshotOptions.d.ts +1 -0
- package/types/native/UniCanvasElement.d.ts +9 -0
- package/types/native/UniNativePage.d.ts +27 -1
- package/types/native/UniPageManager.d.ts +4 -1
- package/types/native/UniResizeObserver.d.ts +9 -99
- package/types/native/UniScrollEvent.d.ts +1 -1
- package/types/native/UniSwiperAnimationFinishEvent.d.ts +1 -1
- package/types/native/UniSwiperChangeEvent.d.ts +1 -1
- package/types/native/global.d.ts +21 -0
- package/types/native/index.d.ts +3 -0
- package/types/shim-uts-basic.d.ts +4495 -0
- package/types/uni/env/index.d.ts +21 -0
- package/types/uni/uts-plugin-api/global.d.ts +12 -1
- package/types/uni/uts-plugin-api/index.d.ts +12 -1
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +10 -0
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +77 -0
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +10 -0
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +77 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/global.d.ts +40 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/index.d.ts +19 -0
- package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +203 -0
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/global.d.ts +20 -0
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/index.d.ts +9 -0
- package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +152 -0
- package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +20 -3
- package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +19 -8
- package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +13 -6
- package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +28 -0
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +6 -1
- package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +8 -1
- package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +20 -17
- package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +26 -18
- package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +201 -64
- package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +180 -59
- package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +7 -1
- package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +10 -1
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +173 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/global.d.ts +2 -14
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/index.d.ts +1 -6
- package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/interface.d.ts +1 -151
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +10 -3
- package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +7 -1
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +113 -23
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +500 -149
- package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +123 -112
- package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/interface.d.ts +9 -6
- package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +18 -2
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/global.d.ts +22 -0
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +60 -0
- package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +8 -1
- package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-makePhoneCall/utssdk/global.d.ts +9 -6
- package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-makePhoneCall/utssdk/index.d.ts +4 -2
- package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-makePhoneCall/utssdk/interface.d.ts +40 -61
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +312 -58
- package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +34 -5
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +280 -92
- package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +20 -15
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +70 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +16 -6
- package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +17 -10
- package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/interface.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/global.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/index.d.ts +4 -0
- package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/interface.d.ts +3 -0
- package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +120 -42
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +16 -1
- package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +241 -32
- package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +7 -2
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/global.d.ts +24 -0
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/index.d.ts +11 -0
- package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +73 -0
- package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +112 -43
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/global.d.ts +16 -0
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/index.d.ts +8 -0
- package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +78 -1
- package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +199 -149
- package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +170 -83
- package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +11 -7
- package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +33 -15
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/global.d.ts +4 -0
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/index.d.ts +2 -0
- package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +777 -568
- package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +10 -6
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +132 -15
- package/types/uni/uts-plugin-extend/global.d.ts +0 -1
- package/types/uni/uts-plugin-extend/index.d.ts +0 -3
- package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +4 -4
- package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +3 -3
- package/types/uni-cloud/interface.d.ts +57 -3
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/global.d.ts +0 -78
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/index.d.ts +0 -38
- package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/interface.d.ts +0 -642
- package/types/uni/uts-plugin-extend/lib/uni-getClipboardData/utssdk/global.d.ts +0 -21
- package/types/uni/uts-plugin-extend/lib/uni-getClipboardData/utssdk/index.d.ts +0 -9
- package/types/uni/uts-plugin-extend/lib/uni-getClipboardData/utssdk/interface.d.ts +0 -119
- package/types/uni/uts-plugin-extend/lib/uni-setClipboardData/utssdk/global.d.ts +0 -21
- package/types/uni/uts-plugin-extend/lib/uni-setClipboardData/utssdk/index.d.ts +0 -9
- package/types/uni/uts-plugin-extend/lib/uni-setClipboardData/utssdk/interface.d.ts +0 -122
package/options.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CSSStyleDeclaration表示一个CSS 声明块对象,它是一个 CSS 属性键值对的集合,暴露样式信息和各种与样式相关的方法和属性。
|
|
3
3
|
* @package io.dcloud.uniapp.runtime
|
|
4
|
-
* @uniPlatform {
|
|
5
|
-
* "app": {
|
|
6
|
-
* "android": {
|
|
7
|
-
* "osVer": "5.0",
|
|
8
|
-
* "uniVer": "x",
|
|
9
|
-
* "unixVer": "3.9"
|
|
10
|
-
* },
|
|
11
|
-
* "ios": {
|
|
12
|
-
* "osVer": "12.0",
|
|
13
|
-
* "uniVer": "x",
|
|
14
|
-
* "unixVer": "4.11"
|
|
15
|
-
* }
|
|
16
|
-
* }
|
|
17
|
-
* "web": {
|
|
18
|
-
* "uniVer": "x",
|
|
19
|
-
* "unixVer": "4.0"
|
|
20
|
-
* }
|
|
21
|
-
* }
|
|
22
4
|
*/
|
|
23
5
|
export class CSSStyleDeclaration {
|
|
24
6
|
|
|
@@ -26,72 +8,18 @@ export class CSSStyleDeclaration {
|
|
|
26
8
|
* 对CSS指定样式设置一个新值,如有此样式已存在则更新。
|
|
27
9
|
* @param name CSS样式名称
|
|
28
10
|
* @param value 要设置的新CSS样式值
|
|
29
|
-
* @uniPlatform {
|
|
30
|
-
* "app": {
|
|
31
|
-
* "android": {
|
|
32
|
-
* "osVer": "5.0",
|
|
33
|
-
* "uniVer": "x",
|
|
34
|
-
* "unixVer": "3.9"
|
|
35
|
-
* },
|
|
36
|
-
* "ios": {
|
|
37
|
-
* "osVer": "12.0",
|
|
38
|
-
* "uniVer": "x",
|
|
39
|
-
* "unixVer": "4.11"
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
* "web": {
|
|
43
|
-
* "uniVer": "x",
|
|
44
|
-
* "unixVer": "4.0"
|
|
45
|
-
* }
|
|
46
|
-
* }
|
|
47
11
|
*/
|
|
48
12
|
setProperty(name: string | string.cssPropertyString, value: any | null): void
|
|
49
13
|
|
|
50
14
|
/**
|
|
51
15
|
* 获取CSS指定的样式值,如果指定的样式不存在则返回null。
|
|
52
16
|
* @param property 要获取的CSS样式名称
|
|
53
|
-
* @uniPlatform {
|
|
54
|
-
* "app": {
|
|
55
|
-
* "android": {
|
|
56
|
-
* "osVer": "5.0",
|
|
57
|
-
* "uniVer": "x",
|
|
58
|
-
* "unixVer": "3.9"
|
|
59
|
-
* },
|
|
60
|
-
* "ios": {
|
|
61
|
-
* "osVer": "12.0",
|
|
62
|
-
* "uniVer": "x",
|
|
63
|
-
* "unixVer": "4.11"
|
|
64
|
-
* }
|
|
65
|
-
* }
|
|
66
|
-
* "web": {
|
|
67
|
-
* "uniVer": "x",
|
|
68
|
-
* "unixVer": "4.0"
|
|
69
|
-
* }
|
|
70
|
-
* }
|
|
71
17
|
*/
|
|
72
18
|
getPropertyValue(property: string | string.cssPropertyString): any | null
|
|
73
19
|
|
|
74
20
|
/**
|
|
75
21
|
* 删除CSS指定的样式值
|
|
76
22
|
* @param property 要删除的CSS样式名称
|
|
77
|
-
* @uniPlatform {
|
|
78
|
-
* "app": {
|
|
79
|
-
* "android": {
|
|
80
|
-
* "osVer": "5.0",
|
|
81
|
-
* "uniVer": "x",
|
|
82
|
-
* "unixVer": "3.9"
|
|
83
|
-
* },
|
|
84
|
-
* "ios": {
|
|
85
|
-
* "osVer": "12.0",
|
|
86
|
-
* "uniVer": "x",
|
|
87
|
-
* "unixVer": "4.11"
|
|
88
|
-
* }
|
|
89
|
-
* }
|
|
90
|
-
* "web": {
|
|
91
|
-
* "uniVer": "x",
|
|
92
|
-
* "unixVer": "4.0"
|
|
93
|
-
* }
|
|
94
|
-
* }
|
|
95
23
|
*/
|
|
96
24
|
removeProperty(property: string | string.cssPropertyString): any | null
|
|
97
25
|
}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @package io.dcloud.uniapp.runtime
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Image } from "./IUniElement"
|
|
6
|
+
import { Path2D } from "./Path2D"
|
|
7
|
+
|
|
8
|
+
export interface TextMetrics {
|
|
9
|
+
readonly width: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CanvasPattern {
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CanvasGradient {
|
|
17
|
+
/**
|
|
18
|
+
* 添加颜色的渐变点。小于最小 stop 的部分会按最小 stop 的 color 来渲染,大于最大 stop 的部分会按最大 stop 的 color 来渲染
|
|
19
|
+
* @param {number} stop 表示渐变中开始与结束之间的位置,范围 0-1
|
|
20
|
+
* @param {string} color 渐变点的颜色
|
|
21
|
+
*/
|
|
22
|
+
addColorStop(stop: number, color: string): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface CanvasRenderingContext2D {
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 是对与给定上下文关联的HTMLCanvasElement对象的只读引用
|
|
29
|
+
*/
|
|
30
|
+
readonly canvas: UniCanvasElement
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 设置字体大小
|
|
34
|
+
* @defaultValue 10px
|
|
35
|
+
*/
|
|
36
|
+
font: string
|
|
37
|
+
/**
|
|
38
|
+
* 设置填充颜色
|
|
39
|
+
* @defaultValue #000 (黑色)
|
|
40
|
+
*/
|
|
41
|
+
fillStyle: CanvasGradient | string
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* 用来描述在 canvas 上绘图之前,设置图形和图片透明度的属性。数值的范围从 0.0(完全透明)到 1.0(完全不透明)
|
|
45
|
+
* @defaultValue 1.0
|
|
46
|
+
*/
|
|
47
|
+
globalAlpha: number
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* 在绘制新形状时应用的合成操作的类型,其中 type 是用于标识要使用的合成或混合模式操作的字符串
|
|
51
|
+
*/
|
|
52
|
+
globalCompositeOperation: "" | "source-over" | "source-atop" | "source-in" | "source-out" | "destination-over" | "destination-atop" | "destination-in" | "destination-out" | "lighter" | "copy" | "xor"
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 指定如何绘制每一条线条末端的属性,可选值:`butt`线段末端以方形结束;`round`线段末端以圆形结束;`square`线段末端以方形结束,但是会增加一个一半宽度的矩形区域。
|
|
56
|
+
* @defaultValue butt
|
|
57
|
+
*/
|
|
58
|
+
lineCap: "" | "butt" | "round" | "square"
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* 设置虚线偏移量
|
|
62
|
+
*/
|
|
63
|
+
lineDashOffset: number
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* 设置 2 个长度不为 0 的线条相连部分如何连接在一起的属性,可选值:`bevel`斜角;`round`圆角;`miter`尖角。
|
|
67
|
+
* @defaultValue miter
|
|
68
|
+
*/
|
|
69
|
+
lineJoin: "" | "round" | "bevel" | "miter"
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 设置线条的宽度
|
|
73
|
+
* @defaultValue 1px
|
|
74
|
+
*/
|
|
75
|
+
lineWidth: number
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* 设置边框的颜色
|
|
79
|
+
* @defaultValue #000 (黑色)
|
|
80
|
+
*/
|
|
81
|
+
strokeStyle: CanvasGradient | string
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 设置文本的对齐方式,可取值:`left`左对齐;`center`居中对齐;`right`右对齐。
|
|
85
|
+
* @defaultValue left
|
|
86
|
+
*/
|
|
87
|
+
textAlign: "" | "left" | "right" | "center" | "start" | "end"
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 设置斜接面限制比例的属性。当获取属性值时,会返回当前的值(默认值是10.0 )。当给属性赋值时,0、负数、 Infinity 和 NaN 都会被忽略;除此之外都会被赋予一个新值。
|
|
91
|
+
*/
|
|
92
|
+
miterLimit: number
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* 描述绘制文本时,当前文本基线的属性
|
|
96
|
+
*/
|
|
97
|
+
textBaseline: "" | "top" | "hanging" | "middle" | "alphabetic" | "ideographic" | "bottom"
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* 绘制一段弧线
|
|
101
|
+
* @param {number} x 圆弧中心(圆心)的 x 轴坐标
|
|
102
|
+
* @param {number} y 圆弧中心(圆心)的 y 轴坐标
|
|
103
|
+
* @param {number} radius 圆弧的半径
|
|
104
|
+
* @param {number} startAngle 圆弧的起始点,x 轴方向开始计算,单位为弧度
|
|
105
|
+
* @param {number} endAngle 圆弧的终点,单位为弧度
|
|
106
|
+
* @param {number} [anticlockwise=true] 圆弧绘制方向,true:逆时针绘制,false:顺时针绘制。
|
|
107
|
+
*/
|
|
108
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): void
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* 根据控制点和半径绘制圆弧路径,使用当前的描点 (前一个 moveTo 或 lineTo 等函数的止点)。根据当前描点与给定的控制点 1 连接的直线,和控制点 1 与控制点 2 连接的直线,作为使用指定半径的圆的切线,画出两条切线之间的弧线路径
|
|
112
|
+
* @param {number} x1 第一个控制点的 x 轴坐标
|
|
113
|
+
* @param {number} y1 第一个控制点的 y 轴坐标
|
|
114
|
+
* @param {number} x2 第二个控制点的 x 轴坐标
|
|
115
|
+
* @param {number} y2 第二个控制点的 y 轴坐标
|
|
116
|
+
* @param {number} radius 圆弧的半径
|
|
117
|
+
*/
|
|
118
|
+
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* 开始创建一个路径。需要调用 fill 或者 stroke 才会使用路径进行填充或描边
|
|
122
|
+
*/
|
|
123
|
+
beginPath(): void
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* 绘制三次贝赛尔曲线路径
|
|
127
|
+
* @param {number} cp1x 第一个控制点的 x 轴坐标
|
|
128
|
+
* @param {number} cp1y 第一个控制点的 y 轴坐标
|
|
129
|
+
* @param {number} cp2x 第二个控制点的 x 轴坐标
|
|
130
|
+
* @param {number} cp2y 第二个控制点的 y 轴坐标
|
|
131
|
+
* @param {number} x 结束点的 x 轴坐标
|
|
132
|
+
* @param {number} y 结束点的 y 轴坐标
|
|
133
|
+
*/
|
|
134
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 清除画布上在该矩形区域内的内容
|
|
138
|
+
* @param {number} x 矩形起点的 x 轴坐标
|
|
139
|
+
* @param {number} y 矩形起点的 y 轴坐标
|
|
140
|
+
* @param {number} width 矩形的宽度
|
|
141
|
+
* @param {number} height 矩形的高度
|
|
142
|
+
*/
|
|
143
|
+
clearRect(x: number, y: number, width: number, height: number): void
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 将当前创建的路径设置为当前剪切路径
|
|
147
|
+
*/
|
|
148
|
+
clip(): void
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 关闭一个路径
|
|
152
|
+
*/
|
|
153
|
+
closePath(): void
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* 对指定的图像创建模式的方法,可在指定的方向上重复元图像
|
|
157
|
+
* @param {string} image 重复的图像源,支持代码包路径和本地临时路径 (本地路径)
|
|
158
|
+
* @param {string} repetition 如何重复图像
|
|
159
|
+
*/
|
|
160
|
+
createPattern(image: Image, repetition: string): CanvasPattern
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 创建一个线性的渐变颜色。返回的CanvasGradient对象需要使用 CanvasGradient.addColorStop() 来指定渐变点,至少要两个
|
|
164
|
+
* @param {number} x0 起点的 x 坐标
|
|
165
|
+
* @param {number} y0 起点的 y 坐标
|
|
166
|
+
* @param {number} x1 终点的 x 坐标
|
|
167
|
+
* @param {number} y1 终点的 y 坐标
|
|
168
|
+
*/
|
|
169
|
+
createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* 根据参数确定两个圆的坐标,绘制放射性渐变
|
|
173
|
+
* @param {number} x0 开始圆形的 x 轴坐标
|
|
174
|
+
* @param {number} y0 开始圆形的 y 轴坐标
|
|
175
|
+
* @param {number} r0 开始圆形的半径
|
|
176
|
+
* @param {number} x1 结束圆形的 x 轴坐标
|
|
177
|
+
* @param {number} y1 结束圆形的 y 轴坐标
|
|
178
|
+
* @param {number} r1 结束圆形的半径
|
|
179
|
+
*/
|
|
180
|
+
createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r01: number): CanvasGradient
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* 将之前在绘图上下文中的描述(路径、变形、样式)画到 canvas 中
|
|
184
|
+
*/
|
|
185
|
+
draw(): void
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* 绘制图像到画布
|
|
189
|
+
* @param {string} imageResource 所要绘制的图片资源
|
|
190
|
+
* @param {number} sx 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的左上角 x 坐标
|
|
191
|
+
* @param {number} sy 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的左上角 y 坐标
|
|
192
|
+
* @param {number} sWidth 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的宽度
|
|
193
|
+
* @param {number} sHeight 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的高度
|
|
194
|
+
* @param {number} dx imageResource的左上角在目标 canvas 上 x 轴的位置
|
|
195
|
+
* @param {number} dy imageResource的左上角在目标 canvas 上 y 轴的位置
|
|
196
|
+
* @param {number} dWidth 在目标画布上绘制imageResource的宽度,允许对绘制的imageResource进行缩放
|
|
197
|
+
* @param {number} dHeight 在目标画布上绘制imageResource的高度,允许对绘制的imageResource进行缩放
|
|
198
|
+
*/
|
|
199
|
+
drawImage(imageResource: Image, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* 对当前路径中的内容进行填充
|
|
203
|
+
*/
|
|
204
|
+
fill(): void
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 对当前路径中的内容进行填充
|
|
208
|
+
* @param {string} fillRule 填充当前或已存在的路径的方法。采取非零环绕(nonzero)或者奇偶环绕(evenodd)规则
|
|
209
|
+
*/
|
|
210
|
+
fill(fillRule: "nonzero" | "evenodd"): void
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* 对指定路径中的内容进行填充
|
|
214
|
+
* @param {string} path 填充路径
|
|
215
|
+
* @param {string} fillRule 填充当前或已存在的路径的方法。采取非零环绕(nonzero)或者奇偶环绕(evenodd)规则
|
|
216
|
+
*/
|
|
217
|
+
fill(path: Path2D, fillRule: "nonzero" | "evenodd"): void
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
*填充一个矩形。用 setFillStyle 设置矩形的填充色,如果没设置默认是黑色
|
|
221
|
+
* @param {number} x 矩形起点的 x 轴坐标
|
|
222
|
+
* @param {number} y 矩形起点的 y 轴坐标
|
|
223
|
+
* @param {number} width 矩形的宽度
|
|
224
|
+
* @param {number} height 矩形的高度
|
|
225
|
+
*/
|
|
226
|
+
fillRect(x: number, y: number, width: number, height: number): void
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 在填充线时使用虚线模式, 它使用一组值来指定描述模式的线和间隙的交替长度。
|
|
231
|
+
* @ret {segments} Array<number>一组描述交替绘制线段和间距(坐标空间单位)长度的数字
|
|
232
|
+
*/
|
|
233
|
+
getLineDash(): Array<number>
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* 返回一个Boolean 标记上下文是否已经丢失
|
|
237
|
+
*/
|
|
238
|
+
isContextLost(): Boolean
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* 在画布上绘制文本
|
|
242
|
+
* @param {string} text 要渲染的文本字符串
|
|
243
|
+
* @param {number} x 开始绘制文本的点的 X 轴坐标
|
|
244
|
+
* @param {number} y 开始绘制文本的点的 X 轴坐标
|
|
245
|
+
* @param {number} maxWidth 需要绘制的最大宽度
|
|
246
|
+
*/
|
|
247
|
+
fillText(text: string, x: number, y: number, maxWidth: number): void
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* 增加一个新点,然后创建一条从上次指定点到目标点的线。用 stroke 方法来画线条
|
|
251
|
+
* @param {number} x 目标位置的 x 坐标
|
|
252
|
+
* @param {number} y 目标位置的 y 坐标
|
|
253
|
+
*/
|
|
254
|
+
lineTo(x: number, y: number): void
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* 测量文本尺寸信息。目前仅返回文本宽度
|
|
258
|
+
* @param {number} text 要渲测量的文本字符串
|
|
259
|
+
*/
|
|
260
|
+
measureText(text: string): TextMetrics
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* 把路径移动到画布中的指定点
|
|
264
|
+
* @param {number} x 目标位置的 x 坐标
|
|
265
|
+
* @param {number} y 目标位置的 y 坐标
|
|
266
|
+
*/
|
|
267
|
+
moveTo(x: number, y: number): void
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* 创建二次贝塞尔曲线路径
|
|
271
|
+
* @param {number} cpx 贝塞尔控制点的 x 坐标
|
|
272
|
+
* @param {number} cpy 贝塞尔控制点的 y 坐标
|
|
273
|
+
* @param {number} x 结束点的 x 坐标
|
|
274
|
+
* @param {number} y 结束点的 y 坐标
|
|
275
|
+
*/
|
|
276
|
+
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* 创建一个矩形路径
|
|
280
|
+
* @param {number} x 矩形路径起点的 x 轴坐标
|
|
281
|
+
* @param {number} y 矩形路径起点的 y 轴坐标
|
|
282
|
+
* @param {number} width 矩形路径的宽度
|
|
283
|
+
* @param {number} height 矩形路径的高度
|
|
284
|
+
*/
|
|
285
|
+
rect(x: number, y: number, width: number, height: number): void
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 恢复之前保存的绘图上下文
|
|
289
|
+
*/
|
|
290
|
+
restore(): void
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* 以原点为中心顺时针旋转当前坐标轴
|
|
294
|
+
* @param {rotate} 旋转角度,以弧度计 degrees * Math.PI/180;degrees 范围为 0-360
|
|
295
|
+
*/
|
|
296
|
+
rotate(rotate: number): void
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* 保存绘图上下文
|
|
300
|
+
*/
|
|
301
|
+
save(): void
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* 缩放变换
|
|
305
|
+
* @param {x} 水平方向的缩放因子
|
|
306
|
+
* @param {y} 垂直方向的缩放因子
|
|
307
|
+
*/
|
|
308
|
+
scale(x: number, y: number): void
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* 在填充线时使用虚线模式, 它使用一组值来指定描述模式的线和间隙的交替长度。
|
|
312
|
+
* @param {segments} Array<number>一组描述交替绘制线段和间距(坐标空间单位)长度的数字
|
|
313
|
+
*/
|
|
314
|
+
setLineDash(segments: Array<number>): void
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* 画出当前路径的边框。默认颜色色为黑色
|
|
318
|
+
*/
|
|
319
|
+
stroke(): void
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* 画出指定路径的边框。默认颜色色为黑色
|
|
323
|
+
* @param {path} Path2D
|
|
324
|
+
*/
|
|
325
|
+
stroke(path: Path2D): void
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* 画一个矩形(非填充)
|
|
329
|
+
* @param {number} x 矩形起点的 x 轴坐标
|
|
330
|
+
* @param {number} y 矩形起点的 y 轴坐标
|
|
331
|
+
* @param {number} width 矩形的宽度
|
|
332
|
+
* @param {number} height 矩形的高度
|
|
333
|
+
*/
|
|
334
|
+
strokeRect(x: number, y: number, width: number, height: number): void
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* 文本描边
|
|
338
|
+
* @param {string} text 要渲染的文本字符串
|
|
339
|
+
* @param {number} x 开始绘制文本的点的 X 轴坐标
|
|
340
|
+
* @param {number} y 开始绘制文本的点的 X 轴坐标
|
|
341
|
+
* @param {number} maxWidth 需要绘制的最大宽度
|
|
342
|
+
*/
|
|
343
|
+
strokeText(text: string, x: number, y: number, maxWidth: number): void
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* 使用矩阵多次叠加当前变换,矩阵由方法的参数进行描述。可以缩放、旋转、移动和倾斜上下文
|
|
347
|
+
* @param {number} scaleX 水平缩放
|
|
348
|
+
* @param {number} skewY 垂直倾斜
|
|
349
|
+
* @param {number} skewX 水平倾斜
|
|
350
|
+
* @param {number} scaleY 垂直缩放
|
|
351
|
+
* @param {number} translateX 水平移动
|
|
352
|
+
* @param {number} translateY 垂直移动
|
|
353
|
+
*/
|
|
354
|
+
transform(scaleX: Number, skewY: number, skewX: number, scaleY: number, translateX: number, translateY: number): void
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* 使用单位矩阵重新设置(覆盖)当前的变换并调用变换
|
|
358
|
+
* @param {number} scaleX 水平缩放
|
|
359
|
+
* @param {number} skewY 垂直倾斜
|
|
360
|
+
* @param {number} skewX 水平倾斜
|
|
361
|
+
* @param {number} scaleY 垂直缩放
|
|
362
|
+
* @param {number} translateX 水平移动
|
|
363
|
+
* @param {number} translateY 垂直移动
|
|
364
|
+
*/
|
|
365
|
+
setTransform(scaleX: Number, skewY: Number, skewX: Number, scaleY: Number, translateX: Number, translateY: Number): void
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* 使用单位矩阵重新设置当前变换
|
|
369
|
+
*/
|
|
370
|
+
resetTransform(): void
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* 当前网格添加平移变换
|
|
374
|
+
* @param {number} translateX 水平方向的移动距离
|
|
375
|
+
* @param {number} translateY 垂直方向的移动距离
|
|
376
|
+
*/
|
|
377
|
+
translate(translateX: number, translateY: number): void
|
|
378
|
+
}
|