@dcloudio/uni-app-x 0.5.17 → 0.6.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/options.d.ts +9 -0
- package/package.json +4 -3
- package/types/app.d.ts +59 -166
- package/types/index.d.ts +1 -2
- package/types/native/AsyncApiResult.d.ts +1 -1
- package/types/native/CSSStyleDeclaration.d.ts +1 -1
- package/types/native/CustomEvent.d.ts +3 -3
- package/types/native/DOMRect.d.ts +2 -2
- package/types/native/DrawableContext.d.ts +149 -149
- package/types/native/Element.d.ts +7 -5
- package/types/native/Event.d.ts +38 -38
- package/types/native/IApp.d.ts +2 -2
- package/types/native/IDocument.d.ts +3 -3
- package/types/native/INavigationBar.d.ts +1 -1
- package/types/native/IPage.d.ts +15 -10
- package/types/native/IPageManager.d.ts +2 -2
- package/types/native/IUniError.d.ts +18 -18
- package/types/native/ImageErrorEvent.d.ts +2 -2
- package/types/native/ImageLoadEvent.d.ts +2 -2
- package/types/native/InputBlurEvent.d.ts +8 -8
- package/types/native/InputConfirmEvent.d.ts +8 -8
- package/types/native/InputEvent.d.ts +20 -20
- package/types/native/InputFocusEvent.d.ts +13 -13
- package/types/native/InputKeyboardHeightChangeEvent.d.ts +12 -12
- package/types/native/MouseEvent.d.ts +58 -58
- package/types/native/NestedPreScrollEvent.d.ts +22 -22
- package/types/native/NodeData.d.ts +2 -2
- package/types/native/PageEvent.d.ts +2 -2
- package/types/native/PageScrollEvent.d.ts +5 -5
- package/types/native/RefresherEvent.d.ts +2 -2
- package/types/native/ResizeEvent.d.ts +27 -27
- package/types/native/RichTextItemClickEvent.d.ts +2 -2
- package/types/native/ScrollEvent.d.ts +28 -28
- package/types/native/ScrollToLowerEvent.d.ts +6 -6
- package/types/native/ScrollToUpperEvent.d.ts +6 -6
- package/types/native/SnapshotOptions.d.ts +8 -8
- package/types/native/SourceError.d.ts +1 -1
- package/types/native/StartNestedScrollEvent.d.ts +7 -7
- package/types/native/SwiperAnimationFinishEvent.d.ts +6 -6
- package/types/native/SwiperChangeEvent.d.ts +6 -6
- package/types/native/SwiperTransitionEvent.d.ts +6 -6
- package/types/native/TabTapEvent.d.ts +11 -9
- package/types/native/TextareaBlurEvent.d.ts +12 -12
- package/types/native/TextareaFocusEvent.d.ts +12 -12
- package/types/native/TextareaLineChangeEvent.d.ts +16 -16
- package/types/native/TouchEvent.d.ts +43 -43
- package/types/native/UTSAndroidHookProxy.d.ts +6 -6
- package/types/native/UniAggregateError.d.ts +4 -2
- package/types/native/UniAppManager.d.ts +3 -3
- package/types/native/UniElement.d.ts +30 -15
- package/types/native/UniError.d.ts +7 -7
- package/types/native/UniTabsElement.d.ts +4 -3
- package/types/native/UniTextElement.d.ts +3 -3
- package/types/native/UniVideoElement.d.ts +4 -4
- package/types/native/UniWebViewElement.d.ts +3 -3
- package/types/native/WebViewDownloadEvent.d.ts +3 -3
- package/types/native/WebViewErrorEvent.d.ts +3 -3
- package/types/native/WebViewLoadedEvent.d.ts +3 -3
- package/types/native/WebViewLoadingEvent.d.ts +4 -3
- package/types/native/WebViewMessageEvent.d.ts +3 -3
- package/types/native/WebViewStyles.d.ts +3 -3
- package/types/native/global.d.ts +254 -0
- package/types/native/index.d.ts +57 -58
- package/types/native-global/index.d.ts +1 -0
- package/types/page.d.ts +26 -8
- package/types/uni/core/index.d.ts +3 -3
- package/types/uni/core/lib/route/index.d.ts +12 -0
- package/types/uni/core/lib/route/interface.d.ts +31 -5
- package/types/uni/core/lib/ui/get-element-by-id/interface.d.ts +1 -1
- package/types/uni/core/lib/ui/page-scroll-to/interface.d.ts +1 -1
- package/types/uni/core/lib/ui/set-navigation-bar-color/index.d.ts +4 -0
- package/types/uni/core/lib/ui/set-navigation-bar-color/interface.d.ts +9 -1
- package/types/uni/core/lib/ui/set-navigation-bar-title/index.d.ts +4 -0
- package/types/uni/core/lib/ui/set-navigation-bar-title/interface.d.ts +10 -1
- package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +2 -2
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +27 -6
- package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +3 -3
- package/types/uni/uts-plugin-modules/lib/uni-facialRecognitionVerify/utssdk/index.d.ts +10 -0
- package/types/uni/uts-plugin-modules/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +63 -12
- package/types/vue/UniCloudDBElement.d.ts +1 -1
- package/types/shims-vue.d.ts +0 -14
package/options.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-app-x",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "uni-app x types",
|
|
5
5
|
"typings": "index.d.ts",
|
|
6
6
|
"author": "DCloud",
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
"build:types:plugin:api": "node ./scripts/build-types.js -t uts-plugin-api",
|
|
12
12
|
"build:types:plugin:component": "node ./scripts/build-types.js -t uts-plugin-component",
|
|
13
13
|
"build:types:plugin:modules": "node ./scripts/build-types.js -t uts-plugin-modules",
|
|
14
|
-
"build:types:plugin": "npm run build:types:plugin:api && npm run build:types:plugin:component",
|
|
14
|
+
"build:types:plugin": "npm run build:types:plugin:api && npm run build:types:plugin:component && npm run build:types:plugin:modules",
|
|
15
15
|
"build:types:meta": "node ./scripts/build-meta.js",
|
|
16
|
-
"build:types": "
|
|
16
|
+
"build:types:native": "node ./scripts/build-native.js",
|
|
17
|
+
"build:types": "build:types:native && npm run build:types:core && npm run build:types:plugin"
|
|
17
18
|
},
|
|
18
19
|
"devDependencies": {
|
|
19
20
|
"delete": "^1.1.0",
|
package/types/app.d.ts
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
/// <reference path='./common.d.ts' />
|
|
2
|
+
import { ComputedOptions, EditorCreateVueAppComponent, MethodOptions, OptionsData, ComponentInternalInstance, EditorVueAppComponent, EditorComponentPublicInstance, DefineApp } from '@vue/runtime-core'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Construct a type with a set of properties K of type T
|
|
6
|
+
*/
|
|
7
|
+
type Record<K extends keyof any, T> = {
|
|
8
|
+
[P in K]: T;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* From T, pick a set of properties whose keys are in the union K
|
|
12
|
+
*/
|
|
13
|
+
type Pick<T, K extends keyof T> = {
|
|
14
|
+
[P in K]: T[P];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Exclude from T those types that are assignable to U
|
|
18
|
+
*/
|
|
19
|
+
type Exclude<T, U> = T extends U ? never : T;
|
|
20
|
+
/**
|
|
21
|
+
* Construct a type with the properties of T except for those in type K.
|
|
22
|
+
*/
|
|
23
|
+
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
|
2
24
|
|
|
3
25
|
interface ReferrerInfo {
|
|
4
26
|
/**
|
|
@@ -132,8 +154,8 @@ interface PageNotFoundOption {
|
|
|
132
154
|
*/
|
|
133
155
|
isEntryPage: boolean;
|
|
134
156
|
}
|
|
135
|
-
|
|
136
|
-
interface
|
|
157
|
+
type GlobalData = Record<string, any | null>
|
|
158
|
+
interface UniAppOptions<G extends GlobalData = GlobalData> {
|
|
137
159
|
/**
|
|
138
160
|
* 全局对象
|
|
139
161
|
* 文档:[https://uniapp.dcloud.io/collocation/App?id=globaldata](https://uniapp.dcloud.io/collocation/App?id=globaldata)
|
|
@@ -199,7 +221,7 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
199
221
|
* }
|
|
200
222
|
*}
|
|
201
223
|
*/
|
|
202
|
-
globalData?:
|
|
224
|
+
globalData?: G;
|
|
203
225
|
/**
|
|
204
226
|
* 生命周期回调 监听应用初始化
|
|
205
227
|
*
|
|
@@ -549,160 +571,6 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
549
571
|
*}
|
|
550
572
|
*/
|
|
551
573
|
onPageNotFound?(options: PageNotFoundOption): void;
|
|
552
|
-
/**
|
|
553
|
-
* 未处理的 Promise 拒绝事件监听函数
|
|
554
|
-
*
|
|
555
|
-
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
556
|
-
* @uniPlatform {
|
|
557
|
-
* "app": {
|
|
558
|
-
* "android": {
|
|
559
|
-
* "osVer": "5.0",
|
|
560
|
-
* "uniVer": "√",
|
|
561
|
-
* "unixVer": "x"
|
|
562
|
-
* },
|
|
563
|
-
* "ios": {
|
|
564
|
-
* "osVer": "10.0",
|
|
565
|
-
* "uniVer": "√",
|
|
566
|
-
* "unixVer": "x"
|
|
567
|
-
* }
|
|
568
|
-
* },
|
|
569
|
-
* "mp": {
|
|
570
|
-
* "weixin": {
|
|
571
|
-
* "hostVer": "√",
|
|
572
|
-
* "uniVer": "√",
|
|
573
|
-
* "unixVer": "x"
|
|
574
|
-
* },
|
|
575
|
-
* "alipay": {
|
|
576
|
-
* "hostVer": "√",
|
|
577
|
-
* "uniVer": "√",
|
|
578
|
-
* "unixVer": "x"
|
|
579
|
-
* },
|
|
580
|
-
* "baidu": {
|
|
581
|
-
* "hostVer": "√",
|
|
582
|
-
* "uniVer": "√",
|
|
583
|
-
* "unixVer": "x"
|
|
584
|
-
* },
|
|
585
|
-
* "toutiao": {
|
|
586
|
-
* "hostVer": "√",
|
|
587
|
-
* "uniVer": "√",
|
|
588
|
-
* "unixVer": "x"
|
|
589
|
-
* },
|
|
590
|
-
* "lark": {
|
|
591
|
-
* "hostVer": "√",
|
|
592
|
-
* "uniVer": "√",
|
|
593
|
-
* "unixVer": "x"
|
|
594
|
-
* },
|
|
595
|
-
* "qq": {
|
|
596
|
-
* "hostVer": "√",
|
|
597
|
-
* "uniVer": "√",
|
|
598
|
-
* "unixVer": "x"
|
|
599
|
-
* },
|
|
600
|
-
* "kuaishou": {
|
|
601
|
-
* "hostVer": "√",
|
|
602
|
-
* "uniVer": "√",
|
|
603
|
-
* "unixVer": "x"
|
|
604
|
-
* },
|
|
605
|
-
* "jd": {
|
|
606
|
-
* "hostVer": "√",
|
|
607
|
-
* "uniVer": "√",
|
|
608
|
-
* "unixVer": "x"
|
|
609
|
-
* },
|
|
610
|
-
* "360": {
|
|
611
|
-
* "hostVer": "√",
|
|
612
|
-
* "uniVer": "√",
|
|
613
|
-
* "unixVer": "x"
|
|
614
|
-
* }
|
|
615
|
-
* },
|
|
616
|
-
* "quickapp": {
|
|
617
|
-
* "uniVer": "√",
|
|
618
|
-
* "unixVer": "x"
|
|
619
|
-
* },
|
|
620
|
-
* "web": {
|
|
621
|
-
* "uniVer": "√",
|
|
622
|
-
* "unixVer": "x"
|
|
623
|
-
* }
|
|
624
|
-
*}
|
|
625
|
-
*/
|
|
626
|
-
|
|
627
|
-
// onUnhandledRejection?(options: UniNamespace.OnUnhandledRejectionCallbackResult): void;
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* 监听系统主题变化
|
|
631
|
-
*
|
|
632
|
-
* @tutorial [https://uniapp.dcloud.io/collocation/frame/lifecycle](https://uniapp.dcloud.io/collocation/frame/lifecycle)
|
|
633
|
-
* @uniPlatform {
|
|
634
|
-
* "app": {
|
|
635
|
-
* "android": {
|
|
636
|
-
* "osVer": "5.0",
|
|
637
|
-
* "uniVer": "√",
|
|
638
|
-
* "unixVer": "x"
|
|
639
|
-
* },
|
|
640
|
-
* "ios": {
|
|
641
|
-
* "osVer": "10.0",
|
|
642
|
-
* "uniVer": "√",
|
|
643
|
-
* "unixVer": "x"
|
|
644
|
-
* }
|
|
645
|
-
* },
|
|
646
|
-
* "mp": {
|
|
647
|
-
* "weixin": {
|
|
648
|
-
* "hostVer": "√",
|
|
649
|
-
* "uniVer": "√",
|
|
650
|
-
* "unixVer": "x"
|
|
651
|
-
* },
|
|
652
|
-
* "alipay": {
|
|
653
|
-
* "hostVer": "√",
|
|
654
|
-
* "uniVer": "√",
|
|
655
|
-
* "unixVer": "x"
|
|
656
|
-
* },
|
|
657
|
-
* "baidu": {
|
|
658
|
-
* "hostVer": "√",
|
|
659
|
-
* "uniVer": "√",
|
|
660
|
-
* "unixVer": "x"
|
|
661
|
-
* },
|
|
662
|
-
* "toutiao": {
|
|
663
|
-
* "hostVer": "√",
|
|
664
|
-
* "uniVer": "√",
|
|
665
|
-
* "unixVer": "x"
|
|
666
|
-
* },
|
|
667
|
-
* "lark": {
|
|
668
|
-
* "hostVer": "√",
|
|
669
|
-
* "uniVer": "√",
|
|
670
|
-
* "unixVer": "x"
|
|
671
|
-
* },
|
|
672
|
-
* "qq": {
|
|
673
|
-
* "hostVer": "√",
|
|
674
|
-
* "uniVer": "√",
|
|
675
|
-
* "unixVer": "x"
|
|
676
|
-
* },
|
|
677
|
-
* "kuaishou": {
|
|
678
|
-
* "hostVer": "√",
|
|
679
|
-
* "uniVer": "√",
|
|
680
|
-
* "unixVer": "x"
|
|
681
|
-
* },
|
|
682
|
-
* "jd": {
|
|
683
|
-
* "hostVer": "√",
|
|
684
|
-
* "uniVer": "√",
|
|
685
|
-
* "unixVer": "x"
|
|
686
|
-
* },
|
|
687
|
-
* "360": {
|
|
688
|
-
* "hostVer": "√",
|
|
689
|
-
* "uniVer": "√",
|
|
690
|
-
* "unixVer": "x"
|
|
691
|
-
* }
|
|
692
|
-
* },
|
|
693
|
-
* "quickapp": {
|
|
694
|
-
* "uniVer": "√",
|
|
695
|
-
* "unixVer": "x"
|
|
696
|
-
* },
|
|
697
|
-
* "web": {
|
|
698
|
-
* "uniVer": "√",
|
|
699
|
-
* "unixVer": "x"
|
|
700
|
-
* }
|
|
701
|
-
*}
|
|
702
|
-
*/
|
|
703
|
-
|
|
704
|
-
// onThemeChange?(options: UniNamespace.OnThemeChangeCallbackResult): void;
|
|
705
|
-
|
|
706
574
|
/**
|
|
707
575
|
* 监听 nvue 页面消息
|
|
708
576
|
*
|
|
@@ -935,15 +803,40 @@ interface AppInstance<T extends AnyObject = {}> {
|
|
|
935
803
|
onLastPageBackPress?(): void;
|
|
936
804
|
}
|
|
937
805
|
|
|
938
|
-
type AppConstructor = <T extends AnyObject & AppInstance>(
|
|
939
|
-
options: AppInstance<T> & T,
|
|
940
|
-
) => void;
|
|
941
|
-
|
|
942
|
-
|
|
943
806
|
/**
|
|
944
|
-
*
|
|
945
|
-
* @tutorial https://uniapp.dcloud.net.cn/tutorial/page.html#getapp
|
|
807
|
+
* Obtain the return type of a function type
|
|
946
808
|
*/
|
|
947
|
-
type
|
|
809
|
+
type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;
|
|
810
|
+
|
|
811
|
+
type EditorComponentPublicInstanceX<D extends OptionsData, C extends ComputedOptions, M extends MethodOptions, G extends GlobalData> = EditorComponentPublicInstance<D, C, M> & {
|
|
812
|
+
globalData: G
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
type EditorVueAppComponentX<D extends OptionsData, C extends ComputedOptions, M extends MethodOptions, G extends GlobalData> = EditorVueAppComponent<D, C, M> & {
|
|
816
|
+
$: EditorComponentPublicInstanceX<D, C, M, G>
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
type EditorCreateVueAppComponentX<D extends OptionsData = OptionsData, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, G extends GlobalData = GlobalData> = Omit<EditorCreateVueAppComponent, 'create'> & {
|
|
820
|
+
// 仅用于编辑器提示,TODO 重写 create 方法实现
|
|
821
|
+
create: (instance: ComponentInternalInstance) => EditorVueAppComponentX<D, C, M, G>;
|
|
822
|
+
}
|
|
948
823
|
|
|
949
|
-
|
|
824
|
+
type AppInstance<T extends EditorCreateVueAppComponentX> = ReturnType<T['create']>['$']
|
|
825
|
+
|
|
826
|
+
declare global {
|
|
827
|
+
export interface AppCreateVueAppComponentDefault { }
|
|
828
|
+
/**
|
|
829
|
+
* `getApp()` 函数用于获取当前应用实例,可通过应用实例调用 App.uvue methods 中定义的方法。
|
|
830
|
+
* @tutorial https://uniapp.dcloud.net.cn/tutorial/page.html#getapp
|
|
831
|
+
*/
|
|
832
|
+
function getApp<T extends EditorCreateVueAppComponentX = AppCreateVueAppComponentDefault>(): AppInstance<T>
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
type DefineAppX<D extends OptionsData, C extends ComputedOptions, M extends MethodOptions, G extends GlobalData> = DefineApp<D, C, M> & UniAppOptions<G>
|
|
836
|
+
|
|
837
|
+
declare module '@vue/runtime-core' {
|
|
838
|
+
interface AppCustomOptions extends UniAppOptions {
|
|
839
|
+
|
|
840
|
+
}
|
|
841
|
+
export function defineApp<D extends OptionsData = OptionsData, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, G extends GlobalData = GlobalData>(options: DefineAppX<D, C, M, G>): EditorCreateVueAppComponentX<D, C, M, G>
|
|
842
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference path='./native/
|
|
1
|
+
/// <reference path='./native/global.d.ts' />
|
|
2
2
|
/// <reference path='./vue/index.d.ts' />
|
|
3
3
|
/// <reference path='./uni/index.d.ts' />
|
|
4
4
|
/// <reference path='./uni-cloud/index.d.ts' />
|
|
5
5
|
/// <reference path='./app.d.ts' />
|
|
6
6
|
/// <reference path='./page.d.ts' />
|
|
7
|
-
/// <reference path='./shims-vue.d.ts' />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { Event } from "./Event";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @package io.dcloud.uniapp.runtime
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
export class CustomEventOptions<T>{
|
|
7
7
|
detail: T
|
|
8
8
|
constructor (detail: T)
|
|
9
9
|
}
|
|
@@ -11,7 +11,7 @@ declare class CustomEventOptions<T>{
|
|
|
11
11
|
/**
|
|
12
12
|
* @package io.dcloud.uniapp.runtime
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
export class CustomEvent<T> extends Event {
|
|
15
15
|
get detail(): T
|
|
16
16
|
constructor (type: string, options: CustomEventOptions<T>)
|
|
17
17
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* 一个 DOMRect 代表一个矩形。
|
|
3
3
|
* @package io.dcloud.uniapp.runtime
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
export class DOMRect {
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* 创建一个新的 DOMRect 对象
|
|
@@ -11,7 +11,7 @@ declare class DOMRect {
|
|
|
11
11
|
* @param {number} [width=0] 矩形的宽
|
|
12
12
|
* @param {number} [height=0] 矩形的高
|
|
13
13
|
*/
|
|
14
|
-
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
14
|
+
constructor (x?: number, y?: number, width?: number, height?: number);
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* 矩形的宽
|
|
@@ -2,162 +2,162 @@
|
|
|
2
2
|
* @package io.dcloud.uniapp.runtime
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
5
|
+
export class DrawableContext {
|
|
6
|
+
/**
|
|
7
|
+
* 设置字体大小
|
|
8
|
+
* @defaultValue 10px
|
|
9
|
+
*/
|
|
10
|
+
font: string
|
|
11
|
+
/**
|
|
12
|
+
* 设置填充颜色
|
|
13
|
+
* @defaultValue #000 (黑色)
|
|
14
|
+
*/
|
|
15
|
+
fillStyle: string.ColorString
|
|
16
|
+
/**
|
|
17
|
+
* 指定如何绘制每一条线条末端的属性,可选值:`butt`线段末端以方形结束;`round`线段末端以圆形结束;`square`线段末端以方形结束,但是会增加一个一半宽度的矩形区域。
|
|
18
|
+
* @defaultValue butt
|
|
19
|
+
*/
|
|
20
|
+
lineCap: string
|
|
21
|
+
/**
|
|
22
|
+
* 设置虚线偏移量
|
|
23
|
+
*/
|
|
24
|
+
lineDashOffset: number
|
|
25
|
+
/**
|
|
26
|
+
* 设置 2 个长度不为 0 的线条相连部分如何连接在一起的属性,可选值:`bevel`斜角;`round`圆角;`miter`尖角。
|
|
27
|
+
* @defaultValue miter
|
|
28
|
+
*/
|
|
29
|
+
lineJoin: string
|
|
30
|
+
/**
|
|
31
|
+
* 设置线条的宽度
|
|
32
|
+
* @defaultValue 1px
|
|
33
|
+
*/
|
|
34
|
+
lineWidth: number
|
|
35
|
+
/**
|
|
36
|
+
* 设置边框的颜色
|
|
37
|
+
* @defaultValue #000 (黑色)
|
|
38
|
+
*/
|
|
39
|
+
strokeStyle: string.ColorString
|
|
40
|
+
/**
|
|
41
|
+
* 设置文本的对齐方式,可取值:`left`左对齐;`center`居中对齐;`right`右对齐。
|
|
42
|
+
* @defaultValue left
|
|
43
|
+
*/
|
|
44
|
+
textAlign: string
|
|
45
|
+
/**
|
|
46
|
+
* 创建一个新的空路径
|
|
47
|
+
*/
|
|
48
|
+
beginPath(): void
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
/**
|
|
51
|
+
* 绘制一段弧线
|
|
52
|
+
* @param {number} x 圆心的X轴坐标
|
|
53
|
+
* @param {number} y 圆心的Y轴坐标
|
|
54
|
+
* @param {number} radius 圆弧的半径
|
|
55
|
+
* @param {number} startAngle 圆弧的起始点,x 轴方向开始计算,单位为弧度
|
|
56
|
+
* @param {number} endAngle 圆弧的终点,单位为弧度
|
|
57
|
+
* @param {number} [anticlockwise=true] 圆弧绘制方向,true:逆时针绘制,false:顺时针绘制。
|
|
58
|
+
*/
|
|
59
|
+
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean | null): void
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
/**
|
|
62
|
+
* 将一个新的路径的起始点移动到 (x,y) 坐标
|
|
63
|
+
* @param {number} x 点的X轴坐标
|
|
64
|
+
* @param {number} y 点的Y轴坐标
|
|
65
|
+
*/
|
|
66
|
+
moveTo(x: number, y: number): void
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
68
|
+
/**
|
|
69
|
+
* 创建一个矩形路径
|
|
70
|
+
* @param {number} x 矩形起点的X轴坐标
|
|
71
|
+
* @param {number} y 矩形起点的Y轴坐标
|
|
72
|
+
* @param {number} width 矩形宽度
|
|
73
|
+
* @param {number} height 矩形高度
|
|
74
|
+
*/
|
|
75
|
+
rect(x: number, y: number, width: number, height: number): void
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
77
|
+
/**
|
|
78
|
+
* 将路径的最后一个点连接到 (x,y) 坐标
|
|
79
|
+
* @param {number} x 线终点的X轴坐标
|
|
80
|
+
* @param {number} y 线终点的Y轴坐标
|
|
81
|
+
*/
|
|
82
|
+
lineTo(x: number, y: number): void
|
|
83
|
+
/**
|
|
84
|
+
* 闭合路径,将最后一个点与起点连接起来。如果图形已经封闭,或者只有一个点,那么此方法不会产生任何效果。
|
|
85
|
+
*/
|
|
86
|
+
closePath(): void
|
|
87
|
+
/**
|
|
88
|
+
* 绘制当前或已经存在的路径的边框。
|
|
89
|
+
*/
|
|
90
|
+
stroke(): void
|
|
91
|
+
/**
|
|
92
|
+
* 绘制一个矩形框
|
|
93
|
+
* @param {number} x 矩形起点的X轴坐标
|
|
94
|
+
* @param {number} y 矩形起点的Y轴坐标
|
|
95
|
+
* @param {number} width 矩形宽度
|
|
96
|
+
* @param {number} height 矩形高度
|
|
97
|
+
*/
|
|
98
|
+
strokeRect(x: number, y: number, width: number, height: number): void
|
|
99
|
+
/**
|
|
100
|
+
* 绘制空心字符
|
|
101
|
+
* @param {string} text 要绘制的字符
|
|
102
|
+
* @param {number} x 字符开始绘制的X轴坐标
|
|
103
|
+
* @param {number} y 字符开始绘制的Y轴坐标
|
|
104
|
+
*/
|
|
105
|
+
strokeText(text: string, x: number, y: number): void
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
/**
|
|
108
|
+
* 填充当前或已存在的路径
|
|
109
|
+
* @param {string} [fillRule=nonzero] 填充规则。可取值:`nonzero`非零环绕规则;`evenodd`奇偶环绕规则。
|
|
110
|
+
*/
|
|
111
|
+
fill(fillRule?: string | null): void
|
|
112
112
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
/**
|
|
114
|
+
* 绘制一个实心矩形
|
|
115
|
+
* @param {number} x 矩形起点的X轴坐标
|
|
116
|
+
* @param {number} y 矩形起点的Y轴坐标
|
|
117
|
+
* @param {number} width 矩形宽度
|
|
118
|
+
* @param {number} height 矩形高度
|
|
119
|
+
*/
|
|
120
|
+
fillRect(x: number, y: number, width: number, height: number): void
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
122
|
+
/**
|
|
123
|
+
* 绘制实心字符
|
|
124
|
+
* @param {string} text 要绘制的字符
|
|
125
|
+
* @param {number} x 字符开始绘制的X轴坐标
|
|
126
|
+
* @param {number} y 字符开始绘制的Y轴坐标
|
|
127
|
+
*/
|
|
128
|
+
fillText(text: string, x: number, y: number): void
|
|
129
|
+
/**
|
|
130
|
+
* 清空绘制数据
|
|
131
|
+
*/
|
|
132
|
+
reset(): void
|
|
133
|
+
/**
|
|
134
|
+
* 将所有绘制内容更新到画布上
|
|
135
|
+
*/
|
|
136
|
+
update(): void
|
|
137
|
+
/**
|
|
138
|
+
* 设置虚线样式
|
|
139
|
+
* @param {Array<number>} segments 一组描述交替绘制线段和间距长度的数字。
|
|
140
|
+
*/
|
|
141
|
+
setLineDash(segments: Array<number>): void
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
/**
|
|
144
|
+
* 根据控制点和半径绘制圆弧路径
|
|
145
|
+
* @param {number} x1 第一个控制点的 x 轴坐标
|
|
146
|
+
* @param {number} y1 第一个控制点的 y 轴坐标
|
|
147
|
+
* @param {number} x2 第二个控制点的 x 轴坐标
|
|
148
|
+
* @param {number} y2 第二个控制点的 y 轴坐标
|
|
149
|
+
* @param {number} radius 圆弧的半径
|
|
150
|
+
*/
|
|
151
|
+
// arcTo(x1 : number, y1 : number, x2 : number, y2 : number, radius : number) : void
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
153
|
+
/**
|
|
154
|
+
* 创建三次方贝塞尔曲线路径
|
|
155
|
+
* @param {number} cp1x 第一个贝塞尔控制点的 x 坐标
|
|
156
|
+
* @param {number} cp1y 第一个贝塞尔控制点的 y 坐标
|
|
157
|
+
* @param {number} cp2x 第二个贝塞尔控制点的 x 坐标
|
|
158
|
+
* @param {number} cp2y 第二个贝塞尔控制点的 y 坐标
|
|
159
|
+
* @param {number} x 结束点的 x 坐标
|
|
160
|
+
* @param {number} y 结束点的 y 坐标
|
|
161
|
+
*/
|
|
162
|
+
bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void
|
|
163
163
|
}
|