• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# ArkUI子系统JS API变更
2
3OpenHarmony 3.2 Beta2版本相较于OpenHarmony 3.2 Beta1版本,ArkUI子系统的API变更如下:
4
5## 接口变更
6
7| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
8|---|---|---|---|
9| ArkUI | AbilityComponentInterface | (want: Want): AbilityComponentAttribute; | 新增 |
10| ArkUI | AbilityComponentAttribute | onConnect(callback: () => void): AbilityComponentAttribute; | 新增 |
11| ArkUI | AbilityComponentAttribute | onDisconnect(callback: () => void): AbilityComponentAttribute; | 新增 |
12| ArkUI | HttpAuthHandler | isHttpAuthInfoSaved(): boolean; | 新增 |
13| ArkUI | HttpAuthHandler | cancel(): void; | 新增 |
14| ArkUI | HttpAuthHandler | confirm(userName: string, password: string): boolean; | 新增 |
15| ArkUI | HttpAuthHandler | constructor(); | 新增 |
16| ArkUI | HitTestValue | getExtra(): string; | 新增 |
17| ArkUI | HitTestValue | getType(): HitTestType; | 新增 |
18| ArkUI | HitTestValue | constructor(); | 新增 |
19| ArkUI | JsResult | handlePromptConfirm(result: string): void; | 新增 |
20| ArkUI | Resource | readonly moduleName: string; | 新增 |
21| ArkUI | Resource | readonly bundleName: string; | 新增 |
22| ArkUI | TextInputAttribute | textAlign(value: TextAlign): TextInputAttribute; | 新增 |
23| ArkUI | TextInputAttribute | showPasswordIcon(value: boolean): TextInputAttribute; | 新增 |
24| ArkUI | TextInputAttribute | copyOption(value: boolean \| CopyOption): TextInputAttribute; | 新增 |
25| ArkUI | InputType | PhoneNumber | 新增 |
26| ArkUI | TextAreaAttribute | copyOption(value: boolean \| CopyOption): TextAreaAttribute; | 新增 |
27| ArkUI | TextAttribute | copyOption(value: boolean \| CopyOption): TextAttribute; | 新增 |
28| ArkUI | SearchAttribute | textAlign(value: TextAlign): SearchAttribute; | 新增 |
29| ArkUI | SearchAttribute | copyOption(value: boolean \| CopyOption): SearchAttribute; | 新增 |
30| ArkUI | ScrollAttribute | onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }): ScrollAttribute; | 新增 |
31| ArkUI | Scroller | scrollBy(dx: Length, dy: Length); | 新增 |
32| ArkUI | RemoteWindowInterface | (target: WindowAnimationTarget): RemoteWindowAttribute; | 新增 |
33| ArkUI | WindowAnimationTarget | readonly windowBounds: RRect; | 新增 |
34| ArkUI | WindowAnimationTarget | readonly abilityName: string; | 新增 |
35| ArkUI | WindowAnimationTarget | readonly bundleName: string; | 新增 |
36| ArkUI | RRect | radius: number; | 新增 |
37| ArkUI | RRect | height: number; | 新增 |
38| ArkUI | RRect | width: number; | 新增 |
39| ArkUI | RRect | top: number; | 新增 |
40| ArkUI | RRect | left: number; | 新增 |
41| ArkUI | RelativeContainerInterface | (): RelativeContainerAttribute; | 新增 |
42| ArkUI | PluginComponentAttribute | onError(callback: (info: { errcode: number; msg: string }) => void): PluginComponentAttribute; | 新增 |
43| ArkUI | PluginComponentAttribute | onComplete(callback: () => void): PluginComponentAttribute; | 新增 |
44| ArkUI | PluginComponentInterface | (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; | 新增 |
45| ArkUI | PluginComponentTemplate | ability: string; | 新增 |
46| ArkUI | PluginComponentTemplate | source: string; | 新增 |
47| ArkUI | PatternLockAttribute | autoReset(value: boolean): PatternLockAttribute; | 新增 |
48| ArkUI | PatternLockAttribute | onPatternComplete(callback: (input: Array\<number>) => void): PatternLockAttribute; | 新增 |
49| ArkUI | PatternLockAttribute | pathStrokeWidth(value: number \| string): PatternLockAttribute; | 新增 |
50| ArkUI | PatternLockAttribute | pathColor(value: ResourceColor): PatternLockAttribute; | 新增 |
51| ArkUI | PatternLockAttribute | activeColor(value: ResourceColor): PatternLockAttribute; | 新增 |
52| ArkUI | PatternLockAttribute | selectedColor(value: ResourceColor): PatternLockAttribute; | 新增 |
53| ArkUI | PatternLockAttribute | regularColor(value: ResourceColor): PatternLockAttribute; | 新增 |
54| ArkUI | PatternLockAttribute | backgroundColor(value: ResourceColor): PatternLockAttribute; | 新增 |
55| ArkUI | PatternLockAttribute | circleRadius(value: Length): PatternLockAttribute; | 新增 |
56| ArkUI | PatternLockAttribute | sideLength(value: Length): PatternLockAttribute; | 新增 |
57| ArkUI | PatternLockInterface | (controller?: PatternLockController): PatternLockAttribute; | 新增 |
58| ArkUI | PatternLockController | reset(); | 新增 |
59| ArkUI | PatternLockController | constructor(); | 新增 |
60| ArkUI | ListAttribute | onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }): ListAttribute; | 新增 |
61| ArkUI | ListAttribute | alignListItem(value: ListItemAlign): ListAttribute; | 新增 |
62| ArkUI | ListAttribute | lanes(value: number \| LengthConstrain): ListAttribute; | 新增 |
63| ArkUI | ListItemAlign | End | 新增 |
64| ArkUI | ListItemAlign | Center | 新增 |
65| ArkUI | ListItemAlign | Start | 新增 |
66| ArkUI | ImageFrameInfo | duration?: number; | 新增 |
67| ArkUI | ImageFrameInfo | left?: number \| string; | 新增 |
68| ArkUI | ImageFrameInfo | top?: number \| string; | 新增 |
69| ArkUI | ImageFrameInfo | height?: number \| string; | 新增 |
70| ArkUI | ImageFrameInfo | width?: number \| string; | 新增 |
71| ArkUI | ImageFrameInfo | src: string \| Resource; | 新增 |
72| ArkUI | GridRowAttribute | onBreakpointChange(callback: (breakpoints: string) => void): GridRowAttribute; | 新增 |
73| ArkUI | GridRowInterface | (optiion?: GridRowOptions): GridRowAttribute; | 新增 |
74| ArkUI | GridRowOptions | direction?: GridRowDirection; | 新增 |
75| ArkUI | GridRowOptions | breakpoints?: BreakPoints; | 新增 |
76| ArkUI | GridRowOptions | columns?: number \| GridRowColumnOption; | 新增 |
77| ArkUI | GridRowOptions | gutter?: Length \| GetterOption; | 新增 |
78| ArkUI | BreakPoints | reference?: BreakpointsReference, | 新增 |
79| ArkUI | BreakPoints | value?: Array\<string>, | 新增 |
80| ArkUI | GridRowDirection | RowReverse | 新增 |
81| ArkUI | GridRowDirection | Row | 新增 |
82| ArkUI | BreakpointsReference | ComponentSize | 新增 |
83| ArkUI | BreakpointsReference | WindowSize | 新增 |
84| ArkUI | GetterOption | y?: Length \| GridRowSizeOption | 新增 |
85| ArkUI | GetterOption | x?: Length \| GridRowSizeOption, | 新增 |
86| ArkUI | GridRowColumnOption | xxl?: number, | 新增 |
87| ArkUI | GridRowColumnOption | xl?: number, | 新增 |
88| ArkUI | GridRowColumnOption | lg?: number, | 新增 |
89| ArkUI | GridRowColumnOption | md?: number, | 新增 |
90| ArkUI | GridRowColumnOption | sm?: number, | 新增 |
91| ArkUI | GridRowColumnOption | xs?: number, | 新增 |
92| ArkUI | GridRowSizeOption | xxl?: Length, | 新增 |
93| ArkUI | GridRowSizeOption | xl?: Length, | 新增 |
94| ArkUI | GridRowSizeOption | lg?: Length, | 新增 |
95| ArkUI | GridRowSizeOption | md?: Length, | 新增 |
96| ArkUI | GridRowSizeOption | sm?: Length, | 新增 |
97| ArkUI | GridRowSizeOption | xs?: Length, | 新增 |
98| ArkUI | GridColAttribute | order(value: number \| GridColColumnOption): GridRowAttribute; | 新增 |
99| ArkUI | GridColAttribute | offset(value: number \| GridColColumnOption): GridRowAttribute; | 新增 |
100| ArkUI | GridColAttribute | span(value: number \| GridColColumnOption): GridRowAttribute; | 新增 |
101| ArkUI | GridColInterface | (optiion?: GridColOptions): GridColAttribute; | 新增 |
102| ArkUI | GridColOptions | order?: number \| GridColColumnOption; | 新增 |
103| ArkUI | GridColOptions | offset?: number \| GridColColumnOption; | 新增 |
104| ArkUI | GridColOptions | span?: number \| GridColColumnOption; | 新增 |
105| ArkUI | GridColColumnOption | xxl?: number, | 新增 |
106| ArkUI | GridColColumnOption | xl?: number, | 新增 |
107| ArkUI | GridColColumnOption | lg?: number, | 新增 |
108| ArkUI | GridColColumnOption | md?: number, | 新增 |
109| ArkUI | GridColColumnOption | sm?: number, | 新增 |
110| ArkUI | GridColColumnOption | xs?: number, | 新增 |
111| ArkUI | CopyOption | CrossDevice = 2 | 新增 |
112| ArkUI | CopyOption | LocalDevice = 1 | 新增 |
113| ArkUI | CopyOption | InApp = 0 | 新增 |
114| ArkUI | Placement | RightBottom | 新增 |
115| ArkUI | Placement | RightTop | 新增 |
116| ArkUI | Placement | LeftBottom | 新增 |
117| ArkUI | Placement | LeftTop | 新增 |
118| ArkUI | CommonMethod | onVisibleAreaChange(ratios: Array\<number>, event: (isVisible: boolean, currentRatio: number) => void): T; | 新增 |
119| ArkUI | CommonMethod | alignRules(value: AlignRuleOption): T; | 新增 |
120| ArkUI | CommonMethod | tabIndex(index: number): T; | 新增 |
121| ArkUI | CommonMethod | borderImage(value: BorderImageOption): T; | 新增 |
122| ArkUI | CommonMethod | backgroundBlurStyle(value: BlurStyle): T; | 新增 |
123| ArkUI | BorderImageOption | fill?: boolean | 新增 |
124| ArkUI | BorderImageOption | outset?: Length \| EdgeWidths, | 新增 |
125| ArkUI | BorderImageOption | width?: Length \| EdgeWidths, | 新增 |
126| ArkUI | BorderImageOption | source?: string \| Resource \| linearGradient, | 新增 |
127| ArkUI | BorderImageOption | repeat?: RepeatMode, | 新增 |
128| ArkUI | BorderImageOption | slice?: Length \| EdgeWidths, | 新增 |
129| ArkUI | BlurStyle | Thick | 新增 |
130| ArkUI | BlurStyle | Regular | 新增 |
131| ArkUI | BlurStyle | Thin | 新增 |
132| ArkUI | RepeatMode | Space | 新增 |
133| ArkUI | RepeatMode | Round | 新增 |
134| ArkUI | RepeatMode | Stretch | 新增 |
135| ArkUI | RepeatMode | Repeat | 新增 |
136| ArkUI | AlignRuleOption | center?: { anchor: string, align: VerticalAlign }; | 新增 |
137| ArkUI | AlignRuleOption | bottom?: { anchor: string, align: VerticalAlign }; | 新增 |
138| ArkUI | AlignRuleOption | top?: { anchor: string, align: VerticalAlign }; | 新增 |
139| ArkUI | AlignRuleOption | middle?: { anchor: string, align: HorizontalAlign }; | 新增 |
140| ArkUI | AlignRuleOption | right?: { anchor: string, align: HorizontalAlign }; | 新增 |
141| ArkUI | AlignRuleOption | left?: { anchor: string, align: HorizontalAlign }; | 新增 |
142| ArkUI | ICurve | interpolate(fraction : number) : number; | 新增 |
143| elementName | ElementName | moduleName?: string; | 新增 |
144| global |  |  function sendMouseEvent(event: MouseEvent): boolean; | 新增 |
145| global |  |  function sendKeyEvent(event: KeyEvent): boolean; | 新增 |
146| global |  |  function sendTouchEvent(event: TouchObject): boolean; | 新增 |
147| global |  |  function sendEventByKey(id: string, action: number, params: string): boolean; | 新增 |
148| global |  |  function getInspectorTree(): string; | 新增 |
149| global |  |  function getInspectorByKey(id: string): string; | 新增 |
150| ohos.curves | curves | function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve; | 新增 |
151| ohos.curves | curves | function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve; | 新增 |
152| ohos.curves | curves | function stepsCurve(count: number, end: boolean): ICurve; | 新增 |
153| ohos.curves | curves | function initCurve(curve?: Curve): ICurve; | 新增 |
154| ohos.curves | ICurve | interpolate(fraction : number) : number; | 新增 |
155| ohos.router | RouterMode | Single | 新增 |
156| ohos.router | RouterMode | Standard | 新增 |
157| ohos.uiAppearance | uiAppearance | function getDarkMode(): DarkMode; | 新增 |
158| ohos.uiAppearance | uiAppearance | function setDarkMode(mode: DarkMode, callback: AsyncCallback\<void>): void;<br>function setDarkMode(mode: DarkMode): Promise\<void>; | 新增 |
159| ohos.uiAppearance | DarkMode | ALWAYS_LIGHT = 1 | 新增 |
160| ohos.uiAppearance | DarkMode | ALWAYS_DARK = 0 | 新增 |
161| viewmodel | CanvasRenderingContext2D | getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap | 新增 |
162| viewmodel | OffscreenCanvasRenderingContext2D | getPixelMap(sx: number, sy: number, sw: number, sh: number): PixelMap | 新增 |
163| ohos.curves | curves | function spring(velocity: number, mass: number, stiffness: number, damping: number): string; | 废弃 |
164| ohos.curves | curves | function cubicBezier(x1: number, y1: number, x2: number, y2: number): string; | 废弃 |
165| ohos.curves | curves | function steps(count: number, end: boolean): string; | 废弃 |
166| ohos.curves | curves | function init(curve?: Curve): string; | 废弃 |
167| system.router | Router | static disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void; | 废弃 |
168| system.router | Router | static enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void; | 废弃 |
169| system.router | Router | static getState(): RouterState; | 废弃 |
170| system.router | Router | static getLength(): string; | 废弃 |
171| system.router | Router | static clear(): void; | 废弃 |
172| system.router | Router | static getParams(): ParamsInterface; | 废弃 |
173| system.router | Router | static back(options?: BackRouterOptions): void; | 废弃 |
174| system.router | Router | static replace(options: RouterOptions): void; | 废弃 |
175| system.router | Router | static push(options: RouterOptions): void; | 废弃 |
176| system.router | DisableAlertBeforeBackPageOptions | complete?: () => void; | 废弃 |
177| system.router | DisableAlertBeforeBackPageOptions | cancel?: (errMsg: string) => void; | 废弃 |
178| system.router | DisableAlertBeforeBackPageOptions | success?: (errMsg: string) => void; | 废弃 |
179| system.router | EnableAlertBeforeBackPageOptions | complete?: () => void; | 废弃 |
180| system.router | EnableAlertBeforeBackPageOptions | cancel?: (errMsg: string) => void; | 废弃 |
181| system.router | EnableAlertBeforeBackPageOptions | success?: (errMsg: string) => void; | 废弃 |
182| system.router | EnableAlertBeforeBackPageOptions | message: string; | 废弃 |
183| system.router | RouterState | path: string; | 废弃 |
184| system.router | RouterState | name: string; | 废弃 |
185| system.router | RouterState | index: number; | 废弃 |
186| system.router | BackRouterOptions | params?: Object; | 废弃 |
187| system.router | BackRouterOptions | uri?: string; | 废弃 |
188| system.router | RouterOptions | params?: Object; | 废弃 |
189| system.router | RouterOptions | uri: string; | 废弃 |
190| ohos.prompt | ActionMenuOptions |old : title?: string;<br>new : title?: string \| Resource;  | 变更 |
191| ohos.prompt | ShowDialogOptions |old : message?: string;<br>new : message?: string \| Resource;  | 变更 |
192| ohos.prompt | ShowDialogOptions |old : title?: string;<br>new : title?: string \| Resource;  | 变更 |
193| ohos.prompt | Button |old : color: string;<br>new : color: string \| Resource;  | 变更 |
194| ohos.prompt | Button |old : text: string;<br>new : text: string \| Resource;  | 变更 |
195| ohos.prompt | ShowToastOptions |old : message: string;<br>new : message: string \| Resource;  | 变更 |
196| ArkUI | BorderOptions |old : style?: BorderStyle;<br>new : style?: EdgeStyles \| BorderStyle; | 变更 |
197| ArkUI | BorderOptions |old : radius?: Length;<br>new : radius?: BorderRadiuses \| Length;  | 变更 |
198| ArkUI | BorderOptions |old : color?: ResourceColor;<br>new : color?: EdgeColors \| ResourceColor;  | 变更 |
199| ArkUI | BorderOptions |old : width?: Length;<br>new : width?: EdgeWidths \| Length;  | 变更 |
200| ArkUI | AnimateParam |old : curve?: Curve \| string;<br>new : curve?: Curve \| string \| ICurve;  | 变更 |