diff --git a/api/@internal/component/ets/canvas.d.ts b/api/@internal/component/ets/canvas.d.ts index 47e5744a1..8ce4dca7a 100644 --- a/api/@internal/component/ets/canvas.d.ts +++ b/api/@internal/component/ets/canvas.d.ts @@ -1139,6 +1139,20 @@ declare class CanvasRenderer extends CanvasPath { * @form * @since 9 */ + /** + * Creates a template object using the specified image + * @param image Objects as duplicate image sources + * @param repetition Specifies how to repeat images. The following four modes are supported: + * "repeat": Repeated images in both X and Y directions + * "repeat-x": Repeated images in the X-axis direction but not in the Y-axis direction + * "repeat-y": The image is repeated in the Y axis direction, and the image is not repeated in the X axis direction. + * "no-repeat": Non-repeating images in both X and Y directions + * "clamp": Replicate the edge color if the shader draws outside of its original bounds. + * "mirror": Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @form + * @since 10 + */ createPattern(image: ImageBitmap, repetition: string | null): CanvasPattern | null; /** @@ -1164,6 +1178,22 @@ declare class CanvasRenderer extends CanvasPath { */ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; + /** + * Creates a gradient around a point with given coordinates. + * @param startAngle The angle at which to begin the gradient, in radians. + * Angle measurements start horizontally the right of the center and move around clockwise. + * @param x The x-axis coordinate of the center of the gradient. + * @param y The y-axis coordinate of the center of the gradient. + * @returns CanvasGradient A CanvasGradient object that draws a conic gradient around the given coordinates. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + createConicGradient( + startAngle: number, + x: number, + y: number + ): CanvasGradient; + /** * Provides filter effects such as blur and grayscale. You can set the following filter effects: * blur(): Adds a Gaussian blur effect to the drawing diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 7b4b49114..6ba414610 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -2146,28 +2146,60 @@ declare interface CustomPopupOptions { } /** - * Defines the menu options. + * Defines the context menu options. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ -declare interface MenuOptions { +declare interface ContextMenuOptions { /** - * Sets the title of the menu window. - * @type { ResourceStr } - * @default - - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @since 10 - */ - title?: ResourceStr; - - /** - * Sets the position offset of the menu window. - * @type { Position } + * Sets the position offset of the context menu window. + * @type { ?Position } * @default - * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 10 */ offset?: Position; + + /** + * Sets the placement of the context menu window. + * @type { ?Placement } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + placement?: Placement; + + /**s + * Callback function when the context menu appears. + * @type { ?() => void } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + onAppear?: () => void; + + /** + * Callback function when the context menu disappear. + * @type { ?() => void } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + onDisappear?: () => void; +} + +/** + * Defines the menu options. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare interface MenuOptions extends ContextMenuOptions { + /** + * Sets the title of the menu window. + * @type { ?ResourceStr } + * @default - + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + title?: ResourceStr; } /** @@ -3328,7 +3360,15 @@ declare class CommonMethod { * ContextMenu control * @since 8 */ - bindContextMenu(content: CustomBuilder, responseType: ResponseType): T; + /** + * ContextMenu control + * @param { CustomBuilder } content - Indicates the content of context menu. + * @param { responseType } responseType - Indicates response type of context menu. + * @param { ContextMenuOptions } options - Indicates the options of context menu. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + bindContextMenu(content: CustomBuilder, responseType: ResponseType, options?: ContextMenuOptions): T; /** * Bind content cover diff --git a/api/@internal/component/ets/counter.d.ts b/api/@internal/component/ets/counter.d.ts index a43216a2f..e5d948791 100644 --- a/api/@internal/component/ets/counter.d.ts +++ b/api/@internal/component/ets/counter.d.ts @@ -66,6 +66,24 @@ declare class CounterAttribute extends CommonMethod { * @since 9 */ onDec(event: () => void): CounterAttribute; + + /** + * Indicates whether the decrease button of counter component is available or not. + * @param { boolean } value - If true, the decrease button is available and can respond to operations such as clicking. If false, click operations are not responded. + * @returns { CounterAttribute } The attribute of the counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + enableDec(value: boolean): CounterAttribute; + + /** + * Indicates whether the increase button of counter component is available or not. + * @param { boolean } value - If true, the increase button is available and can respond to operations such as clicking. If false, click operations are not responded. + * @returns { CounterAttribute } The attribute of the counter. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + enableInc(value: boolean): CounterAttribute; } /** @@ -88,4 +106,4 @@ declare const CounterInstance: CounterAttribute; * @form * @since 9 */ -declare const Counter: CounterInterface; +declare const Counter: CounterInterface; \ No newline at end of file diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index 510839160..be1fb0db1 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -2781,3 +2781,38 @@ declare enum CtrlKey { */ ALT = 2, } + +/** + * The alignment of ImageSpan + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare enum ImageSpanAlignment { + /** + * Indicating that the bottom of the ImageSpan should be aligned with the baseline of the surrounding text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + BASELINE, + + /** + * Indicating that the bottom of the ImageSpan should be aligned with the bottom of the surrounding text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + BOTTOM, + + /** + * Indicating that the center of the ImageSpan should be aligned with the center of the surrounding text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + CENTER, + + /** + * Indicating that the top of the ImageSpan should be aligned with the top of the surrounding text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + TOP, +} diff --git a/api/@internal/component/ets/grid.d.ts b/api/@internal/component/ets/grid.d.ts index 1bc486a56..1dbc0d1a6 100644 --- a/api/@internal/component/ets/grid.d.ts +++ b/api/@internal/component/ets/grid.d.ts @@ -186,6 +186,16 @@ declare class GridAttribute extends CommonMethod { onItemDrop( event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void, ): GridAttribute; + + /** + * Called when the sliding effect is set. + * @param { EdgeEffect } value - Scroll effect. For details, see EdgeEffect. + * @default EdgeEffect.None + * @returns { GridAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + edgeEffect(value: EdgeEffect): GridAttribute; } /** @@ -198,4 +208,4 @@ declare const Grid: GridInterface; * Defines Grid Component instance. * @since 7 */ -declare const GridInstance: GridAttribute; +declare const GridInstance: GridAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/image_span.d.ts b/api/@internal/component/ets/image_span.d.ts new file mode 100644 index 000000000..843e85f10 --- /dev/null +++ b/api/@internal/component/ets/image_span.d.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Provide image decoration in the text component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +interface ImageSpanInterface { + /** + * Called when image is entered in span. + * @param { ResourceStr | PixelMap } - The image resource. + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + (value: ResourceStr | PixelMap): ImageSpanAttribute; +} + +/** + * Define the ImageSpan attribute functions. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare class ImageSpanAttribute extends CommonMethod { + /** + * Called when the alignment of image span is set. + * @param { ImageSpanAlignment } value - The alignment type of image span. + * @default ImageSpanAlignment.BOTTOM + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + verticalAlign(value: ImageSpanAlignment): ImageSpanAttribute; + + /** + * Sets the zoom type of an image. + * @param { ImageFit } value - Image display mode. + * @default ImageFit.Cover + * @returns { ImageSpanAttribute } The attribute of the image span. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + objectFit(value: ImageFit): ImageSpanAttribute; +} + +/** + * Defines ImageSpan Component instance. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const ImageSpan: ImageSpanInterface; + +/** + * Defines ImageSpan Component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ +declare const ImageSpanInstance: ImageSpanAttribute; \ No newline at end of file diff --git a/api/@internal/component/ets/text.d.ts b/api/@internal/component/ets/text.d.ts index 44f520ce0..eb0c459f7 100644 --- a/api/@internal/component/ets/text.d.ts +++ b/api/@internal/component/ets/text.d.ts @@ -239,6 +239,15 @@ declare class TextAttribute extends CommonMethod { * @since 10 */ heightAdaptivePolicy(value: TextHeightAdaptivePolicy): TextAttribute; + + /** + * Specify the indentation of the first line in a text-block. + * @param { Length } value - The length of text indent. + * @returns { TextAttribute } The attribute of the text. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + textIndent(value: Length): TextAttribute; } /** diff --git a/api/@internal/component/ets/text_area.d.ts b/api/@internal/component/ets/text_area.d.ts index 68a11bd7b..757dc699b 100644 --- a/api/@internal/component/ets/text_area.d.ts +++ b/api/@internal/component/ets/text_area.d.ts @@ -146,6 +146,14 @@ declare class TextAreaAttribute extends CommonMethod { */ onChange(callback: (value: string) => void): TextAreaAttribute; + /** + * Called when judging whether the text editing change finished. + * @param {boolean} isEditing - Triggered when the text area status changes. If the value of isEditing is true, text area is in progress. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 10 + */ + onEditChange(callback: (isEditing: boolean) => void): TextAreaAttribute; + /** * Called when using the Clipboard menu * @since 7 diff --git a/api/@internal/ets/global.d.ts b/api/@internal/ets/global.d.ts index ecc8d61bd..9d45ce534 100644 --- a/api/@internal/ets/global.d.ts +++ b/api/@internal/ets/global.d.ts @@ -93,6 +93,132 @@ export declare class console { * @since 9 */ static error(message: string, ...arguments: any[]): void; + + /** + * Prints a message if value is false or omitted. + * @param { Object } value The value tested for being truthy. + * @param { Object[] } arguments Used as error message to print. + * @static + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static assert(value?: Object, ...arguments: Object[]): void; + + /** + * Maintains an internal counter specific to label and print the number of times + * console.count() has been called with the given label. + * @param { string } label Counter name. Default: "default". + * @static + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static count(label?: string): void; + + /** + * Reset the internal counter specific to label. + * @param { string } label Counter name. Default: "default". + * @static + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static countReset(label?: string): void; + + /** + * Prints properties of the specified JavaScript object. + * @param { Object } dir A JavaScript object whose properties should be output. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static dir(dir?: Object): void; + + /** + * This method calls console.log() passing it the arguments received. + * This method does not produce any XML formatting. + * @param { Object[] } arguments Text to print. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static dirxml(...arguments: Object[]): void; + + /** + * Creates a new inline group, causing any subsequent console messages to be indented by an additional level. + * @param { Object[] } arguments messages to print first. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static group(...arguments: Object[]): void; + + /** + * Same as console.group() + * @param { Object[] } arguments messages to print first. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static groupCollapsed(...arguments: Object[]): void; + + /** + * Exit current inline group. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static groupEnd(): void; + + /** + * Prints tabular data as a table. + * @param { Object } tableData tabular data. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static table(tableData?: Object): void; + + /** + * Start a timer. + * @param { string } label Timer name. Default: "default". + * @static + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static time(label?: string): void; + + /** + * End a timer and print time duration. + * @param { string } label Timer name. Default: "default". + * @static + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static timeEnd(label?: string): void; + + /** + * Print the elapsed time and other data arguments. + * @param { string } label Timer name. Default: "default". + * @param { Object[] } arguments Text to print. + * @static + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static timeLog(label?: string, ...arguments: Object[]): void; + + /** + * Prints stack information for the current code location. + * @param { Object[] } arguments message to print. + * @static + * @syscap SystemCapability.Utils.Lang + * @since 10 + */ + static trace(...arguments: Object[]): void; } /** diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 9cc9bba31..76db7f318 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -25,7 +25,7 @@ import rdb from "../../@ohos.data.rdb"; import rpc from "../../@ohos.rpc"; import resourceManager from "../../@ohos.resourceManager"; import { PacMap } from "../../ability/dataAbilityHelper"; -import { AsyncCallback } from "../../basic"; +import { AsyncCallback } from "../../@ohos.base"; /** * interface of form lifecycle. diff --git a/api/@ohos.InputMethodExtensionContext.d.ts b/api/@ohos.InputMethodExtensionContext.d.ts index bf719c42e..867140014 100644 --- a/api/@ohos.InputMethodExtensionContext.d.ts +++ b/api/@ohos.InputMethodExtensionContext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import ExtensionContext from './application/ExtensionContext'; /** diff --git a/api/@ohos.InputMethodSubtype.d.ts b/api/@ohos.InputMethodSubtype.d.ts index c12febe56..b22408dc6 100644 --- a/api/@ohos.InputMethodSubtype.d.ts +++ b/api/@ohos.InputMethodSubtype.d.ts @@ -29,6 +29,14 @@ export default interface InputMethodSubtype { */ readonly label?: string; + /** + * The label id of input method subtype. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + readonly labelId?: number; + /** * The name of input method. * @@ -88,8 +96,16 @@ export default interface InputMethodSubtype { /** * The extra info of input method subtype. * + * @type { object } * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 9 */ - extra: object; + /** + * The extra info of input method subtype. + * + * @type { ?object } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + extra?: object; } diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 7e8954373..2546b1eb6 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { Callback } from './basic'; +import { AsyncCallback } from './@ohos.base'; +import { Callback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index eb65676c6..a7e897001 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; import { NotificationRequest } from './notification/notificationRequest'; diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index 42cd534e6..16b2bc6b3 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import { Permissions } from './permissions'; import { Context } from './application/Context'; import { PermissionRequestResult } from './security/PermissionRequestResult'; diff --git a/api/@ohos.accessibility.GesturePath.d.ts b/api/@ohos.accessibility.GesturePath.d.ts index 7a92fce43..1f1a3ed91 100644 --- a/api/@ohos.accessibility.GesturePath.d.ts +++ b/api/@ohos.accessibility.GesturePath.d.ts @@ -13,23 +13,30 @@ * limitations under the License. */ -import { GesturePoint } from "./@ohos.accessibility.GesturePoint"; +import type { GesturePoint } from './@ohos.accessibility.GesturePoint'; /** * Indicates the path of the gesture. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 9 */ export declare class GesturePath { - constructor(durationTime: number); - /** - * Indicates the position of the points that make up the gesture. - * @type {Array} - */ - points: Array; - /** - * Indicates the duration of the gesture. - * @type {number} - */ - durationTime: number; -} \ No newline at end of file + constructor(durationTime: number); + /** + * Indicates the position of the points that make up the gesture. + * + * @type { Array } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + points: Array; + /** + * Indicates the duration of the gesture. + * + * @type { number } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + durationTime: number; +} diff --git a/api/@ohos.accessibility.GesturePoint.d.ts b/api/@ohos.accessibility.GesturePoint.d.ts index a5e075bc9..ad182e8c0 100644 --- a/api/@ohos.accessibility.GesturePoint.d.ts +++ b/api/@ohos.accessibility.GesturePoint.d.ts @@ -15,19 +15,26 @@ /** * Indicates the point of the gesture. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 9 */ export declare class GesturePoint { - constructor(positionX: number, positionY: number); - /** - * Indicates the X coordinate of point. - * @type {number} - */ - positionX: number; - /** - * Indicates the Y coordinate of point. - * @type {number} - */ - positionY: number; -} \ No newline at end of file + constructor(positionX: number, positionY: number); + /** + * Indicates the X coordinate of point. + * + * @type { number } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + positionX: number; + /** + * Indicates the Y coordinate of point. + * + * @type { number } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + positionY: number; +} diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 690c702cf..a2629949e 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -13,140 +13,300 @@ * limitations under the License. */ -import accessibility from './@ohos.accessibility'; -import { AsyncCallback, Callback } from './basic'; +import type accessibility from './@ohos.accessibility'; +import type { AsyncCallback, Callback } from './@ohos.base'; /** * Configuration of the accessibility. * - * @since 9 + * @namespace config * @syscap SystemCapability.BarrierFree.Accessibility.Core * @systemapi + * @since 9 */ declare namespace config { /** * Indicates the configuration of high-contrast text. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var highContrastText: Config; /** * Indicates the configuration of invert color. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var invertColor: Config; /** * Indicates the configuration of daltonization color filter. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var daltonizationColorFilter: Config; /** * Indicates the configuration of content timeout. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var contentTimeout: Config; /** * Indicates the configuration of animation state. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var animationOff: Config; /** * Indicates the configuration of brightness discount. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var brightnessDiscount: Config; /** * Indicates the configuration of mouse key state. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var mouseKey: Config; /** * Indicates the configuration of mouse auto click. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var mouseAutoClick: Config; /** * Indicates the configuration of short key state. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var shortkey: Config; /** * Indicates the configuration of short key target. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var shortkeyTarget: Config; /** * Indicates the configuration of captions state. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var captions: Config; /** * Indicates the configuration of captions style. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ var captionsStyle: Config; /** * Enable the accessibility extension ability. - * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. - * @param capability Indicates the ability. + * + * @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @param { Array } capability Indicates the ability. + * @returns { Promise } * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. * @throws { BusinessError } 9300002 - Target ability already enabled. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ function enableAbility(name: string, capability: Array): Promise; - function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; + + /** + * Enable the accessibility extension ability. + * + * @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @param { Array } capability Indicates the ability. + * @param { AsyncCallback } callback + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. + * @throws { BusinessError } 9300002 - Target ability already enabled. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 + */ + function enableAbility( + name: string, + capability: Array, + callback: AsyncCallback + ): void; /** * Disable the accessibility extension ability. - * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * + * @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @returns { Promise } * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. * @throws { BusinessError } 401 - Input parameter error. * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ function disableAbility(name: string): Promise; + + /** + * Disable the accessibility extension ability. + * + * @param { string } name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @param { AsyncCallback } callback + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 + */ function disableAbility(name: string, callback: AsyncCallback): void; /** * Register the listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the type of event. - * @param callback Indicates the listener. + * + * @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 202 - Not system App. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback): void; /** * Unregister listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the type of event. - * @param callback Indicates the listener. + * + * @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event. + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 202 - Not system App. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback): void; /** * Indicates setting, getting, and listening to changes in configuration. + * + * @typedef Config + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ interface Config { /** * Setting configuration value. - * @param value Indicates the value. + * + * @param { T } value Indicates the value. + * @returns { Promise } * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ set(value: T): Promise; + + /** + * Setting configuration value. + * + * @param { T } value Indicates the value. + * @param { AsyncCallback } callback + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 + */ set(value: T, callback: AsyncCallback): void; /** * Getting configuration value. + * + * @returns { Promise } + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ get(): Promise; + + /** + * Getting configuration value. + * + * @param { AsyncCallback } callback + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 + */ get(callback: AsyncCallback): void; /** * Register the listener to listen for configuration changes. - * @param callback Indicates the listener. + * + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system App. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ on(callback: Callback): void; /** * Unregister the listener to listen for configuration changes. - * @param callback Indicates the listener. + * + * @param { Callback } callback Indicates the listener. + * @throws { BusinessError } 202 - Not system App. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @systemapi + * @since 9 */ off(callback?: Callback): void; } /** * Indicates the type of daltonization color filter. + * + * @systemapi */ type DaltonizationColorFilter = 'Normal' | 'Protanomaly' | 'Deuteranomaly' | 'Tritanomaly'; } -export default config; \ No newline at end of file +export default config; diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 597532bea..c7bf35a8b 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -13,25 +13,28 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { Callback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; +import type { Callback } from './@ohos.base'; /** * Accessibility - * @name Accessibility - * @since 7 + * + * @namespace accessibility * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 */ declare namespace accessibility { /** * The type of the Ability app. + * * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' } * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ /** * The type of the Ability app. - * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } + * + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 9 */ @@ -39,6 +42,7 @@ declare namespace accessibility { /** * The action that the ability can execute. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -48,6 +52,8 @@ declare namespace accessibility { /** * The type of the accessibility event. + * windowsChange/windowContentChange/windowStateChange/announcement/notificationChange/textTraversedAtMove + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -57,6 +63,8 @@ declare namespace accessibility { /** * The change type of the windowsChange event. + * It's used when received the {@code windowsChange} event. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -64,6 +72,7 @@ declare namespace accessibility { /** * The type of the ability state. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -71,6 +80,13 @@ declare namespace accessibility { /** * The ability that accessibility subsystem support. + * touchExplorer: Describes the capability to talkback. + * magnification: Describes the capability to request to control the display magnification. + * gesturesSimulation: Describes the capability to request to simulate the gesture. + * windowContent: Describes the capability to search for the content of the active window. + * filterKeyEvents: Describes the capability to request to filter key events. + * fingerprintGesture: Describes the capability to request to fingerprint gesture. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -78,6 +94,7 @@ declare namespace accessibility { /** * The granularity of text move. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -85,221 +102,349 @@ declare namespace accessibility { /** * Checks whether accessibility ability is enabled. - * @since 7 - * @param callback Asynchronous callback interface. + * + * @param { AsyncCallback } callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. + * @since 7 */ function isOpenAccessibility(callback: AsyncCallback): void; + + /** + * Checks whether accessibility ability is enabled. + * + * @param { AsyncCallback } callback Asynchronous callback interface. + * @returns { Promise } Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 + */ function isOpenAccessibility(): Promise; /** * Checks touch browser ability (which is used by talkback) is enabled. - * @since 7 - * @param callback Asynchronous callback interface. + * + * @param { AsyncCallback } callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @returns Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. + * @since 7 */ function isOpenTouchGuide(callback: AsyncCallback): void; + + /** + * Checks touch browser ability (which is used by talkback) is enabled. + * + * @param { AsyncCallback } callback Asynchronous callback interface. + * @returns { Promise } Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. + * @syscap SystemCapability.BarrierFree.Accessibility.Vision + * @since 7 + */ function isOpenTouchGuide(): Promise; /** * Queries the list of accessibility abilities. - * @since 7 - * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken - * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed + * + * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken + * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed + * @param { AsyncCallback> } callback * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns the list of abilityInfos. + * @since 7 * @deprecated since 9 * @useinstead ohos.accessibility#getAccessibilityExtensionList */ - function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, - callback: AsyncCallback>): void; - function getAbilityLists(abilityType: AbilityType, - stateType: AbilityState): Promise>; - + function getAbilityLists( + abilityType: AbilityType, + stateType: AbilityState, + callback: AsyncCallback> + ): void; /** * Queries the list of accessibility abilities. - * @since 9 - * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken - * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed + * + * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken + * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed + * @returns { Promise> } Returns the list of abilityInfos. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns the list of abilityInfos. - * @throws { BusinessError } 401 - Input parameter error. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.accessibility#getAccessibilityExtensionList */ - function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>; - function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; + function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise>; + + /** + * Queries the list of accessibility abilities. + * + * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken + * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed + * @returns { Promise> } Returns the list of abilityInfos. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + function getAccessibilityExtensionList( + abilityType: AbilityType, + stateType: AbilityState + ): Promise>; + + /** + * Queries the list of accessibility abilities. + * + * @param { AbilityType } abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken + * @param { AbilityState } stateType The state of the accessibility ability. {@code AbilityState} eg.installed + * @param { AsyncCallback> } callback + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + function getAccessibilityExtensionList( + abilityType: AbilityType, + stateType: AbilityState, + callback: AsyncCallback> + ): void; /** * Send accessibility Event. - * @since 7 - * @param event The object of the accessibility {@code EventInfo} . - * @param callback Asynchronous callback interface. + * + * @param { EventInfo } event The object of the accessibility {@code EventInfo} . + * @param { AsyncCallback } callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns {@code true} if success ; returns {@code false} otherwise. + * @since 7 * @deprecated since 9 * @useinstead ohos.accessibility#sendAccessibilityEvent */ function sendEvent(event: EventInfo, callback: AsyncCallback): void; + + /** + * Send accessibility Event. + * + * @param { EventInfo } event The object of the accessibility {@code EventInfo} . + * @returns { Promise } Returns {@code true} if success ; returns {@code false} otherwise. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 + * @deprecated since 9 + * @useinstead ohos.accessibility#sendAccessibilityEvent + */ function sendEvent(event: EventInfo): Promise; /** * Send accessibility event. - * @since 9 - * @param event The object of the accessibility {@code EventInfo} . - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns {@code true} if success ; returns {@code false} otherwise. + * + * @param { EventInfo } event The object of the accessibility {@code EventInfo} . + * @param { AsyncCallback } callback Asynchronous callback interface. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; + + /** + * Send accessibility event. + * + * @param { EventInfo } event The object of the accessibility {@code EventInfo} . + * @returns { Promise } Returns {@code true} if success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ function sendAccessibilityEvent(event: EventInfo): Promise; /** - * Register the observer of the accessibility state changed. - * @since 7 - * @param type state event type. - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns {@code true} if the register is success ; returns {@code false} otherwise. + * Register the observe of the accessibility state changed. + * + * @param { 'accessibilityStateChange' } type state event type. + * @param { Callback } callback Asynchronous callback interface. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 */ function on(type: 'accessibilityStateChange', callback: Callback): void; /** - * Register the observer of the touchGuide state changed. - * @since 7 - * @param type state event type. - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @returns Returns {@code true} if the register is success ; returns {@code false} otherwise. + * Register the observe of the touchGuide state changed. + * + * @param { 'touchGuideStateChange' } type state event type. + * @param { Callback } callback Asynchronous callback interface. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Vision + * @since 7 */ function on(type: 'touchGuideStateChange', callback: Callback): void; /** - * Unregister the observer of the accessibility state changed. - * @since 7 - * @param type state event type - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * Unregister the observe of the accessibility state changed. + * + * @param { 'accessibilityStateChange' } type state event type + * @param { Callback } callback Asynchronous callback interface. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 */ function off(type: 'accessibilityStateChange', callback?: Callback): void; /** - * Unregister the observer of the touchGuide state changed. - * @since 7 - * @param type state event type - * @param callback Asynchronous callback interface. - * @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * Unregister the observe of the touchGuide state changed. + * + * @param { 'touchGuideStateChange' } type state event type + * @param { Callback } callback Asynchronous callback interface. * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 */ - function off(type: 'touchGuideStateChange', callback?: Callback): void; + function off(type: 'touchGuideStateChange', callback?: Callback): void; /** * Get the captions manager. + * + * @returns { CaptionsManager } Returns the captions manager. * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 - * @returns Returns the captions manager. */ - function getCaptionsManager(): CaptionsManager; + function getCaptionsManager(): CaptionsManager; - /** - * Indicates the captions manager. - * @syscap SystemCapability.BarrierFree.Accessibility.Hearing - * @since 8 - */ - interface CaptionsManager { - /** - * Indicates whether captions are enabled. - */ - enabled: boolean; - /** - * Indicates the style of captions. - */ - style: CaptionsStyle; - - /** - * Register the observer of the enable state. - * @throws { BusinessError } 401 - Input parameter error. - */ - on(type: 'enableChange', callback: Callback): void; + /** + * Indicates the captions manager. + * + * @typedef CaptionsManager + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + interface CaptionsManager { + /** + * Indicates whether captions are enabled. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + enabled: boolean; + /** + * Indicates the style of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + style: CaptionsStyle; - /** - * Register the observer of the style. - * @throws { BusinessError } 401 - Input parameter error. - */ - on(type: 'styleChange', callback: Callback): void; + /** + * Register the observe of the enable state. + * + * @param { 'enableChange' } type + * @param { Callback } callback + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + on(type: 'enableChange', callback: Callback): void; - /** - * Unregister the observer of the enable state. - * @throws { BusinessError } 401 - Input parameter error. - */ - off(type: 'enableChange', callback?: Callback): void; + /** + * Register the observer of the style. + * + * @param { 'styleChange' } type + * @param { Callback } callback + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + on(type: 'styleChange', callback: Callback): void; - /** - * Unregister the observer of the style. - * @throws { BusinessError } 401 - Input parameter error. - */ - off(type: 'styleChange', callback?: Callback): void; - } - - /** - * Indicates the edge type of the captions font. - * @syscap SystemCapability.BarrierFree.Accessibility.Hearing - * @since 8 - */ - type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow'; - /** - * Indicates the font family of captions. - * @syscap SystemCapability.BarrierFree.Accessibility.Hearing - * @since 8 - */ - type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' | - 'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals'; - /** - * Indicates the style of captions. - * @syscap SystemCapability.BarrierFree.Accessibility.Hearing - * @since 8 - */ - interface CaptionsStyle { - /** - * Indicates the font family of captions. - */ - fontFamily: CaptionsFontFamily; - /** - * Indicates the font scaling of captions. - */ - fontScale: number; - /** - * Indicates the font color of captions. - */ - fontColor: number | string; - /** - * Indicates the edge type of the captions font. - */ - fontEdgeType: CaptionsFontEdgeType; - /** - * Indicates the background color of captions. - */ - backgroundColor: number | string; - /** - * Indicates the window color of captions. - */ - windowColor: number | string; - } + /** + * Unregister the observe of the enable state. + * + * @param { 'enableChange' } type + * @param { Callback } callback + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + off(type: 'enableChange', callback?: Callback): void; - /** - * Indicates the info of accessibility. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since 7 - */ + /** + * Unregister the observer of the style. + * + * @param { 'styleChange' } type + * @param { Callback } callback + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + off(type: 'styleChange', callback?: Callback): void; + } + + /** + * Indicates the edge type of the captions font. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + type CaptionsFontEdgeType = 'none' | 'raised' | 'depressed' | 'uniform' | 'dropShadow'; + /** + * Indicates the font family of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + type CaptionsFontFamily = 'default' | 'monospacedSerif' | 'serif' | + 'monospacedSansSerif' | 'sansSerif' | 'casual' | 'cursive' | 'smallCapitals'; + /** + * Indicates the style of captions. + * + * @typedef CaptionsStyle + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + interface CaptionsStyle { + /** + * Indicates the font family of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + fontFamily: CaptionsFontFamily; + /** + * Indicates the font scaling of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + fontScale: number; + /** + * Indicates the font color of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + fontColor: number | string; + /** + * Indicates the edge type of the captions font. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + fontEdgeType: CaptionsFontEdgeType; + /** + * Indicates the background color of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + backgroundColor: number | string; + /** + * Indicates the window color of captions. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Hearing + * @since 8 + */ + windowColor: number | string; + } + + /** + * Indicates the info of accessibility. + * + * @typedef AccessibilityAbilityInfo + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 + */ interface AccessibilityAbilityInfo { /** * The ability id. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ readonly id: string; @@ -321,119 +466,156 @@ declare namespace accessibility { /** * The type of the ability. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ readonly abilityTypes: Array; /** * The capabilities of the ability. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ readonly capabilities: Array; /** * The description of the ability. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ readonly description: string; /** * The events which the accessibility ability wants to observe. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ readonly eventTypes: Array; - } /** - * Indicates the info of events. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since 7 - */ + * Indicates the info of events. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 7 + */ class EventInfo { constructor(jsonObject); /** * The type of an accessibility event. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ type: EventType; /** * The type of the window change event. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ windowUpdateType?: WindowUpdateType; /** * The bundle name of the target application. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ bundleName: string; /** * The type of the event source component,such as button, chart. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ componentType?: string; - /** The page id of the event source. + /** + * The page id of the event source. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ - pageId ?: number; + pageId?: number; /** * The accessibility event description. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ description?: string; /** * The action that triggers the accessibility event, for example, clicking or focusing a view. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ triggerAction: Action; /** * The movement step used for reading texts. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ textMoveUnit?: TextMoveUnit; /** * The content list. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ contents?: Array; /** * The content changed before. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ lastContent?: string; /** * The start index of listed items on the screen. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ beginIndex?: number; /** * The index of the current item on the screen. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ currentIndex?: number; /** * The end index of listed items on the screen. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ endIndex?: number; /** - * The total of the items. + * The total of the items, talkback used it when scroll. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ itemCount?: number; } } -export default accessibility; \ No newline at end of file +export default accessibility; diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index 5e6ff48d5..736ba3210 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import rpc from './@ohos.rpc'; diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index 81a686df1..6e6ef49ea 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * This module provides the capability to manage distributed accounts. diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 586cc772c..6cd90ddb3 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -14,7 +14,7 @@ */ import distributedAccount from './@ohos.account.distributedAccount'; -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * This module provides the capability to manage os accounts. @@ -2074,6 +2074,56 @@ declare namespace osAccount { freezingTime: number; } + /** + * Provides the GetDomainAccessTokenOptions type. + * + * @typedef GetDomainAccessTokenOptions + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + interface GetDomainAccessTokenOptions { + /** + * Indicates the domain account information. + * + * @type { DomainAccountInfo } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + domainAccountInfo: DomainAccountInfo; + + /** + * Indicates the domain account token. + * + * @type { Uint8Array } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + domainAccountToken: Uint8Array; + + /** + * Indicates the business parameters. + * + * @type { object } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + businessParams: { [key: string]: object }; + + /** + * Indicates caller UID. + * + * @type { number } + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + callerUid: number; + } + /** * Provides the definition of domain plugin. * @@ -2163,6 +2213,33 @@ declare namespace osAccount { * @since 10 */ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback): void; + + /** + * Checks whether the token of specified domain account is valid. + * + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. + * @param { Uint8Array } token - Indicates the account token. + * @param { AsyncCallback } callback - Indicates the callback for notifying the checking result. + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + isAccountTokenValid( + domainAccountInfo: DomainAccountInfo, + token: Uint8Array, + callback: AsyncCallback + ): void; + + /** + * Gets the access token based on the specified options. + * + * @param { GetDomainAccessTokenOptions } options - Indicates the options for getting th access token. + * @param { AsyncCallback } callback - Indicates the callback for returning the access token. + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback): void; } /** @@ -2318,6 +2395,54 @@ declare namespace osAccount { * @since 10 */ static hasAccount(domainAccountInfo: DomainAccountInfo): Promise; + + /** + * Updates the token for the specified domain account. + *

Only the registered domain plugin has the permission to call this function.
+ * An empty token indicates the token of the target domain account is invalid.

+ * + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. + * @param { Uint8Array } token - Indicates the domain account token. + * @param { AsyncCallback } callback - Indicates the result callback. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid token. + * @throws { BusinessError } 12300003 - Account not found. + * @static + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + static updateAccountToken( + domainAccountInfo: DomainAccountInfo, + token: Uint8Array, + callback: AsyncCallback + ): void; + + /** + * Updates the token for the specified domain account. + *

Only the registered domain plugin has the permission to call this function.
+ * An empty token indicates the token of the target domain account is invalid.

+ * + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS + * @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information. + * @param { Uint8Array } token - Indicates the domain account token. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not system application. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid token. + * @throws { BusinessError } 12300003 - Account not found. + * @static + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + * @since 10 + */ + static updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array): Promise; } /** diff --git a/api/@ohos.animation.windowAnimationManager.d.ts b/api/@ohos.animation.windowAnimationManager.d.ts index 6c6cbcaf8..0d0a86b86 100644 --- a/api/@ohos.animation.windowAnimationManager.d.ts +++ b/api/@ohos.animation.windowAnimationManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {AsyncCallback} from "./@ohos.base"; /** * Window animation manager. diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts index e88d7c5e4..a26d870d3 100644 --- a/api/@ohos.app.ability.AbilityConstant.d.ts +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -18,6 +18,7 @@ * @namespace AbilityConstant * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ declare namespace AbilityConstant { @@ -26,6 +27,7 @@ declare namespace AbilityConstant { * @typedef LaunchParam * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export interface LaunchParam { @@ -33,6 +35,7 @@ declare namespace AbilityConstant { * Indicates launch reason. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ launchReason: LaunchReason; @@ -41,6 +44,7 @@ declare namespace AbilityConstant { * Indicates last exit reason. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ lastExitReason: LastExitReason; @@ -51,13 +55,44 @@ declare namespace AbilityConstant { * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export enum LaunchReason { + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 9 + */ UNKNOWN = 0, + + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @since 9 + */ START_ABILITY = 1, + + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @since 9 + */ CALL = 2, + + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @since 9 + */ CONTINUATION = 3, + + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @since 9 + */ APP_RECOVERY = 4, /** @@ -71,11 +106,30 @@ declare namespace AbilityConstant { * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export enum LastExitReason { + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @crossplatform + * @since 9 + */ UNKNOWN = 0, + + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @since 9 + */ ABILITY_NOT_RESPONDING = 1, + + /** + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + * @since 9 + */ NORMAL = 2, } diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts index e9ad08814..2e48ab633 100644 --- a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -21,6 +21,7 @@ import window from './@ohos.window'; * The ability lifecycle callback. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ export default class AbilityLifecycleCallback { @@ -29,6 +30,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onAbilityCreate(ability: UIAbility): void; @@ -39,6 +41,7 @@ export default class AbilityLifecycleCallback { * @param { window.WindowStage } windowStage - window stage to create * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; @@ -69,6 +72,7 @@ export default class AbilityLifecycleCallback { * @param { window.WindowStage } windowStage - window stage to destroy * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void; @@ -78,6 +82,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onAbilityDestroy(ability: UIAbility): void; @@ -87,6 +92,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onAbilityForeground(ability: UIAbility): void; @@ -96,6 +102,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onAbilityBackground(ability: UIAbility): void; diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index 2afe66003..a267812f4 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -22,6 +22,7 @@ import { Configuration } from './@ohos.app.ability.Configuration'; * The class of an ability stage. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export default class AbilityStage { @@ -38,6 +39,7 @@ export default class AbilityStage { * Called back when an ability stage is started for initialization. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ onCreate(): void; @@ -59,6 +61,7 @@ export default class AbilityStage { * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ onConfigurationUpdate(newConfig: Configuration): void; diff --git a/api/@ohos.app.ability.Configuration.d.ts b/api/@ohos.app.ability.Configuration.d.ts index b5f11c28d..c6895e48d 100644 --- a/api/@ohos.app.ability.Configuration.d.ts +++ b/api/@ohos.app.ability.Configuration.d.ts @@ -19,6 +19,7 @@ import ConfigurationConstant from "./@ohos.app.ability.ConfigurationConstant"; * configuration item. * @typedef Configuration * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform * @since 9 */ export interface Configuration { @@ -34,6 +35,7 @@ export interface Configuration { * Indicates the current colorMode of the application. * @type { ConfigurationConstant.ColorMode } * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform * @since 9 */ colorMode?: ConfigurationConstant.ColorMode; @@ -42,6 +44,7 @@ export interface Configuration { * Indicates the screen direction of the current device. * @type { ConfigurationConstant.Direction } * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform * @since 9 */ direction?: ConfigurationConstant.Direction; diff --git a/api/@ohos.app.ability.ConfigurationConstant.d.ts b/api/@ohos.app.ability.ConfigurationConstant.d.ts index 303647c93..c11cf4739 100644 --- a/api/@ohos.app.ability.ConfigurationConstant.d.ts +++ b/api/@ohos.app.ability.ConfigurationConstant.d.ts @@ -24,6 +24,7 @@ * ColorMode * @enum { number } * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform * @since 9 */ export enum ColorMode { @@ -36,6 +37,7 @@ * Direction * @enum { number } * @syscap SystemCapability.Ability.AbilityBase + * @crossplatform * @since 9 */ export enum Direction { diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts index b12e789de..41b21965f 100644 --- a/api/@ohos.app.ability.UIAbility.d.ts +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -31,6 +31,17 @@ export interface OnReleaseCallback { (msg: string): void; } +/** + * The prototype of the listener function interface registered by the Caller. + * @typedef OnRemoteStateChangeCallback + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @since 10 + */ +export interface OnRemoteStateChangeCallback { + (msg: string): void; +} + /** * The prototype of the message listener function interface registered by the Callee. * @typedef CalleeCallback @@ -92,6 +103,16 @@ export interface Caller { */ onRelease(callback: OnReleaseCallback): void; + /** + * Register state changed listener notification callback of remote ability. + * @param { OnRemoteStateChangeCallback } callback - Register a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + * @since 10 + */ + onRemoteStateChange(callback: OnRemoteStateChangeCallback): void; + /** * Register death listener notification callback. * @param { string } type - release. @@ -159,6 +180,7 @@ export interface Callee { * The class of a UI ability. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ export default class UIAbility extends Ability { @@ -204,6 +226,7 @@ export default class UIAbility extends Ability { * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onCreate(want: Want, param: AbilityConstant.LaunchParam): void; @@ -213,6 +236,7 @@ export default class UIAbility extends Ability { * @param { window.WindowStage } windowStage - Indicates the created WindowStage. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onWindowStageCreate(windowStage: window.WindowStage): void; @@ -221,6 +245,7 @@ export default class UIAbility extends Ability { * Called back when an ability window stage is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onWindowStageDestroy(): void; @@ -238,6 +263,7 @@ export default class UIAbility extends Ability { * Called back before an ability is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onDestroy(): void | Promise; @@ -246,6 +272,7 @@ export default class UIAbility extends Ability { * Called back when the state of an ability changes to foreground. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onForeground(): void; @@ -254,6 +281,7 @@ export default class UIAbility extends Ability { * Called back when the state of an ability changes to background. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onBackground(): void; @@ -275,6 +303,7 @@ export default class UIAbility extends Ability { * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @StageModelOnly + * @crossplatform * @since 9 */ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts index 07a622452..10a352fee 100644 --- a/api/@ohos.app.ability.abilityManager.d.ts +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { Configuration } from './@ohos.app.ability.Configuration'; import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo'; import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo'; diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts index da686a54e..4e068df07 100644 --- a/api/@ohos.app.ability.appManager.d.ts +++ b/api/@ohos.app.ability.appManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import * as _ApplicationStateObserver from './application/ApplicationStateObserver'; import * as _AbilityStateData from './application/AbilityStateData'; import * as _AppStateData from './application/AppStateData'; diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts index 10573f876..23fd676a1 100644 --- a/api/@ohos.app.ability.errorManager.d.ts +++ b/api/@ohos.app.ability.errorManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import * as _ErrorObserver from './application/ErrorObserver'; /** diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index 6848333b3..7878d9ff2 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { MissionInfo as _MissionInfo } from './application/MissionInfo'; import { MissionListener as _MissionListener } from './application/MissionListener'; import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot'; diff --git a/api/@ohos.app.ability.quickFixManager.d.ts b/api/@ohos.app.ability.quickFixManager.d.ts index 89cf51bc8..c22b289c4 100644 --- a/api/@ohos.app.ability.quickFixManager.d.ts +++ b/api/@ohos.app.ability.quickFixManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; /** * Interface of quickFixManager. diff --git a/api/@ohos.app.ability.wantAgent.d.ts b/api/@ohos.app.ability.wantAgent.d.ts index b5ee51a99..2ca573eab 100644 --- a/api/@ohos.app.ability.wantAgent.d.ts +++ b/api/@ohos.app.ability.wantAgent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback , Callback} from './basic'; +import { AsyncCallback , Callback} from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo'; import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; diff --git a/api/@ohos.app.businessAbilityRouter.d.ts b/api/@ohos.app.businessAbilityRouter.d.ts index 835364b2d..a36758747 100755 --- a/api/@ohos.app.businessAbilityRouter.d.ts +++ b/api/@ohos.app.businessAbilityRouter.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; import type * as _BusinessAbilityInfo from './bundleManager/BusinessAbilityInfo'; /** diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index 65713d7cd..269984f51 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -135,4 +135,15 @@ export default class FormExtensionAbility { * @since 9 */ onShareForm?(formId: string): { [key: string]: Object }; + + /** + * Called when the system acquire the form data. + * @param { string } formId - Indicates the ID of the form. + * @returns { { [key: string]: Object } } Returns the wantParams object. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @StageModelOnly + * @since 10 + */ + onAcquireFormData?(formId: string): { [key: string]: Object }; } diff --git a/api/@ohos.app.form.formBindingData.d.ts b/api/@ohos.app.form.formBindingData.d.ts index ebfa0528d..e5c785303 100644 --- a/api/@ohos.app.form.formBindingData.d.ts +++ b/api/@ohos.app.form.formBindingData.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BusinessError } from './basic'; +import { BusinessError } from './@ohos.base'; /** * Interface of formBindingData. diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 5ac41dbb6..4d2ed34f4 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; -import { Callback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; +import { Callback } from "./@ohos.base"; import Want from './@ohos.app.ability.Want'; import formInfo from './@ohos.app.form.formInfo'; @@ -742,7 +742,7 @@ declare namespace formHost { * @since 9 */ function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise; - + /** * Acquire form data by formId. * @permission ohos.permission.REQUIRE_FORM @@ -756,17 +756,17 @@ declare namespace formHost { */ function acquireFormData(formId: string, callback: AsyncCallback<{[key: string]: Object}>): void; - /** - * Acquire form data by formId. - * @permission ohos.permission.REQUIRE_FORM - * @param { string } formId - Indicates the form ID. - * @returns { Promise<{[key: string]: Object}> } The promise returned by the function. - * @throws { BusinessError } 201 - Permissions denied. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.Form - * @systemapi - * @since 10 - */ + /** + * Acquire form data by formId. + * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form ID. + * @returns { Promise<{[key: string]: Object}> } The promise returned by the function. + * @throws { BusinessError } 201 - Permissions denied. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 10 + */ function acquireFormData(formId: string): Promise<{[key: string]: Object}>; } export default formHost; \ No newline at end of file diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 8c19a6a31..f2c8b17ad 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -389,7 +389,35 @@ declare namespace formInfo { * @systemapi * @since 9 */ - DEVICE_ID_KEY = "ohos.extra.param.key.device_id" + DEVICE_ID_KEY = "ohos.extra.param.key.device_id", + + /** + * Indicates the key specifying the launch reason of the form to be obtained, which is represented as + * want: { + * "parameters": { + * LAUNCH_REASON_KEY: LaunchReason.FORM_DEFAULT + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 10 + */ + LAUNCH_REASON_KEY = "ohos.extra.param.key.form_launch_reason", + + /** + * Indicates the key specifying the custom data of the form to be obtained, which is represented as + * want: { + * "parameters": { + * PARAM_FORM_CUSTOMIZE_KEY: { + * "key": "userData" + * } + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 10 + */ + PARAM_FORM_CUSTOMIZE_KEY = "ohos.extra.param.key.form_customize" } /** @@ -475,5 +503,26 @@ declare namespace formInfo { */ FORM_INVISIBLE, } + + /** + * Indicates the launch reason of a form. + * @enum { number } + * @syscap SystemCapability.Ability.Form + * @since 10 + */ + enum LaunchReason { + /** + * Indicates the launch reason of a form is default. + * @syscap SystemCapability.Ability.Form + * @since 10 + */ + FORM_DEFAULT = 1, + /** + * Indicates the launch reason of a form is share. + * @syscap SystemCapability.Ability.Form + * @since 10 + */ + FORM_SHARE, + } } export default formInfo; \ No newline at end of file diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts index d569e4f95..78ec1c98e 100644 --- a/api/@ohos.app.form.formProvider.d.ts +++ b/api/@ohos.app.form.formProvider.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; import formBindingData from "./@ohos.app.form.formBindingData"; import formInfo from "./@ohos.app.form.formInfo"; import Want from "./@ohos.app.ability.Want"; diff --git a/api/@ohos.application.AccessibilityExtensionAbility.d.ts b/api/@ohos.application.AccessibilityExtensionAbility.d.ts index 7a6c8527d..b2cd505fb 100644 --- a/api/@ohos.application.AccessibilityExtensionAbility.d.ts +++ b/api/@ohos.application.AccessibilityExtensionAbility.d.ts @@ -13,79 +13,98 @@ * limitations under the License. */ -import accessibility from './@ohos.accessibility' -import AccessibilityExtensionContext, { AccessibilityElement } from './application/AccessibilityExtensionContext' -import { KeyEvent } from './@ohos.multimodalInput.keyEvent' +import type accessibility from './@ohos.accessibility'; +import type AccessibilityExtensionContext, { AccessibilityElement } from './application/AccessibilityExtensionContext'; +import type { KeyEvent } from './@ohos.multimodalInput.keyEvent'; /** * class of accessibility extension ability. * - * @since 9 * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ export default class AccessibilityExtensionAbility { - /** - * Indicates accessibility extension ability context. - */ - context: AccessibilityExtensionContext; + /** + * Indicates accessibility extension ability context. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + context: AccessibilityExtensionContext; - /** - * Called when extension ability is connected. - */ - onConnect(): void; + /** + * Called when extension ability is connected. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + onConnect(): void; - /** - * Called when extension ability is disconnected. - */ - onDisconnect(): void; + /** + * Called when extension ability is disconnected. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + onDisconnect(): void; - /** - * Called when an accessibility event occurs, such as when the user touches the application interface. - * @param event Indicates an accessibility event. - */ - onAccessibilityEvent(event: AccessibilityEvent): void; + /** + * Called when an accessibility event occurs, such as when the user touches the application interface. + * + * @param { AccessibilityEvent } event Indicates an accessibility event. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + onAccessibilityEvent(event: AccessibilityEvent): void; - /** - * Called when a physical key is pressed, such as when the user presses the volume button . - * @param keyEvent Indicates the physical key event. - */ - onKeyEvent(keyEvent: KeyEvent): boolean; + /** + * Called when a physical key is pressed, such as when the user presses the volume button . + * + * @param { KeyEvent } keyEvent Indicates the physical key event. + * @returns { boolean } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + onKeyEvent(keyEvent: KeyEvent): boolean; } /** * Indicates the accessibility event. - * * It provides the event type and the target element of the event if any. - * @since 9 + * + * @typedef AccessibilityEvent * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ declare interface AccessibilityEvent { - eventType: accessibility.EventType | accessibility.WindowUpdateType | - TouchGuideType | GestureType | PageUpdateType; - target?: AccessibilityElement; - timeStamp?: number; + eventType: accessibility.EventType | accessibility.WindowUpdateType | TouchGuideType | GestureType | PageUpdateType; + target?: AccessibilityElement; + timeStamp?: number; } /** * Indicates the gesture type. - * @since 9 + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ type GestureType = 'left' | 'leftThenRight' | 'leftThenUp' | 'leftThenDown' | - 'right' | 'rightThenLeft' | 'rightThenUp' | 'rightThenDown' | - 'up' | 'upThenLeft' | 'upThenRight' | 'upThenDown' | - 'down' | 'downThenLeft' | 'downThenRight' | 'downThenUp'; + 'right' | 'rightThenLeft' | 'rightThenUp' | 'rightThenDown' | + 'up' | 'upThenLeft' | 'upThenRight' | 'upThenDown' | + 'down' | 'downThenLeft' | 'downThenRight' | 'downThenUp'; /** * Indicates the page update type. - * @since 9 + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ type PageUpdateType = 'pageContentUpdate' | 'pageStateUpdate'; /** * Indicates the type of touch event during touch browsing. - * @since 9 + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ -type TouchGuideType = 'touchBegin' | 'touchEnd'; \ No newline at end of file +type TouchGuideType = 'touchBegin' | 'touchEnd'; diff --git a/api/@ohos.application.DataShareExtensionAbility.d.ts b/api/@ohos.application.DataShareExtensionAbility.d.ts index 8eb387b1e..c6c65530e 100644 --- a/api/@ohos.application.DataShareExtensionAbility.d.ts +++ b/api/@ohos.application.DataShareExtensionAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; import ExtensionContext from "./application/ExtensionContext"; import Want from './@ohos.app.ability.Want'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index 0b74b25ea..b7290af34 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { Configuration } from './@ohos.application.Configuration'; import { AbilityRunningInfo } from './application/AbilityRunningInfo'; import { ExtensionRunningInfo } from './application/ExtensionRunningInfo'; diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index 7e2a49d5b..80ca73547 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import ApplicationStateObserver from './application/ApplicationStateObserver'; import AbilityStateData from './application/AbilityStateData'; import AppStateData from './application/AppStateData'; diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts index 4d55b952e..140224b8d 100644 --- a/api/@ohos.application.formHost.d.ts +++ b/api/@ohos.application.formHost.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; -import { Callback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; +import { Callback } from "./@ohos.base"; import Want from './@ohos.app.ability.Want'; import formInfo from './@ohos.app.form.formInfo' diff --git a/api/@ohos.application.formProvider.d.ts b/api/@ohos.application.formProvider.d.ts index d7be9840a..bcca68e02 100644 --- a/api/@ohos.application.formProvider.d.ts +++ b/api/@ohos.application.formProvider.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; import formBindingData from "./@ohos.application.formBindingData"; import formInfo from "./@ohos.app.form.formInfo"; import Want from './@ohos.app.ability.Want'; diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 941d4ac61..e56df4087 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { MissionInfo } from './application/MissionInfo'; import { MissionListener } from './application/MissionListener'; import { MissionSnapshot } from './application/MissionSnapshot'; diff --git a/api/@ohos.arkui.componentSnapshot.d.ts b/api/@ohos.arkui.componentSnapshot.d.ts index f11cdd0eb..f721ea4de 100644 --- a/api/@ohos.arkui.componentSnapshot.d.ts +++ b/api/@ohos.arkui.componentSnapshot.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import image from './@ohos.multimedia.image' /** diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index f707324f0..aa03b4511 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback , Callback} from './basic'; +import { AsyncCallback , Callback} from './@ohos.base'; import { WantAgent } from "./@ohos.wantAgent"; import Context from './application/BaseContext'; diff --git a/api/basic.d.ts b/api/@ohos.base.d.ts similarity index 79% rename from api/basic.d.ts rename to api/@ohos.base.d.ts index f3469b28d..dbcb9af28 100644 --- a/api/basic.d.ts +++ b/api/@ohos.base.d.ts @@ -1,68 +1,81 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Defines the basic callback. - * @since 6 - */ -export interface Callback { - /** - * Defines the callback info. - * @since 6 - */ - (data: T): void; -} - -/** - * Defines the basic error callback. - * @since 6 - */ -export interface ErrorCallback { - /** - * Defines the basic error callback. - * @since 6 - */ - (err: T): void; -} - -/** - * Defines the basic async callback. - * @since 6 - */ -export interface AsyncCallback { - /** - * Defines the callback data. - * @since 6 - */ - (err: BusinessError, data: T): void; -} - -/** - * Defines the error interface. - * @since 6 - */ -export interface BusinessError extends Error { - /** - * Defines the basic error code. - * @since 6 - */ - code: number; - /** - * Defines the additional information for business - * @type { ?T } - * @since 9 - */ - data?: T; -} +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Defines the basic callback. + * @syscap SystemCapability.Base + * @typedef Callback + * @since 6 + */ +export interface Callback { + /** + * Defines the callback info. + * @param { T } data + * @since 6 + */ + (data: T): void; +} + +/** + * Defines the basic error callback. + * @syscap SystemCapability.Base + * @typedef ErrorCallback + * @since 6 + */ +export interface ErrorCallback { + /** + * Defines the basic error callback. + * @param { T } err + * @since 6 + */ + (err: T): void; +} + +/** + * Defines the basic async callback. + * @syscap SystemCapability.Base + * @typedef AsyncCallback + * @since 6 + */ +export interface AsyncCallback { + /** + * Defines the callback data. + * @param { BusinessError } err + * @param { T } data + * @since 6 + */ + (err: BusinessError, data: T): void; +} + +/** + * Defines the error interface. + * @syscap SystemCapability.Base + * @typedef BusinessError + * @since 6 + */ +export interface BusinessError extends Error { + /** + * Defines the basic error code. + * @type { number } code + * @since 6 + */ + code: number; + /** + * Defines the additional information for business + * @type { ?T } data + * @since 9 + */ + data?: T; +} diff --git a/api/@ohos.batteryStatistics.d.ts b/api/@ohos.batteryStatistics.d.ts index 5bcab7962..52d8564ab 100644 --- a/api/@ohos.batteryStatistics.d.ts +++ b/api/@ohos.batteryStatistics.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError } from './basic'; +import { AsyncCallback, BusinessError } from './@ohos.base'; /** * Provides methods to get power consumption information. diff --git a/api/@ohos.bluetooth.d.ts b/api/@ohos.bluetooth.d.ts index 524430a08..3f14c2045 100644 --- a/api/@ohos.bluetooth.d.ts +++ b/api/@ohos.bluetooth.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides methods to operate or manage Bluetooth. diff --git a/api/@ohos.bluetoothManager.d.ts b/api/@ohos.bluetoothManager.d.ts index 5b678e6e6..49075787a 100644 --- a/api/@ohos.bluetoothManager.d.ts +++ b/api/@ohos.bluetoothManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides methods to operate or manage Bluetooth. diff --git a/api/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts index 756b9611c..f0adc314b 100644 --- a/api/@ohos.brightness.d.ts +++ b/api/@ohos.brightness.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BusinessError } from './basic'; +import { BusinessError } from './@ohos.base'; /** * Provides interfaces to control the power of display. diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index e5459e399..46d55c90a 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -14,6 +14,7 @@ */ /** * The Buffer class is a global type for dealing with binary data directly. It can be constructed in a variety of ways. + * @crossplatform * @since * @syscap SystemCapability.Utils.Lang * @permission N/A @@ -25,6 +26,7 @@ declare namespace buffer { interface TypedArray extends Int8Array {} /** * Allocates a new Buffer for a fixed size bytes. If fill is undefined, the Buffer will be zero-filled. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer @@ -37,6 +39,7 @@ declare namespace buffer { /** * Allocates a new Buffer for a fixed size bytes. The Buffer will not be initially filled. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer @@ -47,6 +50,7 @@ declare namespace buffer { /** * Allocates a new un-pooled Buffer for a fixed size bytes. The Buffer will not be initially filled. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer @@ -59,6 +63,7 @@ declare namespace buffer { * Returns the byte length of a string when encoded using `encoding`. * This is not the same as [`String.prototype.length`], which does not account * for the encoding that is used to convert the string into bytes. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param string A value to calculate the length of @@ -70,6 +75,7 @@ declare namespace buffer { /** * Returns a new `Buffer` which is the result of concatenating all the `Buffer`instances in the `list` together. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param list List of `Buffer` or Uint8Array instances to concatenate @@ -82,6 +88,7 @@ declare namespace buffer { /** * Allocates a new Buffer using an array of bytes in the range 0 – 255. Array entries outside that range will be truncated to fit into it. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param array an array of bytes in the range 0 – 255 @@ -92,6 +99,7 @@ declare namespace buffer { /** * This creates a view of the ArrayBuffer without copying the underlying memory. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param arrayBuffer An ArrayBuffer, SharedArrayBuffer, for example the .buffer property of a TypedArray. @@ -105,6 +113,7 @@ declare namespace buffer { /** * Copies the passed buffer data onto a new Buffer instance. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param buffer An existing Buffer or Uint8Array from which to copy data @@ -116,6 +125,7 @@ declare namespace buffer { /** * For the object whose value returned by valueof() function is strictly equal to object * or supports symbol To primitive object, a new buffer instance is created. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param object An object supporting Symbol.toPrimitive or valueOf() @@ -129,6 +139,7 @@ declare namespace buffer { /** * Creates a new Buffer containing string. The encoding parameter identifies the character encoding * to be used when converting string into bytes. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param string A string to encode @@ -140,6 +151,7 @@ declare namespace buffer { /** * Returns true if obj is a Buffer, false otherwise + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param obj Objects to be judged @@ -149,6 +161,7 @@ declare namespace buffer { /** * Returns true if encoding is the name of a supported character encoding, or false otherwise. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param encoding A character encoding name to check @@ -158,6 +171,7 @@ declare namespace buffer { /** * Compares buf1 to buf2 + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param buf1 A Buffer or Uint8Array instance. @@ -171,6 +185,7 @@ declare namespace buffer { /** * Re-encodes the given Buffer or Uint8Array instance from one character encoding to another. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param source A Buffer or Uint8Array instance. @@ -187,6 +202,7 @@ declare namespace buffer { /** * Returns the number of bytes in buf + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @throws {BusinessError} 10200013 - Cannot set property length of Buffer which has only a getter @@ -195,6 +211,7 @@ declare namespace buffer { /** * The underlying ArrayBuffer object based on which this Buffer object is created. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @throws {BusinessError} 10200013 - Cannot set property buffer of Buffer which has only a getter @@ -203,6 +220,7 @@ declare namespace buffer { /** * The byteOffset of the Buffers underlying ArrayBuffer object + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @throws {BusinessError} 10200013 - Cannot set property byteOffset of Buffer which has only a getter @@ -211,6 +229,7 @@ declare namespace buffer { /** * Fills buf with the specified value. If the offset and end are not given, the entire buf will be filled. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value The value with which to fill buf @@ -226,6 +245,7 @@ declare namespace buffer { /** * Compares buf with target and returns a number indicating whether buf comes before, after, * or is the same as target in sort order. Comparison is based on the actual sequence of bytes in each Buffer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param target A Buffer or Uint8Array with which to compare buf @@ -245,6 +265,7 @@ declare namespace buffer { /** * Copies data from a region of buf to a region in target, even if the target memory region overlaps with buf. * If sourceEnd is greater than the length of the target, the length of the target shall prevail, and the extra part will not be overwritten. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param target A Buffer or Uint8Array to copy into @@ -260,6 +281,7 @@ declare namespace buffer { /** * Returns true if both buf and otherBuffer have exactly the same bytes, false otherwise + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param otherBuffer A Buffer or Uint8Array with which to compare buf @@ -270,6 +292,7 @@ declare namespace buffer { /** * Returns true if value was found in buf, false otherwise + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value What to search for @@ -282,6 +305,7 @@ declare namespace buffer { /** * The index of the first occurrence of value in buf + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value What to search for @@ -294,6 +318,7 @@ declare namespace buffer { /** * Creates and returns an iterator of buf keys (indices). + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ @@ -301,6 +326,7 @@ declare namespace buffer { /** * Creates and returns an iterator for buf values (bytes). + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ @@ -308,6 +334,7 @@ declare namespace buffer { /** * Creates and returns an iterator of [index, byte] pairs from the contents of buf. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ @@ -315,6 +342,7 @@ declare namespace buffer { /** * The index of the last occurrence of value in buf + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value What to search for @@ -327,6 +355,7 @@ declare namespace buffer { /** * Reads a signed, big-endian 64-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 @@ -338,6 +367,7 @@ declare namespace buffer { /** * Reads a signed, little-endian 64-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 @@ -349,6 +379,7 @@ declare namespace buffer { /** * Reads a unsigned, big-endian 64-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 @@ -360,6 +391,7 @@ declare namespace buffer { /** * Reads a unsigned, little-endian 64-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 @@ -371,6 +403,7 @@ declare namespace buffer { /** * Reads a 64-bit, big-endian double from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 @@ -382,6 +415,7 @@ declare namespace buffer { /** * Reads a 64-bit, little-endian double from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 @@ -393,6 +427,7 @@ declare namespace buffer { /** * Reads a 32-bit, big-endian float from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 @@ -404,6 +439,7 @@ declare namespace buffer { /** * Reads a 32-bit, little-endian float from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 @@ -415,6 +451,7 @@ declare namespace buffer { /** * Reads a signed 8-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1 @@ -426,6 +463,7 @@ declare namespace buffer { /** * Reads a signed, big-endian 16-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 @@ -437,6 +475,7 @@ declare namespace buffer { /** * Reads a signed, little-endian 16-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 @@ -448,6 +487,7 @@ declare namespace buffer { /** * Reads a signed, big-endian 32-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 @@ -459,6 +499,7 @@ declare namespace buffer { /** * Reads a signed, little-endian 32-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 @@ -471,6 +512,7 @@ declare namespace buffer { /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result as a big-endian, * two's complement signed value supporting up to 48 bits of accuracy + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength @@ -484,6 +526,7 @@ declare namespace buffer { /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result as a little-endian, * two's complement signed value supporting up to 48 bits of accuracy. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength @@ -496,6 +539,7 @@ declare namespace buffer { /** * Reads an unsigned 8-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1 @@ -507,6 +551,7 @@ declare namespace buffer { /** * Reads an unsigned, big-endian 16-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 @@ -518,6 +563,7 @@ declare namespace buffer { /** * Reads an unsigned, little-endian 16-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 @@ -529,6 +575,7 @@ declare namespace buffer { /** * Reads an unsigned, big-endian 32-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 @@ -540,6 +587,7 @@ declare namespace buffer { /** * Reads an unsigned, little-endian 32-bit integer from buf at the specified offset + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 @@ -552,6 +600,7 @@ declare namespace buffer { /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result as * an unsigned big-endian integer supporting up to 48 bits of accuracy. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength @@ -565,6 +614,7 @@ declare namespace buffer { /** * Reads byteLength number of bytes from buf at the specified offset and interprets the result as an unsigned, * little-endian integer supporting up to 48 bits of accuracy. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength @@ -577,6 +627,7 @@ declare namespace buffer { /** * Returns a new Buffer that references the same memory as the original, but offset and cropped by the start and end indices. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [start = 0] Where the new Buffer will start @@ -587,6 +638,7 @@ declare namespace buffer { /** * Interprets buf as an array of unsigned 16-bit integers and swaps the byte order in-place. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @returns A reference to buf @@ -596,6 +648,7 @@ declare namespace buffer { /** * Interprets buf as an array of unsigned 32-bit integers and swaps the byte order in-place. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @returns A reference to buf @@ -605,6 +658,7 @@ declare namespace buffer { /** * Interprets buf as an array of unsigned 64-bit integers and swaps the byte order in-place. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @returns A reference to buf @@ -614,6 +668,7 @@ declare namespace buffer { /** * Returns a JSON representation of buf + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @returns Returns a JSON @@ -622,6 +677,7 @@ declare namespace buffer { /** * Decodes buf to a string according to the specified character encoding in encoding + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param [encoding='utf8'] The character encoding to use @@ -633,6 +689,7 @@ declare namespace buffer { /** * Writes string to buf at offset according to the character encoding in encoding + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param str Writes string to buf at offset according to the character encoding in encoding @@ -647,6 +704,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -659,6 +717,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -671,6 +730,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -683,6 +743,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -695,6 +756,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -707,6 +769,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -719,6 +782,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -731,6 +795,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -743,6 +808,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset. value must be a valid signed 8-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -755,6 +821,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. The value must be a valid signed 16-bit integer + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -767,6 +834,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. The value must be a valid signed 16-bit integer + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -779,6 +847,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. The value must be a valid signed 32-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -791,6 +860,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. The value must be a valid signed 32-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -803,6 +873,7 @@ declare namespace buffer { /** * Writes byteLength bytes of value to buf at the specified offset as big-endian + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -816,6 +887,7 @@ declare namespace buffer { /** * Writes byteLength bytes of value to buf at the specified offset as little-endian + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -829,6 +901,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset. value must be a valid unsigned 8-bit integer + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -841,6 +914,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. The value must be a valid unsigned 16-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -853,6 +927,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. The value must be a valid unsigned 16-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -865,6 +940,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as big-endian. The value must be a valid unsigned 32-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -877,6 +953,7 @@ declare namespace buffer { /** * Writes value to buf at the specified offset as little-endian. The value must be a valid unsigned 32-bit integer. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -889,6 +966,7 @@ declare namespace buffer { /** * Writes byteLength bytes of value to buf at the specified offset as big-endian + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -902,6 +980,7 @@ declare namespace buffer { /** * Writes byteLength bytes of value to buf at the specified offset as little-endian + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf @@ -919,6 +998,7 @@ declare namespace buffer { /** * Creates a new Blob object containing a concatenation of the given sources. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param sources An array of string, , , , or objects, or any mix of such objects, that will be stored within the Blob @@ -931,6 +1011,7 @@ declare namespace buffer { /** * The total size of the Blob in bytes + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ @@ -938,6 +1019,7 @@ declare namespace buffer { /** * The content-type of the Blob + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ @@ -945,6 +1027,7 @@ declare namespace buffer { /** * Returns a promise that fulfills with an containing a copy of the Blob data. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ @@ -952,6 +1035,7 @@ declare namespace buffer { /** * Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param start The starting index @@ -962,6 +1046,7 @@ declare namespace buffer { /** * Returns a promise that fulfills with the contents of the Blob decoded as a UTF-8 string. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.bundle.appControl.d.ts b/api/@ohos.bundle.appControl.d.ts index 5f1782c56..60997d958 100644 --- a/api/@ohos.bundle.appControl.d.ts +++ b/api/@ohos.bundle.appControl.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; /** @@ -31,7 +31,7 @@ declare namespace appControl { * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS * @param { string } appId - Indicates the app ID of the application. * @param { Want } disposedWant - Indicates the disposed want. - * @param { AsyncCallback } callback - The callback of setting the disposed status result. + * @param { AsyncCallback } callback - The callback of setting the disposed status result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 64559c479..6a453e5a0 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { ApplicationInfo as _ApplicationInfo } from './bundleManager/ApplicationInfo'; import { Metadata as _Metadata } from './bundleManager/Metadata'; import { PermissionDef as _PermissionDef } from './bundleManager/PermissionDef'; @@ -465,6 +465,7 @@ declare namespace bundleManager { * * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ export enum LaunchType { @@ -472,6 +473,7 @@ declare namespace bundleManager { * Indicates that the ability has only one instance * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ SINGLETON = 0, @@ -480,6 +482,7 @@ declare namespace bundleManager { * Indicates that the ability can have multiple instances * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ MULTITON = 1, @@ -734,12 +737,31 @@ declare namespace bundleManager { function getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback): void; /** - * Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * Obtains bundleInfo based on bundleName, bundleFlags. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. + * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. - * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @param { AsyncCallback } callback - The callback of getting bundle info result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -750,11 +772,12 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; - function getBundleInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback): void; + function getBundleInfo(bundleName: string, + bundleFlags: number, userId: number, callback: AsyncCallback): void; /** - * Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * Obtains bundleInfo based on bundleName, bundleFlags and userId. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. @@ -774,6 +797,25 @@ declare namespace bundleManager { /** * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { AsyncCallback } callback - The callback of getting application info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback): void; + + /** + * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. @@ -789,11 +831,12 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback): void; - function getApplicationInfo(bundleName: string, appFlags: number, userId: number, callback: AsyncCallback): void; + function getApplicationInfo(bundleName: string, + appFlags: number, userId: number, callback: AsyncCallback): void; /** * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. @@ -813,10 +856,26 @@ declare namespace bundleManager { /** * Obtains BundleInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. + * @param { AsyncCallback> } callback - The callback of getting a list of BundleInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback>): void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. * @param { number } userId - Indicates the user id. - * @param { AsyncCallback } callback - The callback of getting a list of BundleInfo objects. + * @param { AsyncCallback> } callback - The callback of getting a list of BundleInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -825,11 +884,11 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback>): void; function getAllBundleInfo(bundleFlags: number, userId: number, callback: AsyncCallback>): void; /** * Obtains BundleInfo of all bundles available in the system. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. * @param { number } userId - Indicates the user id. @@ -846,10 +905,26 @@ declare namespace bundleManager { /** * Obtains information about all installed applications of a specified user. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of getting a list of ApplicationInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getAllApplicationInfo(appFlags: number, callback: AsyncCallback>): void; + + /** + * Obtains information about all installed applications of a specified user. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. - * @param { AsyncCallback } callback - The callback of getting a list of ApplicationInfo objects. + * @param { AsyncCallback> } callback - The callback of getting a list of ApplicationInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -858,11 +933,12 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getAllApplicationInfo(appFlags: number, callback: AsyncCallback>): void; - function getAllApplicationInfo(appFlags: number, userId: number, callback: AsyncCallback>): void; + function getAllApplicationInfo(appFlags: number, + userId: number, callback: AsyncCallback>): void; /** * Obtains information about all installed applications of a specified user. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. @@ -879,6 +955,27 @@ declare namespace bundleManager { /** * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of querying ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback>): void; + + /** + * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. @@ -896,11 +993,12 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback>): void; - function queryAbilityInfo(want: Want, abilityFlags: number, userId: number, callback: AsyncCallback>): void; + function queryAbilityInfo(want: Want, + abilityFlags: number, userId: number, callback: AsyncCallback>): void; /** * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. @@ -922,6 +1020,28 @@ declare namespace bundleManager { /** * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionAbilityInfo objects that will be returned. + * @param { AsyncCallback> } callback - The callback of querying extension ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, + extensionAbilityFlags: number, callback: AsyncCallback>): void; + + /** + * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. @@ -939,11 +1059,12 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, callback: AsyncCallback>): void; - function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, userId: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, + extensionAbilityFlags: number, userId: number, callback: AsyncCallback>): void; /** * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. @@ -961,10 +1082,12 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, userId?: number): Promise>; + function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, + extensionAbilityFlags: number, userId?: number): Promise>; /** * Obtains bundle name by the given uid. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { number } uid - Indicates the UID of an application. * @param { AsyncCallback } callback - The callback of getting bundle name. @@ -976,10 +1099,11 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getBundleNameByUid(uid: number, callback: AsyncCallback): void + function getBundleNameByUid(uid: number, callback: AsyncCallback): void; /** * Obtains bundle name by the given uid. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { number } uid - Indicates the UID of an application. * @returns { Promise } Returns the bundle name. @@ -995,6 +1119,7 @@ declare namespace bundleManager { /** * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path to the data directory of the current application. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. @@ -1007,10 +1132,11 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback): void + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback): void; /** * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path to the data directory of the current application. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. @@ -1023,10 +1149,11 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise; + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise; /** * Clears cache data of a specified application. + * * @permission ohos.permission.REMOVE_CACHE_FILES * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. * @param { AsyncCallback } callback - The callback of cleaning bundle cache files result. @@ -1043,6 +1170,7 @@ declare namespace bundleManager { /** * Clears cache data of a specified application. + * * @permission ohos.permission.REMOVE_CACHE_FILES * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. * @returns { Promise } Clean bundle cache files result @@ -1059,6 +1187,7 @@ declare namespace bundleManager { /** * Sets whether to enable a specified application. + * * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE * @param { string } bundleName - Indicates the bundle name of the application. * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. @@ -1075,6 +1204,7 @@ declare namespace bundleManager { /** * Sets whether to enable a specified application. + * * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE * @param { string } bundleName - Indicates the bundle name of the application. * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. @@ -1091,8 +1221,9 @@ declare namespace bundleManager { /** * Sets whether to enable a specified ability. + * * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE - * @param { AbilityInfo } abilityInfo - Indicates information about the ability to set. + * @param { AbilityInfo } info - Indicates information about the ability to set. * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. * @param { AsyncCallback } callback - The callback of setting ability enabled result. * @throws { BusinessError } 201 - Permission denied. @@ -1108,8 +1239,9 @@ declare namespace bundleManager { /** * Sets whether to enable a specified ability. + * * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE - * @param { AbilityInfo } abilityInfo - Indicates information about the ability to set. + * @param { AbilityInfo } info - Indicates information about the ability to set. * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. * @returns { Promise } set ability enabled result. * @throws { BusinessError } 201 - Permission denied. @@ -1125,6 +1257,7 @@ declare namespace bundleManager { /** * Checks whether a specified application is enabled. + * * @param { string } bundleName - Indicates the bundle name of the application. * @param { AsyncCallback } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -1138,8 +1271,9 @@ declare namespace bundleManager { /** * Checks whether a specified application is enabled. + * * @param { string } bundleName - Indicates the bundle name of the application. - * @returns { Promise } Returns true if the application is enabled; returns false otherwise. + * @returns { Promise } Returns true if the application is enabled; returns false otherwise. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. @@ -1151,6 +1285,7 @@ declare namespace bundleManager { /** * Checks whether a specified ability is enabled. + * * @param { AbilityInfo } info - Indicates information about the ability to check. * @param { AsyncCallback } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -1165,6 +1300,7 @@ declare namespace bundleManager { /** * Checks whether a specified ability is enabled. + * * @param { AbilityInfo } info - Indicates information about the ability to check. * @returns { Promise } Returns true if the ability is enabled; returns false otherwise. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. @@ -1177,10 +1313,11 @@ declare namespace bundleManager { */ function isAbilityEnabled(info: AbilityInfo): Promise; - /** + /** * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application. * @param { number } userId - Indicates the user ID or do not pass user ID. @@ -1201,6 +1338,7 @@ declare namespace bundleManager { * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application. * @param { AsyncCallback } callback - The callback for starting the application's main ability. @@ -1208,7 +1346,6 @@ declare namespace bundleManager { * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -1220,6 +1357,7 @@ declare namespace bundleManager { * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application. * @param { number } userId - Indicates the user ID or do not pass user ID. @@ -1238,6 +1376,7 @@ declare namespace bundleManager { /** * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } abilityName - Indicates the abilityName of the application. * @param { string } metadataName - Indicates the name of metadata in ability. @@ -1255,6 +1394,7 @@ declare namespace bundleManager { /** * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } abilityName - Indicates the abilityName of the application. * @param { string } metadataName - Indicates the name of metadata in ability. @@ -1272,10 +1412,11 @@ declare namespace bundleManager { /** * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. * @param { string } metadataName - Indicates the name of metadata in ability. - * @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file. + * @param { AsyncCallback> } callback - The callback of returning string in json-format of the corresponding config file. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. @@ -1288,6 +1429,7 @@ declare namespace bundleManager { /** * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * * @param { string } moduleName - Indicates the moduleName of the application. * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. * @param { string } metadataName - Indicates the name of metadata in ability. @@ -1304,6 +1446,7 @@ declare namespace bundleManager { /** * Get the permission details by permission name. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } permissionName - Indicates permission name. * @param { AsyncCallback } callback - The callback of get permissionDef object result. @@ -1319,6 +1462,7 @@ declare namespace bundleManager { /** * Get the permission details by permission name. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } permissionName - Indicates permission name. * @returns { Promise } Returns permissionDef object. @@ -1334,6 +1478,7 @@ declare namespace bundleManager { /** * Obtains the label of a specified ability. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. * @param { string } moduleName - Indicates the module name. @@ -1356,6 +1501,7 @@ declare namespace bundleManager { /** * Obtains the label of a specified ability. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. * @param { string } moduleName - Indicates the module name. @@ -1378,11 +1524,12 @@ declare namespace bundleManager { /** * Obtains applicationInfo based on a given bundleName and bundleFlags. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. - * @returns Returns the ApplicationInfo object. + * @returns { ApplicationInfo } - Returns the ApplicationInfo object. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -1393,14 +1540,15 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number) : ApplicationInfo; + function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number): ApplicationInfo; /** * Obtains applicationInfo based on a given bundleName and bundleFlags. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. - * @returns Returns the ApplicationInfo object. + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. + * @returns { ApplicationInfo } - Returns the ApplicationInfo object. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -1410,15 +1558,16 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getApplicationInfoSync(bundleName: string, applicationFlags: number) : ApplicationInfo; + function getApplicationInfoSync(bundleName: string, applicationFlags: number): ApplicationInfo; /** - * Obtains bundleInfo based on bundleName, bundleFlags and options. + * Obtains bundleInfo based on bundleName, bundleFlags and userId. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. - * @returns Returns the BundleInfo object. + * @returns { BundleInfo } - Returns the BundleInfo object. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -1429,14 +1578,15 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo; + function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo; /** - * Obtains bundleInfo based on bundleName, bundleFlags and options. + * Obtains bundleInfo based on bundleName, bundleFlags. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. - * @returns Returns the BundleInfo object. + * @returns { BundleInfo } - Returns the BundleInfo object. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -1446,10 +1596,11 @@ declare namespace bundleManager { * @systemapi * @since 9 */ - function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; + function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; /** * Obtains SharedBundleInfo of all shared bundle available in the system. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { AsyncCallback> } callback - The callback of getting a list of SharedBundleInfo objects. * @throws { BusinessError } 201 - Permission denied. @@ -1462,6 +1613,7 @@ declare namespace bundleManager { /** * Obtains SharedBundleInfo of all shared bundle available in the system. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @returns { Promise> } Returns a list of SharedBundleInfo objects. * @throws { BusinessError } 201 - Permission denied. @@ -1474,6 +1626,7 @@ declare namespace bundleManager { /** * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundleName of the application. * @param { string } moduleName - Indicates the moduleName of the application. @@ -1491,6 +1644,7 @@ declare namespace bundleManager { /** * Obtains SharedBundleInfo of shared bundle by bundle name and module name. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundleName of the application. * @param { string } moduleName - Indicates the moduleName of the application. @@ -1508,6 +1662,7 @@ declare namespace bundleManager { /** * Obtains configuration information about an application. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1515,6 +1670,7 @@ declare namespace bundleManager { /** * Indicates the Metadata. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1522,6 +1678,7 @@ declare namespace bundleManager { /** * Obtains configuration information about a bundle. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1529,6 +1686,7 @@ declare namespace bundleManager { /** * The scene which is used. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1536,13 +1694,15 @@ declare namespace bundleManager { /** * Indicates the required permissions details defined in file config.json. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; - /** + /** * Indicates the SignatureInfo. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1550,6 +1710,7 @@ declare namespace bundleManager { /** * Obtains configuration information about a module. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1557,6 +1718,7 @@ declare namespace bundleManager { /** * Obtains preload information about a module. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1564,6 +1726,7 @@ declare namespace bundleManager { /** * Obtains dependency information about a module. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1571,6 +1734,7 @@ declare namespace bundleManager { /** * Obtains configuration information about an ability. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1578,6 +1742,7 @@ declare namespace bundleManager { /** * Contains basic Ability information. Indicates the window size.. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1585,6 +1750,7 @@ declare namespace bundleManager { /** * Obtains extension information about a bundle. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1592,6 +1758,7 @@ declare namespace bundleManager { /** * Indicates the defined permission details in file config.json. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -1600,6 +1767,7 @@ declare namespace bundleManager { /** * Contains basic Ability information, which uniquely identifies an ability. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ @@ -1607,6 +1775,7 @@ declare namespace bundleManager { /** * Contains shared bundle info. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 10 diff --git a/api/@ohos.bundle.bundleMonitor.d.ts b/api/@ohos.bundle.bundleMonitor.d.ts index 4d003ae04..0d2c2c9ea 100644 --- a/api/@ohos.bundle.bundleMonitor.d.ts +++ b/api/@ohos.bundle.bundleMonitor.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Callback } from './basic'; +import { Callback } from './@ohos.base'; /** * Bundle monitor diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 0392db25f..2711ea021 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { ApplicationInfo } from './bundle/applicationInfo'; import { AbilityInfo } from './bundle/abilityInfo'; import { PermissionDef } from './bundle/PermissionDef'; @@ -30,16 +30,16 @@ import { BundleInstaller } from './bundle/bundleInstaller'; * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager - * @name bundle */ declare namespace bundle { /** + * BundleFlag + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager.BundleFlag, ohos.bundle.bundleManager.ApplicationFlag or - * ohos.bundle.bundleManager.AbilityFlag - * @name BundleFlag + * @useinstead ohos.bundle.bundleManager.BundleFlag */ enum BundleFlag { GET_BUNDLE_DEFAULT = 0x00000000, @@ -82,10 +82,12 @@ declare namespace bundle { } /** + * ColorMode + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 - * @name ColorMode */ export enum ColorMode { AUTO_MODE = -1, @@ -94,11 +96,13 @@ declare namespace bundle { } /** + * GrantStatus + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.PermissionGrantState - * @name GrantStatus */ export enum GrantStatus { PERMISSION_DENIED = -1, @@ -106,15 +110,18 @@ declare namespace bundle { } /** + * AbilityType + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.AbilityType - * @name AbilityType */ export enum AbilityType { /** - * @default Indicates an unknown ability type + * Indicates an unknown ability type + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -122,7 +129,8 @@ declare namespace bundle { UNKNOWN, /** - * @default Indicates that the ability has a UI + * Indicates that the ability has a UI + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -130,7 +138,8 @@ declare namespace bundle { PAGE, /** - * @default Indicates that the ability does not have a UI + * Indicates that the ability does not have a UI + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -138,7 +147,8 @@ declare namespace bundle { SERVICE, /** - * @default Indicates that the ability is used to provide data access services + * Indicates that the ability is used to provide data access services + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -147,10 +157,12 @@ declare namespace bundle { } /** + * AbilitySubType + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 - * @name AbilitySubType */ export enum AbilitySubType { UNSPECIFIED = 0, @@ -158,15 +170,18 @@ declare namespace bundle { } /** + * DisplayOrientation + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.DisplayOrientation - * @name DisplayOrientation */ export enum DisplayOrientation { /** - * @default Indicates that the system automatically determines the display orientation + * Indicates that the system automatically determines the display orientation + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -174,7 +189,8 @@ declare namespace bundle { UNSPECIFIED, /** - * @default Indicates the landscape orientation + * Indicates the landscape orientation + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -182,7 +198,8 @@ declare namespace bundle { LANDSCAPE, /** - * @default Indicates the portrait orientation + * Indicates the portrait orientation + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -190,7 +207,8 @@ declare namespace bundle { PORTRAIT, /** - * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack + * Indicates the page ability orientation is the same as that of the nearest ability in the stack + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -199,15 +217,18 @@ declare namespace bundle { } /** + * LaunchMode + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.LaunchType - * @name LaunchMode */ export enum LaunchMode { /** - * @default Indicates that the ability has only one instance + * Indicates that the ability has only one instance + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -215,7 +236,8 @@ declare namespace bundle { SINGLETON = 0, /** - * @default Indicates that the ability can have multiple instances + * Indicates that the ability can have multiple instances + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -224,14 +246,17 @@ declare namespace bundle { } /** + * BundleOptions + * + * @typedef BundleOptions * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 - * @name BundleOptions */ export interface BundleOptions { /** - * @default Indicates the user id + * Indicates the user id + * * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 @@ -240,10 +265,12 @@ declare namespace bundle { } /** + * InstallErrorCode + * + * @enum { number } * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 - * @name InstallErrorCode */ export enum InstallErrorCode { SUCCESS = 0, @@ -306,148 +333,343 @@ declare namespace bundle { /** * Obtains bundleInfo based on bundleName, bundleFlags and options. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param bundleFlags Indicates the application bundle flags to be queried. - * @param options Indicates the bundle options object. - * @returns Returns the BundleInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the application bundle flags to be queried. + * @param { BundleOptions } options Indicates the bundle options object. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getBundleInfo */ - function getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback): void; - function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; - function getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise; + function getBundleInfo(bundleName: string, + bundleFlags: number, options: BundleOptions, callback: AsyncCallback): void; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and options. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the application bundle flags to be queried. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getBundleInfo + */ + function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and options. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the application bundle flags to be queried. + * @param { BundleOptions } options Indicates the bundle options object. + * @returns { Promise } Returns the BundleInfo object. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getBundleInfo + */ + function getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise; /** * Obtains the interface used to install bundles. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @returns Returns the IBundleInstaller interface. * @permission ohos.permission.INSTALL_BUNDLE + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.installer#getBundleInstaller */ function getBundleInstaller(callback: AsyncCallback): void; + + /** + * Obtains the interface used to install bundles. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @returns { Promise } Returns the IBundleInstaller interface. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.installer#getBundleInstaller + */ function getBundleInstaller(): Promise; /** * Obtains information about the current ability. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param abilityName Indicates the ability name. - * @returns Returns the AbilityInfo object for the current ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { string } abilityName - Indicates the ability name. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#queryAbilityInfo */ function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback): void; + + /** + * Obtains information about the current ability. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { string } abilityName - Indicates the ability name. + * @returns { Promise } Returns the AbilityInfo object for the current ability. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#queryAbilityInfo + */ function getAbilityInfo(bundleName: string, abilityName: string): Promise; /** * Obtains based on a given bundle name. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object - * that will be returned. - * @param userId Indicates the user ID or do not pass user ID. - * @returns Returns the ApplicationInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained + * in the ApplicationInfo object that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getApplicationInfo */ - function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback) : void; - function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback) : void; - function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number) : Promise; + function getApplicationInfo(bundleName: string, + bundleFlags: number, userId: number, callback: AsyncCallback) : void; + + /** + * Obtains based on a given bundle name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained + * in the ApplicationInfo object that will be returned. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getApplicationInfo + */ + function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; + + /** + * Obtains based on a given bundle name. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained + * in the ApplicationInfo object that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise } Returns the ApplicationInfo object. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getApplicationInfo + */ + function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number): Promise; /** * Query the AbilityInfo by the given Want. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param want Indicates the Want containing the application bundle name to - * be queried. - * @param bundleFlags Indicates the flag used to specify information contained in the AbilityInfo objects that - * will be returned. - * @param userId Indicates the user ID. - * @returns Returns a list of AbilityInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name + * to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that + * will be returned. + * @param { number } userId - Indicates the user ID. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#queryAbilityInfo + */ + function queryAbilityByWant(want: Want, + bundleFlags: number, userId: number, callback: AsyncCallback>): void; + + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name + * to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that + * will be returned. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#queryAbilityInfo */ - function queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback>): void; function queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback>): void; - function queryAbilityByWant(want: Want, bundleFlags: number, userId?:number): Promise>; + + /** + * Query the AbilityInfo by the given Want. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name + * to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that + * will be returned. + * @param { number } userId - Indicates the user ID. + * @returns { Promise> } Returns a list of AbilityInfo objects. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#queryAbilityInfo + */ + function queryAbilityByWant(want: Want, bundleFlags: number, userId?: number): Promise>; /** * Obtains BundleInfo of all bundles available in the system. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleFlag Indicates the flag used to specify information contained in the BundleInfo that will be - * returned. - * @param userId Indicates the user id. - * @returns Returns a list of BundleInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { BundleFlag } bundleFlag - Indicates the flag used to specify information contained + * in the BundleInfo that will be returned. + * @param { number } userId - Indicates the user ID. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAllBundleInfo */ - function getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback>) : void; - function getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback>) : void; - function getAllBundleInfo(bundleFlag: BundleFlag, userId?: number) : Promise>; + function getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback>): void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { BundleFlag } bundleFlag - Indicates the flag used to specify information contained + * in the BundleInfo that will be returned. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAllBundleInfo + */ + function getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback>): void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { BundleFlag } bundleFlag - Indicates the flag used to specify information contained + * in the BundleInfo that will be returned. + * @param { number } userId - Indicates the user ID. + * @returns { Promise> } Returns a list of BundleInfo objects. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAllBundleInfo + */ + function getAllBundleInfo(bundleFlag: BundleFlag, userId?: number): Promise>; /** * Obtains information about all installed applications of a specified user. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects - * that will be returned. - * @param userId Indicates the user ID or do not pass user ID. - * @returns Returns a list of ApplicationInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } bundleFlags - Indicates the flag used to specify information contained + * in the ApplicationInfo objects that will be returned. + * @param { number } userId - Indicates the user ID. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAllApplicationInfo */ - function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback>) : void; - function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void; - function getAllApplicationInfo(bundleFlags: number, userId?: number) : Promise>; + function getAllApplicationInfo(bundleFlags: number, + userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains information about all installed applications of a specified user. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } bundleFlags - Indicates the flag used to specify information contained + * in the ApplicationInfo objects that will be returned. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAllApplicationInfo + */ + function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>): void; + + /** + * Obtains information about all installed applications of a specified user. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } bundleFlags - Indicates the flag used to specify information contained + * in the ApplicationInfo objects that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise> } Returns a list of ApplicationInfo objects. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAllApplicationInfo + */ + function getAllApplicationInfo(bundleFlags: number, userId?: number): Promise>; /** * Obtains bundle name by the given uid. * - * @since 8 + * @param { number } uid - Indicates the UID of an application. + * @param { AsyncCallback } callback * @syscap SystemCapability.BundleManager.BundleFramework - * @param uid Indicates the UID of an application. - * @returns Returns the bundle name. + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getNameForUid */ - function getNameForUid(uid: number, callback: AsyncCallback) : void - function getNameForUid(uid: number) : Promise; + function getNameForUid(uid: number, callback: AsyncCallback): void; + + /** + * Obtains bundle name by the given uid. + * + * @param { number } uid - Indicates the UID of an application. + * @returns { Promise } Returns the bundle name. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getNameForUid + */ + function getNameForUid(uid: number): Promise; /** * Obtains information about an application bundle contained in an ohos Ability Package (HAP). * - * @since 7 + * @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path + * to the data directory of the current application. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the + * BundleInfo object to be returned. + * @param { AsyncCallback } callback * @syscap SystemCapability.BundleManager.BundleFramework - * @param hapFilePath Indicates the path storing the HAP. The path should be the relative path to the data - * directory of the current application. - * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be - * returned. - * @returns Returns the BundleInfo object. + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getBundleArchiveInfo */ - function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void - function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise; + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback): void; + + /** + * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * + * @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path + * to the data directory of the current application. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the + * BundleInfo object to be returned. + * @returns { Promise } - Returns the BundleInfo object. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getBundleArchiveInfo + */ + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise; /** * Obtains the Want for starting the main ability of an application based on the @@ -455,134 +677,254 @@ declare namespace bundle { * #ACTION_HOME and #ENTITY_HOME Want * filters set in the application's config.json file. * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @returns Returns the Want for starting the application's main ability if any; returns null if - * the given bundle does not exist or does not contain any main ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getLaunchWantForBundle */ function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want + * filters set in the application's config.json file. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @returns { Promise } Returns the Want for starting the application's main ability if any. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 7 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getLaunchWantForBundle + */ function getLaunchWantForBundle(bundleName: string): Promise; /** * Clears cache data of a specified application. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application whose cache data is to be cleared. - * @param callback Indicates the callback to be invoked for returning the operation result. * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleared. + * @param { AsyncCallback } callback Indicates the callback to be invoked for returning the operation result. + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#cleanBundleCacheFiles */ function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback): void; + + /** + * Clears cache data of a specified application. + * + * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleared. + * @returns { Promise } + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#cleanBundleCacheFiles + */ function cleanBundleCacheFiles(bundleName: string): Promise; /** * Sets whether to enable a specified application. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @param isEnable Specifies whether to enable the application. The value true means to enable it, and the - * value false means to disable it. * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it, + * and the value false means to disable it. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#setApplicationEnabled */ function setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable a specified application. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it, + * and the value false means to disable it. + * @returns { Promise } + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#setApplicationEnabled + */ function setApplicationEnabled(bundleName: string, isEnable: boolean): Promise; /** * Sets whether to enable a specified ability. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param abilityInfo Indicates information about the ability to set. - * @param isEnable Specifies whether to enable the ability. The value true means to enable it, and the - * value false means to disable it.. * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } info - Indicates information about the ability to set. + * @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it, + * and the value false means to disable it. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#setAbilityEnabled */ function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable a specified ability. + * + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } info - Indicates information about the ability to set. + * @param { boolean } isEnable - Specifies whether to enable the application. The value true means to enable it, + * and the value false means to disable it. + * @returns { Promise } + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#setAbilityEnabled + */ function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; /** * Get the permission details by permissionName. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param permissionName Indicates permission name. - * @returns Returns permissionDef object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } permissionName - Indicates permission name. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getPermissionDef */ function getPermissionDef(permissionName: string, callback: AsyncCallback): void; + + /** + * Get the permission details by permissionName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } permissionName - Indicates permission name. + * @returns { Promise } Returns permissionDef object. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getPermissionDef + */ function getPermissionDef(permissionName: string): Promise; /** * Obtains the label of a specified ability. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application to which the ability belongs. - * @param abilityName Indicates the ability name. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @returns Returns the label representing the label of the specified ability. + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } abilityName - Indicates the ability name. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAbilityLabel */ function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void; + + /** + * Obtains the label of a specified ability. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } abilityName - Indicates the ability name. + * @returns { Promise } Returns the label representing the label of the specified ability. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAbilityLabel + */ function getAbilityLabel(bundleName: string, abilityName: string): Promise; /** - * Obtains the icon of a specified ability. - * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application to which the ability belongs. - * @param abilityName Indicates the ability name. - * @returns Returns the PixelMap object representing the icon of the specified ability. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @deprecated since 9 - * @useinstead ohos.resourceManager#getMediaContent - */ + * Obtains the icon of a specified ability. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } abilityName - Indicates the ability name. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager#getMediaContent + */ function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void; + + /** + * Obtains the icon of a specified ability. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } abilityName - Indicates the ability name. + * @returns { Promise } Returns the PixelMap object representing the icon of the specified ability. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager#getMediaContent + */ function getAbilityIcon(bundleName: string, abilityName: string): Promise; /** - * Checks whether a specified ability is enabled. - * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param info Indicates information about the ability to check. - * @returns Returns true if the ability is enabled; returns false otherwise. - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#isAbilityEnabled - */ + * Checks whether a specified ability is enabled. + * + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#isAbilityEnabled + */ function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void; + + /** + * Checks whether a specified ability is enabled. + * + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @returns { Promise } Returns true if the ability is enabled; returns false otherwise. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#isAbilityEnabled + */ function isAbilityEnabled(info: AbilityInfo): Promise; /** - * Checks whether a specified application is enabled. - * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @returns Returns true if the application is enabled; returns false otherwise. - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#isApplicationEnabled - */ + * Checks whether a specified application is enabled. + * + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#isApplicationEnabled + */ function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void; + + /** + * Checks whether a specified application is enabled. + * + * @param { string } bundleName - Indicates the bundle name of the application. + * @returns { Promise } Returns true if the application is enabled; returns false otherwise. + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#isApplicationEnabled + */ function isApplicationEnabled(bundleName: string): Promise; } diff --git a/api/@ohos.bundle.defaultAppManager.d.ts b/api/@ohos.bundle.defaultAppManager.d.ts index d7e3e35c4..9bf8450c4 100644 --- a/api/@ohos.bundle.defaultAppManager.d.ts +++ b/api/@ohos.bundle.defaultAppManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { BundleInfo } from './bundleManager/BundleInfo'; import { ElementName } from './bundleManager/ElementName'; @@ -133,8 +133,25 @@ declare namespace defaultAppManager { * @systemapi * @since 9 */ - function getDefaultApplication(type: string, userId: number, callback: AsyncCallback) : void; - function getDefaultApplication(type: string, callback: AsyncCallback) : void; + function getDefaultApplication(type: string, userId: number, callback: AsyncCallback): void; + + /** + * Get default application based on type. + * + * @permission ohos.permission.GET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { AsyncCallback } callback - The callback of the BundleInfo object result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700023 - The specified default app does not exist. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 9 + */ + function getDefaultApplication(type: string, callback: AsyncCallback): void; /** * Get default application based on type. @@ -177,7 +194,25 @@ declare namespace defaultAppManager { */ function setDefaultApplication(type: string, elementName: ElementName, userId: number, callback: AsyncCallback) : void; - function setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCallback) : void; + + /** + * Set default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. + * @param { AsyncCallback } callback - The callback of setting default application result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @throws { BusinessError } 17700028 - The specified ability does not match the type. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 9 + */ + function setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCallback): void; /** * Set default application based on type. @@ -217,8 +252,24 @@ declare namespace defaultAppManager { * @systemapi * @since 9 */ - function resetDefaultApplication(type: string, userId: number, callback: AsyncCallback) : void; - function resetDefaultApplication(type: string, callback: AsyncCallback) : void; + function resetDefaultApplication(type: string, userId: number, callback: AsyncCallback): void; + + /** + * Reset default application based on type. + * + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { AsyncCallback } callback - The callback of resetting default application result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp + * @systemapi + * @since 9 + */ + function resetDefaultApplication(type: string, callback: AsyncCallback): void; /** * Reset default application based on type. diff --git a/api/@ohos.bundle.distributedBundleManager.d.ts b/api/@ohos.bundle.distributedBundleManager.d.ts index a58699b9c..f98b5bc8e 100644 --- a/api/@ohos.bundle.distributedBundleManager.d.ts +++ b/api/@ohos.bundle.distributedBundleManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { ElementName } from './bundleManager/ElementName'; import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundleManager/RemoteAbilityInfo'; @@ -135,7 +135,7 @@ declare namespace distributedBundleManager { * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { ElementName } elementName - Indicates the elementName. * @param { string } locale - Indicates the locale info - * @returns { Promise> } The result of getting the ability info of the remote device. + * @returns { Promise } The result of getting the ability info of the remote device. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. @@ -156,7 +156,7 @@ declare namespace distributedBundleManager { * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. * @param { string } locale - Indicates the locale info - * @param { AsyncCallback } callback - Returns the abilities info of the remote device. + * @param { AsyncCallback> } callback - Returns the abilities info of the remote device. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. diff --git a/api/@ohos.bundle.freeInstall.d.ts b/api/@ohos.bundle.freeInstall.d.ts index 2ee5185fa..4eadc1b7d 100644 --- a/api/@ohos.bundle.freeInstall.d.ts +++ b/api/@ohos.bundle.freeInstall.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { DispatchInfo as _DispatchInfo } from './bundleManager/DispatchInfo'; import * as _PackInfo from './bundleManager/BundlePackInfo'; @@ -170,7 +170,7 @@ declare namespace freeInstall { * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the bundle name of the application. * @param { string } moduleName - Indicates the module name of the application. - * @returns { Promise } Returns true if the module is removable; returns false otherwise. + * @returns { Promise } Returns true if the module is removable; returns false otherwise. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - The parameter check failed. diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index e979c17a9..e95d6b1ea 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -13,98 +13,167 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { BundleStatusCallback } from './bundle/bundleStatusCallback'; import { LauncherAbilityInfo } from './bundle/launcherAbilityInfo'; import { ShortcutInfo } from './bundle/shortcutInfo'; /** * inner bundle manager. - * @name innerBundleManager - * @since 8 + * + * @namespace innerBundleManager * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager */ - declare namespace innerBundleManager { /** * Obtains based on a given bundleName and userId. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param userId Indicates the id for the user. - * @returns Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo */ - function getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback>) : void; - function getLauncherAbilityInfos(bundleName: string, userId: number) : Promise>; + function getLauncherAbilityInfos(bundleName: string, + userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains based on a given bundleName and userId. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } userId - Indicates the id for the user. + * @returns { Promise> } Returns the LauncherAbilityInfo array. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo + */ + function getLauncherAbilityInfos(bundleName: string, userId: number): Promise>; /** * Register Callback. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param type Indicates the command should be implement. - * @param LauncherStatusCallback Indicates the callback to be register. - * @returns { string | Promise } Returns the result of register. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { 'BundleStatusChange' } type - Indicates the command should be implement. + * @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleMonitor#on */ - function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback) : void; - function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Promise; + function on(type:'BundleStatusChange', + bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback) : void; + + /** + * Register Callback. + * + * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { 'BundleStatusChange' } type - Indicates the command should be implement. + * @param { BundleStatusCallback } bundleStatusCallback - Indicates the callback to be register. + * @returns { Promise } - Returns the result of register. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleMonitor#on + */ + function on(type: 'BundleStatusChange', bundleStatusCallback: BundleStatusCallback): Promise; /** * UnRegister Callback. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param type Indicates the command should be implement. - * @returns { string | Promise } Returns the result of unregister. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { 'BundleStatusChange' } type - Indicates the command should be implement. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleMonitor#off */ - function off(type:"BundleStatusChange", callback: AsyncCallback) : void; - function off(type:"BundleStatusChange"): Promise; + function off(type: 'BundleStatusChange', callback: AsyncCallback): void; + + /** + * UnRegister Callback. + * + * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { 'BundleStatusChange' } type - Indicates the command should be implement. + * @returns { Promise } Returns the result of unregister. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.bundleMonitor#off + */ + function off(type: 'BundleStatusChange'): Promise; /** * Obtains based on a given userId. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param userId Indicates the id for the user. - * @returns Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos */ - function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback>) : void; - function getAllLauncherAbilityInfos(userId: number) : Promise>; + function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback>): void; + + /** + * Obtains based on a given userId. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } userId - Indicates the id for the user. + * @returns { Promise> } Returns the LauncherAbilityInfo array. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos + */ + function getAllLauncherAbilityInfos(userId: number): Promise>; /** * Obtains based on a given bundleName. * - * @since 8 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @returns Returns the LauncherShortcutInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo */ - function getShortcutInfos(bundleName :string, callback: AsyncCallback>) : void; - function getShortcutInfos(bundleName : string) : Promise>; + function getShortcutInfos(bundleName: string, callback: AsyncCallback>): void; + + /** + * Obtains based on a given bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @returns { Promise> } Returns the LauncherShortcutInfo array. + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi Hide this for inner system use + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo + */ + function getShortcutInfos(bundleName: string): Promise>; } export default innerBundleManager; diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index 261b561de..fcc480e9d 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -13,10 +13,11 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * Support install, upgrade, remove and recover bundles on the devices. + * * @namespace installer * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -25,20 +26,21 @@ import { AsyncCallback } from './basic'; declare namespace installer { /** * Obtains the interface used to install bundle. - * @param { AsyncCallback } callback - The callback of BundleInstaller object. + * + * @param { AsyncCallback } callback - The callback of BundleInstaller object. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 */ - function getBundleInstaller(callback: AsyncCallback) : void + function getBundleInstaller(callback: AsyncCallback): void; /** * Obtains the interface used to install bundle. - * @param { AsyncCallback } callback - The callback of getting a list of BundleInstaller objects. - * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * * @returns { Promise } BundleInstaller object. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -47,6 +49,7 @@ declare namespace installer { /** * Bundle installer interface, include install uninstall recover. + * * @interface BundleInstaller * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -55,10 +58,11 @@ declare namespace installer { interface BundleInstaller { /** * Install haps for an application. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { Array } hapFilePaths - Indicates the path where the hap of the application is stored. * @param { InstallParam } installParam - Indicates other parameters required for the installation. - * @param { AsyncCallback } callback - The callback of installing haps result. + * @param { AsyncCallback } callback - The callback of installing haps result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. @@ -78,15 +82,41 @@ declare namespace installer { * @systemapi * @since 9 */ - install(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback) : void; - install(hapFilePaths: Array, callback: AsyncCallback) : void; + install(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback): void; /** * Install haps for an application. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the hap of the application is stored. + * @param { AsyncCallback } callback - The callback of installing haps result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. + * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. + * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. + * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. + * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. + * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + install(hapFilePaths: Array, callback: AsyncCallback): void; + + /** + * Install haps for an application. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { Array } hapFilePaths - Indicates the path where the hap of the application is stored. * @param { InstallParam } installParam - Indicates other parameters required for the installation. - * @param { AsyncCallback } callback - The callback of installing haps result. + * @returns { Promise } * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. @@ -106,14 +136,15 @@ declare namespace installer { * @systemapi * @since 9 */ - install(hapFilePaths: Array, installParam?: InstallParam) : Promise; + install(hapFilePaths: Array, installParam?: InstallParam): Promise; /** * Uninstall an application. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. - * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @param { AsyncCallback } callback - The callback of uninstalling application result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. @@ -124,15 +155,32 @@ declare namespace installer { * @systemapi * @since 9 */ - uninstall(bundleName: string, installParam: InstallParam, callback : AsyncCallback) : void; - uninstall(bundleName: string, callback : AsyncCallback) : void; + uninstall(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; /** * Uninstall an application. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. + * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + uninstall(bundleName: string, callback: AsyncCallback): void; + + /** + * Uninstall an application. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. - * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @returns { Promise } * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. @@ -143,14 +191,15 @@ declare namespace installer { * @systemapi * @since 9 */ - uninstall(bundleName: string, installParam?: InstallParam) : Promise; + uninstall(bundleName: string, installParam?: InstallParam): Promise; /** * Recover an application. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be recovered. * @param { InstallParam } installParam - Indicates other parameters required for the recover. - * @param { AsyncCallback } callback - The callback of recovering application result. + * @param { AsyncCallback } callback - The callback of recovering application result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. @@ -160,14 +209,29 @@ declare namespace installer { * @since 9 */ recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; + + /** + * Recover an application. + * + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { AsyncCallback } callback - The callback of recovering application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Input parameters check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ recover(bundleName: string, callback: AsyncCallback): void; /** * Recover an application. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be recovered. * @param { InstallParam } installParam - Indicates other parameters required for the recover. - * @param { AsyncCallback } callback - The callback of recovering application result. + * @returns { Promise } * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 202 - Permission denied, non-system app called system api. * @throws { BusinessError } 401 - Input parameters check failed. @@ -176,13 +240,14 @@ declare namespace installer { * @systemapi * @since 9 */ - recover(bundleName: string, installParam?: InstallParam) : Promise; + recover(bundleName: string, installParam?: InstallParam): Promise; /** * Uninstall a shared bundle. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. - * @param { AsyncCallback } callback - The callback of uninstalling shared bundle result. + * @param { AsyncCallback } callback - The callback of uninstalling shared bundle result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. @@ -192,12 +257,14 @@ declare namespace installer { * @systemapi * @since 10 */ - uninstall(uninstallParam: UninstallParam, callback : AsyncCallback) : void; + uninstall(uninstallParam: UninstallParam, callback: AsyncCallback): void; /** * Uninstall a shared bundle. + * * @permission ohos.permission.INSTALL_BUNDLE * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. + * @returns { Promise } * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. @@ -207,11 +274,12 @@ declare namespace installer { * @systemapi * @since 10 */ - uninstall(uninstallParam: UninstallParam) : Promise; + uninstall(uninstallParam: UninstallParam): Promise; } /** * Provides parameters required for hashParam. + * * @typedef HashParam * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -220,14 +288,18 @@ declare namespace installer { export interface HashParam { /** * Indicates the moduleName + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ moduleName: string; /** * Indicates the hash value + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ hashValue: string; @@ -235,6 +307,7 @@ declare namespace installer { /** * Provides parameters required for installing or uninstalling an application. + * * @typedef InstallParam * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -243,42 +316,54 @@ declare namespace installer { export interface InstallParam { /** * Indicates the user id + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ userId?: number; /** * Indicates the install flag, which 0x00 for normal, 0x10 for freeInstall + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ installFlag?: number; /** * Indicates whether the param has data + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ isKeepData?: boolean; /** * Indicates the hash params + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ hashParams?: Array; /** * Indicates the deadline of the crowdtesting bundle + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ crowdtestDeadline?: number; /** * Indicates the shared bundle dir paths. + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 10 */ sharedBundleDirPaths?: Array; @@ -286,6 +371,7 @@ declare namespace installer { /** * Provides parameters required for uninstalling shared bundle. + * * @typedef UninstallParam * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -294,18 +380,22 @@ declare namespace installer { export interface UninstallParam { /** * Indicates the shared bundle name + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 10 */ bundleName: string; /** * Indicates the shared version code. If default, indicates that all version sharing bundles are uninstalled + * * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 10 */ versionCode?: number; } } -export default installer; \ No newline at end of file +export default installer; diff --git a/api/@ohos.bundle.launcherBundleManager.d.ts b/api/@ohos.bundle.launcherBundleManager.d.ts index 36b2405cc..923cb261c 100644 --- a/api/@ohos.bundle.launcherBundleManager.d.ts +++ b/api/@ohos.bundle.launcherBundleManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { LauncherAbilityInfo as _LauncherAbilityInfo } from './bundleManager/LauncherAbilityInfo'; import { ShortcutInfo as _ShortcutInfo, ShortcutWant as _ShortcutWant } from './bundleManager/ShortcutInfo'; diff --git a/api/@ohos.bundle.overlay.d.ts b/api/@ohos.bundle.overlay.d.ts index d9e2ce121..046e8d520 100755 --- a/api/@ohos.bundle.overlay.d.ts +++ b/api/@ohos.bundle.overlay.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import * as _OverlayModuleInfo from './bundleManager/OverlayModuleInfo'; /** @@ -36,11 +36,25 @@ declare namespace overlay { * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @since 10 */ - function setOverlayEnabled(moduleName:string, isEnabled: boolean, callback: AsyncCallback): void; - function setOverlayEnabled(moduleName:string, isEnabled: boolean): Promise; + function setOverlayEnabled(moduleName: string, isEnabled: boolean, callback: AsyncCallback): void; + + /** + * Set enabled state of overlay module based on specified moduleName. + * + * @param { string } moduleName - Indicates the module name of the overlay module to be set. + * @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature. + * @returns { Promise } + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 10 + */ + function setOverlayEnabled(moduleName: string, isEnabled: boolean): Promise; /** * Set enabled state of overlay module based on specified bundleName and moduleName. + * * @permission ohos.permission.CHANGE_OVERLAY_ENABLED_STATE * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be set. * @param { string } moduleName - Indicates the module name of the overlay module to be set. @@ -57,11 +71,33 @@ declare namespace overlay { * @systemapi * @since 10 */ - function setOverlayEnabledByBundleName(bundleName:string, moduleName:string, isEnabled: boolean, callback: AsyncCallback): void; - function setOverlayEnabledByBundleName(bundleName:string, moduleName:string, isEnabled: boolean): Promise; + function setOverlayEnabledByBundleName(bundleName:string, + moduleName:string, isEnabled: boolean, callback: AsyncCallback): void; + + /** + * Set enabled state of overlay module based on specified bundleName and moduleName. + * + * @permission ohos.permission.CHANGE_OVERLAY_ENABLED_STATE + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be set. + * @param { string } moduleName - Indicates the module name of the overlay module to be set. + * @param { boolean } isEnabled - The value true means to enable overlay feature, and the value false means to disable overlay feature. + * @returns { Promise } + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 10 + */ + function setOverlayEnabledByBundleName(bundleName: string, moduleName: string, isEnabled: boolean): Promise; /** * Obtain the OverlayModuleInfo of current application based on moduleName. + * * @param { string } moduleName - Indicates the module name of the overlay module to be queried. * @param { AsyncCallback } callback - The callback of getting OverlayModuleInfo object. * @throws { BusinessError } 401 - The parameter check failed. @@ -71,11 +107,25 @@ declare namespace overlay { * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @since 10 */ - function getOverlayModuleInfo(moduleName: string, callback: AsyncCallback): void; - function getOverlayModuleInfo(moduleName: string): Promise; + function getOverlayModuleInfo(moduleName: string, callback: AsyncCallback): void; /** * Obtain the OverlayModuleInfo of current application based on moduleName. + * + * @param { string } moduleName - Indicates the module name of the overlay module to be queried. + * @returns { Promise } + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @throws { BusinessError } 17700033 - The specified module is not an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 10 + */ + function getOverlayModuleInfo(moduleName: string): Promise; + + /** + * Obtain the OverlayModuleInfo of current application based on moduleName. + * * @param { string } targetModuleName - Indicates the target module name of the target module to be queried. * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo object. * @throws { BusinessError } 401 - The parameter check failed. @@ -84,11 +134,43 @@ declare namespace overlay { * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @since 10 */ - function getTargetOverlayModuleInfos(targetModuleName: string, callback: AsyncCallback>): void; - function getTargetOverlayModuleInfos(targetModuleName: string): Promise>; + function getTargetOverlayModuleInfos(targetModuleName: string, + callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of current application based on moduleName. + * + * @param { string } targetModuleName - Indicates the target module name of the target module to be queried. + * @returns { Promise> } + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @throws { BusinessError } 17700034 - The specified module is an overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @since 10 + */ + function getTargetOverlayModuleInfos(targetModuleName: string): Promise>; /** * Obtain the OverlayModuleInfo of the specified application based on bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo object. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700032 - The specified bundle does not contain any overlay module. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 10 + */ + function getOverlayModuleInfoByBundleName(bundleName: string, + callback: AsyncCallback>): void; + + /** + * Obtain the OverlayModuleInfo of the specified application based on bundleName. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired. * @param { string } moduleName - Indicates the module name of the overlay module to be queried. @@ -104,11 +186,12 @@ declare namespace overlay { * @systemapi * @since 10 */ - function getOverlayModuleInfoByBundleName(bundleName: string, callback: AsyncCallback>): void; - function getOverlayModuleInfoByBundleName(bundleName: string, moduleName: string, callback: AsyncCallback>): void; + function getOverlayModuleInfoByBundleName(bundleName: string, + moduleName: string, callback: AsyncCallback>): void; /** * Obtain the OverlayModuleInfo of the specified application based on bundleName and moduleName. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the application bundle name of the overlay bundle to be quired. * @param { string } moduleName - Indicates the module name of the overlay module to be queried. @@ -124,7 +207,26 @@ declare namespace overlay { * @systemapi * @since 10 */ - function getOverlayModuleInfoByBundleName(bundleName: string, moduleName?: string): Promise>; + function getOverlayModuleInfoByBundleName(bundleName: string, + moduleName?: string): Promise>; + + /** + * Obtain the OverlayModuleInfo of the specified target application based on bundleName. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired. + * @param { AsyncCallback> } callback - The callback of getting a list of OverlayModuleInfo object. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700035 - The specified bundle is an overlay bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Overlay + * @systemapi + * @since 10 + */ + function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, + callback: AsyncCallback>): void; /** * Obtain the OverlayModuleInfo of the specified target application based on bundleName. @@ -144,11 +246,12 @@ declare namespace overlay { * @systemapi * @since 10 */ - function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, callback: AsyncCallback>): void; - function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName: string, callback: AsyncCallback>): void; + function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, + moduleName: string, callback: AsyncCallback>): void; /** * Obtain the OverlayModuleInfo of the specified target application based on bundleName and moduleName. + * * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } targetBundleName - Indicates the application target bundle name of the overlay bundle to be quired. * @param { string } moduleName - Indicates the module name of the overlay module to be queried. @@ -164,14 +267,16 @@ declare namespace overlay { * @systemapi * @since 10 */ - function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, moduleName?: string): Promise>; + function getTargetOverlayModuleInfosByBundleName(targetBundleName: string, + moduleName?: string): Promise>; /** * Obtains configuration information about a overlay hap module. + * * @syscap SystemCapability.BundleManager.BundleFramework.Overlay * @since 10 */ - export type OverlayModuleInfo = _OverlayModuleInfo.OverlayModuleInfo; + export type OverlayModuleInfo = _OverlayModuleInfo.OverlayModuleInfo; } -export default overlay; \ No newline at end of file +export default overlay; diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index eb7f098c1..9dabd86b3 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides methods for managing bundle usage statistics, @@ -29,243 +29,413 @@ import { AsyncCallback, Callback } from './basic'; * @useinstead ohos.resourceschedule.usageStatistics */ declare namespace bundleState { - + /** + * @interface BundleStateInfo + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.BundleStatsInfo + */ + interface BundleStateInfo { /** - * @since 7 + * The identifier of BundleStateInfo. + * * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.BundleStatsInfo - */ - interface BundleStateInfo { - /** - * The identifier of BundleStateInfo. - */ - id: number; - /** - * The total duration, in milliseconds. - */ - abilityInFgTotalTime?: number; - /** - * The last time when the application was accessed, in milliseconds. - */ - abilityPrevAccessTime?: number; - /** - * The last time when the application was visible in the foreground, in milliseconds. - */ - abilityPrevSeenTime?: number; - /** - * The total duration, in milliseconds. - */ - abilitySeenTotalTime?: number; - /** - * The bundle name of the application. - */ - bundleName?: string; - /** - * The total duration, in milliseconds. - */ - fgAbilityAccessTotalTime?: number; - /** - * The last time when the foreground application was accessed, in milliseconds. - */ - fgAbilityPrevAccessTime?: number; - /** - * The time of the first bundle usage record in this {@code BundleActiveInfo} object, - * in milliseconds. - */ - infosBeginTime?: number; - /** - * The time of the last bundle usage record in this {@code BundleActiveInfo} object, - * in milliseconds. - */ - infosEndTime?: number; - - /** - * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object. - * The bundle name of both objects must be the same. - * - * @since 7 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. - * If the bundle names of the two {@link BundleActiveInfo} objects are different. - */ - merge(toMerge: BundleStateInfo): void; - } - - /** * @since 7 + * @deprecated since 9 + */ + id: number; + /** + * The total duration, in milliseconds. + * * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.BundleEvents - */ - interface BundleActiveState { - /** - * The usage priority group of the application. - */ - appUsagePriorityGroup?: number; - /** - * The bundle name. - */ - bundleName?: string; - /** - * The shortcut ID. - */ - indexOfLink?: string; - /** - * The class name. - */ - nameOfClass?: string; - /** - * The time when this state occurred, in milliseconds. - */ - stateOccurredTime?: number; - /** - * The state type. - */ - stateType?: number; - } - - /** - * Checks whether the application with a specified bundle name is in the idle state. - * * @since 7 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @param bundleName Indicates the bundle name of the application to query. - * @returns Returns {@code true} if the application is idle in a particular period; - * returns {@code false} otherwise. The time range of the particular period is defined by the system, - * which may be hours or days. * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.isIdleState */ - function isIdleState(bundleName: string, callback: AsyncCallback): void; - function isIdleState(bundleName: string): Promise; - + abilityInFgTotalTime?: number; /** - * Queries the usage priority group of the calling application. + * The last time when the application was accessed, in milliseconds. * - *

The priority defined in a priority group restricts the resource usage of an application, - * for example, restricting the running of background tasks.

- * - * @since 7 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @returns Returns the usage priority group of the calling application. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup - */ - function queryAppUsagePriorityGroup(callback: AsyncCallback): void; - function queryAppUsagePriorityGroup(): Promise; - - /** - * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.BundleStatsMap */ - interface BundleActiveInfoResponse { - [key: string]: BundleStateInfo; - } + abilityPrevAccessTime?: number; + /** + * The last time when the application was visible in the foreground, in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + abilityPrevSeenTime?: number; + /** + * The total duration, in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + abilitySeenTotalTime?: number; + /** + * The bundle name of the application. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + bundleName?: string; + /** + * The total duration, in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + fgAbilityAccessTotalTime?: number; + /** + * The last time when the foreground application was accessed, in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + fgAbilityPrevAccessTime?: number; + /** + * The time of the first bundle usage record in this {@code BundleActiveInfo} object, + * in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + infosBeginTime?: number; + /** + * The time of the last bundle usage record in this {@code BundleActiveInfo} object, + * in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + infosEndTime?: number; /** - * Queries usage information about each bundle within a specified period. + * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object. + * The bundle name of both objects must be the same. * - *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

- * - * @since 7 + * @param { BundleStateInfo } toMerge Indicates the {@link BundleActiveInfo} object to merge. + * If the bundle names of the two {@link BundleActiveInfo} objects are different. * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. - * @returns Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. + * @since 7 * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfos */ - function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; - function queryBundleStateInfos(begin: number, end: number): Promise; + merge(toMerge: BundleStateInfo): void; + } + + /** + * @typedef BundleActiveState + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.BundleEvents + */ + interface BundleActiveState { + /** + * The usage priority group of the application. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + appUsagePriorityGroup?: number; + /** + * The bundle name. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + bundleName?: string; + /** + * The shortcut ID. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + indexOfLink?: string; + /** + * The class name. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + nameOfClass?: string; + /** + * The time when this state occurred, in milliseconds. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + stateOccurredTime?: number; + /** + * The state type. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + stateType?: number; + } + + /** + * Checks whether the application with a specified bundle name is in the idle state. + * + * @param { string } bundleName Indicates the bundle name of the application to query. + * @param { AsyncCallback } callback + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.isIdleState + */ + function isIdleState(bundleName: string, callback: AsyncCallback): void; + + /** + * Checks whether the application with a specified bundle name is in the idle state. + * + * @param { string } bundleName Indicates the bundle name of the application to query. + * @returns { Promise } + * returns {@code false} otherwise. The time range of the particular period is defined by the system, + * which may be hours or days. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.isIdleState + */ + function isIdleState(bundleName: string): Promise; + + /** + * Queries the usage priority group of the calling application. + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @param { AsyncCallback } callback + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup + */ + function queryAppUsagePriorityGroup(callback: AsyncCallback): void; + + /** + * Queries the usage priority group of the calling application. + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @returns { Promise } Returns the usage priority group of the calling application. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup + */ + function queryAppUsagePriorityGroup(): Promise; + + /** + * @typedef BundleActiveInfoResponse + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.BundleStatsMap + */ + interface BundleActiveInfoResponse { + [key: string]: BundleStateInfo; + } + + /** + * Queries usage information about each bundle within a specified period. + *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

+ * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback } callback + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfos + */ + function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; + + /** + * Queries usage information about each bundle within a specified period. + *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

+ * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @returns { Promise } Returns the {@link BundleActiveInfoResponse} objects + * containing the usage information about each bundle. + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfos + */ + function queryBundleStateInfos(begin: number, end: number): Promise; + + /** + * Declares interval type. + * + * @enum { number } + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.IntervalType + */ + export enum IntervalType { + /** + * Indicates the interval type that will determine the optimal interval based on the start and end time. + * + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + */ + BY_OPTIMIZED = 0, /** - * Declares interval type. + * Indicates the daily interval. * - * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.IntervalType */ - export enum IntervalType { - /** - * Indicates the interval type that will determine the optimal interval based on the start and end time. - */ - BY_OPTIMIZED = 0, - - /** - * Indicates the daily interval. - */ - BY_DAILY = 1, - - /** - * Indicates the weekly interval. - */ - BY_WEEKLY = 2, - - /** - * Indicates the monthly interval. - */ - BY_MONTHLY = 3, - - /** - * Indicates the annually interval. - */ - BY_ANNUALLY = 4 - } + BY_DAILY = 1, /** - * Queries usage information about each bundle within a specified period at a specified interval. + * Indicates the weekly interval. * - * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param byInterval Indicates the interval at which the usage statistics are queried. - * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, - * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. - * @returns Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. + * @since 7 * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval */ - function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + BY_WEEKLY = 2, /** - * Queries state data of all bundles within a specified period identified by the start and end time. + * Indicates the monthly interval. * - * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. - * @returns Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. + * @since 7 * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents */ - function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleActiveStates(begin: number, end: number): Promise>; + BY_MONTHLY = 3, /** - * Queries state data of the current bundle within a specified period. + * Indicates the annually interval. * - * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. - * @returns Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. + * @since 7 * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents */ - function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; + BY_ANNUALLY = 4 + } + + /** + * Queries usage information about each bundle within a specified period at a specified interval. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { IntervalType } byInterval Indicates the interval at which the usage statistics are queried. + * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval + */ + function queryBundleStateInfoByInterval(byInterval: IntervalType, + begin: number, end: number, callback: AsyncCallback>): void; + + /** + * Queries usage information about each bundle within a specified period at a specified interval. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { IntervalType } byInterval Indicates the interval at which the usage statistics are queried. + * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval + */ + function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + + /** + * Queries state data of all bundles within a specified period identified by the start and end time. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents + */ + function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; + + /** + * Queries state data of all bundles within a specified period identified by the start and end time. + * + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents + */ + function queryBundleActiveStates(begin: number, end: number): Promise>; + + /** + * Queries state data of the current bundle within a specified period. + * + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents + */ + function queryCurrentBundleActiveStates(begin: number, + end: number, callback: AsyncCallback>): void; + + /** + * Queries state data of the current bundle within a specified period. + * + * @param { number } begin Indicates the start time of the query period, in milliseconds. + * @param { number } end Indicates the end time of the query period, in milliseconds. + * @returns { Promise> } + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @since 7 + * @deprecated since 9 + * @useinstead ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents + */ + function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; } export default bundleState; diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index f1d817038..bd11e5d95 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { CommonEventData } from './commonEvent/commonEventData'; import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber'; import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo'; diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts index 76911243b..3f4aacbc3 100644 --- a/api/@ohos.commonEventManager.d.ts +++ b/api/@ohos.commonEventManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { CommonEventData } from './commonEvent/commonEventData'; import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber'; import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo'; diff --git a/api/@ohos.configPolicy.d.ts b/api/@ohos.configPolicy.d.ts index f7dc96983..9ec009a27 100644 --- a/api/@ohos.configPolicy.d.ts +++ b/api/@ohos.configPolicy.d.ts @@ -1,64 +1,97 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import {AsyncCallback} from "./basic"; +import { AsyncCallback } from './@ohos.base'; /** * Provides file path related APIS. * - * @since 8 - * @systemapi + * @namespace configPolicy * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi + * @since 8 */ declare namespace configPolicy { /** * Get file from the highest priority config path which contains the given file name. * - * @since 8 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Customization.ConfigPolicy - * @param relPath the relative path of the config file. - * @returns Returns the path of the highest priority config file. + * @param { string } relPath the relative path of the config file. + * @param { AsyncCallback } callback contains the path of the highest priority config file. * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi Hide this for inner system use. + * @since 8 */ function getOneCfgFile(relPath: string, callback: AsyncCallback); + + /** + * Get file from the highest priority config path which contains the given file name. + * + * @param { string } relPath the relative path of the config file. + * @returns { Promise } the promise returns the path of the highest priority config file. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi Hide this for inner system use. + * @since 8 + */ function getOneCfgFile(relPath: string): Promise; /** * Get config files in device architecture, ordered by priority from low to high. * - * @since 8 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Customization.ConfigPolicy - * @param relPath the relative path of the config file. - * @returns Returns paths of config files. + * @param { string } relPath the relative path of the config file. + * @param { AsyncCallback> } callback contains paths of config files. * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi Hide this for inner system use. + * @since 8 */ function getCfgFiles(relPath: string, callback: AsyncCallback>); + + /** + * Get config files in device architecture, ordered by priority from low to high. + * + * @param { string } relPath the relative path of the config file. + * @returns { Promise> } the promise returns paths of config files. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi Hide this for inner system use. + * @since 8 + */ function getCfgFiles(relPath: string): Promise>; /** * Get config directories in device architecture, ordered by priority from low to high. * - * @since 8 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Customization.ConfigPolicy - * @returns Returns paths of config directories. + * @param { AsyncCallback> } callback contains paths of config directories. * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi Hide this for inner system use. + * @since 8 */ function getCfgDirList(callback: AsyncCallback>); + + /** + * Get config directories in device architecture, ordered by priority from low to high. + * + * @returns { Promise> } the promise returns paths of config directories. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.ConfigPolicy + * @systemapi Hide this for inner system use. + * @since 8 + */ function getCfgDirList(): Promise>; } diff --git a/api/@ohos.connectedTag.d.ts b/api/@ohos.connectedTag.d.ts index d0b6bc390..44e04bb2e 100644 --- a/api/@ohos.connectedTag.d.ts +++ b/api/@ohos.connectedTag.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides methods to operate or manage Connected Tag. diff --git a/api/@ohos.contact.d.ts b/api/@ohos.contact.d.ts index 814054e2e..466305c8d 100644 --- a/api/@ohos.contact.d.ts +++ b/api/@ohos.contact.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * Contains variety of system contact, provides functions for adding, updating and deleting these system contact diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts index e12c6a1f8..a9f4edf1c 100644 --- a/api/@ohos.continuation.continuationManager.d.ts +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { Callback } from './basic'; -import { AsyncCallback } from './basic'; +import { Callback } from './@ohos.base'; +import { AsyncCallback } from './@ohos.base'; import { ContinuationResult } from './continuation/continuationResult' import { ContinuationExtraParams } from './continuation/continuationExtraParams' diff --git a/api/@ohos.data.DataShareResultSet.d.ts b/api/@ohos.data.DataShareResultSet.d.ts index 13c8479c8..a7aac891f 100644 --- a/api/@ohos.data.DataShareResultSet.d.ts +++ b/api/@ohos.data.DataShareResultSet.d.ts @@ -17,6 +17,7 @@ * Indicates the {@code DataType}. *

{@code DataType} is obtained based on the value. * + * @enum { number } * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -77,6 +78,7 @@ export enum DataType { /** * Provides methods for accessing a datashare result set generated by querying the database. * + * @interface DataShareResultSet * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -130,7 +132,7 @@ export default interface DataShareResultSet { /** * Go to the first row of the result set. * - * @returns Returns true if the result set is moved successfully; + * @returns { boolean } Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -142,7 +144,7 @@ export default interface DataShareResultSet { /** * Go to the last row of the result set. * - * @returns Returns true if the result set is moved successfully; + * @returns { boolean } Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -154,7 +156,7 @@ export default interface DataShareResultSet { /** * Go to the next row of the result set. * - * @returns Returns true if the result set is moved successfully; + * @returns { boolean } Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the last row. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -166,7 +168,7 @@ export default interface DataShareResultSet { /** * Go to the previous row of the result set. * - * @returns Returns true if the result set is moved successfully; + * @returns { boolean } Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the first row. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -179,8 +181,8 @@ export default interface DataShareResultSet { * Go to the specified row of the result set forwards or backwards by an offset relative to its current position. * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * - * @param offset Indicates the offset relative to the current position. - * @returns Returns true if the result set is moved successfully and does not go beyond the range; + * @param { number } offset - Indicates the offset relative to the current position. + * @returns { boolean } Returns true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -192,8 +194,8 @@ export default interface DataShareResultSet { /** * Go to the specified row of the result set. * - * @param position Indicates the index of the specified row, which starts from 1. - * @returns Returns true if the result set is moved successfully; returns false otherwise. + * @param { number } position - Indicates the index of the specified row, which starts from 1. + * @returns { boolean } Returns true if the result set is moved successfully; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -206,8 +208,8 @@ export default interface DataShareResultSet { * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null or the specified column or key is not of the Blob type. * - * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @returns Returns the value of the specified column or key as a byte array. + * @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0. + * @returns { Uint8Array } Returns the value of the specified column or key as a byte array. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -220,8 +222,8 @@ export default interface DataShareResultSet { * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null or the specified column or key is not of the string type. * - * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @returns Returns the value of the specified column or key as a string. + * @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0. + * @returns { string } Returns the value of the specified column or key as a string. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -234,8 +236,8 @@ export default interface DataShareResultSet { * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null, the specified column or key is not of the long type. * - * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @returns Returns the value of the specified column or key as a long. + * @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0. + * @returns { number } Returns the value of the specified column or key as a long. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -248,8 +250,8 @@ export default interface DataShareResultSet { * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null, the specified column or key is not of the double type. * - * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @returns Returns the value of the specified column or key as a double. + * @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0. + * @returns { number } Returns the value of the specified column or key as a double. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -261,7 +263,6 @@ export default interface DataShareResultSet { * Closes the result set. * Calling this method on the result set will release all of its resources and makes it ineffective. * - * @returns Returns true if the result set is closed; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -273,8 +274,8 @@ export default interface DataShareResultSet { * Obtains the column index or key index based on the specified column name or key name. * The column name or key name is passed as an input parameter. * - * @param columnName Indicates the name of the specified column or key in the result set. - * @returns Returns the index of the specified column or key. + * @param { string } columnName - Indicates the name of the specified column or key in the result set. + * @returns { number } Returns the index of the specified column or key. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -286,8 +287,8 @@ export default interface DataShareResultSet { * Obtains the column name or key name based on the specified column index or key index. * The column index or key index is passed as an input parameter. * - * @param columnIndex Indicates the index of the specified column or key in the result set. - * @returns Returns the name of the specified column or key. + * @param { number } columnIndex - Indicates the index of the specified column or key in the result set. + * @returns { string } Returns the name of the specified column or key. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -300,8 +301,8 @@ export default interface DataShareResultSet { * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null, the specified column or key is not in the data type. * - * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @returns Returns the dataType of the specified column or key. + * @param { number } columnIndex - Indicates the specified column index or key index, which starts from 0. + * @returns { DataType } Returns the dataType of the specified column or key. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly diff --git a/api/@ohos.data.dataAbility.d.ts b/api/@ohos.data.dataAbility.d.ts index 14f0a08d1..037b73f37 100644 --- a/api/@ohos.data.dataAbility.d.ts +++ b/api/@ohos.data.dataAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import rdb from './@ohos.data.rdb'; /** @@ -28,9 +28,9 @@ declare namespace dataAbility { * Create an RdbPredicates by table name and DataAbilityPredicates. * This method is similar to = of the SQL statement. * - * @param name Indicates the table name. - * @param dataAbilityPredicates Indicates the dataAbility predicates. - * @returns Returns an RdbPredicates. + * @param { string } name - Indicates the table name. + * @param { DataAbilityPredicates } dataAbilityPredicates - Indicates the dataAbility predicates. + * @returns { rdb.RdbPredicates } Returns an RdbPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -48,9 +48,9 @@ declare namespace dataAbility { * to a specified value. * This method is similar to = of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataAbilityPredicates. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { ValueType } value - Indicates the value to match with the DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -62,9 +62,9 @@ declare namespace dataAbility { * Configure the data capability predicate to match a field where the data type is a value type and the value is not equal to the specified value. * This method is similar to != of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataAbilityPredicates. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { ValueType } value - Indicates the value to match with the DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -74,7 +74,7 @@ declare namespace dataAbility { * Adds a left parenthesis to the DataAbilityPredicates. * This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * - * @returns Returns the DataAbilityPredicates with the left parenthesis. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the left parenthesis. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -85,7 +85,7 @@ declare namespace dataAbility { * This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). * - * @returns Returns the DataAbilityPredicates with the right parenthesis. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the right parenthesis. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -95,7 +95,7 @@ declare namespace dataAbility { * Adds an or condition to the DataAbilityPredicates. * This method is similar to or of the SQL statement. * - * @returns Returns the DataAbilityPredicates with the or condition. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the or condition. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -105,7 +105,7 @@ declare namespace dataAbility { * Adds an and condition to the DataAbilityPredicates. * This method is similar to and of the SQL statement. * - * @returns Returns the DataAbilityPredicates with the and condition. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the and condition. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -116,9 +116,9 @@ declare namespace dataAbility { * contains a specified value. * This method is similar to contains of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataAbilityPredicates. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -129,9 +129,9 @@ declare namespace dataAbility { * with a specified string. * This method is similar to value% of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataAbilityPredicates. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -142,9 +142,9 @@ declare namespace dataAbility { * ends with a specified string. * This method is similar to %value of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataAbilityPredicates. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -154,8 +154,8 @@ declare namespace dataAbility { * Configure the DataAbilityPredicates to match the fields whose value is null. * This method is similar to is null of the SQL statement. * - * @param field Indicates the column name in the database table. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -165,8 +165,8 @@ declare namespace dataAbility { * Configure the DataAbilityPredicates to match the specified fields whose value is not null. * This method is similar to is not null of the SQL statement. * - * @param field Indicates the column name in the database table. - * @returns Returns the DataAbilityPredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -177,10 +177,10 @@ declare namespace dataAbility { * similar to a specified string. * This method is similar to like of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataAbilityPredicates. The percent sign (%) in the value + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataAbilityPredicates. The percent sign (%) in the value * is a wildcard (like * in a regular expression). - * @returns Returns the DataAbilityPredicates that match the specified field. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -191,9 +191,9 @@ declare namespace dataAbility { * a wildcard. * Different from like, the input parameters of this method are case-sensitive. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with DataAbilityPredicates. - * @returns Returns the SQL statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the SQL statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -202,10 +202,10 @@ declare namespace dataAbility { /** * Restricts the value of the field to the range between low value and high value. * - * @param field Indicates the column name. - * @param low Indicates the minimum value. - * @param high Indicates the maximum value. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } low - Indicates the minimum value. + * @param { ValueType } high - Indicates the maximum value. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -215,10 +215,10 @@ declare namespace dataAbility { * Configure DataAbilityPredicates to match the specified field whose data type is int and value is * out of a given range. * - * @param field Indicates the column name in the database table. - * @param low Indicates the minimum value to match with DataAbilityPredicates}. - * @param high Indicates the maximum value to match with DataAbilityPredicates}. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name in the database table. + * @param { ValueType } low - Indicates the minimum value to match with DataAbilityPredicates}. + * @param { ValueType } high - Indicates the maximum value to match with DataAbilityPredicates}. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -227,9 +227,9 @@ declare namespace dataAbility { /** * Restricts the value of the field to be greater than the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -238,9 +238,9 @@ declare namespace dataAbility { /** * Restricts the value of the field to be smaller than the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -249,9 +249,9 @@ declare namespace dataAbility { /** * Restricts the value of the field to be greater than or equal to the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -260,9 +260,9 @@ declare namespace dataAbility { /** * Restricts the value of the field to be smaller than or equal to the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -272,8 +272,8 @@ declare namespace dataAbility { * Restricts the ascending order of the return list. When there are several orders, * the one close to the head has the highest priority. * - * @param field Indicates the column name for sorting the return list. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name for sorting the return list. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -283,8 +283,8 @@ declare namespace dataAbility { * Restricts the descending order of the return list. When there are several orders, * the one close to the head has the highest priority. * - * @param field Indicates the column name for sorting the return list. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @param { string } field - Indicates the column name for sorting the return list. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -293,7 +293,7 @@ declare namespace dataAbility { /** * Restricts each row of the query result to be unique. * - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -302,9 +302,9 @@ declare namespace dataAbility { /** * Restricts the max number of return records. * - * @param value Indicates the max length of the return list. - * @returns Returns the SQL query statement with the specified DataAbilityPredicates. - * @throws IllegalPredicateException Throws this exception if DataAbilityPredicates are added to a wrong position. + * @param { number } value - Indicates the max length of the return list. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified DataAbilityPredicates. + * @throws { BusinessError } IllegalPredicateException Throws this exception if DataAbilityPredicates are added to a wrong position. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -314,8 +314,8 @@ declare namespace dataAbility { * Configure DataAbilityPredicates to specify the start position of the returned result. * Use this method together with limit(int). * - * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. - * @returns Returns the SQL query statement with the specified AbsPredicates. + * @param { number } rowOffset - Indicates the start position of the returned result. The value is a positive integer. + * @returns { DataAbilityPredicates } Returns the SQL query statement with the specified AbsPredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -324,8 +324,8 @@ declare namespace dataAbility { /** * Configure DataAbilityPredicates to group query results by specified columns. * - * @param fields Indicates the specified columns by which query results are grouped. - * @returns Returns the DataAbilityPredicates with the specified columns by which query results are grouped. + * @param { Array } fields - Indicates the specified columns by which query results are grouped. + * @returns { DataAbilityPredicates } Returns the DataAbilityPredicates with the specified columns by which query results are grouped. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -335,8 +335,8 @@ declare namespace dataAbility { * Configure DataAbilityPredicates to specify the index column. * Before using this method, you need to create an index column. * - * @param indexName Indicates the name of the index column. - * @returns Returns DataAbilityPredicates with the specified index column. + * @param { string } field - Indicates the name of the index column. + * @returns { DataAbilityPredicates } Returns DataAbilityPredicates with the specified index column. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -346,9 +346,9 @@ declare namespace dataAbility { * Configure DataAbilityPredicates to match the specified field whose data type is ValueType array and values * are within a given range. * - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with DataAbilityPredicates. - * @returns Returns DataAbilityPredicates that matches the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { Array } value Indicates the values to match with DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns DataAbilityPredicates that matches the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ @@ -358,9 +358,9 @@ declare namespace dataAbility { * Configure {@code DataAbilityPredicates} to match the specified field whose data type is String array and values * are out of a given range. * - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with DataAbilityPredicates. - * @returns Returns DataAbilityPredicates that matches the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { Array } value - Indicates the values to match with DataAbilityPredicates. + * @returns { DataAbilityPredicates } Returns DataAbilityPredicates that matches the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @since 7 */ diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index c6e4a250d..82dfef227 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import Context from './application/Context'; import DataShareResultSet from './@ohos.data.DataShareResultSet'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -62,6 +62,7 @@ declare namespace dataShare { /** * DataShareHelper * + * @interface DataShareHelper * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -71,7 +72,7 @@ declare namespace dataShare { /** * Registers an observer to observe data specified by the given uri. * - * @param { string } type - type must be 'dataChange'. + * @param { 'dataChange' } type - type must be 'dataChange'. * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - the callback of on. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -84,7 +85,7 @@ declare namespace dataShare { /** * Deregisters an observer used for monitoring data specified by the given uri. * - * @param { string } type - type must be 'dataChange'. + * @param { 'dataChange' } type - type must be 'dataChange'. * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - the callback of off. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -98,7 +99,7 @@ declare namespace dataShare { * Inserts a single data record into the database. * * @param { string } uri - Indicates the path of the data to operate. - * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, + * @param { ValuesBucket } value - Indicates the data record to insert. If this parameter is null, * a blank row will be inserted. * @param { AsyncCallback } callback - {number}: the index of the inserted data record. * @throws { BusinessError } 401 - the parameter check failed. @@ -113,7 +114,7 @@ declare namespace dataShare { * Inserts a single data record into the database. * * @param { string } uri - Indicates the path of the data to operate. - * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, + * @param { ValuesBucket } value - Indicates the data record to insert. If this parameter is null, * a blank row will be inserted. * @returns { Promise } {number}: the index of the inserted data record. * @throws { BusinessError } 401 - the parameter check failed. @@ -203,7 +204,7 @@ declare namespace dataShare { * @param { string } uri - Indicates the path of data to update. * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. * You should define the processing logic when this parameter is null. - * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. + * @param { ValuesBucket } value - Indicates the data to update. This parameter can be null. * @param { AsyncCallback } callback - {number}: the number of data records updated. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -224,7 +225,7 @@ declare namespace dataShare { * @param { string } uri - Indicates the path of data to update. * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. * You should define the processing logic when this parameter is null. - * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. + * @param { ValuesBucket } value - Indicates the data to update. This parameter can be null. * @returns { Promise } {number}: the number of data records updated. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer diff --git a/api/@ohos.data.dataSharePredicates.d.ts b/api/@ohos.data.dataSharePredicates.d.ts index 11bbbb653..7a3317a76 100644 --- a/api/@ohos.data.dataSharePredicates.d.ts +++ b/api/@ohos.data.dataSharePredicates.d.ts @@ -39,9 +39,9 @@ declare namespace dataSharePredicates { * to a specified value. * This method is similar to = of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { ValueType } value - Indicates the value to match with the DataSharePredicates. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -54,9 +54,9 @@ declare namespace dataSharePredicates { * a specified value. * This method is similar to != of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { ValueType } value - Indicates the value to match with the DataSharePredicates. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -68,7 +68,7 @@ declare namespace dataSharePredicates { * Adds a left parenthesis to the DataSharePredicates. * This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * - * @returns Returns the DataSharePredicates with the left parenthesis. + * @returns { DataSharePredicates } Returns the DataSharePredicates with the left parenthesis. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -81,7 +81,7 @@ declare namespace dataSharePredicates { * This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). * - * @returns Returns the DataSharePredicates with the right parenthesis. + * @returns { DataSharePredicates } Returns the DataSharePredicates with the right parenthesis. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -93,7 +93,7 @@ declare namespace dataSharePredicates { * Adds an or condition to the DataSharePredicates. * This method is similar to or of the SQL statement. * - * @returns Returns the DataSharePredicates with the or condition. + * @returns { DataSharePredicates } Returns the DataSharePredicates with the or condition. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -105,7 +105,7 @@ declare namespace dataSharePredicates { * Adds an and condition to the DataSharePredicates. * This method is similar to and of the SQL statement. * - * @returns Returns the DataSharePredicates with the and condition. + * @returns { DataSharePredicates } Returns the DataSharePredicates with the and condition. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -118,9 +118,9 @@ declare namespace dataSharePredicates { * contains a specified value. * This method is similar to contains of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataSharePredicates. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -133,9 +133,9 @@ declare namespace dataSharePredicates { * with a specified string. * This method is similar to value% of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataSharePredicates. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -148,9 +148,9 @@ declare namespace dataSharePredicates { * ends with a specified string. * This method is similar to %value of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataSharePredicates. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -162,8 +162,8 @@ declare namespace dataSharePredicates { * Configure the DataSharePredicates to match the fields whose value is null. * This method is similar to is null of the SQL statement. * - * @param field Indicates the column name in the database table. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -175,8 +175,8 @@ declare namespace dataSharePredicates { * Configure the DataSharePredicates to match the specified fields whose value is not null. * This method is similar to is not null of the SQL statement. * - * @param field Indicates the column name in the database table. - * @returns Returns the DataSharePredicates that match the specified field. + * @param { string } field - Indicates the column name in the database table. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -189,10 +189,10 @@ declare namespace dataSharePredicates { * similar to a specified string. * This method is similar to like of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value * is a wildcard (like * in a regular expression). - * @returns Returns the DataSharePredicates that match the specified field. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -205,10 +205,10 @@ declare namespace dataSharePredicates { * similar to a specified string. * This method is similar to unlike of the SQL statement. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value * is a wildcard (like * in a regular expression). - * @returns Returns the DataSharePredicates that match the specified field. + * @returns { DataSharePredicates } Returns the DataSharePredicates that match the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -221,9 +221,9 @@ declare namespace dataSharePredicates { * a wildcard. * Different from like, the input parameters of this method are case-sensitive. * - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with DataSharePredicates. - * @returns Returns the SQL statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name in the database table. + * @param { string } value - Indicates the value to match with DataSharePredicates. + * @returns { DataSharePredicates } Returns the SQL statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -234,10 +234,10 @@ declare namespace dataSharePredicates { /** * Restricts the value of the field to the range between low value and high value. * - * @param field Indicates the column name. - * @param low Indicates the minimum value. - * @param high Indicates the maximum value. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } low - Indicates the minimum value. + * @param { ValueType } high - Indicates the maximum value. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -249,10 +249,10 @@ declare namespace dataSharePredicates { * Configure DataSharePredicates to match the specified field whose data type is int and value is * out of a given range. * - * @param field Indicates the column name in the database table. - * @param low Indicates the minimum value to match with DataSharePredicates. - * @param high Indicates the maximum value to match with DataSharePredicates. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name in the database table. + * @param { ValueType } low - Indicates the minimum value to match with DataSharePredicates. + * @param { ValueType } high - Indicates the maximum value to match with DataSharePredicates. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -263,9 +263,9 @@ declare namespace dataSharePredicates { /** * Restricts the value of the field to be greater than the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -276,9 +276,9 @@ declare namespace dataSharePredicates { /** * Restricts the value of the field to be smaller than the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -289,9 +289,9 @@ declare namespace dataSharePredicates { /** * Restricts the value of the field to be greater than or equal to the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -302,9 +302,9 @@ declare namespace dataSharePredicates { /** * Restricts the value of the field to be smaller than or equal to the specified value. * - * @param field Indicates the column name. - * @param value Indicates the String field. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name. + * @param { ValueType } value - Indicates the String field. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -316,8 +316,8 @@ declare namespace dataSharePredicates { * Restricts the ascending order of the return list. When there are several orders, * the one close to the head has the highest priority. * - * @param field Indicates the column name for sorting the return list. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name for sorting the return list. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -329,8 +329,8 @@ declare namespace dataSharePredicates { * Restricts the descending order of the return list. When there are several orders, * the one close to the head has the highest priority. * - * @param field Indicates the column name for sorting the return list. - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @param { string } field - Indicates the column name for sorting the return list. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -341,7 +341,7 @@ declare namespace dataSharePredicates { /** * Restricts each row of the query result to be unique. * - * @returns Returns the SQL query statement with the specified DataSharePredicates. + * @returns { DataSharePredicates } Returns the SQL query statement with the specified DataSharePredicates. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -352,9 +352,9 @@ declare namespace dataSharePredicates { /** * Construct a query object to specify the number of results and the starting position. * - * @param total Represents the specified number of results. - * @param offset Indicates the starting position. - * @returns Returns the query object. + * @param { number } total - Represents the specified number of results. + * @param { number } offset - Indicates the starting position. + * @returns { DataSharePredicates } Returns the query object. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -365,8 +365,8 @@ declare namespace dataSharePredicates { /** * Configure {@code DataSharePredicates} to group query results by specified columns. * - * @param fields Indicates the specified columns by which query results are grouped. - * @returns Returns the DataSharePredicates with the specified columns by which query results are grouped. + * @param { Array } fields - Indicates the specified columns by which query results are grouped. + * @returns { DataSharePredicates } Returns the DataSharePredicates with the specified columns by which query results are grouped. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -378,8 +378,8 @@ declare namespace dataSharePredicates { * Configure {@code DataSharePredicates} to specify the index column. * Before using this method, you need to create an index column. * - * @param field Indicates the name of the index column. - * @returns Returns DataSharePredicates with the specified index column. + * @param { string } field - Indicates the name of the index column. + * @returns { DataSharePredicates } Returns DataSharePredicates with the specified index column. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -391,9 +391,9 @@ declare namespace dataSharePredicates { * Configure {@code DataSharePredicates} to match the specified field whose data type is ValueType array and values * are within a given range. * - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with DataSharePredicates. - * @returns Returns DataSharePredicates that matches the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { Array } value - Indicates the values to match with DataSharePredicates. + * @returns { DataSharePredicates } Returns DataSharePredicates that matches the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -405,9 +405,9 @@ declare namespace dataSharePredicates { * Configure {@code DataSharePredicates} to match the specified field whose data type is String array and values * are out of a given range. * - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with DataSharePredicates. - * @returns Returns DataSharePredicates that matches the specified field. + * @param { string } field - Indicates the column name in the database table. + * @param { Array } value - Indicates the values to match with DataSharePredicates. + * @returns { DataSharePredicates } Returns DataSharePredicates that matches the specified field. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -418,8 +418,8 @@ declare namespace dataSharePredicates { /** * Configure {@code DataSharePredicates} Creates a query condition using the specified key prefix. * - * @param prefix Represents the specified key prefix. - * @returns Returns the query object. + * @param { string } prefix - Represents the specified key prefix. + * @returns { DataSharePredicates } Returns the query object. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly @@ -430,8 +430,8 @@ declare namespace dataSharePredicates { /** * Configure {@code DataSharePredicates} to match the specified value whose key is within a given range. * - * @param keys Represents the key names. - * @returns Returns the query object. + * @param { Array } keys - Represents the key names. + * @returns { DataSharePredicates } Returns the query object. * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @StageModelOnly diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index a58a20303..523c8efc2 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from './basic'; +import {AsyncCallback, Callback} from './@ohos.base'; /** * Providers interfaces to creat a {@link KVManager} instance. diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index c04d555b4..0f070190f 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import Context from './application/Context'; /** @@ -61,6 +61,7 @@ declare namespace distributedDataObject { * The response of save. * Contains the parameter information of the save object. * + * @interface SaveSuccessResponse * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ @@ -96,6 +97,7 @@ declare namespace distributedDataObject { * The response of revokeSave. * Contains the sessionId of the changed object. * + * @interface RevokeSaveSuccessResponse * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ @@ -112,6 +114,7 @@ declare namespace distributedDataObject { /** * Object create by {@link createDistributedObject}. * + * @interface DistributedObject * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 @@ -134,8 +137,8 @@ declare namespace distributedDataObject { /** * On watch of change * - * @param { string } type - event type, fixed as' change ', indicates data change. - * @param { Callback<{sessionId: string, fields: Array}> } callback + * @param { 'change' } type - event type, fixed as' change ', indicates data change. + * @param { Callback<{ sessionId: string, fields: Array }> } callback * indicates the observer of object data changed. * {string} sessionId - the sessionId of the changed object. * {Array} fields - changed data. @@ -149,8 +152,8 @@ declare namespace distributedDataObject { /** * Off watch of change * - * @param { string } type - event type, fixed as' change ', indicates data change. - * @param { Callback<{sessionId: string, fields: Array}> } callback + * @param { 'change' } type - event type, fixed as' change ', indicates data change. + * @param { Callback<{ sessionId: string, fields: Array }> } callback? * indicates the observer of object data changed. * {string} sessionId - the sessionId of the changed object. * {Array} fields - changed data. @@ -165,8 +168,8 @@ declare namespace distributedDataObject { /** * On watch of status * - * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. - * @param { Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}> } callback + * @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object. + * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback * indicates the observer of object status changed. * {string} sessionId - the sessionId of the changed object. * {string} networkId - networkId of the changed device. @@ -186,8 +189,8 @@ declare namespace distributedDataObject { /** * Off watch of status * - * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. - * @param { Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}> } callback + * @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object. + * @param { Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }> } callback? * Indicates the observer of object status changed. * {string} sessionId - the sessionId of the changed object. * {string} networkId - networkId of the changed device. @@ -209,6 +212,7 @@ declare namespace distributedDataObject { /** * Object create by {@link create}. * + * @interface DataObject * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ @@ -258,8 +262,8 @@ declare namespace distributedDataObject { /** * On watch of change. * - * @param { string } type - event type, fixed as' change ', indicates data change. - * @param { Callback<{sessionId: string, fields: Array}> } callback + * @param { 'change' } type - event type, fixed as' change ', indicates data change. + * @param { Callback<{ sessionId: string; fields: Array }> } callback * indicates the observer of object data changed. * {string} sessionId - the sessionId of the changed object. * {Array} fields - changed data. @@ -273,8 +277,8 @@ declare namespace distributedDataObject { /** * Off watch of change. * - * @param { string } type - event type, fixed as' change ', indicates data change. - * @param { Callback<{sessionId: string, fields: Array}> } callback + * @param { 'change' } type - event type, fixed as' change ', indicates data change. + * @param { Callback<{ sessionId: string; fields: Array }> } callback? * indicates the observer of object data changed. * {string} sessionId - the sessionId of the changed object. * {Array} fields - changed data. @@ -288,8 +292,8 @@ declare namespace distributedDataObject { /** * On watch of status. * - * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. - * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback + * @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object. + * @param { Callback<{ sessionId: string; networkId: string; status: 'online' | 'offline' }> } callback * indicates the observer of object status changed. * {string} sessionId - the sessionId of the changed object. * {string} networkId - networkId of the changed device. @@ -309,8 +313,8 @@ declare namespace distributedDataObject { /** * Off watch of status. * - * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. - * @param { Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}> } callback + * @param { 'status' } type - event type, fixed as' status', indicates the online and offline of the object. + * @param { Callback<{ sessionId: string; deviceId: string; status: 'online' | 'offline' }> } callback? * Indicates the observer of object status changed. * {string} sessionId - the sessionId of the changed object. * {string} networkId - networkId of the changed device. diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 39942501c..c5838df72 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import { ValuesBucket } from './@ohos.data.ValuesBucket'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; import BaseContext from './application/BaseContext'; diff --git a/api/@ohos.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts index 038cc192d..87cb6a923 100644 --- a/api/@ohos.data.preferences.d.ts +++ b/api/@ohos.data.preferences.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import Context from './application/BaseContext'; /** @@ -129,6 +129,7 @@ declare namespace preferences { * the file that stores preferences data, and use movePreferencesFromCache * to remove the {@link Preferences} instance from the memory. * + * @interface Preferences * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @since 9 */ @@ -197,7 +198,7 @@ declare namespace preferences { * Checks whether the {@link Preferences} object contains a preferences matching a specified key. * * @param { string } key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty. - * @returns { Promise } {@code true} if the {@link Preferences} object contains + * @returns { Promise } {@code true} if the {@link Preferences} object contains * a preferences with the specified key; returns {@code false} otherwise. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -304,8 +305,8 @@ declare namespace preferences { /** * Registers an observer to listen for the change of a {@link Preferences} object. * - * @param { Callback } callback - indicates the callback when preferences changes. - * @param { Callback<{key: string}> } callback - Indicates the callback function. + * @param { 'change' } type - indicates the callback when preferences changes. + * @param { Callback<{ key: string }> } callback - Indicates the callback function. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @since 9 @@ -315,8 +316,8 @@ declare namespace preferences { /** * Unregisters an existing observer. * - * @param { Callback } callback - indicates the callback when preferences changes. - * @param { Callback<{key: string}> } callback - Indicates the callback function. + * @param { 'change' } type - indicates the callback when preferences changes. + * @param { Callback<{ key: string }> } callback? - Indicates the callback function. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @since 9 @@ -334,6 +335,7 @@ declare namespace preferences { * * @constant * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * @since 9 */ const MAX_KEY_LENGTH: 80; @@ -342,6 +344,7 @@ declare namespace preferences { * * @constant * @syscap SystemCapability.DistributedDataManager.Preferences.Core + * @since 9 */ const MAX_VALUE_LENGTH: 8192; } diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index c036cef0b..0aaf66780 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import { ResultSet as _ResultSet } from './data/rdb/resultSet'; import Context from './application/BaseContext'; @@ -87,6 +87,7 @@ declare namespace rdb { /** * Indicates the database synchronization mode. * + * @enum { number } * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 @@ -118,6 +119,7 @@ declare namespace rdb { * Describes the subscription type. * * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @enum { number } * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 @@ -127,6 +129,7 @@ declare namespace rdb { /** * Subscription to remote data changes * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 @@ -139,6 +142,7 @@ declare namespace rdb { * Provides methods for managing the relational database (RDB). * This class provides methods for creating, querying, updating, and deleting RDBs. * + * @interface RdbStore * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -163,7 +167,7 @@ declare namespace rdb { * * @param { string } table - Indicates the row of data to be inserted into the table. * @param { ValuesBucket } values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @returns { Promise } return the row ID if the operation is successful. return -1 otherwise. + * @returns { Promise } return the row ID if the operation is successful. return -1 otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -189,7 +193,7 @@ declare namespace rdb { * * @param { string } table - Indicates the target table. * @param { Array } values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @returns { Promise } return the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @returns { Promise } return the number of values that were inserted if the operation is successful. returns -1 otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -279,7 +283,6 @@ declare namespace rdb { * @param { string } sql - Indicates the SQL statement to execute. * @param { Array } bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. * @param { AsyncCallback } callback - * @returns { Promise } return the {@link ResultSet} object if the operation is successful. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 @@ -388,7 +391,7 @@ declare namespace rdb { * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param { string } device - Indicates the remote device. - * @param { AsyncCallback } callback - {string}: the distributed table name. + * @param { string } table - {string}: the distributed table name. * @param { AsyncCallback } callback * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -416,8 +419,8 @@ declare namespace rdb { * Sync data between devices. * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } device - Indicates the remote device. - * @param { AsyncCallback> } callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @param { SyncMode } mode - Indicates the remote device. + * @param { RdbPredicates } predicates - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. * @param { AsyncCallback> } callback * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -430,7 +433,7 @@ declare namespace rdb { * Sync data between devices. * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } device - Indicates the remote device. + * @param { SyncMode } mode - Indicates the remote device. * @param { RdbPredicates } predicates * @returns { Promise> } {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -444,9 +447,9 @@ declare namespace rdb { * Registers an observer for the database. When data in the distributed database changes, * the callback will be invoked. * - * @param { string } event - Indicates the event must be string 'dataChange'. + * @param { 'dataChange' } event - Indicates the event must be string 'dataChange'. * @param { SubscribeType } type - Indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required. - * @param { AsyncCallback> } observer - {Array}: the observer of data change events in the distributed database. + * @param { Callback> } observer - {Array}: the observer of data change events in the distributed database. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 @@ -457,9 +460,9 @@ declare namespace rdb { /** * Remove specified observer of specified type from the database. * - * @param { string } event - Indicates the event must be string 'dataChange'. + * @param { 'dataChange' } event - Indicates the event must be string 'dataChange'. * @param { SubscribeType } type - Indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required. - * @param { AsyncCallback> } observer - {Array}: the data change observer already registered. + * @param { Callback> } observer - {Array}: the data change observer already registered. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 @@ -491,6 +494,7 @@ declare namespace rdb { /** * Manages relational database configurations. * + * @interface StoreConfig * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -604,7 +608,7 @@ declare namespace rdb { * Adds an or condition to the RdbPredicates. * This method is similar to or of the SQL statement. * - * @returns Returns the {@link RdbPredicates} with the or condition. + * @returns { RdbPredicates } Returns the {@link RdbPredicates} with the or condition. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -616,7 +620,7 @@ declare namespace rdb { * Adds an and condition to the RdbPredicates. * This method is similar to or of the SQL statement. * - * @returns Returns the {@link RdbPredicates} with the or condition. + * @returns { RdbPredicates } Returns the {@link RdbPredicates} with the or condition. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -630,7 +634,7 @@ declare namespace rdb { * This method is similar to contains of the SQL statement. * * @param { string } field - Indicates the column name in the database table. - * @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - Indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 @@ -645,7 +649,7 @@ declare namespace rdb { * This method is similar to value% of the SQL statement. * * @param { string } field - Indicates the column name in the database table. - * @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - Indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 @@ -660,7 +664,7 @@ declare namespace rdb { * This method is similar to %value of the SQL statement. * * @param { string } field - Indicates the column name in the database table. - * @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - Indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 @@ -702,7 +706,7 @@ declare namespace rdb { * This method is similar to like of the SQL statement. * * @param { string } field - Indicates the column name in the database table. - * @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - Indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} that match the specified field. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 @@ -717,7 +721,7 @@ declare namespace rdb { * Different from like, the input parameters of this method are case-sensitive. * * @param { string } field - Indicates the column name in the database table. - * @param { ValueType } value - Indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - Indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the SQL statement with the specified {@link RdbPredicates}. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 diff --git a/api/@ohos.data.relationalStore.d.ts b/api/@ohos.data.relationalStore.d.ts index 4b76372a8..82f92459e 100644 --- a/api/@ohos.data.relationalStore.d.ts +++ b/api/@ohos.data.relationalStore.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import Context from './application/BaseContext'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -86,6 +86,7 @@ declare namespace relationalStore { /** * Manages relational database configurations. * + * @interface StoreConfig * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -118,6 +119,7 @@ declare namespace relationalStore { /** * Describes the {@code RdbStore} type. * + * @enum { number } * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -178,6 +180,7 @@ declare namespace relationalStore { /** * Indicates the database synchronization mode. * + * @enum { number } * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -203,6 +206,7 @@ declare namespace relationalStore { * Describes the subscription type. * * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @enum { number } * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -210,6 +214,7 @@ declare namespace relationalStore { /** * Subscription to remote data changes * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -219,6 +224,7 @@ declare namespace relationalStore { /** * Describes the conflict resolutions to insert data into the table. * + * @enum { number } * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 10 */ @@ -276,6 +282,7 @@ declare namespace relationalStore { * Provides methods for managing the relational database (RDB). * This class provides methods for creating, querying, updating, and deleting RDBs. * + * @interface RdbStore * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -331,7 +338,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @returns { Promise } the row ID if the operation is successful. return -1 otherwise. + * @returns { Promise } the row ID if the operation is successful. return -1 otherwise. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 @@ -341,7 +348,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @returns { Promise } the row ID if the operation is successful. return -1 otherwise. + * @returns { Promise } the row ID if the operation is successful. return -1 otherwise. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -355,7 +362,7 @@ declare namespace relationalStore { * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data {@link ValuesBucket} to be inserted into the table. * @param { ConflictResolution } conflict - indicates the {@link ConflictResolution} to insert data into the table. - * @returns { Promise } the row ID if the operation is successful. return -1 otherwise. + * @returns { Promise } the row ID if the operation is successful. return -1 otherwise. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -391,7 +398,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { Array } values - indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @returns { Promise } the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @returns { Promise } the number of values that were inserted if the operation is successful. returns -1 otherwise. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 @@ -401,7 +408,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { Array } values - indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @returns { Promise } the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @returns { Promise } the number of values that were inserted if the operation is successful. returns -1 otherwise. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -493,7 +500,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @param { AsyncCallback } callback - the number of affected rows. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API. @@ -507,7 +514,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @param { AsyncCallback } callback - the number of affected rows. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. @@ -529,7 +536,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @returns { Promise } the number of affected rows. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API. @@ -543,7 +550,7 @@ declare namespace relationalStore { * * @param { string } table - indicates the target table. * @param { ValuesBucket } values - indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param { DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @returns { Promise } the number of affected rows. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. @@ -601,7 +608,7 @@ declare namespace relationalStore { * Deletes data from the database based on a specified instance object of RdbPredicates. * * @param { string } table - indicates the target table. - * @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @param { AsyncCallback } callback - the number of affected rows. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API. @@ -614,7 +621,7 @@ declare namespace relationalStore { * Deletes data from the database based on a specified instance object of RdbPredicates. * * @param { string } table - indicates the target table. - * @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @param { AsyncCallback } callback - the number of affected rows. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. @@ -630,7 +637,7 @@ declare namespace relationalStore { * Deletes data from the database based on a specified instance object of RdbPredicates. * * @param { string } table - indicates the target table. - * @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @returns { Promise } the number of affected rows. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 202 - if permission verification failed, application which is not a system application uses system API. @@ -643,7 +650,7 @@ declare namespace relationalStore { * Deletes data from the database based on a specified instance object of RdbPredicates. * * @param { string } table - indicates the target table. - * @param { DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param { dataSharePredicates.DataSharePredicates } predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. * @returns { Promise } the number of affected rows. * @throws { BusinessError } 14800047 - if the WAL file size exceeds the default limit. * @throws { BusinessError } 401 - if the parameter type is incorrect. @@ -901,7 +908,7 @@ declare namespace relationalStore { * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param { string } device - indicates the remote device. - * @param { AsyncCallback } callback - {string}: the distributed table name. + * @param { string } table - {string}: the distributed table name. * @param { AsyncCallback } callback * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 801 - Capability not supported. @@ -993,9 +1000,9 @@ declare namespace relationalStore { * Registers an observer for the database. When data in the distributed database changes, * the callback will be invoked. * - * @param { string } event - indicates the event must be string 'dataChange'. + * @param { 'dataChange' } event - indicates the event must be string 'dataChange'. * @param { SubscribeType } type - indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required. - * @param { AsyncCallback> } observer - {Array}: the observer of data change events in the distributed database. + * @param { Callback> } observer - {Array}: the observer of data change events in the distributed database. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1006,9 +1013,9 @@ declare namespace relationalStore { /** * Remove specified observer of specified type from the database. * - * @param { string } event - indicates the event must be string 'dataChange'. + * @param { 'dataChange' } event - indicates the event must be string 'dataChange'. * @param { SubscribeType } type - indicates the subscription type, which is defined in {@link SubscribeType}.If its value is SUBSCRIBE_TYPE_REMOTE, ohos.permission.DISTRIBUTED_DATASYNC is required. - * @param { AsyncCallback> } observer - {Array}: the data change observer already registered. + * @param { Callback> } observer - {Array}: the data change observer already registered. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1130,7 +1137,7 @@ declare namespace relationalStore { * This method is similar to contains of the SQL statement. * * @param { string } field - indicates the column name in the database table. - * @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} self. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1144,7 +1151,7 @@ declare namespace relationalStore { * This method is similar to value% of the SQL statement. * * @param { string } field - indicates the column name in the database table. - * @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} self. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1158,7 +1165,7 @@ declare namespace relationalStore { * This method is similar to %value of the SQL statement. * * @param { string } field - indicates the column name in the database table. - * @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} self. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1196,7 +1203,7 @@ declare namespace relationalStore { * This method is similar to like of the SQL statement. * * @param { string } field - indicates the column name in the database table. - * @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the {@link RdbPredicates} that match the specified field. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1210,7 +1217,7 @@ declare namespace relationalStore { * Different from like, the input parameters of this method are case-sensitive. * * @param { string } field - indicates the column name in the database table. - * @param { ValueType } value - indicates the value to match with the {@link RdbPredicates}. + * @param { string } value - indicates the value to match with the {@link RdbPredicates}. * @returns { RdbPredicates } - the SQL statement with the specified {@link RdbPredicates}. * @throws { BusinessError } 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1401,6 +1408,7 @@ declare namespace relationalStore { /** * Provides methods for accessing a database result set generated by querying the database. * + * @interface ResultSet * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1514,7 +1522,7 @@ declare namespace relationalStore { * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * * @param { number } offset - indicates the offset relative to the current position. - * @returns { string } true if the result set is moved successfully and does not go beyond the range; + * @returns { boolean } true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. * @throws { BusinessError } 14800012 - the result set is empty or the specified location is invalid. * @throws { BusinessError } 401 - parameter error. diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index d0bfc2b9d..13b0fec29 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides interfaces to obtain and modify storage data. diff --git a/api/@ohos.deviceAttest.d.ts b/api/@ohos.deviceAttest.d.ts index 863d29f30..dea121232 100644 --- a/api/@ohos.deviceAttest.d.ts +++ b/api/@ohos.deviceAttest.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * xts_device_attest authResult information diff --git a/api/@ohos.display.d.ts b/api/@ohos.display.d.ts index 91f9e61db..27da4d141 100644 --- a/api/@ohos.display.d.ts +++ b/api/@ohos.display.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback, Callback } from './basic'; +import type { AsyncCallback, Callback } from './@ohos.base'; /** * Interface of display manager. diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts index 2fcfba00e..de2d5b782 100644 --- a/api/@ohos.distributedBundle.d.ts +++ b/api/@ohos.distributedBundle.d.ts @@ -13,48 +13,76 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { ElementName } from './bundle/elementName'; +import { AsyncCallback } from './@ohos.base'; +import { ElementName } from './bundle/elementName'; import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; /** * distributedBundle. - * @name distributedBundle - * @since 8 + * + * @namespace distributedBundle * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi Hide this for inner system use + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.distributedBundleManager */ - declare namespace distributedBundle { +declare namespace distributedBundle { /** * Obtains information about the ability info of the remote device. * - * @since 8 - * @syscap SystemCapability.BundleManager.DistributedBundleFramework - * @param elementName Indicates the elementName. - * @returns Returns the ability info of the remote device. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName Indicates the elementName. + * @param { AsyncCallback } callback + * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo */ - function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void; - function getRemoteAbilityInfo(elementName: ElementName): Promise; + function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void; + + /** + * Obtains information about the ability info of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName Indicates the elementName. + * @returns { Promise } Returns the ability info of the remote device. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo + */ + function getRemoteAbilityInfo(elementName: ElementName): Promise; /** * Obtains information about the ability infos of the remote device. * - * @since 8 - * @syscap SystemCapability.BundleManager.DistributedBundleFramework - * @param elementNames Indicates the elementNames, Maximum array length ten. - * @returns Returns the ability infos of the remote device. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames Indicates the elementNames, Maximum array length ten. + * @param { AsyncCallback> } callback + * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi + * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo */ - function getRemoteAbilityInfos(elementNames: Array, callback: AsyncCallback>): void; - function getRemoteAbilityInfos(elementNames: Array): Promise>; + function getRemoteAbilityInfos(elementNames: Array, + callback: AsyncCallback>): void; + + /** + * Obtains information about the ability infos of the remote device. + * + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames Indicates the elementNames, Maximum array length ten. + * @returns { Promise> } Returns the ability infos of the remote device. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 8 + * @deprecated since 9 + * @useinstead ohos.bundle.distributedBundleManager#getRemoteAbilityInfo + */ + function getRemoteAbilityInfos(elementNames: Array): Promise>; } -export default distributedBundle; \ No newline at end of file +export default distributedBundle; diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index e2de55463..5745e31c2 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Providers interfaces to create a {@link deviceManager} instances. diff --git a/api/@ohos.distributedMissionManager.d.ts b/api/@ohos.distributedMissionManager.d.ts index 9731c48c0..c6beb7161 100644 --- a/api/@ohos.distributedMissionManager.d.ts +++ b/api/@ohos.distributedMissionManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { ContinueCallback } from './application/ContinueCallback'; import { ContinueDeviceInfo } from './application/ContinueDeviceInfo'; import { MissionCallback } from './application/MissionCallbacks'; diff --git a/api/@ohos.document.d.ts b/api/@ohos.document.d.ts index 5c066668f..976dfb60b 100644 --- a/api/@ohos.document.d.ts +++ b/api/@ohos.document.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic' +import { AsyncCallback } from './@ohos.base' export default document; diff --git a/api/@ohos.effectKit.d.ts b/api/@ohos.effectKit.d.ts index 024760f37..179663b4b 100644 --- a/api/@ohos.effectKit.d.ts +++ b/api/@ohos.effectKit.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import image from './@ohos.multimedia.image'; /** diff --git a/api/@ohos.enterprise.accountManager.d.ts b/api/@ohos.enterprise.accountManager.d.ts index f91587784..20e3fd0fa 100644 --- a/api/@ohos.enterprise.accountManager.d.ts +++ b/api/@ohos.enterprise.accountManager.d.ts @@ -13,12 +13,12 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; -import Want from "./@ohos.app.ability.Want"; +import { AsyncCallback } from "./@ohos.base"; +import type Want from './@ohos.app.ability.Want'; /** * This module provides the capability to manage the accounts of the enterprise devices. - * @namespace accountManager. + * @namespace accountManager * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @since 10 diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts index eabb463d0..1c928fa6b 100644 --- a/api/@ohos.enterprise.adminManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./basic"; -import Want from "./@ohos.app.ability.Want"; +import { AsyncCallback} from "./@ohos.base"; +import type Want from './@ohos.app.ability.Want'; /** * This module provides the capability to manage the administrator of the enterprise devices. @@ -231,7 +231,7 @@ declare namespace adminManager { * Disables a current super administrator ability. * Only the administrator app or apps with the shell uid can call this method. * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN - * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { String } bundleName - bundleName indicates the administrator bundle information. * @param { AsyncCallback } callback - the callback of disableSuperAdmin. * @throws { BusinessError } 9200005 - failed to disable the administrator application of the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. @@ -248,7 +248,7 @@ declare namespace adminManager { * Disables a current super administrator ability. * Only the administrator app or apps with the shell uid can call this method. * @permission ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN - * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { String } bundleName - bundleName indicates the administrator bundle information. * @returns { Promise } the promise returned by the disableSuperAdmin. * @throws { BusinessError } 9200005 - failed to disable the administrator application of the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. @@ -368,7 +368,7 @@ declare namespace adminManager { /** * Get whether the ability is enabled as super device administrator. - * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { String } bundleName - bundleName indicates the administrator bundle information. * @param { AsyncCallback } callback - callback contained true if the administrator is super administrator. * @throws { BusinessError } 202 - not system application. * @throws { BusinessError } 401 - invalid input parameter. @@ -381,7 +381,7 @@ declare namespace adminManager { /** * Get whether the ability is enabled as super device administrator. - * @param { string } bundleName - bundleName indicates the administrator bundle information. + * @param { String } bundleName - bundleName indicates the administrator bundle information. * @returns { Promise } promise contained true if the administrator is super administrator. * @throws { BusinessError } 202 - not system application. * @throws { BusinessError } 401 - invalid input parameter. diff --git a/api/@ohos.enterprise.bundleManager.d.ts b/api/@ohos.enterprise.bundleManager.d.ts index 88b8882d0..9a11a15e5 100644 --- a/api/@ohos.enterprise.bundleManager.d.ts +++ b/api/@ohos.enterprise.bundleManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import type Want from './@ohos.app.ability.Want'; /** diff --git a/api/@ohos.enterprise.dateTimeManager.d.ts b/api/@ohos.enterprise.dateTimeManager.d.ts index bc25418f0..e16f089e0 100644 --- a/api/@ohos.enterprise.dateTimeManager.d.ts +++ b/api/@ohos.enterprise.dateTimeManager.d.ts @@ -13,12 +13,12 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from "./@ohos.base"; import type Want from './@ohos.app.ability.Want'; /** * This module provides the capability to manage the datetime of the enterprise devices. - * @namespace dateTimeManager. + * @namespace dateTimeManager * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @since 9 diff --git a/api/@ohos.enterprise.deviceControl.d.ts b/api/@ohos.enterprise.deviceControl.d.ts index f4683402b..e3f59697d 100644 --- a/api/@ohos.enterprise.deviceControl.d.ts +++ b/api/@ohos.enterprise.deviceControl.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./basic"; -import Want from "./@ohos.app.ability.Want"; +import { AsyncCallback, Callback } from "./@ohos.base"; +import type Want from './@ohos.app.ability.Want'; /** * This module provides the capability to control the enterprise devices. diff --git a/api/@ohos.enterprise.deviceInfo.d.ts b/api/@ohos.enterprise.deviceInfo.d.ts index 62a6f7eaf..58d49277d 100644 --- a/api/@ohos.enterprise.deviceInfo.d.ts +++ b/api/@ohos.enterprise.deviceInfo.d.ts @@ -13,12 +13,12 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; import Want from "./@ohos.app.ability.Want"; /** * This module provides the capability to manage the device info of the enterprise devices. - * @namespace deviceInfo. + * @namespace deviceInfo * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi * @since 10 diff --git a/api/@ohos.enterprise.networkManager.d.ts b/api/@ohos.enterprise.networkManager.d.ts index bda355983..0aca81ed7 100644 --- a/api/@ohos.enterprise.networkManager.d.ts +++ b/api/@ohos.enterprise.networkManager.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; -import Want from "./@ohos.app.ability.Want"; +import { AsyncCallback } from "./@ohos.base"; +import type Want from './@ohos.app.ability.Want'; /** * This module offers set network policies on the devices. diff --git a/api/@ohos.enterprise.wifiManager.d.ts b/api/@ohos.enterprise.wifiManager.d.ts index 1c58612b3..f2f6fc66b 100644 --- a/api/@ohos.enterprise.wifiManager.d.ts +++ b/api/@ohos.enterprise.wifiManager.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; -import Want from "./@ohos.app.ability.Want"; +import { AsyncCallback } from "./@ohos.base"; +import type Want from './@ohos.app.ability.Want'; /** * This module offers set wifi policies on the devices. @@ -447,7 +447,7 @@ declare namespace wifiManager { /** * Wi-Fi bssid(MAC): the length is 6 - * @type { string } + * @type { ?string } * @since 10 */ bssid?: string; @@ -461,7 +461,7 @@ declare namespace wifiManager { /** * Hide SSID or not, false(default): not hide - * @type { boolean } + * @type { ?boolean } * @since 10 */ isHiddenSsid?: boolean; @@ -475,56 +475,56 @@ declare namespace wifiManager { /** * The UID of the Wi-Fi profile creator - * @type { number } + * @type { ?number } * @since 10 */ creatorUid?: number; /** * Disable reason - * @type { number } + * @type { ?number } * @since 10 */ disableReason?: number; /** * Allocated networkId - * @type { number } + * @type { ?number } * @since 10 */ netId?: number; /** * Random mac type - * @type { number } + * @type { ?number } * @since 10 */ randomMacType?: number; /** * Random mac address, the length is 6 - * @type { string } + * @type { ?string } * @since 10 */ randomMacAddr?: string; /** * IP Type - * @type { IpType } + * @type { ?IpType } * @since 10 */ ipType?: IpType; /** * IP profile of static - * @type { IpProfile } + * @type { ?IpProfile } * @since 10 */ staticIp?: IpProfile; /** * EAP profile info. - * @type { WifiEapProfile } + * @type { ?WifiEapProfile } * @since 10 */ eapProfile?: WifiEapProfile; diff --git a/api/@ohos.events.emitter.d.ts b/api/@ohos.events.emitter.d.ts index 6fbe9037b..62767aac6 100644 --- a/api/@ohos.events.emitter.d.ts +++ b/api/@ohos.events.emitter.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Callback } from './basic'; +import { Callback } from './@ohos.base'; /** * Provides methods for sending and processing in-process events. diff --git a/api/@ohos.faultLogger.d.ts b/api/@ohos.faultLogger.d.ts index 5c3a49859..8ec801a94 100644 --- a/api/@ohos.faultLogger.d.ts +++ b/api/@ohos.faultLogger.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; /** * This module provides the capability to query faultlog data. diff --git a/api/@ohos.file.backup.d.ts b/api/@ohos.file.backup.d.ts index 93dcca76e..cc50396b9 100644 --- a/api/@ohos.file.backup.d.ts +++ b/api/@ohos.file.backup.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback, Callback } from './basic'; +import type { AsyncCallback, Callback } from './@ohos.base'; /** * Module providing backup and restore capabilities. diff --git a/api/@ohos.file.cloudSyncManager.d.ts b/api/@ohos.file.cloudSyncManager.d.ts index 09c15a67e..c7125e2c0 100644 --- a/api/@ohos.file.cloudSyncManager.d.ts +++ b/api/@ohos.file.cloudSyncManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; /** * This module provides the capabilities to manage the state and data of cloud file synchronization. diff --git a/api/@ohos.file.environment.d.ts b/api/@ohos.file.environment.d.ts index 7d72196cb..97f070e3d 100644 --- a/api/@ohos.file.environment.d.ts +++ b/api/@ohos.file.environment.d.ts @@ -1,56 +1,79 @@ /* -* Copyright (C) 2021-2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import { AsyncCallback } from "./basic"; +import type { AsyncCallback } from "./@ohos.base"; /** * Provides Environment APIs. * - * @since 8 + * @namespace Environment * @syscap SystemCapability.FileManagement.File.Environment * @systemapi + * @since 8 */ declare namespace Environment { /** * Get the user data path. * - * @since 8 + * @returns { Promise } return Promise + * @throws { BusinessError } 202 - The caller is not a system application + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.Environment * @systemapi - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 202 - The caller is not a system application - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900042 - Unknown error + * @since 8 */ function getStorageDataDir(): Promise; + + /** + * Get the user data path. + * + * @param { AsyncCallback } [callback] - callback + * @throws { BusinessError } 202 - The caller is not a system application + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.Environment + * @systemapi + * @since 8 + */ function getStorageDataDir(callback: AsyncCallback): void; /** * Get the User storage path. * - * @since 8 + * @returns { Promise } return Promise + * @throws { BusinessError } 202 - The caller is not a system application + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.Environment * @systemapi - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 202 - The caller is not a system application - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900042 - Unknown error + * @since 8 */ function getUserDataDir(): Promise; + + /** + * Get the User storage path. + * + * @param { AsyncCallback } [callback] - callback + * @throws { BusinessError } 202 - The caller is not a system application + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.Environment + * @systemapi + * @since 8 + */ function getUserDataDir(callback: AsyncCallback): void; } diff --git a/api/@ohos.file.fileAccess.d.ts b/api/@ohos.file.fileAccess.d.ts index 89defc42e..bb93b8b74 100644 --- a/api/@ohos.file.fileAccess.d.ts +++ b/api/@ohos.file.fileAccess.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./basic"; +import { AsyncCallback, Callback } from "./@ohos.base"; import Want from './@ohos.app.ability.Want'; import Context from './application/Context'; import { Filter } from './@ohos.file.fs'; @@ -539,6 +539,21 @@ declare namespace fileAccess { next(): {value: RootInfo, done: boolean} } + /** + * CopyResult describe the return information of the copy operation. + * + * @permission ohos.permission.FILE_ACCESS_MANAGER + * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi + * @since 10 + */ + interface CopyResult { + sourceUri: string; + destUri: string; + errCode: number; + errMsg: string; + } + /** * OPENFLAGS represents the way to open the file. * @since 9 @@ -880,6 +895,47 @@ declare namespace fileAccess { move(sourceFile: string, destFile: string) : Promise; move(sourceFile: string, destFile: string, callback: AsyncCallback) : void; + /** + * Copy file or directory in the promise way. + * + * @permission ohos.permission.FILE_ACCESS_MANAGER + * @param { string } sourceUri - Indicates the file or directory to be copied. + * @param { string } destUri - Represents the destination directory. + * @param { boolean } force - Optional parameter that determines whether to forcibly copy files. + * @returns { Promise } Returns the file information where the error occurred. + * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi + * @since 10 + */ + copy(sourceUri: string, destUri: string, force?: boolean): Promise>; + + /** + * Copy file or directory in the asyncCallback way. + * + * @permission ohos.permission.FILE_ACCESS_MANAGER + * @param { string } sourceUri - Indicates the file or directory to be copied. + * @param { string } destUri - Represents the destination directory. + * @param { AsyncCallback } callback - The callback is used to return the file information where the error occurred. + * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi + * @since 10 + */ + copy(sourceUri: string, destUri: string, callback: AsyncCallback>): void; + + /** + * Copy file or directory in the asyncCallback way. + * + * @permission ohos.permission.FILE_ACCESS_MANAGER + * @param { string } sourceUri - Indicates the file or directory to be copied. + * @param { string } destUri - Represents the destination directory. + * @param { boolean } force - Determines whether to forcibly copy files. + * @param { AsyncCallback } callback - The callback is used to return the file information where the error occurred. + * @syscap SystemCapability.FileManagement.UserFileService + * @systemapi + * @since 10 + */ + copy(sourceUri: string, destUri: string, force: boolean, callback: AsyncCallback>): void; + /** * Rename the selected file or directory. * diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts index 0ed4a562e..793c2085d 100644 --- a/api/@ohos.file.fs.d.ts +++ b/api/@ohos.file.fs.d.ts @@ -12,12 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic' +import { AsyncCallback } from './@ohos.base'; export default fileIo; /** * FileIO + * + * @namespace fileIo * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ @@ -45,8 +47,9 @@ declare namespace fileIo { export { mkdirSync }; export { mkdtemp }; export { mkdtempSync }; - export { moveFile } - export { moveFileSync } + export { moveDir }; + export { moveFile }; + export { moveFileSync }; export { open }; export { openSync }; export { read }; @@ -75,635 +78,905 @@ declare namespace fileIo { /** * Mode Indicates the open flags. - * @since 9 + * + * @namespace OpenMode * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 */ namespace OpenMode { - const READ_ONLY = 0o0; // Read only Permission - const WRITE_ONLY = 0o1; // Write only Permission - const READ_WRITE = 0o2; // Write and Read Permission - const CREATE = 0o100; // If not exist, create file - const TRUNC = 0o1000; // File truncate len 0 - const APPEND = 0o2000; // File append write - const NONBLOCK = 0o4000; // File open in nonblocking mode - const DIR = 0o200000; // File is Dir - const NOFOLLOW = 0o400000; // File is not symbolic link - const SYNC = 0o4010000; // SYNC IO + const READ_ONLY = 0o0; // Read only Permission + const WRITE_ONLY = 0o1; // Write only Permission + const READ_WRITE = 0o2; // Write and Read Permission + const CREATE = 0o100; // If not exist, create file + const TRUNC = 0o1000; // File truncate len 0 + const APPEND = 0o2000; // File append write + const NONBLOCK = 0o4000; // File open in nonblocking mode + const DIR = 0o200000; // File is Dir + const NOFOLLOW = 0o400000; // File is not symbolic link + const SYNC = 0o4010000; // SYNC IO } } /** * Access file. * + * @param { string } path - path. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error */ declare function access(path: string): Promise; + +/** + * Access file. + * + * @param { string } path - path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function access(path: string, callback: AsyncCallback): void; /** * Access file with sync interface. + * + * @param { string } path - path. + * @returns { boolean } access success + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @returns {boolean} access success - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error */ declare function accessSync(path: string): boolean; /** * Close file or fd. * + * @param { number | File } file - file object or fd. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number | File} file - file object or fd. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function close(file: number | File): Promise; + +/** + * Close file or fd. + * + * @param { number | File } file - file object or fd. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function close(file: number | File, callback: AsyncCallback): void; /** * Close file or fd with sync interface. * + * @param { number | File } file - file object or fd. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @permission N/A - * @param {number | File} file - file object or fd. - * @returns {void} close success - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ -declare function closeSync(fd: number | File): void; +declare function closeSync(file: number | File): void; /** * Copy file. * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string | number} src - src. - * @param {string | number} dest - dest. - * @param {number} [mode = 0] - mode. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ declare function copyFile(src: string | number, dest: string | number, mode?: number): Promise; + +/** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function copyFile(src: string | number, dest: string | number, callback: AsyncCallback): void; -declare function copyFile(src: string | number, dest: string | number, mode: number, callback: AsyncCallback): void; + +/** + * Copy file. + * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function copyFile( + src: string | number, + dest: string | number, + mode: number, + callback: AsyncCallback +): void; /** * Copy file with sync interface. * + * @param { string | number } src - src. + * @param { string | number } dest - dest. + * @param { number } [mode = 0] - mode. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string | number} src - src. - * @param {string | number} dest - dest. - * @param {number} [mode = 0] - mode. - * @returns {void} copyFile success - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ declare function copyFileSync(src: string | number, dest: string | number, mode?: number): void; /** * Create class Stream. * + * @param { string } path - path. + * @param { string } mode - mode. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {string} mode - mode. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return Stream - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function createStream(path: string, mode: string): Promise; + +/** + * Create class Stream. + * + * @param { string } path - path. + * @param { string } mode - mode. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function createStream(path: string, mode: string, callback: AsyncCallback): void; /** * Create class Stream with sync interface. * + * @param { string } path - path. + * @param { string } mode - mode. + * @returns { Stream } createStream + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {string} mode - mode. - * @returns {Stream} createStream - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function createStreamSync(path: string, mode: string): Stream; /** * Create watcher to listen for file changes. * + * @param { string } path - path. + * @param { number } events - listened events. + * @param { WatchEventListener } listener - Callback to invoke when an event of the specified type occurs. + * @returns { Watcher } Return watcher object. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 - * @param {string} path - path. - * @param {number} events - listened events. - * @param {WatchEventListener} listener - Callback to invoke when an event of the specified type occurs. - * @returns {Watcher} Return watcher object. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900042 - Unknown error */ declare function createWatcher(path: string, events: number, listener: WatchEventListener): Watcher; /** * Synchronize file metadata. * + * @param { number } fd - fd. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - fd. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function fdatasync(fd: number): Promise; + +/** + * Synchronize file metadata. + * + * @param { number } fd - fd. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function fdatasync(fd: number, callback: AsyncCallback): void; /** * Synchronize file metadata with sync interface. * + * @param { number } fd - fd. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - fd. - * @returns {void} fdatasync success - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function fdatasyncSync(fd: number): void; /** * Create class Stream by using fd. + * + * @param { number } fd - fd. + * @param { string } mode - mode. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - fd. - * @param {string} mode - mode. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function fdopenStream(fd: number, mode: string): Promise; + +/** + * Create class Stream by using fd. + * + * @param { number } fd - fd. + * @param { string } mode - mode. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; /** * Create class Stream by using fd with sync interface. + * + * @param { number } fd - fd. + * @param { string } mode - mode. + * @returns { Stream } open stream from fd + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - fd. - * @param {string} mode - mode. - * @returns {Stream} open stream from fd - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ + */ declare function fdopenStreamSync(fd: number, mode: string): Stream; /** * Synchronize file. * + * @param { number } fd - fd. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - fd. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function fsync(fd: number): Promise; + +/** + * Synchronize file. + * + * @param { number } fd - fd. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function fsync(fd: number, callback: AsyncCallback): void; /** * Synchronize file with sync interface. * + * @param { number } fd - fd. + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - fd. - * @returns {void} fsync success - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function fsyncSync(fd: number): void; /** * List file. * + * @param { string } path - path. + * @param { Object } [options] - options. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {Object} [options] - options. - * @param {boolean} [options.recursion = false] - whether to list recursively - * @param {number} [options.listNum = 0] - the number of listing file. - * @param {Filter} [options.filter] - file filter. - * @returns {Promise} return Promise - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error */ -declare function listFile(path: string, options?: { +declare function listFile( + path: string, + options?: { recursion?: boolean; listNum?: number; filter?: Filter; -}): Promise; + } +): Promise; /** * List file. * + * @param { string } path - path. + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {Object} [options] - options. - * @param {boolean} [options.recursion = false] - whether to list recursively - * @param {number} [options.listNum = 0] - the number of listing file. - * @param {Filter} [options.filter] - file filter. - * @param {AsyncCallback} callback - callback. - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error */ declare function listFile(path: string, callback: AsyncCallback): void; -declare function listFile(path: string, options: { + +/** + * List file. + * + * @param { string } path - path. + * @param { Object } [options] - options. + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function listFile( + path: string, + options: { recursion?: boolean; listNum?: number; filter?: Filter; -}, callback: AsyncCallback): void; + }, + callback: AsyncCallback +): void; /** * List file with sync interface. * + * @param { string } path - path. + * @param { Object } [options] - options. + * @returns { string[] } array of file name + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {Object} [options] - options. - * @param {boolean} [options.recursion = false] - whether to list recursively - * @param {number} [options.listNum = 0] - the number of listing file. - * @param {Filter} [options.filter] - file filter. - * @returns {string[]} array of file name - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900042 - Unknown error */ -declare function listFileSync(path: string, options?: { +declare function listFileSync( + path: string, + options?: { recursion?: boolean; listNum?: number; filter?: Filter; -}): string[]; + } +): string[]; /** * Stat link file. * + * @param { string } path - path. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ declare function lstat(path: string): Promise; + +/** + * Stat link file. + * + * @param { string } path - path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function lstat(path: string, callback: AsyncCallback): void; /** * Stat link file with sync interface. * + * @param { string } path - path. + * @returns { Stat } lstat success + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @returns {Stat} lstat success - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ declare function lstatSync(path: string): Stat; - + /** * Make dir. * + * @param { string } path - path. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function mkdir(path: string): Promise; + +/** + * Make dir. + * + * @param { string } path - path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function mkdir(path: string, callback: AsyncCallback): void; /** * Make dir with sync interface. * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @returns {void} mkdir success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function mkdirSync(path: string): void; /** * Make temp dir. * + * @param { string } prefix - dir prefix. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} prefix - dir prefix. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function mkdtemp(prefix: string): Promise; + +/** + * Make temp dir. + * + * @param { string } prefix - dir prefix. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function mkdtemp(prefix: string, callback: AsyncCallback): void; /** * Make temp dir with sync interface. * + * @param { string } prefix - dir prefix. + * @returns { string } directory name + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} prefix - dir prefix. - * @returns {string} directory name - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function mkdtempSync(prefix: string): string; /** - * Move file. + * Move directory. * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 * @param {string} src - source file path. * @param {string} dest - destination file path. * @param {number} [mode = 0] - move mode when duplicate file name exists. @@ -716,7 +989,7 @@ declare function mkdtempSync(prefix: string): string; * @throws { BusinessError } 13900013 - Bad address * @throws { BusinessError } 13900014 - Device or resource busy * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900015 - Cross-device link + * @throws { BusinessError } 13900016 - Cross-device link * @throws { BusinessError } 13900018 - Not a directory * @throws { BusinessError } 13900019 - Is a directory * @throws { BusinessError } 13900020 - Invalid argument @@ -727,17 +1000,16 @@ declare function mkdtempSync(prefix: string): string; * @throws { BusinessError } 13900033 - Too many symbolic links encountered * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 */ -declare function moveFile(src: string, dest: string, mode?: number): Promise; +declare function moveDir(src: string, dest: string, mode?: number): Promise; /** - * Move file. + * Move directory. * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 * @param {string} src - source file path. * @param {string} dest - destination file path. - * @param {number} [mode = 0] - move mode when duplicate file name exists. * @param {AsyncCallback} callback - callback. * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory @@ -758,19 +1030,18 @@ declare function moveFile(src: string, dest: string, mode?: number): Promise): void; -declare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; +declare function moveDir(src: string, dest: string, callback: AsyncCallback): void; /** - * Move file with sync interface. + * Move directory. * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 * @param {string} src - source file path. * @param {string} dest - destination file path. - * @param {number} [mode = 0] - move mode when duplicate file name exists. - * @returns {void} move success + * @param {number} mode - move mode when duplicate file name exists. + * @param {AsyncCallback} callback - callback. * @throws { BusinessError } 13900001 - Operation not permitted * @throws { BusinessError } 13900002 - No such file or directory * @throws { BusinessError } 13900008 - Bad file descriptor @@ -790,1024 +1061,1670 @@ declare function moveFile(src: string, dest: string, mode: number, callback: Asy * @throws { BusinessError } 13900033 - Too many symbolic links encountered * @throws { BusinessError } 13900041 - Quota exceeded * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 10 + */ +declare function moveDir(src: string, dest: string, mode: number, callback: AsyncCallback): void; + +/** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function moveFile(src: string, dest: string, mode?: number): Promise; + +/** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function moveFile(src: string, dest: string, callback: AsyncCallback): void; + +/** + * Move file. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function moveFile(src: string, dest: string, mode: number, callback: AsyncCallback): void; + +/** + * Move file with sync interface. + * + * @param { string } src - source file path. + * @param { string } dest - destination file path. + * @param { number } [mode = 0] - move mode when duplicate file name exists. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 */ declare function moveFileSync(src: string, dest: string, mode?: number): void; /** * Open file. * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {number} [mode = OpenMode.READ_ONLY] - mode. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function open(path: string, mode?: number): Promise; + +/** + * Open file. + * + * @param { string } path - path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function open(path: string, callback: AsyncCallback): void; + +/** + * Open file. + * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function open(path: string, mode: number, callback: AsyncCallback): void; /** * Open file with sync interface. * + * @param { string } path - path. + * @param { number } [mode = OpenMode.READ_ONLY] - mode. + * @returns { File } open fd + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {number} [mode = OpenMode.READ_ONLY] - mode. - * @returns {File} open fd - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900006 - No such device or address - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900017 - No such device - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900029 - Resource deadlock would occur - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function openSync(path: string, mode?: number): File; /** * Read file. * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { Object } [options] - options. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - file descriptor. - * @param {ArrayBuffer} buffer - file descriptor. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.length = 0] - length. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error */ -declare function read(fd: number, buffer: ArrayBuffer, options?: { +declare function read( + fd: number, + buffer: ArrayBuffer, + options?: { offset?: number; length?: number; -}): Promise; + } +): Promise; + +/** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; -declare function read(fd: number, buffer: ArrayBuffer, options: { + +/** + * Read file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { Object } [options] - options. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function read( + fd: number, + buffer: ArrayBuffer, + options: { offset?: number; length?: number; -}, callback: AsyncCallback): void; + }, + callback: AsyncCallback +): void; /** * Read file with sync interface. * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer } buffer - buffer. + * @param { Object } [options] - options. + * @returns { number } number of bytesRead + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - file descriptor. - * @param {ArrayBuffer} buffer - file descriptor. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.length = 0] - length. - * @returns {number} number of bytesRead - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error */ -declare function readSync(fd: number, buffer: ArrayBuffer, options?: { +declare function readSync( + fd: number, + buffer: ArrayBuffer, + options?: { offset?: number; length?: number; -}): number; + } +): number; /** * Read text. * + * @param { string } filePath - file path. + * @param { Object } [options] - options. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} filePath - file path. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset in bytes. - * @param {number} [options.length = 0] - length in bytes. - * @param {number} [options.encoding = 'utf-8'] - encoding. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ +declare function readText( + filePath: string, + options?: { + offset?: number; + length?: number; + encoding?: string; + } +): Promise; -declare function readText(filePath: string, options?: { - offset?: number; - length?: number; - encoding?: string; -}): Promise; +/** + * Read text. + * + * @param { string } filePath - file path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function readText(filePath: string, callback: AsyncCallback): void; -declare function readText(filePath: string, options: { + +/** + * Read text. + * + * @param { string } filePath - file path. + * @param { Object } [options] - options. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function readText( + filePath: string, + options: { offset?: number; length?: number; encoding?: string; -}, callback: AsyncCallback): void; + }, + callback: AsyncCallback +): void; /** * Read text with sync interface. * + * @param { string } filePath - file path. + * @param { Object } [options] - options. + * @returns { string } readout result + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} filePath - file path. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset in bytes. - * @param {number} [options.length = 0] - length in bytes. - * @param {number} [options.encoding = 'utf-8'] - encoding. - * @returns {string} readout result - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ -declare function readTextSync(filePath: string, options?: { +declare function readTextSync( + filePath: string, + options?: { offset?: number; length?: number; encoding?: string; -}): string; + } +): string; /** * Rename file. * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} oldPath - oldPath. - * @param {string} newPath - newPath. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900015 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function rename(oldPath: string, newPath: string): Promise; + +/** + * Rename file. + * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; /** * Rename file with sync interface. * + * @param { string } oldPath - oldPath. + * @param { string } newPath - newPath. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900016 - Cross-device link + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900028 - Too many links + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} oldPath - oldPath. - * @param {string} newPath - newPath. - * @returns {void} rename success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900015 - Cross-device link - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900028 - Too many links - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ + */ declare function renameSync(oldPath: string, newPath: string): void; /** * Delete dir. * + * @param { string } path - path. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error */ declare function rmdir(path: string): Promise; + +/** + * Delete dir. + * + * @param { string } path - path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function rmdir(path: string, callback: AsyncCallback): void; /** * Delete dir with sync interface. * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system1 + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900032 - Directory not empty + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @returns {void} rmdir success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system1 - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900032 - Directory not empty - * @throws { BusinessError } 13900042 - Unknown error - */ + */ declare function rmdirSync(path: string): void; /** * Get file information. - * @static + * + * @param { string | number } file - path or file descriptor. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string | number} file - path or file descriptor. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ declare function stat(file: string | number): Promise; + +/** + * Get file information. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function stat(file: string | number, callback: AsyncCallback): void; /** * Get file information with sync interface. - * @static + * + * @param { string | number } file - path or file descriptor. + * @returns { Stat } stat success + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string | number} file - path or file descriptor. - * @returns {Stat} stat success - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ declare function statSync(file: string | number): Stat; /** * Link file. * + * @param { string } target - target. + * @param { string } srcPath - srcPath. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} target - target. - * @param {string} srcPath - srcPath. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ declare function symlink(target: string, srcPath: string): Promise; + +/** + * Link file. + * + * @param { string } target - target. + * @param { string } srcPath - srcPath. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function symlink(target: string, srcPath: string, callback: AsyncCallback): void; /** * Link file with sync interface. * + * @param { string } target - target. + * @param { string } srcPath - srcPath. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} target - target. - * @param {string} srcPath - srcPath. - * @returns {void} symlink success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ + */ declare function symlinkSync(target: string, srcPath: string): void; /** * Truncate file. * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string | number} file - path or file descriptor. - * @param {number} [len = 0] - len. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error */ declare function truncate(file: string | number, len?: number): Promise; + +/** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function truncate(file: string | number, callback: AsyncCallback): void; + +/** + * Truncate file. + * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function truncate(file: string | number, len: number, callback: AsyncCallback): void; /** * Truncate file with sync interface. * + * @param { string | number } file - path or file descriptor. + * @param { number } [len = 0] - len. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string | number} file - path or file descriptor. - * @param {number} [len = 0] - len. - * @returns {void} truncate success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900023 - Text file busy - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error */ declare function truncateSync(file: string | number, len?: number): void; /** * Delete file. * + * @param { string } path - path. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error */ declare function unlink(path: string): Promise; + +/** + * Delete file. + * + * @param { string } path - path. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function unlink(path: string, callback: AsyncCallback): void; /** * Delete file with sync interface. * + * @param { string } path - path. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path. - * @returns {void} unlink success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900014 - Device or resource busy - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900027 - Read-only file system - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900042 - Unknown error */ declare function unlinkSync(path: string): void; /** * Write file. * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { Object } [options] - options. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - file descriptor. - * @param {ArrayBuffer | string} buffer - file descriptor. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.length = 0] - length. - * @param {string} [options.encoding = 'utf-8'] - encoding. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ -declare function write(fd: number, buffer: ArrayBuffer | string, options?: { +declare function write( + fd: number, + buffer: ArrayBuffer | string, + options?: { offset?: number; length?: number; encoding?: string; -}): Promise; + } +): Promise; + +/** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ declare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; -declare function write(fd: number, buffer: ArrayBuffer | string, options: { + +/** + * Write file. + * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { Object } [options] - options. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare function write( + fd: number, + buffer: ArrayBuffer | string, + options: { offset?: number; length?: number; encoding?: string; -}, callback: AsyncCallback): void; + }, + callback: AsyncCallback +): void; /** * Write file with sync interface. * + * @param { number } fd - file descriptor. + * @param { ArrayBuffer | string } buffer - buffer. + * @param { Object } [options] - options. + * @returns { number } on success number of bytesRead + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {number} fd - file descriptor. - * @param {ArrayBuffer | string} buffer - file descriptor. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.length = 0] - length. - * @param {string} [options.encoding = 'utf-8'] - encoding. - * @returns {number} on success number of bytesRead - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ -declare function writeSync(fd: number, buffer: ArrayBuffer | string, options?: { +declare function writeSync( + fd: number, + buffer: ArrayBuffer | string, + options?: { offset?: number; length?: number; encoding?: string; -}): number; + } +): number; /** * File object. + * + * @interface File * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ declare interface File { - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - */ - readonly fd: number; + /** + * @type { number } + * @readonly + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly fd: number; - /** - * Lock file with blocking method. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {boolean} exclusive - whether lock is exclusive. - * @returns {Promise} return Promise - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available - */ - lock(exclusive?: boolean): Promise; + /** + * Lock file with blocking method. + * + * @param { boolean } exclusive - whether lock is exclusive. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + lock(exclusive?: boolean): Promise; - /** - * Lock file with blocking method. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {boolean} exclusive - whether lock is exclusive. - * @param {AsyncCallback} callback - callback. - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available - */ - lock(callback: AsyncCallback): void; - lock(exclusive: boolean, callback: AsyncCallback): void; + /** + * Lock file with blocking method. + * + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + lock(callback: AsyncCallback): void; - /** - * Try to lock file with returning results immediately. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {boolean} exclusive - whether lock is exclusive. - * @returns {void} tryLock success - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available - */ - tryLock(exclusive?: boolean): void; + /** + * Lock file with blocking method. + * + * @param { boolean } exclusive - whether lock is exclusive. + * @param { AsyncCallback } callback - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + lock(exclusive: boolean, callback: AsyncCallback): void; - /** - * Unlock file. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {void} unlock success - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900043 - No record locks available - */ - unlock(): void; + /** + * Try to lock file with returning results immediately. + * + * @param { boolean } exclusive - whether lock is exclusive. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + tryLock(exclusive?: boolean): void; + + /** + * Unlock file. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900043 - No record locks available + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + unlock(): void; } /** * Stat object. + * + * @interface Stat * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ declare interface Stat { - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly ino: bigint; - /** - * @type {bigint} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly mode: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly uid: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly gid: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly size: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly atime: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly mtime: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @readonly - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - readonly ctime: number; - /** - * Whether path/fd is block device. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isBlockDevice(): boolean; - /** - * Whether path/fd is character device. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isCharacterDevice(): boolean; - /** - * Whether path/fd is directory. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isDirectory(): boolean; - /** - * Whether path/fd is fifo. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isFIFO(): boolean; - /** - * Whether path/fd is file. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isFile(): boolean; - /** - * Whether path/fd is socket. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isSocket(): boolean; - /** - * Whether path/fd is symbolic link. - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {boolean} is or not - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900042 - Unknown error - */ - isSymbolicLink(): boolean; + /** + * @type { bigint } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly ino: bigint; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly mode: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly uid: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly gid: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly size: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly atime: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly mtime: number; + /** + * @type { number } + * @readonly + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readonly ctime: number; + /** + * Whether path/fd is block device. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isBlockDevice(): boolean; + /** + * Whether path/fd is character device. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isCharacterDevice(): boolean; + /** + * Whether path/fd is directory. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isDirectory(): boolean; + /** + * Whether path/fd is fifo. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isFIFO(): boolean; + /** + * Whether path/fd is file. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isFile(): boolean; + /** + * Whether path/fd is socket. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isSocket(): boolean; + /** + * Whether path/fd is symbolic link. + * + * @returns { boolean } is or not + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + isSymbolicLink(): boolean; } /** * Stream object + * + * @interface Stream * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ declare interface Stream { - /** - * Close stream. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} close success - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - * - */ - close(): Promise; - close(callback: AsyncCallback): void; + /** + * Close stream. + * + * @returns { Promise } return Promise + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + close(): Promise; - /** - * Close stream with sync interface. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {void} close success - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ - closeSync(): void; - /** - * Flush stream. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ - flush(): Promise; - flush(callback: AsyncCallback): void; - /** - * Flush stream with sync interface. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @returns {void} flush success - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ - flushSync(): void; - /** - * Write stream. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {ArrayBuffer | string} buffer - file description. - * @param {Object} [options] - options. - * @param {number} [options.length = 0] - length(bytes) ignored when buffer is string. - * @param {number} [options.offset = 0] - offset(bytes) where start to write < 0 use read, else use pread. - * @param {string} [options.encoding = 'utf-8'] - encoding. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ - write(buffer: ArrayBuffer | string, options?: { - offset?: number; - length?: number; - encoding?: string; - }): Promise; - write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; - write(buffer: ArrayBuffer | string, options: { - offset?: number; - length?: number; - encoding?: string; - }, callback: AsyncCallback): void; - /** - * Write stream with sync interface. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {ArrayBuffer | string} buffer - file description. - * @param {Object} [options] - options. - * @param {number} [options.length = 0] - length(bytes) ignored when buffer is string. - * @param {number} [options.offset = 0] - offset(bytes) where start to write < 0 use read, else use pread. - * @param {string} [options.encoding = 'utf-8'] - encoding. - * @returns {number} on success number of bytes written - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900024 - File too large - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error - */ - writeSync(buffer: ArrayBuffer | string, options?: { - offset?: number; - length?: number; - encoding?: string; - }): number; - /** - * Read stream. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {ArrayBuffer} buffer - file description. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.length = 0] - length. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - */ - read(buffer: ArrayBuffer, options?: { - offset?: number; - length?: number; - }): Promise; - read(buffer: ArrayBuffer, callback: AsyncCallback): void; - read(buffer: ArrayBuffer, options: { - offset?: number; - length?: number; - }, callback: AsyncCallback): void; + /** + * Close stream. + * + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + close(callback: AsyncCallback): void; - /** - * Read stream with sync interface. - * - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {ArrayBuffer} buffer - file description. - * @param {Object} [options] - options. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.length = 0] - length. - * @returns {number} number of bytesRead - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900010 - Try again - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900019 - Is a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900034 - Operation would block - * @throws { BusinessError } 13900042 - Unknown error - */ - readSync(buffer: ArrayBuffer, options?: { - offset?: number; - length?: number; - }): number; + /** + * Close stream with sync interface. + * + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + closeSync(): void; + /** + * Flush stream. + * + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + flush(): Promise; + + /** + * Flush stream. + * + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + flush(callback: AsyncCallback): void; + /** + * Flush stream with sync interface. + * + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + flushSync(): void; + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { Object } [options] - options. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + write( + buffer: ArrayBuffer | string, + options?: { + offset?: number; + length?: number; + encoding?: string; + } + ): Promise; + + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + write(buffer: ArrayBuffer | string, callback: AsyncCallback): void; + + /** + * Write stream. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { Object } [options] - options. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + write( + buffer: ArrayBuffer | string, + options: { + offset?: number; + length?: number; + encoding?: string; + }, + callback: AsyncCallback + ): void; + /** + * Write stream with sync interface. + * + * @param { ArrayBuffer | string } buffer - buffer. + * @param { Object } [options] - options. + * @returns { number } on success number of bytes written + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + writeSync( + buffer: ArrayBuffer | string, + options?: { + offset?: number; + length?: number; + encoding?: string; + } + ): number; + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { Object } [options] - options. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + read( + buffer: ArrayBuffer, + options?: { + offset?: number; + length?: number; + } + ): Promise; + + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + read(buffer: ArrayBuffer, callback: AsyncCallback): void; + + /** + * Read stream. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { Object } [options] - options. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + read( + buffer: ArrayBuffer, + options: { + offset?: number; + length?: number; + }, + callback: AsyncCallback + ): void; + + /** + * Read stream with sync interface. + * + * @param { ArrayBuffer } buffer - buffer. + * @param { Object } [options] - options. + * @returns { number } number of bytesRead + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + readSync( + buffer: ArrayBuffer, + options?: { + offset?: number; + length?: number; + } + ): number; } /** * Implements watcher event listening. - * + * + * @interface WatchEventListener * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 @@ -1815,18 +2732,19 @@ declare interface Stream { export interface WatchEventListener { /** * Specifies the callback function to be invoked. - * + * + * @param { WatchEvent } event - Event type for the callback to invoke. * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 - * @param event Event type for the callback to invoke. */ (event: WatchEvent): void; } /** * Event Listening. - * + * + * @interface WatchEvent * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 @@ -1834,16 +2752,20 @@ export interface WatchEventListener { export interface WatchEvent { /** * File name. - * + * + * @type { string } + * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 */ readonly fileName: string; - + /** * Event happened. - * + * + * @type { number } + * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 @@ -1852,7 +2774,9 @@ export interface WatchEvent { /** * Associated rename event. - * + * + * @type { number } + * @readonly * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 @@ -1862,7 +2786,8 @@ export interface WatchEvent { /** * Watcher object - * + * + * @interface Watcher * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 @@ -1870,103 +2795,96 @@ export interface WatchEvent { export interface Watcher { /** * Start watcher. - * + * + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 - * @returns {void} start watcher success - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900042 - Unknown error */ start(): void; /** * Stop watcher. * + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900021 - File table overflow + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @systemapi * @since 10 - * @returns {void} stop watcher success - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900021 - File table overflow - * @throws { BusinessError } 13900022 - Too many open files - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900042 - Unknown error */ stop(): void; } /** - * File filter type + * File filter type + * * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ export type Filter = { - /** - * @type {Array} - * @syscap SystemCapability.FileManagement.File.FileIO - * @systemapi - * @since 9 - * @readonly - */ - suffix?: Array; - /** - * @type {Array} - * @syscap SystemCapability.FileManagement.File.FileIO - * @systemapi - * @since 9 - * @readonly - */ - displayName?: Array; - /** - * @type {Array} - * @syscap SystemCapability.FileManagement.File.FileIO - * @systemapi - * @since 9 - * @readonly - */ - mimeType?: Array; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @systemapi - * @since 9 - * @readonly - */ - fileSizeOver?: number; - /** - * @type {number} - * @syscap SystemCapability.FileManagement.File.FileIO - * @systemapi - * @since 9 - * @readonly - */ - lastModifiedAfter?: number; - /** - * @type {boolean} - * @syscap SystemCapability.FileManagement.File.FileIO - * @systemapi - * @since 9 - * @readonly - */ - excludeMedia?: boolean; -} + /** + * @type { Array } + * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi + * @since 9 + */ + suffix?: Array; + /** + * @type { Array } + * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi + * @since 9 + */ + displayName?: Array; + /** + * @type { Array } + * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi + * @since 9 + */ + mimeType?: Array; + /** + * @type { number } + * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi + * @since 9 + */ + fileSizeOver?: number; + /** + * @type { number } + * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi + * @since 9 + */ + lastModifiedAfter?: number; + /** + * @type { boolean } + * @syscap SystemCapability.FileManagement.File.FileIO + * @systemapi + * @since 9 + */ + excludeMedia?: boolean; +}; diff --git a/api/@ohos.file.hash.d.ts b/api/@ohos.file.hash.d.ts index 563b89ab8..36e762e12 100644 --- a/api/@ohos.file.hash.d.ts +++ b/api/@ohos.file.hash.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,29 +12,41 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic' +import type { AsyncCallback } from './@ohos.base' /** * Hash + * + * @namespace hash * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 */ declare namespace hash { - /** - * Hash file. - * @static - * @syscap SystemCapability.FileManagement.File.FileIO - * @since 9 - * @param {string} path - path. - * @param {string} algorithm - algorithm md5 sha1 sha256. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900042 - Unknown error - */ - function hash(path: string, algorithm: string): Promise; - function hash(path: string, algorithm: string, callback: AsyncCallback): void; + /** + * Hash file. + * + * @param { string } path - path. + * @param { string } algorithm - algorithm md5 sha1 sha256. + * @returns { Promise } return Promise + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + function hash(path: string, algorithm: string): Promise; + + /** + * Hash file. + * + * @param { string } path - path. + * @param { string } algorithm - algorithm md5 sha1 sha256. + * @param { AsyncCallback } [callback] - callback. + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ + function hash(path: string, algorithm: string, callback: AsyncCallback): void; } export default hash; - \ No newline at end of file diff --git a/api/@ohos.file.picker.d.ts b/api/@ohos.file.picker.d.ts index 54e70a1f2..b0f29d4d6 100644 --- a/api/@ohos.file.picker.d.ts +++ b/api/@ohos.file.picker.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./basic"; +import { AsyncCallback, Callback } from "./@ohos.base"; /** * This module provides the capabilities to use different pickers. diff --git a/api/@ohos.file.securityLabel.d.ts b/api/@ohos.file.securityLabel.d.ts index 9e5d9fca6..ac4f735b1 100644 --- a/api/@ohos.file.securityLabel.d.ts +++ b/api/@ohos.file.securityLabel.d.ts @@ -1,107 +1,138 @@ /* -* Copyright (C) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import { AsyncCallback } from "./basic"; +import type { AsyncCallback } from "./@ohos.base"; /** * Provides securityLabel APIs * + * @namespace securityLabel + * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @syscap SystemCapability.FileManagement.File.FileIO */ - declare namespace securityLabel { - - type DataLevel = 's0'|'s1'|'s2'|'s3'|'s4'; + type DataLevel = 's0' | 's1' | 's2' | 's3' | 's4'; /** * Set the SecurityLabel. * + * @param { string } path - path + * @param { DataLevel } type - type + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @syscap SystemCapability.FileManagement.File.FileIO - * @param {string} path - path - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900007 - Arg list too long - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ function setSecurityLabel(path: string, type: DataLevel): Promise; + + /** + * Set the SecurityLabel. + * + * @param { string } path - path + * @param { DataLevel } type - type + * @param { AsyncCallback } [callback] - callback + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ function setSecurityLabel(path: string, type: DataLevel, callback: AsyncCallback): void; /** * Set the SecurityLabel with sync interface. * + * @param { string } path - path + * @param { DataLevel } type - type + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @syscap SystemCapability.FileManagement.File.FileIO - * @param {string} path - path - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900007 - Arg list too long - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ function setSecurityLabelSync(path: string, type: DataLevel): void; - /** + /** * Get the SecurityLabel. * + * @param { string } path - path + * @returns { Promise } return Promise + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @syscap SystemCapability.FileManagement.File.FileIO - * @param {string} path - path - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900007 - Arg list too long - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ function getSecurityLabel(path: string): Promise; + + /** + * Get the SecurityLabel. + * + * @param { string } path - path + * @param { AsyncCallback } [callback] - callback + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ function getSecurityLabel(path: string, callback: AsyncCallback): void; /** * Get the SecurityLabel with sync interface. * + * @param { string } path - path + * @returns { string } security label name + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900007 - Arg list too long + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900037 - No data available + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @syscap SystemCapability.FileManagement.File.FileIO - * @param {string} path - path - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900001 - Operation not permitted - * @throws { BusinessError } 13900007 - Arg list too long - * @throws { BusinessError } 13900015 - File exists - * @throws { BusinessError } 13900020 - Invalid argument - * @throws { BusinessError } 13900025 - No space left on device - * @throws { BusinessError } 13900037 - No data available - * @throws { BusinessError } 13900041 - Quota exceeded - * @throws { BusinessError } 13900042 - Unknown error */ - function getSecurityLabelSync(path: string): string; + function getSecurityLabelSync(path: string): string; } -export default securityLabel; \ No newline at end of file +export default securityLabel; diff --git a/api/@ohos.file.statvfs.d.ts b/api/@ohos.file.statvfs.d.ts index dbc68641e..df34f5f10 100644 --- a/api/@ohos.file.statvfs.d.ts +++ b/api/@ohos.file.statvfs.d.ts @@ -1,75 +1,118 @@ /* -* Copyright (C) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import { AsyncCallback } from "./basic"; +import type { AsyncCallback } from "./@ohos.base"; /** * Provides filesystem statistics APIs * - * @since 9 + * @namespace statfs * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 */ declare namespace statfs { /** * Get the number of free bytes on the specified path. * + * @param { string } path - path + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ function getFreeSize(path: string): Promise; + + /** + * Get the number of free bytes on the specified path. + * + * @param { string } path - path + * @param { AsyncCallback } [callback] - callback + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ function getFreeSize(path: string, callback: AsyncCallback): void; - + /** * Get the number of total bytes on the specified path. * + * @param { string } path - path + * @returns { Promise } return Promise + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error * @syscap SystemCapability.FileManagement.File.FileIO * @since 9 - * @param {string} path - path - * @param {AsyncCallback} [callback] - callback - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws { BusinessError } 13900002 - No such file or directory - * @throws { BusinessError } 13900004 - Interrupted system call - * @throws { BusinessError } 13900005 - I/O error - * @throws { BusinessError } 13900008 - Bad file descriptor - * @throws { BusinessError } 13900011 - Out of memory - * @throws { BusinessError } 13900012 - Permission denied - * @throws { BusinessError } 13900013 - Bad address - * @throws { BusinessError } 13900018 - Not a directory - * @throws { BusinessError } 13900030 - File name too long - * @throws { BusinessError } 13900031 - Function not implemented - * @throws { BusinessError } 13900033 - Too many symbolic links encountered - * @throws { BusinessError } 13900038 - Value too large for defined data type - * @throws { BusinessError } 13900042 - Unknown error */ function getTotalSize(path: string): Promise; + + /** + * Get the number of total bytes on the specified path. + * + * @param { string } path - path + * @param { AsyncCallback } [callback] - callback + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ function getTotalSize(path: string, callback: AsyncCallback): void; } diff --git a/api/@ohos.file.storageStatistics.d.ts b/api/@ohos.file.storageStatistics.d.ts index bf659c55a..8296d00e1 100644 --- a/api/@ohos.file.storageStatistics.d.ts +++ b/api/@ohos.file.storageStatistics.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; /** * Provides filesystem statistics APIs diff --git a/api/@ohos.file.volumeManager.d.ts b/api/@ohos.file.volumeManager.d.ts index 498aeeb2c..8ae14b9c9 100644 --- a/api/@ohos.file.volumeManager.d.ts +++ b/api/@ohos.file.volumeManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; /** * Provides volumemanager statistics APIs diff --git a/api/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts index ef9f64242..a4a0bd723 100644 --- a/api/@ohos.fileio.d.ts +++ b/api/@ohos.fileio.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic' +import { AsyncCallback } from './@ohos.base' export default fileIO; diff --git a/api/@ohos.filemanagement.userFileManager.d.ts b/api/@ohos.filemanagement.userFileManager.d.ts index ded672377..2c9caa18e 100644 --- a/api/@ohos.filemanagement.userFileManager.d.ts +++ b/api/@ohos.filemanagement.userFileManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Huawei Device Co., Ltd. + * Copyright (C) 2022-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; -import Context from './application/Context'; +import type { AsyncCallback, Callback } from './@ohos.base'; +import type Context from './application/Context'; import image from './@ohos.multimedia.image'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -66,6 +66,41 @@ declare namespace userFileManager { AUDIO } + /** + * File position + * + * @enum File position, which indicates the file is in local device or cloud + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + enum PositionType { + /** + * File exists only in local device + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + LOCAL = 1, + /** + * File exists only in cloud + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + CLOUD, + /** + * File exists in both local and cloud + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + BOTH + } + /** * Indicates the type of file asset member. * @since 9 @@ -390,7 +425,15 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ - FAVORITE + FAVORITE, + /** + * File position + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + POSITION } /** @@ -589,6 +632,92 @@ declare namespace userFileManager { getPositionObject(index: number): Promise; } + /** + * Album type. + * + * @enum Album type + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + enum AlbumType { + /** + * Album created by user. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + USER = 0, + /** + * Album created by system, which metadata cannot be modified by user. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + SYSTEM = 1024 + } + + /** + * Album subtype + * + * @enum Album subtype + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + enum AlbumSubType { + /** + * Generic user-created albums. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + USER_GENERIC = 1, + /** + * Favorite album, which assets are marked as favorite. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + FAVORITE = 1025, + /** + * Video album, which contains all video assets. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + VIDEO, + /** + * Hidden album, which assets are marked as hidden. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + HIDDEN, + /** + * Trash album, which assets are deleted. + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + TRASH, + /** + * Any album + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + ANY = 2147483647 + } + /** * Defines the AbsAlbum. * @since 9 @@ -596,6 +725,22 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core */ interface AbsAlbum { + /** + * Album type + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + readonly albumType: AlbumType; + /** + * Album subtype + * + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + readonly albumSubType: AlbumSubType; /** * Album name. * @since 9 @@ -630,7 +775,7 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ - readonly coverUri: string; + coverUri: string; /** * Obtains files in an album. This method uses an asynchronous callback to return the files. * @since 9 @@ -772,6 +917,96 @@ declare namespace userFileManager { * @returns A Promise instance used to return an album array. */ getPhotoAlbums(options: AlbumFetchOptions): Promise>; + /** + * Create a generic user album. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { string } name - Album name to be created. + * @param { AsyncCallback } callback - Returns the instance of newly created Album + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + createAlbum(name: string, callback: AsyncCallback): void; + /** + * Create a generic user album. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { string } name - Album name to be created. + * @returns { Promise } Returns the instance of newly created Album + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + createAlbum(name: string): Promise; + /** + * Delete generic user-created albums. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { Array } albums - Specify which album to delete + * @param { AsyncCallback } callback - Returns void + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + deleteAlbums(albums: Array, callback: AsyncCallback): void; + /** + * Delete generic user-created albums. + * + * @permission ohos.permission.WRITE_IMAGEVIDEO + * @param { Array } albums - Specify which album to delete + * @returns { Promise } Returns the promise + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + deleteAlbums(albums: Array): Promise; + /** + * Obtains albums based on the retrieval options and album types. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param { AlbumType } type - Album type. + * @param { AlbumSubType } subType - Album subtype. + * @param { FetchOptions } options - options to fetch albums + * @param { AsyncCallback> } callback - Returns the fetch result of the albums + * @throws { BusinessError } 13900020 - if type options is not FetchOption + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + getAlbums( + type: AlbumType, + subType: AlbumSubType, + options: FetchOptions, + callback: AsyncCallback> + ): void; + /** + * Obtains albums based on the album types. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param { AlbumType } type - Album type. + * @param { AlbumSubType } subType - Album subtype. + * @param { AsyncCallback> } callback - Returns the fetch result of the albums + * @throws { BusinessError } 13900020 - if type options is not FetchOption + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + getAlbums(type: AlbumType, subType: AlbumSubType, callback: AsyncCallback>): void; + /** + * Obtains albums based on the retrieval options and album types. + * + * @permission ohos.permission.READ_IMAGEVIDEO + * @param { AlbumType } type - Album type. + * @param { AlbumSubType } subType - Album subtype. + * @param { FetchOptions } [options] -options to fetch albums + * @returns { Promise> } - Returns the fetch result of the albums + * @throws { BusinessError } 13900020 - if type options is not FetchOption + * @syscap SystemCapability.FileManagement.UserFileManager.Core + * @systemapi + * @since 10 + */ + getAlbums(type: AlbumType, subType: AlbumSubType, options?: FetchOptions): Promise>; /** * Obtains system private albums based on the private album type. This method uses an asynchronous callback to return. * @since 9 diff --git a/api/@ohos.fileshare.d.ts b/api/@ohos.fileshare.d.ts index 9613331ea..ec184edaf 100644 --- a/api/@ohos.fileshare.d.ts +++ b/api/@ohos.fileshare.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; import wantConstant from "./@ohos.ability.wantConstant"; /** diff --git a/api/@ohos.geoLocationManager.d.ts b/api/@ohos.geoLocationManager.d.ts index 3ddbfb628..a2488ba5b 100644 --- a/api/@ohos.geoLocationManager.d.ts +++ b/api/@ohos.geoLocationManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import { WantAgent } from './@ohos.wantAgent'; /** @@ -685,9 +685,9 @@ declare namespace geoLocationManager { /** * Actual address information corresponding to the location. - * + * * @type { GeoAddress } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 */ @@ -705,9 +705,9 @@ declare namespace geoLocationManager { export interface LocationMockConfig { /** * Interval for reporting simulated locations. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 */ @@ -715,9 +715,9 @@ declare namespace geoLocationManager { /** * Mock location array. - * + * * @type { Array } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 */ @@ -752,36 +752,36 @@ declare namespace geoLocationManager { /** * Carrier to noise density array. - * + * * @type { Array } - * @syscap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @since 9 */ carrierToNoiseDensitys: Array; /** * Satellite altitude array. - * + * * @type { Array } - * @syscap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @since 9 */ altitudes: Array; /** * Satellite azimuth array. - * + * * @type { Array } - * @syscap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @since 9 */ azimuths: Array; /** * Satellite carrier frequency array. - * + * * @type { Array } - * @syscap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @since 9 */ carrierFrequencies: Array; @@ -806,9 +806,9 @@ declare namespace geoLocationManager { /** * Indicates whether to wake up the listener when the GNSS cache location queue is full. - * + * * @type { boolean } - * @syscap SystemCapability.Location.Location.Gnss + * @syscap SystemCapability.Location.Location.Gnss * @since 9 */ wakeUpCacheQueueFull: boolean; @@ -824,7 +824,7 @@ declare namespace geoLocationManager { export interface GeofenceRequest { /** * Indicate the user scenario. - * + * * @type { LocationRequestScenario } * @syscap SystemCapability.Location.Location.Geofence * @since 9 @@ -950,45 +950,45 @@ declare namespace geoLocationManager { /** * Address information. - * + * * @type { string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ description: string; /** * Indicates the maximum number of geocode query results. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ maxItems?: number; /** * Indicates the minimum latitude for geocoding query results. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ minLatitude?: number; /** * Indicates the minimum longitude for geocoding query results. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ minLongitude?: number; /** * Indicates the maximum latitude for geocoding query results. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ maxLatitude?: number; @@ -997,7 +997,7 @@ declare namespace geoLocationManager { * Indicates the maximum longitude for geocoding query results. * * @type { ?number } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ maxLongitude?: number; @@ -1036,126 +1036,126 @@ declare namespace geoLocationManager { /** * Indicates language used for the location description. * zh indicates Chinese, and en indicates English. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ locale?: string; /** * Indicates landmark of the location. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ placeName?: string; /** * Indicates country code. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ countryCode?: string; /** * Indicates country name. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ countryName?: string; /** * Indicates administrative region name. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ administrativeArea?: string; /** * Indicates sub-administrative region name. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ subAdministrativeArea?: string; /** * Indicates locality information. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ locality?: string; /** * Indicates sub-locality information. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ subLocality?: string; /** * Indicates road name. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ roadName?: string; /** * Indicates auxiliary road information. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ subRoadName?: string; /** * Indicates house information. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ premises?: string; /** * Indicates postal code. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ postalCode?: string; /** * Indicates phone number. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ phoneNumber?: string; /** * Indicates website URL. - * + * * @type { ?string } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ addressUrl?: string; @@ -1164,25 +1164,25 @@ declare namespace geoLocationManager { * Indicates additional information. * * @type { ?Array } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ descriptions?: Array; /** * Indicates the amount of additional descriptive information. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @since 9 */ descriptionsSize?: number; /** * Indicates whether it is an mock GeoAddress - * + * * @type { ?Boolean } - * @syscap SystemCapability.Location.Location.Geocoder + * @syscap SystemCapability.Location.Location.Geocoder * @systemapi * @since 9 */ @@ -1208,36 +1208,36 @@ declare namespace geoLocationManager { /** * User scenario of the location request. - * + * * @type { ?LocationRequestScenario } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ scenario?: LocationRequestScenario; /** * Location report interval. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ timeInterval?: number; /** * Location report distance interval. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ distanceInterval?: number; /** * Accuracy requirements for reporting locations. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ maxAccuracy?: number; @@ -1253,36 +1253,36 @@ declare namespace geoLocationManager { export interface CurrentLocationRequest { /** * Priority of the location request. - * + * * @type { ?LocationRequestPriority } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ priority?: LocationRequestPriority; /** * User scenario of the location request. - * + * * @type { ?LocationRequestScenario } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ scenario?: LocationRequestScenario; /** * Accuracy requirements for reporting locations. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ maxAccuracy?: number; /** * Timeout interval of a single location request. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ timeoutMs?: number; @@ -1300,9 +1300,9 @@ declare namespace geoLocationManager { * Indicates latitude information. * A positive value indicates north latitude, * and a negative value indicates south latitude. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ latitude: number; @@ -1311,90 +1311,90 @@ declare namespace geoLocationManager { * Indicates Longitude information. * A positive value indicates east longitude , * and a negative value indicates west longitude. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ longitude: number; /** * Indicates location altitude, in meters. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ altitude: number; /** * Indicates location accuracy, in meters. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ accuracy: number; /** * Indicates speed, in m/s. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ speed: number; /** * Indicates location timestamp in the UTC format. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ timeStamp: number; /** * Indicates direction information. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ direction: number; /** * Indicates location timestamp since boot. - * + * * @type { number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ timeSinceBoot: number; /** * Indicates additional information. - * + * * @type { ?Array } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ additions?: Array; /** * Indicates the amount of additional descriptive information. - * + * * @type { ?number } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ additionSize?: number; /** * Indicates whether it is an mock location. - * + * * @type { ?Boolean } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 */ @@ -1411,7 +1411,7 @@ declare namespace geoLocationManager { export enum LocationRequestPriority { /** * Default priority. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1419,7 +1419,7 @@ declare namespace geoLocationManager { /** * Preferentially ensure the locating accuracy. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1427,7 +1427,7 @@ declare namespace geoLocationManager { /** * Preferentially ensure low power consumption for locating. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1435,11 +1435,11 @@ declare namespace geoLocationManager { /** * Preferentially ensure that the first location is time-consuming. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ - FIRST_FIX + FIRST_FIX } /** @@ -1452,7 +1452,7 @@ declare namespace geoLocationManager { export enum LocationRequestScenario { /** * Default scenario. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1468,7 +1468,7 @@ declare namespace geoLocationManager { /** * Trajectory tracking scenario. High positioning precision is required. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1476,7 +1476,7 @@ declare namespace geoLocationManager { /** * Car hailing scenario. High positioning precision and real-time performance are required. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1484,7 +1484,7 @@ declare namespace geoLocationManager { /** * Daily life scenarios. Low requirements on positioning precision and real-time performance. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1492,7 +1492,7 @@ declare namespace geoLocationManager { /** * Power saving scenarios. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1510,7 +1510,7 @@ declare namespace geoLocationManager { export enum LocationPrivacyType { /** * Other scenarios. - * + * * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 @@ -1519,7 +1519,7 @@ declare namespace geoLocationManager { /** * Privacy agreement for the startup wizard scenario. - * + * * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 @@ -1528,12 +1528,12 @@ declare namespace geoLocationManager { /** * Privacy agreement pop-up when network location is enabled. - * + * * @syscap SystemCapability.Location.Location.Core * @systemapi * @since 9 */ - CORE_LOCATION + CORE_LOCATION } /** @@ -1546,18 +1546,18 @@ declare namespace geoLocationManager { export interface LocationCommand { /** * Information about the scenario where the command is sent. - * + * * @type { LocationRequestScenario } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ scenario: LocationRequestScenario; /** * Sent command content. - * + * * @type { string } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ command: string; @@ -1573,18 +1573,18 @@ declare namespace geoLocationManager { export interface CountryCode { /** * Country code character string. - * + * * @type { string } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ country: string; /** * Country code source. - * + * * @type { CountryCodeType } - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Core * @since 9 */ type: CountryCodeType; @@ -1600,7 +1600,7 @@ declare namespace geoLocationManager { export enum CountryCodeType { /** * Country code obtained from the locale setting. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1608,15 +1608,15 @@ declare namespace geoLocationManager { /** * Country code obtained from the SIM information. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ COUNTRY_CODE_FROM_SIM, /** - * Query the country code information from the reverse geocoding result. - * + * Query the country code information from the reverse geocoding result. + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ @@ -1624,7 +1624,7 @@ declare namespace geoLocationManager { /** * Obtain the country code from the cell registration information. - * + * * @syscap SystemCapability.Location.Location.Core * @since 9 */ diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 8375eb7db..c56fa6be8 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import { WantAgent } from './@ohos.wantAgent'; /** @@ -208,6 +208,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getCurrentLocation */ function getCurrentLocation(callback: AsyncCallback): void; @@ -220,6 +221,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getCurrentLocation */ function getCurrentLocation(request?: CurrentLocationRequest): Promise; @@ -243,6 +245,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getLastLocation */ function getLastLocation(): Promise; @@ -266,6 +269,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.isLocationEnabled */ function isLocationEnabled(): Promise; @@ -310,9 +314,10 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION * @param { ReverseGeoCodeRequest } request - Indicates the reverse geocode query parameters. * @returns { Promise> } The promise returned by the function. - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Geocoder * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getAddressesFromLocation */ function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise>; @@ -320,7 +325,7 @@ declare namespace geolocation { * Obtain latitude and longitude info from location address * * @permission ohos.permission.LOCATION - * @param { GeoCodeRequest } request - Indicates the reverse geocode query parameters. + * @param { GeoCodeRequest } request - Indicates the geocode query parameters. * @param { AsyncCallback> } callback - Indicates the callback for reporting the latitude and longitude result. * @syscap SystemCapability.Location.Location.Geocoder * @since 7 @@ -333,11 +338,12 @@ declare namespace geolocation { * Obtain latitude and longitude info from location address * * @permission ohos.permission.LOCATION - * @param { GeoCodeRequest } request - Indicates the reverse geocode query parameters. + * @param { GeoCodeRequest } request - Indicates the geocode query parameters. * @returns { Promise> } The promise returned by the function. - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Geocoder * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getAddressesFromLocationName */ function getAddressesFromLocationName(request: GeoCodeRequest): Promise>; @@ -358,9 +364,10 @@ declare namespace geolocation { * * @permission ohos.permission.LOCATION * @returns { Promise } The promise returned by the function. - * @syscap SystemCapability.Location.Location.Core + * @syscap SystemCapability.Location.Location.Geocoder * @since 7 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.isGeocoderAvailable */ function isGeoServiceAvailable(): Promise; @@ -381,9 +388,10 @@ declare namespace geolocation { * * @permission ohos.permission.LOCATION * @returns { Promise } The promise returned by the function. - * @syscap SystemCapability.Location.Location.Core - * @since 7 + * @syscap SystemCapability.Location.Location.Gnss + * @since 8 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getCachedGnssLocationsSize */ function getCachedGnssLocationsSize(): Promise; @@ -406,9 +414,10 @@ declare namespace geolocation { * * @permission ohos.permission.LOCATION * @returns { Promise } The promise returned by the function. - * @syscap SystemCapability.Location.Location.Core - * @since 7 + * @syscap SystemCapability.Location.Location.Gnss + * @since 8 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.flushCachedGnssLocations */ function flushCachedGnssLocations(): Promise; @@ -432,8 +441,9 @@ declare namespace geolocation { * @param { LocationCommand } command - Indicates the extended Command Message Body. * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Location.Location.Core - * @since 7 + * @since 8 * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.sendCommand */ function sendCommand(command: LocationCommand): Promise; @@ -559,7 +569,7 @@ declare namespace geolocation { * * @permission ohos.permission.LOCATION * @syscap SystemCapability.Location.Location.Geocoder - * @since 7 + * @since 7 * @deprecated since 9 */ latitude?: number; @@ -880,11 +890,11 @@ declare namespace geolocation { /** * Indicates the amount of additional descriptive information. - * + * * @permission ohos.permission.LOCATION - * @syscap SystemCapability.Location.Location.Core - * @since 7 - * @deprecated since 9 + * @syscap SystemCapability.Location.Location.Core + * @since 7 + * @deprecated since 9 */ additionSize?: number; } @@ -903,7 +913,7 @@ declare namespace geolocation { UNSET = 0x200, ACCURACY, LOW_POWER, - FIRST_FIX + FIRST_FIX } /** @@ -922,7 +932,7 @@ declare namespace geolocation { TRAJECTORY_TRACKING, CAR_HAILING, DAILY_LIFE_SERVICE, - NO_POWER + NO_POWER } /** @@ -947,27 +957,27 @@ declare namespace geolocation { /** * Indicates reverse geocode query failed. - * + * * @permission ohos.permission.LOCATION - * @syscap SystemCapability.Location.Location.Core - * @since 7 - * @deprecated since 9 + * @syscap SystemCapability.Location.Location.Core + * @since 7 + * @deprecated since 9 */ REVERSE_GEOCODE_ERROR, /** * Indicates geocode query failed. - * + * * @permission ohos.permission.LOCATION - * @syscap SystemCapability.Location.Location.Core - * @since 7 - * @deprecated since 9 + * @syscap SystemCapability.Location.Location.Core + * @since 7 + * @deprecated since 9 */ GEOCODE_ERROR, /** * Indicates positioning failed. - * + * * @permission ohos.permission.LOCATION * @syscap SystemCapability.Location.Location.Core * @since 7 @@ -1003,7 +1013,7 @@ declare namespace geolocation { * @since 7 * @deprecated since 9 */ - LOCATION_REQUEST_TIMEOUT_ERROR + LOCATION_REQUEST_TIMEOUT_ERROR } /** @@ -1019,7 +1029,7 @@ declare namespace geolocation { export enum LocationPrivacyType { OTHERS = 0, STARTUP, - CORE_LOCATION + CORE_LOCATION } /** diff --git a/api/@ohos.graphics.colorSpaceManager.d.ts b/api/@ohos.graphics.colorSpaceManager.d.ts index 962c8f860..a943cb537 100644 --- a/api/@ohos.graphics.colorSpaceManager.d.ts +++ b/api/@ohos.graphics.colorSpaceManager.d.ts @@ -13,14 +13,13 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * colorSpaceManager * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ - declare namespace colorSpaceManager { - +declare namespace colorSpaceManager { /** * Enumerates color space types. * @since 9 @@ -180,6 +179,6 @@ import { AsyncCallback } from './basic'; * @throws {BusinessError} 18600001 - If param value is abnormal */ function create(primaries: ColorSpacePrimaries, gamma: number): ColorSpaceManager; - } +} - export default colorSpaceManager; \ No newline at end of file +export default colorSpaceManager; \ No newline at end of file diff --git a/api/@ohos.hiAppEvent.d.ts b/api/@ohos.hiAppEvent.d.ts index 96446e5bc..ced9df061 100644 --- a/api/@ohos.hiAppEvent.d.ts +++ b/api/@ohos.hiAppEvent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * Provides the event logging function for applications to log the fault, statistical, security, diff --git a/api/@ohos.hiSysEvent.d.ts b/api/@ohos.hiSysEvent.d.ts index 956323244..8213700a4 100644 --- a/api/@ohos.hiSysEvent.d.ts +++ b/api/@ohos.hiSysEvent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * Provides the system event logging function for applications to log the fault, statistical, security, diff --git a/api/@ohos.hilog.d.ts b/api/@ohos.hilog.d.ts index a1a7e8880..a0d88df1b 100644 --- a/api/@ohos.hilog.d.ts +++ b/api/@ohos.hilog.d.ts @@ -28,6 +28,7 @@ declare namespace hilog { * @param tag Identifies the log tag. * @param format Indicates the log format string. * @param args Indicates the log parameters. + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ @@ -39,6 +40,7 @@ declare namespace hilog { * @param tag Identifies the log tag. * @param format Indicates the log format string. * @param args Indicates the log parameters. + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ @@ -50,6 +52,7 @@ declare namespace hilog { * @param tag Identifies the log tag. * @param format Indicates the log format string. * @param args Indicates the log parameters. + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ @@ -61,6 +64,7 @@ declare namespace hilog { * @param tag Identifies the log tag. * @param format Indicates the log format string. * @param args Indicates the log parameters. + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ @@ -72,6 +76,7 @@ declare namespace hilog { * @param tag Identifies the log tag. * @param format Indicates the log format string. * @param args Indicates the log parameters. + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ @@ -82,6 +87,7 @@ declare namespace hilog { * @param domain Indicates the service domain, which is a hexadecimal integer ranging from 0x0 to 0xFFFF * @param tag Identifies the log tag. * @param level log level + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ @@ -89,6 +95,7 @@ declare namespace hilog { /** * Log level define * + * @crossplatform * @since 7 * @syscap SystemCapability.HiviewDFX.HiLog */ diff --git a/api/@ohos.hiviewdfx.hiAppEvent.d.ts b/api/@ohos.hiviewdfx.hiAppEvent.d.ts index a4d78cae8..b635ce4e6 100644 --- a/api/@ohos.hiviewdfx.hiAppEvent.d.ts +++ b/api/@ohos.hiviewdfx.hiAppEvent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * Provides the event logging function for applications to log the fault, statistical, security, diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 1739c7a96..1892134a1 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -1165,7 +1165,7 @@ declare namespace i18n { * @since 9 */ static getTimezoneFromCity(cityID: string): TimeZone; -} + } /** * Provides the API for transliterate text from one format to another. @@ -1209,7 +1209,7 @@ declare namespace i18n { /** * Enumerates the Normalizer modes. * - * @enum {number} + * @enum { number } * @syscap SystemCapability.Global.I18n * @since 10 */ diff --git a/api/@ohos.inputMethod.d.ts b/api/@ohos.inputMethod.d.ts index 90d992c55..a777b1e68 100644 --- a/api/@ohos.inputMethod.d.ts +++ b/api/@ohos.inputMethod.d.ts @@ -13,9 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import InputMethodSubtype from './@ohos.InputMethodSubtype'; -import { Movement, Range } from './imf/InputMethodCommon'; /** * Input method @@ -128,6 +127,19 @@ declare namespace inputMethod { * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 9 */ + /** + * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored. + * + * @permission ohos.permission.CONNECT_IME_ABILITY + * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one. + * @param { AsyncCallback } callback - the callback of switchCurrentInputMethodSubtype. + * @throws { BusinessError } 201 - permissions check fails. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800005 - configuration persisting error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ function switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback): void; /** @@ -143,6 +155,19 @@ declare namespace inputMethod { * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 9 */ + /** + * Switch current input method subtype, if this interface is invoked by the current IME, this permission is ignored. + * + * @permission ohos.permission.CONNECT_IME_ABILITY + * @param { InputMethodSubtype } target - Indicates the input method subtype which will replace the current one. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - permissions check fails. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800005 - configuration persisting error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ function switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise; /** @@ -369,6 +394,221 @@ declare namespace inputMethod { * @since 6 */ interface InputMethodController { + /** + * Attach application to the input method service. + * + * @param { boolean } showKeyboard - show the keyboard or not when attach the input method. + * @param { TextConfig } textConfig - indicates the config of the textInput. + * @param { AsyncCallback } callback - the callback of attach. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + attach(showKeyboard: boolean, textConfig: TextConfig, callback: AsyncCallback): void; + + /** + * Attach application to the input method service. + * + * @param { boolean } showKeyboard - show the keyboard or not when attach the input method. + * @param { TextConfig } textConfig - indicates the config of the textInput. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + attach(showKeyboard: boolean, textConfig: TextConfig): Promise; + + /** + * Show the text input and start typing. + * + * @param { AsyncCallback } callback - the callback of showTextInput. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + showTextInput(callback: AsyncCallback): void; + + /** + * Show the text input and start typing. + * + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + showTextInput(): Promise; + + /** + * Hide the text input and stop typing. + * + * @param { AsyncCallback } callback - the callback of hideTextInput. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + hideTextInput(callback: AsyncCallback): void; + + /** + * Hide the text input and stop typing. + * + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + hideTextInput(): Promise; + + /** + * Detach the applications from the input method manager service. + * + * @param { AsyncCallback } callback - the callback of detach. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + detach(callback: AsyncCallback): void; + + /** + * Detach the applications from the input method manager service. + * + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + detach(): Promise; + + /** + * Inform the system of the window ID of the application currently bound to the input method. + * After the correct setting, the window where the client is located can avoid the input method window. + * + * @param { number } windowId - the window ID of the application currently bound to the input method. + * @param { AsyncCallback } callback - the callback of setCallingWindow. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + setCallingWindow(windowId: number, callback: AsyncCallback): void; + + /** + * Inform the system of the window ID of the application currently bound to the input method. + * After the correct setting, the window where the client is located can avoid the input method window. + * + * @param { number } windowId - the window ID of the application currently bound to the input method. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + setCallingWindow(windowId: number): Promise; + + /** + * Update Cursor and notify the input method that the current application cursor has changed. + * + * @param { CursorInfo } cursorInfo - the CursorInfo object. + * @param { AsyncCallback } callback - the callback of updateCursor. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + updateCursor(cursorInfo: CursorInfo, callback: AsyncCallback): void; + + /** + * Update Cursor and notify the input method that the current application cursor has changed. + * + * @param { CursorInfo } cursorInfo - the CursorInfo object. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + updateCursor(cursorInfo: CursorInfo): Promise; + + /** + * Notify the input method the selected text and the selection range of the current application text has changed. + * + * @param { string } text - the whole input text. + * @param { number } start - start position of selected text. + * @param { number } end - end position of selected text. + * @param { AsyncCallback } callback - the callback of changeSelection. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + changeSelection(text: string, start: number, end: number, callback: AsyncCallback): void; + + /** + * Notify the input method the selected text and the selection range of the current application text has changed. + * + * @param { string } text - the selected text. + * @param { number } start - start position of selected text. + * @param { number } end - end position of selected text. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + changeSelection(text: string, start: number, end: number): Promise; + + /** + * Update InputAttribute information of input text. + * + * @param { InputAttribute } attribute - the InputAttribute object. + * @param { AsyncCallback } callback - the callback of updateAttribute. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + updateAttribute(attribute: InputAttribute, callback: AsyncCallback): void; + + /** + * Update InputAttribute information of input text. + * + * @param { InputAttribute } attribute - the InputAttribute object. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800008 - input method manager service error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + updateAttribute(attribute: InputAttribute): Promise; /** * Stop input session * @@ -510,6 +750,142 @@ declare namespace inputMethod { * @since 10 */ off(type: 'selectByMovement'): void; + + /** + * Register a callback and when IME sends insert text event, the callback will be invoked. + * + * @param { string } type - event type, fixed as 'insertText'. + * @param { (text: string) => void } callback - processes insertText command. The text of insert is provided for this callback. + * Subscribers are expected to process the inserted text and update changes in editor by changeSelection and updateCursor as needed. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + on(type: 'insertText', callback: (text: string) => void): void; + + /** + * Unregister the callback of insertText. + * + * @param { string } type - event type, fixed as 'insertText'. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + off(type: 'insertText'): void; + + /** + * Register a callback and when IME sends delete left or delete right event with length, + * the callback will be invoked. + * + * @param { string } type - event type, fixed as 'deleteLeft' or 'deleteRight'. + * @param { (length: number) => void } callback - processes deleteLeft/deleteRight command. The length of + * delete is provided for this callback. Subscribers are expected to delete specified length of text + * to the left/right of the cursor and update changes in editor by changeSelection and updateCursor as needed. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + on(type: 'deleteLeft' | 'deleteRight', callback: (length: number) => void): void; + + /** + * Unregister the callback of deleteLeft/deleteRight. + * + * @param { string } type - event type, fixed as 'deleteLeft'/'deleteRight'. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + off(type: 'deleteLeft' | 'deleteRight'): void; + + /** + * Register a callback and when IME sends keyboard status, the callback will be invoked. + * + * @param { string } type - event type, fixed as 'sendKeyboardStatus'. + * @param { (keyBoardStatus: KeyboardStatus) => void } callback - processes sendKeyboardStatus command. + * The keyBoardStatus is provided for this callback. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + on(type: 'sendKeyboardStatus', callback: (keyBoardStatus: KeyboardStatus) => void): void; + + /** + * Unregister the callback of sendKeyboardStatus. + * + * @param { string } type - event type, fixed as 'sendKeyboardStatus'. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + off(type: 'sendKeyboardStatus'): void; + + /** + * Register a callback and when IME sends functionKey, the callback will be invoked. + * + * @param { string } type - event type, fixed as 'sendFunctionKey'. + * @param { (functionKey: FunctionKey) => void } callback - processes sendFunctionKey command. + * The functionKey is provided for this callback.Subscribers are expected to complete the + * corresponding task based on the value of functionKey. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + on(type: 'sendFunctionKey', callback: (functionKey: FunctionKey) => void): void; + + /** + * Unregister the callback of sendFunctionKey. + * + * @param { string } type - event type, fixed as 'sendFunctionKey'. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + off(type: 'sendFunctionKey'): void; + + /** + * Register a callback and when IME sends move cursor, the callback will be invoked. + * + * @param { string } type - event type, fixed as 'moveCursor'. + * @param { (direction: Direction) => void } callback - processes moveCursor command. The direction of + * cursor is provided for this callback. Subscribers are expected to move the cursor and update changes + * in editor by changeSelection and updateCursor. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + on(type: 'moveCursor', callback: (direction: Direction) => void): void; + + /** + * Unregister the callback of moveCursor. + * + * @param { string } type - event type, fixed as 'moveCursor'. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + off(type: 'moveCursor'): void; + + /** + * Register a callback and when IME sends extend action code, the callback will be invoked. + * + * @param { string } type - event type, fixed as 'handleExtendAction'. + * @param { (action: ExtendAction) => void } callback - processes handleExtendAction command. The action code + * is provided for this callback. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800009 - input method client is detached. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + on(type: 'handleExtendAction', callback: (action: ExtendAction) => void): void; + + /** + * Unregister the callback of handleExtendAction. + * + * @param { string } type - event type, fixed as 'handleExtendAction'. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + off(type: 'handleExtendAction'): void; } /** @@ -564,6 +940,14 @@ declare namespace inputMethod { */ readonly label?: string; + /** + * The label id of input method + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + readonly labelId?: number; + /** * The icon of input method * @@ -583,10 +967,412 @@ declare namespace inputMethod { /** * The extra info of input method * + * @type { object } * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 9 */ - extra: object; + /** + * The extra info of input method + * + * @type { ?object } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + extra?: object; + } + + /** + * Enumerates the moving direction of cursor + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum Direction { + /** + * Cursor moves up + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_UP = 1, + + /** + * Cursor moves down + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_DOWN, + + /** + * Cursor moves left + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_LEFT, + + /** + * Cursor moves right + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_RIGHT + } + + /** + * Range of selected text. + * + * @typedef Range + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface Range { + /** + * Indicates the index of the first character of the selected text. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + start: number; + + /** + * Indicates the index of the last character of the selected text. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + end: number; + } + + /** + * Movement of cursor. + * + * @typedef Movement + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface Movement { + /** + * Indicates the direction of cursor movement + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + direction: Direction; + } + + /** + * Enumerates the text input type. + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum TextInputType { + /** + * The text input type is NONE. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + NONE = -1, + + /** + * The text input type is TEXT. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + TEXT = 0, + + /** + * The text input type is MULTILINE. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + MULTILINE, + + /** + * The text input type is NUMBER. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + NUMBER, + + /** + * The text input type is PHONE. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + PHONE, + + /** + * The text input type is DATETIME. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + DATETIME, + + /** + * The text input type is EMAIL_ADDRESS. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + EMAIL_ADDRESS, + + /** + * The text input type is URL. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + URL, + + /** + * The text input type is VISIBLE_PASSWORD. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + VISIBLE_PASSWORD + } + + /** + * Enumerates the enter key type. + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum EnterKeyType { + /** + * The enter key type is UNSPECIFIED. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + UNSPECIFIED = 0, + + /** + * The enter key type is NONE. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + NONE, + + /** + * The enter key type is GO. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + GO, + + /** + * The enter key type is SEARCH. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + SEARCH, + + /** + * The enter key type is SEND. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + SEND, + + /** + * The enter key type is NEXT. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + NEXT, + + /** + * The enter key type is DONE. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + DONE, + + /** + * The enter key type is PREVIOUS. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + PREVIOUS + } + + /** + * Enumerates the keyboard status. + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum KeyboardStatus { + /** + * The keyboard status is none. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + NONE = 0, + + /** + * The keyboard status is hide. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + HIDE = 1, + + /** + * The keyboard status is show. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + SHOW = 2 + } + + /** + * Attribute of Input. + * + * @typedef InputAttribute + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface InputAttribute { + /** + * Indicates the text input type of the input method. + * + * @type { TextInputType } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + textInputType: TextInputType; + + /** + * Indicates the enter key type of the input method. + * + * @type { EnterKeyType } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + enterKeyType: EnterKeyType; + } + + /** + * FunctionKey of Input. + * + * @typedef FunctionKey + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface FunctionKey { + /** + * Indicates the enter key type of the input method. + * + * @type { EnterKeyType } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + enterKeyType: EnterKeyType; + } + + /** + * Information of Cursor. + * + * @typedef CursorInfo + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface CursorInfo { + /** + * Indicates the left point of the cursor info and must be absolute coordinate of the physical screen. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + left: number; + + /** + * Indicates the top point of the cursor info and must be absolute coordinate of the physical screen. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + top: number; + + /** + * Indicates the width point of the cursor info. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + width: number; + + /** + * Indicates the height point of the cursor info. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + height: number; + } + + /** + * Config of editor. + * + * @typedef { typedef } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface TextConfig { + /** + * Attribute of Input. + * + * @typedef Movement + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + inputAttribute: InputAttribute; + } + + /** + * Enumerates the extend action. + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum ExtendAction { + /** + * Select all text. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + SELECT_ALL = 0, + + /** + * Cut selecting text. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CUT = 3, + + /** + * Copy selecting text. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + COPY = 4, + + /** + * Paste from paste board. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + PASTE = 5 } } diff --git a/api/@ohos.inputMethodEngine.d.ts b/api/@ohos.inputMethodEngine.d.ts index 07ad94f72..d9916e30c 100644 --- a/api/@ohos.inputMethodEngine.d.ts +++ b/api/@ohos.inputMethodEngine.d.ts @@ -15,11 +15,10 @@ /// -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import InputMethodSubtype from './@ohos.InputMethodSubtype'; import LocalStorage from 'StateManagement'; import BaseContext from './application/BaseContext'; -import { Movement, Range } from './imf/InputMethodCommon'; /** * Input method engine @@ -435,7 +434,7 @@ declare namespace inputMethodEngine { * Unsubscribe 'keyboardShow'|'keyboardHide' * * @param { 'keyboardShow' | 'keyboardHide' } type - indicates the type of subscribe event. - * @param { AsyncCallback } [callback] - optional, indicates the callback of off('keyboardShow'|'keyboardHide'). + * @param { () => void } [callback] - optional, indicates the callback of off('keyboardShow'|'keyboardHide'). * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 8 */ @@ -500,7 +499,7 @@ declare namespace inputMethodEngine { * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 9 */ - on(type: 'setCallingWindow', callback: (wid:number) => void): void; + on(type: 'setCallingWindow', callback: (wid: number) => void): void; /** * Unsubscribe 'setCallingWindow'. @@ -510,7 +509,7 @@ declare namespace inputMethodEngine { * @syscap SystemCapability.MiscServices.InputMethodFramework * @since 9 */ - off(type: 'setCallingWindow', callback: (wid:number) => void): void; + off(type: 'setCallingWindow', callback: (wid: number) => void): void; /** * Subscribe 'keyboardShow'|'keyboardHide'. @@ -554,9 +553,7 @@ declare namespace inputMethodEngine { /** * Creates a panel. - *

The system only allows one soft keyboard and one status bar to be created. - * Once you create a soft keyboard with FLG_FIXED or FLG_FLOATING, you cannot create - * status bar, and vice versa.

+ *

The system only allows one soft keyboard and one status bar to be created.

* * @param { BaseContext } ctx - indicates the context on which the window depends. * @param { PanelInfo } info - the info of panel to be created. @@ -570,9 +567,7 @@ declare namespace inputMethodEngine { /** * Creates a panel. - *

The system only allows one soft keyboard and one status bar to be created. - * Once you create a soft keyboard with FLG_FIXED or FLG_FLOATING, you cannot create - * status bar, and vice versa.

+ *

The system only allows one soft keyboard and one status bar to be created.

* * @param { BaseContext } ctx - indicates the context on which the window depends. * @param { PanelInfo } info - the info of panel to be created. @@ -1031,6 +1026,32 @@ declare namespace inputMethodEngine { * @since 10 */ getTextIndexAtCursor(): Promise; + + /** + * Send extend action code. + * + * @param { ExtendAction } action - action code which will be send. + * @param { AsyncCallback } callback - the callback of sendExtendAction. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800006 - Input method controller error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + sendExtendAction(action: ExtendAction, callback: AsyncCallback): void; + + /** + * Send extend action code. + * + * @param { ExtendAction } action - action code which will be send. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 12800003 - input method client error. + * @throws { BusinessError } 12800006 - Input method controller error. + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + sendExtendAction(action: ExtendAction): Promise; } /** @@ -1212,7 +1233,7 @@ declare namespace inputMethodEngine { /** * Moves a panel. - *

It's unavailable for SOFT_KEYBOARD panel with FLG_FIXED.

+ *

It's unusable for SOFT_KEYBOARD panel with FLG_FIXED.

* * @param { number } x - the x-coordinate of the new position. * @param { number } y - the y-coordinate of the new position. @@ -1225,7 +1246,7 @@ declare namespace inputMethodEngine { /** * Moves a panel. - *

It's unavailable for SOFT_KEYBOARD panel with FLG_FIXED.

+ *

It's unusable for SOFT_KEYBOARD panel with FLG_FIXED.

* * @param { number } x - the x-coordinate of the new position. * @param { number } y - the y-coordinate of the new position. @@ -1296,7 +1317,7 @@ declare namespace inputMethodEngine { /** * Changes panel flag. - *

When flag is changed, the panel will be hide. Developers should change the content, size, point of the panel + *

Before flag is changed, Developers should hide the panel.After that, developers can change the content, size, point of the panel * and show it again at appropriate opportunity.

* * @param { PanelFlag } flag - the callback of changeFlag. @@ -1436,6 +1457,125 @@ declare namespace inputMethodEngine { */ flag?: PanelFlag; } + + /** + * Enumerates the moving direction of cursor + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum Direction { + /** + * Cursor moves up + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_UP = 1, + + /** + * Cursor moves down + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_DOWN, + + /** + * Cursor moves left + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_LEFT, + + /** + * Cursor moves right + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CURSOR_RIGHT + } + + /** + * Range of selected text. + * + * @interface Range + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface Range { + /** + * Indicates the index of the first character of the selected text. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + start: number; + + /** + * Indicates the index of the last character of the selected text. + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + end: number; + } + + /** + * Movement of cursor. + * + * @interface Movement + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export interface Movement { + /** + * Indicates the direction of cursor movement + * + * @type { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + direction: Direction; + } + + /** + * Enumerates the extend action. + * + * @enum { number } + * @syscap SystemCapability.MiscServices.InputMethodFramework + * @since 10 + */ + export enum ExtendAction { + /** + * Select all text. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + SELECT_ALL = 0, + + /** + * Cut selecting text. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + CUT = 3, + + /** + * Copy selecting text. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + COPY = 4, + + /** + * Paste from paste board. + * + * @syscap SystemCapability.MiscServices.InputMethodFramework + */ + PASTE = 5 + } } export default inputMethodEngine; diff --git a/api/@ohos.mediaquery.d.ts b/api/@ohos.mediaquery.d.ts index 04cbb0fc7..619a7014a 100644 --- a/api/@ohos.mediaquery.d.ts +++ b/api/@ohos.mediaquery.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {Callback} from './basic'; +import {Callback} from './@ohos.base'; /** * Used to do mediaquery operations. diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index f18c10d77..8cc99ea8f 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {ErrorCallback, AsyncCallback, Callback} from './basic'; +import {ErrorCallback, AsyncCallback, Callback} from './@ohos.base'; /** * @namespace audio diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index 94140078d..dc80eb8d1 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { WantAgent } from './@ohos.wantAgent'; import { KeyEvent } from './@ohos.multimodalInput.keyEvent'; import { ElementName } from './bundleManager/ElementName'; diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index fdb770ec2..74114a051 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {ErrorCallback, AsyncCallback} from './basic'; +import {ErrorCallback, AsyncCallback} from './@ohos.base'; import { Context } from './app/context'; /** diff --git a/api/@ohos.multimedia.image.d.ts b/api/@ohos.multimedia.image.d.ts index 381558611..b43ca07ff 100644 --- a/api/@ohos.multimedia.image.d.ts +++ b/api/@ohos.multimedia.image.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * @namespace image diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 37985f143..051526d0d 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { ErrorCallback, AsyncCallback, Callback } from './basic'; +import { ErrorCallback, AsyncCallback, Callback } from './@ohos.base'; import audio from "./@ohos.multimedia.audio"; /** diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts index f0fe9a55f..b4ef10b56 100644 --- a/api/@ohos.multimedia.mediaLibrary.d.ts +++ b/api/@ohos.multimedia.mediaLibrary.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import Context from './application/Context'; import image from './@ohos.multimedia.image'; diff --git a/api/@ohos.multimedia.systemSoundManager.d.ts b/api/@ohos.multimedia.systemSoundManager.d.ts index 6f2486fda..1edc9315e 100644 --- a/api/@ohos.multimedia.systemSoundManager.d.ts +++ b/api/@ohos.multimedia.systemSoundManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; import type Context from './application/Context'; import type { RingtonePlayer as _RingtonePlayer } from './multimedia/ringtonePlayer'; import type { RingtoneOptions as _RingtoneOptions } from './multimedia/ringtonePlayer'; diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts index bd0666174..e62984f26 100644 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -1,71 +1,104 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import { Callback } from './basic'; - - /** - * The event of key input management module is configured to subscribe and unsubscribe system keys. + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * @since 8 - * @syscap SystemCapability.MultimodalInput.Input.InputConsumer - * @systemapi hide for inner use + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ +import { Callback } from './@ohos.base'; + +/** + * The event of key input management module is configured to subscribe and unsubscribe system keys. + * + * @namespace inputConsumer + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use + * @since 8 + */ declare namespace inputConsumer { + /** + * Defines event of key that user want to subscribe or unsubscribe. + * + * @interface KeyOptions + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use + * @since 8 + */ + interface KeyOptions { /** - * Defines event of key that user want to subscribe or unsubscribe. + * The pre-keys that want to subscribe or unsubscribe. * + * @type { Array } * @syscap SystemCapability.MultimodalInput.Input.InputConsumer * @systemapi hide for inner use - * @param preKeys The pre-keys that want to subscribe or unsubscribe. - * @param finalKey The post position key that want to subscribe or unsubscribe. - * @param isFinalKeyDown The final key press down or up. - * @param finalKeyDownDuration Duration of final key press. + * @since 8 */ - interface KeyOptions { - preKeys: Array; - finalKey: number; - isFinalKeyDown: boolean; - finalKeyDownDuration: number; - } + preKeys: Array; /** - * Subscribe system keys. + * The post position key that want to subscribe or unsubscribe. * - * @since 8 + * @type { number } * @syscap SystemCapability.MultimodalInput.Input.InputConsumer * @systemapi hide for inner use - * @param type type of the inputevent about input which is to be subscribed. - * @param keyOptions the key events about input which is to be subscribed. - * @param callback callback function, receive reported data. - * @throws {BusinessError} 401 - Parameter error. + * @since 8 */ - function on(type: "key", keyOptions: KeyOptions, callback: Callback): void; + finalKey: number; /** - * Subscribe system keys. + * The final key press down or up. * - * @since 8 + * @type { boolean } * @syscap SystemCapability.MultimodalInput.Input.InputConsumer * @systemapi hide for inner use - * @param type type of the inputevent about input which is to be subscribed. - * @param keyOptions the key events about input which is to be subscribed. - * @param callback callback function, receive reported data. - * @throws {BusinessError} 401 - Parameter error. + * @since 8 */ - function off(type: "key", keyOptions: KeyOptions, callback?: Callback): void; + isFinalKeyDown: boolean; + + /** + * Duration of final key press. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use + * @since 8 + */ + finalKeyDownDuration: number; + } + + /** + * Subscribe system keys. + * + * @param { 'key' } type - type of the inputevent about input which is to be subscribed. + * @param { KeyOptions } keyOptions - the key events about input which is to be subscribed. + * @param { Callback } callback - callback function, receive reported data. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use + * @since 8 + */ + function on(type: 'key', keyOptions: KeyOptions, callback: Callback): void; + + /** + * Subscribe system keys. + * + * @param { 'key' } type - type of the inputevent about input which is to be subscribed. + * @param { KeyOptions } keyOptions - the key events about input which is to be subscribed. + * @param { Callback } callback - callback function, receive reported data. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.InputConsumer + * @systemapi hide for inner use + * @since 8 + */ + function off(type: 'key', keyOptions: KeyOptions, callback?: Callback): void; } export default inputConsumer; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 3b1d0f6ad..ba284fe80 100644 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -1,26 +1,27 @@ /* -* Copyright (c) 2021-2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import { Callback, AsyncCallback } from "./basic"; -import { KeyCode } from "./@ohos.multimodalInput.keyCode" +import type { Callback, AsyncCallback } from './basic'; +import type { KeyCode } from './@ohos.multimodalInput.keyCode'; /** * The input device management module is configured to obtain an ID and device information of an input device. * - * @since 8 + * @namespace inputDevice * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 8 */ declare namespace inputDevice { /** @@ -39,125 +40,191 @@ declare namespace inputDevice { * @since 9 * Axis Type of the input event */ - type AxisType = 'touchmajor' | 'touchminor' | 'orientation' | 'x' | 'y' | 'pressure' | 'toolminor' | 'toolmajor' | 'null'; + type AxisType = + 'touchmajor' + | 'touchminor' + | 'orientation' + | 'x' + | 'y' + | 'pressure' + | 'toolminor' + | 'toolmajor' + | 'null'; /** + * @enum { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ enum KeyboardType { /** * None + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ NONE = 0, /** * Unknown key + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ UNKNOWN = 1, /** * Alphabetical keyboard + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ ALPHABETIC_KEYBOARD = 2, /** * Digital keyboard + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ DIGITAL_KEYBOARD = 3, /** * Stylus + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ HANDWRITING_PEN = 4, /** * Remote control + * + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ - REMOTE_CONTROL = 5, + REMOTE_CONTROL = 5 } /** * Defines the listener for input device events. - * - * @since 9 + * + * @interface DeviceListener * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param type Type of the input device event. The options are add and remove. - * @param deviceId ID of the input device for the reported input device event. + * @since 9 */ interface DeviceListener { + /** + * Type of the input device event. The options are add and remove. + * + * @type { ChangedType } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 + */ type: ChangedType; + + /** + * ID of the input device for the reported input device event. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 + */ deviceId: number; } /** * Starts listening for an input device event. - * - * @since 9 + * + * @param { 'change' } type - Type of the input device event, which is **change**. + * @param { Callback } listener - Callback for the input device event. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param type Type of the input device event, which is **change**. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ - function on(type: "change", listener: Callback): void; + function on(type: 'change', listener: Callback): void; /** * Stops listening for an input device event. - * - * @since 9 + * + * @param { 'change' } type - Type of the input device event, which is **change**. + * @param { Callback } listener - Callback for the input device event. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param type Type of the input device event, which is **change**. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ - function off(type: "change", listener?: Callback): void; + function off(type: 'change', listener?: Callback): void; /** * Defines axis information about events that can be reported by an input device. * For example, a touchscreen may report information such as x, y, and pressure, * which indicate the x-axis coordinate, y-axis coordinate, and pressure, respectively. * - * @since 8 + * @interface AxisRange * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param source Input source type of the axis. For example, if a mouse reports an x-axis event, the source of the x-axis is the mouse. - * @param axis Type of the axis. for example, the x-axis, y-axis, and pressure axis. - * @param max Maximum value of the data reported on this axis. - * @param min Minimum value of the data reported on this axis. - * @param fuzz Fuzz value of the data reported on this axis. - * @param flat Flat value of the data reported on this axis. - * @param resolution Resolution value of the data reported on this axis. + * @since 8 */ interface AxisRange { /** + * Input source type of the axis. For example, if a mouse reports an x-axis event, + * the source of the x-axis is the mouse. + * + * @type { SourceType } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ source: SourceType; /** + * Type of the axis. for example, the x-axis, y-axis, and pressure axis. + * + * @type { AxisType } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ axis: AxisType; /** + * Maximum value of the data reported on this axis. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ max: number; /** + * Minimum value of the data reported on this axis. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ min: number; /** + * Fuzz value of the data reported on this axis. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ fuzz: number; /** + * Flat value of the data reported on this axis. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ flat: number; /** + * Resolution value of the data reported on this axis. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ resolution: number; @@ -166,65 +233,98 @@ declare namespace inputDevice { /** * Defines the information about an input device. * - * @since 8 + * @interface InputDeviceData * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param name Name of the input device. - * @param sources Source type supported by the input device. For example, if a keyboard is attached with a touchpad, the device has two input sources: keyboard and touchpad. - * @param axisRanges Axis range of the input device. - * @param bus Bus of the input device. - * @param product Product of the input device. - * @param vendor Vendor of the input device. - * @param version Version of the input device. - * @param phys Physical path of the input device. - * @param uniq Unique identifier of the input device. + * @since 8 */ interface InputDeviceData { /** + * Id of the input device. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ id: number; /** + * Name of the input device. + * + * @type { string } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ name: string; /** + * Source type supported by the input device. For example, if a keyboard is attached with a touchpad, + * the device has two input sources: keyboard and touchpad. + * + * @type { Array } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ sources: Array; /** + * Axis range of the input device. + * + * @type { Array } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 8 */ axisRanges: Array; /** + * Bus of the input device. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ bus: number; /** + * Product of the input device. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ product: number; /** + * Vendor of the input device. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ vendor: number; /** + * Version of the input device. + * + * @type { number } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ version: number; /** + * Physical path of the input device. + * + * @type { string } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ phys: string; /** + * Unique identifier of the input device. + * + * @type { string } + * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @since 9 */ uniq: string; @@ -233,9 +333,9 @@ declare namespace inputDevice { /** * Obtains the IDs of all input devices. * - * @since 8 + * @param { AsyncCallback> } callback - Callback function, receive reported data * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param callback Callback function, receive reported data + * @since 8 * @deprecated since 9 * @useinstead ohos.multimodalInput.inputDevice#getDeviceList */ @@ -244,8 +344,9 @@ declare namespace inputDevice { /** * Obtains the IDs of all input devices. * - * @since 8 + * @returns { Promise> } * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 8 * @deprecated since 9 * @useinstead ohos.multimodalInput.inputDevice#getDeviceList */ @@ -254,10 +355,10 @@ declare namespace inputDevice { /** * Obtain the information about an input device. * - * @since 8 + * @param { number } deviceId - ID of the input device whose information is to be obtained. + * @param { AsyncCallback } callback - Callback function, receive reported data * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device whose information is to be obtained. - * @param callback Callback function, receive reported data + * @since 8 * @deprecated since 9 * @useinstead ohos.multimodalInput.inputDevice#getDeviceInfo */ @@ -266,9 +367,10 @@ declare namespace inputDevice { /** * Obtain the information about an input device. * - * @since 8 + * @param { number } deviceId - ID of the input device whose information is to be obtained. + * @returns { Promise } * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device whose information is to be obtained. + * @since 8 * @deprecated since 9 * @useinstead ohos.multimodalInput.inputDevice#getDeviceInfo */ @@ -277,85 +379,87 @@ declare namespace inputDevice { /** * Obtains the IDs of all input devices. * - * @since 9 + * @param { AsyncCallback> } callback - Callback function, receive reported data + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param callback Callback function, receive reported data - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function getDeviceList(callback: AsyncCallback>): void; /** * Obtains the IDs of all input devices. * - * @since 9 + * @returns { Promise> } * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 */ function getDeviceList(): Promise>; /** - * Obtain the information about an input device. - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device whose information is to be obtained. - * @param callback Callback function, receive reported data - * @throws {BusinessError} 401 - Parameter error. - */ + * Obtain the information about an input device. + * + * @param { number } deviceId - ID of the input device whose information is to be obtained. + * @param { AsyncCallback } callback - Callback function, receive reported data + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 + */ function getDeviceInfo(deviceId: number, callback: AsyncCallback): void; /** - * Obtain the information about an input device. - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device whose information is to be obtained. - * @throws {BusinessError} 401 - Parameter error. - */ + * Obtain the information about an input device. + * + * @param { number } deviceId - ID of the input device whose information is to be obtained. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.InputDevice + * @since 9 + */ function getDeviceInfo(deviceId: number): Promise; /** * Checks whether the specified key codes of an input device are supported. * - * @since 9 + * @param { number } deviceId - ID of the input device. + * @param { Array } keys - Key codes of the input device, You can query maximum of five key codes at a time. + * @param { AsyncCallback> } callback -Indicates whether the specified key codes are supported. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device. - * @param keys Key codes of the input device, You can query a maximum of five key codes at a time. - * @returns Returns a result indicating whether the specified key codes are supported. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function supportKeys(deviceId: number, keys: Array, callback: AsyncCallback>): void; /** * Checks whether the specified key codes of an input device are supported. * - * @since 9 + * @param { number } deviceId - ID of the input device. + * @param { Array } keys - Key codes of the input device, You can query maximum of five key codes at a time. + * @returns { Promise> } Returns a result indicating whether the specified key codes are supported. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the input device. - * @param keys Key codes of the input device, You can query a maximum of five key codes at a time. - * @returns Returns a result indicating whether the specified key codes are supported. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function supportKeys(deviceId: number, keys: Array): Promise>; /** * Query the keyboard type of the input device. * - * @since 9 + * @param { number } deviceId - ID of the specified input device. + * @param { AsyncCallback } callback - Returns the keyboard type. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the specified input device. - * @returns Returns the keyboard type. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function getKeyboardType(deviceId: number, callback: AsyncCallback): void; /** * Query the keyboard type of the input device. * - * @since 9 + * @param { number } deviceId - ID of the specified input device. + * @returns { Promise } Returns the keyboard type. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @param deviceId ID of the specified input device. - * @returns Returns the keyboard type. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function getKeyboardType(deviceId: number): Promise; } diff --git a/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts b/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts index c7354eb5d..c315a5c26 100644 --- a/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts +++ b/api/@ohos.multimodalInput.inputDeviceCooperate.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; /** * Events for input devices diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index 79de5c419..e1c99f477 100644 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -1,47 +1,63 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** * InputEvent * - * @since 9 + * @interface InputEvent * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare interface InputEvent { /** * Unique event ID generated by the server + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ id: number; /** * ID of the device that reports the input event + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ deviceId: number; /** * Occurrence time of the input event + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ actionTime: number; /** * ID of the target screen + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ screenId: number; /** * ID of the target window + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ windowId: number; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts index b898d63b3..155c19476 100644 --- a/api/@ohos.multimodalInput.inputEventClient.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -1,55 +1,83 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - - /** - * Global Key Event Injection + * Copyright (C) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * @since 8 - * @syscap SystemCapability.MultimodalInput.Input.InputSimulator - * @systemapi hide for inner use + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ +/** + * Global Key Event Injection + * + * @namespace inputEventClient + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 8 + */ declare namespace inputEventClient { + /** + * Defines event of key that user want to inject. + * + * @interface KeyEvent + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 8 + */ + interface KeyEvent { /** - * Defines event of key that user want to inject. + * The status of key. * - * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputSimulator * @systemapi hide for inner use - * @param isPressed The status of key. - * @param keyCode The keyCode value of key. - * @param keyDownDuration Key hold duration. - * @param isIntercepted Whether the key is blocked. + * @since 8 */ - interface KeyEvent { - isPressed: boolean; - keyCode: number; - keyDownDuration: number; - isIntercepted: boolean; - } + isPressed: boolean; /** - * Inject system keys. + * The keyCode value of key. * - * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputSimulator * @systemapi hide for inner use - * @param KeyEvent the key event to be injected. - * @throws {BusinessError} 401 - Parameter error. + * @since 8 */ - function injectEvent({KeyEvent: KeyEvent}): void; + keyCode: number; + + /** + * Key hold duration. + * + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 8 + */ + keyDownDuration: number; + + /** + * Whether the key is blocked. + * + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 8 + */ + isIntercepted: boolean; + } + + /** + * Inject system keys. + * + * @param { { KeyEvent } } KeyEvent - the key event to be injected. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.InputSimulator + * @systemapi hide for inner use + * @since 8 + */ + function injectEvent({ KeyEvent: KeyEvent }): void; } export default inputEventClient; diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts index ed1835ba8..7bfa21cde 100644 --- a/api/@ohos.multimodalInput.inputMonitor.d.ts +++ b/api/@ohos.multimodalInput.inputMonitor.d.ts @@ -13,86 +13,88 @@ * limitations under the License. */ -import { Callback } from './basic'; +import { Callback } from './@ohos.base'; import { MouseEvent } from './@ohos.multimodalInput.mouseEvent'; /** * Global input event listener * System API, available only to system processes - * @since 7 - * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * + * @namespace inputMonitor * @permission ohos.permission.INPUT_MONITORING + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor * @systemapi hide for inner use + * @since 7 */ declare namespace inputMonitor { - /** - * Callback used to receive touch input events. If **true** is returned, the touch input is consumed, and the system performs the closing operation. - * @since 7 - * @syscap SystemCapability.MultimodalInput.Input.InputMonitor - * @systemapi hide for inner use - */ - interface TouchEventReceiver { - (touchEvent:TouchEvent): Boolean; - } + /** + * Callback used to receive touch input events. If **true** is returned, the touch input is consumed, + * and the system performs the closing operation. + * + * @interface TouchEventReceiver + * @permission ohos.permission.INPUT_MONITORING + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 7 + */ + interface TouchEventReceiver { + (touchEvent: TouchEvent): Boolean; + } - /** - * Listens for touch input events. - * - * @since 7 - * @syscap SystemCapability.MultimodalInput.Input.InputMonitor - * @systemapi hide for inner use - * @permission ohos.permission.INPUT_MONITORING - * @param type Event type, which is **touch**. - * @param receiver Callback used to receive the reported data. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 201 - Permission denied. - */ - function on(type:"touch", receiver:TouchEventReceiver):void; + /** + * Listens for touch input events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'touch' } type - Event type, which is **touch**. + * @param { TouchEventReceiver } receiver - Callback used to receive the reported data. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 7 + */ + function on(type: 'touch', receiver: TouchEventReceiver): void; - /** - * Listens for mouse input events. - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputMonitor - * @systemapi hide for inner use - * @permission ohos.permission.INPUT_MONITORING - * @param type Event type, which is **mouse**. - * @param receiver Callback used to receive the reported data. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 201 - Permission denied. - */ - function on(type:"mouse", receiver:Callback):void; + /** + * Listens for mouse input events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'mouse' } type - Event type, which is **mouse**. + * @param { Callback } receiver - Callback used to receive the reported data. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 9 + */ + function on(type: 'mouse', receiver: Callback): void; - /** - * Cancel listening for touch input events. - * - * @since 7 - * @syscap SystemCapability.MultimodalInput.Input.InputMonitor - * @systemapi hide for inner use - * @permission ohos.permission.INPUT_MONITORING - * @param type Event type, which is **touch**. - * @param receiver Callback used to receive the reported data. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 201 - Permission denied. - */ - function off(type:"touch", receiver?:TouchEventReceiver):void; + /** + * Cancel listening for touch input events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'touch' } type - Event type, which is **touch**. + * @param { TouchEventReceiver } receiver - Callback used to receive the reported data. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 7 + */ + function off(type: 'touch', receiver?: TouchEventReceiver): void; - /** - * Cancel listening for mouse input events. - * - * @since 9 - * @syscap SystemCapability.MultimodalInput.Input.InputMonitor - * @systemapi hide for inner use - * @permission ohos.permission.INPUT_MONITORING - * @param type Event type, which is **mouse**. - * @param receiver Callback used to receive the reported data. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 201 - Permission denied. - */ - function off(type:"mouse", receiver?:Callback):void; + /** + * Cancel listening for mouse input events. + * + * @permission ohos.permission.INPUT_MONITORING + * @param { 'mouse' } type - Event type, which is **mouse**. + * @param { Callback } receiver - Callback used to receive the reported data. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 201 - Permission denied. + * @syscap SystemCapability.MultimodalInput.Input.InputMonitor + * @systemapi hide for inner use + * @since 9 + */ + function off(type: 'mouse', receiver?: Callback): void; } export default inputMonitor; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index f25638ee7..b233cc3c8 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -1,25 +1,25 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS; -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS; + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ /** -* KeyCode -* -* @since 9 -* @syscap SystemCapability.MultimodalInput.Input.Core -*/ - + * KeyCode + * + * @enum { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 + */ export declare enum KeyCode { KEYCODE_FN = 0, KEYCODE_UNKNOWN = -1, @@ -350,5 +350,5 @@ export declare enum KeyCode { KEYCODE_BTN_6 = 3106, KEYCODE_BTN_7 = 3107, KEYCODE_BTN_8 = 3108, - KEYCODE_BTN_9 = 3109, + KEYCODE_BTN_9 = 3109 } diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index d51cf1af5..ff24f65a7 100644 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -1,129 +1,187 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import { InputEvent } from "./@ohos.multimodalInput.inputEvent" -import { KeyCode } from "./@ohos.multimodalInput.keyCode" + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { InputEvent } from './@ohos.multimodalInput.inputEvent'; +import type { KeyCode } from './@ohos.multimodalInput.keyCode'; /** -* Action -* -* @since 9 -* @syscap SystemCapability.MultimodalInput.Input.Core -*/ + * Action + * + * @enum { number } + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 + */ export declare enum Action { /** * Cancel key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ CANCEL = 0, /** * Down key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ DOWN = 1, /** * Up key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - UP = 2, + UP = 2 } /** -* Key -* -* @since 9 -* @syscap SystemCapability.MultimodalInput.Input.Core -*/ + * Key + * + * @interface Key + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 + */ export declare interface Key { /** * Key code + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ code: KeyCode; /** * Time when the key is pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ pressedTime: number; /** * Device to which the key belongs + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ deviceId: number; } /** -* KeyEvent -* -* @since 9 -* @syscap SystemCapability.MultimodalInput.Input.Core -*/ + * KeyEvent + * + * @interface KeyEvent + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 + */ export declare interface KeyEvent extends InputEvent { /** * Key action + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ action: Action; /** * Key that has changed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ key: Key; /** * Unicode character corresponding to the key + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ unicodeChar: number; /** * List of pressed keys + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ keys: Key[]; /** * Whether ctrlKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ ctrlKey: boolean; /** * Whether altKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ altKey: boolean; /** * Whether shiftKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ shiftKey: boolean; /** * Whether logoKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ logoKey: boolean; /** * Whether fnKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ fnKey: boolean; /** * Whether capsLock is active + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ capsLock: boolean; /** * Whether numLock is active + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ numLock: boolean; /** * Whether scrollLock is active + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ scrollLock: boolean; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 7828872e9..069bdea0d 100644 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -1,107 +1,155 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import { InputEvent } from "./@ohos.multimodalInput.inputEvent" -import { KeyCode } from "./@ohos.multimodalInput.keyCode" + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { InputEvent } from './@ohos.multimodalInput.inputEvent'; +import type { KeyCode } from './@ohos.multimodalInput.keyCode'; /** * Action * - * @since 9 + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare enum Action { /** * Cancel + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ CANCEL = 0, /** * Moving of the mouse pointer + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ MOVE = 1, /** * Pressing down of the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ BUTTON_DOWN = 2, /** * Lifting of the mouse button + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ BUTTON_UP = 3, /** * Beginning of the axis event associated with the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ AXIS_BEGIN = 4, /** * Updating of the axis event associated with the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ AXIS_UPDATE = 5, /** * Ending of the axis event associated with the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - AXIS_END = 6, + AXIS_END = 6 } /** * Mouse button * - * @since 9 + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare enum Button { /** * Left button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ LEFT = 0, /** * Middle button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ MIDDLE = 1, /** * Right button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ RIGHT = 2, /** * Side button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ SIDE = 3, /** * Extended button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ EXTRA = 4, /** * Forward button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ FORWARD = 5, /** * Back button on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ BACK = 6, /** * Task key on the mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ TASK = 7 } @@ -109,143 +157,219 @@ export declare enum Button { /** * Axis * - * @since 9 + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare enum Axis { /** * Vertical scroll axis + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ SCROLL_VERTICAL = 0, /** * Horizontal scroll axis + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ SCROLL_HORIZONTAL = 1, /** * Pinch axis + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - PINCH = 2, + PINCH = 2 } /** * AxisValue * - * @since 9 + * @interface AxisValue * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare interface AxisValue { /** * Axis type + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ axis: Axis; /** * Axis value + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - value: number + value: number; } /** * MouseEvent * - * @since 9 + * @interface MouseEvent * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare interface MouseEvent extends InputEvent { /** * Mouse event action + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ action: Action; /** * X coordinate of the mouse pointer on the screen + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ screenX: number; /** * Y coordinate of the mouse pointer on the screen + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ screenY: number; /** * X coordinate of the mouse pointer in the window + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ windowX: number; /** * Y coordinate of the mouse pointer in the window + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ windowY: number; /** - * X axis offset relative to the previous reported mouse pointer position. When the mouse pointer is at the edge of the screen, the value may be less than the difference of the X coordinate reported twice. + * X axis offset relative to the previous reported mouse pointer position. When the mouse pointer is at + * the edge of the screen, the value may be less than the difference of the X coordinate reported twice. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ rawDeltaX: number; /** * Y axis offset relative to the previous reported mouse pointer position + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ rawDeltaY: number; /** * Button that is currently pressed or released + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ button: Button; /** * Button that is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ pressedButtons: Button[]; /** * All axis data contained in the event + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ axes: AxisValue[]; /** * List of pressed keys + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ pressedKeys: KeyCode[]; /** * Whether ctrlKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ ctrlKey: boolean; /** * Whether altKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ altKey: boolean; /** * Whether shiftKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ shiftKey: boolean; /** * Whether logoKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ logoKey: boolean; /** * Whether fnKey is being pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - fnKey:boolean - + fnKey: boolean; + /** * Whether capsLock is active + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - capsLock:boolean - + capsLock: boolean; + /** * Whether numLock is active + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - numLock:boolean - + numLock: boolean; + /** * Whether scrollLock is active + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - scrollLock:boolean + scrollLock: boolean; } \ No newline at end of file diff --git a/api/@ohos.multimodalInput.pointer.d.ts b/api/@ohos.multimodalInput.pointer.d.ts index b323bbeee..e5a5a84db 100644 --- a/api/@ohos.multimodalInput.pointer.d.ts +++ b/api/@ohos.multimodalInput.pointer.d.ts @@ -1,232 +1,352 @@ /* -* Copyright (c) 2022-2023 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ -import { AsyncCallback } from "./basic"; +import type { AsyncCallback } from './basic'; /** * Declares interfaces related to mouse pointer attributes. * - * @since 9 + * @namespace pointer * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ declare namespace pointer { /** * Pointer style. - * - * @since 9 + * + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ enum PointerStyle { /** * Default + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ DEFAULT, /** * East arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ EAST, /** * West arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ WEST, /** * South arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ SOUTH, /** * North arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ NORTH, /** * East-west arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ WEST_EAST, /** * North-south arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ NORTH_SOUTH, /** * North-east arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ NORTH_EAST, /** * North-west arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ NORTH_WEST, /** * South-east arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ SOUTH_EAST, /** * South-west arrow + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ SOUTH_WEST, /** * Northeast and southwest adjustment + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ NORTH_EAST_SOUTH_WEST, /** * Northwest and southeast adjustment + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ NORTH_WEST_SOUTH_EAST, /** * Cross (accurate selection) + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ CROSS, /** * Copy + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ CURSOR_COPY, /** * Forbid + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ CURSOR_FORBID, /** * Sucker + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ COLOR_SUCKER, /** * Grabbing hand + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ HAND_GRABBING, /** * Opening hand + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ HAND_OPEN, /** * Hand-shaped pointer + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ HAND_POINTING, /** * Help + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ HELP, /** * Move + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MOVE, /** * Left and right resizing + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ RESIZE_LEFT_RIGHT, /** * Up and down resizing + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ RESIZE_UP_DOWN, /** * Screenshot crosshair + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ SCREENSHOT_CHOOSE, /** * Screenshot + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ SCREENSHOT_CURSOR, /** * Text selection + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ TEXT_CURSOR, /** * Zoom in + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ ZOOM_IN, /** * Zoom out + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ ZOOM_OUT, /** * Scrolling east + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_EAST, /** * Scrolling west + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_WEST, /** * Scrolling south + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_SOUTH, /** * Scrolling north + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_NORTH, /** * Scrolling north and south + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_NORTH_SOUTH, /** * Scrolling northeast + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_NORTH_EAST, /** * Scrolling northwest + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_NORTH_WEST, /** * Scrolling southeast + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_SOUTH_EAST, /** * Scrolling southwest + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ MIDDLE_BTN_SOUTH_WEST, /** * Moving as a cone in four directions + * + * @syscap SystemCapability.MultimodalInput.Input.Pointer + * @since 9 */ - MIDDLE_BTN_NORTH_SOUTH_WEST_EAST, + MIDDLE_BTN_NORTH_SOUTH_WEST_EAST } /** * Mouse button. + * * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Pointer * @since 10 @@ -234,12 +354,14 @@ declare namespace pointer { enum PrimaryButton { /** * Left mouse button + * * @syscap SystemCapability.MultimodalInput.Input.Pointer * @since 10 */ LEFT = 0, /** * Right mouse button + * * @syscap SystemCapability.MultimodalInput.Input.Pointer * @since 10 */ @@ -248,141 +370,144 @@ declare namespace pointer { /** * Sets the pointer moving speed. - * - * @since 9 + * + * @param { number } speed - Pointer moving speed, which is any number. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use - * @param speed Pointer moving speed, which is any number. - * @param callback Callback used to return the result. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function setPointerSpeed(speed: number, callback: AsyncCallback): void; /** * Sets the pointer moving speed. - * - * @since 9 + * + * @param { number } speed - Pointer moving speed, which is any number. + * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use - * @param speed Pointer moving speed, which is any number. - * @returns Returns the result through a promise. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function setPointerSpeed(speed: number): Promise; /** * Queries the pointer moving speed. - * - * @since 9 + * + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use - * @param callback Callback used to return the result. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function getPointerSpeed(callback: AsyncCallback): void; /** * Queries the pointer moving speed. - * - * @since 9 + * + * @returns { Promise } Returns the result through a promise. * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use - * @returns Returns the result through a promise. + * @since 9 */ function getPointerSpeed(): Promise; /** * Sets the pointer style. - * - * @since 9 + * + * @param { number } windowId - Window ID. + * @param { PointerStyle } pointerStyle - Pointer style. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @param windowId Window ID. - * @param pointerStyle Pointer style. - * @param callback Callback used to return the result. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback): void; /** * Sets the pointer style. - * - * @since 9 + * + * @param { number } windowId - Window ID. + * @param { PointerStyle } pointerStyle - Pointer style. + * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @param windowId Window ID. - * @param pointerStyle Pointer style. - * @returns Returns the result through a promise. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise; /** * Queries the pointer style. - * - * @since 9 + * + * @param { number } windowId - Window ID. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @param windowId Window ID. - * @param callback Callback used to return the result. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function getPointerStyle(windowId: number, callback: AsyncCallback): void; /** * Queries the pointer style. - * - * @since 9 + * + * @param { number } windowId - Window ID. + * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @param windowId Window ID. - * @returns Returns the result through a promise. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function getPointerStyle(windowId: number): Promise; /** * Sets whether the pointer icon is visible. * - * @since 9 + * @param { boolean } visible Whether the pointer icon is visible. The value true indicates that the pointer + * icon is visible, and the value false indicates the opposite. + * @param { AsyncCallback } callback - Callback for the input device event. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @param visible Whether the pointer icon is visible. The value true indicates that the pointer icon is visible, - * and the value false indicates the opposite. - * @returns Callback for the input device event. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function setPointerVisible(visible: boolean, callback: AsyncCallback): void; /** * Sets whether the pointer icon is visible. * - * @since 9 + * @param { boolean } visible Whether the pointer icon is visible. The value true indicates that the pointer + * icon is visible, and the value false indicates the opposite. + * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @param visible Whether the pointer icon is visible. The value true indicates that the pointer icon is visible, - * and the value false indicates the opposite. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function setPointerVisible(visible: boolean): Promise; /** * Checks whether the pointer icon is visible. * - * @since 9 + * @param { AsyncCallback } callback - Returns true if the pointer icon is visible, + * returns false otherwise. + * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @returns Returns true if the pointer icon is visible; returns false otherwise. - * @throws {BusinessError} 401 - Parameter error. + * @since 9 */ function isPointerVisible(callback: AsyncCallback): void; /** * Checks whether the pointer icon is visible. * - * @since 9 + * @returns { Promise } Returns true if the pointer icon is visible; returns false otherwise. * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @returns Returns true if the pointer icon is visible; returns false otherwise. + * @since 9 */ function isPointerVisible(): Promise; /** * Sets mouse primary button. - * @param { PrimaryButton } primary - Indicates mouse primary button. The value LEFT indicates that mouse primary button is - * left button, and the value RIGHT indicates that mouse primary button is right button. + * + * @param { PrimaryButton } primary - Indicates mouse primary button. The value LEFT indicates that mouse primary + * button is left button, and the value RIGHT indicates that mouse primary button is right button. * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer @@ -393,8 +518,9 @@ declare namespace pointer { /** * Sets mouse primary button. - * @param { PrimaryButton } primary - Indicates mouse primary button. The value LEFT indicates that mouse primary button is - * left button, and the value RIGHT indicates that mouse primary button is right button. + * + * @param { PrimaryButton } primary - Indicates mouse primary button. The value LEFT indicates that mouse primary + * button is left button, and the value RIGHT indicates that mouse primary button is right button. * @returns { Promise } Returns the result through a promise. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer @@ -405,6 +531,7 @@ declare namespace pointer { /** * Gets mouse primary button. + * * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer @@ -415,6 +542,7 @@ declare namespace pointer { /** * Gets mouse primary button. + * * @returns { Promise } Returns the result through a promise. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer @@ -425,6 +553,7 @@ declare namespace pointer { /** * Sets whether the mouse hover scroll is enabled in inactive window. + * * @param { boolean } state - Indicates whether the mouse hover scroll is enabled in inactive window. The value true * indicates that the mouse hover scroll is enabled, and the value false indicates the opposite. * @param { AsyncCallback } callback - Callback used to return the result. @@ -437,6 +566,7 @@ declare namespace pointer { /** * Sets whether mouse hover scroll is enabled in inactive window. + * * @param { boolean } state - Indicates whether the mouse hover scroll is enabled in inactive window. The value true * indicates that the mouse hover scroll is enabled, and the value false indicates the opposite. * @returns { Promise } Returns the result through a promise. @@ -449,6 +579,7 @@ declare namespace pointer { /** * Gets a status whether the mouse hover scroll is enabled in inactive window. + * * @param { AsyncCallback } callback - Callback used to return the result. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer @@ -459,6 +590,7 @@ declare namespace pointer { /** * Gets a status whether mouse hover scroll is enabled in inactive window. + * * @returns { Promise } Returns the result through a promise. * @throws { BusinessError } 401 - Parameter error. * @syscap SystemCapability.MultimodalInput.Input.Pointer diff --git a/api/@ohos.multimodalInput.shortKey.d.ts b/api/@ohos.multimodalInput.shortKey.d.ts new file mode 100644 index 000000000..140f5a3e4 --- /dev/null +++ b/api/@ohos.multimodalInput.shortKey.d.ts @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2023 Huawei Device Co., Ltd. +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +import type { AsyncCallback } from './basic'; +/** + * Declares interfaces related to short key attributes. + * + * @namespace shortKey + * @syscap SystemCapability.MultimodalInput.Input.ShortKey + * @systemapi hide for inner use + * @since 10 + */ +declare namespace shortKey { + /** + * Sets short key down duration. + * @param { string } businessKey - The key for business which should be applied to MMI. + * @param { number } delay - Duration of short key press which should be limited to 0-4000ms. + * @param { AsyncCallback } callback - Callback used to return the result. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.ShortKey + * @systemapi hide for inner use + * @since 10 + */ + function setKeyDownDuration(businessKey: string, delay: number, callback: AsyncCallback): void; + + /** + * Sets short key down duration. + * @param { string } businessKey - The key for business which should be applied to MMI. + * @param { number } delay - Duration of short key press which should be limited to 0-4000ms. + * @returns { Promise } Returns the result through a promise. + * @throws { BusinessError } 401 - Parameter error. + * @syscap SystemCapability.MultimodalInput.Input.ShortKey + * @systemapi hide for inner use + * @since 10 + */ + function setKeyDownDuration(businessKey: string, delay: number): Promise; + +} +export default shortKey; \ No newline at end of file diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index 574889033..ef9ae1e5c 100644 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -1,209 +1,310 @@ /* -* Copyright (c) 2022 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import { InputEvent } from './@ohos.multimodalInput.inputEvent' + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { InputEvent } from './@ohos.multimodalInput.inputEvent'; /** * Action * - * @since 9 + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare enum Action { /** * Touch cancelled + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ CANCEL = 0, /** * Touch pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ DOWN = 1, /** * Touch moved + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ MOVE = 2, /** * Touch lifted + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - UP = 3, + UP = 3 } /** * ToolType * - * @since 9 + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare enum ToolType { /** * Finger + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ FINGER = 0, /** * Stylus + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ PEN = 1, /** * Rubber + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ RUBBER = 2, /** * Brush + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ BRUSH = 3, /** * Pencil + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ PENCIL = 4, /** * Air brush + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ AIRBRUSH = 5, /** * Mouse + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ MOUSE = 6, - LENS = 7, + LENS = 7 } /** * SourceType * - * @since 9 + * @enum { number } * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare enum SourceType { /** * Touchscreen + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ TOUCH_SCREEN = 0, /** * Stylus + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ PEN = 1, /** * Touchpad + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ - TOUCH_PAD = 2, + TOUCH_PAD = 2 } /** * Touch * - * @since 9 + * @interface Touch * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare interface Touch { /** * Pointer identifier + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ id: number; /** * Time stamp when touch is pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ pressedTime: number; /** * X coordinate of the touch position on the screen + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ screenX: number; /** * Y coordinate of the touch position on the screen + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ screenY: number; /** * X coordinate of the touch position in the window + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ windowX: number; /** * Y coordinate of the touch position in the window + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ windowY: number; /** * Pressure value. The value range is [0.0, 1.0]. The value 0.0 indicates that the pressure is not supported. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ pressure: number; /** * Width of the contact area when touch is pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ width: number; /** * Height of the contact area when touch is pressed + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ height: number; /** * Angle relative to the YZ plane. The value range is [-90, 90]. A positive value indicates a rightward tilt. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ tiltX: number; /** * Angle relative to the XZ plane. The value range is [-90, 90]. A positive value indicates a downward tilt. + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ tiltY: number; /** * Center point X of the tool area + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ toolX: number; /** * Center point Y of the tool area + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ toolY: number; /** * Width of the tool area + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ toolWidth: number; /** * Height of the tool area + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ toolHeight: number; /** * X coordinate of the input device + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ rawX: number; /** * Y coordinate of the input device + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ rawY: number; /** * Tool type + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ toolType: ToolType; } @@ -211,27 +312,40 @@ export declare interface Touch { /** * TouchEvent * - * @since 9 + * @interface TouchEvent * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ export declare interface TouchEvent extends InputEvent { /** * Touch action + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ action: Action; /** * Current touch point + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ touch: Touch; /** * All touch points + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ touches: Touch[]; /** * Device type of the touch source + * + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 9 */ sourceType: SourceType; } \ No newline at end of file diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index a6746e8a6..d8e585045 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; import http from "./@ohos.net.http"; import socket from "./@ohos.net.socket"; diff --git a/api/@ohos.net.ethernet.d.ts b/api/@ohos.net.ethernet.d.ts index 127d892e8..4234add13 100644 --- a/api/@ohos.net.ethernet.d.ts +++ b/api/@ohos.net.ethernet.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; /** * Provides interfaces to manage ethernet. diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts index 54dc91ec0..49ebab9a5 100644 --- a/api/@ohos.net.http.d.ts +++ b/api/@ohos.net.http.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; import connection from "./@ohos.net.connection"; /** @@ -30,54 +30,64 @@ declare namespace http { /** * Creates an HTTP request task. + * @crossplatform */ function createHttp(): HttpRequest; export interface HttpRequestOptions { /** * Request method. + * @crossplatform */ method?: RequestMethod; // default is GET /** * Additional data of the request. * extraData can be a string or an Object (API 6) or an ArrayBuffer(API 8). + * @crossplatform */ extraData?: string | Object | ArrayBuffer; /** * Data type to be returned. If this parameter is set, the system preferentially returns the specified type. * + * @crossplatform * @since 9 */ expectDataType?: HttpDataType; /** + * @crossplatform * @since 9 */ usingCache?: boolean; // default is true /** + * @crossplatform * @since 9 */ priority?: number; // [1, 1000], default is 1. /** * HTTP request header. + * @crossplatform */ header?: Object; // default is 'content-type': 'application/json' /** * Read timeout period. The default value is 60,000, in ms. + * @crossplatform */ readTimeout?: number; // default is 60s /** * Connection timeout interval. The default value is 60,000, in ms. + * @crossplatform */ connectTimeout?: number; // default is 60s. /** + * @crossplatform * @since 9 */ usingProtocol?: HttpProtocol; // default is automatically specified by the system. @@ -137,6 +147,7 @@ declare namespace http { * @throws {BusinessError} 2300078 - Remote file not found. * @throws {BusinessError} 2300094 - An authentication function returned an error. * @throws {BusinessError} 2300999 - Unknown Other Error. + * @crossplatform */ request(url: string, callback: AsyncCallback): void; request(url: string, options: HttpRequestOptions, callback: AsyncCallback): void; @@ -272,6 +283,7 @@ declare namespace http { /** * Destroys an HTTP request. + * @crossplatform */ destroy(): void; @@ -294,6 +306,7 @@ declare namespace http { /** * Registers an observer for HTTP Response Header events. * + * @crossplatform * @since 8 */ on(type: "headersReceive", callback: Callback): void; @@ -301,6 +314,7 @@ declare namespace http { /** * Unregisters the observer for HTTP Response Header events. * + * @crossplatform * @since 8 */ off(type: "headersReceive", callback?: Callback): void; @@ -308,6 +322,7 @@ declare namespace http { /** * Registers a one-time observer for HTTP Response Header events. * + * @crossplatform * @since 8 */ once(type: "headersReceive", callback: Callback): void; @@ -355,6 +370,9 @@ declare namespace http { off(type: "dataProgress", callback?: Callback<{ receiveSize: number, totalSize: number }>): void; } + /** + * @crossplatform + */ export enum RequestMethod { OPTIONS = "OPTIONS", GET = "GET", @@ -365,7 +383,10 @@ declare namespace http { TRACE = "TRACE", CONNECT = "CONNECT" } - + + /** + * @crossplatform + */ export enum ResponseCode { OK = 200, CREATED, @@ -407,6 +428,7 @@ declare namespace http { /** * Supported protocols. * + * @crossplatform * @since 9 */ export enum HttpProtocol { @@ -417,19 +439,23 @@ declare namespace http { /** * Indicates the type of the returned data. * + * @crossplatform * @since 9 */ export enum HttpDataType { /** * The returned type is string. + * @crossplatform */ STRING, /** * The returned type is Object. + * @crossplatform */ OBJECT = 1, /** * The returned type is ArrayBuffer. + * @crossplatform */ ARRAY_BUFFER = 2, } @@ -438,6 +464,7 @@ declare namespace http { /** * result can be a string (API 6) or an ArrayBuffer(API 8). Object is deprecated from API 8. * If {@link HttpRequestOptions#expectDataType} is set, the system preferentially returns this parameter. + * @crossplatform */ result: string | Object | ArrayBuffer; @@ -446,21 +473,25 @@ declare namespace http { * If the resultType is Object, you can get result such as this: result['key']. * If the resultType is ArrayBuffer, you can use ArrayBuffer to create the binary objects. * + * @crossplatform * @since 9 */ resultType: HttpDataType; /** * Server status code. + * @crossplatform */ responseCode: ResponseCode | number; /** * All headers in the response from the server. + * @crossplatform */ header: Object; /** + * @crossplatform * @since 8 */ cookies: string; @@ -470,22 +501,26 @@ declare namespace http { * Creates a default {@code HttpResponseCache} object to store the responses of HTTP access requests. * * @param cacheSize the size of cache(max value is 10MB), default is 10*1024*1024(10MB). + * @crossplatform * @since 9 */ function createHttpResponseCache(cacheSize?: number): HttpResponseCache; /** + * @crossplatform * @since 9 */ export interface HttpResponseCache { /** * Writes data in the cache to the file system so that all the cached data can be accessed in the next HTTP request. + * @crossplatform */ flush(callback: AsyncCallback): void; flush(): Promise; /** * Disables a cache and deletes the data in it. + * @crossplatform */ delete(callback: AsyncCallback): void; delete(): Promise; diff --git a/api/@ohos.net.mdns.d.ts b/api/@ohos.net.mdns.d.ts index e338ef212..9bf401e59 100644 --- a/api/@ohos.net.mdns.d.ts +++ b/api/@ohos.net.mdns.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; import connection from "./@ohos.net.connection"; import Context from "./application/Context"; @@ -141,14 +141,14 @@ declare namespace mdns { * @since 10 */ on(type: 'discoveryStart', - callback: Callback<{serviceInfo: LocalServiceInfo, errorCode?: MDNS_ERR}>): void; + callback: Callback<{serviceInfo: LocalServiceInfo, errorCode?: MdnsError}>): void; /** * Enables listening for discoveryStop events of mDNS services. * @since 10 */ on(type: 'discoveryStop', - callback: Callback<{serviceInfo: LocalServiceInfo, errorCode?: MDNS_ERR}>): void; + callback: Callback<{serviceInfo: LocalServiceInfo, errorCode?: MdnsError}>): void; /** * Enables listening for serviceFound events of mDNS services. @@ -216,7 +216,7 @@ declare namespace mdns { value: Array; } - export enum MDNS_ERR { + export enum MdnsError { /** * Indicates that the operation failed due to internal error. * @since 10 diff --git a/api/@ohos.net.sharing.d.ts b/api/@ohos.net.sharing.d.ts index 2e5682bb9..22ed32050 100644 --- a/api/@ohos.net.sharing.d.ts +++ b/api/@ohos.net.sharing.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; import connection from "./@ohos.net.connection"; /** diff --git a/api/@ohos.net.socket.d.ts b/api/@ohos.net.socket.d.ts index 90ccebadc..53f25e75b 100644 --- a/api/@ohos.net.socket.d.ts +++ b/api/@ohos.net.socket.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback, ErrorCallback} from "./basic"; +import {AsyncCallback, Callback, ErrorCallback} from "./@ohos.base"; import connection from "./@ohos.net.connection"; import cert from "./@ohos.security.cert"; @@ -28,23 +28,27 @@ declare namespace socket { /** * Deposit certificate * + * @crossplatform * @since 9 */ export type X509CertRawData = cert.EncodingBlob; /** * Creates a UDPSocket object. + * @crossplatform */ function constructUDPSocketInstance(): UDPSocket; /** * Creates a TCPSocket object. + * @crossplatform */ function constructTCPSocketInstance(): TCPSocket; /** * Creates a TLSSocket object. * + * @crossplatform * @since 9 */ function constructTLSSocketInstance(): TLSSocket; @@ -52,11 +56,13 @@ declare namespace socket { export interface UDPSendOptions { /** * Data to send. + * @crossplatform */ data: string | ArrayBuffer; /** * Destination address. + * @crossplatform */ address: NetAddress; } @@ -64,21 +70,25 @@ declare namespace socket { export interface ExtraOptionsBase { /** * Size of the receive buffer, in MBS. + * @crossplatform */ receiveBufferSize?: number; /** * Size of the send buffer, in MBS. + * @crossplatform */ sendBufferSize?: number; /** * Whether to reuse addresses. The default value is false. + * @crossplatform */ reuseAddress?: boolean; /** * Timeout duration of the UDPSocket connection, in milliseconds. + * @crossplatform */ socketTimeout?: number; } @@ -86,6 +96,7 @@ declare namespace socket { export interface UDPExtraOptions extends ExtraOptionsBase { /** * Whether to send broadcast messages. The default value is false. + * @crossplatform */ broadcast?: boolean; } @@ -93,16 +104,19 @@ declare namespace socket { export interface SocketStateBase { /** * Whether the connection is in the bound state. + * @crossplatform */ isBound: boolean; /** * Whether the connection is in the closed state. + * @crossplatform */ isClose: boolean; /** * Whether the connection is in the connected state. + * @crossplatform */ isConnected: boolean; } @@ -110,21 +124,25 @@ declare namespace socket { export interface SocketRemoteInfo { /** * Bound IP address. + * @crossplatform */ address: string; /** * Network protocol type. The options are as follows: IPv4, IPv6. + * @crossplatform */ family: 'IPv4' | 'IPv6'; /** * Port number. The value ranges from 0 to 65535. + * @crossplatform */ port: number; /** * Length of the server response message, in bytes. + * @crossplatform */ size: number; } @@ -137,6 +155,7 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ bind(address: NetAddress, callback: AsyncCallback): void; bind(address: NetAddress): Promise; @@ -148,6 +167,7 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ send(options: UDPSendOptions, callback: AsyncCallback): void; send(options: UDPSendOptions): Promise; @@ -156,6 +176,7 @@ declare namespace socket { * Closes a UDPSocket connection. * @permission ohos.permission.INTERNET * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ close(callback: AsyncCallback): void; close(): Promise; @@ -166,6 +187,7 @@ declare namespace socket { * @param callback Callback used to return the result. {@link SocketStateBase}. * @permission ohos.permission.INTERNET * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ getState(callback: AsyncCallback): void; getState(): Promise; @@ -177,37 +199,44 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback): void; setExtraOptions(options: UDPExtraOptions): Promise; /** * Listens for message receiving events of the UDPSocket connection. + * @crossplatform */ on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; /** * Cancels listening for message receiving events of the UDPSocket connection. + * @crossplatform */ off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; /** * Listens for data packet message events or close events of the UDPSocket connection. + * @crossplatform */ on(type: 'listening' | 'close', callback: Callback): void; /** * Cancels listening for data packet message events or close events of the UDPSocket connection. + * @crossplatform */ off(type: 'listening' | 'close', callback?: Callback): void; /** * Listens for error events of the UDPSocket connection. + * @crossplatform */ on(type: 'error', callback: ErrorCallback): void; /** * Cancels listening for error events of the UDPSocket connection. + * @crossplatform */ off(type: 'error', callback?: ErrorCallback): void; } @@ -215,11 +244,13 @@ declare namespace socket { export interface TCPConnectOptions { /** * Bound IP address and port number. + * @crossplatform */ address: NetAddress; /** * Timeout duration of the TCPSocket connection, in milliseconds. + * @crossplatform */ timeout?: number; } @@ -227,11 +258,13 @@ declare namespace socket { export interface TCPSendOptions { /** * Data to send. + * @crossplatform */ data: string | ArrayBuffer; /** * Character encoding format. + * @crossplatform */ encoding?: string; } @@ -239,21 +272,25 @@ declare namespace socket { export interface TCPExtraOptions extends ExtraOptionsBase { /** * Whether to keep the connection alive. The default value is false. + * @crossplatform */ keepAlive?: boolean; /** * Whether to enable OOBInline. The default value is false. + * @crossplatform */ OOBInline?: boolean; /** * Whether to enable no-delay on the TCPSocket connection. The default value is false. + * @crossplatform */ TCPNoDelay?: boolean; /** * Socket linger. + * @crossplatform */ socketLinger?: {on: boolean, linger: number}; } @@ -266,6 +303,7 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ bind(address: NetAddress, callback: AsyncCallback): void; bind(address: NetAddress): Promise; @@ -277,6 +315,7 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ connect(options: TCPConnectOptions, callback: AsyncCallback): void; connect(options: TCPConnectOptions): Promise; @@ -288,6 +327,7 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ send(options: TCPSendOptions, callback: AsyncCallback): void; send(options: TCPSendOptions): Promise; @@ -296,6 +336,7 @@ declare namespace socket { * Closes a TCPSocket connection. * @permission ohos.permission.INTERNET * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ close(callback: AsyncCallback): void; close(): Promise; @@ -306,6 +347,7 @@ declare namespace socket { * @param callback Callback used to return the result. {@link NetAddress} * @permission ohos.permission.INTERNET * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ getRemoteAddress(callback: AsyncCallback): void; getRemoteAddress(): Promise; @@ -316,6 +358,7 @@ declare namespace socket { * @param callback Callback used to return the result. {@link SocketStateBase} * @permission ohos.permission.INTERNET * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ getState(callback: AsyncCallback): void; getState(): Promise; @@ -327,42 +370,50 @@ declare namespace socket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback): void; setExtraOptions(options: TCPExtraOptions): Promise; /** * Listens for message receiving events of the TCPSocket connection. + * @crossplatform */ on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; /** * Cancels listening for message receiving events of the TCPSocket connection. + * @crossplatform */ off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; /** * Listens for connection or close events of the TCPSocket connection. + * @crossplatform */ on(type: 'connect' | 'close', callback: Callback): void; /** * Cancels listening for connection or close events of the TCPSocket connection. + * @crossplatform */ off(type: 'connect' | 'close', callback?: Callback): void; /** * Listens for error events of the TCPSocket connection. + * @crossplatform */ on(type: 'error', callback: ErrorCallback): void; /** * Cancels listening for error events of the TCPSocket connection. + * @crossplatform */ off(type: 'error', callback?: ErrorCallback): void; } /** + * @crossplatform * @since 9 */ export interface TLSSocket { @@ -376,6 +427,7 @@ declare namespace socket { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 2303198 - Address already in use. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ bind(address: NetAddress, callback: AsyncCallback): void; bind(address: NetAddress): Promise; @@ -386,6 +438,7 @@ declare namespace socket { * @param callback Callback used to return the result. {@link NetAddress} * @throws {BusinessError} 2303188 - Socket operation on non-socket. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getRemoteAddress(callback: AsyncCallback): void; getRemoteAddress(): Promise; @@ -396,6 +449,7 @@ declare namespace socket { * @param callback Callback used to return the result. {@link SocketStateBase} * @throws {BusinessError} 2303188 - Socket operation on non-socket. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getState(callback: AsyncCallback): void; getState(): Promise; @@ -407,6 +461,7 @@ declare namespace socket { * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 2303188 - Socket operation on non-socket. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback): void; setExtraOptions(options: TCPExtraOptions): Promise; @@ -415,6 +470,7 @@ declare namespace socket { * Listens for message receiving events of the TLSSocket connection. * * @throws {BusinessError} 401 - Parameter error. + * @crossplatform */ on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; @@ -422,6 +478,7 @@ declare namespace socket { * Cancels listening for message receiving events of the TLSSocket connection. * * @throws {BusinessError} 401 - Parameter error. + * @crossplatform */ off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; @@ -429,6 +486,7 @@ declare namespace socket { * Listens for connection or close events of the TLSSocket connection. * * @throws {BusinessError} 401 - Parameter error. + * @crossplatform */ on(type: 'connect' | 'close', callback: Callback): void; @@ -436,6 +494,7 @@ declare namespace socket { * Cancels listening for connection or close events of the TLSSocket connection. * * @throws {BusinessError} 401 - Parameter error. + * @crossplatform */ off(type: 'connect' | 'close', callback?: Callback): void; @@ -443,6 +502,7 @@ declare namespace socket { * Listens for error events of the TLSSocket connection. * * @throws {BusinessError} 401 - Parameter error. + * @crossplatform */ on(type: 'error', callback: ErrorCallback): void; @@ -450,6 +510,7 @@ declare namespace socket { * Cancels listening for error events of the TLSSocket connection. * * @throws {BusinessError} 401 - Parameter error. + * @crossplatform */ off(type: 'error', callback?: ErrorCallback): void; @@ -459,6 +520,7 @@ declare namespace socket { * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2303504 - Error looking up x509 * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getCertificate(callback: AsyncCallback): void; getCertificate(): Promise; @@ -470,6 +532,7 @@ declare namespace socket { * * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getRemoteCertificate(callback: AsyncCallback): void; getRemoteCertificate(): Promise; @@ -482,6 +545,7 @@ declare namespace socket { * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2303505 - Error occurred in the tls system call. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getProtocol(callback: AsyncCallback): void; getProtocol(): Promise; @@ -494,6 +558,7 @@ declare namespace socket { * @throws {BusinessError} 2303502 - Error in tls reading. * @throws {BusinessError} 2303505 - Error occurred in the tls system call. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getCipherSuite(callback: AsyncCallback>): void; getCipherSuite(): Promise>; @@ -504,6 +569,7 @@ declare namespace socket { * * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ getSignatureAlgorithms(callback: AsyncCallback>): void; getSignatureAlgorithms(): Promise>; @@ -528,6 +594,7 @@ declare namespace socket { * @throws {BusinessError} 2303505 - Error occurred in the tls system call. * @throws {BusinessError} 2303506 - Error clearing tls connection. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ connect(options: TLSConnectOptions, callback: AsyncCallback): void; connect(options: TLSConnectOptions): Promise; @@ -542,6 +609,7 @@ declare namespace socket { * @throws {BusinessError} 2303505 - Error occurred in the tls system call. * @throws {BusinessError} 2303506 - Error clearing tls connection. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ send(data: string, callback: AsyncCallback): void; send(data: string): Promise; @@ -554,42 +622,50 @@ declare namespace socket { * @throws {BusinessError} 2303505 - Error occurred in the tls system call. * @throws {BusinessError} 2303506 - Error clearing tls connection. * @throws {BusinessError} 2300002 - System internal error. + * @crossplatform */ close(callback: AsyncCallback): void; close(): Promise; } /** + * @crossplatform * @since 9 */ export interface TLSSecureOptions { /** * Certificate used to verify the identity of the server + * @crossplatform */ ca: string | Array; /** * Certificate proving the identity of the client + * @crossplatform */ cert?: string; /** * Private key of client certificate + * @crossplatform */ key?: string; /** * Password of the private key + * @crossplatform */ password?: string; /** * TLS protocol version + * @crossplatform */ protocols?: Protocol | Array; /** * default is false, use local cipher. + * @crossplatform */ useRemoteCipherPrefer?: boolean; @@ -597,16 +673,19 @@ declare namespace socket { * Supported signature algorithms. This string can contain summary algorithms(SHA256、MD5、etc)、 * Public key algorithm(RSA-PSS、ECDSA、etc)、Combination of the two(For example 'RSA+SHA384') * or TLS v1.3 Scheme name(For example rsa_pss_pss_sha512) + * @crossplatform */ signatureAlgorithms?: string; /** * Crypto suite specification + * @crossplatform */ cipherSuite?: string; } /** + * @crossplatform * @since 9 */ export interface TLSConnectOptions { @@ -615,11 +694,13 @@ declare namespace socket { /** * Application layer protocol negotiation extension, such as "spdy/1", "http/1.1", "h2" + * @crossplatform */ ALPNProtocols?: Array; } /** + * @crossplatform * @since 9 */ export enum Protocol { diff --git a/api/@ohos.net.webSocket.d.ts b/api/@ohos.net.webSocket.d.ts index d06587146..d04743d8e 100644 --- a/api/@ohos.net.webSocket.d.ts +++ b/api/@ohos.net.webSocket.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, ErrorCallback} from "./basic"; +import {AsyncCallback, ErrorCallback} from "./@ohos.base"; /** * Provides WebSocket APIs. @@ -24,12 +24,14 @@ import {AsyncCallback, ErrorCallback} from "./basic"; declare namespace webSocket { /** * Creates a web socket connection. + * @crossplatform */ function createWebSocket(): WebSocket; export interface WebSocketRequestOptions { /** * HTTP request header. + * @crossplatform */ header?: Object; } @@ -37,10 +39,12 @@ declare namespace webSocket { export interface WebSocketCloseOptions { /** * Error code. + * @crossplatform */ code?: number; /** * Error cause. + * @crossplatform */ reason?: string; } @@ -55,6 +59,7 @@ declare namespace webSocket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ connect(url: string, callback: AsyncCallback): void; connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback): void; @@ -68,6 +73,7 @@ declare namespace webSocket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ send(data: string | ArrayBuffer, callback: AsyncCallback): void; send(data: string | ArrayBuffer): Promise; @@ -80,6 +86,7 @@ declare namespace webSocket { * @permission ohos.permission.INTERNET * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 201 - Permission denied. + * @crossplatform */ close(callback: AsyncCallback): void; close(options: WebSocketCloseOptions, callback: AsyncCallback): void; @@ -87,43 +94,51 @@ declare namespace webSocket { /** * Enables listening for the open events of a WebSocket connection. + * @crossplatform */ on(type: 'open', callback: AsyncCallback): void; /** * Cancels listening for the open events of a WebSocket connection. + * @crossplatform */ off(type: 'open', callback?: AsyncCallback): void; /** * Enables listening for the message events of a WebSocket connection. * data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8). + * @crossplatform */ on(type: 'message', callback: AsyncCallback): void; /** * Cancels listening for the message events of a WebSocket connection. * data in AsyncCallback can be a string(API 6) or an ArrayBuffer(API 8). + * @crossplatform */ off(type: 'message', callback?: AsyncCallback): void; /** * Enables listening for the close events of a WebSocket connection. + * @crossplatform */ on(type: 'close', callback: AsyncCallback<{ code: number, reason: string }>): void; /** * Cancels listening for the close events of a WebSocket connection. + * @crossplatform */ off(type: 'close', callback?: AsyncCallback<{ code: number, reason: string }>): void; /** * Enables listening for the error events of a WebSocket connection. + * @crossplatform */ on(type: 'error', callback: ErrorCallback): void; /** * Cancels listening for the error events of a WebSocket connection. + * @crossplatform */ off(type: 'error', callback?: ErrorCallback): void; } diff --git a/api/@ohos.nfc.cardEmulation.d.ts b/api/@ohos.nfc.cardEmulation.d.ts index 3ef3c2925..0697b6323 100644 --- a/api/@ohos.nfc.cardEmulation.d.ts +++ b/api/@ohos.nfc.cardEmulation.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { ElementName } from './bundleManager/ElementName'; /** diff --git a/api/@ohos.nfc.controller.d.ts b/api/@ohos.nfc.controller.d.ts index 3ef348412..0a704219d 100644 --- a/api/@ohos.nfc.controller.d.ts +++ b/api/@ohos.nfc.controller.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Callback } from './basic'; +import { Callback } from './@ohos.base'; /** * Provides methods to operate or manage NFC. diff --git a/api/@ohos.nfc.tag.d.ts b/api/@ohos.nfc.tag.d.ts index 64290c2a9..08b7091a0 100644 --- a/api/@ohos.nfc.tag.d.ts +++ b/api/@ohos.nfc.tag.d.ts @@ -26,7 +26,7 @@ import { NdefMessage as _NdefMessage } from './tag/nfctech'; import { TagSession as _TagSession } from './tag/tagSession'; import { PacMap } from "./ability/dataAbilityHelper"; import rpc from "./@ohos.rpc"; -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import type { ElementName } from './bundleManager/ElementName'; diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index a1f9b8a98..6b93d4c3c 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { NotificationActionButton } from './notification/notificationActionButton'; import { NotificationBasicContent } from './notification/notificationContent'; import { NotificationContent } from './notification/notificationContent'; diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index 80906ad8f..ac1d80f07 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { BundleOption as _BundleOption } from './notification/NotificationCommonDef'; import { NotificationActionButton as _NotificationActionButton } from './notification/notificationActionButton'; import { NotificationBasicContent as _NotificationBasicContent } from './notification/notificationContent'; diff --git a/api/@ohos.notificationSubscribe.d.ts b/api/@ohos.notificationSubscribe.d.ts index 07f307d43..cdacfb233 100644 --- a/api/@ohos.notificationSubscribe.d.ts +++ b/api/@ohos.notificationSubscribe.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { BundleOption as _BundleOption } from './notification/NotificationCommonDef'; import { NotificationSubscribeInfo as _NotificationSubscribeInfo } from './notification/notificationSubscribeInfo'; import { NotificationSubscriber as _NotificationSubscriber } from './notification/notificationSubscriber'; diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts index 8e3e71663..15344dffc 100644 --- a/api/@ohos.pasteboard.d.ts +++ b/api/@ohos.pasteboard.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import image from './@ohos.multimedia.image'; @@ -526,7 +526,8 @@ declare namespace pasteboard { /** * Remove a callback invoked when pasteboard content changes. * @param { string } type - indicates pasteboard content changed. - * @param { () => void } [callback] - the callback to remove. + * @param { () => void } [callback] - the callback to remove. If this parameter is not filled in, it indicates that all + * callbacks for this application will be cleared. Otherwise, it indicates that the specified callback will be cleared. * @throws { BusinessError } 401 - if type is not string or callback is not () => void. * @since 7 */ diff --git a/api/@ohos.pluginComponent.d.ts b/api/@ohos.pluginComponent.d.ts index d3291cf95..d37fe7d93 100644 --- a/api/@ohos.pluginComponent.d.ts +++ b/api/@ohos.pluginComponent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import Want from './@ohos.app.ability.Want'; /** diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index ae588bc59..0eaa48833 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError } from './basic'; +import { AsyncCallback, BusinessError } from './@ohos.base'; /** * Provides interfaces to manage power. diff --git a/api/@ohos.privacyManager.d.ts b/api/@ohos.privacyManager.d.ts index b10764fb9..edc1d4ad3 100644 --- a/api/@ohos.privacyManager.d.ts +++ b/api/@ohos.privacyManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; import { Permissions } from './permissions'; /** diff --git a/api/@ohos.process.d.ts b/api/@ohos.process.d.ts index f755acd09..44313d8fd 100644 --- a/api/@ohos.process.d.ts +++ b/api/@ohos.process.d.ts @@ -16,6 +16,7 @@ /** * The process is mainly used to obtain the relevant ID of the process, obtain and modify * the working directory of the process, exit and close the process. +* @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang */ @@ -23,6 +24,7 @@ declare namespace process { /** * The childprocess object can be used to create a new process. + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -31,6 +33,7 @@ declare namespace process { export interface ChildProcess { /** * Return pid is the pid of the current process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -41,6 +44,7 @@ declare namespace process { /** * Return ppid is the pid of the current child process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -51,6 +55,7 @@ declare namespace process { /** * Return exitCode is the exit code of the current child process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -61,6 +66,7 @@ declare namespace process { /** * Return boolean is whether the current process signal is sent successfully + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -71,6 +77,7 @@ declare namespace process { /** * Return 'number' is the target process exit code + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -81,6 +88,7 @@ declare namespace process { /** * Return it as 'Uint8Array' of the stdout until EOF + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -91,6 +99,7 @@ declare namespace process { /** * Return it as 'Uint8Array of the stderr until EOF + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -101,6 +110,7 @@ declare namespace process { /** * Close the target process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -110,6 +120,7 @@ declare namespace process { /** * Send a signal to process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -123,12 +134,14 @@ declare namespace process { * Process is mainly used to obtain the relevant ID of the process, obtain and modify the * working directory of the process, exit and close the process. * @name ProcessManager + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang */ export class ProcessManager { /** * Returns a boolean whether the specified uid belongs to a particular application. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param v An id. @@ -139,6 +152,7 @@ declare namespace process { /** * Returns the uid based on the specified user name. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param v Process name. @@ -149,6 +163,7 @@ declare namespace process { /** * Returns the thread priority based on the specified tid. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param v The tid of the process. @@ -159,6 +174,7 @@ declare namespace process { /** * Returns the system configuration at runtime. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system configuration. @@ -169,6 +185,7 @@ declare namespace process { /** * Returns the system value for environment variables. + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system environment variables. @@ -179,6 +196,7 @@ declare namespace process { /** * Process exit + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param code Process exit code. @@ -188,6 +206,7 @@ declare namespace process { /** * Return whether the signal was sent successfully + * @crossplatform * @since 9 * @syscap SystemCapability.Utils.Lang * @param signal Signal sent. @@ -200,6 +219,7 @@ declare namespace process { /** * Returns the numeric valid group ID of the process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -210,6 +230,7 @@ declare namespace process { /** * Return the numeric valid user identity of the process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -220,6 +241,7 @@ declare namespace process { /** * Returns the numeric group id of the process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -230,6 +252,7 @@ declare namespace process { /** * Returns the digital user id of the process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @returns Return the digital user id of the process. @@ -238,6 +261,7 @@ declare namespace process { /** * Return an array with supplementary group id + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -248,6 +272,7 @@ declare namespace process { /** * Return pid is The pid of the current process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @returns Return The pid of the current process. @@ -256,6 +281,7 @@ declare namespace process { /** * Return ppid is The pid of the current child process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -266,6 +292,7 @@ declare namespace process { /** * Returns the tid of the current thread. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @returns Return the tid of the current thread. @@ -293,6 +320,7 @@ declare namespace process { /** * Returns a boolean whether the process is running in a 64-bit environment. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @returns Return a boolean whether the process is running in a 64-bit environment. @@ -323,6 +351,7 @@ declare namespace process { /** * Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @returns Return the start of the system to the start of the process. @@ -331,6 +360,7 @@ declare namespace process { /** * Returns the cpu time (in milliseconds) from the time when the process starts to the current time. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @returns Return the cpu time (in milliseconds) from the time when the process starts to the current time. @@ -362,6 +392,7 @@ declare namespace process { type EventListener = (evt: Object) => void; /** * Return a child process object and spawns a new ChildProcess to run the command. + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @param command String of the shell commands executed by the child process. @@ -377,6 +408,7 @@ declare namespace process { /** * Abort current process + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang */ @@ -384,6 +416,7 @@ declare namespace process { /** * Register for an event + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @param type Indicates the type of event registered. @@ -395,6 +428,7 @@ declare namespace process { /** * Remove registered event + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @param type Remove the type of registered event. @@ -406,6 +440,7 @@ declare namespace process { /** * Process exit + * @crossplatform * @since 7 * @deprecated since 9 * @useinstead ohos.process.ProcessManager.exit @@ -416,6 +451,7 @@ declare namespace process { /** * Return the current work directory; + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -426,6 +462,7 @@ declare namespace process { /** * Change current directory + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -436,6 +473,7 @@ declare namespace process { /** * Returns the running time of the system + * @crossplatform * @since 7 * @syscap SystemCapability.Utils.Lang * @returns Return the running time of the system. diff --git a/api/@ohos.prompt.d.ts b/api/@ohos.prompt.d.ts index 16fe3ca4c..52db3ae4a 100644 --- a/api/@ohos.prompt.d.ts +++ b/api/@ohos.prompt.d.ts @@ -15,7 +15,7 @@ /// -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { Resource } from 'GlobalResource'; /** diff --git a/api/@ohos.promptAction.d.ts b/api/@ohos.promptAction.d.ts index e7f07663e..deecf80de 100644 --- a/api/@ohos.promptAction.d.ts +++ b/api/@ohos.promptAction.d.ts @@ -15,7 +15,7 @@ /// -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { Resource } from 'GlobalResource'; /** diff --git a/api/@ohos.reminderAgent.d.ts b/api/@ohos.reminderAgent.d.ts index 15d5ce7c6..c994a22f7 100644 --- a/api/@ohos.reminderAgent.d.ts +++ b/api/@ohos.reminderAgent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import notification from './@ohos.notification'; import { NotificationSlot } from './notification/notificationSlot'; diff --git a/api/@ohos.reminderAgentManager.d.ts b/api/@ohos.reminderAgentManager.d.ts index 5d91012d6..f9dd36329 100644 --- a/api/@ohos.reminderAgentManager.d.ts +++ b/api/@ohos.reminderAgentManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import notification from './@ohos.notification'; import { NotificationSlot } from './notification/notificationSlot'; diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index b4213bd6c..fb4f23d81 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { Callback } from './basic'; +import { AsyncCallback } from './@ohos.base'; +import { Callback } from './@ohos.base'; import BaseContext from './application/BaseContext'; /** diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 20da468b3..6ce684f0a 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -15,25 +15,29 @@ import { RawFileDescriptor as _RawFileDescriptor } from './global/rawFileDescriptor'; import { Resource as _Resource } from './global/resource'; -import { AsyncCallback as _AsyncCallback } from './basic'; +import { AsyncCallback as _AsyncCallback } from './@ohos.base'; import { DrawableDescriptor } from './@ohos.arkui.drawableDescriptor'; /** * Provides resource related APIs. * - * @since 6 + * @namespace resourceManager * @syscap SystemCapability.Global.ResourceManager + * @since 6 */ declare namespace resourceManager { -/** - * Enumerates screen directions. - * - * @since 6 - */ -export enum Direction { + /** + * Enumerates screen directions. + * + * @enum { number } + * @syscap SystemCapability.Global.ResourceManager + * @since 6 + */ + export enum Direction { /** * Indicates the vertical direction. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DIRECTION_VERTICAL = 0, @@ -41,20 +45,24 @@ export enum Direction { /** * Indicates the horizontal direction. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DIRECTION_HORIZONTAL = 1 -} + } -/** - * Enumerates device types. - * - * @since 6 - */ -export enum DeviceType { + /** + * Enumerates device types. + * + * @enum { number } + * @syscap SystemCapability.Global.ResourceManager + * @since 6 + */ + export enum DeviceType { /** * Indicates a phone. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DEVICE_TYPE_PHONE = 0x00, @@ -62,6 +70,7 @@ export enum DeviceType { /** * Indicates a tablet. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DEVICE_TYPE_TABLET = 0x01, @@ -69,6 +78,7 @@ export enum DeviceType { /** * Indicates a car. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DEVICE_TYPE_CAR = 0x02, @@ -76,6 +86,7 @@ export enum DeviceType { /** * Indicates a PC. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DEVICE_TYPE_PC = 0x03, @@ -83,6 +94,7 @@ export enum DeviceType { /** * Indicates a smart TV. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DEVICE_TYPE_TV = 0x04, @@ -90,20 +102,24 @@ export enum DeviceType { /** * Indicates a wearable device. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ DEVICE_TYPE_WEARABLE = 0x06 -} + } -/** - * Enumerates screen density types. - * - * @since 6 - */ -export enum ScreenDensity { + /** + * Enumerates screen density types. + * + * @enum { number } + * @syscap SystemCapability.Global.ResourceManager + * @since 6 + */ + export enum ScreenDensity { /** * Indicates small screen density. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ SCREEN_SDPI = 120, @@ -111,6 +127,7 @@ export enum ScreenDensity { /** * Indicates medium screen density. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ SCREEN_MDPI = 160, @@ -118,6 +135,7 @@ export enum ScreenDensity { /** * Indicates large screen density. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ SCREEN_LDPI = 240, @@ -125,6 +143,7 @@ export enum ScreenDensity { /** * Indicates extra-large screen density. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ SCREEN_XLDPI = 320, @@ -132,6 +151,7 @@ export enum ScreenDensity { /** * Indicates extra-extra-large screen density. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ SCREEN_XXLDPI = 480, @@ -139,111 +159,126 @@ export enum ScreenDensity { /** * Indicates extra-extra-extra-large screen density. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ SCREEN_XXXLDPI = 640 -} + } -/** - * Provides the device configuration. - * - * @since 6 - */ -export class Configuration { + /** + * Provides the device configuration. + * + * @since 6 + */ + export class Configuration { /** * Indicates the screen direction of the current device. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ - direction: Direction + direction: Direction; /** * Indicates the current system language, for example, zh-Hans-CN. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ - locale: string -} + locale: string; + } -/** - * Provides the device capability. - * - * @since 6 - */ -export class DeviceCapability { + /** + * Provides the device capability. + * + * @since 6 + */ + export class DeviceCapability { /** * Indicates the screen density of the current device. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ - screenDensity: ScreenDensity + screenDensity: ScreenDensity; /** * Indicates the type of the current device. * + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ - deviceType: DeviceType -} + deviceType: DeviceType; + } -/** - * The ResourceManager callback. - * @since 6 - * @deprecated since 9 - */ - export interface AsyncCallback { + /** + * The ResourceManager callback. + * + * @interface AsyncCallback + * @syscap SystemCapability.Global.ResourceManager + * @since 6 + * @deprecated since 9 + */ + export interface AsyncCallback { (err: Error, data: T): void; -} + } -/** - * Obtains the ResourceManager object of the current application. - * - * @param callback Indicates the callback containing the ResourceManager object. - * @since 6 - * @FAModelOnly - */ -export function getResourceManager(callback: AsyncCallback): void; + /** + * Obtains the ResourceManager object of the current application. + * + * @param { AsyncCallback } callback - Indicates the callback containing the ResourceManager object. + * @syscap SystemCapability.Global.ResourceManager + * @FAModelOnly + * @since 6 + */ + export function getResourceManager(callback: AsyncCallback): void; -/** - * Obtains the ResourceManager object of the specified application. - * - * @param bundleName Indicates the bundle name of the specified application. - * @param callback Indicates the callback containing the ResourceManager object. - * @since 6 - * @FAModelOnly - */ -export function getResourceManager(bundleName: string, callback: AsyncCallback): void; + /** + * Obtains the ResourceManager object of the specified application. + * + * @param { string } bundleName - Indicates the bundle name of the specified application. + * @param { AsyncCallback } callback - Indicates the callback containing the ResourceManager object. + * @syscap SystemCapability.Global.ResourceManager + * @FAModelOnly + * @since 6 + */ + export function getResourceManager(bundleName: string, callback: AsyncCallback): void; -/** - * Obtains the ResourceManager object of the current application. - * - * @returns Returns that the ResourceManager object is returned in Promise mode. - * @since 6 - * @FAModelOnly - */ -export function getResourceManager(): Promise; + /** + * Obtains the ResourceManager object of the current application. + * + * @returns { Promise } The ResourceManager object is returned in Promise mode. + * @syscap SystemCapability.Global.ResourceManager + * @FAModelOnly + * @since 6 + */ + export function getResourceManager(): Promise; -/** - * Obtains the ResourceManager object of the specified application. - * - * @param bundleName Indicates the bundle name of the specified application. - * @returns Returns that the ResourceManager object is returned in Promise mode. - * @since 6 - * @FAModelOnly - */ -export function getResourceManager(bundleName: string): Promise; + /** + * Obtains the ResourceManager object of the specified application. + * + * @param { string } bundleName - Indicates the bundle name of the specified application. + * @returns { Promise } The ResourceManager object is returned in Promise mode. + * @syscap SystemCapability.Global.ResourceManager + * @FAModelOnly + * @since 6 + */ + export function getResourceManager(bundleName: string): Promise; -/** - * Provides the capability of accessing application resources. - * - * @since 6 - */ -export interface ResourceManager { + /** + * Provides the capability of accessing application resources. + * + * @interface ResourceManager + * @syscap SystemCapability.Global.ResourceManager + * @since 6 + */ + export interface ResourceManager { /** * Obtains the character string corresponding to a specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @param { number } resId - Indicates the resource ID. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained character string. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getStringValue @@ -253,8 +288,9 @@ export interface ResourceManager { /** * Obtains string resources associated with a specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the character string corresponding to the resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise } The character string corresponding to the resource ID. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getStringValue @@ -264,12 +300,13 @@ export interface ResourceManager { /** * Obtains the character string corresponding to a specified resource object in callback mode. * - * @param resource Indicates the resource object. - * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @param { Resource } resource - Indicates the resource object. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained character string. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringValue(resource: Resource, callback: _AsyncCallback): void; @@ -277,12 +314,13 @@ export interface ResourceManager { /** * Obtains string resources associated with a specified resource object in Promise mode. * - * @param resource Indicates the resource object. - * @returns Returns the character string corresponding to the resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { Promise } The character string corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringValue(resource: Resource): Promise; @@ -290,8 +328,9 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @param { number } resId - Indicates the resource ID. + * @param { AsyncCallback> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getStringArrayValue @@ -301,8 +340,9 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the array of character strings corresponding to the specified resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise> } The array of character strings corresponding to the specified resource ID. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getStringArrayValue @@ -312,12 +352,13 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource object in callback mode. * - * @param resource Indicates the resource object. - * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @param { Resource } resource - Indicates the resource object. + * @param { _AsyncCallback> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringArrayValue(resource: Resource, callback: _AsyncCallback>): void; @@ -325,12 +366,13 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource object in Promise mode. * - * @param resource Indicates the resource object. - * @returns Returns the array of character strings corresponding to the specified resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { Promise> } The array of character strings corresponding to the specified resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringArrayValue(resource: Resource): Promise>; @@ -338,8 +380,9 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @param { number } resId - Indicates the resource ID. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained media file content. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getMediaContent @@ -349,8 +392,9 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the content of the media file corresponding to the specified resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise } The content of the media file corresponding to the specified resource ID. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getMediaContent @@ -360,11 +404,12 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource object in callback mode. * - * @param resource Indicates the resource object. - * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @param { Resource } resource - Indicates the resource object. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained media file content. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContent(resource: Resource, callback: _AsyncCallback): void; @@ -372,11 +417,12 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource object in Promise mode. * - * @param resource Indicates the resource object. - * @returns Returns the content of the media file corresponding to the specified resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { Promise } The content of the media file corresponding to the specified resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContent(resource: Resource): Promise; @@ -384,9 +430,10 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image + * @param { number } resId - Indicates the resource ID. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getMediaContentBase64 @@ -396,8 +443,9 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the Base64 code of the image resource corresponding to the specified resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise } The Base64 code of the image resource corresponding to the specified resource ID. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getMediaContentBase64 @@ -407,12 +455,13 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource object in callback mode. * - * @param resource Indicates the resource object. - * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image + * @param { Resource } resource - Indicates the resource object. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContentBase64(resource: Resource, callback: _AsyncCallback): void; @@ -420,11 +469,12 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. * - * @param resource Indicates the resource object. - * @returns Returns the Base64 code of the image resource corresponding to the specified resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { Promise } The Base64 code of the image resource corresponding to the specified resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContentBase64(resource: Resource): Promise; @@ -432,7 +482,8 @@ export interface ResourceManager { /** * Obtains the device capability in callback mode. * - * @param callback Indicates the asynchronous callback used to return the obtained device capability. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained device capability. + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ getDeviceCapability(callback: _AsyncCallback): void; @@ -440,7 +491,8 @@ export interface ResourceManager { /** * Obtains the device capability in Promise mode. * - * @returns Returns the device capability. + * @returns { Promise } the device capability. + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ getDeviceCapability(): Promise; @@ -448,8 +500,9 @@ export interface ResourceManager { /** * Obtains the device configuration in callback mode. * - * @param callback Indicates the asynchronous callback used to return the obtained device + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained device * configuration. + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ getConfiguration(callback: _AsyncCallback): void; @@ -457,7 +510,8 @@ export interface ResourceManager { /** * Obtains the device configuration in Promise mode. * - * @returns Returns the device configuration. + * @returns { Promise } the device configuration. + * @syscap SystemCapability.Global.ResourceManager * @since 6 */ getConfiguration(): Promise; @@ -466,10 +520,11 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the ID string corresponding to the * specified number in callback mode. * - * @param resId Indicates the resource ID. - * @param num Indicates the number. - * @param callback Indicates the asynchronous callback used to return the singular-plural character + * @param { number } resId - Indicates the resource ID. + * @param { number } num - Indicates the number. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return the singular-plural character * string represented by the ID string corresponding to the specified number. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getPluralStringValue @@ -480,10 +535,11 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the ID string corresponding to * the specified number in Promise mode. * - * @param resId Indicates the resource ID. - * @param num Indicates the number. - * @returns Returns the singular-plural character string represented by the ID string + * @param { number } resId - Indicates the resource ID. + * @param { number } num - Indicates the number. + * @returns { Promise } The singular-plural character string represented by the ID string * corresponding to the specified number. + * @syscap SystemCapability.Global.ResourceManager * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getPluralStringValue @@ -494,14 +550,15 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the resource object string corresponding to the * specified number in callback mode. * - * @param resource Indicates the resource object. - * @param num Indicates the number. - * @param callback Indicates the asynchronous callback used to return the singular-plural character + * @param { Resource } resource - Indicates the resource object. + * @param { number } num - Indicates the number. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the singular-plural character * string represented by the resource object string corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getPluralStringValue(resource: Resource, num: number, callback: _AsyncCallback): void; @@ -510,14 +567,15 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the resource object string corresponding to * the specified number in Promise mode. * - * @param resource Indicates the resource object. - * @param num Indicates the number. - * @returns Returns the singular-plural character string represented by the resource object string + * @param { Resource } resource - Indicates the resource object. + * @param { number } num - Indicates the number. + * @returns { Promise } The singular-plural character string represented by the resource object string * corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getPluralStringValue(resource: Resource, num: number): Promise; @@ -525,8 +583,9 @@ export interface ResourceManager { /** * Obtains the raw file resource corresponding to the specified resource path in callback mode. * - * @param path Indicates the resource relative path. - * @param callback Indicates the asynchronous callback used to return the raw file resource. + * @param { string } path - Indicates the resource relative path. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return the raw file resource. + * @syscap SystemCapability.Global.ResourceManager * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.getRawFileContent @@ -536,8 +595,9 @@ export interface ResourceManager { /** * Obtains the raw file resource corresponding to the specified resource path in Promise mode. * - * @param path Indicates the resource relative path. - * @returns Returns the raw file resource corresponding to the specified resource path. + * @param { string } path - Indicates the resource relative path. + * @returns { Promise } The raw file resource corresponding to the specified resource path. + * @syscap SystemCapability.Global.ResourceManager * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.getRawFileContent @@ -547,30 +607,33 @@ export interface ResourceManager { /** * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. * - * @param path Indicates the resource relative path. - * @param callback Indicates the asynchronous callback used to return the raw file resource descriptor. + * @param { string } path - Indicates the resource relative path. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return the raw file resource descriptor. + * @syscap SystemCapability.Global.ResourceManager * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.getRawFd */ getRawFileDescriptor(path: string, callback: AsyncCallback): void; - /** - * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. - * - * @param path Indicates the resource relative path. - * @returns Returns the raw file resource descriptor corresponding to the specified resource path. - * @since 8 - * @deprecated since 9 - * @useinstead ohos.resourceManager.getRawFd - */ + /** + * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. + * + * @param { string } path - Indicates the resource relative path. + * @returns { Promise } The raw file resource descriptor corresponding to the specified resource path. + * @syscap SystemCapability.Global.ResourceManager + * @since 8 + * @deprecated since 9 + * @useinstead ohos.resourceManager.getRawFd + */ getRawFileDescriptor(path: string): Promise; /** * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. * - * @param path Indicates the resource relative path. - * @param callback Indicates the asynchronous callback used to return result close raw file resource descriptor. + * @param { string } path - Indicates the resource relative path. + * @param { AsyncCallback } callback - Indicates the asynchronous callback used to return result close raw file resource descriptor. + * @syscap SystemCapability.Global.ResourceManager * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.closeRawFd @@ -580,8 +643,9 @@ export interface ResourceManager { /** * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. * - * @param path Indicates the resource relative path. - * @returns Returns result close raw file resource descriptor corresponding to the specified resource path. + * @param { string } path - Indicates the resource relative path. + * @returns { Promise } The result close raw file resource descriptor corresponding to the specified resource path. + * @syscap SystemCapability.Global.ResourceManager * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.closeRawFd @@ -591,12 +655,13 @@ export interface ResourceManager { /** * Obtains the character string corresponding to a specified resource name in callback mode. * - * @param resName Indicates the resource name. - * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @param { string } resName - Indicates the resource name. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained character string. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringByName(resName: string, callback: _AsyncCallback): void; @@ -604,12 +669,13 @@ export interface ResourceManager { /** * Obtains string resources associated with a specified resource name in Promise mode. * - * @param resName Indicates the resource name. - * @returns Returns the character string corresponding to the resource name. + * @param { string } resName - Indicates the resource name. + * @returns { Promise } The character string corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringByName(resName: string): Promise; @@ -617,12 +683,13 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource name in callback mode. * - * @param resName Indicates the resource name. - * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @param { string } resName - Indicates the resource name. + * @param { _AsyncCallback> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringArrayByName(resName: string, callback: _AsyncCallback>): void; @@ -630,12 +697,13 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource name in Promise mode. * - * @param resName Indicates the resource name. - * @returns Returns the array of character strings corresponding to the specified resource name. + * @param { string } resName - Indicates the resource name. + * @returns { Promise> } the array of character strings corresponding to the specified resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringArrayByName(resName: string): Promise>; @@ -643,11 +711,12 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource name in callback mode. * - * @param resName Indicates the resource name. - * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @param { string } resName - Indicates the resource name. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained media file content. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaByName(resName: string, callback: _AsyncCallback): void; @@ -655,11 +724,12 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource name in Promise mode. * - * @param resName Indicates the resource name. - * @returns Returns the content of the media file corresponding to the specified resource name. + * @param { string } resName - Indicates the resource name. + * @returns { Promise } The content of the media file corresponding to the specified resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaByName(resName: string): Promise; @@ -667,12 +737,13 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource name in callback mode. * - * @param resName Indicates the resource name. - * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image + * @param { string } resName - Indicates the resource name. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaBase64ByName(resName: string, callback: _AsyncCallback): void; @@ -680,11 +751,12 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode. * - * @param resName Indicates the resource name. - * @returns Returns the Base64 code of the image resource corresponding to the specified resource name. + * @param { string } resName - Indicates the resource name. + * @returns { Promise } The Base64 code of the image resource corresponding to the specified resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaBase64ByName(resName: string): Promise; @@ -693,14 +765,15 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the name string corresponding to the * specified number in callback mode. * - * @param resName Indicates the resource name. - * @param num Indicates the number. - * @param callback Indicates the asynchronous callback used to return the singular-plural character + * @param { string } resName - Indicates the resource name. + * @param { number } num - Indicates the number. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the singular-plural character * string represented by the name string corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getPluralStringByName(resName: string, num: number, callback: _AsyncCallback): void; @@ -709,14 +782,15 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the name string corresponding to * the specified number in Promise mode. * - * @param resName Indicates the resource name. - * @param num Indicates the number. - * @returns Returns the singular-plural character string represented by the name string + * @param { string } resName - Indicates the resource name. + * @param { number } num - Indicates the number. + * @returns { Promise } the singular-plural character string represented by the name string * corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getPluralStringByName(resName: string, num: number): Promise; @@ -724,90 +798,103 @@ export interface ResourceManager { /** * Obtains string resources associated with a specified resource ID. * - * @param resId Indicates the resource ID. - * @returns Returns the character string corresponding to the resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { string } The character string corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ + getStringSync(resId: number): string; + /** * Obtains string resources associated with a specified resource ID. * - * @param resId Indicates the resource ID. - * @param args Indicates the formatting string resource parameters. - * @returns Returns the character string corresponding to the resource ID. + * @param { number } resId - Indicates the resource ID. + * @param { Array } args - Indicates the formatting string resource parameters. + * @returns { string } The character string corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @throws { BusinessError } 9001007 - If the resource obtained by resId formatting error. + * @syscap SystemCapability.Global.ResourceManager * @since 10 */ - getStringSync(resId: number, ...args): string; + getStringSync(resId: number, ...args: Array): string; /** * Obtains string resources associated with a specified resource object. * - * @param resource Indicates the resource object. - * @returns Returns the character string corresponding to the resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { string } The character string corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ + getStringSync(resource: Resource): string; + /** * Obtains string resources associated with a specified resource object. * - * @param resource Indicates the resource object. - * @param args Indicates the formatting string resource parameters. - * @returns Returns the character string corresponding to the resource object. + * @param { Resource } resource - Indicates the resource object. + * @param { Array } args - Indicates the formatting string resource parameters. + * @returns { string } The character string corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @throws { BusinessError } 9001007 - If the resource obtained by resId formatting error. + * @syscap SystemCapability.Global.ResourceManager * @since 10 */ - getStringSync(resource: Resource, ...args): string; + getStringSync(resource: Resource, ...args: Array): string; /** * Obtains string resources associated with a specified resource name. * - * @param resName Indicates the resource name. - * @returns Returns the character string corresponding to the resource name. + * @param { string } resName - Indicates the resource name. + * @returns { string } The character string corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ + getStringByNameSync(resName: string): string; + /** * Obtains string resources associated with a specified resource name. * - * @param resName Indicates the resource name. - * @param args Indicates the formatting string resource parameters. - * @returns Returns the character string corresponding to the resource name. + * @param { string } resName - Indicates the resource name. + * @param { Array } args - Indicates the formatting string resource parameters. + * @returns { string } The character string corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @throws { BusinessError } 9001008 - If the resource obtained by resName formatting error. + * @syscap SystemCapability.Global.ResourceManager * @since 10 */ - getStringByNameSync(resName: string, ...args): string; + getStringByNameSync(resName: string, ...args: Array): string; /** * Obtains the boolean result with a specified resource ID. * - * @param resId Indicates the resource ID. - * @returns Returns the boolean resource corresponding to the resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { boolean } The boolean resource corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getBoolean(resId: number): boolean; @@ -815,12 +902,13 @@ export interface ResourceManager { /** * Obtains the boolean result with a specified resource object. * - * @param resource Indicates the resource object. - * @returns Returns the boolean resource corresponding to the resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { boolean } The boolean resource corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getBoolean(resource: Resource): boolean; @@ -828,12 +916,13 @@ export interface ResourceManager { /** * Obtains the boolean result with a specified resource name. * - * @param resName Indicates the resource name. - * @returns Returns the boolean resource corresponding to the resource name. + * @param { string } resName - Indicates the resource name. + * @returns { boolean } The boolean resource corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getBooleanByName(resName: string): boolean; @@ -841,12 +930,13 @@ export interface ResourceManager { /** * Obtains the number result with a specified resource ID. * - * @param resId Indicates the resource ID. - * @returns Returns the number resource corresponding to the resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { number } The number resource corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getNumber(resId: number): number; @@ -854,12 +944,13 @@ export interface ResourceManager { /** * Obtains the number result with a specified resource object. * - * @param resource Indicates the resource object. - * @returns Returns the number resource corresponding to the resource object. + * @param { Resource } resource - Indicates the resource object. + * @returns { number } The number resource corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getNumber(resource: Resource): number; @@ -867,12 +958,13 @@ export interface ResourceManager { /** * Obtains the number result with a specified resource name. * - * @param resName Indicates the resource name. - * @returns Returns the number resource corresponding to the resource name. + * @param { string } resName - Indicates the resource name. + * @returns { number } The number resource corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getNumberByName(resName: string): number; @@ -880,6 +972,7 @@ export interface ResourceManager { /** * Obtains release resourceManager. * + * @syscap SystemCapability.Global.ResourceManager * @since 7 */ release(); @@ -887,25 +980,27 @@ export interface ResourceManager { /** * Obtains the character string corresponding to a specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained character string. + * @param { number } resId - Indicates the resource ID. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained character string. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringValue(resId: number, callback: _AsyncCallback): void; - /** + /** * Obtains string resources associated with a specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the character string corresponding to the resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise } The character string corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringValue(resId: number): Promise; @@ -913,12 +1008,13 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained array of character strings. + * @param { number } resId - Indicates the resource ID. + * @param { _AsyncCallback> } callback - Indicates the asynchronous callback used to return the obtained array of character strings. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringArrayValue(resId: number, callback: _AsyncCallback>): void; @@ -926,12 +1022,13 @@ export interface ResourceManager { /** * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the array of character strings corresponding to the specified resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise> } The array of character strings corresponding to the specified resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getStringArrayValue(resId: number): Promise>; @@ -940,42 +1037,45 @@ export interface ResourceManager { * Obtains the singular-plural character string represented by the ID string corresponding to the * specified number in callback mode. * - * @param resId Indicates the resource ID. - * @param num Indicates the number. - * @param callback Indicates the asynchronous callback used to return the singular-plural character + * @param { number } resId - Indicates the resource ID. + * @param { number } num - Indicates the number. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the singular-plural character * string represented by the ID string corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getPluralStringValue(resId: number, num: number, callback: _AsyncCallback): void; /** - * Obtains the singular-plural character string represented by the ID string corresponding to - * the specified number in Promise mode. - * - * @param resId Indicates the resource ID. - * @param num Indicates the number. - * @returns Returns the singular-plural character string represented by the ID string - * corresponding to the specified number. - * @throws { BusinessError } 401 - If the input parameter invalid. - * @throws { BusinessError } 9001001 - If the resId invalid. - * @throws { BusinessError } 9001002 - If the resource not found by resId. - * @throws { BusinessError } 9001006 - If the resource re-ref too much. - * @since 9 - */ + * Obtains the singular-plural character string represented by the ID string corresponding to + * the specified number in Promise mode. + * + * @param { number } resId - Indicates the resource ID. + * @param { number } num - Indicates the number. + * @returns { Promise } The singular-plural character string represented by the ID string + * corresponding to the specified number. + * @throws { BusinessError } 401 - If the input parameter invalid. + * @throws { BusinessError } 9001001 - If the resId invalid. + * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @throws { BusinessError } 9001006 - If the resource re-ref too much. + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + */ getPluralStringValue(resId: number, num: number): Promise; /** * Obtains the content of the media file corresponding to a specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained media file content. + * @param { number } resId - Indicates the resource ID. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained media file content. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContent(resId: number, callback: _AsyncCallback): void; @@ -983,11 +1083,12 @@ export interface ResourceManager { /** * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the content of the media file corresponding to the specified resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise } The content of the media file corresponding to the specified resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContent(resId: number): Promise; @@ -995,12 +1096,13 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in callback mode. * - * @param resId Indicates the resource ID. - * @param callback Indicates the asynchronous callback used to return the obtained Base64 code of the image + * @param { number } resId - Indicates the resource ID. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the obtained Base64 code of the image * resource. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContentBase64(resId: number, callback: _AsyncCallback): void; @@ -1008,11 +1110,12 @@ export interface ResourceManager { /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. * - * @param resId Indicates the resource ID. - * @returns Returns the Base64 code of the image resource corresponding to the specified resource ID. + * @param { number } resId - Indicates the resource ID. + * @returns { Promise } the Base64 code of the image resource corresponding to the specified resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getMediaContentBase64(resId: number): Promise; @@ -1020,10 +1123,11 @@ export interface ResourceManager { /** * Obtains the raw file resource corresponding to the specified resource path in callback mode. * - * @param path Indicates the resource relative path. - * @param callback Indicates the asynchronous callback used to return the raw file resource. + * @param { string } path - Indicates the resource relative path. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the raw file resource. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getRawFileContent(path: string, callback: _AsyncCallback): void; @@ -1031,10 +1135,11 @@ export interface ResourceManager { /** * Obtains the raw file resource corresponding to the specified resource path in Promise mode. * - * @param path Indicates the resource relative path. - * @returns Returns the raw file resource corresponding to the specified resource path. + * @param { string } path - Indicates the resource relative path. + * @returns { Promise } the raw file resource corresponding to the specified resource path. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getRawFileContent(path: string): Promise; @@ -1042,10 +1147,11 @@ export interface ResourceManager { /** * Obtains the raw file resource descriptor corresponding to the specified resource path in callback mode. * - * @param path Indicates the resource relative path. - * @param callback Indicates the asynchronous callback used to return the raw file resource descriptor. + * @param { string } path - Indicates the resource relative path. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return the raw file resource descriptor. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getRawFd(path: string, callback: _AsyncCallback): void; @@ -1053,10 +1159,11 @@ export interface ResourceManager { /** * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. * - * @param path Indicates the resource relative path. - * @returns Returns the raw file resource descriptor corresponding to the specified resource path. + * @param { string } path - Indicates the resource relative path. + * @returns { Promise } The raw file resource descriptor corresponding to the specified resource path. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ getRawFd(path: string): Promise; @@ -1064,10 +1171,11 @@ export interface ResourceManager { /** * Obtains close raw file resource descriptor corresponding to the specified resource path in callback mode. * - * @param path Indicates the resource relative path. - * @param callback Indicates the asynchronous callback used to return result close raw file resource descriptor. + * @param { string } path - Indicates the resource relative path. + * @param { _AsyncCallback } callback - Indicates the asynchronous callback used to return result close raw file resource descriptor. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ closeRawFd(path: string, callback: _AsyncCallback): void; @@ -1075,9 +1183,11 @@ export interface ResourceManager { /** * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. * - * @param path Indicates the resource relative path. + * @param { string } path - Indicates the resource relative path. + * @returns { Promise } The result close raw file resource descriptor corresponding to the specified resource path. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. + * @syscap SystemCapability.Global.ResourceManager * @since 9 */ closeRawFd(path: string): Promise; @@ -1085,13 +1195,14 @@ export interface ResourceManager { /** * Obtains the DrawableDescriptor of the media file corresponding to a specified resource ID. * - * @param resId Indicates the resource ID. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * @param { number } resId - Indicates the resource ID. + * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. - * @returns Returns the DrawableDescriptor class to get drawable image. + * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @syscap SystemCapability.Global.ResourceManager * @since 10 */ getDrawableDescriptor(resId: number, density?: number): DrawableDescriptor; @@ -1099,13 +1210,14 @@ export interface ResourceManager { /** * Obtains the DrawableDescriptor of the media file corresponding to a specified resource Name. * - * @param resName Indicates the resource name. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * @param { string } resName - Indicates the resource name. + * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. - * @returns Returns the DrawableDescriptor class to get drawable image. + * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. + * @syscap SystemCapability.Global.ResourceManager * @since 10 */ getDrawableDescriptorByName(resName: string, density?: number): DrawableDescriptor; @@ -1113,34 +1225,35 @@ export interface ResourceManager { /** * Obtains the DrawableDescriptor of the media file corresponding to a specified resource. * - * @param resource Indicates the resource object. - * @param density The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means + * @param { Resource } resource - Indicates the resource object. + * @param { number } density - The optional parameter ScreenDensity{@link ScreenDensity}, A value of 0 means * to use the density of current system dpi. - * @returns Returns the DrawableDescriptor class to get drawable image. + * @returns { DrawableDescriptor } The DrawableDescriptor class to get drawable image. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. + * @syscap SystemCapability.Global.ResourceManager * @since 10 */ getDrawableDescriptor(resource: Resource, density?: number): DrawableDescriptor; -} + } - /** - * Contains rawFile descriptor information. - * @name Contains rawFile descriptor information - * @since 9 - * @syscap SystemCapability.Global.ResourceManager - * - */ - export type RawFileDescriptor = _RawFileDescriptor; + /** + * Contains rawFile descriptor information. + * + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + * @name Contains rawFile descriptor information + */ + export type RawFileDescriptor = _RawFileDescriptor; - /** - * Contains resource descriptor information. - * @name Contains resource descriptor information - * @since 9 - * @syscap SystemCapability.Global.ResourceManager - * - */ - export type Resource = _Resource; + /** + * Contains resource descriptor information. + * + * @syscap SystemCapability.Global.ResourceManager + * @since 9 + * @name Contains resource descriptor information + */ + export type Resource = _Resource; } export default resourceManager; \ No newline at end of file diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 8b96fafbd..6cac3beac 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback , Callback} from './basic'; +import { AsyncCallback , Callback} from './@ohos.base'; import { WantAgent } from "./@ohos.wantAgent"; import Context from './application/BaseContext'; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 7a7d3e5a8..e289a76bb 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback , Callback} from './basic'; +import { AsyncCallback , Callback} from './@ohos.base'; /** * Provides methods for managing bundle usage statistics, diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index fdd886446..fc14be4ad 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from './basic'; +import {AsyncCallback} from './@ohos.base'; /** * Work scheduler interface. diff --git a/api/@ohos.router.d.ts b/api/@ohos.router.d.ts index cf6952672..72e1e5a73 100644 --- a/api/@ohos.router.d.ts +++ b/api/@ohos.router.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import {Callback} from './basic'; -import { AsyncCallback } from './basic'; +import {Callback} from './@ohos.base'; +import { AsyncCallback } from './@ohos.base'; /** * @namespace router diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 5c5876487..5f4f8d9fc 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic' +import { AsyncCallback } from './@ohos.base' declare namespace rpc { /** diff --git a/api/@ohos.runningLock.d.ts b/api/@ohos.runningLock.d.ts index 790c66b00..1ed2fa7b1 100644 --- a/api/@ohos.runningLock.d.ts +++ b/api/@ohos.runningLock.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError } from './basic'; +import { AsyncCallback, BusinessError } from './@ohos.base'; /** * Provides a mechanism to prevent the system from hibernating so that the applications can run in the background or diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index 747c2ae07..fd380d429 100644 --- a/api/@ohos.screen.d.ts +++ b/api/@ohos.screen.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Interface of screen manager diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts index 79e1b2418..a1926ef74 100644 --- a/api/@ohos.screenLock.d.ts +++ b/api/@ohos.screenLock.d.ts @@ -12,20 +12,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { Callback } from './basic'; +import { AsyncCallback } from './@ohos.base'; +import { Callback } from './@ohos.base'; /** * systemScreenLock + * + * @namespace screenLock * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 */ declare namespace screenLock { - /** * Checks whether the screen is currently locked. * - * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. + * @param { AsyncCallback } callback - the callback of isScreenLocked. * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 * @deprecated since 9 @@ -35,7 +36,7 @@ declare namespace screenLock { /** * Checks whether the screen is currently locked. * - * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. + * @returns { Promise } the promise returned by the function. * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 * @deprecated since 9 @@ -45,8 +46,8 @@ declare namespace screenLock { /** * Checks whether the screen is currently locked. * - * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @returns { boolean } returns true if the screen is currently locked, returns false otherwise. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 @@ -56,7 +57,7 @@ declare namespace screenLock { /** * Checks whether the screen lock of the current device is secure. * - * @returns Returns {@code true} if the screen lock of the current device is secure; returns {@code false} otherwise. + * @param { AsyncCallback } callback - the callback of isSecureMode. * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 * @deprecated since 9 @@ -66,7 +67,7 @@ declare namespace screenLock { /** * Checks whether the screen lock of the current device is secure. * - * @returns Returns {@code true} if the screen lock of the current device is secure; returns {@code false} otherwise. + * @returns { Promise } the promise returned by the function. * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 * @deprecated since 9 @@ -76,6 +77,7 @@ declare namespace screenLock { /** * Unlock the screen. * + * @param { AsyncCallback } callback - the callback of unlockScreen. * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 * @deprecated since 9 @@ -85,19 +87,20 @@ declare namespace screenLock { /** * Unlock the screen. * + * @returns { Promise } the promise returned by the function. * @syscap SystemCapability.MiscServices.ScreenLock * @since 7 * @deprecated since 9 */ - function unlockScreen():Promise; + function unlockScreen(): Promise; /** * Unlock the screen. * - * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @param { AsyncCallback } callback - the callback of unlock. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 @@ -107,24 +110,24 @@ declare namespace screenLock { /** * Unlock the screen. * - * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 */ - function unlock():Promise; + function unlock(): Promise; /** * Lock the screen. * - * @returns Returns {@code true} if the screen is locked successfully; returns {@code false} otherwise. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { AsyncCallback } callback - the callback of lock. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 @@ -134,16 +137,16 @@ declare namespace screenLock { /** * Lock the screen. * - * @returns Returns {@code true} if the screen is locked successfully; returns {@code false} otherwise. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 */ - function lock():Promise; + function lock(): Promise; /** * Indicates the system event type related to the screenlock management service. @@ -153,43 +156,44 @@ declare namespace screenLock { * @since 9 */ type EventType = - 'beginWakeUp' - | 'endWakeUp' - | 'beginScreenOn' - | 'endScreenOn' - | 'beginScreenOff' - | 'endScreenOff' - | 'unlockScreen' - | 'lockScreen' - | 'beginExitAnimation' - | 'beginSleep' - | 'endSleep' - | 'changeUser' - | 'screenlockEnabled' - | 'serviceRestart' + 'beginWakeUp' + | 'endWakeUp' + | 'beginScreenOn' + | 'endScreenOn' + | 'beginScreenOff' + | 'endScreenOff' + | 'unlockScreen' + | 'lockScreen' + | 'beginExitAnimation' + | 'beginSleep' + | 'endSleep' + | 'changeUser' + | 'screenlockEnabled' + | 'serviceRestart'; /** * Indicates the system event type and parameter related to the screenlock management service. * + * @typedef SystemEvent * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 */ interface SystemEvent { - eventType: EventType, - params: string + eventType: EventType; + params: string; } /** * Register system event related to screen lock service. * - * @param { Callback } callback - the callback function for indicating the system event related screen lock - * @returns Returns {@code true} if register system event is success; returns {@code false} otherwise. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { Callback } callback - the callback of onSystemEvent. + * @returns { boolean } returns true if register system event is success, returns false otherwise. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 @@ -199,14 +203,14 @@ declare namespace screenLock { /** * The screen lock app sends the event to the screen lock service. * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER * @param { String } event - event type. * @param { number } parameter - operation result of the event. - * @returns Returns {@code true} if screen lock app send event to screen lock service is success; returns {@code false} otherwise. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @param { AsyncCallback } callback - the callback of sendScreenLockEvent. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 @@ -216,14 +220,14 @@ declare namespace screenLock { /** * The screen lock app sends the event to the screen lock service. * + * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER * @param { String } event - event type. * @param { number } parameter - operation result of the event. - * @returns Returns {@code true} if screen lock app send event to screen lock service is success; returns {@code false} otherwise. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. - * @permission ohos.permission.ACCESS_SCREEN_LOCK_INNER + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @throws { BusinessError } 13200002 - the screenlock management service is abnormal. * @syscap SystemCapability.MiscServices.ScreenLock * @systemapi Hide this for inner system use. * @since 9 diff --git a/api/@ohos.screenshot.d.ts b/api/@ohos.screenshot.d.ts index 2967f7cc1..302a638d2 100644 --- a/api/@ohos.screenshot.d.ts +++ b/api/@ohos.screenshot.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, ErrorCallback } from './basic'; +import { AsyncCallback, ErrorCallback } from './@ohos.base'; import image from './@ohos.multimedia.image'; /** diff --git a/api/@ohos.secureElement.d.ts b/api/@ohos.secureElement.d.ts index 18c81ccff..07b377d46 100644 --- a/api/@ohos.secureElement.d.ts +++ b/api/@ohos.secureElement.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import type { AsyncCallback, Callback } from './basic'; +import type { AsyncCallback, Callback } from './@ohos.base'; /** * Provides APIs for mobile applications to access different SEs in mobile devices, such as SIMs or embedded SEs. diff --git a/api/@ohos.security.cert.d.ts b/api/@ohos.security.cert.d.ts index 818dcec0b..78524321a 100644 --- a/api/@ohos.security.cert.d.ts +++ b/api/@ohos.security.cert.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; import cryptoFramework from '@ohos.security.cryptoFramework'; /** diff --git a/api/@ohos.security.cryptoFramework.d.ts b/api/@ohos.security.cryptoFramework.d.ts index af7a82355..45dbc46eb 100644 --- a/api/@ohos.security.cryptoFramework.d.ts +++ b/api/@ohos.security.cryptoFramework.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides a set of encryption and decryption algorithm library framework, shields the underlying differences, diff --git a/api/@ohos.security.huks.d.ts b/api/@ohos.security.huks.d.ts index 9871fc489..04c5c2eb7 100644 --- a/api/@ohos.security.huks.d.ts +++ b/api/@ohos.security.huks.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; /** * OpenHarmony Universal KeyStore diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index 0d41fb3f4..f3c068674 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./basic"; +import { AsyncCallback, Callback } from "./@ohos.base"; /** * This module provides the capability to subscribe to sensor data. diff --git a/api/@ohos.settings.d.ts b/api/@ohos.settings.d.ts index 4d7802921..49e3cf61e 100644 --- a/api/@ohos.settings.d.ts +++ b/api/@ohos.settings.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; import { DataAbilityHelper } from './ability/dataAbilityHelper'; /** diff --git a/api/@ohos.statfs.d.ts b/api/@ohos.statfs.d.ts index fc9f7a75f..beda4e8ed 100644 --- a/api/@ohos.statfs.d.ts +++ b/api/@ohos.statfs.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { AsyncCallback } from "./@ohos.base"; /** * Provides filesystem statistics APIs diff --git a/api/@ohos.stationary.d.ts b/api/@ohos.stationary.d.ts index 5c4bf855c..b150eaf10 100644 --- a/api/@ohos.stationary.d.ts +++ b/api/@ohos.stationary.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Callback } from "./basic"; +import { Callback } from "./@ohos.base"; /** * Declares a namespace that provides APIs to report the device status. diff --git a/api/@ohos.systemCapability.d.ts b/api/@ohos.systemCapability.d.ts index 438327224..caf17c63d 100644 --- a/api/@ohos.systemCapability.d.ts +++ b/api/@ohos.systemCapability.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides interfaces to get system capability. diff --git a/api/@ohos.systemDateTime.d.ts b/api/@ohos.systemDateTime.d.ts index d2a6da3f1..0d20363f5 100644 --- a/api/@ohos.systemDateTime.d.ts +++ b/api/@ohos.systemDateTime.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * System time and timezone. diff --git a/api/@ohos.systemParameterEnhance.d.ts b/api/@ohos.systemParameterEnhance.d.ts index ff8c6f3e3..cd6001de3 100644 --- a/api/@ohos.systemParameterEnhance.d.ts +++ b/api/@ohos.systemParameterEnhance.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError } from './basic'; +import { AsyncCallback, BusinessError } from './@ohos.base'; /** * The interface of system parameters class. diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts index 636afc96f..08d41e830 100644 --- a/api/@ohos.systemTime.d.ts +++ b/api/@ohos.systemTime.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * System time and timezone. diff --git a/api/@ohos.systemTimer.d.ts b/api/@ohos.systemTimer.d.ts index f65c4967f..8949c3e99 100644 --- a/api/@ohos.systemTimer.d.ts +++ b/api/@ohos.systemTimer.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * Provides js api for systemTimer diff --git a/api/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts index 93aa70a20..6b7c4e9b4 100644 --- a/api/@ohos.systemparameter.d.ts +++ b/api/@ohos.systemparameter.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError } from './basic'; +import { AsyncCallback, BusinessError } from './@ohos.base'; /** * The interface of system parameters class. diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 42a2dba2b..3d898d82a 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; /** * Provides methods related to call management. diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index 2fc704ecf..1537e3f2c 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {AsyncCallback} from "./@ohos.base"; /** * Provides methods related to cellular data services. diff --git a/api/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts index c27f305a8..783b8b64b 100644 --- a/api/@ohos.telephony.observer.d.ts +++ b/api/@ohos.telephony.observer.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {Callback} from "./basic"; +import {Callback} from "./@ohos.base"; import radio from "./@ohos.telephony.radio"; import data from "./@ohos.telephony.data"; import call from "./@ohos.telephony.call"; diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index bd85bd2f5..d99f0e8c2 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from "./basic"; +import {AsyncCallback, Callback} from "./@ohos.base"; /** * Provides interfaces for applications to obtain the network state, cell information, signal information, diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 593e70282..8e1e2cfd1 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {AsyncCallback} from "./@ohos.base"; /** * Provides applications with APIs for obtaining SIM card status, card file information, and card specifications. diff --git a/api/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts index 7a571716e..06a98394d 100644 --- a/api/@ohos.telephony.sms.d.ts +++ b/api/@ohos.telephony.sms.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {AsyncCallback} from "./@ohos.base"; /** * Provides the capabilities and methods for obtaining Short Message Service (SMS) management objects. diff --git a/api/@ohos.thermal.d.ts b/api/@ohos.thermal.d.ts index 5e85fb60e..319e9ec34 100644 --- a/api/@ohos.thermal.d.ts +++ b/api/@ohos.thermal.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError, Callback } from './basic'; +import { AsyncCallback, BusinessError, Callback } from './@ohos.base'; /** * Provides thermal level-related callback and query APIs to obtain the information required for diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 1246756e0..f9b16c9a2 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, BusinessError } from "./basic"; +import { AsyncCallback, BusinessError } from "./@ohos.base"; /** * A static class to do update for device. diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts index 772e72a38..ca6f6a872 100644 --- a/api/@ohos.usb.d.ts +++ b/api/@ohos.usb.d.ts @@ -14,909 +14,1149 @@ */ /** + * @namespace usb + * @since 8 * @deprecated since 9 * @useinstead ohos.usbManager */ declare namespace usb { - /** - * Obtains the USB device list. - * - * @returns Returns the {@link USBDevice} list. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function getDevices(): Array>; + /** + * Obtains the USB device list. + * + * @returns { Array> } USB device list. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function getDevices(): Array>; - /** - * Connects to the USB device based on the device information returned by {@link getDevices()}. - * - * @param device USB device on the device list returned by {@link getDevices()}. - * @returns Returns the {@link USBDevicePipe} object for data transfer. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function connectDevice(device: USBDevice): Readonly; + /** + * Connects to the USB device based on the device information returned by getDevices(). + * + * @param { USBDevice } device - USB device on the device list returned by getDevices(). + * @returns { Readonly } object for data transfer. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function connectDevice(device: USBDevice): Readonly; - /** - * Checks whether the application has the permission to access the device. - * - * @param deviceName Device name defined by {@link USBDevice.name}. - * @returns Returns **true** if the user has the permission to access the device; return **false** otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function hasRight(deviceName: string): boolean; + /** + * Checks whether the application has the permission to access the device. + * + * @param { string } deviceName - device name defined by USBDevice.name. + * @returns { boolean } indicates if the user has the permission to access the device. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function hasRight(deviceName: string): boolean; - /** - * Requests the temporary permission for a given application to access the USB device. - * - * @param deviceName Device name defined by {@link USBDevice.name}. - * @returns Returns **true** if the temporary device access permissions are granted; return **false** otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function requestRight(deviceName: string): Promise; + /** + * Requests the temporary permission for a given application to access the USB device. + * + * @param { string } deviceName - device name defined by USBDevice.name. + * @returns { Promise } indicates if the device access permissions are granted. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function requestRight(deviceName: string): Promise; - /** - * Converts the string descriptor of a given USB function list to a numeric mask combination. - * - * @param funcs Descriptor of the supported function list. - * @returns Returns the numeric mask combination of the function list. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function usbFunctionsFromString(funcs: string): number; + /** + * Converts the string descriptor of a given USB function list to a numeric mask combination. + * + * @param { string } funcs - descriptor of the supported function list. + * @returns { number } the numeric mask combination of the function list. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function usbFunctionsFromString(funcs: string): number; - /** - * Converts the numeric mask combination of a given USB function list to a string descriptor. - * - * @param funcs Numeric mask combination of the function list. - * @returns Returns the string descriptor of the supported function list. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function usbFunctionsToString(funcs: FunctionType): string; + /** + * Converts the numeric mask combination of a given USB function list to a string descriptor. + * + * @param { FunctionType } funcs - numeric mask combination of the function list. + * @returns { string } - descriptor of the supported function list. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function usbFunctionsToString(funcs: FunctionType): string; - /** - * Sets the current USB function list in Device mode. - * - * @param funcs Numeric mask combination of the supported function list. - * @returns Returns **true** if the setting is successful; returns **false** otherwise. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function setCurrentFunctions(funcs: FunctionType): Promise; + /** + * Sets the current USB function list in Device mode. + * + * @param { FunctionType } funcs - numeric mask combination of the supported function list. + * @returns { Promise } returns **true** if the setting is successful; returns **false** otherwise. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function setCurrentFunctions(funcs: FunctionType): Promise; - /** - * Obtains the numeric mask combination for the current USB function list in Device mode. - * - * @returns Returns the numeric mask combination for the current USB function list in {@link FunctionType}. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function getCurrentFunctions(): FunctionType; + /** + * Obtains the numeric mask combination for the current USB function list in Device mode. + * + * @returns { FunctionType } the numeric mask combination for the current USB function list in FunctionType. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function getCurrentFunctions(): FunctionType; - /* usb port functions begin */ - /** - * Obtains the {@link USBPort} list. - * - * @returns Returns the {@link USBPort} list. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function getPorts(): Array; + /** + * Obtains the USBPort list. + * + * @returns { Array } the USBPort list. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function getPorts(): Array; - /** - * Gets the mask combination for the supported mode list of the specified {@link USBPort}. - * - * @returns Returns the mask combination for the supported mode list in {@link PortModeType}. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function getSupportedModes(portId: number): PortModeType; + /** + * Gets the mask combination for the supported mode list of the specified USBPort. + * + * @param { number } portId + * @returns { PortModeType } the mask combination for the supported mode list in PortModeType. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function getSupportedModes(portId: number): PortModeType; - /** - * Sets the role types supported by the specified {@link USBPort}, which can be powerRole (for charging) and dataRole (for data transfer). - * - * @param portId Unique ID of the port. - * @param powerRole Charging role defined by {@link PowerRoleType}. - * @param dataRole Data role defined by {@link DataRoleType}. - * @returns Returns the supported role type. - * @systemapi - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; + /** + * Sets the role types supported by the specified USBPort, which can be powerRole (for charging) and dataRole (for data transfer). + * + * @param { number } portId - unique ID of the port. + * @param { PowerRoleType } powerRole - charging role. + * @param { DataRoleType } dataRole - data role. + * @returns { Promise } returns **true** if the setting is successful; returns **false** otherwise. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; - /* usb pipe functions begin */ - /** - * Claims a USB interface. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim. - * @param force Optional parameter that determines whether to forcibly claim the USB interface. - * @returns Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; + /* usb pipe functions begin */ + /** + * Claims a USB interface. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the bus number and device address. + * @param { USBInterface } iface - USB interface , which is used to determine the interface to claim. + * @param { boolean } [force] - optional parameter that determines whether to forcibly claim the USB interface. + * @returns { number } returns **0** if the USB interface is successfully claimed; returns an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; - /** - * Releases a USB interface. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release. - * @returns Returns **0** if the USB interface is successfully released; returns an error code otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; + /** + * Releases a USB interface. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the bus number and device address. + * @param { USBInterface } iface - USB interface , which is used to determine the interface to release. + * @returns { number } returns **0** if the USB interface is successfully released; returns an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; - /** - * Sets the device configuration. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param config Device configuration defined by {@link USBConfig}. - * @returns Returns **0** if the device configuration is successfully set; returns an error code otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; + /** + * Sets the device configuration. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the bus number and device address. + * @param { USBConfig } config - device configuration. + * @returns { number } returns **0** if the device configuration is successfully set; returns an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; - /** - * Sets a USB interface. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set. - * @returns Returns **0** if the USB interface is successfully set; return an error code otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; + /** + * Sets a USB interface. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the bus number and device address. + * @param { USBInterface } iface - USB interface , which is used to determine the interface to set. + * @returns { number } returns **0** if the USB interface is successfully set; return an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; - /** - * Obtains the raw USB descriptor. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @returns Returns the raw descriptor data. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; + /** + * Obtains the raw USB descriptor. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the bus number and device address. + * @returns { Uint8Array } returns the raw descriptor data. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; - /** - * Obtains the file descriptor. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @returns Returns the file descriptor of the USB device. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function getFileDescriptor(pipe: USBDevicePipe): number; + /** + * Obtains the file descriptor. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the USB device. + * @returns { number } returns the file descriptor of the USB device. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function getFileDescriptor(pipe: USBDevicePipe): number; - /** - * Performs control transfer. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @param controlparam Control transfer parameters. - * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise; + /** + * Performs control transfer. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the USB device. + * @param { USBControlParams } controlparam - control transfer parameters. + * @param { number } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @returns { Promise } returns the size of the transmitted or received data block if the control transfer is successful; + * return -1 if an exception occurs. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise; - /** - * Performs bulk transfer. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @param endpoint USB endpoint defined by {@link USBEndpoint}, which is used to determine the USB port for data transfer. - * @param buffer Buffer for writing or reading data. - * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, - timeout?: number): Promise; + /** + * Performs bulk transfer. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the USB device. + * @param { USBEndpoint } endpoint - USB endpoint, which is used to determine the USB port for data transfer. + * @param { Uint8Array } buffer - buffer for writing or reading data. + * @param { number } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @returns { Promise } the size of the transmitted or received data block if the control transfer is successful; + * return -1 if an exception occurs. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function bulkTransfer( + pipe: USBDevicePipe, + endpoint: USBEndpoint, + buffer: Uint8Array, + timeout?: number + ): Promise; - /** - * Closes a USB device pipe. - * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @returns Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - function closePipe(pipe: USBDevicePipe): number; + /** + * Closes a USB device pipe. + * + * @param { USBDevicePipe } pipe - device pipe , which is used to determine the USB device. + * @returns { number } returns **0** if the USB device pipe is closed successfully; return an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + function closePipe(pipe: USBDevicePipe): number; + /** + * Represents the USB endpoint from which data is sent or received. You can obtain the USB endpoint through USBInterface. + * + * @typedef USBEndpoint + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interface USBEndpoint { /** - * Represents the USB endpoint from which data is sent or received. You can obtain the USB endpoint through {@link USBInterface}. + * Endpoint address * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - interface USBEndpoint { - /** - * Endpoint address - * - * @since 8 - */ - address: number; - - /** - * Endpoint attributes - * - * @since 8 - */ - attributes: number; - - /** - * Endpoint interval - * - * @since 8 - */ - interval: number; - - /** - * Maximum size of data packets on the endpoint - * - * @since 8 - */ - maxPacketSize: number; - - /** - * Endpoint direction - * - * @since 8 - */ - direction: USBRequestDirection; - - /** - * Endpoint number - * - * @since 8 - */ - number: number; - - /** - * Endpoint type - * - * @since 8 - */ - type: number; - - /** - * Unique ID defined by {@link USBInterface.id}, which indicates the interface to which the endpoint belongs - * - * @since 8 - */ - interfaceId: number; - } - + address: number; /** - * Represents a USB interface. One config {@link USBConfig} can contain multiple **USBInterface** instances, each providing a specific function. + * Endpoint attributes * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - interface USBInterface { - /** - * Unique ID of the USB interface - * - * @since 8 - */ - id: number; - - /** - * Interface protocol - * - * @since 8 - */ - protocol: number; - - /** - * Device type - * - * @since 8 - */ - clazz: number; - - /** - * Device subclass - * - * @since 8 - */ - subClass: number; - - /** - * Alternation between descriptors of the same USB interface - * - * @since 8 - */ - alternateSetting: number; - - /** - * Interface name - * - * @since 8 - */ - name: string; - - /** - * {@link USBEndpoint} that belongs to the USB interface - * - * @since 8 - */ - endpoints: Array; - } + attributes: number; /** - * USB configuration. One {@link USBDevice} can contain multiple USBConfig instances. + * Endpoint interval * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - interface USBConfig { - /** - * Unique ID of the USB configuration - * - * @since 8 - * - * - */ - id: number; - - /** - * Configuration attributes - * - * @since 8 - */ - attributes: number; - - /** - * Maximum power consumption, in mA - * - * @since 8 - */ - maxPower: number; - - /** - * Configuration name, which can be left empty - * - * @since 8 - */ - name: string; - - /** - * Support for remote wakeup - * - * @since 8 - */ - isRemoteWakeup: boolean; - - /** - * Support for independent power supplies - * - * @since 8 - */ - isSelfPowered: boolean; - - /** - * Supported interface attributes defined by {@link USBInterface} - * - * @since 8 - */ - interfaces: Array; - } + interval: number; /** - * Represents a USB device. + * Maximum size of data packets on the endpoint * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - interface USBDevice { - /** - * Bus address - * - * @since 8 - */ - busNum: number; - - /** - * Device address - * - * @since 8 - */ - devAddress: number; - - /** - * Device SN - * - * @since 8 - */ - serial: string; - - /** - * Device name - * - * @since 8 - */ - name: string; - - /** - * Device manufacturer - * - * @since 8 - */ - manufacturerName: string; - - /** - * Product information - * - * @since 8 - */ - productName: string; - - /** - * Product version - * - * @since 8 - */ - version: string; - - /** - * Vendor ID - * - * @since 8 - */ - vendorId: number; - - /** - * Product ID - * - * @since 8 - */ - productId: number; - - /** - * Device class - * - * @since 8 - */ - clazz: number; - - /** - * Device subclass - * - * @since 8 - */ - subClass: number; - - /** - * Device protocol code - * - * @since 8 - */ - protocol: number; - - /** - * Device configuration descriptor information defined by {@link USBConfig} - * - * @since 8 - */ - configs: Array; - } + maxPacketSize: number; /** - * Represents a USB device pipe, which is used to determine the USB device. + * Endpoint direction * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - interface USBDevicePipe { - /** - * Bus address. - * - * @since 8 - */ - busNum: number; - - /** - * Device address - * - * @since 8 - */ - devAddress: number; - } + direction: USBRequestDirection; /** - * Enumerates power role types. + * Endpoint number + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + number: number; + + /** + * Endpoint type + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + type: number; + + /** + * Unique ID defined by {@link USBInterface.id}, which indicates the interface to which the endpoint belongs + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interfaceId: number; + } + + /** + * Represents a USB interface. One config can contain multiple **USBInterface** instances, each providing a specific function. + * + * @typedef USBInterface + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interface USBInterface { + /** + * Unique ID of the USB interface + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + id: number; + + /** + * Interface protocol + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + protocol: number; + + /** + * Device type + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + clazz: number; + + /** + * Device subclass + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + subClass: number; + + /** + * Alternation between descriptors of the same USB interface + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + alternateSetting: number; + + /** + * Interface name + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + name: string; + + /** + * USBEndpoint that belongs to the USB interface + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + endpoints: Array; + } + + /** + * USB configuration. One USBDevice can contain multiple USBConfig instances. + * + * @typedef USBConfig + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interface USBConfig { + /** + * Unique ID of the USB configuration + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + id: number; + + /** + * Configuration attributes + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + attributes: number; + + /** + * Maximum power consumption, in mA + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + maxPower: number; + + /** + * Configuration name, which can be left empty + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + name: string; + + /** + * Support for remote wakeup + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + isRemoteWakeup: boolean; + + /** + * Support for independent power supplies + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + isSelfPowered: boolean; + + /** + * Supported interface + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interfaces: Array; + } + + /** + * Represents a USB device. + * + * @typedef USBDevice + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interface USBDevice { + /** + * Bus address + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + busNum: number; + + /** + * Device address + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + devAddress: number; + + /** + * Device SN + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + serial: string; + + /** + * Device name + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + name: string; + + /** + * Device manufacturer + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + manufacturerName: string; + + /** + * Product information + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + productName: string; + + /** + * Product version + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + version: string; + + /** + * Vendor ID + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + vendorId: number; + + /** + * Product ID + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + productId: number; + + /** + * Device class + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + clazz: number; + + /** + * Device subclass + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + subClass: number; + + /** + * Device protocol code + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + protocol: number; + + /** + * Device configuration descriptor information + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + configs: Array; + } + + /** + * Represents a USB device pipe, which is used to determine the USB device. + * + * @typedef USBDevicePipe + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interface USBDevicePipe { + /** + * Bus address. + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + busNum: number; + + /** + * Device address + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + devAddress: number; + } + + /** + * Enumerates power role types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + export enum PowerRoleType { + /** + * None * * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 + * @deprecated since 9 */ - export enum PowerRoleType { - /** - * None - * - * @since 9 - */ - NONE = 0, - - /** - * External power supply - * - * @since 9 - */ - SOURCE = 1, - - /** - * Internal power supply - * - * @since 9 - */ - SINK = 2 - } + NONE = 0, /** - * Enumerates data role types. + * External power supply * * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 + * @deprecated since 9 */ - export enum DataRoleType { - /** - * None - * - * @since 9 - */ - NONE = 0, - - /** - * Host mode - * - * @since 9 - */ - HOST = 1, - - /** - * Device mode - * - * @since 9 - */ - DEVICE = 2 - } + SOURCE = 1, /** - * Enumerates port mode types + * Internal power supply * * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 + * @deprecated since 9 */ - export enum PortModeType { - /** - * None - * - * @since 9 - */ - NONE = 0, - - /** - * Upstream facing port, which functions as the sink of power supply - * - * @since 9 - */ - UFP = 1, - - /** - * Downstream facing port, which functions as the source of power supply - * - * @since 9 - */ - DFP = 2, - - /** - * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. - * - * @since 9 - */ - DRP = 3, - - /** - * Not supported currently - * - * @since 9 - */ - NUM_MODES = 4 - } + SINK = 2 + } + /** + * Enumerates data role types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + export enum DataRoleType { /** - * Enumerates USB device port roles. + * None * * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 + * @deprecated since 9 */ - interface USBPortStatus { - /** - * USB mode - * - * @since 9 - */ - currentMode: number; - - /** - * Power role - * - * @since 9 - */ - currentPowerRole: number; - - /** - * Data role - * - * @since 9 - */ - currentDataRole: number; - } + NONE = 0, /** - * Represents a USB device port. + * Host mode * * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 + * @deprecated since 9 */ - interface USBPort { - /** - * Unique ID of the USB port - * - * @since 9 - */ - id: number; - - /** - * Mask combination for the supported mode list of the USB port - * - * @since 9 - */ - supportedModes: PortModeType; - - /** - * USB port role defined by {@link USBPortStatus} - * - * @since 9 - */ - status: USBPortStatus; - } + HOST = 1, /** - * Represents control transfer parameters. - * - * @syscap SystemCapability.USB.USBManager - * @since 8 - */ - interface USBControlParams { - /** - * Request type - * - * @since 8 - */ - request: number; + * Device mode + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + DEVICE = 2 + } - /** - * Request target type - * - * @since 8 - */ - target: USBRequestTargetType; - - /** - * Control request type - * - * @since 8 - */ - reqType: USBControlRequestType; - - /** - * Request parameter value - * - * @since 8 - */ - value: number; - - /** - * Index of the parameter value - * - * @since 8 - */ - index: number; - - /** - * Data written to or read from the buffer - * @since 8 - */ - data: Uint8Array; - } + /** + * Enumerates port mode types + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + export enum PortModeType { + /** + * None + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + NONE = 0, /** - * Enumerates USB request target types. + * Upstream facing port, which functions as the sink of power supply + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + UFP = 1, + + /** + * Downstream facing port, which functions as the source of power supply + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + DFP = 2, + + /** + * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + DRP = 3, + + /** + * Not supported currently + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + NUM_MODES = 4 + } + + /** + * Enumerates USB device port roles. + * + * @typedef USBPortStatus + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + interface USBPortStatus { + /** + * USB mode + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + currentMode: number; + + /** + * Power role + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + currentPowerRole: number; + + /** + * Data role + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + currentDataRole: number; + } + + /** + * Represents a USB device port. + * + * @typedef USBPort + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + interface USBPort { + /** + * Unique ID of the USB port + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + id: number; + + /** + * Mask combination for the supported mode list of the USB port + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + supportedModes: PortModeType; + + /** + * USB port role + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + status: USBPortStatus; + } + + /** + * Represents control transfer parameters. + * + * @typedef USBControlParams + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + interface USBControlParams { + /** + * Request type * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - export enum USBRequestTargetType { - /** - * USB device - * - * @since 8 - */ - USB_REQUEST_TARGET_DEVICE = 0, - - /** - * USB interface - * - * @since 8 - */ - USB_REQUEST_TARGET_INTERFACE = 1, - - /** - * Endpoint - * - * @since 8 - */ - USB_REQUEST_TARGET_ENDPOINT = 2, - - /** - * Others - * - * @since 8 - */ - USB_REQUEST_TARGET_OTHER = 3 - } + request: number; /** - * Enumerates control request types. - * + * Request target type + * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - export enum USBControlRequestType { - /** - * Standard - * - * @since 8 - */ - USB_REQUEST_TYPE_STANDARD = 0, - - /** - * Class - * - * @since 8 - */ - USB_REQUEST_TYPE_CLASS = 1, - - /** - * Vendor - * - * @since 8 - */ - USB_REQUEST_TYPE_VENDOR = 2 - } + target: USBRequestTargetType; /** - * Enumerates request directions. - * + * Control request type + * * @syscap SystemCapability.USB.USBManager * @since 8 + * @deprecated since 9 */ - export enum USBRequestDirection { - /** - * Request for writing data from the host to the device - * - * @since 8 - */ - USB_REQUEST_DIR_TO_DEVICE = 0, - - /** - * Request for reading data from the device to the host - * - * @since 8 - */ - USB_REQUEST_DIR_FROM_DEVICE = 0x80 - } + reqType: USBControlRequestType; /** - * Enumerates function modes. + * Request parameter value + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + value: number; + + /** + * Index of the parameter value + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + index: number; + + /** + * Data written to or read from the buffer + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + data: Uint8Array; + } + + /** + * Enumerates USB request target types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + export enum USBRequestTargetType { + /** + * USB device + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TARGET_DEVICE = 0, + + /** + * USB interface + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TARGET_INTERFACE = 1, + + /** + * Endpoint + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TARGET_ENDPOINT = 2, + + /** + * Others + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TARGET_OTHER = 3 + } + + /** + * Enumerates control request types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + export enum USBControlRequestType { + /** + * Standard + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TYPE_STANDARD = 0, + + /** + * Class + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TYPE_CLASS = 1, + + /** + * Vendor + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_TYPE_VENDOR = 2 + } + + /** + * Enumerates request directions. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + export enum USBRequestDirection { + /** + * Request for writing data from the host to the device + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_DIR_TO_DEVICE = 0, + + /** + * Request for reading data from the device to the host + * + * @syscap SystemCapability.USB.USBManager + * @since 8 + * @deprecated since 9 + */ + USB_REQUEST_DIR_FROM_DEVICE = 0x80 + } + + /** + * Enumerates function modes. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + export enum FunctionType { + /** + * None * * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 + * @deprecated since 9 */ - export enum FunctionType { - /** - * None - * - * @since 9 - */ - NONE = 0, + NONE = 0, - /** - * Serial port device - * - * @since 9 - */ - ACM = 1, + /** + * Serial port device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + ACM = 1, - /** - * Ethernet port device - * - * @since 9 - */ - ECM = 2, + /** + * Ethernet port device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + ECM = 2, - /** - * HDC device - * - * @since 9 - */ - HDC = 4, + /** + * HDC device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + HDC = 4, - /** - * MTP device - * - * @since 9 - */ - MTP = 8, + /** + * MTP device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + MTP = 8, - /** - * PTP device - * - * @since 9 - */ - PTP = 16, + /** + * PTP device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + PTP = 16, - /** - * RNDIS device - * - * @since 9 - */ - RNDIS = 32, + /** + * RNDIS device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + RNDIS = 32, - /** - * MIDI device - * - * @since 9 - */ - MIDI = 64, + /** + * MIDI device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + MIDI = 64, - /** - * Audio source device - * - * @since 9 - */ - AUDIO_SOURCE = 128, - - /** - * NCM device - * - * @since 9 - */ - NCM = 256 - } + /** + * Audio source device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + AUDIO_SOURCE = 128, + /** + * NCM device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + * @deprecated since 9 + */ + NCM = 256 + } } export default usb; diff --git a/api/@ohos.usbManager.d.ts b/api/@ohos.usbManager.d.ts index 124a12d52..066855702 100644 --- a/api/@ohos.usbManager.d.ts +++ b/api/@ohos.usbManager.d.ts @@ -15,966 +15,1077 @@ /** * This module provides the capability of manage USB device. + * * @namespace usbManager * @syscap SystemCapability.USB.USBManager * @since 9 */ declare namespace usbManager { + /** + * Obtains the USB device list. + * + * @returns { Array> } USB device list. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getDevices(): Array>; + + /** + * Connects to the USB device based on the device information returned by getDevices(). + * + * @param { USBDevice } device - USB device on the device list returned by getDevices(). + * @returns { Readonly } object for data transfer. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @throws { BusinessError } 14400001 - USB Device access denied. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function connectDevice(device: USBDevice): Readonly; + + /** + * Checks whether the application has the permission to access the device. + * + * @param { string } deviceName - device name defined by USBDevice.name. + * @returns { boolean } indicates if the user has the permission to access the device. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function hasRight(deviceName: string): boolean; + + /** + * Requests the permission for a given application to access the USB device. + * + * @param { string } deviceName - device name defined by USBDevice.name. + * @returns { Promise } indicates if the device access permissions are granted. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function requestRight(deviceName: string): Promise; + + /** + * Remove the permission for a given application to access the USB device. + * + * @param { string } deviceName - device name defined by USBDevice.name. + * @returns { boolean } indicates if the device access permissions are removed. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function removeRight(deviceName: string): boolean; + + /** + * Add device access permission. + * + * @param { string } bundleName - refers to application that require access permissions. + * @param { string } deviceName - device name defined by USBDevice.name. + * @returns { boolean } value to indicate whether the permission is granted. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function addRight(bundleName: string, deviceName: string): boolean; + + /** + * Converts the string descriptor of a given USB function list to a numeric mask combination. + * + * @param { string } funcs - descriptor of the supported function list. + * @returns { number } the numeric mask combination of the function list. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function usbFunctionsFromString(funcs: string): number; + + /** + * Converts the numeric mask combination of a given USB function list to a string descriptor. + * + * @param { FunctionType } funcs - numeric mask combination of the function list. + * @returns { string } - descriptor of the supported function list. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function usbFunctionsToString(funcs: FunctionType): string; + + /** + * Sets the current USB function list in Device mode. + * + * @param { FunctionType } funcs - numeric mask combination of the supported function list. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function setCurrentFunctions(funcs: FunctionType): Promise; + + /** + * Obtains the numeric mask combination for the current USB function list in Device mode. + * + * @returns { FunctionType } the numeric mask combination for the current USB function list in FunctionType. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function getCurrentFunctions(): FunctionType; + + /* usb port functions begin */ + /** + * Obtains the USBPort list. + * + * @returns { Array } the USBPort list. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function getPorts(): Array; + + /** + * Gets the mask combination for the supported mode list of the specified USBPort. + * + * @param { number } portId + * @returns { PortModeType } the mask combination for the supported mode list in PortModeType. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function getSupportedModes(portId: number): PortModeType; + + /** + * Sets the role types supported by the specified USBPort, which can be powerRole (for charging) and dataRole (for data transfer). + * + * @param { number } portId - unique ID of the port. + * @param { PowerRoleType } powerRole - charging role. + * @param { DataRoleType } dataRole - data role. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; + + /* usb pipe functions begin */ + /** + * Claims a USB interface. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. + * @param { USBInterface } iface - USB interface, which is used to determine the interface to claim. + * @param { boolean } [force] - optional parameter that determines whether to forcibly claim the USB interface. + * @returns { number } returns **0** if the USB interface is successfully claimed; returns an error code otherwise. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; + + /** + * Releases a USB interface. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. + * @param { USBInterface } iface - USB interface, which is used to determine the interface to release. + * @returns { number } returns **0** if the USB interface is successfully released; returns an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; + + /** + * Sets the device configuration. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. + * @param { USBConfiguration } config - device configuration. + * @returns { number } returns **0** if the device configuration is successfully set; returns an error code otherwise. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; + + /** + * Sets a USB interface. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. + * @param { USBInterface } iface - USB interface, which is used to determine the interface to set. + * @returns { number } returns **0** if the USB interface is successfully set; return an error code otherwise. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; + + /** + * Obtains the raw USB descriptor. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the bus number and device address. + * @returns { Uint8Array } returns the raw descriptor data. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; + + /** + * Obtains the file descriptor. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. + * @returns { number } returns the file descriptor of the USB device. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getFileDescriptor(pipe: USBDevicePipe): number; + + /** + * Performs control transfer. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. + * @param { USBControlParams } controlparam - control transfer parameters. + * @param { number } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @returns { Promise } returns the size of the transmitted or received data block if the control transfer is successful; + * return -1 if an exception occurs. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise; + + /** + * Performs bulk transfer. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. + * @param { USBEndpoint } endpoint - USB endpoint, which is used to determine the USB port for data transfer. + * @param { Uint8Array } buffer - buffer for writing or reading data. + * @param { number } [timeout] - timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @returns { Promise } the size of the transmitted or received data block if the control transfer is successful; + * return -1 if an exception occurs. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function bulkTransfer( + pipe: USBDevicePipe, + endpoint: USBEndpoint, + buffer: Uint8Array, + timeout?: number + ): Promise; + + /** + * Closes a USB device pipe. + * + * @param { USBDevicePipe } pipe - device pipe, which is used to determine the USB device. + * @returns { number } returns **0** if the USB device pipe is closed successfully; return an error code otherwise. + * @throws { BusinessError } 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function closePipe(pipe: USBDevicePipe): number; + + /** + * Represents the USB endpoint from which data is sent or received. You can obtain the USB endpoint through USBInterface. + * + * @typedef USBEndpoint + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBEndpoint { /** - * Obtains the USB device list. + * Endpoint address * - * @returns Returns the {@link USBDevice} list. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function getDevices(): Array>; + address: number; /** - * Connects to the USB device based on the device information returned by {@link getDevices()}. + * Endpoint attributes * - * @param device USB device on the device list returned by {@link getDevices()}. - * @returns Returns the {@link USBDevicePipe} object for data transfer. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @throws {BusinessError} 14400001 - USB Device access denied. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function connectDevice(device: USBDevice): Readonly; + attributes: number; /** - * Checks whether the application has the permission to access the device. + * Endpoint interval * - * @param deviceName Device name defined by {@link USBDevice.name}. - * @returns Returns **true** if the user has the permission to access the device; return **false** otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function hasRight(deviceName: string): boolean; + interval: number; /** - * Requests the permission for a given application to access the USB device. + * Maximum size of data packets on the endpoint * - * @param deviceName Device name defined by {@link USBDevice.name}. - * @returns Returns **true** if the device access permissions are granted; return **false** otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function requestRight(deviceName: string): Promise; + maxPacketSize: number; /** - * Remove the permission for a given application to access the USB device. + * Endpoint direction * - * @param deviceName Device name defined by {@link USBDevice.name}. - * @returns Returns **true** if the device access permissions are removed; return **false** otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function removeRight(deviceName: string): boolean; + direction: USBRequestDirection; /** - * Add device access permission. + * Endpoint number * - * @param bundleName refers to application that require access permissions. - * @param deviceName Device name defined by {@link USBDevice.name}. - * @returns Returns the boolean value to indicate whether the permission is granted. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function addRight(bundleName: string, deviceName: string): boolean; + number: number; /** - * Converts the string descriptor of a given USB function list to a numeric mask combination. + * Endpoint type * - * @param funcs Descriptor of the supported function list. - * @returns Returns the numeric mask combination of the function list. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function usbFunctionsFromString(funcs: string): number; + type: number; /** - * Converts the numeric mask combination of a given USB function list to a string descriptor. + * Unique ID defined by USBInterface.id, which indicates the interface to which the endpoint belongs * - * @param funcs Numeric mask combination of the function list. - * @returns Returns the string descriptor of the supported function list. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function usbFunctionsToString(funcs: FunctionType): string; + interfaceId: number; + } + /** + * Represents a USB interface. One config can contain multiple **USBInterface** instances, each providing a specific function. + * + * @typedef USBInterface + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBInterface { /** - * Sets the current USB function list in Device mode. + * Unique ID of the USB interface * - * @param funcs Numeric mask combination of the supported function list. - * @returns Returns **true** if the setting is successful; returns **false** otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function setCurrentFunctions(funcs: FunctionType): Promise; + id: number; /** - * Obtains the numeric mask combination for the current USB function list in Device mode. + * Interface protocol * - * @returns Returns the numeric mask combination for the current USB function list in {@link FunctionType}. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function getCurrentFunctions(): FunctionType; + protocol: number; - /* usb port functions begin */ /** - * Obtains the {@link USBPort} list. + * Device type * - * @returns Returns the {@link USBPort} list. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function getPorts(): Array; + clazz: number; /** - * Gets the mask combination for the supported mode list of the specified {@link USBPort}. + * Device subclass * - * @returns Returns the mask combination for the supported mode list in {@link PortModeType}. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function getSupportedModes(portId: number): PortModeType; + subClass: number; /** - * Sets the role types supported by the specified {@link USBPort}, which can be powerRole (for charging) and dataRole (for data transfer). + * Alternation between descriptors of the same USB interface * - * @param portId Unique ID of the port. - * @param powerRole Charging role defined by {@link PowerRoleType}. - * @param dataRole Data role defined by {@link DataRoleType}. - * @returns Returns the supported role type. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. - * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ - function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; + alternateSetting: number; - /* usb pipe functions begin */ /** - * Claims a USB interface. + * Interface name * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim. - * @param force Optional parameter that determines whether to forcibly claim the USB interface. - * @returns Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; + name: string; /** - * Releases a USB interface. + * USBEndpoint that belongs to the USB interface * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release. - * @returns Returns **0** if the USB interface is successfully released; returns an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; + endpoints: Array; + } + /** + * USB configuration. One USBDevice can contain multiple USBConfiguration instances. + * + * @typedef USBConfiguration + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBConfiguration { /** - * Sets the device configuration. + * Unique ID of the USB configuration * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param config Device configuration defined by {@link USBConfiguration}. - * @returns Returns **0** if the device configuration is successfully set; returns an error code otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; + id: number; /** - * Sets a USB interface. + * Configuration attributes * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set. - * @returns Returns **0** if the USB interface is successfully set; return an error code otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; + attributes: number; /** - * Obtains the raw USB descriptor. + * Maximum power consumption, in mA * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @returns Returns the raw descriptor data. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; + maxPower: number; /** - * Obtains the file descriptor. + * Configuration name, which can be left empty * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @returns Returns the file descriptor of the USB device. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function getFileDescriptor(pipe: USBDevicePipe): number; + name: string; /** - * Performs control transfer. + * Support for remote wakeup * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @param controlparam Control transfer parameters. - * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise; + isRemoteWakeup: boolean; /** - * Performs bulk transfer. + * Support for independent power supplies * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @param endpoint USB endpoint defined by {@link USBEndpoint}, which is used to determine the USB port for data transfer. - * @param buffer Buffer for writing or reading data. - * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, - timeout?: number): Promise; + isSelfPowered: boolean; /** - * Closes a USB device pipe. + * Supported interface attributes * - * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @returns Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. - * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function closePipe(pipe: USBDevicePipe): number; + interfaces: Array; + } + /** + * Represents a USB device. + * + * @typedef USBDevice + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBDevice { /** - * Represents the USB endpoint from which data is sent or received. You can obtain the USB endpoint through {@link USBInterface}. + * Bus address * - * @typedef USBEndpoint * @syscap SystemCapability.USB.USBManager * @since 9 */ - interface USBEndpoint { - /** - * Endpoint address - * - * @since 9 - */ - address: number; - - /** - * Endpoint attributes - * - * @since 9 - */ - attributes: number; - - /** - * Endpoint interval - * - * @since 9 - */ - interval: number; - - /** - * Maximum size of data packets on the endpoint - * - * @since 9 - */ - maxPacketSize: number; - - /** - * Endpoint direction - * - * @since 9 - */ - direction: USBRequestDirection; - - /** - * Endpoint number - * - * @since 9 - */ - number: number; - - /** - * Endpoint type - * - * @since 9 - */ - type: number; - - /** - * Unique ID defined by {@link USBInterface.id}, which indicates the interface to which the endpoint belongs - * - * @since 9 - */ - interfaceId: number; - } - + busNum: number; /** - * Represents a USB interface. One config {@link USBConfiguration} can contain multiple **USBInterface** instances, each providing a specific function. + * Device address * - * @typedef USBInterface * @syscap SystemCapability.USB.USBManager * @since 9 */ - interface USBInterface { - /** - * Unique ID of the USB interface - * - * @since 9 - */ - id: number; - - /** - * Interface protocol - * - * @since 9 - */ - protocol: number; - - /** - * Device type - * - * @since 9 - */ - clazz: number; - - /** - * Device subclass - * - * @since 9 - */ - subClass: number; - - /** - * Alternation between descriptors of the same USB interface - * - * @since 9 - */ - alternateSetting: number; - - /** - * Interface name - * - * @since 9 - */ - name: string; - - /** - * {@link USBEndpoint} that belongs to the USB interface - * - * @since 9 - */ - endpoints: Array; - } + devAddress: number; /** - * USB configuration. One {@link USBDevice} can contain multiple USBConfiguration instances. + * Device SN * - * @typedef USBConfiguration * @syscap SystemCapability.USB.USBManager * @since 9 */ - interface USBConfiguration { - /** - * Unique ID of the USB configuration - * - * @since 9 - * - * - */ - id: number; - - /** - * Configuration attributes - * - * @since 9 - */ - attributes: number; - - /** - * Maximum power consumption, in mA - * - * @since 9 - */ - maxPower: number; - - /** - * Configuration name, which can be left empty - * - * @since 9 - */ - name: string; - - /** - * Support for remote wakeup - * - * @since 9 - */ - isRemoteWakeup: boolean; - - /** - * Support for independent power supplies - * - * @since 9 - */ - isSelfPowered: boolean; - - /** - * Supported interface attributes defined by {@link USBInterface} - * - * @since 9 - */ - interfaces: Array; - } + serial: string; /** - * Represents a USB device. + * Device name * - * @typedef USBDevice * @syscap SystemCapability.USB.USBManager * @since 9 */ - interface USBDevice { - /** - * Bus address - * - * @since 9 - */ - busNum: number; - - /** - * Device address - * - * @since 9 - */ - devAddress: number; - - /** - * Device SN - * - * @since 9 - */ - serial: string; - - /** - * Device name - * - * @since 9 - */ - name: string; - - /** - * Device manufacturer - * - * @since 9 - */ - manufacturerName: string; - - /** - * Product information - * - * @since 9 - */ - productName: string; - - /** - * Product version - * - * @since 9 - */ - version: string; - - /** - * Vendor ID - * - * @since 9 - */ - vendorId: number; - - /** - * Product ID - * - * @since 9 - */ - productId: number; - - /** - * Device class - * - * @since 9 - */ - clazz: number; - - /** - * Device subclass - * - * @since 9 - */ - subClass: number; - - /** - * Device protocol code - * - * @since 9 - */ - protocol: number; - - /** - * Device configuration descriptor information defined by {@link USBConfiguration} - * - * @since 9 - */ - configs: Array; - } + name: string; /** - * Represents a USB device pipe, which is used to determine the USB device. + * Device manufacturer * - * @typedef USBDevicePipe * @syscap SystemCapability.USB.USBManager * @since 9 */ - interface USBDevicePipe { - /** - * Bus address. - * - * @since 9 - */ - busNum: number; - - /** - * Device address - * - * @since 9 - */ - devAddress: number; - } + manufacturerName: string; /** - * Enumerates power role types. + * Product information + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + productName: string; + + /** + * Product version + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + version: string; + + /** + * Vendor ID + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + vendorId: number; + + /** + * Product ID + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + productId: number; + + /** + * Device class + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + clazz: number; + + /** + * Device subclass + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + subClass: number; + + /** + * Device protocol code + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + protocol: number; + + /** + * Device configuration descriptor information + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + configs: Array; + } + + /** + * Represents a USB device pipe, which is used to determine the USB device. + * + * @typedef USBDevicePipe + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBDevicePipe { + /** + * Bus address. + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + busNum: number; + + /** + * Device address + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + devAddress: number; + } + + /** + * Enumerates power role types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum PowerRoleType { + /** + * None * - * @enum { number } * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 */ - export enum PowerRoleType { - /** - * None - * - * @since 9 - */ - NONE = 0, - - /** - * External power supply - * - * @since 9 - */ - SOURCE = 1, - - /** - * Internal power supply - * - * @since 9 - */ - SINK = 2 - } + NONE = 0, /** - * Enumerates data role types. + * External power supply * - * @enum { number } * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 */ - export enum DataRoleType { - /** - * None - * - * @since 9 - */ - NONE = 0, - - /** - * Host mode - * - * @since 9 - */ - HOST = 1, - - /** - * Device mode - * - * @since 9 - */ - DEVICE = 2 - } + SOURCE = 1, /** - * Enumerates port mode types + * Internal power supply * - * @enum { number } * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 */ - export enum PortModeType { - /** - * None - * - * @since 9 - */ - NONE = 0, - - /** - * Upstream facing port, which functions as the sink of power supply - * - * @since 9 - */ - UFP = 1, - - /** - * Downstream facing port, which functions as the source of power supply - * - * @since 9 - */ - DFP = 2, - - /** - * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. - * - * @since 9 - */ - DRP = 3, - - /** - * Not supported currently - * - * @since 9 - */ - NUM_MODES = 4 - } + SINK = 2 + } + /** + * Enumerates data role types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum DataRoleType { /** - * Enumerates USB device port roles. + * None * - * @typedef USBPortStatus * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 */ - interface USBPortStatus { - /** - * USB mode - * - * @since 9 - */ - currentMode: number; - - /** - * Power role - * - * @since 9 - */ - currentPowerRole: number; - - /** - * Data role - * - * @since 9 - */ - currentDataRole: number; - } + NONE = 0, /** - * Represents a USB device port. + * Host mode * - * @typedef USBPort * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 */ - interface USBPort { - /** - * Unique ID of the USB port - * - * @since 9 - */ - id: number; - - /** - * Mask combination for the supported mode list of the USB port - * - * @since 9 - */ - supportedModes: PortModeType; - - /** - * USB port role defined by {@link USBPortStatus} - * - * @since 9 - */ - status: USBPortStatus; - } + HOST = 1, /** - * Represents control transfer parameters. - * - * @typedef USBControlParams - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - interface USBControlParams { - /** - * Request type - * - * @since 9 - */ - request: number; - - /** - * Request target type - * - * @since 9 - */ - target: USBRequestTargetType; - - /** - * Control request type - * - * @since 9 - */ - reqType: USBControlRequestType; - - /** - * Request parameter value - * - * @since 9 - */ - value: number; - - /** - * Index of the parameter value - * - * @since 9 - */ - index: number; - - /** - * Data written to or read from the buffer - * @since 9 - */ - data: Uint8Array; - } - - /** - * Enumerates USB request target types. + * Device mode * - * @enum { number } - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - export enum USBRequestTargetType { - /** - * USB device - * - * @since 9 - */ - USB_REQUEST_TARGET_DEVICE = 0, - - /** - * USB interface - * - * @since 9 - */ - USB_REQUEST_TARGET_INTERFACE = 1, - - /** - * Endpoint - * - * @since 9 - */ - USB_REQUEST_TARGET_ENDPOINT = 2, - - /** - * Others - * - * @since 9 - */ - USB_REQUEST_TARGET_OTHER = 3 - } - - /** - * Enumerates control request types. - * - * @enum { number } - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - export enum USBControlRequestType { - /** - * Standard - * - * @since 9 - */ - USB_REQUEST_TYPE_STANDARD = 0, - - /** - * Class - * - * @since 9 - */ - USB_REQUEST_TYPE_CLASS = 1, - - /** - * Vendor - * - * @since 9 - */ - USB_REQUEST_TYPE_VENDOR = 2 - } - - /** - * Enumerates request directions. - * - * @enum { number } - * @syscap SystemCapability.USB.USBManager - * @since 9 - */ - export enum USBRequestDirection { - /** - * Request for writing data from the host to the device - * - * @since 9 - */ - USB_REQUEST_DIR_TO_DEVICE = 0, - - /** - * Request for reading data from the device to the host - * - * @since 9 - */ - USB_REQUEST_DIR_FROM_DEVICE = 0x80 - } - - /** - * Enumerates function modes. - * - * @enum { number } * @syscap SystemCapability.USB.USBManager * @systemapi * @since 9 */ - export enum FunctionType { - /** - * None - * - * @since 9 - */ - NONE = 0, + DEVICE = 2 + } - /** - * Serial port device - * - * @since 9 - */ - ACM = 1, + /** + * Enumerates port mode types + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum PortModeType { + /** + * None + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + NONE = 0, - /** - * Ethernet port device - * - * @since 9 - */ - ECM = 2, + /** + * Upstream facing port, which functions as the sink of power supply + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + UFP = 1, - /** - * HDC device - * - * @since 9 - */ - HDC = 4, + /** + * Downstream facing port, which functions as the source of power supply + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + DFP = 2, - /** - * MTP device - * - * @since 9 - */ - MTP = 8, + /** + * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + DRP = 3, - /** - * PTP device - * - * @since 9 - */ - PTP = 16, + /** + * Not supported currently + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + NUM_MODES = 4 + } - /** - * RNDIS device - * - * @since 9 - */ - RNDIS = 32, + /** + * Enumerates USB device port roles. + * + * @typedef USBPortStatus + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + interface USBPortStatus { + /** + * USB mode + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + currentMode: number; - /** - * MIDI device - * - * @since 9 - */ - MIDI = 64, + /** + * Power role + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + currentPowerRole: number; - /** - * Audio source device - * - * @since 9 - */ - AUDIO_SOURCE = 128, + /** + * Data role + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + currentDataRole: number; + } - /** - * NCM device - * - * @since 9 - */ - NCM = 256 - } + /** + * Represents a USB device port. + * + * @typedef USBPort + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + interface USBPort { + /** + * Unique ID of the USB port + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + id: number; + /** + * Mask combination for the supported mode list of the USB port + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + supportedModes: PortModeType; + + /** + * USB port role + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + status: USBPortStatus; + } + + /** + * Represents control transfer parameters. + * + * @typedef USBControlParams + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBControlParams { + /** + * Request type + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + request: number; + + /** + * Request target type + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + target: USBRequestTargetType; + + /** + * Control request type + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + reqType: USBControlRequestType; + + /** + * Request parameter value + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + value: number; + + /** + * Index of the parameter value + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + index: number; + + /** + * Data written to or read from the buffer + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + data: Uint8Array; + } + + /** + * Enumerates USB request target types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + export enum USBRequestTargetType { + /** + * USB device + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TARGET_DEVICE = 0, + + /** + * USB interface + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TARGET_INTERFACE = 1, + + /** + * Endpoint + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TARGET_ENDPOINT = 2, + + /** + * Others + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TARGET_OTHER = 3 + } + + /** + * Enumerates control request types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + export enum USBControlRequestType { + /** + * Standard + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TYPE_STANDARD = 0, + + /** + * Class + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TYPE_CLASS = 1, + + /** + * Vendor + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_TYPE_VENDOR = 2 + } + + /** + * Enumerates request directions. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + export enum USBRequestDirection { + /** + * Request for writing data from the host to the device + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_DIR_TO_DEVICE = 0, + + /** + * Request for reading data from the device to the host + * + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + USB_REQUEST_DIR_FROM_DEVICE = 0x80 + } + + /** + * Enumerates function modes. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum FunctionType { + /** + * None + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + NONE = 0, + + /** + * Serial port device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + ACM = 1, + + /** + * Ethernet port device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + ECM = 2, + + /** + * HDC device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + HDC = 4, + + /** + * MTP device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + MTP = 8, + + /** + * PTP device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + PTP = 16, + + /** + * RNDIS device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + RNDIS = 32, + + /** + * MIDI device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + MIDI = 64, + + /** + * Audio source device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + AUDIO_SOURCE = 128, + + /** + * NCM device + * + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + NCM = 256 + } } export default usbManager; diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index 0902a2151..b8912ef02 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { AsyncCallback } from './basic'; +import type { AsyncCallback } from './@ohos.base'; /** * User authentication diff --git a/api/@ohos.vibrator.d.ts b/api/@ohos.vibrator.d.ts index cf502d838..428606c23 100644 --- a/api/@ohos.vibrator.d.ts +++ b/api/@ohos.vibrator.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; /** * This module provides the capability to control motor vibration. diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts index 9cac88ca1..7d9addc36 100644 --- a/api/@ohos.wallpaper.d.ts +++ b/api/@ohos.wallpaper.d.ts @@ -12,386 +12,468 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {AsyncCallback} from './basic'; +import {AsyncCallback} from './@ohos.base'; import image from './@ohos.multimedia.image'; /** * System wallpaper + * + * @namespace wallpaper * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 */ declare namespace wallpaper { + /** + * RgbaColor definition + * + * @typedef RgbaColor + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + interface RgbaColor { /** - * RgbaColor definition + * The range is 0 to 255. + * * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 * @deprecated since 9 */ - interface RgbaColor { - /** - * The range is 0 to 255. - */ - red: number; - /** - * The range is 0 to 255. - */ - green: number; - /** - * The range is 0 to 255. - */ - blue: number; - /** - * The range is 0 to 255. - */ - alpha: number; - } - + red: number; /** - * Indicates wallpaper type. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - */ - enum WallpaperType { - /** - * Indicates the home screen wallpaper. - */ - WALLPAPER_SYSTEM, - /** - * Indicates the lock screen wallpaper. - */ - WALLPAPER_LOCKSCREEN - } - - /** - * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. - * @param wallpaperType Indicates the wallpaper type. + * The range is 0 to 255. + * * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 * @deprecated since 9 */ - function getColors(wallpaperType: WallpaperType, callback: AsyncCallback>): void; - + green: number; /** - * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. - * @param wallpaperType Indicates the wallpaper type. - * @returns { Promise> } the Promise> returned by the function. + * The range is 0 to 255. + * * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 * @deprecated since 9 */ - function getColors(wallpaperType: WallpaperType): Promise>; - + blue: number; /** - * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. - * @param wallpaperType Indicates the wallpaper type. - * @returns { Array } the Array returned by the function. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function getColorsSync(wallpaperType: WallpaperType): Array; - - /** - * Obtains the ID of the wallpaper of the specified type. Returns an integer greater than or equal to {@code 0} representing the wallpaper ID. - * if the specified type of wallpaper has been set; returns {@code -1} otherwise. The return value is an integer ranging from -1 to 2^31 - 1. - * @param wallpaperType Indicates the wallpaper type. + * The range is 0 to 255. + * * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 * @deprecated since 9 */ - function getId(wallpaperType: WallpaperType, callback: AsyncCallback): void; + alpha: number; + } + /** + * Indicates wallpaper type. + * + * @enum { number } WallpaperType + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + */ + enum WallpaperType { /** - * Obtains the ID of the wallpaper of the specified type. Returns an integer greater than or equal to {@code 0} representing the wallpaper ID. - * if the specified type of wallpaper has been set; returns {@code -1} otherwise. The return value is an integer ranging from -1 to 2^31 - 1. - * @param wallpaperType Indicates the wallpaper type. - * @returns { Promise } the Promise returned by the function. + * Indicates the home screen wallpaper. + * * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 - * @deprecated since 9 */ - function getId(wallpaperType: WallpaperType): Promise; - + WALLPAPER_SYSTEM, /** - * Obtains a file of the wallpaper of the specified type. Returns the file descriptor. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.GET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 8 - * @deprecated since 9 - */ - function getFile(wallpaperType: WallpaperType, callback: AsyncCallback): void; - - /** - * Obtains a file of the wallpaper of the specified type. Returns the file descriptor. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.GET_WALLPAPER - * @returns { Promise } the Promise returned by the function. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 8 - * @deprecated since 9 - */ - function getFile(wallpaperType: WallpaperType): Promise; - - /** - * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * Indicates the lock screen wallpaper. + * * @syscap SystemCapability.MiscServices.Wallpaper * @since 7 - * @deprecated since 9 */ - function getMinHeight(callback: AsyncCallback): void; + WALLPAPER_LOCKSCREEN + } - /** - * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. - * @returns { Promise } the Promise returned by the function. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function getMinHeight(): Promise; + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback> } callback - the callback of getColors. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getColors(wallpaperType: WallpaperType, callback: AsyncCallback>): void; - /** - * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. - * @returns { number } the number returned by the function. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function getMinHeightSync(): number; + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise> } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getColors(wallpaperType: WallpaperType): Promise>; - /** - * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function getMinWidth(callback: AsyncCallback): void; + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Array } the Array returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getColorsSync(wallpaperType: WallpaperType): Array; - /** - * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. - * @returns { Promise } the Promise returned by the function. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function getMinWidth(): Promise; + /** + * Obtains the ID of the wallpaper of the specified type. Returns an integer greater than or equal to {@code 0} representing the wallpaper ID. + * if the specified type of wallpaper has been set; returns {@code -1} otherwise. The return value is an integer ranging from -1 to 2^31 - 1. + * + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of getId. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getId(wallpaperType: WallpaperType, callback: AsyncCallback): void; - /** - * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. - * @returns { number } the number returned by the function. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function getMinWidthSync(): number; + /** + * Obtains the ID of the wallpaper of the specified type. Returns an integer greater than or equal to {@code 0} representing the wallpaper ID. + * if the specified type of wallpaper has been set; returns {@code -1} otherwise. The return value is an integer ranging from -1 to 2^31 - 1. + * + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getId(wallpaperType: WallpaperType): Promise; - /** - * Checks whether to allow the application to change the wallpaper for the current user. - * Returns true if the application is allowed to set a wallpaper for the current user. returns false otherwise. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function isChangePermitted(callback: AsyncCallback): void; + /** + * Obtains a file of the wallpaper of the specified type. Returns the file descriptor. + * When usage is complete, the caller needs to close the file descriptor in time. + * + * @permission ohos.permission.GET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of getFile. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 8 + * @deprecated since 9 + */ + function getFile(wallpaperType: WallpaperType, callback: AsyncCallback): void; - /** - * Checks whether to allow the application to change the wallpaper for the current user. - * Returns true if the application is allowed to set a wallpaper for the current user. returns false otherwise. - * @returns { Promise } the Promise returned by the function. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function isChangePermitted(): Promise; + /** + * Obtains a file of the wallpaper of the specified type. Returns the file descriptor. + * When usage is complete, the caller needs to close the file descriptor in time. + * + * @permission ohos.permission.GET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 8 + * @deprecated since 9 + */ + function getFile(wallpaperType: WallpaperType): Promise; - /** - * Checks whether a user is allowed to set wallpapers. - * Returns true if a user is allowed to set wallpapers. returns false otherwise. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function isOperationAllowed(callback: AsyncCallback): void; + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * + * @param { AsyncCallback } callback - the callback of getMinHeight. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getMinHeight(callback: AsyncCallback): void; - /** - * Checks whether a user is allowed to set wallpapers. - * Returns true if a user is allowed to set wallpapers. returns false otherwise. - * @returns { Promise } the Promise returned by the function. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function isOperationAllowed(): Promise; + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getMinHeight(): Promise; - /** - * Removes a wallpaper of the specified type and restores the default one. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function reset(wallpaperType: WallpaperType, callback: AsyncCallback): void; + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * + * @returns { number } the number returned by the function. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getMinHeightSync(): number; - /** - * Removes a wallpaper of the specified type and restores the default one. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function reset(wallpaperType: WallpaperType): Promise; + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * + * @param { AsyncCallback } callback - the callback of getMinWidth. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getMinWidth(callback: AsyncCallback): void; - /** - * Removes a wallpaper of the specified type and restores the default one. - * @param wallpaperType Indicates the wallpaper type. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function getMinWidth(): Promise; - /** - * Removes a wallpaper of the specified type and restores the default one. - * @param wallpaperType Indicates the wallpaper type. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function restore(wallpaperType: WallpaperType): Promise; + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * + * @returns { number } the number returned by the function. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getMinWidthSync(): number; - /** - * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. - * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + /** + * Checks whether to allow the application to change the wallpaper for the current user. + * Returns true if the application is allowed to set a wallpaper for the current user. returns false otherwise. + * + * @param { AsyncCallback } callback - the callback of isChangePermitted. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function isChangePermitted(callback: AsyncCallback): void; - /** - * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. - * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + /** + * Checks whether to allow the application to change the wallpaper for the current user. + * Returns true if the application is allowed to set a wallpaper for the current user. returns false otherwise. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function isChangePermitted(): Promise; - /** - * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. - * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. - * @param wallpaperType Indicates the wallpaper type. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + /** + * Checks whether a user is allowed to set wallpapers. + * Returns true if a user is allowed to set wallpapers. returns false otherwise. + * + * @param { AsyncCallback } callback - the callback of isOperationAllowed. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function isOperationAllowed(callback: AsyncCallback): void; - /** - * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. - * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. - * @param wallpaperType Indicates the wallpaper type. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @permission ohos.permission.SET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + /** + * Checks whether a user is allowed to set wallpapers. + * Returns true if a user is allowed to set wallpapers. returns false otherwise. + * + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function isOperationAllowed(): Promise; - /** - * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. - * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.GET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 7 - * @deprecated since 9 - */ - function getPixelMap(wallpaperType: WallpaperType, callback: AsyncCallback): void; + /** + * Removes a wallpaper of the specified type and restores the default one. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of reset. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function reset(wallpaperType: WallpaperType, callback: AsyncCallback): void; - /** - * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. - * @param wallpaperType Indicates the wallpaper type. - * @returns { Promise } the Promise returned by the function. - * @permission ohos.permission.GET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 7 - * @deprecated since 9 - */ - function getPixelMap(wallpaperType: WallpaperType): Promise; + /** + * Removes a wallpaper of the specified type and restores the default one. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function reset(wallpaperType: WallpaperType): Promise; - /** - * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. - * @param wallpaperType Indicates the wallpaper type. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @permission ohos.permission.GET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function getImage(wallpaperType: WallpaperType, callback: AsyncCallback): void; + /** + * Removes a wallpaper of the specified type and restores the default one. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of restore. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; - /** - * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. - * @param wallpaperType Indicates the wallpaper type. - * @returns { Promise } the Promise returned by the function. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 201 - permission denied. - * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. - * @permission ohos.permission.GET_WALLPAPER - * @syscap SystemCapability.MiscServices.Wallpaper - * @systemapi Hide this for inner system use. - * @since 9 - */ - function getImage(wallpaperType: WallpaperType): Promise; + /** + * Removes a wallpaper of the specified type and restores the default one. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function restore(wallpaperType: WallpaperType): Promise; - /** - * Registers a listener for wallpaper color changes to receive notifications about the changes. - * @param type The incoming colorChange table open receiver pick a color change wallpaper wallpaper color changes - * @param callback Provides dominant colors of the wallpaper. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of setWallpaper. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function setWallpaper( + source: string | image.PixelMap, + wallpaperType: WallpaperType, + callback: AsyncCallback + ): void; - /** - * Unregisters a listener for wallpaper color changes. - * @param type Incoming 'colorChange' table delete receiver to pick up a color change wallpaper wallpaper color changes - * @param callback Provides dominant colors of the wallpaper. - * @syscap SystemCapability.MiscServices.Wallpaper - * @since 7 - * @deprecated since 9 - */ - function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of setImage. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * + * @permission ohos.permission.SET_WALLPAPER + * @param { string | image.PixelMap } source - indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + + /** + * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. + * + * @permission ohos.permission.GET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of getPixelMap. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + */ + function getPixelMap(wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. + * + * @permission ohos.permission.GET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 7 + * @deprecated since 9 + */ + function getPixelMap(wallpaperType: WallpaperType): Promise; + + /** + * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. + * + * @permission ohos.permission.GET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @param { AsyncCallback } callback - the callback of getImage. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getImage(wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Obtains the default pixel map of a wallpaper of the specified type. Returns the default pixel map. + * + * @permission ohos.permission.GET_WALLPAPER + * @param { WallpaperType } wallpaperType - indicates the wallpaper type. + * @returns { Promise } the promise returned by the function. + * @throws { BusinessError } 401 - parameter error. + * @throws { BusinessError } 201 - permission denied. + * @throws { BusinessError } 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getImage(wallpaperType: WallpaperType): Promise; + + /** + * Registers a listener for wallpaper color changes to receive notifications about the changes. + * + * @param { 'colorChange' } type - the incoming colorChange table open receiver pick a color change wallpaper wallpaper color changes. + * @param { (colors: Array, wallpaperType: WallpaperType) => void } callback - provides dominant colors of the wallpaper. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; + + /** + * Unregisters a listener for wallpaper color changes. + * + * @param { 'colorChange' } type - incoming colorChange table delete receiver to pick up a color change wallpaper wallpaper color changes + * @param { (colors: Array, wallpaperType: WallpaperType) => void } callback - provides dominant colors of the wallpaper. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 7 + * @deprecated since 9 + */ + function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; } export default wallpaper; diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index d1ffa7461..cb99575d0 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback , Callback} from './basic'; +import { AsyncCallback , Callback} from './@ohos.base'; import Want from './@ohos.app.ability.Want'; import { WantAgentInfo } from './wantAgent/wantAgentInfo'; import { TriggerInfo } from './wantAgent/triggerInfo'; diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index f2e5933d1..31dcb9a87 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -15,8 +15,8 @@ /// -import {AsyncCallback} from "./basic"; -import {Callback} from "./basic"; +import {AsyncCallback} from "./@ohos.base"; +import {Callback} from "./@ohos.base"; import {Resource} from 'GlobalResource'; import image from "./@ohos.multimedia.image"; import cert from './@ohos.security.cert'; diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index c06cd6367..b5082d879 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides methods to operate or manage Wi-Fi. diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index cea4606dd..1306be209 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides methods to operate or manage Wi-Fi. diff --git a/api/@ohos.wifiManagerExt.d.ts b/api/@ohos.wifiManagerExt.d.ts index 164414239..f324bf3f8 100644 --- a/api/@ohos.wifiManagerExt.d.ts +++ b/api/@ohos.wifiManagerExt.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides extended methods to operate or manage Wi-Fi. diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts index 429d83f9f..6d36f13e6 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import { AsyncCallback, Callback } from './@ohos.base'; /** * Provides extended methods to operate or manage Wi-Fi. diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index c11d0dd3b..c480bab06 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -15,7 +15,7 @@ /// -import { AsyncCallback, Callback } from './basic' ; +import { AsyncCallback, Callback } from './@ohos.base'; import BaseContext from './application/BaseContext'; import { LocalStorage } from 'StateManagement'; import image from './@ohos.multimedia.image'; @@ -861,8 +861,8 @@ declare namespace window { * @param { enable } enable gesture navigation if true, or disable if false. * @param { AsyncCallback } callback - The callback of setGestureNavigationEnabled. * @throws { BusinessError } 401 - If param is invalid. - * @throws { BusinessError } 1300002 - This window manager service works abnormally. - * @throws { BusinessError } 1300003 - This window state is abnormal. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @systemapi Hide this for inner system use. * @since 10 */ @@ -873,8 +873,8 @@ declare namespace window { * @param { enable } enable gesture navigation if true, or disable if false. * @returns { Promise } - The promise returned by the function. * @throws { BusinessError } 401 - If param is invalid. - * @throws { BusinessError } 1300002 - This window manager service works abnormally. - * @throws { BusinessError } 1300003 - This window state is abnormal. + * @throws { BusinessError } 1300002 - This window state is abnormal. + * @throws { BusinessError } 1300003 - This window manager service works abnormally. * @systemapi Hide this for inner system use. * @since 10 */ @@ -2400,8 +2400,8 @@ declare namespace window { * @param { number } ratio - The aspect ratio of window except decoration * @param { AsyncCallback } callback - The callback of setAspectRatio. * @throws { BusinessError } 401 - If param is invalid - * @throws { BusinessError } 1300002 - If window state is abnormally - * @throws { BusinessError } 1300004 - If this window can not set aspect ratio + * @throws { BusinessError } 1300002 - This window state is abnormal + * @throws { BusinessError } 1300004 - Unauthorized operation * @since 10 */ setAspectRatio(ratio: number, callback: AsyncCallback): void; @@ -2411,8 +2411,8 @@ declare namespace window { * @param { number } ratio - The aspect ratio of window except decoration * @returns { Promise } - The promise returned by the function. * @throws { BusinessError } 401 - If param is invalid - * @throws { BusinessError } 1300002 - If window state is abnormally - * @throws { BusinessError } 1300004 - If this window can not set aspect ratio + * @throws { BusinessError } 1300002 - This window state is abnormal + * @throws { BusinessError } 1300004 - Unauthorized operation * @since 10 */ setAspectRatio(ratio: number): Promise; @@ -2420,8 +2420,8 @@ declare namespace window { /** * Resets the aspect ratio of window * @param { AsyncCallback } callback - The callback of setAspectRatio. - * @throws { BusinessError } 1300002 - If window state is abnormally - * @throws { BusinessError } 1300004 - If this window can not reset aspect ratio + * @throws { BusinessError } 1300002 - This window state is abnormal + * @throws { BusinessError } 1300004 - Unauthorized operation * @since 10 */ resetAspectRatio(callback: AsyncCallback): void; @@ -2429,8 +2429,8 @@ declare namespace window { /** * Resets the aspect ratio of window * @returns { Promise } - The promise returned by the function. - * @throws { BusinessError } 1300002 - If window state is abnormally - * @throws { BusinessError } 1300004 - If this window can not reset aspect ratio + * @throws { BusinessError } 1300002 - This window state is abnormal + * @throws { BusinessError } 1300004 - Unauthorized operation * @since 10 */ resetAspectRatio(): Promise; @@ -2439,8 +2439,8 @@ declare namespace window { * Set the watermark flag on the window. * @param { enable } add water mark flag to window if true, or remove flag if false. * @param { AsyncCallback } callback - The callback of setWaterMarkFlag. - * @throws { BusinessError } 1300002 - If window state is abnormally. - * @throws { BusinessError } 1300003 - If system state is abnormally. + * @throws { BusinessError } 1300002 - This window state is abnormal + * @throws { BusinessError } 1300003 - This window manager service works abnormally * @throws { BusinessError } 1300008 - The operation is on invalid display. * @systemapi Hide this for inner system use. * @since 10 @@ -2448,12 +2448,12 @@ declare namespace window { setWaterMarkFlag(enable: boolean, callback: AsyncCallback): void; /** - * Set the watermark flag on the window. - * @param { enable } add water mark flag to window if true, or remove flag if false. - * @returns { Promise } - The promise returned by the function. - * @throws { BusinessError } 1300002 - If window state is abnormally. - * @throws { BusinessError } 1300003 - If system state is abnormally. - * @throws { BusinessError } 1300008 - The operation is on invalid display. + * Set the watermark flag on the window + * @param { enable } add water mark flag to window if true, or remove flag if false + * @returns { Promise } - The promise returned by the function + * @throws { BusinessError } 1300002 - This window state is abnormal + * @throws { BusinessError } 1300003 - This window manager service works abnormally + * @throws { BusinessError } 1300008 - The operation is on invalid display * @systemapi Hide this for inner system use. * @since 10 */ diff --git a/api/@ohos.xml.d.ts b/api/@ohos.xml.d.ts index 7e2cd4267..e11a22cf6 100644 --- a/api/@ohos.xml.d.ts +++ b/api/@ohos.xml.d.ts @@ -15,6 +15,7 @@ /** * The xml module provides utilities for converting XML text to Javascript object, XML generation and parsing. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @permission N/A @@ -24,6 +25,7 @@ declare namespace xml { /** * The XmlSerializer interface is used to generate an xml file. * @name XmlSerializer + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,6 +42,7 @@ declare namespace xml { /** * Write an attribute. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param name Key name of the attribute. @@ -50,6 +53,7 @@ declare namespace xml { /** * Add an empty element. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param name Key name of the attribute. @@ -60,6 +64,7 @@ declare namespace xml { /** * Writes xml declaration with encoding. For example: . + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -67,6 +72,7 @@ declare namespace xml { /** * Writes a element start tag with the given name. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param name Name of the element. @@ -76,6 +82,7 @@ declare namespace xml { /** * Writes end tag of the element. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -83,6 +90,7 @@ declare namespace xml { /** * Writes the namespace of the current element tag. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param prefix Values name of the prefix. @@ -93,6 +101,7 @@ declare namespace xml { /** * Writes the comment. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of comment. @@ -102,6 +111,7 @@ declare namespace xml { /** * Writes the CDATA. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of CDATA. @@ -111,6 +121,7 @@ declare namespace xml { /** * Writes the text. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of text. @@ -120,6 +131,7 @@ declare namespace xml { /** * Writes the DOCTYPE. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of docType. @@ -131,66 +143,77 @@ declare namespace xml { enum EventType { /** * Start a document. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ START_DOCUMENT, /** * End a document. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ END_DOCUMENT, /** * Start a tag. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ START_TAG, /** * End a tag. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ END_TAG, /** * Character data. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ TEXT, /** * A CDATA sections. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ CDSECT, /** * An XML comment. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ COMMENT, /** * An XML document type declaration. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ DOCDECL, /** * An XML processing instruction declaration. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ INSTRUCTION, /** * An entity reference. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ ENTITY_REFERENCE, /** * A whitespace. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -201,60 +224,70 @@ declare namespace xml { interface ParseInfo { /** * The current column number, starting from 1. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getColumnNumber(): number; /** * The current depth of the element. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getDepth(): number; /** * The current line number, starting from 1. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getLineNumber(): number; /** * The current element's name. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getName(): string; /** * The current element's namespace. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getNamespace(): string; /** * The current element's prefix. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getPrefix(): string; /** * The text content of the current event as String. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ getText(): string; /** * Returns true if the current element is empty. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ isEmptyElementTag(): boolean; /** * Checks whether the current TEXT event contains only whitespace characters. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ isWhitespace(): boolean; /** * Returns the number of attributes of the current start tag. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -266,6 +299,7 @@ declare namespace xml { /** * Whether to parsing Doctype of the elements. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -273,6 +307,7 @@ declare namespace xml { /** * Whether to ignore parsing texts of the elements. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -280,6 +315,7 @@ declare namespace xml { /** * Tag value callback function. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param name The current tag name. @@ -290,6 +326,7 @@ declare namespace xml { /** * Attribute value callback function. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param name The current attribute name. @@ -300,6 +337,7 @@ declare namespace xml { /** * Token value callback function. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param eventType The current token eventtype. @@ -312,6 +350,7 @@ declare namespace xml { /** * The XmlPullParser interface is used to parse the existing xml file. * @name XmlPullParser + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -324,6 +363,7 @@ declare namespace xml { /** * Starts parsing the XML file. + * @crossplatform * @since 8 * @syscap SystemCapability.Utils.Lang * @param option parse options for XmlPullParser, the interface including two Boolean variables and three callback functions. diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index 68ac169d3..1f4891b0f 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import { AsyncCallback } from './@ohos.base'; declare namespace zlib { /** diff --git a/api/@system.package.d.ts b/api/@system.package.d.ts index 130b0a397..f84a413dc 100644 --- a/api/@system.package.d.ts +++ b/api/@system.package.d.ts @@ -14,52 +14,64 @@ */ /** + * @typedef CheckPackageHasInstalledResponse * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 * @deprecated since 9 */ export interface CheckPackageHasInstalledResponse { - /** - * Whether the application exists, or whether the native application has been installed. - * @syscap SystemCapability.BundleManager.BundleFramework - * @since 3 - */ - result: boolean; + /** + * Whether the application exists, or whether the native application has been installed. + * + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @deprecated since 9 + */ + result: boolean; } /** + * @typedef CheckPackageHasInstalledOptions * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 * @deprecated since 9 */ export interface CheckPackageHasInstalledOptions { - /** - * Application bundle name. - * @syscap SystemCapability.BundleManager.BundleFramework - * @since 3 - */ - bundleName: string; + /** + * Application bundle name. + * + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @deprecated since 9 + */ + bundleName: string; - /** - * Called when native applications are installed. - * @syscap SystemCapability.BundleManager.BundleFramework - * @since 3 - */ - success?: (data: CheckPackageHasInstalledResponse) => void; + /** + * Called when native applications are installed. + * + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @deprecated since 9 + */ + success?: (data: CheckPackageHasInstalledResponse) => void; - /** - * Called when native applications fail to be installed. - * @syscap SystemCapability.BundleManager.BundleFramework - * @since 3 - */ - fail?: (data: any, code: number) => void; + /** + * Called when native applications fail to be installed. + * + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @deprecated since 9 + */ + fail?: (data: any, code: number) => void; - /** - * Called when the execution is completed. - * @syscap SystemCapability.BundleManager.BundleFramework - * @since 3 - */ - complete?: () => void; + /** + * Called when the execution is completed. + * + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @deprecated since 9 + */ + complete?: () => void; } /** @@ -68,11 +80,13 @@ export interface CheckPackageHasInstalledOptions { * @deprecated since 9 */ export default class Package { - /** - * Checks whether an application exists, or whether a native application has been installed. - * @param options Options - * @syscap SystemCapability.BundleManager.BundleFramework - * @deprecated since 9 - */ - static hasInstalled(options: CheckPackageHasInstalledOptions): void; -} \ No newline at end of file + /** + * Checks whether an application exists, or whether a native application has been installed. + * + * @param { CheckPackageHasInstalledOptions } options Options + * @syscap SystemCapability.BundleManager.BundleFramework + * @since 3 + * @deprecated since 9 + */ + static hasInstalled(options: CheckPackageHasInstalledOptions): void; +} diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index 037aa2482..4900961a2 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from '../basic'; +import { AsyncCallback } from '../@ohos.base'; import { ResultSet } from '../data/rdb/resultSet'; import { DataAbilityOperation } from './dataAbilityOperation'; import { DataAbilityResult } from './dataAbilityResult'; diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 46334e4a7..34b705b6b 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from '../basic'; +import { AsyncCallback } from '../@ohos.base'; import { ApplicationInfo } from '../bundle/applicationInfo'; import { ProcessInfo } from './processInfo'; import { ElementName } from '../bundle/elementName'; diff --git a/api/application/AbilityDelegator.d.ts b/api/application/AbilityDelegator.d.ts index c7dcac105..88c171503 100644 --- a/api/application/AbilityDelegator.d.ts +++ b/api/application/AbilityDelegator.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from '../basic'; +import { AsyncCallback } from '../@ohos.base'; import UIAbility from '../@ohos.app.ability.UIAbility'; import AbilityStage from '../@ohos.app.ability.AbilityStage'; import { AbilityMonitor } from './AbilityMonitor'; diff --git a/api/application/AbilityStageContext.d.ts b/api/application/AbilityStageContext.d.ts index 31b7a8f99..475a6822a 100644 --- a/api/application/AbilityStageContext.d.ts +++ b/api/application/AbilityStageContext.d.ts @@ -24,6 +24,7 @@ import Context from "./Context"; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @crossplatform */ export default class AbilityStageContext extends Context { @@ -33,6 +34,7 @@ export default class AbilityStageContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform */ currentHapModuleInfo: HapModuleInfo; diff --git a/api/application/AccessibilityExtensionContext.d.ts b/api/application/AccessibilityExtensionContext.d.ts index d3c38cddd..9c8ead036 100644 --- a/api/application/AccessibilityExtensionContext.d.ts +++ b/api/application/AccessibilityExtensionContext.d.ts @@ -13,357 +13,723 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; -import ExtensionContext from "./ExtensionContext"; -import accessibility from "../@ohos.accessibility"; -import { GesturePath } from "../@ohos.accessibility.GesturePath"; +import type { AsyncCallback } from '../@ohos.base'; +import ExtensionContext from './ExtensionContext'; +import type accessibility from '../@ohos.accessibility'; +import type { GesturePath } from '../@ohos.accessibility.GesturePath'; /** * The accessibility extension context. Used to configure, query information, and inject gestures. * - * @since 9 + * @extends ExtensionContext * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ export default class AccessibilityExtensionContext extends ExtensionContext { - /** - * Set the name of the bundle name that is interested in sending the event. - * @param targetNames - * @throws { BusinessError } 401 - Input parameter error. - */ - setTargetBundleName(targetNames: Array): Promise; - setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; + /** + * Set the bundle names that is interested in sending the event. + * + * @param { Array } targetNames The bundle names that are interested in sending the event. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; - /** - * Get focus element. - * @param isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. - */ - getFocusElement(isAccessibilityFocus?: boolean): Promise; - getFocusElement(callback: AsyncCallback): void; - getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback): void; + /** + * Set the bundle names that is interested in sending the event. + * + * @param { Array } targetNames The bundle names that are interested in sending the event. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + setTargetBundleName(targetNames: Array): Promise; - /** - * Get window root element. - * @param windowId Indicates the window ID. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. - */ - getWindowRootElement(windowId?: number): Promise; - getWindowRootElement(callback: AsyncCallback): void; - getWindowRootElement(windowId: number, callback: AsyncCallback): void; + /** + * Get focus element. + * + * @param { boolean } isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getFocusElement(isAccessibilityFocus: boolean, callback: AsyncCallback): void; - /** - * Get window list. - * @param displayId Indicates the display ID. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. - */ - getWindows(displayId?: number): Promise>; - getWindows(callback: AsyncCallback>): void; - getWindows(displayId: number, callback: AsyncCallback>): void; + /** + * Get focus element. + * + * @param { boolean } isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getFocusElement(isAccessibilityFocus?: boolean): Promise; - /** - * Inject gesture path events. - * @param gesturePath Indicates the gesture path. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. - */ - injectGesture(gesturePath: GesturePath): Promise; - injectGesture(gesturePath: GesturePath, callback: AsyncCallback): void; + /** + * Get focus element. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getFocusElement(callback: AsyncCallback): void; + + /** + * Get window root element. + * + * @param { number } windowId Indicates the window ID. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getWindowRootElement(windowId: number, callback: AsyncCallback): void; + + /** + * Get window root element. + * + * @param { number } windowId Indicates the window ID. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getWindowRootElement(windowId?: number): Promise; + + /** + * Get window root element. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getWindowRootElement(callback: AsyncCallback): void; + + /** + * Get window list. + * + * @param { number } displayId Indicates the display ID. + * @param { AsyncCallback> } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getWindows(displayId: number, callback: AsyncCallback>): void; + + /** + * Get window list. + * + * @param { number } displayId Indicates the display ID. + * @returns { Promise> } + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getWindows(displayId?: number): Promise>; + + /** + * Get window list. + * @param { AsyncCallback> } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + getWindows(callback: AsyncCallback>): void; + + /** + * Inject gesture path events. + * + * @param { GesturePath } gesturePath Indicates the gesture path. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + injectGesture(gesturePath: GesturePath, callback: AsyncCallback): void; + + /** + * Inject gesture path events. + * + * @param { GesturePath } gesturePath Indicates the gesture path. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + injectGesture(gesturePath: GesturePath): Promise; } /** * Indicates an accessibility element. - * * Supports querying element attributes, requesting execution actions, and finding child elements by condition. - * @since 9 + * + * @typedef AccessibilityElement * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ declare interface AccessibilityElement { - /** - * Get a list of attribute names. - */ - attributeNames(): Promise>; - attributeNames(callback: AsyncCallback>): void; + /** + * Get a list of attribute names. + * + * @param { AsyncCallback> } callback Indicates the listener. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + attributeNames(callback: AsyncCallback>): void; - /** - * Get the value of an attribute. - * @param attributeName Indicates the attribute name. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300004 - This property does not exist. - */ - attributeValue(attributeName: T): Promise; - attributeValue(attributeName: T, - callback: AsyncCallback): void; + /** + * Get a list of attribute names. + * @returns { Promise> } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + attributeNames(): Promise>; - /** - * Get a list of supported actions. - */ - actionNames(): Promise>; - actionNames(callback: AsyncCallback>): void; + /** + * Get the value of an attribute. + * + * @param { T } attributeName Indicates the attribute name. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300004 - This property does not exist. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + attributeValue( + attributeName: T, + callback: AsyncCallback + ): void; - /** - * Perform the specified action. - * @param actionName Indicates the action name. - * @param parameters Indicates the parameters needed to execute the action. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300005 - This action is not supported. - */ - performAction(actionName: string, parameters?: object): Promise; - performAction(actionName: string, callback: AsyncCallback): void; - performAction(actionName: string, parameters: object, callback: AsyncCallback): void; - - /** - * Find elements that match the condition. - * @param type The type of query condition is content. - * @param condition Indicates the specific content to be queried. - * @throws { BusinessError } 401 - Input parameter error. - */ - findElement(type: 'content', condition: string): Promise>; - findElement(type: 'content', condition: string, callback: AsyncCallback>): void + /** + * Get the value of an attribute. + * + * @param { T } attributeName Indicates the attribute name. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300004 - This property does not exist. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + attributeValue(attributeName: T): Promise; - /** - * Find elements that match the condition. - * @param type The type of query condition is focus type. - * @param condition Indicates the type of focus to query. - * @throws { BusinessError } 401 - Input parameter error. - */ - findElement(type: 'focusType', condition: FocusType): Promise; - findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void + /** + * Get a list of supported actions. + * + * @param { AsyncCallback> } callback Indicates the listener. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + actionNames(callback: AsyncCallback>): void; - /** - * Find elements that match the condition. - * @param type The type of query condition is focus direction. - * @param condition Indicates the direction of search focus to query. - * @throws { BusinessError } 401 - Input parameter error. - */ - findElement(type: 'focusDirection', condition: FocusDirection): Promise; - findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void + /** + * Get a list of supported actions. + * + * @param { AsyncCallback> } callback Indicates the listener. + * @returns { Promise> } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + actionNames(): Promise>; + + /** + * Perform the specified action. + * + * @param { string } actionName Indicates the action name. + * @param { object } parameters Indicates the parameters needed to execute the action. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300005 - This action is not supported. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + performAction(actionName: string, parameters: object, callback: AsyncCallback): void; + + /** + * Perform the specified action. + * + * @param { string } actionName Indicates the action name. + * @param { object } parameters Indicates the parameters needed to execute the action. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300005 - This action is not supported. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + performAction(actionName: string, parameters?: object): Promise; + + /** + * Perform the specified action. + * + * @param { string } actionName Indicates the action name. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300005 - This action is not supported. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + performAction(actionName: string, callback: AsyncCallback): void; + + /** + * Find elements that match the condition. + * + * @param { 'content' } type The type of query condition is content. + * @param { string } condition Indicates the specific content to be queried. + * @param { AsyncCallback> } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + findElement(type: 'content', condition: string, callback: AsyncCallback>): void; + + /** + * Find elements that match the condition. + * + * @param { 'content' } type The type of query condition is content. + * @param { string } condition Indicates the specific content to be queried. + * @returns { Promise> } + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + findElement(type: 'content', condition: string): Promise>; + + /** + * Find elements that match the condition. + * + * @param { 'focusType' } type The type of query condition is focus type. + * @param { FocusType } condition Indicates the type of focus to query. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void; + + /** + * Find elements that match the condition. + * + * @param { 'focusType' } type The type of query condition is focus type. + * @param { FocusType } condition Indicates the type of focus to query. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + findElement(type: 'focusType', condition: FocusType): Promise; + + /** + * Find elements that match the condition. + * + * @param { 'focusDirection' } type The type of query condition is focus direction. + * @param { FocusDirection } condition Indicates the direction of search focus to query. + * @param { AsyncCallback } callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void; + + /** + * Find elements that match the condition. + * + * @param { 'focusDirection' } type The type of query condition is focus direction. + * @param { FocusDirection } condition Indicates the direction of search focus to query. + * @returns { Promise } + * @throws { BusinessError } 401 - Input parameter error. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + findElement(type: 'focusDirection', condition: FocusDirection): Promise; } /** * Indicates the possible attributes of the element and the type of the attribute value. - * @since 9 + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ type ElementAttributeValues = { - /** - * Indicates accessibility focus state. - */ - 'accessibilityFocused': boolean; - /** - * Indicates the bundle name to which it belongs. - */ - 'bundleName': string; - /** - * Indicates whether the element is checkable. - */ - 'checkable': boolean; - /** - * Indicates whether the element is checked. - */ - 'checked': boolean; - /** - * Indicates all child elements. - */ - 'children': Array; - /** - * Indicates whether the element is clickable. - */ - 'clickable': boolean; - /** - * Indicates the component ID to which the element belongs. - */ - 'componentId': number; - /** - * Indicates the component type to which the element belongs. - */ - 'componentType': string; - /** - * Indicates the content. - */ - 'contents': Array; - /** - * Indicates the index of the current item. - */ - 'currentIndex': number; - /** - * Indicates the description of the element. - */ - 'description': string; - /** - * Indicates whether the element is editable. - */ - 'editable': boolean; - /** - * Indicates the list index of the last item displayed on the screen. - */ - 'endIndex': number; - /** - * Indicates the string of error state. - */ - 'error': string; - /** - * Indicates whether the element is focusable. - */ - 'focusable': boolean; - /** - * Indicates the hint text. - */ - 'hintText': string; - /** - * Indicates the type of input text. - */ - 'inputType': number; - /** - * Indicates the inspector key. - */ - 'inspectorKey': string - /** - * Indicates whether the element is active or not. - */ - 'isActive': boolean; - /** - * Indicates whether the element is enable or not. - */ - 'isEnable': boolean; - /** - * Indicates whether the element is hint state or not. - */ - 'isHint': boolean; - /** - * Indicates whether the element is focused or not. - */ - 'isFocused': boolean; - /** - * Indicates whether the element is password or not. - */ - 'isPassword': boolean; - /** - * Indicates whether the element is visible or not. - */ - 'isVisible': boolean; - /** - * Indicates the total count of the items. - */ - 'itemCount': number; - /** - * Indicates the last content. - */ - 'lastContent': string; - /** - * Indicates the display layer of the element. - */ - 'layer': number; - /** - * Indicates whether the element is long clickable. - */ - 'longClickable': boolean; - /** - * Indicates the page id. - */ - 'pageId': number; - /** - * Indicates the parent of the element. - */ - 'parent': AccessibilityElement; - /** - * Indicates whether the element supports multiple lines of text. - */ - 'pluralLineSupported': boolean; - /** - * Indicates the area of the element. - */ - 'rect': Rect; - /** - * Indicates the resource name of the element. - */ - 'resourceName': string; - /** - * Indicates the root element of the window element. - */ - 'rootElement': AccessibilityElement; - /** - * Indicates the display area of the element. - */ - 'screenRect': Rect; - /** - * Indicates whether the element is scrollable. - */ - 'scrollable': boolean; - /** - * Indicates whether the element is selected. - */ - 'selected': boolean; - /** - * Indicates the list index of the first item displayed on the screen. - */ - 'startIndex': number; - /** - * Indicates the text of the element. - */ - 'text': string; - /** - * Indicates the maximum length limit of the element text. - */ - 'textLengthLimit': number; - /** - * Indicates the unit of movement of the element text as it is read. - */ - 'textMoveUnit': accessibility.TextMoveUnit; - /** - * Indicates the action that triggered the element event. - */ - 'triggerAction': accessibility.Action; - /** - * Indicates the window type of the element. - */ - 'type': WindowType; - /** - * Indicates the maximum value. - */ - 'valueMax': number; - /** - * Indicates the minimum value. - */ - 'valueMin': number; - /** - * Indicates the current value. - */ - 'valueNow': number; - /** - * Indicates the window id. - */ - 'windowId': number; -} + /** + * Indicates accessibility focus state. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'accessibilityFocused': boolean; + /** + * Indicates the bundle name to which it belongs. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'bundleName': string; + /** + * Indicates whether the element is checkable. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'checkable': boolean; + /** + * Indicates whether the element is checked. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'checked': boolean; + /** + * Indicates all child elements. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'children': Array; + /** + * Indicates whether the element is clickable. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'clickable': boolean; + /** + * Indicates the component ID to which the element belongs. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'componentId': number; + /** + * Indicates the component type to which the element belongs. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'componentType': string; + /** + * Indicates the content. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'contents': Array; + /** + * Indicates the index of the current item. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'currentIndex': number; + /** + * Indicates the description of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'description': string; + /** + * Indicates whether the element is editable. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'editable': boolean; + /** + * Indicates the list index of the last item displayed on the screen. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'endIndex': number; + /** + * Indicates the string of error state. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'error': string; + /** + * Indicates whether the element is focusable. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'focusable': boolean; + /** + * Indicates the hint text. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'hintText': string; + /** + * Indicates the type of input text. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'inputType': number; + /** + * Indicates the inspector key. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'inspectorKey': string; + /** + * Indicates whether the element is active or not. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'isActive': boolean; + /** + * Indicates whether the element is enable or not. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'isEnable': boolean; + /** + * Indicates whether the element is hint state or not. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'isHint': boolean; + /** + * Indicates whether the element is focused or not. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'isFocused': boolean; + /** + * Indicates whether the element is password or not. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'isPassword': boolean; + /** + * Indicates whether the element is visible or not. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'isVisible': boolean; + /** + * Indicates the total count of the items. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'itemCount': number; + /** + * Indicates the last content. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'lastContent': string; + /** + * Indicates the display layer of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'layer': number; + /** + * Indicates whether the element is long clickable. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'longClickable': boolean; + /** + * Indicates the page id. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'pageId': number; + /** + * Indicates the parent of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'parent': AccessibilityElement; + /** + * Indicates whether the element supports multiple lines of text. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'pluralLineSupported': boolean; + /** + * Indicates the area of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'rect': Rect; + /** + * Indicates the resource name of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'resourceName': string; + /** + * Indicates the root element of the window element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'rootElement': AccessibilityElement; + /** + * Indicates the display area of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'screenRect': Rect; + /** + * Indicates whether the element is scrollable. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'scrollable': boolean; + /** + * Indicates whether the element is selected. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'selected': boolean; + /** + * Indicates the list index of the first item displayed on the screen. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'startIndex': number; + /** + * Indicates the text of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'text': string; + /** + * Indicates the maximum length limit of the element text. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'textLengthLimit': number; + /** + * Indicates the unit of movement of the element text as it is read. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'textMoveUnit': accessibility.TextMoveUnit; + /** + * Indicates the action that triggered the element event. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'triggerAction': accessibility.Action; + /** + * Indicates the window type of the element. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'type': WindowType; + /** + * Indicates the maximum value. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'valueMax': number; + /** + * Indicates the minimum value. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'valueMin': number; + /** + * Indicates the current value. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'valueNow': number; + /** + * Indicates the window id. + * + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + 'windowId': number; +}; /** -* Indicates the direction of the search focus. - * @since 9 + * Indicates the direction of the search focus. + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ type FocusDirection = 'up' | 'down' | 'left' | 'right' | 'forward' | 'backward'; /** * Indicates the type of the focus. - * @since 9 + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ type FocusType = 'accessibility' | 'normal'; /** * Indicates the type of the window. - * @since 9 + * * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ type WindowType = 'application' | 'system'; /** * Indicates rectangle. - * @since 9 + * + * @typedef Rect * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 */ interface Rect { - left: number; - top: number; - width: number; - height: number; -} \ No newline at end of file + left: number; + top: number; + width: number; + height: number; +} diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 6e5568cdb..024de60b6 100644 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; +import { AsyncCallback } from "../@ohos.base"; import Context from "./Context"; import AbilityLifecycleCallback from "../@ohos.app.ability.AbilityLifecycleCallback"; import EnvironmentCallback from "../@ohos.app.ability.EnvironmentCallback"; @@ -23,6 +23,7 @@ import { ProcessInformation } from "./ProcessInformation"; * The context of an application. It allows access to application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export default class ApplicationContext extends Context { @@ -34,6 +35,7 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ on(type: "abilityLifecycle", callback: AbilityLifecycleCallback): number; @@ -46,6 +48,7 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ off(type: "abilityLifecycle", callbackId: number, callback: AsyncCallback): void; @@ -104,6 +107,7 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ getRunningProcessInformation(): Promise>; @@ -114,6 +118,7 @@ export default class ApplicationContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ getRunningProcessInformation(callback: AsyncCallback>): void; diff --git a/api/application/BaseContext.d.ts b/api/application/BaseContext.d.ts index 9ddd20b75..a22af379b 100644 --- a/api/application/BaseContext.d.ts +++ b/api/application/BaseContext.d.ts @@ -27,6 +27,7 @@ export default abstract class BaseContext { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @crossplatform */ stageMode: boolean; } diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 6e7f373e9..5a1e67e98 100644 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -25,6 +25,7 @@ import contextConstant from "../@ohos.app.ability.contextConstant" * application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export default class Context extends BaseContext { @@ -33,6 +34,7 @@ export default class Context extends BaseContext { * @type { resmgr.ResourceManager } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ resourceManager: resmgr.ResourceManager; @@ -42,6 +44,7 @@ export default class Context extends BaseContext { * @type { ApplicationInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ applicationInfo: ApplicationInfo; @@ -51,6 +54,7 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ cacheDir: string; @@ -60,6 +64,7 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ tempDir: string; @@ -69,6 +74,7 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ filesDir: string; @@ -78,6 +84,7 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ databaseDir: string; @@ -87,6 +94,7 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ preferencesDir: string; @@ -96,6 +104,7 @@ export default class Context extends BaseContext { * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ bundleCodeDir: string; @@ -169,6 +178,7 @@ export default class Context extends BaseContext { * @returns { ApplicationContext } Returns the application context. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ getApplicationContext(): ApplicationContext; diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index 5c94424b9..d6e2edae5 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { BusinessError } from '../basic'; +import { BusinessError } from '../@ohos.base'; /** * The event center of a context, support the subscription and publication of events. diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts index f52556313..db4e415e5 100644 --- a/api/application/FormExtensionContext.d.ts +++ b/api/application/FormExtensionContext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; +import { AsyncCallback } from "../@ohos.base"; import ExtensionContext from "./ExtensionContext"; import formBindingData from '../@ohos.app.form.formBindingData'; import Want from '../@ohos.app.ability.Want'; diff --git a/api/application/ProcessInformation.d.ts b/api/application/ProcessInformation.d.ts index 915cecc9e..a4ad4e135 100644 --- a/api/application/ProcessInformation.d.ts +++ b/api/application/ProcessInformation.d.ts @@ -17,12 +17,14 @@ * The class of an process information. * * @since 9 + * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ export interface ProcessInformation { /** * @default process id * @since 9 + * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ pid: number; @@ -37,6 +39,7 @@ /** * @default the name of the process * @since 9 + * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ processName: string; @@ -44,6 +47,7 @@ /** * @default an array of the bundleNames running in the process * @since 9 + * @crossplatform * @syscap SystemCapability.Ability.AbilityRuntime.Core */ bundleNames: Array; diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index 6b559b487..36eefae72 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; +import { AsyncCallback } from "../@ohos.base"; import { ConnectOptions } from "../ability/connectOptions"; import { Caller } from '../@ohos.app.ability.UIAbility'; import ExtensionContext from "./ExtensionContext"; diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index ede2990c4..f36cc5f4d 100644 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -17,7 +17,7 @@ import { AbilityInfo } from "../bundleManager/AbilityInfo"; import { AbilityResult } from "../ability/abilityResult"; -import { AsyncCallback } from "../basic"; +import { AsyncCallback } from "../@ohos.base"; import { ConnectOptions } from "../ability/connectOptions"; import { HapModuleInfo } from "../bundleManager/HapModuleInfo"; import Context from "./Context"; @@ -33,6 +33,7 @@ import dialogRequest from "../@ohos.app.ability.dialogRequest"; * The context of an ability. It allows access to ability-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ export default class UIAbilityContext extends Context { @@ -41,6 +42,7 @@ export default class UIAbilityContext extends Context { * @type { AbilityInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ abilityInfo: AbilityInfo; @@ -50,6 +52,7 @@ export default class UIAbilityContext extends Context { * @type { HapModuleInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ currentHapModuleInfo: HapModuleInfo; @@ -83,6 +86,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16200001 - The caller has been released. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; @@ -604,6 +608,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ terminateSelf(callback: AsyncCallback): void; @@ -620,6 +625,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 16000050 - Internal error. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @crossplatform * @since 9 */ terminateSelf(): Promise; diff --git a/api/application/WindowExtensionContext.d.ts b/api/application/WindowExtensionContext.d.ts index 3b28a2312..738714d44 100644 --- a/api/application/WindowExtensionContext.d.ts +++ b/api/application/WindowExtensionContext.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; +import { AsyncCallback } from "../@ohos.base"; import ExtensionContext from "./ExtensionContext"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; diff --git a/api/bundle/PermissionDef.d.ts b/api/bundle/PermissionDef.d.ts index cb0a92b24..fc1f9e846 100644 --- a/api/bundle/PermissionDef.d.ts +++ b/api/bundle/PermissionDef.d.ts @@ -14,12 +14,14 @@ */ /** + * Indicates the defined permission details in file config.json + * + * @typedef PermissionDef * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.PermissionDef - * @name Indicates the defined permission details in file config.json */ export interface PermissionDef { /** diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index 7d44c9957..35a4e8c85 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -18,11 +18,13 @@ import { CustomizeData } from './customizeData'; import bundle from './../@ohos.bundle'; /** + * Obtains configuration information about an ability + * + * @typedef AbilityInfo * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.AbilityInfo - * @name Obtains configuration information about an ability */ export interface AbilityInfo { /** diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 5c10912c0..80a6b74bf 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -17,11 +17,13 @@ import { ModuleInfo } from './moduleInfo'; import { CustomizeData } from './customizeData'; /** + * Obtains configuration information about an application + * + * @typedef ApplicationInfo * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.ApplicationInfo - * @name Obtains configuration information about an application */ export interface ApplicationInfo { /** diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 07c8b9972..0d0b0d243 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -18,11 +18,13 @@ import { ApplicationInfo } from './applicationInfo'; import { HapModuleInfo } from './hapModuleInfo'; /** + * The scene which is used + * + * @typedef UsedScene * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.UsedScene - * @name The scene which is used */ export interface UsedScene { /** @@ -43,11 +45,13 @@ export interface UsedScene { } /** + * Indicates the required permissions details defined in file config.json + * + * @typedef ReqPermissionDetail * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.ReqPermissionDetail - * @name Indicates the required permissions details defined in file config.json */ export interface ReqPermissionDetail { /** @@ -76,11 +80,13 @@ export interface ReqPermissionDetail { } /** + * Obtains configuration information about a bundle + * + * @typedef BundleInfo * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.BundleInfo - * @name Obtains configuration information about a bundle */ export interface BundleInfo { /** diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index f30e3834f..c2c98a72a 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -13,16 +13,18 @@ * limitations under the License. */ -import { AsyncCallback } from './../basic'; +import { AsyncCallback } from './../@ohos.base'; import bundle from './../@ohos.bundle'; /** + * Provides parameters required for installing or uninstalling an application. + * + * @typedef InstallParam * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.installer#InstallParam - * @name Provides parameters required for installing or uninstalling an application. */ export interface InstallParam { /** @@ -57,11 +59,13 @@ export interface InstallParam { } /** + * Indicates the install or uninstall status + * + * @typedef InstallStatus * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 7 * @deprecated since 9 - * @name Indicates the install or uninstall status */ export interface InstallStatus { /** @@ -84,23 +88,24 @@ export interface InstallStatus { } /** + * Offers install, upgrade, and remove bundles on the devices. + * + * @interface BundleInstaller * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.installer#BundleInstaller - * @name Offers install, upgrade, and remove bundles on the devices. */ export interface BundleInstaller { /** * Install an application in a HAP. * * @permission ohos.permission.INSTALL_BUNDLE - * @param bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the - * relative path to the data directory of the current application. - * @param param Indicates other parameters required for the installation. + * @param { Array } bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the + * relative path to the data directory of the current application. + * @param { InstallParam } param Indicates other parameters required for the installation. * @param { AsyncCallback } callback - * @returns InstallStatus * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 7 @@ -113,10 +118,9 @@ export interface BundleInstaller { * Uninstall an application. * * @permission ohos.permission.INSTALL_BUNDLE - * @param bundleName Indicates the bundle name of the application to be uninstalled. - * @param param Indicates other parameters required for the uninstall. + * @param { string } bundleName Indicates the bundle name of the application to be uninstalled. + * @param { InstallParam } param Indicates other parameters required for the uninstall. * @param { AsyncCallback } callback - * @returns InstallStatus * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 7 @@ -129,10 +133,9 @@ export interface BundleInstaller { * recover an application. * * @permission ohos.permission.INSTALL_BUNDLE - * @param bundleName Indicates the bundle name of the application to be recovered. - * @param param Indicates other parameters required for the recover. + * @param { string } bundleName Indicates the bundle name of the application to be recovered. + * @param { InstallParam } param Indicates other parameters required for the recover. * @param { AsyncCallback } callback - * @returns InstallStatus * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 diff --git a/api/bundle/bundleStatusCallback.d.ts b/api/bundle/bundleStatusCallback.d.ts index e0d1939db..82f298fed 100644 --- a/api/bundle/bundleStatusCallback.d.ts +++ b/api/bundle/bundleStatusCallback.d.ts @@ -17,42 +17,46 @@ * Contains basic Ability information, which uniquely identifies an launcher StatusCallback. * You can use this class to obtain values of the fields set in an callback function, * such as the add, update, remove. + * Contains basic launcher status callback information, which uniquely identifies an LauncherStatusCallback * + * @interface BundleStatusCallback * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Contains basic launcher status callback information, which uniquely identifies an LauncherStatusCallback */ export interface BundleStatusCallback { /** + * Obtains add callback about an launcherStatusCallback. + * * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains add callback about an launcherStatusCallback. */ add: (bundleName: string, userId: number) => void; /** + * Obtains update callback about an launcherStatusCallback. + * * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains update callback about an launcherStatusCallback. */ update: (bundleName: string, userId: number) => void; /** + * Obtains remove callback about an launcherStatusCallback. + * * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains remove callback about an launcherStatusCallback. */ remove: (bundleName: string, userId: number) => void; } diff --git a/api/bundle/customizeData.d.ts b/api/bundle/customizeData.d.ts index 2266c964d..780d9f5f0 100644 --- a/api/bundle/customizeData.d.ts +++ b/api/bundle/customizeData.d.ts @@ -14,11 +14,13 @@ */ /** + * Indicates the custom metadata + * + * @typedef CustomizeData * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.Metadata - * @name Indicates the custom metadata */ export interface CustomizeData { /** diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts index 2c5733767..1525f8a2f 100644 --- a/api/bundle/elementName.d.ts +++ b/api/bundle/elementName.d.ts @@ -18,11 +18,13 @@ * You can use this class to obtain values of the fields set in an element, * such as the device ID, bundle name, and ability name. * + * Contains basic Ability information, which uniquely identifies an ability + * + * @typedef ElementName * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.ElementName - * @name Contains basic Ability information, which uniquely identifies an ability */ export interface ElementName { /** diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index abcecbcb1..826e6ff9c 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -16,11 +16,13 @@ import { AbilityInfo } from './abilityInfo'; /** + * Obtains configuration information about a module. + * + * @typedef HapModuleInfo * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.HapModuleInfo - * @name Obtains configuration information about a module. */ export interface HapModuleInfo { /** diff --git a/api/bundle/launcherAbilityInfo.d.ts b/api/bundle/launcherAbilityInfo.d.ts index 558acbbda..c18ff5b65 100644 --- a/api/bundle/launcherAbilityInfo.d.ts +++ b/api/bundle/launcherAbilityInfo.d.ts @@ -21,65 +21,73 @@ import { ElementName } from './elementName'; * You can use this class to obtain values of the fields set in an AbilityInfo, * such as the application Info , elementName, labelId, iconId, userId, installTime. * + * Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo + * + * @typedef LauncherAbilityInfo * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.LauncherAbilityInfo - * @name Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo */ export interface LauncherAbilityInfo { /** + * Obtains application info information about an launcher ability. + * * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains application info information about an launcher ability. */ readonly applicationInfo: ApplicationInfo; /** + * Obtains element name about an launcher ability. + * * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains element name about an launcher ability. */ readonly elementName: ElementName; /** + * Obtains labelId about an launcher ability. + * * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains labelId about an launcher ability. */ readonly labelId: number; /** + * Obtains iconId about an launcher ability. + * * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains iconId about an launcher ability. */ readonly iconId: number; /** + * Obtains userId about an launcher ability. + * * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains userId about an launcher ability. */ readonly userId: number; /** + * Obtains installTime about an launcher ability. + * * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 8 * @deprecated since 9 - * @name Obtains installTime about an launcher ability. */ readonly installTime: number; } diff --git a/api/bundle/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts index 8e7ef4230..fad44193d 100644 --- a/api/bundle/moduleInfo.d.ts +++ b/api/bundle/moduleInfo.d.ts @@ -14,11 +14,13 @@ */ /** + * Stores module information about an application. + * + * @typedef ModuleInfo * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.HapModuleInfo - * @name Stores module information about an application. */ export interface ModuleInfo { /** diff --git a/api/bundle/remoteAbilityInfo.d.ts b/api/bundle/remoteAbilityInfo.d.ts index 129ae80a4..244276c9a 100644 --- a/api/bundle/remoteAbilityInfo.d.ts +++ b/api/bundle/remoteAbilityInfo.d.ts @@ -16,12 +16,14 @@ import { ElementName } from './elementName'; /** + * Contains basic remote ability information. + * + * @typedef RemoteAbilityInfo * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi * @since 8 * @deprecated since 9 * @useinstead ohos.bundle.distributedBundleManager.RemoteAbilityInfo - * @name Contains basic remote ability information. */ export interface RemoteAbilityInfo { /** diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index fbe6e720c..37569df99 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -14,13 +14,15 @@ */ /** + * Provides methods for obtaining information about the ability that a shortcut will start, including the target + * bundle name, target module name and ability class name. + * + * @typedef ShortcutWant * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager.ShortcutWant - * @name Provides methods for obtaining information about the ability that a shortcut will start, including the target - * bundle name, target module name and ability class name. */ export interface ShortcutWant { /** @@ -40,11 +42,13 @@ export interface ShortcutWant { } /** + * Provides information about a shortcut, including the shortcut ID and label. + * + * @typedef ShortcutInfo * @syscap SystemCapability.BundleManager.BundleFramework * @since 7 * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager.ShortcutInfo - * @name Provides information about a shortcut, including the shortcut ID and label. */ export interface ShortcutInfo { /** diff --git a/api/bundleManager/AbilityInfo.d.ts b/api/bundleManager/AbilityInfo.d.ts index c6b612089..c55e73b37 100644 --- a/api/bundleManager/AbilityInfo.d.ts +++ b/api/bundleManager/AbilityInfo.d.ts @@ -22,6 +22,7 @@ import bundleManager from './../@ohos.bundle.bundleManager'; * * @typedef AbilityInfo * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ export interface AbilityInfo { @@ -30,6 +31,7 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly bundleName: string; @@ -39,6 +41,7 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly moduleName: string; @@ -48,6 +51,7 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly name: string; @@ -57,6 +61,7 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly label: string; @@ -66,6 +71,7 @@ export interface AbilityInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly labelId: number; @@ -75,6 +81,7 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly description: string; @@ -84,6 +91,7 @@ export interface AbilityInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly descriptionId: number; @@ -93,6 +101,7 @@ export interface AbilityInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly icon: string; @@ -102,6 +111,7 @@ export interface AbilityInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly iconId: number; @@ -148,6 +158,7 @@ export interface AbilityInfo { * * @type { bundleManager.LaunchType } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly launchType: bundleManager.LaunchType; @@ -205,6 +216,7 @@ export interface AbilityInfo { * * @type { ApplicationInfo } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly applicationInfo: ApplicationInfo; @@ -214,6 +226,7 @@ export interface AbilityInfo { * * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly metadata: Array; diff --git a/api/bundleManager/ApplicationInfo.d.ts b/api/bundleManager/ApplicationInfo.d.ts index 4df5b33cd..8bccecf38 100644 --- a/api/bundleManager/ApplicationInfo.d.ts +++ b/api/bundleManager/ApplicationInfo.d.ts @@ -22,6 +22,7 @@ import bundleManager from './../@ohos.bundle.bundleManager'; * * @typedef ApplicationInfo * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ export interface ApplicationInfo { @@ -30,6 +31,7 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly name: string; @@ -39,6 +41,7 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly description: string; @@ -48,6 +51,7 @@ export interface ApplicationInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly descriptionId: number; @@ -66,6 +70,7 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly label: string; @@ -75,6 +80,7 @@ export interface ApplicationInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly labelId: number; @@ -84,6 +90,7 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly icon: string; @@ -93,6 +100,7 @@ export interface ApplicationInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly iconId: number; @@ -120,6 +128,7 @@ export interface ApplicationInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly codePath: string; diff --git a/api/bundleManager/BundlePackInfo.d.ts b/api/bundleManager/BundlePackInfo.d.ts index 607eee038..8d3a0421f 100644 --- a/api/bundleManager/BundlePackInfo.d.ts +++ b/api/bundleManager/BundlePackInfo.d.ts @@ -21,11 +21,11 @@ * @systemapi * @since 9 */ - export interface BundlePackInfo { +export interface BundlePackInfo { /** * This contains package information in pack.info * - * @type { PackageConfig } + * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi * @since 9 @@ -215,7 +215,7 @@ export interface ModuleConfigInfo { /** * Indicates the devices type * - * @type { string } + * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall * @systemapi * @since 9 diff --git a/api/bundleManager/HapModuleInfo.d.ts b/api/bundleManager/HapModuleInfo.d.ts index b27be1fc5..be284b9a1 100644 --- a/api/bundleManager/HapModuleInfo.d.ts +++ b/api/bundleManager/HapModuleInfo.d.ts @@ -23,6 +23,7 @@ import bundleManager from './../@ohos.bundle.bundleManager'; * * @typedef HapModuleInfo * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ export interface HapModuleInfo { @@ -31,6 +32,7 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly name: string; @@ -40,6 +42,7 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly icon: string; @@ -49,6 +52,7 @@ export interface HapModuleInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly iconId: number; @@ -58,6 +62,7 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly label: string; @@ -67,6 +72,7 @@ export interface HapModuleInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly labelId: number; @@ -76,6 +82,7 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly description: string; @@ -85,6 +92,7 @@ export interface HapModuleInfo { * * @type { number } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly descriptionId: number; @@ -94,6 +102,7 @@ export interface HapModuleInfo { * * @type { string } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly mainElementName: string; @@ -103,6 +112,7 @@ export interface HapModuleInfo { * * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly abilitiesInfo: Array; @@ -121,6 +131,7 @@ export interface HapModuleInfo { * * @type { Array } * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @crossplatform * @since 9 */ readonly metadata: Array; diff --git a/api/bundleManager/Metadata.d.ts b/api/bundleManager/Metadata.d.ts index 264526413..12860e008 100644 --- a/api/bundleManager/Metadata.d.ts +++ b/api/bundleManager/Metadata.d.ts @@ -20,7 +20,7 @@ * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - export interface Metadata { +export interface Metadata { /** * Indicates the metadata name * diff --git a/api/bundleManager/OverlayModuleInfo.d.ts b/api/bundleManager/OverlayModuleInfo.d.ts index aaf23b0a5..6818a5753 100755 --- a/api/bundleManager/OverlayModuleInfo.d.ts +++ b/api/bundleManager/OverlayModuleInfo.d.ts @@ -20,7 +20,7 @@ * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 10 */ - export interface OverlayModuleInfo { +export interface OverlayModuleInfo { /** * Indicates the name of the bundle * diff --git a/api/bundleManager/ShortcutInfo.d.ts b/api/bundleManager/ShortcutInfo.d.ts index 6551faf47..a55b560aa 100644 --- a/api/bundleManager/ShortcutInfo.d.ts +++ b/api/bundleManager/ShortcutInfo.d.ts @@ -21,7 +21,7 @@ * @systemapi * @since 9 */ - export interface ShortcutInfo { +export interface ShortcutInfo { /** * Indicates the ID of the application to which this shortcut belongs * diff --git a/api/common/full/viewmodel.d.ts b/api/common/full/viewmodel.d.ts index d74b6d4b6..a2e194b41 100644 --- a/api/common/full/viewmodel.d.ts +++ b/api/common/full/viewmodel.d.ts @@ -14,8 +14,6 @@ */ import { Image, ImageData, ImageBitmap } from "./global"; -import { WebGLContextAttributes, WebGLRenderingContext } from "../../webgl/webgl"; -import { WebGL2RenderingContext } from "../../webgl/webgl2"; import image from "../../@ohos.multimedia.image"; import { CanvasPattern } from './canvaspattern'; diff --git a/api/commonEvent/commonEventSubscriber.d.ts b/api/commonEvent/commonEventSubscriber.d.ts index 904df9513..68d217e82 100644 --- a/api/commonEvent/commonEventSubscriber.d.ts +++ b/api/commonEvent/commonEventSubscriber.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './../basic'; +import { AsyncCallback } from './../@ohos.base'; import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; /** diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 71df7dce4..826733cf9 100644 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -13,11 +13,12 @@ * limitations under the License. */ -import { AsyncCallback } from '../../basic'; +import { AsyncCallback } from '../../@ohos.base'; /** * Provides methods for accessing a database result set generated by querying the database. * + * @interface ResultSet * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -152,7 +153,7 @@ export interface ResultSet { * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * * @param { number } offset - Indicates the offset relative to the current position. - * @returns { string } returns true if the result set is moved successfully and does not go beyond the range; + * @returns { boolean } returns true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 @@ -164,7 +165,7 @@ export interface ResultSet { /** * Go to the specified row of the result set. * - * @param { number } rowIndex - Indicates the index of the specified row, which starts from 0. + * @param { number } position - Indicates the index of the specified row, which starts from 0. * @returns { boolean } returns true if the result set is moved successfully; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 diff --git a/api/device-define/car.json b/api/device-define/car.json index bb54d1ef6..dfbbb75ce 100644 --- a/api/device-define/car.json +++ b/api/device-define/car.json @@ -5,6 +5,7 @@ "SystemCapability.ArkUI.ArkUI.Napi", "SystemCapability.ArkUI.ArkUI.Libuv", "SystemCapability.ArkUI.UiAppearance", + "SystemCapability.Base", "SystemCapability.BundleManager.BundleFramework", "SystemCapability.BundleManager.DistributedBundleFramework", "SystemCapability.BundleManager.BundleTool", @@ -40,6 +41,7 @@ "SystemCapability.MultimodalInput.Input.InputConsumer", "SystemCapability.MultimodalInput.Input.InputSimulator", "SystemCapability.MultimodalInput.Input.InputFilter", + "SystemCapability.MultimodalInput.Input.ShortKey", "SystemCapability.PowerManager.ThermalManager", "SystemCapability.PowerManager.PowerManager.Core", "SystemCapability.Multimedia.Media.Core", @@ -62,6 +64,8 @@ "SystemCapability.Multimedia.Audio.Device", "SystemCapability.Multimedia.Audio.Volume", "SystemCapability.Multimedia.Audio.Communication", + "SystemCapability.Multimedia.Audio.Interrupt", + "SystemCapability.Multimedia.Audio.Tone", "SystemCapability.Multimedia.Camera.Core", "SystemCapability.Multimedia.Camera.DistributedCore", "SystemCapability.Multimedia.Image.Core", @@ -139,6 +143,7 @@ "SystemCapability.Cloud.VAID", "SystemCapability.Security.CertificateManager", "SystemCapability.Security.CryptoFramework", + "SystemCapability.Security.Cert", "SystemCapability.BundleManager.BundleFramework.Core", "SystemCapability.BundleManager.BundleFramework.FreeInstall", "SystemCapability.BundleManager.BundleFramework.Resource", diff --git a/api/device-define/default.json b/api/device-define/default.json index a48886466..77fa35be2 100644 --- a/api/device-define/default.json +++ b/api/device-define/default.json @@ -5,6 +5,7 @@ "SystemCapability.ArkUI.ArkUI.Napi", "SystemCapability.ArkUI.ArkUI.Libuv", "SystemCapability.ArkUI.UiAppearance", + "SystemCapability.Base", "SystemCapability.BundleManager.BundleFramework", "SystemCapability.BundleManager.DistributedBundleFramework", "SystemCapability.BundleManager.BundleTool", @@ -41,6 +42,7 @@ "SystemCapability.MultimodalInput.Input.InputConsumer", "SystemCapability.MultimodalInput.Input.InputSimulator", "SystemCapability.MultimodalInput.Input.InputFilter", + "SystemCapability.MultimodalInput.Input.ShortKey", "SystemCapability.PowerManager.BatteryManager.Extension", "SystemCapability.PowerManager.BatteryStatistics", "SystemCapability.PowerManager.DisplayPowerManager", @@ -68,6 +70,8 @@ "SystemCapability.Multimedia.Audio.Device", "SystemCapability.Multimedia.Audio.Volume", "SystemCapability.Multimedia.Audio.Communication", + "SystemCapability.Multimedia.Audio.Interrupt", + "SystemCapability.Multimedia.Audio.Tone", "SystemCapability.Multimedia.Camera.Core", "SystemCapability.Multimedia.Camera.DistributedCore", "SystemCapability.Multimedia.Image.Core", @@ -168,6 +172,7 @@ "SystemCapability.Cloud.VAID", "SystemCapability.Security.CertificateManager", "SystemCapability.Security.CryptoFramework", + "SystemCapability.Security.Cert", "SystemCapability.BundleManager.BundleFramework.Core", "SystemCapability.BundleManager.BundleFramework.FreeInstall", "SystemCapability.BundleManager.BundleFramework.Resource", diff --git a/api/device-define/liteWearable.json b/api/device-define/liteWearable.json index 0deef106c..ed71d6dff 100644 --- a/api/device-define/liteWearable.json +++ b/api/device-define/liteWearable.json @@ -1,6 +1,7 @@ { "SysCaps": [ "SystemCapability.ArkUI.ArkUI.Lite", + "SystemCapability.Base", "SystemCapability.Location.Location.Lite", "SystemCapability.PowerManager.BatteryManager.Core", "SystemCapability.FileManagement.File.FileIO", diff --git a/api/device-define/router.json b/api/device-define/router.json index 266910c1c..7aeb1f183 100644 --- a/api/device-define/router.json +++ b/api/device-define/router.json @@ -1,5 +1,6 @@ { "SysCaps": [ + "SystemCapability.Base", "SystemCapability.Communication.SoftBus.Core", "SystemCapability.Communication.WiFi.AP.Extension", "SystemCapability.PowerManager.PowerManager.Lite", diff --git a/api/device-define/smartVision.json b/api/device-define/smartVision.json index 04f627106..4e8b8ea51 100644 --- a/api/device-define/smartVision.json +++ b/api/device-define/smartVision.json @@ -1,6 +1,7 @@ { "SysCaps": [ "SystemCapability.ArkUI.ArkUI.Lite", + "SystemCapability.Base", "SystemCapability.BundleManager.PackingTool", "SystemCapability.Communication.IPC.Core", "SystemCapability.Communication.SoftBus.Core", diff --git a/api/device-define/tablet.json b/api/device-define/tablet.json index 7368bbc6e..4bdaec773 100644 --- a/api/device-define/tablet.json +++ b/api/device-define/tablet.json @@ -5,6 +5,7 @@ "SystemCapability.ArkUI.ArkUI.Napi", "SystemCapability.ArkUI.ArkUI.Libuv", "SystemCapability.ArkUI.UiAppearance", + "SystemCapability.Base", "SystemCapability.BundleManager.BundleFramework", "SystemCapability.BundleManager.DistributedBundleFramework", "SystemCapability.BundleManager.BundleTool", @@ -40,6 +41,7 @@ "SystemCapability.MultimodalInput.Input.InputConsumer", "SystemCapability.MultimodalInput.Input.InputSimulator", "SystemCapability.MultimodalInput.Input.InputFilter", + "SystemCapability.MultimodalInput.Input.ShortKey", "SystemCapability.PowerManager.BatteryManager.Extension", "SystemCapability.PowerManager.BatteryStatistics", "SystemCapability.PowerManager.DisplayPowerManager", @@ -67,6 +69,8 @@ "SystemCapability.Multimedia.Audio.Device", "SystemCapability.Multimedia.Audio.Volume", "SystemCapability.Multimedia.Audio.Communication", + "SystemCapability.Multimedia.Audio.Interrupt", + "SystemCapability.Multimedia.Audio.Tone", "SystemCapability.Multimedia.Camera.Core", "SystemCapability.Multimedia.Camera.DistributedCore", "SystemCapability.Multimedia.Image.Core", @@ -167,6 +171,7 @@ "SystemCapability.Cloud.VAID", "SystemCapability.Security.CertificateManager", "SystemCapability.Security.CryptoFramework", + "SystemCapability.Security.Cert", "SystemCapability.BundleManager.BundleFramework.Core", "SystemCapability.BundleManager.BundleFramework.FreeInstall", "SystemCapability.BundleManager.BundleFramework.Resource", diff --git a/api/device-define/tv.json b/api/device-define/tv.json index a17921326..b7ee928b0 100644 --- a/api/device-define/tv.json +++ b/api/device-define/tv.json @@ -5,6 +5,7 @@ "SystemCapability.ArkUI.ArkUI.Napi", "SystemCapability.ArkUI.ArkUI.Libuv", "SystemCapability.ArkUI.UiAppearance", + "SystemCapability.Base", "SystemCapability.BundleManager.BundleFramework", "SystemCapability.BundleManager.DistributedBundleFramework", "SystemCapability.BundleManager.BundleTool", @@ -35,6 +36,7 @@ "SystemCapability.MultimodalInput.Input.InputConsumer", "SystemCapability.MultimodalInput.Input.InputSimulator", "SystemCapability.MultimodalInput.Input.InputFilter", + "SystemCapability.MultimodalInput.Input.ShortKey", "SystemCapability.PowerManager.DisplayPowerManager", "SystemCapability.PowerManager.ThermalManager", "SystemCapability.PowerManager.PowerManager.Core", @@ -59,6 +61,8 @@ "SystemCapability.Multimedia.Audio.Device", "SystemCapability.Multimedia.Audio.Volume", "SystemCapability.Multimedia.Audio.Communication", + "SystemCapability.Multimedia.Audio.Interrupt", + "SystemCapability.Multimedia.Audio.Tone", "SystemCapability.Multimedia.Camera.Core", "SystemCapability.Multimedia.Camera.DistributedCore", "SystemCapability.Multimedia.Image.Core", @@ -141,6 +145,7 @@ "SystemCapability.Cloud.VAID", "SystemCapability.Security.CertificateManager", "SystemCapability.Security.CryptoFramework", + "SystemCapability.Security.Cert", "SystemCapability.BundleManager.BundleFramework.Core", "SystemCapability.BundleManager.BundleFramework.FreeInstall", "SystemCapability.BundleManager.BundleFramework.Resource", diff --git a/api/device-define/wearable.json b/api/device-define/wearable.json index 5a4274c3d..ccfaec8d4 100644 --- a/api/device-define/wearable.json +++ b/api/device-define/wearable.json @@ -5,6 +5,7 @@ "SystemCapability.ArkUI.ArkUI.Napi", "SystemCapability.ArkUI.ArkUI.Libuv", "SystemCapability.ArkUI.UiAppearance", + "SystemCapability.Base", "SystemCapability.BundleManager.BundleFramework", "SystemCapability.BundleManager.DistributedBundleFramework", "SystemCapability.BundleManager.BundleTool", @@ -60,6 +61,8 @@ "SystemCapability.Multimedia.Audio.Device", "SystemCapability.Multimedia.Audio.Volume", "SystemCapability.Multimedia.Audio.Communication", + "SystemCapability.Multimedia.Audio.Interrupt", + "SystemCapability.Multimedia.Audio.Tone", "SystemCapability.Multimedia.Camera.Core", "SystemCapability.Multimedia.Camera.DistributedCore", "SystemCapability.Multimedia.Image.Core", diff --git a/api/imf/InputMethodCommon.d.ts b/api/imf/InputMethodCommon.d.ts deleted file mode 100644 index d44bcf0ab..000000000 --- a/api/imf/InputMethodCommon.d.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Enumerates the moving direction of cursor - * @enum { number } - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 10 - */ -export enum Direction { - /** - * Cursor moves up - */ - CURSOR_UP = 1, - - /** - * Cursor moves down - */ - CURSOR_DOWN, - - /** - * Cursor moves left - */ - CURSOR_LEFT, - - /** - * Cursor moves right - */ - CURSOR_RIGHT, -} - -/** - * Range of selected text. - * @interface Range - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 10 - */ -export interface Range { - /** - * Indicates the index of the first character of the selected text. - * @type { number } - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 10 - */ - start: number; - - /** - * Indicates the index of the last character of the selected text. - * @type { number } - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 10 - */ - end: number; -} - -/** - * Movement of cursor. - * @interface Movement - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 10 - */ -export interface Movement { - /** - * Indicates the direction of cursor movement - * @type { number } - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 10 - */ - direction: Direction; -} \ No newline at end of file diff --git a/api/multimedia/ringtonePlayer.d.ts b/api/multimedia/ringtonePlayer.d.ts index e9ba5eeb2..dd53cbf74 100644 --- a/api/multimedia/ringtonePlayer.d.ts +++ b/api/multimedia/ringtonePlayer.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import type { Callback, AsyncCallback } from '../basic'; +import type { Callback, AsyncCallback } from '../@ohos.base'; import type audio from '../@ohos.multimedia.audio'; import type media from '../@ohos.multimedia.media'; diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index afd9ab312..175e26106 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -14,7 +14,7 @@ */ import tag from '../@ohos.nfc.tag'; import { TagSession } from './tagSession'; -import { AsyncCallback, Callback } from '../basic'; +import { AsyncCallback, Callback } from '../@ohos.base'; /** * Provides interfaces to control the read and write of tags that support the NFC-A technology. diff --git a/api/tag/tagSession.d.ts b/api/tag/tagSession.d.ts index 51c482ada..e88383a45 100644 --- a/api/tag/tagSession.d.ts +++ b/api/tag/tagSession.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import tag from '../@ohos.nfc.tag'; -import { AsyncCallback } from '../basic'; +import { AsyncCallback } from '../@ohos.base'; /** * Controls tag read and write. diff --git a/api/webgl/webgl.d.ts b/api/webgl/webgl.d.ts deleted file mode 100644 index 382cc598d..000000000 --- a/api/webgl/webgl.d.ts +++ /dev/null @@ -1,699 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLenum = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLboolean = boolean; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLbitfield = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLbyte = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLshort = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLint = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLsizei = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLintptr = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLsizeiptr = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLubyte = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLushort = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLuint = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLfloat = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type GLclampf = number; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type TexImageSource = ImageData; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type Float32List = Float32Array | GLfloat[]; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type Int32List = Int32Array | GLint[]; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -type WebGLPowerPreference = "default" | "low-power" | "high-performance"; -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -export interface WebGLContextAttributes { - alpha?: boolean; - depth?: boolean; - stencil?: boolean; - antialias?: boolean; - premultipliedAlpha?: boolean; - preserveDrawingBuffer?: boolean; - powerPreference?: WebGLPowerPreference; - failIfMajorPerformanceCaveat?: boolean; - desynchronized?: boolean; -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLBuffer { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLFramebuffer { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLProgram { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLRenderbuffer { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLShader { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLTexture { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLUniformLocation { -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLActiveInfo { - readonly size: GLint; - readonly type: GLenum; - readonly name: string; -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLShaderPrecisionFormat { - readonly rangeMin: GLint; - readonly rangeMax: GLint; - readonly precision: GLint; -} - -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLRenderingContextBase { - readonly DEPTH_BUFFER_BIT: GLenum; - readonly STENCIL_BUFFER_BIT: GLenum; - readonly COLOR_BUFFER_BIT: GLenum; - readonly POINTS: GLenum; - readonly LINES: GLenum; - readonly LINE_LOOP: GLenum; - readonly LINE_STRIP: GLenum; - readonly TRIANGLES: GLenum; - readonly TRIANGLE_STRIP: GLenum; - readonly TRIANGLE_FAN: GLenum; - readonly ZERO: GLenum; - readonly ONE: GLenum; - readonly SRC_COLOR: GLenum; - readonly ONE_MINUS_SRC_COLOR: GLenum; - readonly SRC_ALPHA: GLenum; - readonly ONE_MINUS_SRC_ALPHA: GLenum; - readonly DST_ALPHA: GLenum; - readonly ONE_MINUS_DST_ALPHA: GLenum; - readonly DST_COLOR: GLenum; - readonly ONE_MINUS_DST_COLOR: GLenum; - readonly SRC_ALPHA_SATURATE: GLenum; - readonly FUNC_ADD: GLenum; - readonly BLEND_EQUATION: GLenum; - readonly BLEND_EQUATION_RGB: GLenum; - readonly BLEND_EQUATION_ALPHA: GLenum; - readonly FUNC_SUBTRACT: GLenum; - readonly FUNC_REVERSE_SUBTRACT: GLenum; - readonly BLEND_DST_RGB: GLenum; - readonly BLEND_SRC_RGB: GLenum; - readonly BLEND_DST_ALPHA: GLenum; - readonly BLEND_SRC_ALPHA: GLenum; - readonly CONSTANT_COLOR: GLenum; - readonly ONE_MINUS_CONSTANT_COLOR: GLenum; - readonly CONSTANT_ALPHA: GLenum; - readonly ONE_MINUS_CONSTANT_ALPHA: GLenum; - readonly BLEND_COLOR: GLenum; - readonly ARRAY_BUFFER: GLenum; - readonly ELEMENT_ARRAY_BUFFER: GLenum; - readonly ARRAY_BUFFER_BINDING: GLenum; - readonly ELEMENT_ARRAY_BUFFER_BINDING: GLenum; - readonly STREAM_DRAW: GLenum; - readonly STATIC_DRAW: GLenum; - readonly DYNAMIC_DRAW: GLenum; - readonly BUFFER_SIZE: GLenum; - readonly BUFFER_USAGE: GLenum; - readonly CURRENT_VERTEX_ATTRIB: GLenum; - readonly FRONT: GLenum; - readonly BACK: GLenum; - readonly FRONT_AND_BACK: GLenum; - readonly CULL_FACE: GLenum; - readonly BLEND: GLenum; - readonly DITHER: GLenum; - readonly STENCIL_TEST: GLenum; - readonly DEPTH_TEST: GLenum; - readonly SCISSOR_TEST: GLenum; - readonly POLYGON_OFFSET_FILL: GLenum; - readonly SAMPLE_ALPHA_TO_COVERAGE: GLenum; - readonly SAMPLE_COVERAGE: GLenum; - readonly NO_ERROR: GLenum; - readonly INVALID_ENUM: GLenum; - readonly INVALID_VALUE: GLenum; - readonly INVALID_OPERATION: GLenum; - readonly OUT_OF_MEMORY: GLenum; - readonly CW: GLenum; - readonly CCW: GLenum; - readonly LINE_WIDTH: GLenum; - readonly ALIASED_POINT_SIZE_RANGE: GLenum; - readonly ALIASED_LINE_WIDTH_RANGE: GLenum; - readonly CULL_FACE_MODE: GLenum; - readonly FRONT_FACE: GLenum; - readonly DEPTH_RANGE: GLenum; - readonly DEPTH_WRITEMASK: GLenum; - readonly DEPTH_CLEAR_VALUE: GLenum; - readonly DEPTH_FUNC: GLenum; - readonly STENCIL_CLEAR_VALUE: GLenum; - readonly STENCIL_FUNC: GLenum; - readonly STENCIL_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_REF: GLenum; - readonly STENCIL_VALUE_MASK: GLenum; - readonly STENCIL_WRITEMASK: GLenum; - readonly STENCIL_BACK_FUNC: GLenum; - readonly STENCIL_BACK_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_FAIL: GLenum; - readonly STENCIL_BACK_PASS_DEPTH_PASS: GLenum; - readonly STENCIL_BACK_REF: GLenum; - readonly STENCIL_BACK_VALUE_MASK: GLenum; - readonly STENCIL_BACK_WRITEMASK: GLenum; - readonly VIEWPORT: GLenum; - readonly SCISSOR_BOX: GLenum; - readonly COLOR_CLEAR_VALUE: GLenum; - readonly COLOR_WRITEMASK: GLenum; - readonly UNPACK_ALIGNMENT: GLenum; - readonly PACK_ALIGNMENT: GLenum; - readonly MAX_TEXTURE_SIZE: GLenum; - readonly MAX_VIEWPORT_DIMS: GLenum; - readonly SUBPIXEL_BITS: GLenum; - readonly RED_BITS: GLenum; - readonly GREEN_BITS: GLenum; - readonly BLUE_BITS: GLenum; - readonly ALPHA_BITS: GLenum; - readonly DEPTH_BITS: GLenum; - readonly STENCIL_BITS: GLenum; - readonly POLYGON_OFFSET_UNITS: GLenum; - readonly POLYGON_OFFSET_FACTOR: GLenum; - readonly TEXTURE_BINDING_2D: GLenum; - readonly SAMPLE_BUFFERS: GLenum; - readonly SAMPLES: GLenum; - readonly SAMPLE_COVERAGE_VALUE: GLenum; - readonly SAMPLE_COVERAGE_INVERT: GLenum; - readonly COMPRESSED_TEXTURE_FORMATS: GLenum; - readonly DONT_CARE: GLenum; - readonly FASTEST: GLenum; - readonly NICEST: GLenum; - readonly GENERATE_MIPMAP_HINT: GLenum; - readonly BYTE: GLenum; - readonly UNSIGNED_BYTE: GLenum; - readonly SHORT: GLenum; - readonly UNSIGNED_SHORT: GLenum; - readonly INT: GLenum; - readonly UNSIGNED_INT: GLenum; - readonly FLOAT: GLenum; - readonly DEPTH_COMPONENT: GLenum; - readonly ALPHA: GLenum; - readonly RGB: GLenum; - readonly RGBA: GLenum; - readonly LUMINANCE: GLenum; - readonly LUMINANCE_ALPHA: GLenum; - readonly UNSIGNED_SHORT_4_4_4_4: GLenum; - readonly UNSIGNED_SHORT_5_5_5_1: GLenum; - readonly UNSIGNED_SHORT_5_6_5: GLenum; - readonly FRAGMENT_SHADER: GLenum; - readonly VERTEX_SHADER: GLenum; - readonly MAX_VERTEX_ATTRIBS: GLenum; - readonly MAX_VERTEX_UNIFORM_VECTORS: GLenum; - readonly MAX_VARYING_VECTORS: GLenum; - readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_TEXTURE_IMAGE_UNITS: GLenum; - readonly MAX_FRAGMENT_UNIFORM_VECTORS: GLenum; - readonly SHADER_TYPE: GLenum; - readonly DELETE_STATUS: GLenum; - readonly LINK_STATUS: GLenum; - readonly VALIDATE_STATUS: GLenum; - readonly ATTACHED_SHADERS: GLenum; - readonly ACTIVE_UNIFORMS: GLenum; - readonly ACTIVE_ATTRIBUTES: GLenum; - readonly SHADING_LANGUAGE_VERSION: GLenum; - readonly CURRENT_PROGRAM: GLenum; - readonly NEVER: GLenum; - readonly LESS: GLenum; - readonly EQUAL: GLenum; - readonly LEQUAL: GLenum; - readonly GREATER: GLenum; - readonly NOTEQUAL: GLenum; - readonly GEQUAL: GLenum; - readonly ALWAYS: GLenum; - readonly KEEP: GLenum; - readonly REPLACE: GLenum; - readonly INCR: GLenum; - readonly DECR: GLenum; - readonly INVERT: GLenum; - readonly INCR_WRAP: GLenum; - readonly DECR_WRAP: GLenum; - readonly VENDOR: GLenum; - readonly RENDERER: GLenum; - readonly VERSION: GLenum; - readonly NEAREST: GLenum; - readonly LINEAR: GLenum; - readonly NEAREST_MIPMAP_NEAREST: GLenum; - readonly LINEAR_MIPMAP_NEAREST: GLenum; - readonly NEAREST_MIPMAP_LINEAR: GLenum; - readonly LINEAR_MIPMAP_LINEAR: GLenum; - readonly TEXTURE_MAG_FILTER: GLenum; - readonly TEXTURE_MIN_FILTER: GLenum; - readonly TEXTURE_WRAP_S: GLenum; - readonly TEXTURE_WRAP_T: GLenum; - readonly TEXTURE_2D: GLenum; - readonly TEXTURE: GLenum; - readonly TEXTURE_CUBE_MAP: GLenum; - readonly TEXTURE_BINDING_CUBE_MAP: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_X: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: GLenum; - readonly TEXTURE_CUBE_MAP_POSITIVE_Z: GLenum; - readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: GLenum; - readonly MAX_CUBE_MAP_TEXTURE_SIZE: GLenum; - readonly TEXTURE0: GLenum; - readonly TEXTURE1: GLenum; - readonly TEXTURE2: GLenum; - readonly TEXTURE3: GLenum; - readonly TEXTURE4: GLenum; - readonly TEXTURE5: GLenum; - readonly TEXTURE6: GLenum; - readonly TEXTURE7: GLenum; - readonly TEXTURE8: GLenum; - readonly TEXTURE9: GLenum; - readonly TEXTURE10: GLenum; - readonly TEXTURE11: GLenum; - readonly TEXTURE12: GLenum; - readonly TEXTURE13: GLenum; - readonly TEXTURE14: GLenum; - readonly TEXTURE15: GLenum; - readonly TEXTURE16: GLenum; - readonly TEXTURE17: GLenum; - readonly TEXTURE18: GLenum; - readonly TEXTURE19: GLenum; - readonly TEXTURE20: GLenum; - readonly TEXTURE21: GLenum; - readonly TEXTURE22: GLenum; - readonly TEXTURE23: GLenum; - readonly TEXTURE24: GLenum; - readonly TEXTURE25: GLenum; - readonly TEXTURE26: GLenum; - readonly TEXTURE27: GLenum; - readonly TEXTURE28: GLenum; - readonly TEXTURE29: GLenum; - readonly TEXTURE30: GLenum; - readonly TEXTURE31: GLenum; - readonly ACTIVE_TEXTURE: GLenum; - readonly REPEAT: GLenum; - readonly CLAMP_TO_EDGE: GLenum; - readonly MIRRORED_REPEAT: GLenum; - readonly FLOAT_VEC2: GLenum; - readonly FLOAT_VEC3: GLenum; - readonly FLOAT_VEC4: GLenum; - readonly INT_VEC2: GLenum; - readonly INT_VEC3: GLenum; - readonly INT_VEC4: GLenum; - readonly BOOL: GLenum; - readonly BOOL_VEC2: GLenum; - readonly BOOL_VEC3: GLenum; - readonly BOOL_VEC4: GLenum; - readonly FLOAT_MAT2: GLenum; - readonly FLOAT_MAT3: GLenum; - readonly FLOAT_MAT4: GLenum; - readonly SAMPLER_2D: GLenum; - readonly SAMPLER_CUBE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_ENABLED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_SIZE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_STRIDE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_TYPE: GLenum; - readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: GLenum; - readonly VERTEX_ATTRIB_ARRAY_POINTER: GLenum; - readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: GLenum; - readonly IMPLEMENTATION_COLOR_READ_TYPE: GLenum; - readonly IMPLEMENTATION_COLOR_READ_FORMAT: GLenum; - readonly COMPILE_STATUS: GLenum; - readonly LOW_FLOAT: GLenum; - readonly MEDIUM_FLOAT: GLenum; - readonly HIGH_FLOAT: GLenum; - readonly LOW_INT: GLenum; - readonly MEDIUM_INT: GLenum; - readonly HIGH_INT: GLenum; - readonly FRAMEBUFFER: GLenum; - readonly RENDERBUFFER: GLenum; - readonly RGBA4: GLenum; - readonly RGB5_A1: GLenum; - readonly RGB565: GLenum; - readonly DEPTH_COMPONENT16: GLenum; - readonly STENCIL_INDEX8: GLenum; - readonly DEPTH_STENCIL: GLenum; - readonly RENDERBUFFER_WIDTH: GLenum; - readonly RENDERBUFFER_HEIGHT: GLenum; - readonly RENDERBUFFER_INTERNAL_FORMAT: GLenum; - readonly RENDERBUFFER_RED_SIZE: GLenum; - readonly RENDERBUFFER_GREEN_SIZE: GLenum; - readonly RENDERBUFFER_BLUE_SIZE: GLenum; - readonly RENDERBUFFER_ALPHA_SIZE: GLenum; - readonly RENDERBUFFER_DEPTH_SIZE: GLenum; - readonly RENDERBUFFER_STENCIL_SIZE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: GLenum; - readonly COLOR_ATTACHMENT0: GLenum; - readonly DEPTH_ATTACHMENT: GLenum; - readonly STENCIL_ATTACHMENT: GLenum; - readonly DEPTH_STENCIL_ATTACHMENT: GLenum; - readonly NONE: GLenum; - readonly FRAMEBUFFER_COMPLETE: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: GLenum; - readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: GLenum; - readonly FRAMEBUFFER_UNSUPPORTED: GLenum; - readonly FRAMEBUFFER_BINDING: GLenum; - readonly RENDERBUFFER_BINDING: GLenum; - readonly MAX_RENDERBUFFER_SIZE: GLenum; - readonly INVALID_FRAMEBUFFER_OPERATION: GLenum; - readonly UNPACK_FLIP_Y_WEBGL: GLenum; - readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: GLenum; - readonly CONTEXT_LOST_WEBGL: GLenum; - readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: GLenum; - readonly BROWSER_DEFAULT_WEBGL: GLenum; - readonly canvas: HTMLCanvasElement | OffscreenCanvas; - readonly drawingBufferWidth: GLsizei; - readonly drawingBufferHeight: GLsizei; - getContextAttributes(): WebGLContextAttributes | null; - isContextLost(): boolean; - getSupportedExtensions(): string[] | null; - getExtension(name: string): any; - activeTexture(texture: GLenum): void; - attachShader(program: WebGLProgram, shader: WebGLShader): void; - bindAttribLocation(program: WebGLProgram, index: GLuint, name: string): void; - bindBuffer(target: GLenum, buffer: WebGLBuffer | null): void; - bindFramebuffer(target: GLenum, framebuffer: WebGLFramebuffer | null): void; - bindRenderbuffer(target: GLenum, renderbuffer: WebGLRenderbuffer | null): void; - bindTexture(target: GLenum, texture: WebGLTexture | null): void; - blendColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void; - blendEquation(mode: GLenum): void; - blendEquationSeparate(modeRGB: GLenum, modeAlpha: GLenum): void; - blendFunc(sfactor: GLenum, dfactor: GLenum): void; - blendFuncSeparate(srcRGB: GLenum, dstRGB: GLenum, srcAlpha: GLenum, dstAlpha: GLenum): void; - checkFramebufferStatus(target: GLenum): GLenum; - clear(mask: GLbitfield): void; - clearColor(red: GLclampf, green: GLclampf, blue: GLclampf, alpha: GLclampf): void; - clearDepth(depth: GLclampf): void; - clearStencil(s: GLint): void; - colorMask(red: GLboolean, green: GLboolean, blue: GLboolean, alpha: GLboolean): void; - compileShader(shader: WebGLShader): void; - copyTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, x: GLint, y: GLint, width: GLsizei, height: GLsizei, border: GLint): void; - copyTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; - createBuffer(): WebGLBuffer | null; - createFramebuffer(): WebGLFramebuffer | null; - createProgram(): WebGLProgram | null; - createRenderbuffer(): WebGLRenderbuffer | null; - createShader(type: GLenum): WebGLShader | null; - createTexture(): WebGLTexture | null; - cullFace(mode: GLenum): void; - deleteBuffer(buffer: WebGLBuffer | null): void; - deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void; - deleteProgram(program: WebGLProgram | null): void; - deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void; - deleteShader(shader: WebGLShader | null): void; - deleteTexture(texture: WebGLTexture | null): void; - depthFunc(func: GLenum): void; - depthMask(flag: GLboolean): void; - depthRange(zNear: GLclampf, zFar: GLclampf): void; - detachShader(program: WebGLProgram, shader: WebGLShader): void; - disable(cap: GLenum): void; - disableVertexAttribArray(index: GLuint): void; - drawArrays(mode: GLenum, first: GLint, count: GLsizei): void; - drawElements(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr): void; - enable(cap: GLenum): void; - enableVertexAttribArray(index: GLuint): void; - finish(): void; - flush(): void; - framebufferRenderbuffer(target: GLenum, attachment: GLenum, renderbuffertarget: GLenum, renderbuffer: WebGLRenderbuffer | null): void; - framebufferTexture2D(target: GLenum, attachment: GLenum, textarget: GLenum, texture: WebGLTexture | null, level: GLint): void; - frontFace(mode: GLenum): void; - generateMipmap(target: GLenum): void; - getActiveAttrib(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null; - getActiveUniform(program: WebGLProgram, index: GLuint): WebGLActiveInfo | null; - getAttachedShaders(program: WebGLProgram): WebGLShader[] | null; - getAttribLocation(program: WebGLProgram, name: string): GLint; - getBufferParameter(target: GLenum, pname: GLenum): any; - getParameter(pname: GLenum): any; - getError(): GLenum; - getFramebufferAttachmentParameter(target: GLenum, attachment: GLenum, pname: GLenum): any; - getProgramParameter(program: WebGLProgram, pname: GLenum): any; - getProgramInfoLog(program: WebGLProgram): string | null; - getRenderbufferParameter(target: GLenum, pname: GLenum): any; - getShaderParameter(shader: WebGLShader, pname: GLenum): any; - getShaderPrecisionFormat(shadertype: GLenum, precisiontype: GLenum): WebGLShaderPrecisionFormat | null; - getShaderInfoLog(shader: WebGLShader): string | null; - getShaderSource(shader: WebGLShader): string | null; - getTexParameter(target: GLenum, pname: GLenum): any; - getUniform(program: WebGLProgram, location: WebGLUniformLocation): any; - getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation | null; - getVertexAttrib(index: GLuint, pname: GLenum): any; - getVertexAttribOffset(index: GLuint, pname: GLenum): GLintptr; - hint(target: GLenum, mode: GLenum): void; - isBuffer(buffer: WebGLBuffer | null): GLboolean; - isEnabled(cap: GLenum): GLboolean; - isFramebuffer(framebuffer: WebGLFramebuffer | null): GLboolean; - isProgram(program: WebGLProgram | null): GLboolean; - isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): GLboolean; - isShader(shader: WebGLShader | null): GLboolean; - isTexture(texture: WebGLTexture | null): GLboolean; - lineWidth(width: GLfloat): void; - linkProgram(program: WebGLProgram): void; - pixelStorei(pname: GLenum, param: GLint | GLboolean): void; - polygonOffset(factor: GLfloat, units: GLfloat): void; - renderbufferStorage(target: GLenum, internalformat: GLenum, width: GLsizei, height: GLsizei): void; - sampleCoverage(value: GLclampf, invert: GLboolean): void; - scissor(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; - shaderSource(shader: WebGLShader, source: string): void; - stencilFunc(func: GLenum, ref: GLint, mask: GLuint): void; - stencilFuncSeparate(face: GLenum, func: GLenum, ref: GLint, mask: GLuint): void; - stencilMask(mask: GLuint): void; - stencilMaskSeparate(face: GLenum, mask: GLuint): void; - stencilOp(fail: GLenum, zfail: GLenum, zpass: GLenum): void; - stencilOpSeparate(face: GLenum, fail: GLenum, zfail: GLenum, zpass: GLenum): void; - texParameterf(target: GLenum, pname: GLenum, param: GLfloat): void; - texParameteri(target: GLenum, pname: GLenum, param: GLint): void; - uniform1f(location: WebGLUniformLocation | null, x: GLfloat): void; - uniform2f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat): void; - uniform3f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat): void; - uniform4f(location: WebGLUniformLocation | null, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void; - uniform1i(location: WebGLUniformLocation | null, x: GLint): void; - uniform2i(location: WebGLUniformLocation | null, x: GLint, y: GLint): void; - uniform3i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint): void; - uniform4i(location: WebGLUniformLocation | null, x: GLint, y: GLint, z: GLint, w: GLint): void; - useProgram(program: WebGLProgram | null): void; - validateProgram(program: WebGLProgram): void; - vertexAttrib1f(index: GLuint, x: GLfloat): void; - vertexAttrib2f(index: GLuint, x: GLfloat, y: GLfloat): void; - vertexAttrib3f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat): void; - vertexAttrib4f(index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat): void; - vertexAttrib1fv(index: GLuint, values: Float32List): void; - vertexAttrib2fv(index: GLuint, values: Float32List): void; - vertexAttrib3fv(index: GLuint, values: Float32List): void; - vertexAttrib4fv(index: GLuint, values: Float32List): void; - vertexAttribPointer(index: GLuint, size: GLint, type: GLenum, normalized: GLboolean, stride: GLsizei, offset: GLintptr): void; - viewport(x: GLint, y: GLint, width: GLsizei, height: GLsizei): void; -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -interface WebGLRenderingContextOverloads { - bufferData(target: GLenum, size: GLsizeiptr, usage: GLenum): void; - bufferData(target: GLenum, data: BufferSource | null, usage: GLenum): void; - bufferSubData(target: GLenum, offset: GLintptr, data: BufferSource): void; - compressedTexImage2D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, data: ArrayBufferView): void; - compressedTexSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, data: ArrayBufferView): void; - readPixels(x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void; - texImage2D(target: GLenum, level: GLint, internalformat: GLint, format: GLenum, type: GLenum, source: TexImageSource): void; - texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, width: GLsizei, height: GLsizei, format: GLenum, type: GLenum, pixels: ArrayBufferView | null): void; - texSubImage2D(target: GLenum, level: GLint, xoffset: GLint, yoffset: GLint, format: GLenum, type: GLenum, source: TexImageSource): void; - uniform1fv(location: WebGLUniformLocation | null, v: Float32List): void; - uniform2fv(location: WebGLUniformLocation | null, v: Float32List): void; - uniform3fv(location: WebGLUniformLocation | null, v: Float32List): void; - uniform4fv(location: WebGLUniformLocation | null, v: Float32List): void; - uniform1iv(location: WebGLUniformLocation | null, v: Int32List): void; - uniform2iv(location: WebGLUniformLocation | null, v: Int32List): void; - uniform3iv(location: WebGLUniformLocation | null, v: Int32List): void; - uniform4iv(location: WebGLUniformLocation | null, v: Int32List): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: GLboolean, value: Float32List): void; -} -/** - * WebGL 1.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/1.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL - */ -export interface WebGLRenderingContext extends WebGLRenderingContextBase, WebGLRenderingContextOverloads { -} diff --git a/api/webgl/webgl2.d.ts b/api/webgl/webgl2.d.ts deleted file mode 100644 index 724191f7b..000000000 --- a/api/webgl/webgl2.d.ts +++ /dev/null @@ -1,494 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ - -import * as webgl from "./webgl"; - -type GLint64 = number; -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -type GLuint64 = number; -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGLQuery { -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGLSampler { -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGLSync { -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGLTransformFeedback { -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGLVertexArrayObject { -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -type Uint32List = Uint32Array | webgl.GLuint[]; -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGL2RenderingContextBase { - readonly READ_BUFFER: webgl.GLenum; - readonly UNPACK_ROW_LENGTH: webgl.GLenum; - readonly UNPACK_SKIP_ROWS: webgl.GLenum; - readonly UNPACK_SKIP_PIXELS: webgl.GLenum; - readonly PACK_ROW_LENGTH: webgl.GLenum; - readonly PACK_SKIP_ROWS: webgl.GLenum; - readonly PACK_SKIP_PIXELS: webgl.GLenum; - readonly COLOR: webgl.GLenum; - readonly DEPTH: webgl.GLenum; - readonly STENCIL: webgl.GLenum; - readonly RED: webgl.GLenum; - readonly RGB8: webgl.GLenum; - readonly RGBA8: webgl.GLenum; - readonly RGB10_A2: webgl.GLenum; - readonly TEXTURE_BINDING_3D: webgl.GLenum; - readonly UNPACK_SKIP_IMAGES: webgl.GLenum; - readonly UNPACK_IMAGE_HEIGHT: webgl.GLenum; - readonly TEXTURE_3D: webgl.GLenum; - readonly TEXTURE_WRAP_R: webgl.GLenum; - readonly MAX_3D_TEXTURE_SIZE: webgl.GLenum; - readonly UNSIGNED_INT_2_10_10_10_REV: webgl.GLenum; - readonly MAX_ELEMENTS_VERTICES: webgl.GLenum; - readonly MAX_ELEMENTS_INDICES: webgl.GLenum; - readonly TEXTURE_MIN_LOD: webgl.GLenum; - readonly TEXTURE_MAX_LOD: webgl.GLenum; - readonly TEXTURE_BASE_LEVEL: webgl.GLenum; - readonly TEXTURE_MAX_LEVEL: webgl.GLenum; - readonly MIN: webgl.GLenum; - readonly MAX: webgl.GLenum; - readonly DEPTH_COMPONENT24: webgl.GLenum; - readonly MAX_TEXTURE_LOD_BIAS: webgl.GLenum; - readonly TEXTURE_COMPARE_MODE: webgl.GLenum; - readonly TEXTURE_COMPARE_FUNC: webgl.GLenum; - readonly CURRENT_QUERY: webgl.GLenum; - readonly QUERY_RESULT: webgl.GLenum; - readonly QUERY_RESULT_AVAILABLE: webgl.GLenum; - readonly STREAM_READ: webgl.GLenum; - readonly STREAM_COPY: webgl.GLenum; - readonly STATIC_READ: webgl.GLenum; - readonly STATIC_COPY: webgl.GLenum; - readonly DYNAMIC_READ: webgl.GLenum; - readonly DYNAMIC_COPY: webgl.GLenum; - readonly MAX_DRAW_BUFFERS: webgl.GLenum; - readonly DRAW_BUFFER0: webgl.GLenum; - readonly DRAW_BUFFER1: webgl.GLenum; - readonly DRAW_BUFFER2: webgl.GLenum; - readonly DRAW_BUFFER3: webgl.GLenum; - readonly DRAW_BUFFER4: webgl.GLenum; - readonly DRAW_BUFFER5: webgl.GLenum; - readonly DRAW_BUFFER6: webgl.GLenum; - readonly DRAW_BUFFER7: webgl.GLenum; - readonly DRAW_BUFFER8: webgl.GLenum; - readonly DRAW_BUFFER9: webgl.GLenum; - readonly DRAW_BUFFER10: webgl.GLenum; - readonly DRAW_BUFFER11: webgl.GLenum; - readonly DRAW_BUFFER12: webgl.GLenum; - readonly DRAW_BUFFER13: webgl.GLenum; - readonly DRAW_BUFFER14: webgl.GLenum; - readonly DRAW_BUFFER15: webgl.GLenum; - readonly MAX_FRAGMENT_UNIFORM_COMPONENTS: webgl.GLenum; - readonly MAX_VERTEX_UNIFORM_COMPONENTS: webgl.GLenum; - readonly SAMPLER_3D: webgl.GLenum; - readonly SAMPLER_2D_SHADOW: webgl.GLenum; - readonly FRAGMENT_SHADER_DERIVATIVE_HINT: webgl.GLenum; - readonly PIXEL_PACK_BUFFER: webgl.GLenum; - readonly PIXEL_UNPACK_BUFFER: webgl.GLenum; - readonly PIXEL_PACK_BUFFER_BINDING: webgl.GLenum; - readonly PIXEL_UNPACK_BUFFER_BINDING: webgl.GLenum; - readonly FLOAT_MAT2x3: webgl.GLenum; - readonly FLOAT_MAT2x4: webgl.GLenum; - readonly FLOAT_MAT3x2: webgl.GLenum; - readonly FLOAT_MAT3x4: webgl.GLenum; - readonly FLOAT_MAT4x2: webgl.GLenum; - readonly FLOAT_MAT4x3: webgl.GLenum; - readonly SRGB: webgl.GLenum; - readonly SRGB8: webgl.GLenum; - readonly SRGB8_ALPHA8: webgl.GLenum; - readonly COMPARE_REF_TO_TEXTURE: webgl.GLenum; - readonly RGBA32F: webgl.GLenum; - readonly RGB32F: webgl.GLenum; - readonly RGBA16F: webgl.GLenum; - readonly RGB16F: webgl.GLenum; - readonly VERTEX_ATTRIB_ARRAY_INTEGER: webgl.GLenum; - readonly MAX_ARRAY_TEXTURE_LAYERS: webgl.GLenum; - readonly MIN_PROGRAM_TEXEL_OFFSET: webgl.GLenum; - readonly MAX_PROGRAM_TEXEL_OFFSET: webgl.GLenum; - readonly MAX_VARYING_COMPONENTS: webgl.GLenum; - readonly TEXTURE_2D_ARRAY: webgl.GLenum; - readonly TEXTURE_BINDING_2D_ARRAY: webgl.GLenum; - readonly R11F_G11F_B10F: webgl.GLenum; - readonly UNSIGNED_INT_10F_11F_11F_REV: webgl.GLenum; - readonly RGB9_E5: webgl.GLenum; - readonly UNSIGNED_INT_5_9_9_9_REV: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_MODE: webgl.GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_VARYINGS: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_START: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_SIZE: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: webgl.GLenum; - readonly RASTERIZER_DISCARD: webgl.GLenum; - readonly MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: webgl.GLenum; - readonly MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: webgl.GLenum; - readonly INTERLEAVED_ATTRIBS: webgl.GLenum; - readonly SEPARATE_ATTRIBS: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_BUFFER_BINDING: webgl.GLenum; - readonly RGBA32UI: webgl.GLenum; - readonly RGB32UI: webgl.GLenum; - readonly RGBA16UI: webgl.GLenum; - readonly RGB16UI: webgl.GLenum; - readonly RGBA8UI: webgl.GLenum; - readonly RGB8UI: webgl.GLenum; - readonly RGBA32I: webgl.GLenum; - readonly RGB32I: webgl.GLenum; - readonly RGBA16I: webgl.GLenum; - readonly RGB16I: webgl.GLenum; - readonly RGBA8I: webgl.GLenum; - readonly RGB8I: webgl.GLenum; - readonly RED_INTEGER: webgl.GLenum; - readonly RGB_INTEGER: webgl.GLenum; - readonly RGBA_INTEGER: webgl.GLenum; - readonly SAMPLER_2D_ARRAY: webgl.GLenum; - readonly SAMPLER_2D_ARRAY_SHADOW: webgl.GLenum; - readonly SAMPLER_CUBE_SHADOW: webgl.GLenum; - readonly UNSIGNED_INT_VEC2: webgl.GLenum; - readonly UNSIGNED_INT_VEC3: webgl.GLenum; - readonly UNSIGNED_INT_VEC4: webgl.GLenum; - readonly INT_SAMPLER_2D: webgl.GLenum; - readonly INT_SAMPLER_3D: webgl.GLenum; - readonly INT_SAMPLER_CUBE: webgl.GLenum; - readonly INT_SAMPLER_2D_ARRAY: webgl.GLenum; - readonly UNSIGNED_INT_SAMPLER_2D: webgl.GLenum; - readonly UNSIGNED_INT_SAMPLER_3D: webgl.GLenum; - readonly UNSIGNED_INT_SAMPLER_CUBE: webgl.GLenum; - readonly UNSIGNED_INT_SAMPLER_2D_ARRAY: webgl.GLenum; - readonly DEPTH_COMPONENT32F: webgl.GLenum; - readonly DEPTH32F_STENCIL8: webgl.GLenum; - readonly FLOAT_32_UNSIGNED_INT_24_8_REV: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_RED_SIZE: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: webgl.GLenum; - readonly FRAMEBUFFER_DEFAULT: webgl.GLenum; - readonly UNSIGNED_INT_24_8: webgl.GLenum; - readonly DEPTH24_STENCIL8: webgl.GLenum; - readonly UNSIGNED_NORMALIZED: webgl.GLenum; - readonly DRAW_FRAMEBUFFER_BINDING: webgl.GLenum; - readonly READ_FRAMEBUFFER: webgl.GLenum; - readonly DRAW_FRAMEBUFFER: webgl.GLenum; - readonly READ_FRAMEBUFFER_BINDING: webgl.GLenum; - readonly RENDERBUFFER_SAMPLES: webgl.GLenum; - readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: webgl.GLenum; - readonly MAX_COLOR_ATTACHMENTS: webgl.GLenum; - readonly COLOR_ATTACHMENT1: webgl.GLenum; - readonly COLOR_ATTACHMENT2: webgl.GLenum; - readonly COLOR_ATTACHMENT3: webgl.GLenum; - readonly COLOR_ATTACHMENT4: webgl.GLenum; - readonly COLOR_ATTACHMENT5: webgl.GLenum; - readonly COLOR_ATTACHMENT6: webgl.GLenum; - readonly COLOR_ATTACHMENT7: webgl.GLenum; - readonly COLOR_ATTACHMENT8: webgl.GLenum; - readonly COLOR_ATTACHMENT9: webgl.GLenum; - readonly COLOR_ATTACHMENT10: webgl.GLenum; - readonly COLOR_ATTACHMENT11: webgl.GLenum; - readonly COLOR_ATTACHMENT12: webgl.GLenum; - readonly COLOR_ATTACHMENT13: webgl.GLenum; - readonly COLOR_ATTACHMENT14: webgl.GLenum; - readonly COLOR_ATTACHMENT15: webgl.GLenum; - readonly FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: webgl.GLenum; - readonly MAX_SAMPLES: webgl.GLenum; - readonly HALF_FLOAT: webgl.GLenum; - readonly RG: webgl.GLenum; - readonly RG_INTEGER: webgl.GLenum; - readonly R8: webgl.GLenum; - readonly RG8: webgl.GLenum; - readonly R16F: webgl.GLenum; - readonly R32F: webgl.GLenum; - readonly RG16F: webgl.GLenum; - readonly RG32F: webgl.GLenum; - readonly R8I: webgl.GLenum; - readonly R8UI: webgl.GLenum; - readonly R16I: webgl.GLenum; - readonly R16UI: webgl.GLenum; - readonly R32I: webgl.GLenum; - readonly R32UI: webgl.GLenum; - readonly RG8I: webgl.GLenum; - readonly RG8UI: webgl.GLenum; - readonly RG16I: webgl.GLenum; - readonly RG16UI: webgl.GLenum; - readonly RG32I: webgl.GLenum; - readonly RG32UI: webgl.GLenum; - readonly VERTEX_ARRAY_BINDING: webgl.GLenum; - readonly R8_SNORM: webgl.GLenum; - readonly RG8_SNORM: webgl.GLenum; - readonly RGB8_SNORM: webgl.GLenum; - readonly RGBA8_SNORM: webgl.GLenum; - readonly SIGNED_NORMALIZED: webgl.GLenum; - readonly COPY_READ_BUFFER: webgl.GLenum; - readonly COPY_WRITE_BUFFER: webgl.GLenum; - readonly COPY_READ_BUFFER_BINDING: webgl.GLenum; - readonly COPY_WRITE_BUFFER_BINDING: webgl.GLenum; - readonly UNIFORM_BUFFER: webgl.GLenum; - readonly UNIFORM_BUFFER_BINDING: webgl.GLenum; - readonly UNIFORM_BUFFER_START: webgl.GLenum; - readonly UNIFORM_BUFFER_SIZE: webgl.GLenum; - readonly MAX_VERTEX_UNIFORM_BLOCKS: webgl.GLenum; - readonly MAX_FRAGMENT_UNIFORM_BLOCKS: webgl.GLenum; - readonly MAX_COMBINED_UNIFORM_BLOCKS: webgl.GLenum; - readonly MAX_UNIFORM_BUFFER_BINDINGS: webgl.GLenum; - readonly MAX_UNIFORM_BLOCK_SIZE: webgl.GLenum; - readonly MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: webgl.GLenum; - readonly MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: webgl.GLenum; - readonly UNIFORM_BUFFER_OFFSET_ALIGNMENT: webgl.GLenum; - readonly ACTIVE_UNIFORM_BLOCKS: webgl.GLenum; - readonly UNIFORM_TYPE: webgl.GLenum; - readonly UNIFORM_SIZE: webgl.GLenum; - readonly UNIFORM_BLOCK_INDEX: webgl.GLenum; - readonly UNIFORM_OFFSET: webgl.GLenum; - readonly UNIFORM_ARRAY_STRIDE: webgl.GLenum; - readonly UNIFORM_MATRIX_STRIDE: webgl.GLenum; - readonly UNIFORM_IS_ROW_MAJOR: webgl.GLenum; - readonly UNIFORM_BLOCK_BINDING: webgl.GLenum; - readonly UNIFORM_BLOCK_DATA_SIZE: webgl.GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORMS: webgl.GLenum; - readonly UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: webgl.GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: webgl.GLenum; - readonly UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: webgl.GLenum; - readonly INVALID_INDEX: webgl.GLenum; - readonly MAX_VERTEX_OUTPUT_COMPONENTS: webgl.GLenum; - readonly MAX_FRAGMENT_INPUT_COMPONENTS: webgl.GLenum; - readonly MAX_SERVER_WAIT_TIMEOUT: webgl.GLenum; - readonly OBJECT_TYPE: webgl.GLenum; - readonly SYNC_CONDITION: webgl.GLenum; - readonly SYNC_STATUS: webgl.GLenum; - readonly SYNC_FLAGS: webgl.GLenum; - readonly SYNC_FENCE: webgl.GLenum; - readonly SYNC_GPU_COMMANDS_COMPLETE: webgl.GLenum; - readonly UNSIGNALED: webgl.GLenum; - readonly SIGNALED: webgl.GLenum; - readonly ALREADY_SIGNALED: webgl.GLenum; - readonly TIMEOUT_EXPIRED: webgl.GLenum; - readonly CONDITION_SATISFIED: webgl.GLenum; - readonly WAIT_FAILED: webgl.GLenum; - readonly SYNC_FLUSH_COMMANDS_BIT: webgl.GLenum; - readonly VERTEX_ATTRIB_ARRAY_DIVISOR: webgl.GLenum; - readonly ANY_SAMPLES_PASSED: webgl.GLenum; - readonly ANY_SAMPLES_PASSED_CONSERVATIVE: webgl.GLenum; - readonly SAMPLER_BINDING: webgl.GLenum; - readonly RGB10_A2UI: webgl.GLenum; - readonly INT_2_10_10_10_REV: webgl.GLenum; - readonly TRANSFORM_FEEDBACK: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_PAUSED: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_ACTIVE: webgl.GLenum; - readonly TRANSFORM_FEEDBACK_BINDING: webgl.GLenum; - readonly TEXTURE_IMMUTABLE_FORMAT: webgl.GLenum; - readonly MAX_ELEMENT_INDEX: webgl.GLenum; - readonly TEXTURE_IMMUTABLE_LEVELS: webgl.GLenum; - readonly TIMEOUT_IGNORED: GLint64; - readonly MAX_CLIENT_WAIT_TIMEOUT_WEBGL: webgl.GLenum; - copyBufferSubData(readTarget: webgl.GLenum, writeTarget: webgl.GLenum, readOffset: webgl.GLintptr, writeOffset: webgl.GLintptr, size: webgl.GLsizeiptr): void; - getBufferSubData(target: webgl.GLenum, srcByteOffset: webgl.GLintptr, dstBuffer: ArrayBufferView, dstOffset?: webgl.GLuint, length?: webgl.GLuint): void; - blitFramebuffer(srcX0: webgl.GLint, srcY0: webgl.GLint, srcX1: webgl.GLint, srcY1: webgl.GLint, dstX0: webgl.GLint, dstY0: webgl.GLint, dstX1: webgl.GLint, dstY1: webgl.GLint, mask: webgl.GLbitfield, filter: webgl.GLenum): void; - framebufferTextureLayer(target: webgl.GLenum, attachment: webgl.GLenum, texture: webgl.WebGLTexture | null, level: webgl.GLint, layer: webgl.GLint): void; - invalidateFramebuffer(target: webgl.GLenum, attachments: webgl.GLenum[]): void; - invalidateSubFramebuffer(target: webgl.GLenum, attachments: webgl.GLenum[], x: webgl.GLint, y: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei): void; - readBuffer(src: webgl.GLenum): void; - getInternalformatParameter(target: webgl.GLenum, internalformat: webgl.GLenum, pname: webgl.GLenum): any; - renderbufferStorageMultisample(target: webgl.GLenum, samples: webgl.GLsizei, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei): void; - texStorage2D(target: webgl.GLenum, levels: webgl.GLsizei, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei): void; - texStorage3D(target: webgl.GLenum, levels: webgl.GLsizei, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei): void; - texImage3D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, pboOffset: webgl.GLintptr): void; - texImage3D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, source: webgl.TexImageSource): void; - texImage3D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, srcData: ArrayBufferView | null): void; - texImage3D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, srcData: ArrayBufferView, srcOffset: webgl.GLuint): void; - texSubImage3D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, zoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, pboOffset: webgl.GLintptr): void; - texSubImage3D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, zoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, source: webgl.TexImageSource): void; - texSubImage3D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, zoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, srcData: ArrayBufferView | null, srcOffset?: webgl.GLuint): void; - copyTexSubImage3D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, zoffset: webgl.GLint, x: webgl.GLint, y: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei): void; - compressedTexImage3D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, border: webgl.GLint, imageSize: webgl.GLsizei, offset: webgl.GLintptr): void; - compressedTexImage3D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, border: webgl.GLint, srcData: ArrayBufferView, srcOffset?: webgl.GLuint, srcLengthOverride?: webgl.GLuint): void; - compressedTexSubImage3D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, zoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, format: webgl.GLenum, imageSize: webgl.GLsizei, offset: webgl.GLintptr): void; - compressedTexSubImage3D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, zoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, depth: webgl.GLsizei, format: webgl.GLenum, srcData: ArrayBufferView, srcOffset?: webgl.GLuint, srcLengthOverride?: webgl.GLuint): void; - getFragDataLocation(program: webgl.WebGLProgram, name: string): webgl.GLint; - uniform1ui(location: webgl.WebGLUniformLocation | null, v0: webgl.GLuint): void; - uniform2ui(location: webgl.WebGLUniformLocation | null, v0: webgl.GLuint, v1: webgl.GLuint): void; - uniform3ui(location: webgl.WebGLUniformLocation | null, v0: webgl.GLuint, v1: webgl.GLuint, v2: webgl.GLuint): void; - uniform4ui(location: webgl.WebGLUniformLocation | null, v0: webgl.GLuint, v1: webgl.GLuint, v2: webgl.GLuint, v3: webgl.GLuint): void; - uniform1uiv(location: webgl.WebGLUniformLocation | null, data: Uint32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform2uiv(location: webgl.WebGLUniformLocation | null, data: Uint32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform3uiv(location: webgl.WebGLUniformLocation | null, data: Uint32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform4uiv(location: webgl.WebGLUniformLocation | null, data: Uint32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix3x2fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix4x2fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix2x3fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix4x3fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix2x4fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix3x4fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - vertexAttribI4i(index: webgl.GLuint, x: webgl.GLint, y: webgl.GLint, z: webgl.GLint, w: webgl.GLint): void; - vertexAttribI4iv(index: webgl.GLuint, values: webgl.Int32List): void; - vertexAttribI4ui(index: webgl.GLuint, x: webgl.GLuint, y: webgl.GLuint, z: webgl.GLuint, w: webgl.GLuint): void; - vertexAttribI4uiv(index: webgl.GLuint, values: Uint32List): void; - vertexAttribIPointer(index: webgl.GLuint, size: webgl.GLint, type: webgl.GLenum, stride: webgl.GLsizei, offset: webgl.GLintptr): void; - vertexAttribDivisor(index: webgl.GLuint, divisor: webgl.GLuint): void; - drawArraysInstanced(mode: webgl.GLenum, first: webgl.GLint, count: webgl.GLsizei, instanceCount: webgl.GLsizei): void; - drawElementsInstanced(mode: webgl.GLenum, count: webgl.GLsizei, type: webgl.GLenum, offset: webgl.GLintptr, instanceCount: webgl.GLsizei): void; - drawRangeElements(mode: webgl.GLenum, start: webgl.GLuint, end: webgl.GLuint, count: webgl.GLsizei, type: webgl.GLenum, offset: webgl.GLintptr): void; - drawBuffers(buffers: webgl.GLenum[]): void; - clearBufferfv(buffer: webgl.GLenum, drawbuffer: webgl.GLint, values: webgl.Float32List, srcOffset?: webgl.GLuint): void; - clearBufferiv(buffer: webgl.GLenum, drawbuffer: webgl.GLint, values: webgl.Int32List, srcOffset?: webgl.GLuint): void; - clearBufferuiv(buffer: webgl.GLenum, drawbuffer: webgl.GLint, values: Uint32List, srcOffset?: webgl.GLuint): void; - clearBufferfi(buffer: webgl.GLenum, drawbuffer: webgl.GLint, depth: webgl.GLfloat, stencil: webgl.GLint): void; - createQuery(): WebGLQuery | null; - deleteQuery(query: WebGLQuery | null): void; - isQuery(query: WebGLQuery | null): webgl.GLboolean; - beginQuery(target: webgl.GLenum, query: WebGLQuery): void; - endQuery(target: webgl.GLenum): void; - getQuery(target: webgl.GLenum, pname: webgl.GLenum): WebGLQuery | null; - getQueryParameter(query: WebGLQuery, pname: webgl.GLenum): any; - createSampler(): WebGLSampler | null; - deleteSampler(sampler: WebGLSampler | null): void; - isSampler(sampler: WebGLSampler | null): webgl.GLboolean; - bindSampler(unit: webgl.GLuint, sampler: WebGLSampler | null): void; - samplerParameteri(sampler: WebGLSampler, pname: webgl.GLenum, param: webgl.GLint): void; - samplerParameterf(sampler: WebGLSampler, pname: webgl.GLenum, param: webgl.GLfloat): void; - getSamplerParameter(sampler: WebGLSampler, pname: webgl.GLenum): any; - fenceSync(condition: webgl.GLenum, flags: webgl.GLbitfield): WebGLSync | null; - isSync(sync: WebGLSync | null): webgl.GLboolean; - deleteSync(sync: WebGLSync | null): void; - clientWaitSync(sync: WebGLSync, flags: webgl.GLbitfield, timeout: GLuint64 ): webgl.GLenum; - waitSync(sync: WebGLSync, flags: webgl.GLbitfield, timeout: GLint64): void; - getSyncParameter(sync: WebGLSync, pname: webgl.GLenum): any; - createTransformFeedback(): WebGLTransformFeedback | null; - deleteTransformFeedback(tf: WebGLTransformFeedback | null): void; - isTransformFeedback(tf: WebGLTransformFeedback | null): webgl.GLboolean; - bindTransformFeedback(target: webgl.GLenum, tf: WebGLTransformFeedback | null): void; - beginTransformFeedback(primitiveMode: webgl.GLenum): void; - endTransformFeedback(): void; - transformFeedbackVaryings(program: webgl.WebGLProgram, varyings: string[], bufferMode: webgl.GLenum): void; - getTransformFeedbackVarying(program: webgl.WebGLProgram, index: webgl.GLuint): webgl.WebGLActiveInfo | null; - pauseTransformFeedback(): void; - resumeTransformFeedback(): void; - bindBufferBase(target: webgl.GLenum, index: webgl.GLuint, buffer: webgl.WebGLBuffer | null): void; - bindBufferRange(target: webgl.GLenum, index: webgl.GLuint, buffer: webgl.WebGLBuffer | null, offset: webgl.GLintptr, size: webgl.GLsizeiptr): void; - getIndexedParameter(target: webgl.GLenum, index: webgl.GLuint): any; - getUniformIndices(program: webgl.WebGLProgram, uniformNames: string[]): webgl.GLuint[] | null; - getActiveUniforms(program: webgl.WebGLProgram, uniformIndices: webgl.GLuint[], pname: webgl.GLenum): any; - getUniformBlockIndex(program: webgl.WebGLProgram, uniformBlockName: string): webgl.GLuint; - getActiveUniformBlockParameter(program: webgl.WebGLProgram, uniformBlockIndex: webgl.GLuint, pname: webgl.GLenum): any; - getActiveUniformBlockName(program: webgl.WebGLProgram, uniformBlockIndex: webgl.GLuint): string | null; - uniformBlockBinding(program: webgl.WebGLProgram, uniformBlockIndex: webgl.GLuint, uniformBlockBinding: webgl.GLuint): void; - createVertexArray(): WebGLVertexArrayObject | null; - deleteVertexArray(vertexArray: WebGLVertexArrayObject | null): void; - isVertexArray(vertexArray: WebGLVertexArrayObject | null): webgl.GLboolean; - bindVertexArray(array: WebGLVertexArrayObject | null): void; -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -interface WebGL2RenderingContextOverloads { - bufferData(target: webgl.GLenum, size: webgl.GLsizeiptr, usage: webgl.GLenum): void; - bufferData(target: webgl.GLenum, srcData: BufferSource | null, usage: webgl.GLenum): void; - bufferSubData(target: webgl.GLenum, dstByteOffset: webgl.GLintptr, srcData: BufferSource): void; - bufferData(target: webgl.GLenum, srcData: ArrayBufferView, usage: webgl.GLenum, srcOffset: webgl.GLuint, length?: webgl.GLuint): void; - bufferSubData(target: webgl.GLenum, dstByteOffset: webgl.GLintptr, srcData: ArrayBufferView, srcOffset: webgl.GLuint, length?: webgl.GLuint): void; - texImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, pixels: ArrayBufferView | null): void; - texImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, source: webgl.TexImageSource): void; - texSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, pixels: ArrayBufferView | null): void; - texSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, source: webgl.TexImageSource): void; - texImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, pboOffset: webgl.GLintptr): void; - texImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, source: webgl.TexImageSource): void; - texImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, border: webgl.GLint, format: webgl.GLenum, type: webgl.GLenum, srcData: ArrayBufferView, srcOffset: webgl.GLuint): void; - texSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, pboOffset: webgl.GLintptr): void; - texSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, source: webgl.TexImageSource): void; - texSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, srcData: ArrayBufferView, srcOffset: webgl.GLuint): void; - compressedTexImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei, border: webgl.GLint, imageSize: webgl.GLsizei, offset: webgl.GLintptr): void; - compressedTexImage2D(target: webgl.GLenum, level: webgl.GLint, internalformat: webgl.GLenum, width: webgl.GLsizei, height: webgl.GLsizei, border: webgl.GLint, srcData: ArrayBufferView, srcOffset?: webgl.GLuint, srcLengthOverride?: webgl.GLuint): void; - compressedTexSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, imageSize: webgl.GLsizei, offset: webgl.GLintptr): void; - compressedTexSubImage2D(target: webgl.GLenum, level: webgl.GLint, xoffset: webgl.GLint, yoffset: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, srcData: ArrayBufferView, srcOffset?: webgl.GLuint, srcLengthOverride?: webgl.GLuint): void; - uniform1fv(location: webgl.WebGLUniformLocation | null, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform2fv(location: webgl.WebGLUniformLocation | null, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform3fv(location: webgl.WebGLUniformLocation | null, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform4fv(location: webgl.WebGLUniformLocation | null, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform1iv(location: webgl.WebGLUniformLocation | null, data: webgl.Int32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform2iv(location: webgl.WebGLUniformLocation | null, data: webgl.Int32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform3iv(location: webgl.WebGLUniformLocation | null, data: webgl.Int32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniform4iv(location: webgl.WebGLUniformLocation | null, data: webgl.Int32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix2fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix3fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - uniformMatrix4fv(location: webgl.WebGLUniformLocation | null, transpose: webgl.GLboolean, data: webgl.Float32List, srcOffset?: webgl.GLuint, srcLength?: webgl.GLuint): void; - readPixels(x: webgl.GLint, y: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, dstData: ArrayBufferView | null): void; - readPixels(x: webgl.GLint, y: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, offset: webgl.GLintptr): void; - readPixels(x: webgl.GLint, y: webgl.GLint, width: webgl.GLsizei, height: webgl.GLsizei, format: webgl.GLenum, type: webgl.GLenum, dstData: ArrayBufferView, dstOffset: webgl.GLuint): void; -} -/** - * WebGL 2.0 - * @see https://www.khronos.org/registry/webgl/specs/latest/2.0/ - * @since 7 - * @syscap SystemCapability.Graphic.Graphic2D.WebGL2 - */ -export interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase { -} diff --git a/build-tools/api_check_plugin/code_style_rule.json b/build-tools/api_check_plugin/code_style_rule.json index 87b1c069f..c836716eb 100644 --- a/build-tools/api_check_plugin/code_style_rule.json +++ b/build-tools/api_check_plugin/code_style_rule.json @@ -308,7 +308,8 @@ "SystemCapability.XTS.DeviceAttest", "SystemCapability.XTS.DeviceAttestLite", "SystemCapability.Base", - "SystemCapability.FileManagement.DistributedFileService.CloudSyncManager" + "SystemCapability.FileManagement.DistributedFileService.CloudSyncManager", + "SystemCapability.MultimodalInput.Input.ShortKey" ] } } \ No newline at end of file diff --git a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt index 55d59281d..f6c9c372b 100644 --- a/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt +++ b/build-tools/api_check_plugin/plugin/dictionaries_supplementary.txt @@ -387,7 +387,7 @@ mah mcc md5 mdns -mdns_err +mdnserror mediaquery meid messageerror diff --git a/build-tools/api_check_plugin/src/check_jsdoc_value/chek_order.js b/build-tools/api_check_plugin/src/check_jsdoc_value/chek_order.js index 2ca0af0ec..a5aa5c5a7 100644 --- a/build-tools/api_check_plugin/src/check_jsdoc_value/chek_order.js +++ b/build-tools/api_check_plugin/src/check_jsdoc_value/chek_order.js @@ -38,7 +38,7 @@ function isAscendingOrder(tags) { // 判断标签是否为官方标签 const firstTag = isOfficialTag(tags[tagIndex].tag); // 非自定义标签在前或数组降序时报错 - if ((firstTag && secondIndex > 1) || firstIndex > secondIndex) { + if ((firstTag && secondIndex > -1) || (firstIndex > secondIndex && secondIndex > -1)) { checkResult = false; break; } diff --git a/build-tools/api_check_plugin/src/check_legality.js b/build-tools/api_check_plugin/src/check_legality.js index cb7eb5fb0..985c203e7 100644 --- a/build-tools/api_check_plugin/src/check_legality.js +++ b/build-tools/api_check_plugin/src/check_legality.js @@ -214,11 +214,13 @@ function checkTagsQuantity(comment, index, errorLogs) { } } +let paramIndex = 0; +let throwsIndex = 0; + function checkTagValue(tag, index, node, fileName, errorLogs) { const { JsDocValueChecker } = require('./check_jsdoc_value/check_rest_value'); const checker = JsDocValueChecker[tag.tag]; - let paramIndex = 0; - let throwsIndex = 0; + if (checker) { let valueCheckResult; if (tag.tag === 'param' && [ts.SyntaxKind.FunctionDeclaration, ts.SyntaxKind.MethodSignature, @@ -261,6 +263,8 @@ function checkJsDocOfCurrentNode(node, sourcefile, permissionConfigPath, fileNam } checkTagValue(tag, index, node, fileName, errorLogs) }); + paramIndex = 0; + throwsIndex = 0; // 标签数量校验 checkTagsQuantity(comment, index, errorLogs); checkInfoMap[index.toString()].illegalTags = checkInfoMap[index.toString()].illegalTags.concat(errorLogs);