Merge branch 'master' of gitee.com:openharmony/interface_sdk-js into master

Signed-off-by: 卢俊鑫 <slzw12138@163.com>
This commit is contained in:
卢俊鑫 2024-06-13 08:13:56 +00:00 committed by Gitee
commit f8ccb005d3
28 changed files with 1082 additions and 118 deletions

View File

@ -8882,7 +8882,7 @@ declare type SizeChangeCallback = (oldValue: SizeOptions, newValue: SizeOptions)
*
* @typedef { function } GestureRecognizerJudgeBeginCallback
* @param { BaseGestureEvent } event - the event information
* @param { GestureRecognizer } currentRecognizer - the current gesture recognizer of the component
* @param { GestureRecognizer } current - the current gesture recognizer of the component
* @param { Array<GestureRecognizer> } recognizers - the gesture recognizers of the component on the response chain
* @returns { GestureJudgeResult } the gesture judge result
* @syscap SystemCapability.ArkUI.ArkUI.Full

View File

@ -738,7 +738,7 @@ declare class NavPathInfo {
*/
declare enum LaunchMode {
/**
* There will always be a new NavDestination created.
* The default mode of stack operation.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
@ -748,7 +748,7 @@ declare enum LaunchMode {
/**
* When the NavDestination with a specified name exists, it will be moved to top of stack,
* otherwise a new NavDestination will be created.
* otherwise, the behavior will be consistent with the STANDARD mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
@ -758,7 +758,7 @@ declare enum LaunchMode {
/**
* When the NavDestination with a specified name exists, the stack will pop until that NavDestination,
* otherwise a new NavDestination will be created.
* otherwise, the behavior will be consistent with the STANDARD mode.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform

View File

@ -3029,8 +3029,47 @@ declare class RichEditorController extends RichEditorBaseController {
* @since 12
*/
getSelection(): RichEditorSelection;
/**
* Convert StyledString to spans in rich editor.
* return a empty Array<RichEditorSpan> if convert failed
*
* @param { StyledString } value - StyledString.
* @returns { Array<RichEditorSpan> }
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
fromStyledString(value: StyledString): Array<RichEditorSpan>;
/**
* Convert spans to StyledString in rich editor.
* return a empty StyledString if convert failed
*
* @param { RichEditorRange } value - range of spans in rich editor
* @returns { StyledString }
* @throws { BusinessError } 401 - The parameter check failed.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
toStyledString(value: RichEditorRange): StyledString;
}
/**
* Defines the types of spans in rich editor.
*
* @typedef { RichEditorImageSpanResult | RichEditorTextSpanResult } RichEditorSpan
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
declare type RichEditorSpan = RichEditorImageSpanResult | RichEditorTextSpanResult;
/**
* Provides Controller for RichEditor with StyledString.
*

View File

@ -1076,7 +1076,7 @@ declare namespace formHost {
* @param { formInfo.PublishFormResult } result - The result of publish form.
* @throws { BusinessError } 201 - Permissions denied.
* @throws { BusinessError } 202 - The application is not a system application.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed.
* @throws { BusinessError } 16500050 - IPC connection error.
* @throws { BusinessError } 16500060 - Service connection error.

View File

@ -1713,7 +1713,7 @@ declare namespace formInfo {
* @since 12
*/
OTHER = -1,
/**
* Form is on the desktop
*
@ -1722,7 +1722,7 @@ declare namespace formInfo {
* @since 12
*/
DESKTOP = 0,
/**
* Form is on the form center.
*
@ -1731,7 +1731,7 @@ declare namespace formInfo {
* @since 12
*/
FORM_CENTER = 1,
/**
* Form is on the form manager.
*
@ -1740,7 +1740,7 @@ declare namespace formInfo {
* @since 12
*/
FORM_MANAGER = 2,
/**
* Form is on the negative screen.
*
@ -1749,7 +1749,7 @@ declare namespace formInfo {
* @since 12
*/
NEGATIVE_SCREEN = 3,
/**
* Form is on the form center of negative screen.
*
@ -1758,7 +1758,7 @@ declare namespace formInfo {
* @since 12
*/
FORM_CENTER_NEGATIVE_SCREEN = 4,
/**
* Form is on the form manager of negative screen.
*
@ -1767,7 +1767,7 @@ declare namespace formInfo {
* @since 12
*/
FORM_MANAGER_NEGATIVE_SCREEN = 5,
/**
* Form is on the screen lock.
*
@ -1776,7 +1776,7 @@ declare namespace formInfo {
* @since 12
*/
SCREEN_LOCK = 6,
/**
* Form is on the ai suggestion.
*

View File

@ -1160,6 +1160,38 @@ declare type ClickEventListenerCallback = (event: ClickEvent, node?: FrameNode)
*/
declare type GestureEventListenerCallback = (event: GestureEvent, node?: FrameNode) => void;
/**
* Defines the PageInfo type.
* The value of routerPageInfo indicates the information of the router page, or undefined if the
* frameNode does not have router page information. And the value of navDestinationInfo indicates
* the information of the navDestination, or undefined if the frameNode does not have navDestination
* information.
*
* @interface PageInfo
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
export interface PageInfo {
/**
* the property of router page information.
*
* @type { ?observer.RouterPageInfo }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 12
*/
routerPageInfo?: observer.RouterPageInfo;
/**
* the property of navDestination information.
*
* @type { ?observer.NavDestinationInfo }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 12
*/
navDestinationInfo?: observer.NavDestinationInfo;
}
/**
* Register callbacks to observe ArkUI behavior.
*
@ -2643,6 +2675,33 @@ export class UIContext {
*/
getFrameNodeByUniqueId(id: number): FrameNode | null;
/**
* Get page information of the frameNode with uniqueId.
*
* @param { number } id - The uniqueId of the target FrameNode.
* @returns { PageInfo } - The page information of the frameNode with the target uniqueId, includes
* navDestination and router page information. If the frame node does not have navDestination and
* router page information, it will return an empty object.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
getPageInfoByUniqueId(id: number): PageInfo;
/**
* Get navigation information of the frameNode with uniqueId.
*
* @param { number } id - The uniqueId of the target FrameNode.
* @returns { observer.NavigationInfo | undefined } - The navigation information of the frameNode with the
* target uniqueId, or undefined if the frameNode is not existed or does not have navigation information.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
getNavigationInfoByUniqueId(id: number): observer.NavigationInfo | undefined;
/**
* Get FocusController.
* @returns { FocusController } the FocusController

View File

@ -0,0 +1,368 @@
/*
* Copyright (C) 2024 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.
*/
/**
* @file Defines FoldSplitContainer component.
* @kit ArkUI
*/
import display from '@ohos.display';
import window from '@ohos.window';
import { Position, Size } from '@ohos.arkui.node';
import { Callback } from '@ohos.base';
/**
* Position enum of the extra region
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export declare enum ExtraRegionPosition {
/**
* The extra region position is in the top.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
TOP = 1,
/**
* The extra region position is in the bottom.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
BOTTOM = 2
}
/**
* The layout options for the container when the foldable screen is expanded.
*
* @interface ExpandedRegionLayoutOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export interface ExpandedRegionLayoutOptions {
/**
* The ratio of the widths of two areas in the horizontal direction.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
horizontalSplitRatio?: number;
/**
* The ratio of the heights of two areas in the vertical direction.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
verticalSplitRatio?: number;
/**
* Does the extended area span from top to bottom within the container?
*
* @type { ?boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
isExtraRegionPerpendicular?: boolean;
/**
* Specify the position of the extra area when the extra area does not vertically span the container.
*
* @type { ?ExtraRegionPosition }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
extraRegionPosition?: ExtraRegionPosition;
}
/**
* The layout options for the container when the foldable screen is in hover mode.
*
* @interface SemiFoldedRegionLayoutOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export interface HoverModeRegionLayoutOptions {
/**
* The ratio of the widths of two areas in the horizontal direction.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
horizontalSplitRatio?: number;
/**
* Does the foldable screen display an extra area when it's in the half-folded state?
*
* @type { ?boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
showExtraRegion?: boolean;
/**
* Specify the position of the extra area when the foldable screen is in the half-folded state.
*
* @type { ?ExtraRegionPosition }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
extraRegionPosition?: ExtraRegionPosition;
}
/**
* The layout options for the container when the foldable screen is folded.
*
* @interface FoldedRegionLayoutOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export interface FoldedRegionLayoutOptions {
/**
* The ratio of the heights of two areas in the vertical direction.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
verticalSplitRatio?: number;
}
/**
* Preset split ratio.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export declare enum PresetSplitRatio {
/**
* 1:1
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
LAYOUT_1V1 = 1,
/**
* 2:3
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
LAYOUT_2V3 = 0.6666666666666666,
/**
* 3:2
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
LAYOUT_3V2 = 1.5
}
/**
* The status of hover mode.
*
* @interface HoverStatus
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export interface HoverModeStatus {
/**
* The fold status of devices.
*
* @type { display.FoldStatus }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
foldStatus: display.FoldStatus;
/**
* Is the app currently in hover mode?
* In hover mode, the upper half of the screen is used for display, and the lower half is used for operation.
*
* @type { boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
isHoverMode: boolean;
/**
* The angle of rotation applied.
*
* @type { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
appRotation: number;
/**
* The status of window.
*
* @type { window.WindowStatusType }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
windowStatusType: window.WindowStatusType;
}
/**
* The handler of onHoverStatusChange event
*
* @typedef { function } OnHoverStatusChangeHandler
* @param { HoverModeStatus } status - The status of hover mode
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
export type OnHoverStatusChangeHandler = (status: HoverModeStatus) => void;
/**
* Defines FoldSplitContainer container.
*
* @interface FoldSplitContainer
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@Component
export declare struct FoldSplitContainer {
/**
* The builder function which will be rendered in the major region of container.
*
* @type { Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@BuilderParam
primary: Callback<void>;
/**
* The builder function which will be rendered in the minor region of container.
*
* @type { Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@BuilderParam
secondary: Callback<void>;
/**
* The builder function which will be rendered in the extra region of container.
*
* @type { ?Callback<void> }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@BuilderParam
extra?: Callback<void>;
/**
* The layout options for the container when the foldable screen is expanded.
*
* @type { ExpandedRegionLayoutOptions }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@Prop
expandedLayoutOptions: ExpandedRegionLayoutOptions;
/**
* The layout options for the container when the foldable screen is in hover mode.
*
* @type { HoverModeRegionLayoutOptions }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@Prop
hoverModeLayoutOptions: HoverModeRegionLayoutOptions;
/**
* The layout options for the container when the foldable screen is folded.
*
* @type { FoldedRegionLayoutOptions }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@Prop
foldedLayoutOptions: FoldedRegionLayoutOptions;
/**
* The animation options of layout
*
* @type { ?(AnimateParam | null) }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
@Prop
animationOptions?: AnimateParam | null;
/**
* The callback function that is triggered when the foldable screen enters or exits hover mode.
* In hover mode, the upper half of the screen is used for display, and the lower half is used for operation.
*
* @type { ?OnHoverStatusChangeHandler }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @atomicservice
* @since 12
*/
onHoverStatusChange?: OnHoverStatusChangeHandler;
}

View File

@ -142,6 +142,22 @@ declare namespace uniformTypeDescriptor {
*/
XML = 'general.xml',
/**
* Xhtml data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
XHTML = 'general.xhtml',
/**
* Rss data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
RSS = 'general.rss',
/**
* Real synchronized multimedia integration language.
*
@ -230,6 +246,14 @@ declare namespace uniformTypeDescriptor {
*/
JAVA_SCRIPT = 'general.java-script',
/**
* Css data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
CSS = 'general.css',
/**
* C header data type.
*
@ -270,6 +294,14 @@ declare namespace uniformTypeDescriptor {
*/
JAVA_SOURCE = 'general.java-source',
/**
* Tex source code data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
TEX = 'general.tex',
/**
* Markdown format.
*
@ -278,6 +310,46 @@ declare namespace uniformTypeDescriptor {
*/
MARKDOWN = 'general.markdown',
/**
* Asc text data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
ASC_TEXT = 'general.asc-text',
/**
* Rich text data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
RICH_TEXT = 'general.rich-text',
/**
* Delimited values text data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
DELIMITED_VALUES_TEXT = 'general.delimited-values-text',
/**
* Comma separated values text data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
COMMA_SEPARATED_VALUES_TEXT = 'general.comma-separated-values-text',
/**
* Tab separated values text data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
TAB_SEPARATED_VALUES_TEXT = 'general.tab-separated-values-text',
/**
* Ebook data type.
*
@ -445,6 +517,14 @@ declare namespace uniformTypeDescriptor {
*/
XBITMAP_IMAGE = 'general.xbitmap-image',
/**
* Gif image format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
GIF = 'general.gif',
/**
* Tagged Graphics (TGA), a type of image format.
*
@ -501,6 +581,46 @@ declare namespace uniformTypeDescriptor {
*/
PPT = 'com.microsoft.powerpoint.ppt',
/**
* Microsoft Word dot data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
WORD_DOT = 'com.microsoft.word.dot',
/**
* Microsoft Powerpoint pps data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
POWERPOINT_PPS = 'com.microsoft.powerpoint.pps',
/**
* Microsoft Powerpoint pot data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
POWERPOINT_POT = 'com.microsoft.powerpoint.pot',
/**
* Microsoft Excel xlt data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
EXCEL_XLT = 'com.microsoft.excel.xlt',
/**
* Microsoft Visio vsd data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
VISIO_VSD = 'com.microsoft.visio.vsd',
/**
* PDF data type.
*
@ -580,6 +700,22 @@ declare namespace uniformTypeDescriptor {
*/
VIDEO_3GPP2 = 'general.3gpp2',
/**
* Ts video format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
TS = 'general.ts',
/**
* Mpegurl video format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MPEGURL_VIDEO = 'general.mpegurl-video',
/**
* Windows WM video format data type.
*
@ -628,6 +764,22 @@ declare namespace uniformTypeDescriptor {
*/
REALMEDIA = 'com.real.realmedia',
/**
* Matroska video format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MATROSKA_VIDEO = 'org.matroska.mkv',
/**
* Flash data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
FLASH = 'com.adobe.flash',
/**
* Audio data type.
*
@ -739,6 +891,46 @@ declare namespace uniformTypeDescriptor {
*/
AIFC_AUDIO = 'general.aifc-audio',
/**
* Mpegurl audio format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MPEGURL_AUDIO = 'general.mpegurl-audio',
/**
* Mpeg-4 audio format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MPEG_4_AUDIO = 'general.mpeg-4-audio',
/**
* Mp2 audio format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MP2 = 'general.mp2',
/**
* Mpeg audio format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MPEG_AUDIO = 'general.mpeg-audio',
/**
* Ulaw audio format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
ULAW_AUDIO = 'general.ulaw-audio',
/**
* Digidesign Sound Designer II audio.
*
@ -755,6 +947,14 @@ declare namespace uniformTypeDescriptor {
*/
REALAUDIO = 'com.real.realaudio',
/**
* Matroska audio format data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
MATROSKA_AUDIO = 'org.matroska.mka',
/**
* File data type.
*
@ -817,6 +1017,30 @@ declare namespace uniformTypeDescriptor {
*/
BZ2_ARCHIVE = 'general.bz2-archive',
/**
* Opg archive data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
OPG = 'general.opg',
/**
* Taz archive data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
TAZ_ARCHIVE = 'general.taz-archive',
/**
* Web archive data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
WEB_ARCHIVE = 'general.web-archive',
/**
* Disk image archive file data type.
*
@ -825,6 +1049,14 @@ declare namespace uniformTypeDescriptor {
*/
DISK_IMAGE = 'general.disk-image',
/**
* Iso data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
ISO = 'general.iso',
/**
* Tar archive data type.
*
@ -905,6 +1137,54 @@ declare namespace uniformTypeDescriptor {
*/
PRESENTATIONML_PRESENTATION = 'org.openxmlformats.presentationml.presentation',
/**
* Office Open XML Drawingml visio.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
DRAWINGML_VISIO = 'org.openxmlformats.drawingml.visio',
/**
* Office Open XML Drawingml template.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
DRAWINGML_TEMPLATE = 'org.openxmlformats.drawingml.template',
/**
* Office Open XML Wordprocessingml template.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
WORDPROCESSINGML_TEMPLATE = 'org.openxmlformats.wordprocessingml.template',
/**
* Office Open XML Presentationml template.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
PRESENTATIONML_TEMPLATE = 'org.openxmlformats.presentationml.template',
/**
* Office Open XML Presentationml slideshow.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
PRESENTATIONML_SLIDESHOW = 'org.openxmlformats.presentationml.slideshow',
/**
* Office Open XML Spreadsheetml template.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
SPREADSHEETML_TEMPLATE = 'org.openxmlformats.spreadsheetml.template',
/**
* Open Document Format for Office Applications.
*
@ -961,6 +1241,22 @@ declare namespace uniformTypeDescriptor {
*/
STUFFIT_ARCHIVE = 'com.allume.stuffit-archive',
/**
* Rar archive.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
RAR_ARCHIVE = 'com.rarlab.rar-archive',
/**
* 7-zip archive.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
SEVEN_ZIP_ARCHIVE = 'org.7-zip.7-zip-archive',
/**
* Calendar data type.
*
@ -1213,7 +1509,31 @@ declare namespace uniformTypeDescriptor {
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
OPENHARMONY_WANT = 'openharmony.want'
OPENHARMONY_WANT = 'openharmony.want',
/**
* Ofd data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
OFD = 'general.ofd',
/**
* Cad data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
CAD = 'general.cad',
/**
* Octet stream data type.
*
* @syscap SystemCapability.DistributedDataManager.UDMF.Core
* @since 12
*/
OCTET_STREAM = 'general.octet-stream'
}
/**

View File

@ -398,7 +398,7 @@ declare namespace deviceSettings {
* @stagemodelonly
* @since 12
*/
function setValue(admin: Want, item: string, value: string): void
function setValue(admin: Want, item: string, value: string): void;
/**
* Gets the device settings value.
@ -419,7 +419,7 @@ declare namespace deviceSettings {
* @stagemodelonly
* @since 12
*/
function getValue(admin: Want, item: string): string
function getValue(admin: Want, item: string): string;
}
export default deviceSettings;

View File

@ -200,7 +200,7 @@ declare namespace restrictions {
* @since 10
*/
function isHdcDisabled(admin: Want): Promise<boolean>;
/**
* Disables the microphone of device.
*

View File

@ -3925,11 +3925,6 @@ declare namespace media {
* @since 12
*/
SPEED_FORWARD_2_00_X = 4,
/**
* playback at 0.5x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
* @since 12
*/
/**
* playback at 0.5x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
@ -3937,11 +3932,6 @@ declare namespace media {
* @since 12
*/
SPEED_FORWARD_0_50_X = 5,
/**
* playback at 1.5x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
* @since 12
*/
/**
* playback at 1.5x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
@ -3949,11 +3939,6 @@ declare namespace media {
* @since 12
*/
SPEED_FORWARD_1_50_X = 6,
/**
* playback at 0.25x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
* @since 12
*/
/**
* playback at 0.25x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
@ -3961,11 +3946,6 @@ declare namespace media {
* @since 12
*/
SPEED_FORWARD_0_25_X = 8,
/**
* playback at 0.125x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer
* @since 12
*/
/**
* playback at 0.125x normal speed
* @syscap SystemCapability.Multimedia.Media.VideoPlayer

View File

@ -755,6 +755,16 @@ declare namespace process {
* @atomicservice
* @since 11
*/
/**
* User Stored Events
*
* @typedef { function } EventListener
* @param { Object } evt - User events
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
type EventListener = (evt: Object) => void;
/**

View File

@ -4957,7 +4957,7 @@ declare namespace request {
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400001 - file operation error.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900004 - application task queue full error.
* @throws { BusinessError } 21900004 - the application task queue is full.
* @throws { BusinessError } 21900005 - task mode error.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
@ -4976,7 +4976,7 @@ declare namespace request {
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400001 - file operation error.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900004 - application task queue full error.
* @throws { BusinessError } 21900004 - the application task queue is full.
* @throws { BusinessError } 21900005 - task mode error.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
@ -5002,7 +5002,7 @@ declare namespace request {
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400001 - file operation error.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900004 - application task queue full error.
* @throws { BusinessError } 21900004 - the application task queue is full.
* @throws { BusinessError } 21900005 - task mode error.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
@ -5021,7 +5021,7 @@ declare namespace request {
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400001 - file operation error.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900004 - application task queue full error.
* @throws { BusinessError } 21900004 - the application task queue is full.
* @throws { BusinessError } 21900005 - task mode error.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
@ -5040,7 +5040,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 11
*/
@ -5055,7 +5055,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
*/
@ -5068,7 +5068,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
* @atomicservice
@ -5085,7 +5085,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
*/
@ -5098,7 +5098,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
* @atomicservice
@ -5114,7 +5114,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
*/
@ -5126,7 +5126,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
* @since 11
@ -5141,7 +5141,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
*/
@ -5153,7 +5153,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
* @since 11
@ -5169,7 +5169,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
*/
@ -5182,7 +5182,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
* @since 11
@ -5198,7 +5198,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @since 10
*/
@ -5211,7 +5211,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type. 3. Parameter verification failed.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @crossplatform
* @since 11
@ -5302,7 +5302,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @systemapi Hide this for inner system use.
* @since 10
@ -5320,7 +5320,7 @@ declare namespace request {
* @throws { BusinessError } 401 - parameter error. Possible causes: 1. Missing mandatory parameters.
* <br>2. Incorrect parameter type.
* @throws { BusinessError } 13400003 - task service ability error.
* @throws { BusinessError } 21900006 - task not found error.
* @throws { BusinessError } 21900006 - task not found.
* @syscap SystemCapability.Request.FileTransferAgent
* @systemapi Hide this for inner system use.
* @since 10

16
api/@ohos.util.d.ts vendored
View File

@ -402,6 +402,14 @@ declare namespace util {
* @crossplatform
* @since 10
*/
/**
* The textDecoder constructor.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
constructor();
/**
@ -1860,6 +1868,14 @@ declare namespace util {
* @crossplatform
* @since 10
*/
/**
* A type used to denote ScopeComparable or number.
*
* @typedef { ScopeComparable | number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 12
*/
type ScopeType = ScopeComparable | number;
/**

View File

@ -30,6 +30,11 @@ declare namespace json {
/**
* The type of conversion result function.
*
* @typedef { function } Transformer
* @param { Object } this - The object to which the parsed key value pair belongs.
* @param { string } key - Attribute name.
* @param { Object } value - The value of the parsed key value pair.
* @returns { Object | undefined | null } Return the modified object or undefined or null.
* @syscap SystemCapability.Utils.Lang
* @since 12
*/

18
api/@ohos.window.d.ts vendored
View File

@ -642,6 +642,24 @@ declare namespace window {
*/
enableNavigationBarAnimation?: boolean;
}
/**
* Properties of status bar, it couldn't update automatically
*
* @interface SystemBarStyle
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @atomicservice
* @since 12
*/
interface SystemBarStyle {
/**
* The content color of the status bar
*
* @syscap SystemCapability.WindowManager.WindowManager.Core
* @since 12
*/
statusBarContentColor?: string;
}
/**
* System bar tint of region

83
api/@ohos.worker.d.ts vendored
View File

@ -137,6 +137,14 @@ export interface Event {
* @crossplatform
* @since 10
*/
/**
* Type of the Event.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
readonly type: string;
/**
@ -152,6 +160,14 @@ export interface Event {
* @crossplatform
* @since 10
*/
/**
* Timestamp(accurate to millisecond) when the event is created.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
readonly timeStamp: number;
}
@ -294,13 +310,13 @@ export interface ErrorEvent extends Event {
}
/**
* @typedef MessageEvent
* @typedef MessageEvent<T>
* Holds the data transferred between worker threads.
* @syscap SystemCapability.Utils.Lang
* @since 7
*/
/**
* @typedef MessageEvent
* @typedef MessageEvent<T>
* Holds the data transferred between worker threads.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
@ -499,6 +515,14 @@ export interface WorkerEventListener {
* @crossplatform
* @since 10
*/
/**
* Type of message, only "message" and "messageerror".
*
* @typedef { 'message' | 'messageerror' }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 12
*/
type MessageType = 'message' | 'messageerror';
/**
@ -622,6 +646,22 @@ export interface WorkerEventTarget {
* @crossplatform
* @since 11
*/
/**
* Adds an event listener to the worker.
*
* @param { string } type - type Type of the event to listen for.
* @param { WorkerEventListener } listener - listener Callback to invoke when an event of the specified type occurs.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200004 - Worker instance is not running.
* @throws { BusinessError } 10200005 - The invoked API is not supported in workers.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
addEventListener(type: string, listener: WorkerEventListener): void;
/**
* Handle the event defined for the worker.
@ -650,6 +690,21 @@ export interface WorkerEventTarget {
* @crossplatform
* @since 10
*/
/**
* Handle the event defined for the worker.
*
* @param { Event } event - event Event to dispatch.
* @returns { boolean }
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200004 - Worker instance is not running.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
dispatchEvent(event: Event): boolean;
/**
* Remove an event defined for the worker.
@ -678,6 +733,21 @@ export interface WorkerEventTarget {
* @crossplatform
* @since 10
*/
/**
* Remove an event defined for the worker.
*
* @param { string } type - type Type of the event for which the event listener is cancelled.
* @param { WorkerEventListener } [callback] - callback Callback of the event listener to remove.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @throws { BusinessError } 10200004 - Worker instance is not running.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
removeEventListener(type: string, callback?: WorkerEventListener): void;
/**
* Remove all event listeners for the worker.
@ -694,6 +764,15 @@ export interface WorkerEventTarget {
* @crossplatform
* @since 10
*/
/**
* Remove all event listeners for the worker.
*
* @throws { BusinessError } 10200004 - Worker instance is not running.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
removeAllListener(): void;
}

View File

@ -1,3 +1,4 @@
将相关文件按规则解析成特定格式,提供处理接口
## 目录
@ -70,19 +71,49 @@
5. getParseEachSince(apiMap)
将接口1、2的树形结构的数据遍历展开进行特殊处理根据since来区分子节点
### check工具
### check工具(线上版本)
[代码](src/coreImpl/checker/local_entry.ts)
提供接口
1. checkEntryLocal(filePath, fileRule, output, excel)
1. checkEntryLocal(filePathArr, fileRuleArr, output, prId, excel)
根据传入的文件路径和检查规则检查文件中存在的规范错误
工具调用命令
```
node --nolazy -r ts-node/register ./src/main.ts -N checkOnline --path 待检查文件路径非build-tools --checker 检查规则 --output 报告输出目录 --excel false
node --nolazy -r ts-node/register ./src/main.ts -N checkOnline --path 待检查文件路径非build-tools --checker 检查规则 --prId 兼容性检查文件路径 --output 报告输出目录 --excel false
```
### check工具线下版本
[代码](src/coreImpl/checker/local_entry.ts)
提供接口
1. checkEntryLocal(filePathArr, fileRuleArr, output, prId, excel)
根据传入的文件路径和检查规则检查文件中存在的规范错误默认生成excel表格默认不执行兼容性变更校验
工具调用命令
```
node --nolazy -r ts-node/register ./src/main.ts -N check
```
### api change check工具
[代码](src/coreImpl/checker/local_entry.ts)
提供接口
1. apiChangeCheckEntryLocal(prId, fileRuleArr, output, excel)
根据传入的文件路径和检查规则检查文件中存在的修改不兼容规范错误
工具调用命令
```
node --nolazy -r ts-node/register ./src/main.ts -N apiChangeCheck --prId 待检查文件路径 --checker 检查规则 --output 报告输出目录 --excel false
```
### diff工具
@ -140,6 +171,7 @@ node --nolazy -r ts-node/register ./src/main.ts -N detection -L 验证标签 -C
-C,--collect-Path `<string>` collect api path (default: "./api")
--path `<string>` check file path
--checker `<string>` check file rule
--prId `<string>` check file change rule
--excel `<string>` check ouput file contain excel
--old `<string>` diff old sdk path (default: "./api")
--new `<string>` diff new sdk path (default: "./api")

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,7 @@ import { SyscapProcessorHelper } from '../coreImpl/diff/syscapFieldProcessor';
import { FunctionUtils } from '../utils/FunctionUtils';
import { ApiCountInfo } from '../typedef/count/ApiCount';
import { ApiCountHelper } from '../coreImpl/count/count'
import { CommonFunctions } from '../utils/checkUtils';
/**
*
@ -328,23 +329,16 @@ function collectApiCallback(apiData: ApiStatisticsInfo[], sheet: ExcelJS.Workshe
* @param { OptionObjType } options
* @return { ToolNameValueType }
*/
function checkApi(options: OptionObjType): ToolNameValueType {
let allApis: FilesMap;
function checkApi(): ToolNameValueType {
try {
let fileContent: ApiResultMessage[] = [];
if (process.env.NODE_ENV === 'development') {
fileContent = LocalEntry.checkEntryLocal([], [], '', 'false');
} else if (process.env.NODE_ENV === 'production') {
}
let finalData: (string | ApiResultMessage)[] = [];
if (options.format === formatType.JSON) {
finalData = [JSON.stringify(fileContent, null, NumberConstant.INDENT_SPACE)];
} else {
finalData = fileContent;
let mdApiFiles: string[] = [];
const filePathTxt: string = path.resolve(FileUtils.getBaseDirName(), '../mdFiles.txt');
if (fs.existsSync(filePathTxt)) {
mdApiFiles = CommonFunctions.getMdFiles(filePathTxt);
}
LocalEntry.checkEntryLocal(mdApiFiles, ['all'], './result.json', 'true');
return {
data: finalData,
data: [],
};
} catch (exception) {
const error = exception as Error;

View File

@ -133,7 +133,7 @@ export class Check {
// tags name check
const tagNamseCheckResult: ErrorTagFormat = TagNameCheck.tagNameCheck(apiJsdoc);
// tags inherit check
const tagInheritCheckResult: ErrorTagFormat = TagInheritCheck.tagInheritCheck(singleApi);
const tagInheritCheckResult: ErrorTagFormat[] = TagInheritCheck.tagInheritCheck(singleApi);
// tags value check
const tagValueCheckResult: ErrorTagFormat[] = TagValueCheck.tagValueCheck(singleApi, apiJsdoc);
// tags repeat check
@ -208,21 +208,24 @@ export class Check {
}
if (!chineseCheckResult.state) {
AddErrorLogs.addAPICheckErrorLogs(
ErrorID.JSDOC_HAS_CHINESE,
ErrorLevel.MIDDLE,
singleApi.getFilePath(),
singleApi.getPos(),
ErrorType.JSDOC_HAS_CHINESE,
LogType.LOG_JSDOC,
toNumber(apiJsdoc.since),
singleApi.getApiName(),
singleApi.getDefinedText(),
chineseCheckResult.errorInfo,
compositiveResult,
compositiveLocalResult
ErrorID.JSDOC_HAS_CHINESE,
ErrorLevel.MIDDLE,
singleApi.getFilePath(),
singleApi.getPos(),
ErrorType.JSDOC_HAS_CHINESE,
LogType.LOG_JSDOC,
toNumber(apiJsdoc.since),
singleApi.getApiName(),
singleApi.getDefinedText(),
chineseCheckResult.errorInfo,
compositiveResult,
compositiveLocalResult
);
}
if (!tagInheritCheckResult.state) {
tagInheritCheckResult.forEach((inheritCheckResult: ErrorTagFormat) => {
if (inheritCheckResult.state !== false) {
return;
}
AddErrorLogs.addAPICheckErrorLogs(
ErrorID.WRONG_SCENE_ID,
ErrorLevel.MIDDLE,
@ -233,11 +236,11 @@ export class Check {
toNumber(apiJsdoc.since),
singleApi.getApiName(),
singleApi.getDefinedText(),
tagInheritCheckResult.errorInfo,
inheritCheckResult.errorInfo,
compositiveResult,
compositiveLocalResult
);
}
});
tagLegalityCheckResult.forEach((legalityResult) => {
if (legalityResult.state !== false) {
return;

View File

@ -432,8 +432,8 @@ export class TagValueCheck {
let paramApiType: string[] = [];
if (singleApi.getApiType() === ApiType.TYPE_ALIAS) {
const typeParams: ParamInfo[] = (singleApi as TypeAliasInfo).getParamInfos();
paramApiName = typeParams.length > paramIndex ? typeParams[paramIndex].getApiName() : '';
const typeParams: TypeParamInfo[] = (singleApi as TypeAliasInfo).getParamInfos();
paramApiName = typeParams.length > paramIndex ? typeParams[paramIndex].getParamName() : '';
paramApiType.push(typeParams.length > paramIndex ? JSON.stringify(typeParams[paramIndex].getParamType()) : '');
} else {
const paramApiInfos: ParamInfo[] = (singleApi as MethodInfo).getParams();

View File

@ -588,7 +588,7 @@ export class NodeProcessorHelper {
false
);
}
propertyInfo.setTypeKind(propertyNode.type ? propertyNode.type.kind : -1);
propertyInfo.setTypeKind(propertyNode.type?.kind);
return propertyInfo;
}
@ -670,7 +670,7 @@ export class NodeProcessorHelper {
paramInfo.setApiName(param.name.getText());
paramInfo.setIsRequired(!param.questionToken ? true : false);
paramInfo.setDefinedText(param.getText());
paramInfo.setParamType(param.type ? param.type.kind : -1);
paramInfo.setParamType(param.type?.kind);
if (param.type === undefined) {
return paramInfo;
}

View File

@ -81,6 +81,14 @@ export enum ErrorLevel {
LOW = 1,
}
export enum ParticularErrorCode {
ERROR_CODE_201 = '201',
ERROR_CODE_202 = '202',
ERROR_CODE_401 = '401',
ERROR_PERMISSION = 'permission',
ERROR_SYSTEMAPI = 'systemapi'
}
/**
* error message infomation
* @enum { string }
@ -107,6 +115,7 @@ export enum ErrorMessage {
ERROR_INFO_VALUE1_THROWS = 'The type of the [$$] [throws] tag is incorrect. Please fill in [BusinessError].',
ERROR_INFO_VALUE2_THROWS = 'The type of the [$$] [throws] tag is incorrect. Please check if the tag value is a numerical value.',
ERROR_INFO_INHERIT = 'It was detected that there is an inheritable label [$$] in the current file, but there are child nodes without this label.',
ERROR_INFO_FOLLOW = 'It was detected that there is a following label [$$] in the current file, but the parent nodes without this label.',
ERROR_ORDER = 'JSDoc label order error, please adjust the order of [$$] labels.',
ERROR_LABELNAME = 'The [$$] tag does not exist. Please use a valid JSDoc tag.',
ERROR_LOST_LABEL = 'JSDoc tag validity verification failed. Please confirm if the [$$] tag is missing.',
@ -131,6 +140,7 @@ export enum ErrorMessage {
ERROR_SMALL_HUMP_NAME = 'This name [$$] should be named by small hump.',
ERROR_SMALL_HUMP_NAME_FILE = 'This API file should be named by small hump.',
ERROR_LARGE_HUMP_NAME_FILE = 'This API file should be named by large hump.',
ERROR_ANONYMOUS_FUNCTION ='Anonymous functions or anonymous object that are not allowed are used in this api.',
ERROR_CHANGES_JSDOC_LEVEL = 'Forbid changes: API defectLevel change to system.',
ERROR_CHANGES_JSDOC_MODEL = 'Forbid changes: API mode change.',
ERROR_CHANGES_JSDOC_CARD = 'Forbid changes: API card delete.',
@ -412,7 +422,7 @@ export class ApiResultMessage {
defectLevel: number = -1;
defectType: string = '';
description: string = '';
language: string = 'ts';
language: string = 'typescript';
mainBuggyCode: string = '';
mainBuggyLine: string = '';

View File

@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import path from 'path';
import path, { ParsedPath } from 'path';
import fs, { Stats } from 'fs';
import { Workbook, Worksheet } from 'exceljs';
import ts, { LineAndCharacter } from 'typescript';
@ -122,8 +122,8 @@ export class GenerateFile {
const apiData: ApiResultInfo = apiCheckArr[i - 1];
sheet.getRow(i + 1).values = [
i,
apiData.getErrorType(),
apiData.getLevel(),
apiData.getErrorType(),
apiData.getLocation(),
apiData.getApiName(),
apiData.getApiFullText(),
@ -248,6 +248,28 @@ export class CommonFunctions {
});
return implementsApiValue;
}
static getMdFiles(url: string) {
const mdFiles: string[] = [];
const content: string = fs.readFileSync(url, 'utf-8');
const filePathArr: string[] = content.split(/[(\r\n)\r\n]+/);
filePathArr.forEach((filePath: string) => {
const pathElements: Set<string> = new Set();
CommonFunctions.splitPath(filePath, pathElements);
if (!pathElements.has('build-tools')) {
mdFiles.push(filePath);
}
});
return mdFiles;
}
static splitPath(filePath: string, pathElements: Set<string>) {
let spliteResult: ParsedPath = path.parse(filePath);
if (spliteResult.base !== '') {
pathElements.add(spliteResult.base);
CommonFunctions.splitPath(spliteResult.dir, pathElements);
}
}
}
/**

View File

@ -101,8 +101,8 @@ export {
CalleeCallback, Caller, CheckPackageHasInstalledOptions, CheckPackageHasInstalledResponse,
ChildProcess, Configuration, ConfigurationConstant, Context, EnvironmentCallback, ErrorCode,
ExtensionAbility, InsightIntentContext, InsightIntentExecutor, OnReleaseCallback, OnRemoteStateChangeCallback,
Package, PermissionRequestResult, Permissions, ServiceExtensionAbility, ShareExtensionAbility, StartOptions,
UIAbility, UIExtensionAbility, UIExtensionContentSession, Want, WantAgent, ability, abilityAccessCtrl,
OpenLinkOptions, Package, PermissionRequestResult, Permissions, ServiceExtensionAbility, ShareExtensionAbility,
StartOptions, UIAbility, UIExtensionAbility, UIExtensionContentSession, Want, WantAgent, ability, abilityAccessCtrl,
abilityManager, appControl, appManager, appRecovery, autoFillManager, autoStartupManager, bundle, bundleManager,
bundleMonitor, bundleResourceManager, businessAbilityRouter, childProcessManager, common, contextConstant,
continuationManager, dataUriUtils, defaultAppManager, dialogRequest, dialogSession, distributedBundle,

11
kits/@kit.ArkUI.d.ts vendored
View File

@ -106,6 +106,14 @@ import SystemRouter, {
} from '@system.router';
import { SymbolGlyphModifier } from '@ohos.arkui.modifier';
import { Colors, CustomColors, Theme, ThemeControl, CustomTheme } from '@ohos.arkui.theme';
import {
ExtraRegionPosition,
ExpandedRegionLayoutOptions,
SemiFoldedRegionLayoutOptions,
FoldedRegionLayoutOptions,
PresetSplitRatio,
FoldSplitContainer,
} from '@ohos.arkui.advanced.FoldSplitContainer';
export {
AddFormMenuItem, AddFormOptions, AlertDialog, Animator, AnimatorOptions, AnimatorResult, App, AppResponse, AtomicServiceBar,
@ -133,5 +141,6 @@ export {
font, inspector, matrix4, mediaquery, performanceMonitor, pluginComponentManager, prompt, promptAction, router,
screen, screenshot, uiAppearance, uiExtensionHost, uiObserver, window, windowAnimationManager, CustomContentDialog,
IconOptions, ChipItemLabelOptions, ChipGroupItemOptions, ChipItemStyle, ChipGroupSpaceOptions, IconItemOptions, IconGroupSuffix, ChipGroup,
SymbolGlyphModifier, Colors, CustomColors, Theme, ThemeControl, CustomTheme, ChipSymbolGlyphOptions
SymbolGlyphModifier, Colors, CustomColors, Theme, ThemeControl, CustomTheme, ChipSymbolGlyphOptions,
ExtraRegionPosition, ExpandedRegionLayoutOptions, SemiFoldedRegionLayoutOptions, FoldedRegionLayoutOptions, PresetSplitRatio, FoldSplitContainer
};