add the crossplatform in arkui

Signed-off-by: lixingchi1 <lixingchi1@huawei.com>
This commit is contained in:
lixingchi1 2023-04-03 21:18:04 +08:00
parent 7da74b77f7
commit e5e8767cde
6 changed files with 119 additions and 1 deletions

View File

@ -17,6 +17,7 @@
* Defines the animator options.
* @interface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
export interface AnimatorOptions {
@ -24,6 +25,7 @@ export interface AnimatorOptions {
* Duration of the animation, in milliseconds.
* The default value is 0.
* @type {number}
* @crossplatform
* @since 6
*/
duration: number;
@ -47,6 +49,7 @@ export interface AnimatorOptions {
* Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end.
* The default value is ease.
* @type {string}
* @crossplatform
* @since 6
*/
easing: string;
@ -55,6 +58,7 @@ export interface AnimatorOptions {
* Delay for the animation start. The default value indicates no delay.
* The default value is 0.
* @type {number}
* @crossplatform
* @since 6
*/
delay: number;
@ -64,6 +68,7 @@ export interface AnimatorOptions {
* none: The initial state is restored after the animation is executed.
* forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed.
* @type {string}
* @crossplatform
* @since 6
*/
fill: "none" | "forwards" | "backwards" | "both";
@ -72,6 +77,7 @@ export interface AnimatorOptions {
* The animation playback mode.
* The default value is "normal".
* @type {string}
* @crossplatform
* @since 6
*/
direction: "normal" | "reverse" | "alternate" | "alternate-reverse";
@ -80,6 +86,7 @@ export interface AnimatorOptions {
* Number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations.
* The default value is 1.
* @type {number}
* @crossplatform
* @since 6
*/
iterations: number;
@ -88,6 +95,7 @@ export interface AnimatorOptions {
* Starting point of animator interpolation.
* The default value is 0.
* @type {number}
* @crossplatform
* @since 6
*/
begin: number;
@ -96,6 +104,7 @@ export interface AnimatorOptions {
* Ending point of Dynamic Interpolation
* The default value is 1.
* @type {number}
* @crossplatform
* @since 6
*/
end: number;
@ -105,6 +114,7 @@ export interface AnimatorOptions {
* Defines the Animator result interface.
* @interface
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
export interface AnimatorResult {
@ -123,36 +133,42 @@ export interface AnimatorResult {
* @throws { BusinessError } 401 - if the type of the parameter 1 is not object.
* @throws { BusinessError } 100001 - if no page is found for pageId or fail to get object property list.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
reset(options: AnimatorOptions): void;
/**
* Starts the animation.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
play(): void;
/**
* Ends the animation.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
finish(): void;
/**
* Pauses the animation.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
pause(): void;
/**
* Cancels the animation.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
cancel(): void;
/**
* Plays the animation in reverse direction.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
reverse(): void;
@ -160,24 +176,28 @@ export interface AnimatorResult {
* Trigger when vsync callback.
* @param { number } progress - The current progress of animation
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
onframe: (progress: number) => void;
/**
* The animation is finished.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
onfinish: () => void;
/**
* The animation is canceled.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
oncancel: () => void;
/**
* The animation is repeated.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
onrepeat: () => void;
@ -186,6 +206,7 @@ export interface AnimatorResult {
/**
* Defines the Animator class.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 6
*/
export default class Animator {
@ -203,6 +224,7 @@ export default class Animator {
* @param { AnimatorOptions } options - Options.
* @throws { BusinessError } 401 - if parameter error.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
static create(options: AnimatorOptions): AnimatorResult;

11
api/@ohos.curves.d.ts vendored
View File

@ -17,6 +17,7 @@
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
* @namespace curves
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
declare namespace curves {
@ -24,6 +25,7 @@ declare namespace curves {
* enum Curve.
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
enum Curve {
@ -46,6 +48,7 @@ declare namespace curves {
* Interface for curve object.
* @typedef ICurve
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface ICurve {
@ -54,6 +57,7 @@ declare namespace curves {
* @param { number } fraction
* @returns { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interpolate(fraction : number) : number;
@ -64,6 +68,7 @@ declare namespace curves {
* @param { Curve } [curve]
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function initCurve(curve?: Curve): ICurve;
@ -85,6 +90,7 @@ declare namespace curves {
* @param { boolean } end
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function stepsCurve(count: number, end: boolean): ICurve;
@ -109,6 +115,7 @@ declare namespace curves {
* @param { number } y2
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve;
@ -135,6 +142,7 @@ declare namespace curves {
* @param { number } damping
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve;
@ -160,6 +168,7 @@ declare namespace curves {
* @param { number } [overlapDuration]
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve;
@ -171,6 +180,7 @@ declare namespace curves {
* @param { number } [overlapDuration]
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve;
@ -185,6 +195,7 @@ declare namespace curves {
* @param { number } damping the damping value of spring
* @returns { ICurve }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 10
*/
function interpolatingSpring(velocity: number, mass: number, stiffness: number, damping: number): ICurve;

View File

@ -15,31 +15,35 @@
/**
* Used to do matrix operations
* @import import Matrix4 from '@ohos.matrix4'
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
declare namespace matrix4 {
/**
* Set translation parameters
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
interface TranslateOption {
/**
* Indicates the translation distance of the x-axis, in px.
* @crossplatform
* @since 7
*/
x?: number;
/**
* Indicates the translation distance of the y-axis, in px.
* @crossplatform
* @since 7
*/
y?: number;
/**
* Indicates the translation distance of the z-axis, in px.
* @crossplatform
* @since 7
*/
z?: number;
@ -48,35 +52,41 @@ declare namespace matrix4 {
/**
* Set scaling parameters
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
interface ScaleOption {
/**
* Zoom factor of the x-axis.
* @crossplatform
* @since 7
*/
x?: number;
/**
* Zoom factor of the y-axis.
* @crossplatform
* @since 7
*/
y?: number;
/**
* Zoom factor of the z-axis.
* @crossplatform
* @since 7
*/
z?: number;
/**
* Transform the x-axis coordinate of the center point.
* @crossplatform
* @since 7
*/
centerX?: number;
/**
* Transform the y-axis coordinate of the center point.
* @crossplatform
* @since 7
*/
centerY?: number;
@ -85,41 +95,48 @@ declare namespace matrix4 {
/**
* Set Rotation Parameters.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
interface RotateOption {
/**
* Axis of rotation vector x coordinate.
* @crossplatform
* @since 7
*/
x?: number;
/**
* Axis of rotation vector y coordinate.
* @crossplatform
* @since 7
*/
y?: number;
/**
* Axis of rotation vector z coordinate.
* @crossplatform
* @since 7
*/
z?: number;
/**
* Transform the x-axis coordinate of the center point.
* @crossplatform
* @since 7
*/
centerX?: number;
/**
* Transform the y-axis coordinate of the center point.
* @crossplatform
* @since 7
*/
centerY?: number;
/**
* Rotation angle.
* @crossplatform
* @since 7
*/
angle?: number;
@ -128,12 +145,14 @@ declare namespace matrix4 {
/**
* Matrix4Transit.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
interface Matrix4Transit {
/**
* Copy function of Matrix, which can copy a copy of the current matrix object.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -142,6 +161,7 @@ declare namespace matrix4 {
/**
* The inverse function of Matrix returns an inverse matrix of the current matrix object, that is, the effect is exactly the opposite.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -150,6 +170,7 @@ declare namespace matrix4 {
/**
* Matrix superposition function, which can superpose the effects of two matrices to generate a new matrix object.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -158,6 +179,7 @@ declare namespace matrix4 {
/**
* Matrix translation function, which can add the x-axis, Y-axis, or Z-axis translation effect to the current matrix.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -166,6 +188,7 @@ declare namespace matrix4 {
/**
* Scaling function of the Matrix, which can add the x-axis, Y-axis, or Z-axis scaling effect to the current matrix.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -174,6 +197,7 @@ declare namespace matrix4 {
/**
* Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -182,6 +206,7 @@ declare namespace matrix4 {
/**
* Matrix coordinate point conversion function, which can apply the current transformation effect to a coordinate point.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -191,6 +216,7 @@ declare namespace matrix4 {
/**
* Constructor of Matrix, which can create a fourth-order matrix based on the input parameters. The matrix is column-first.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -218,6 +244,7 @@ declare namespace matrix4 {
/**
* Matrix initialization function, which can return an identity matrix object.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -226,6 +253,7 @@ declare namespace matrix4 {
/**
* Copy function of Matrix, which can copy a copy of the current matrix object.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -234,6 +262,7 @@ declare namespace matrix4 {
/**
* The inverse function of Matrix returns an inverse matrix of the current matrix object, that is, the effect is exactly the opposite.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -242,6 +271,7 @@ declare namespace matrix4 {
/**
* Matrix superposition function, which can superpose the effects of two matrices to generate a new matrix object.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -250,6 +280,7 @@ declare namespace matrix4 {
/**
* Matrix translation function, which can add the x-axis, Y-axis, or Z-axis translation effect to the current matrix.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -258,6 +289,7 @@ declare namespace matrix4 {
/**
* Scaling function of the Matrix, which can add the x-axis, Y-axis, or Z-axis scaling effect to the current matrix.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -266,6 +298,7 @@ declare namespace matrix4 {
/**
* Rotation function of the Matrix. You can add the x-axis, Y-axis, or Z-axis rotation effect to the current matrix.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/
@ -274,6 +307,7 @@ declare namespace matrix4 {
/**
* Matrix coordinate point conversion function, which can apply the current transformation effect to a coordinate point.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
* @returns Return to Matrix4Transit
*/

View File

@ -18,6 +18,7 @@ import {Callback} from './basic';
/**
* Used to do mediaquery operations.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 7
*/
declare namespace mediaquery {
@ -27,6 +28,7 @@ declare namespace mediaquery {
/**
* Whether the match condition is met.
* This parameter is read-only.
* @crossplatform
* @since 7
*/
readonly matches: boolean;
@ -34,6 +36,7 @@ declare namespace mediaquery {
/**
* Matching condition of a media event.
* This parameter is read-only.
* @crossplatform
* @since 7
*/
readonly media: string;
@ -44,6 +47,7 @@ declare namespace mediaquery {
/**
* Registers a callback with the corresponding query condition by using the handle.
* This callback is triggered when the media attributes change.
* @crossplatform
* @since 7
*/
on(type: 'change', callback: Callback<MediaQueryResult>): void;
@ -51,6 +55,7 @@ declare namespace mediaquery {
/**
* Deregisters a callback with the corresponding query condition by using the handle.
* This callback is not triggered when the media attributes chang.
* @crossplatform
* @since 7
*/
off(type: 'change', callback?: Callback<MediaQueryResult>): void;
@ -58,6 +63,7 @@ declare namespace mediaquery {
/**
* Sets the media query criteria and returns the corresponding listening handle
* @crossplatform
* @since 7
*/
function matchMediaSync(condition: string): MediaQueryListener;

View File

@ -21,6 +21,7 @@ import { Resource } from 'GlobalResource';
/**
* @namespace promptAction
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
declare namespace promptAction {
@ -28,6 +29,7 @@ declare namespace promptAction {
/**
* @typedef ShowToastOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface ShowToastOptions {
@ -35,6 +37,7 @@ declare namespace promptAction {
/**
* Text to display.
* @type { string | Resource }
* @crossplatform
* @since 9
*/
message: string | Resource;
@ -44,6 +47,7 @@ declare namespace promptAction {
* The recommended value ranges from 1500ms to 10000ms.
* NOTE: A value less than 1500 is automatically changed to 1500. The maximum value is 10000ms.
* @type { number }
* @crossplatform
* @since 9
*/
duration?: number;
@ -51,6 +55,7 @@ declare namespace promptAction {
/**
* The distance between toast dialog box and the bottom of screen.
* @type { string | number }
* @crossplatform
* @since 9
*/
bottom?: string | number;
@ -59,18 +64,21 @@ declare namespace promptAction {
/**
* @typedef Button
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface Button {
/**
* @type { string | Resource }
* @crossplatform
* @since 9
*/
text: string | Resource;
/**
* @type { string | Resource }
* @crossplatform
* @since 9
*/
color: string | Resource;
@ -79,6 +87,7 @@ declare namespace promptAction {
/**
* @typedef ShowDialogSuccessResponse
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface ShowDialogSuccessResponse {
@ -86,6 +95,7 @@ declare namespace promptAction {
/**
* Index of the selected button, starting from 0.
* @type { number }
* @crossplatform
* @since 9
*/
index: number;
@ -94,6 +104,7 @@ declare namespace promptAction {
/**
* @typedef ShowDialogOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface ShowDialogOptions {
@ -101,6 +112,7 @@ declare namespace promptAction {
/**
* Title of the text to display.
* @type { string | Resource }
* @crossplatform
* @since 9
*/
title?: string | Resource;
@ -108,6 +120,7 @@ declare namespace promptAction {
/**
* Text body.
* @type { string | Resource }
* @crossplatform
* @since 9
*/
message?: string | Resource;
@ -116,6 +129,7 @@ declare namespace promptAction {
* Array of buttons in the dialog box.
* The array structure is {text:'button', color: '#666666'}.
* One to three buttons are supported. The first button is of the positiveButton type, the second is of the negativeButton type, and the third is of the neutralButton type.
* @crossplatform
* @since 9
*/
buttons?: [Button, Button?, Button?];
@ -124,6 +138,7 @@ declare namespace promptAction {
/**
* @typedef ActionMenuSuccessResponse
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface ActionMenuSuccessResponse {
@ -131,6 +146,7 @@ declare namespace promptAction {
/**
* Index of the selected button, starting from 0.
* @type { number }
* @crossplatform
* @since 9
*/
index: number;
@ -139,6 +155,7 @@ declare namespace promptAction {
/**
* @typedef ActionMenuOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
interface ActionMenuOptions {
@ -146,6 +163,7 @@ declare namespace promptAction {
/**
* Title of the text to display.
* @type { string | Resource }
* @crossplatform
* @since 9
*/
title?: string | Resource;
@ -154,6 +172,7 @@ declare namespace promptAction {
* Array of buttons in the dialog box.
* The array structure is {text:'button', color: '#666666'}.
* One to six buttons are supported.
* @crossplatform
* @since 9
*/
buttons: [Button, Button?, Button?, Button?, Button?, Button?];
@ -166,6 +185,7 @@ declare namespace promptAction {
* @throws { BusinessError } 401 - if the type of message is incorrect.
* @throws { BusinessError } 100001 - if UI execution context not found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function showToast(options: ShowToastOptions):void;
@ -177,6 +197,7 @@ declare namespace promptAction {
* @throws { BusinessError } 401 - if the number of parameters is not 1 or the type of parameters is incorrect.
* @throws { BusinessError } 100001 - if UI execution context not found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSuccessResponse>):void;
@ -188,6 +209,7 @@ declare namespace promptAction {
* @throws { BusinessError } 401 - if the number of parameters is not 1 or the type of parameters is incorrect.
* @throws { BusinessError } 100001 - if UI execution context not found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse>;
@ -199,6 +221,7 @@ declare namespace promptAction {
* @throws { BusinessError } 401 - if the number of parameters is not 1 or the type of parameters is incorrect.
* @throws { BusinessError } 100001 - if UI execution context not found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenuSuccessResponse>):void;
@ -210,6 +233,7 @@ declare namespace promptAction {
* @throws { BusinessError } 401 - if the number of parameters is not 1 or the type of parameters is incorrect.
* @throws { BusinessError } 100001 - if UI execution context not found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function showActionMenu(options: ActionMenuOptions): Promise<ActionMenuSuccessResponse>;

21
api/@ohos.router.d.ts vendored
View File

@ -19,6 +19,7 @@ import { AsyncCallback } from './basic';
/**
* @namespace router
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
declare namespace router {
@ -26,12 +27,14 @@ declare namespace router {
/**
* Router Mode
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
export enum RouterMode {
/**
* Default route mode.
* The page will be added to the top of the page stack.
* @crossplatform
* @since 9
*/
Standard,
@ -41,6 +44,7 @@ declare namespace router {
* If the target page already has the same url page in the page stack,
* the same url page closest to the top of the stack will be moved to the top of the stack.
* If the target page url does not exist in the page stack, route will use default route mode.
* @crossplatform
* @since 9
*/
Single,
@ -80,6 +84,7 @@ declare namespace router {
/**
* @typedef RouterState
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
interface RouterState {
@ -88,6 +93,7 @@ declare namespace router {
* Index of the current page in the stack.
* NOTE: The index starts from 1 from the bottom to the top of the stack.
* @type {number}
* @crossplatform
* @since 8
*/
index: number;
@ -95,6 +101,7 @@ declare namespace router {
/**
* Name of the current page, that is, the file name.
* @type {string}
* @crossplatform
* @since 8
*/
name: string;
@ -102,6 +109,7 @@ declare namespace router {
/**
* Path of the current page.
* @type {string}
* @crossplatform
* @since 8
*/
path: string;
@ -110,6 +118,7 @@ declare namespace router {
/**
* @typedef EnableAlertOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
interface EnableAlertOptions {
@ -117,6 +126,7 @@ declare namespace router {
/**
* dialog context.
* @type {string}
* @crossplatform
* @since 8
*/
message: string;
@ -141,6 +151,7 @@ declare namespace router {
* @throws { BusinessError } 100002 - if the uri is not exist.
* @throws { BusinessError } 100003 - if the pages are pushed too much.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function pushUrl(options: RouterOptions, callback: AsyncCallback<void>):void;
@ -154,6 +165,7 @@ declare namespace router {
* @throws { BusinessError } 100002 - if the uri is not exist.
* @throws { BusinessError } 100003 - if the pages are pushed too much.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function pushUrl(options: RouterOptions): Promise<void>;
@ -168,6 +180,7 @@ declare namespace router {
* @throws { BusinessError } 100002 - if the uri is not exist.
* @throws { BusinessError } 100003 - if the pages are pushed too much.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function pushUrl(options: RouterOptions, mode: RouterMode, callback: AsyncCallback<void>):void;
@ -182,6 +195,7 @@ declare namespace router {
* @throws { BusinessError } 100002 - if the uri is not exist.
* @throws { BusinessError } 100003 - if the pages are pushed too much.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function pushUrl(options: RouterOptions, mode: RouterMode): Promise<void>;
@ -250,6 +264,7 @@ declare namespace router {
* Returns to the previous page or a specified page.
* @param { RouterOptions } options - Options.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
function back(options?: RouterOptions):void;
@ -257,6 +272,7 @@ declare namespace router {
/**
* Clears all historical pages and retains only the current page at the top of the stack.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
function clear():void;
@ -265,6 +281,7 @@ declare namespace router {
* Obtains the number of pages in the current stack.
* @returns { string } Number of pages in the stack. The maximum value is 32.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
function getLength():string;
@ -273,6 +290,7 @@ declare namespace router {
* Obtains information about the current page state.
* @returns { RouterState }Page state.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
function getState():RouterState;
@ -293,6 +311,7 @@ declare namespace router {
* @throws { BusinessError } 401 - if the type of the parameter is not object or the type of the message is not string.
* @throws { BusinessError } 100001 - if UI execution context not found.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function showAlertBeforeBackPage(options: EnableAlertOptions):void;
@ -309,6 +328,7 @@ declare namespace router {
/**
* Hide alert before back page
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 9
*/
function hideAlertBeforeBackPage():void;
@ -317,6 +337,7 @@ declare namespace router {
* Obtains information about the current page params.
* @returns { Object }Page params.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 8
*/
function getParams(): Object;