diff --git a/ets2panda/linter/package.json b/ets2panda/linter/package.json index 0db61d9e690e81bfb3983d6627a147f86b7c035b..c31c058543a4800a94179be7fd3ff790f5a91b32 100644 --- a/ets2panda/linter/package.json +++ b/ets2panda/linter/package.json @@ -20,12 +20,13 @@ "pack:linter": "rimraf bundle && mkdir bundle && npm pack && mv panda-tslinter-*.tgz bundle", "pretest": " npm run fix", "test": "npm run test_all && npm run test_ts_import_ets", - "test_all": "npm run testrunner -- -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin,test/deprecatedapi", + "test_all": "npm run testrunner -- -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin,test/deprecatedapi,test/sdkcommonapi", "test_main": "npm run testrunner -- -d test/main", "test_ohmurl": "npm run testrunner -- -d test/ohmurl", "test_interop": "npm run testrunner -- -d test/interop", "test_sdk": "npm run testrunner -- -d test/sdkwhite", "test_deprecatedapi": "npm run testrunner -- -d test/deprecatedapi", + "test_sdkcommonapi": "npm run testrunner -- -d test/sdkcommonapi", "test_concurrent": "npm run testrunner -- -d test/concurrent", "test_rules": "npm run testrunner -- -d test/rules", "test_regression": "npm run testrunner -- -d test/regression", @@ -37,7 +38,7 @@ "test_ts_import_ets": "npm run testrunner -- -d test/ts_import_ets/ts --sdk --interop-mode", "test_migration": "npm run testrunner -- -d test/migration", "testrunner": "npm run compile && node build/testRunner/TestRunner.js", - "update-tests": "node scripts/update-test-results.mjs test/main test/rules test/regression test/extended_features test/ts_import_ets/ts test/migration test/ohmurl test/interop test/sdkwhite test/concurrent test/builtin test/deprecatedapi", + "update-tests": "node scripts/update-test-results.mjs test/main test/rules test/regression test/extended_features test/ts_import_ets/ts test/migration test/ohmurl test/interop test/sdkwhite test/concurrent test/builtin test/deprecatedapi test/sdkcommonapi", "eslint-check": "npx eslint .", "eslint-fix": "npm run eslint-check -- --fix", "prettier-fix": "npx prettier --write .", @@ -45,7 +46,7 @@ "coverage": "npm run coverage-prepare && npm run coverage-instrument && npm run coverage-test && npm run coverage-collect && npm run coverage-report", "coverage-prepare": "npm run build && node scripts/testRunner/coverage_prepare.js", "coverage-instrument": "nyc --compact false instrument build coverage/build_instrument", - "coverage-test": "node coverage/build_instrument/testRunner/TestRunner.js -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin,test/deprecatedapi", + "coverage-test": "node coverage/build_instrument/testRunner/TestRunner.js -d test/main,test/rules,test/regression,test/extended_features,test/migration,test/ohmurl,test/interop,test/sdkwhite,test/concurrent,test/builtin,test/deprecatedapi,test/sdkcommonapi", "coverage-collect": "node scripts/testRunner/coverage_collect.js", "coverage-report": "node scripts/testRunner/coverage_report.js" }, diff --git a/ets2panda/linter/rule-config.json b/ets2panda/linter/rule-config.json index 42df3797287831d8d1d132729a4dd602ef436bc3..e616bfece039b513c807b4025ab081af7a2a8b3b 100644 --- a/ets2panda/linter/rule-config.json +++ b/ets2panda/linter/rule-config.json @@ -117,7 +117,8 @@ "arkui-statestyles-block-need-arrow-func", "arkui-repeat-disable-default-virtualscroll", "arkui-wrapbuilder-require-arrow-func-generic", - "arkui-no-deprecated-api" + "arkui-no-deprecated-api", + "arkui-sdk-common-deprecated-api" ], "builtin": [ "arkts-builtin-thisArgs", diff --git a/ets2panda/linter/src/lib/CookBookMsg.ts b/ets2panda/linter/src/lib/CookBookMsg.ts index e1c85804dd8c93843b2095a13259952d555541d3..b25b4cc8ad706734fe56105ed00f1d7286468010 100644 --- a/ets2panda/linter/src/lib/CookBookMsg.ts +++ b/ets2panda/linter/src/lib/CookBookMsg.ts @@ -390,6 +390,9 @@ cookBookTag[381] = cookBookTag[382] = 'Promiseconstructor only supports using resolve (undefined) (arkts-promise-with-void-type-need-undefined-as-resolve-arg)'; cookBookTag[399] = 'ArkUI deprecated api check (arkui-no-deprecated-api)'; +cookBookTag[400] = 'ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)'; +cookBookTag[401] = 'ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)'; +cookBookTag[402] = 'ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)'; for (let i = 0; i <= cookBookTag.length; i++) { cookBookMsg[i] = ''; diff --git a/ets2panda/linter/src/lib/FaultAttrs.ts b/ets2panda/linter/src/lib/FaultAttrs.ts index 14bc9b8f4b54ce9c112f6fbe835c7aee3974d213..5efdcaedf30ba471db37baedfc45a6cf5b301bf8 100644 --- a/ets2panda/linter/src/lib/FaultAttrs.ts +++ b/ets2panda/linter/src/lib/FaultAttrs.ts @@ -270,3 +270,6 @@ faultsAttrs[FaultID.UnsupportOperator] = new FaultAttributes(378); faultsAttrs[FaultID.StateStylesBlockNeedArrowFunc] = new FaultAttributes(381); faultsAttrs[FaultID.PromiseVoidNeedResolveArg] = new FaultAttributes(382); faultsAttrs[FaultID.NoDeprecatedApi] = new FaultAttributes(399); +faultsAttrs[FaultID.SdkCommonApiDeprecated] = new FaultAttributes(400); +faultsAttrs[FaultID.SdkCommonApiWhiteList] = new FaultAttributes(401); +faultsAttrs[FaultID.SdkCommonApiBehaviorChange] = new FaultAttributes(402); diff --git a/ets2panda/linter/src/lib/FaultDesc.ts b/ets2panda/linter/src/lib/FaultDesc.ts index f55dc3b3a1c6518e62946dfd9f1277739f8729a8..4e59bb856ab4dcc0d335e18db893e695d8578414 100644 --- a/ets2panda/linter/src/lib/FaultDesc.ts +++ b/ets2panda/linter/src/lib/FaultDesc.ts @@ -259,3 +259,6 @@ faultDesc[FaultID.PromiseVoidNeedResolveArg] = 'Promiseconstructor only su faultDesc[FaultID.RepeatDisableVirtualScroll] = '"Repeat" disable default "virtualScroll"'; faultDesc[FaultID.WrappedBuilderGenericNeedArrowFunc] = 'Generic of "WrappedBuilder" does not support parameter list'; faultDesc[FaultID.NoDeprecatedApi] = 'ArkUI deprecated api check'; +faultDesc[FaultID.SdkCommonApiDeprecated] = 'ArkUI sdk common deprecated api check'; +faultDesc[FaultID.SdkCommonApiWhiteList] = 'ArkUI sdk common whiteList api check'; +faultDesc[FaultID.SdkCommonApiBehaviorChange] = 'ArkUI sdk common behavior change api check'; diff --git a/ets2panda/linter/src/lib/Problems.ts b/ets2panda/linter/src/lib/Problems.ts index c39e5ac1c3e25636c2b6452cb46e353d006162c8..3c24fc2f84b2cf6c5ba7a4557f0f80e99a1ddc94 100644 --- a/ets2panda/linter/src/lib/Problems.ts +++ b/ets2panda/linter/src/lib/Problems.ts @@ -259,6 +259,9 @@ export enum FaultID { RepeatDisableVirtualScroll, WrappedBuilderGenericNeedArrowFunc, NoDeprecatedApi, + SdkCommonApiDeprecated, + SdkCommonApiWhiteList, + SdkCommonApiBehaviorChange, // this should always be last enum LAST_ID } diff --git a/ets2panda/linter/src/lib/TypeScriptLinter.ts b/ets2panda/linter/src/lib/TypeScriptLinter.ts index 90024f48809f9e480207510eb1298cec7a954b93..2e409c667fac6048a6b23dd1b950ffac96b4733f 100644 --- a/ets2panda/linter/src/lib/TypeScriptLinter.ts +++ b/ets2panda/linter/src/lib/TypeScriptLinter.ts @@ -126,7 +126,20 @@ import { ApiList, SdkProblem, SdkNameInfo } from './utils/consts/SdkWhitelist'; import * as apiWhiteList from './data/SdkWhitelist.json'; import * as builtinWhiteList from './data/BuiltinList.json'; import * as deprecatedApiList from './data/DeprecatedApiList.json'; -import { DEPRECATE_CHECK_KEY, DEPRECATE_UNNAMED } from './utils/consts/DeprecateWhiteList'; +import * as sdkCommonList from './data/SdkCommonList.json'; +import { + SdkCommonApiProblemInfos, + SDK_COMMON_TRANSFORMER, + SDK_COMMON_CONSTRUCTOR, + SDK_COMMON_VOID, + SDK_COMMON_SYMBOL_ITERATOR, + SDK_COMMON_SYMBOL_ITERATOR_APINAME, + sdkCommonAllDeprecatedFullTypeName, + sdkCommonAllDeprecatedTypeName, + SDK_COMMON_INDEX_CLASS, + SDK_COMMON_BUFFER_API +} from './utils/consts/SdkCommonDeprecateWhiteList'; +import { DeprecateProblem, DEPRECATE_CHECK_KEY, DEPRECATE_UNNAMED } from './utils/consts/DeprecateWhiteList'; import { BuiltinProblem, SYMBOL_ITERATOR, @@ -189,6 +202,10 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { static indexedTypeSet: Set; static globalApiInfo: Map>; static deprecatedApiInfo: Set; + static sdkCommonApiInfo: Set; + static sdkCommonSymbotIterSet: Set; + static sdkCommonAllDeprecatedTypeNameSet: Set; + static sdkCommonIndexClassSet: Map; static symbotIterSet: Set; static missingAttributeSet: Set; static literalAsPropertyNameTypeSet: Set; @@ -202,13 +219,18 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { TypeScriptLinter.pathMap = new Map>(); TypeScriptLinter.globalApiInfo = new Map>(); TypeScriptLinter.deprecatedApiInfo = new Set(); + TypeScriptLinter.sdkCommonApiInfo = new Set(); TypeScriptLinter.funcMap = new Map>>(); TypeScriptLinter.symbotIterSet = new Set(); + TypeScriptLinter.sdkCommonSymbotIterSet = new Set(); + TypeScriptLinter.sdkCommonAllDeprecatedTypeNameSet = new Set(); + TypeScriptLinter.sdkCommonIndexClassSet = new Map(); TypeScriptLinter.missingAttributeSet = new Set(); TypeScriptLinter.initSdkWhitelist(); TypeScriptLinter.initSdkBuiltinInfo(); TypeScriptLinter.initBuiltinlist(); TypeScriptLinter.initDeprecatedApiList(); + TypeScriptLinter.initSdkCommonApilist(); } initSdkInfo(): void { @@ -328,6 +350,26 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } } + private static initSdkCommonApilist(): void { + const list: ApiList = new ApiList(sdkCommonList); + if (list?.api_list?.length > 0) { + for (const item of list.api_list) { + const parent_api_name = item.api_info.parent_api[0].api_name; + if (item.api_info.api_name === SDK_COMMON_SYMBOL_ITERATOR_APINAME) { + TypeScriptLinter.sdkCommonSymbotIterSet.add(item.file_path); + } else if (sdkCommonAllDeprecatedTypeName.has(parent_api_name)) { + TypeScriptLinter.sdkCommonAllDeprecatedTypeNameSet.add(item.file_path); + } else { + this.sdkCommonApiInfo.add(item); + if (SDK_COMMON_INDEX_CLASS.has(parent_api_name)) { + const combinedPaths = [...item.import_path, item.file_path]; + TypeScriptLinter.sdkCommonIndexClassSet.set(parent_api_name, combinedPaths); + } + } + } + } + } + private static initDeprecatedApiList(): void { const list: ApiList = new ApiList(deprecatedApiList); if (list?.api_list?.length > 0) { @@ -4709,6 +4751,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.fixJsImportElementAccessExpression(tsElementAccessExpr); this.checkInterOpImportJsIndex(tsElementAccessExpr); this.checkEnumGetMemberValue(tsElementAccessExpr); + this.handleNoDeprecatedApi(tsElementAccessExpr); } private checkPropertyAccessByIndex( @@ -7952,12 +7995,10 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } else if (ts.isIdentifier(expr)) { this.fixJsImportExtendsClass(node.parent, expr); } - if (ts.isIdentifier(expr)) { - this.handleNoDeprecatedApi(expr); - } }); this.handleMissingSuperCallInExtendedClass(node); + this.handleNoDeprecatedApi(node); } } @@ -8063,14 +8104,25 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (!parent) { return; } - if (ts.isPropertyAccessExpression(parent)) { - const autofix = this.autofixer?.replaceNode(parent, parent.name.text); - this.incrementCounters(node, FaultID.NoNeedStdLibSendableContainer, autofix); - } + const shouldSkipFix = TypeScriptLinter.shouldSkipFixForCollectionsArray(node); + if (shouldSkipFix) { + if (ts.isPropertyAccessExpression(parent)) { + this.incrementCounters(node, FaultID.NoNeedStdLibSendableContainer); + } - if (ts.isQualifiedName(parent)) { - const autofix = this.autofixer?.replaceNode(parent, parent.right.text); - this.incrementCounters(node, FaultID.NoNeedStdLibSendableContainer, autofix); + if (ts.isQualifiedName(parent)) { + this.incrementCounters(node, FaultID.NoNeedStdLibSendableContainer); + } + } else { + if (ts.isPropertyAccessExpression(parent)) { + const autofix = this.autofixer?.replaceNode(parent, parent.name.text); + this.incrementCounters(node, FaultID.NoNeedStdLibSendableContainer, autofix); + } + + if (ts.isQualifiedName(parent)) { + const autofix = this.autofixer?.replaceNode(parent, parent.right.text); + this.incrementCounters(node, FaultID.NoNeedStdLibSendableContainer, autofix); + } } if (ts.isImportSpecifier(parent) && ts.isIdentifier(node)) { @@ -8085,6 +8137,45 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.checkNodeForUsage(node, COLLECTIONS_TEXT, COLLECTIONS_MODULES, cb); } + private static shouldSkipFixForCollectionsArray(node: ts.Node): boolean { + if ( + ts.isNewExpression(node.parent) && + ts.isPropertyAccessExpression(node.parent.expression) && + node.parent.expression.name.text === 'Array' && + node.parent.arguments?.some((arg) => { + return ts.isNumericLiteral(arg) || TypeScriptLinter.isNumberType(arg); + }) + ) { + return true; + } + + let currentNode: ts.Node | undefined = node; + while (currentNode) { + if (ts.isVariableDeclaration(currentNode)) { + const initializer = currentNode.initializer; + if ( + initializer && + ts.isNewExpression(initializer) && + ts.isPropertyAccessExpression(initializer.expression) && + initializer.expression.name.text === 'Array' && + initializer.arguments?.some((arg) => { + return ts.isNumericLiteral(arg) || TypeScriptLinter.isNumberType(arg); + }) + ) { + return true; + } + break; + } + currentNode = currentNode.parent; + } + + return false; + } + + private static isNumberType(node: ts.Node): boolean { + return ts.isNumericLiteral(node); + } + private checkWorkerSymbol(symbol: ts.Symbol, node: ts.Node): void { const cb = (): void => { this.incrementCounters(node, FaultID.NoNeedStdlibWorker); @@ -9402,7 +9493,6 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (set.size === 0 || decl.getText() !== name) { return false; } - const symbol = this.tsUtils.trueSymbolAtLocation(decl); const sourceFile = symbol?.declarations?.[0]?.getSourceFile(); if (!sourceFile) { @@ -9803,20 +9893,20 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { return; } - this.handleExtendCustomClass(node.parent, extendedClassInfo); + this.handleExtendCustomClass(node.parent, extendedClassInfo, identInfo.decl.name?.text + ''); } } private handleExtendCustomClass( classDecl: ts.ClassDeclaration, - extendedClassInfo: Set + extendedClassInfo: Set, + extendedClassName: string ): void { const superCall = TypeScriptLinter.checkIfSuperCallExists(classDecl); if (!superCall) { this.incrementCounters(classDecl, FaultID.MissingSuperCall); return; } - outer: for (const ctorParams of extendedClassInfo) { const matches: boolean[] = []; if (superCall.arguments.length > ctorParams.length) { @@ -9849,6 +9939,9 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { ) { continue; } + if (sdkCommonAllDeprecatedTypeName.has(extendedClassName)) { + this.incrementCounters(superCall, FaultID.SdkCommonApiDeprecated); + } return; } @@ -12371,6 +12464,8 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { | ts.MethodDeclaration | ts.PropertyAssignment | ts.PropertyAccessExpression + | ts.ElementAccessExpression + | ts.HeritageClause ): void { if (!this.options.arkts2) { return; @@ -12379,7 +12474,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { case ts.SyntaxKind.TypeReference: this.checkTypeReferenceForDeprecatedApi(node); break; - case ts.SyntaxKind.Identifier: + case ts.SyntaxKind.HeritageClause: this.checkHeritageClauseForDeprecatedApi(node); break; case ts.SyntaxKind.PropertyDeclaration: @@ -12399,6 +12494,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { case ts.SyntaxKind.CallExpression: case ts.SyntaxKind.BinaryExpression: case ts.SyntaxKind.PropertyAccessExpression: + case ts.SyntaxKind.ElementAccessExpression: this.handleNoDeprecatedApiForExpression(node); break; default: @@ -12406,7 +12502,12 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } handleNoDeprecatedApiForExpression( - node: ts.NewExpression | ts.CallExpression | ts.BinaryExpression | ts.PropertyAccessExpression + node: + | ts.NewExpression + | ts.CallExpression + | ts.BinaryExpression + | ts.PropertyAccessExpression + | ts.ElementAccessExpression ): void { switch (node.kind) { case ts.SyntaxKind.NewExpression: @@ -12421,16 +12522,69 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { case ts.SyntaxKind.PropertyAccessExpression: this.checkPropertyAccessExpressionForDeprecatedApi(node); break; + case ts.SyntaxKind.ElementAccessExpression: + this.checkSdkCommonOnElementAccess(node); + break; default: } } + private checkSdkCommonOnElementAccess(elemAccessExp: ts.ElementAccessExpression): void { + const indexAccess = elemAccessExp.argumentExpression; + if (!indexAccess || !ts.isNumericLiteral(indexAccess)) { + return; + } + let express = elemAccessExp.expression; + if (ts.isNewExpression(elemAccessExp.expression)) { + express = elemAccessExp.expression.expression; + } + const exprSym = this.tsUtils.trueSymbolAtLocation(express); + const exprDecl = TsUtils.getDeclaration(exprSym); + const isCheckNewExpression = exprSym && exprDecl && ts.isNewExpression(elemAccessExp.expression); + if (isCheckNewExpression) { + this.reportForSdkCommonOnElementAccess( + elemAccessExp, + exprSym.name, + path.basename(exprDecl.getSourceFile().fileName) + ); + return; + } + if (!exprDecl || !ts.isVariableDeclaration(exprDecl)) { + return; + } + const initializer = exprDecl.initializer; + + if (!initializer || !ts.isNewExpression(initializer)) { + return; + } + const constructorIdentifier = initializer.expression; + if (!constructorIdentifier || !ts.isIdentifier(constructorIdentifier)) { + return; + } + const decl = this.tsUtils.getDeclarationNode(constructorIdentifier); + this.reportForSdkCommonOnElementAccess( + elemAccessExp, + constructorIdentifier.text, + path.basename(decl?.getSourceFile().fileName + '') + ); + } + + private reportForSdkCommonOnElementAccess(node: ts.Node, importName: string, filePath: string): void { + if (TypeScriptLinter.isImportedFromOhos(importName, filePath)) { + this.incrementCounters(node, FaultID.SdkCommonApiWhiteList); + } + } + private checkTypeReferenceForDeprecatedApi(node: ts.TypeReferenceNode): void { let typeName = node.typeName; if (ts.isQualifiedName(node.typeName)) { typeName = node.typeName.right; } - const decl = this.tsUtils.getDeclarationNode(typeName); + const sym = this.tsUtils.trueSymbolAtLocation(typeName); + const decl = TsUtils.getDeclaration(sym); + if (sym) { + this.hanldeSdkCommonTypeName(node, sym, sym.name, decl); + } if (decl && (ts.isInterfaceDeclaration(decl) || ts.isClassDeclaration(decl))) { let parentName = decl.name ? decl.name.text : 'unnamed'; if (ts.isQualifiedName(node.typeName)) { @@ -12448,6 +12602,7 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { private checkNewExpressionForDeprecatedApi(node: ts.NewExpression): void { const expression = node.expression; + this.checkNewExpressionForSdkCommonApi(node); if (ts.isIdentifier(expression)) { const decl = this.tsUtils.getDeclarationNode(expression); if (decl && ts.isClassDeclaration(decl)) { @@ -12462,16 +12617,119 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } } - private checkHeritageClauseForDeprecatedApi(node: ts.Identifier): void { + private checkNewExpressionForSdkCommonApi(newExpr: ts.NewExpression): void { + const type = this.tsTypeChecker.getTypeAtLocation(newExpr.expression); + const resolvedSignature = this.tsTypeChecker.getResolvedSignature(newExpr); + if (!resolvedSignature) { + return; + } + const constructorDeclaration = resolvedSignature.declaration; + const parentName = type.symbol ? + this.tsTypeChecker.getFullyQualifiedName(type.symbol) : + newExpr.expression.getText(); + if (constructorDeclaration) { + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + parentName, + constructorDeclaration.parameters as ts.NodeArray, + SDK_COMMON_VOID, + path.basename(constructorDeclaration.getSourceFile().fileName + '') + ); + this.processApiNodeDeprecatedApi( + SDK_COMMON_CONSTRUCTOR, + newExpr.expression, + deprecatedApiCheckMap, + undefined, + true + ); + } + } + + private checkHeritageClauseForDeprecatedApi(node: ts.HeritageClause): void { + node.types.forEach((type) => { + let expr = type.expression; + if (ts.isIdentifier(expr)) { + this.checkHeritageClauseForDeprecatedApiOnIdentifier(expr); + } + if (ts.isPropertyAccessExpression(type.expression) && ts.isIdentifier(type.expression.name)) { + expr = type.expression.name; + } + const decl = this.tsUtils.getDeclarationNode(expr); + this.checkHeritageClauseForSdkCommonApiDeprecated(node, decl); + }); + } + + private checkHeritageClauseForSdkCommonApiDeprecated(node: ts.HeritageClause, decl: ts.Node | undefined): void { + if ( + decl && + (ts.isClassDeclaration(decl) || ts.isInterfaceDeclaration(decl)) && + ts.isClassDeclaration(node.parent) + ) { + if (!sdkCommonAllDeprecatedTypeName.has(decl.name?.text + '')) { + return; + } + const getMembers = (type: 'function' | 'property') => { + const isClass = ts.isClassDeclaration(decl); + return type === 'function' ? + isClass ? + decl.members.filter(ts.isFunctionLike) : + decl.members.filter(ts.isMethodSignature) : + isClass ? + decl.members.filter(ts.isPropertyDeclaration) : + decl.members.filter(ts.isPropertySignature); + }; + + const sourceFunctions = node.parent.members.filter(ts.isFunctionLike); + const extendsFunctions = getMembers('function'); + const extendsFunctionNames = new Set( + extendsFunctions. + map((func) => { + return func.name?.getText(); + }). + filter(Boolean) + ); + this.reportUnderCheckAndCountMembers(sourceFunctions, extendsFunctionNames); + const sourceProperties = node.parent.members.filter(ts.isPropertyDeclaration); + const extendsProperties = getMembers('property'); + const extendsPropertyNames = new Set( + extendsProperties. + map((prop) => { + return prop.name?.getText(); + }). + filter(Boolean) + ); + this.reportUnderCheckAndCountMembers(sourceProperties, extendsPropertyNames); + } + } + + private reportUnderCheckAndCountMembers(sourceMembers: ts.Node[], targetNames: Set): void { + sourceMembers.forEach((member) => { + if ( + (ts.isFunctionLike(member) || + ts.isPropertyDeclaration(member) || + ts.isMethodSignature(member) || + ts.isPropertySignature(member)) && + member.name + ) { + const memberName = member.name.getText(); + if (targetNames.has(memberName)) { + this.incrementCounters(member, FaultID.SdkCommonApiDeprecated); + } + } + }); + } + + private checkHeritageClauseForDeprecatedApiOnIdentifier(node: ts.Identifier): void { + const sym = this.tsUtils.trueSymbolAtLocation(node); const decl = this.tsUtils.getDeclarationNode(node); - if (decl && ts.isInterfaceDeclaration(decl)) { + if (decl && (ts.isInterfaceDeclaration(decl) || ts.isClassDeclaration(decl))) { const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( - decl.name.text, + decl.name?.getText() + '', undefined, undefined, path.basename(decl.getSourceFile().fileName + '') ); this.processApiNodeDeprecatedApi(node.getText(), node, deprecatedApiCheckMap); + this.hanldeSdkCommonTypeName(node, sym, decl.name?.getText() + '', decl); } } @@ -12524,36 +12782,95 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { if (!funSymbol && ts.isPropertyAccessExpression(node.expression)) { funSymbol = this.tsTypeChecker.getSymbolAtLocation(node.expression.expression); } + const isNeedGetResolvedSignature = funSymbol?.declarations && funSymbol.declarations.length > 1; const decl = TsUtils.getDeclaration(funSymbol); const parName = this.tsUtils.getParentSymbolName(funSymbol); + this.handleCallExpressionBufferIndexOf(node, name, parName + '', funSymbol, decl); + const deprecatedApiCheckMap = TypeScriptLinter.getDeprecatedApiCheckMapForCallExpression(decl, parName); + this.reportDeprecatedApi(node, name, deprecatedApiCheckMap); + this.checkCallExpressionForSdkCommonApi(node, name, parName, !!isNeedGetResolvedSignature, deprecatedApiCheckMap); + this.checkSpecialApiForDeprecatedApi(node, name, decl); + } + + private static getDeprecatedApiCheckMapForCallExpression( + decl: ts.Node | undefined, + parName: string | undefined + ): Map> | undefined { if (decl && (ts.isFunctionLike(decl) || ts.isVariableDeclaration(decl))) { - const returnType = decl.type?.getText() === undefined ? 'any' : decl.type?.getText() + ''; const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( parName === undefined ? DEPRECATE_UNNAMED : parName + '', ts.isFunctionLike(decl) ? decl.parameters : undefined, - returnType, + decl.type?.getText() === undefined ? 'any' : decl.type?.getText() + '', path.basename(decl.getSourceFile().fileName) ); - this.reportDeprecatedApi(node, name, deprecatedApiCheckMap); + return deprecatedApiCheckMap; + } + return undefined; + } + + private checkCallExpressionForSdkCommonApi( + node: ts.CallExpression, + name: ts.Identifier, + parName: string | undefined, + isNeedGetResolvedSignature: boolean, + deprecatedApiCheckMap: Map> | undefined + ): void { + if (isNeedGetResolvedSignature) { + this.checkCallExpressionForSdkCommonApiWithSignature(node, name, parName); + } else { + this.reportDeprecatedApi(node, name, deprecatedApiCheckMap, true); } - this.checkSpecialApiForDeprecatedApi(node, name, decl); + } + + private checkCallExpressionForSdkCommonApiWithSignature( + node: ts.CallExpression, + name: ts.Identifier, + parName: string | undefined + ): void { + const signature = this.tsTypeChecker.getResolvedSignature(node); + if (!signature?.declaration) { + return; + } + const functionSymbol = this.getFunctionSymbol(signature.declaration); + const functionDeclaration = functionSymbol?.valueDeclaration; + if (!functionDeclaration) { + return; + } + const returnType = this.tsTypeChecker.typeToString(signature.getReturnType()); + const deprecatedApiCheckMap = TypeScriptLinter.updateDeprecatedApiCheckMap( + parName === undefined ? '' : parName + '', + TypeScriptLinter.getParameterDeclarationsBySignature(signature), + returnType, + path.basename(functionDeclaration.getSourceFile().fileName) + ); + this.reportDeprecatedApi(node, name, deprecatedApiCheckMap, true); } private reportDeprecatedApi( node: ts.CallExpression, name: ts.Identifier, - deprecatedApiCheckMap?: Map> + deprecatedApiCheckMap?: Map>, + isSdkCommon?: boolean ): void { - const isMatched = this.isMatchedDeprecatedApi(name.text, deprecatedApiCheckMap); - if (isMatched) { + const problemStr = this.getFaultIdWithMatchedDeprecatedApi(name.text, deprecatedApiCheckMap, isSdkCommon); + if (problemStr.length > 0) { const autofix = this.autofixer?.fixDeprecatedApiForCallExpression(node); if (autofix) { this.interfacesNeedToImport.add('getUIContext'); } - this.incrementCounters(name, FaultID.NoDeprecatedApi, autofix); + this.incrementCounters( + name, + isSdkCommon ? TypeScriptLinter.getFinalSdkFaultIdByProblem(problemStr) : FaultID.NoDeprecatedApi, + isSdkCommon ? undefined : autofix + ); } } + private static getFinalSdkFaultIdByProblem(problem: string): number { + const sdkFaultId = SdkCommonApiProblemInfos.get(problem); + return sdkFaultId ? sdkFaultId : FaultID.SdkCommonApiWhiteList; + } + private checkSpecialApiForDeprecatedApi( node: ts.CallExpression, name: ts.Identifier, @@ -12643,12 +12960,20 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { this.processApiNodeDeprecatedApi( expression.getText(), expression, - TypeScriptLinter.getPropertyTypeForPropertyAssignment(node, contextualType) + this.getPropertyTypeForPropertyAssignment(node, contextualType) + ); + this.processApiNodeDeprecatedApi( + expression.getText(), + expression, + this.getPropertyTypeForPropertyAssignment(node, contextualType, true), + undefined, + true ); } } private checkPropertyAccessExpressionForDeprecatedApi(node: ts.PropertyAccessExpression): void { + this.handleSymbolIteratorForSdkCommon(node); node.forEachChild((expression) => { if (!ts.isIdentifier(expression)) { return; @@ -12656,14 +12981,8 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { const funSymbol = this.tsUtils.trueSymbolAtLocation(expression); const decl = TsUtils.getDeclaration(funSymbol); let parName = this.tsUtils.getParentSymbolName(funSymbol); - if ( - decl && - (ts.isPropertyDeclaration(decl) || - ts.isPropertySignature(decl) || - ts.isEnumMember(decl) || - ts.isEnumDeclaration(decl)) && - decl.parent - ) { + this.hanldeSdkCommonTypeName(expression, funSymbol, parName ? parName : expression.text, decl); + if (decl && TypeScriptLinter.checkIsAccordWithNode(decl)) { let returnType: string | undefined = this.tsTypeChecker.typeToString( this.tsTypeChecker.getTypeAtLocation(decl) ); @@ -12682,10 +13001,125 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { path.basename(decl.getSourceFile().fileName) ); this.processApiNodeDeprecatedApi(expression.text, expression, deprecatedApiCheckMap); + this.processApiNodeDeprecatedApi(expression.text, expression, deprecatedApiCheckMap, undefined, true); } }); } + private static checkIsAccordWithNode(decl: ts.Node): boolean { + return ( + ts.isPropertyDeclaration(decl) || + ts.isPropertySignature(decl) || + ts.isEnumMember(decl) || + ts.isEnumDeclaration(decl) + ); + } + + private hanldeSdkCommonTypeName( + node: ts.Node, + symbol: ts.Symbol | undefined, + parentName: string, + decl?: ts.Declaration | undefined + ): void { + const filePath = decl?.getSourceFile().fileName; + const isParentNameMatch = + sdkCommonAllDeprecatedFullTypeName.has(symbol?.name + '') || sdkCommonAllDeprecatedFullTypeName.has(parentName); + const newFilePath = TypeScriptLinter.getApiPathFromFullPath(filePath + ''); + const isFilePathMatch = TypeScriptLinter.sdkCommonAllDeprecatedTypeNameSet.has(newFilePath); + const isMatch = isParentNameMatch && isFilePathMatch; + if (isMatch || TypeScriptLinter.isJsonTransformer(decl)) { + this.incrementCounters(node, FaultID.SdkCommonApiDeprecated); + } + } + + private handleCallExpressionBufferIndexOf( + callExpr: ts.CallExpression, + node: ts.Node, + parentName: string, + symbol?: ts.Symbol, + decl?: ts.Declaration + ): void { + if (!symbol || !decl) { + return; + } + + const isIndexOfWithEmptyString = TypeScriptLinter.checkIsIndexOfWithEmptyString(callExpr); + if (!isIndexOfWithEmptyString) { + return; + } + const isNameMatch = symbol.name === SDK_COMMON_BUFFER_API.indexof && parentName === SDK_COMMON_BUFFER_API.full_api; + const isPathMatch = TypeScriptLinter.isImportedFromOhos( + SDK_COMMON_BUFFER_API.apiName, + path.basename(decl.getSourceFile().fileName) + ); + if (isNameMatch && isPathMatch) { + this.incrementCounters(node, FaultID.SdkCommonApiBehaviorChange); + } + } + + private static checkIsIndexOfWithEmptyString(callExpr: ts.CallExpression): boolean { + const isIndexOfCall = + ts.isPropertyAccessExpression(callExpr.expression) && + SDK_COMMON_BUFFER_API.indexof === callExpr.expression.name.text; + const hasEmptyStringArgument = + callExpr.arguments.length === 1 && ts.isStringLiteral(callExpr.arguments[0]) && callExpr.arguments[0].text === ''; + + const hasNoArguments = callExpr.arguments.length === 0; + + return isIndexOfCall && (hasEmptyStringArgument || hasNoArguments); + } + + private static isJsonTransformer(decl: ts.Declaration | undefined): boolean { + if ( + decl && + ts.isTypeAliasDeclaration(decl) && + ts.isFunctionTypeNode(decl.type) && + decl.name.getText() === SDK_COMMON_TRANSFORMER + ) { + return decl.type.parameters.length > 0 && decl.type.parameters[0].name.getText() === 'this'; + } + return false; + } + + private handleSymbolIteratorForSdkCommon(decl: ts.PropertyAccessExpression): boolean { + if ( + this.checkPropertyAccessExpressionForSdkCommonSymbotIter( + decl, + SDK_COMMON_SYMBOL_ITERATOR, + TypeScriptLinter.sdkCommonSymbotIterSet + ) + ) { + this.incrementCounters(decl, FaultID.SdkCommonApiWhiteList); + return true; + } + return false; + } + + private checkPropertyAccessExpressionForSdkCommonSymbotIter( + node: ts.PropertyAccessExpression, + name: string, + set: Set + ): boolean { + if (set.size === 0 || node.getText() !== name) { + return false; + } + if (node.parent && ts.isElementAccessExpression(node.parent)) { + let decl = this.tsUtils.getDeclarationNode(node.parent.expression); + if (decl && ts.isVariableDeclaration(decl) && decl.initializer && ts.isNewExpression(decl.initializer)) { + decl = this.tsUtils.getDeclarationNode(decl.initializer.expression); + } + + const fileName = TypeScriptLinter.getApiPathFromFullPath(decl?.getSourceFile().fileName + ''); + return set.has(fileName); + } + return false; + } + + private static getApiPathFromFullPath(fullPath: string): string { + const regex = /api[\\/](.*)$/; + return fullPath.match(regex)?.[1] ? `api/${fullPath.match(regex)?.[1]}` : ''; + } + private checkPropertyDeclarationForDeprecatedApi(node: ts.PropertyDeclaration): void { const expression = node.name; if (ts.isIdentifier(expression)) { @@ -12697,34 +13131,47 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { apiName: string, errorNode: ts.Node, deprecatedApiCheckMap?: Map>, - autofix?: Autofix[] + autofix?: Autofix[], + isSdkCommon?: boolean ): void { - const matchedApi = this.isMatchedDeprecatedApi(apiName, deprecatedApiCheckMap); - if (matchedApi) { - this.incrementCounters(errorNode, FaultID.NoDeprecatedApi, autofix); + const problemStr = this.getFaultIdWithMatchedDeprecatedApi(apiName, deprecatedApiCheckMap, isSdkCommon); + if (problemStr.length > 0) { + this.incrementCounters( + errorNode, + isSdkCommon ? TypeScriptLinter.getFinalSdkFaultIdByProblem(problemStr) : FaultID.NoDeprecatedApi, + isSdkCommon ? undefined : autofix + ); } } - private isMatchedDeprecatedApi( + private getFaultIdWithMatchedDeprecatedApi( apiName: string, - deprecatedApiCheckMap?: Map> - ): boolean { + deprecatedApiCheckMap?: Map>, + isSdkCommon?: boolean + ): string { void this; - const setApiListItem = TypeScriptLinter.deprecatedApiInfo; + let setApiListItem = TypeScriptLinter.deprecatedApiInfo; + if (isSdkCommon) { + setApiListItem = TypeScriptLinter.sdkCommonApiInfo; + } if (!setApiListItem || !deprecatedApiCheckMap) { - return false; + return ''; } const apiNamesArr = [...setApiListItem]; - const matchedApi = apiNamesArr.some((apiInfoItem) => { + let problem = ''; + apiNamesArr.some((apiInfoItem) => { if (apiInfoItem.api_info.parent_api?.length <= 0) { return false; } let isSameApi = apiInfoItem.api_info.api_name === apiName; - isSameApi &&= - apiInfoItem.api_info.parent_api[0].api_name === deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.PARENT_NAME); - isSameApi &&= - this.normalizeTypeString(apiInfoItem.api_info.method_return_type) === - this.normalizeTypeString(deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.RETURN_TYPE)); + isSameApi &&= TypeScriptLinter.checkParentNameUnderSdkList( + apiInfoItem, + deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.PARENT_NAME) + '', + isSdkCommon + ); + const return_type = this.getReturnTypeByApiInfoItem(apiInfoItem, isSdkCommon); + const actual_return_type = this.normalizeTypeString(deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.RETURN_TYPE)); + isSameApi &&= return_type === actual_return_type; const api_func_args = apiInfoItem.api_info.api_func_args; const params = deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.PARAM_SET); if (api_func_args && params) { @@ -12736,30 +13183,74 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } const fileName = deprecatedApiCheckMap?.get(DEPRECATE_CHECK_KEY.FILE_NAME) + ''; const isSameFile = fileName.endsWith(path.basename(apiInfoItem.file_path)); - return isSameFile && isSameApi; + const res = isSameApi && isSameFile; + if (res) { + problem = isSdkCommon ? apiInfoItem.api_info.problem : DeprecateProblem.NoDeprecatedApi; + } + return res; }); - return matchedApi; + return problem; + } + + private getReturnTypeByApiInfoItem( + apiInfoItem: ApiListItem, + isSdkCommon: boolean | undefined + ): string | ts.NodeArray | undefined { + let return_type = this.normalizeTypeString(apiInfoItem.api_info.method_return_type); + if (isSdkCommon) { + return_type = apiInfoItem.api_info.method_return_type ? + this.normalizeTypeString(apiInfoItem.api_info.method_return_type) : + this.normalizeTypeString(apiInfoItem.api_info.api_property_type); + } + return return_type; + } + + private static checkParentNameUnderSdkList( + apiInfoItem: ApiListItem, + sourceParentName: string, + isSdkCommon?: boolean + ): boolean { + const parentApis = apiInfoItem.api_info.parent_api; + const possibleNames: string[] = []; + const primaryParentName = parentApis[0]?.api_name || ''; + + if (primaryParentName) { + possibleNames.push(primaryParentName); + if (!!isSdkCommon && parentApis.length > 1) { + const secondaryParentName = parentApis[1]?.api_name || ''; + possibleNames.push(`${secondaryParentName}.${primaryParentName}`); + } + } + return possibleNames.includes(sourceParentName); } - private static getPropertyTypeForPropertyAssignment( + private getPropertyTypeForPropertyAssignment( propertyAssignment: ts.PropertyAssignment, - contextualType: ts.Type + contextualType: ts.Type, + isSdkCommon?: boolean ): Map> | undefined { const propertyName = propertyAssignment.name.getText(); if (contextualType.isUnion()) { for (const type of contextualType.types) { - const deprecatedApiCheckMap = TypeScriptLinter.getPropertyInfoByContextualType(type, propertyName); + const deprecatedApiCheckMap = this.getPropertyInfoByContextualType( + type, + propertyName, + propertyAssignment, + isSdkCommon + ); if (deprecatedApiCheckMap) { return deprecatedApiCheckMap; } } } - return TypeScriptLinter.getPropertyInfoByContextualType(contextualType, propertyName); + return this.getPropertyInfoByContextualType(contextualType, propertyName, propertyAssignment, isSdkCommon); } - private static getPropertyInfoByContextualType( + private getPropertyInfoByContextualType( type: ts.Type, - propertyName: string + propertyName: string, + node: ts.Node, + isSdkCommon?: boolean ): Map> | undefined { const propertySymbol = type.getProperty(propertyName); if (!propertySymbol) { @@ -12774,6 +13265,9 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { propertyDecl.type.getText(), path.basename(propertyDecl.getSourceFile().fileName + '') ); + if (isSdkCommon) { + this.hanldeSdkCommonTypeName(node, type.getSymbol(), type.getSymbol()?.name + '', propertyDecl); + } } return deprecatedApiCheckMap; } @@ -12838,4 +13332,27 @@ export class TypeScriptLinter extends BaseTypeScriptLinter { } return true; } + + private static getParameterDeclarationsBySignature(signature: ts.Signature): ts.NodeArray { + const validParameters = signature.parameters. + map((paramSymbol) => { + const declarations = paramSymbol.getDeclarations(); + const paramDeclaration = declarations?.[0]; + return paramDeclaration && ts.isParameter(paramDeclaration) ? paramDeclaration : undefined; + }). + filter((param): param is ts.ParameterDeclaration => { + return param !== undefined; + }); + return ts.factory.createNodeArray(validParameters); + } + + private static isImportedFromOhos(importName: string, filePath: string): boolean { + const classPaths = TypeScriptLinter.sdkCommonIndexClassSet.get(importName); + return ( + !!classPaths && + classPaths.some((p) => { + return path.basename(p) === filePath; + }) + ); + } } diff --git a/ets2panda/linter/src/lib/data/SdkCommonList.json b/ets2panda/linter/src/lib/data/SdkCommonList.json new file mode 100644 index 0000000000000000000000000000000000000000..d13d239b9a745427697527448d2f3df29c07a081 --- /dev/null +++ b/ets2panda/linter/src/lib/data/SdkCommonList.json @@ -0,0 +1,6450 @@ +{ + "api_list": [ + { + "file_path": "api/@ohos.util.ArrayList.d.ts", + "api_info": { + "line": 858, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "ArrayList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.ArrayList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.ArrayList.d.ts", + "api_info": { + "line": 858, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, arrlist?: ArrayList) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "ArrayList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.ArrayList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.ArrayList.d.ts", + "api_info": { + "line": 858, + "problem": "WhiteList", + "api_name": "replaceAllElements", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, arrlist?: ArrayList) => T", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "ArrayList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.ArrayList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.ArrayList.d.ts", + "api_info": { + "line": 858, + "problem": "BehaviorChange", + "api_name": "sort", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "comparator", + "type": "(firstValue: T, secondValue: T) => number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "ArrayList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.ArrayList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@arkts.collections.d.ts", + "api_info": { + "line": 12151, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "BitVector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@arkts.collections", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Deque.d.ts", + "api_info": { + "line": 375, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Deque", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Deque", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Deque.d.ts", + "api_info": { + "line": 375, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, deque?: Deque) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Deque", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Deque", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.HashMap.d.ts", + "api_info": { + "line": 551, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "HashMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.HashMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.HashMap.d.ts", + "api_info": { + "line": 551, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value?: V, key?: K, map?: HashMap) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "HashMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.HashMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.HashSet.d.ts", + "api_info": { + "line": 551, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "HashSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.HashSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.HashSet.d.ts", + "api_info": { + "line": 551, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value?: T, key?: T, set?: HashSet) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "HashSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.HashSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LightWeightMap.d.ts", + "api_info": { + "line": 760, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LightWeightMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LightWeightMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LightWeightMap.d.ts", + "api_info": { + "line": 760, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value?: V, key?: K, map?: LightWeightMap) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LightWeightMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LightWeightMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LightWeightSet.d.ts", + "api_info": { + "line": 512, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LightWeightSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LightWeightSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LightWeightSet.d.ts", + "api_info": { + "line": 512, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value?: T, key?: T, set?: LightWeightSet) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LightWeightSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LightWeightSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LinkedList.d.ts", + "api_info": { + "line": 512, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LinkedList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LinkedList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LinkedList.d.ts", + "api_info": { + "line": 512, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, LinkedList?: LinkedList) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LinkedList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LinkedList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LinkedList.d.ts", + "api_info": { + "line": 512, + "problem": "BehaviorChange", + "api_name": "removeFirstFound", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LinkedList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LinkedList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.LinkedList.d.ts", + "api_info": { + "line": 512, + "problem": "BehaviorChange", + "api_name": "removeLastFound", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LinkedList", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.LinkedList", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.List.d.ts", + "api_info": { + "line": 848, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "List", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.List", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.List.d.ts", + "api_info": { + "line": 848, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, List?: List) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "List", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.List", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.List.d.ts", + "api_info": { + "line": 848, + "problem": "WhiteList", + "api_name": "replaceAllElements", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, list?: List) => T", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "List", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.List", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.PlainArray.d.ts", + "api_info": { + "line": 848, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "PlainArray", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator<[number, T]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.PlainArray", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.PlainArray.d.ts", + "api_info": { + "line": 848, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, PlainArray?: PlainArray) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "PlainArray", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.PlainArray", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Queue.d.ts", + "api_info": { + "line": 266, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Queue", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Queue", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Queue.d.ts", + "api_info": { + "line": 266, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, Queue?: Queue) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Queue", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Queue", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Queue.d.ts", + "api_info": { + "line": 266, + "problem": "WhiteList", + "api_name": "add", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Queue", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Queue", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Stack.d.ts", + "api_info": { + "line": 266, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Stack", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Stack", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Stack.d.ts", + "api_info": { + "line": 266, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, stack?: Stack) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Stack", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Stack", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.TreeMap.d.ts", + "api_info": { + "line": 760, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "TreeMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.TreeMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.TreeMap.d.ts", + "api_info": { + "line": 760, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value?: V, key?: K, map?: TreeMap) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TreeMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.TreeMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.TreeMap.d.ts", + "api_info": { + "line": 760, + "problem": "BehaviorChange", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "comparator", + "type": "(firstValue: K, secondValue: K) => boolean", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TreeMap", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util.TreeMap", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.TreeSet.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "TreeSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.TreeSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.TreeSet.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value?: T, key?: T, set?: TreeSet) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TreeSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.TreeSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.TreeSet.d.ts", + "api_info": { + "line": 89, + "problem": "BehaviorChange", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "comparator", + "type": "(firstValue: T, secondValue: T) => boolean", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TreeSet", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util.TreeSet", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator<[string, string]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getAll", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string[]", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "append", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "delete", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "entries", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator<[string, string]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: string, key: string, searchParams: URLSearchParams) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "get", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string | null", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "get", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string[]", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "has", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "set", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "name", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "keys", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "values", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "toString", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "sort", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "init", + "type": "string[][] | Record | string | URLSearchParams", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: string, key: string, searchParams: URLParams) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLSearchParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "put", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "V", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "V", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "capacity", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "updateCapacity", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "newCapacity", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "getCapacity", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "getCreateCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "getMissCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "getRemovalCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "getMatchCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "getPutCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getPutCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "length", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "LRUCache", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "number", + "code_kind": 171 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.json.d.ts", + "api_info": { + "line": 59, + "problem": "WhiteList", + "api_name": "parse", + "api_type": "FunctionDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "text", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "reviver", + "type": "Transformer", + "is_optional": true, + "has_default": false + }, + { + "name": "options", + "type": "ParseOptions", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "json", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Object | null", + "code_kind": 263 + }, + "import_path": [ + "@ohos.util.json" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.json.d.ts", + "api_info": { + "line": 42, + "problem": "WhiteList", + "api_name": "Transformer", + "api_type": "TypeAliasDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "this", + "type": "Object", + "is_optional": false, + "has_default": false + }, + { + "name": "key", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "json", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Object | undefined | null", + "code_kind": 268 + }, + "import_path": [ + "@ohos.util.json" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.json.d.ts", + "api_info": { + "line": 59, + "problem": "WhiteList", + "api_name": "remove", + "api_type": "FunctionDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "obj", + "type": "object", + "is_optional": false, + "has_default": false + }, + { + "name": "property", + "type": "string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "json", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 263 + }, + "import_path": [ + "@ohos.util.json" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isArgumentsObject", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isGeneratorFunction", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isGeneratorFunction", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isGeneratorObject", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isModuleNamespaceObject", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isProxy", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 3585, + "problem": "WhiteList", + "api_name": "isSymbolObject", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "Object", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "types", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 4701, + "problem": "WhiteList", + "api_name": "addAfter", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "targetClass", + "type": "Object", + "is_optional": false, + "has_default": false + }, + { + "name": "methodName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "isStatic", + "type": "boolean", + "is_optional": false, + "has_default": false + }, + { + "name": "after", + "type": "Function", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Aspect", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 4667, + "problem": "WhiteList", + "api_name": "addBefore", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "targetClass", + "type": "Object", + "is_optional": false, + "has_default": false + }, + { + "name": "methodName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "isStatic", + "type": "boolean", + "is_optional": false, + "has_default": false + }, + { + "name": "before", + "type": "Function", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Aspect", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 4773, + "problem": "WhiteList", + "api_name": "replace", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "targetClass", + "type": "Object", + "is_optional": false, + "has_default": false + }, + { + "name": "methodName", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "isStatic", + "type": "boolean", + "is_optional": false, + "has_default": false + }, + { + "name": "instead", + "type": "Function", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Aspect", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 992, + "problem": "BehaviorChange", + "api_name": "href", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "URL", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 171 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 992, + "problem": "BehaviorChange", + "api_name": "href", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "URL", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 171 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 992, + "problem": "BehaviorChange", + "api_name": "origin", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "URL", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 171 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 992, + "problem": "BehaviorChange", + "api_name": "pathname", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "URL", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 171 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 1143, + "problem": "BehaviorChange", + "api_name": "search", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "URL", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 171 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 1143, + "problem": "WhiteList", + "api_name": "searchParams", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "URL", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "URLSearchParams", + "code_kind": 171 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.url.d.ts", + "api_info": { + "line": 283, + "problem": "BehaviorChange", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "init", + "type": "string[][] | Record | string | URLParams", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "URLParams", + "api_type": "ClassDeclaration" + }, + { + "api_name": "url", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.url", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "lib.es5.d.ts", + "api_info": { + "line": 1139, + "problem": "WhiteList", + "api_name": "stringify", + "api_type": "MethodSignature", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "any", + "is_optional": false, + "has_default": false + }, + { + "name": "replacer", + "type": "(this: any, key: string, value: any) => any", + "is_optional": true, + "has_default": false + }, + { + "name": "space", + "type": "string | number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "JSON", + "api_type": "InterfaceDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 173 + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "lib.es5.d.ts", + "api_info": { + "line": 1139, + "problem": "WhiteList", + "api_name": "stringify", + "api_type": "MethodSignature", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "any", + "is_optional": false, + "has_default": false + }, + { + "name": "replacer", + "type": "(number | string)[] | null", + "is_optional": true, + "has_default": false + }, + { + "name": "space", + "type": "string | number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "JSON", + "api_type": "InterfaceDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 173 + }, + "import_path": [], + "is_global": true + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "slice", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "start", + "type": "number", + "is_optional": true, + "has_default": false + }, + { + "name": "end", + "type": "number", + "is_optional": true, + "has_default": false + }, + { + "name": "type", + "type": "string", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Blob", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Blob", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readInt8", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readInt16BE", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readInt16LE", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readInt32BE", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readInt32LE", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readIntBE", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "byteLength", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.buffer.d.ts", + "api_info": { + "line": 3388, + "problem": "BehaviorChange", + "api_name": "readIntLE", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "offset", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "byteLength", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Buffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "buffer", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.buffer", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getErrorString", + "api_type": "FunctionDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "errno", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "printf", + "api_type": "FunctionDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "format", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "...args", + "type": "Object[]", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "promiseWrapper", + "api_type": "FunctionDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "original", + "type": "(err: Object, value: Object) => void", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Object", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "decode", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array | string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Promise", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "decodeSync", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array | string", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Uint8Array", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "encode", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Promise", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "encodeSync", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Uint8Array", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "encodeToString", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Promise", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "encodeToStringSync", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "BehaviorChange", + "api_name": "encodeToStringSync", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "src", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "Type", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Base64Helper", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "stream", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "DecodeWithStreamOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "afterRemoval", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "isEvict", + "type": "boolean", + "is_optional": false, + "has_default": false + }, + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "V", + "is_optional": false, + "has_default": false + }, + { + "name": "newValue", + "type": "V", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "clear", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "capacity", + "type": "number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "contains", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "createDefault", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "V", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "entries", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "IterableIterator<[K, V]>", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "get", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "V | undefined", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getCapacity", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getCreateCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getMatchCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getMissCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getPutCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getPutCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getRemovalCount", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "isEmpty", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "keys", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "K[]", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "put", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + }, + { + "name": "value", + "type": "V", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "V", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "remove", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "key", + "type": "K", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "V | undefined", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "toString", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "updateCapacity", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "newCapacity", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "values", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "V[]", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "length", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "LruBuffer", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "number", + "code_kind": 171 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "clamp", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "ScopeType", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "ScopeType", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "lowerObj", + "type": "ScopeType", + "is_optional": false, + "has_default": false + }, + { + "name": "upperObj", + "type": "ScopeType", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "contains", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "range", + "type": "Scope", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "contains", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "range", + "type": "ScopeType", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "expand", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "lowerObj", + "type": "ScopeType", + "is_optional": false, + "has_default": false + }, + { + "name": "upperObj", + "type": "ScopeType", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Scope", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "expand", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "value", + "type": "ScopeType", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Scope", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "expand", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "range", + "type": "Scope", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Scope", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getLower", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "ScopeType", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "getUpper", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "ScopeType", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "intersect", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "lowerObj", + "type": "ScopeType", + "is_optional": false, + "has_default": false + }, + { + "name": "upperObj", + "type": "ScopeType", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Scope", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "intersect", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "range", + "type": "Scope", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Scope", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "toString", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Scope", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "encoding", + "type": "string", + "is_optional": true, + "has_default": false + }, + { + "name": "options", + "type": "{ fatal?: boolean; ignoreBOM?: boolean; }", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TextDecoder", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "decode", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "input", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "{ stream?: false; }", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TextDecoder", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "decodeWithStream", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "input", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "DecodeWithStreamOptions", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TextDecoder", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "encode", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "input", + "type": "string", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TextEncoder", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Uint8Array", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.d.ts", + "api_info": { + "line": 615, + "problem": "WhiteList", + "api_name": "encodeInto", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "input", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "dest", + "type": "Uint8Array", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "TextEncoder", + "api_type": "ClassDeclaration" + }, + { + "api_name": "util", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "{ read: number; written: number; }", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "[Symbol.iterator]", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "IterableIterator", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "add", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "clear", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "clone", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "Vector", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "constructor", + "api_type": "ConstructorDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 176 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "convertToArray", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "Array", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "copyToArray", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "array", + "type": "Array", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "forEach", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, vector?: Vector) => void", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "get", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "T", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getCapacity", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getFirstElement", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "T", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getIndexFrom", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + }, + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getIndexOf", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getIndexOf", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "T", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getLastIndexFrom", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + }, + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "getLastIndexOf", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "number", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "has", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "has", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "newCapacity", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "insert", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + }, + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "isEmpty", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "remove", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "element", + "type": "T", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "boolean", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "removeByIndex", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "T", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "removeByRange", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "fromIndex", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "toIndex", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "replaceAllElements", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "callbackFn", + "type": "(value: T, index?: number, vector?: Vector) => T", + "is_optional": false, + "has_default": false + }, + { + "name": "thisArg", + "type": "Object", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "set", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "index", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "element", + "type": "T", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "T", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "setLength", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "newSize", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "sort", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "comparator", + "type": "(firstValue: T, secondValue: T) => number", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "subVector", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "fromIndex", + "type": "number", + "is_optional": false, + "has_default": false + }, + { + "name": "toIndex", + "type": "number", + "is_optional": false, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "Vector", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "toString", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "string", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "trimToCurrentLength", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [], + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "method_return_type": "void", + "code_kind": 174 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.util.Vector.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "length", + "api_type": "PropertyDeclaration", + "api_optional": false, + "parent_api": [ + { + "api_name": "Vector", + "api_type": "ClassDeclaration" + } + ], + "api_property_type": "number", + "code_kind": 171 + }, + "import_path": [ + "@ohos.util.Vector", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "convert", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "xml", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "ConvertOptions", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "ConvertXML", + "api_type": "ClassDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Object", + "code_kind": 174 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "fastConvertToJSObject", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "xml", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "ConvertOptions", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "ConvertXML", + "api_type": "ClassDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Object", + "code_kind": 174 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "convertToJSObject", + "api_type": "MethodDeclaration", + "api_optional": false, + "api_func_args": [ + { + "name": "xml", + "type": "string", + "is_optional": false, + "has_default": false + }, + { + "name": "options", + "type": "ConvertOptions", + "is_optional": true, + "has_default": false + } + ], + "parent_api": [ + { + "api_name": "ConvertXML", + "api_type": "ClassDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "method_return_type": "Object", + "code_kind": 174 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "trim", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreDeclaration", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreInstruction", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreAttributes", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreComment", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreCDATA", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreDoctype", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "ignoreText", + "api_type": "PropertySignature", + "api_optional": true, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "boolean", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "declarationKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "instructionKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "attributesKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "textKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "cdataKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "doctypeKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "commentKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "parentKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "typeKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "nameKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + }, + { + "file_path": "api/@ohos.convertxml.d.ts", + "api_info": { + "line": 349, + "problem": "WhiteList", + "api_name": "elementsKey", + "api_type": "PropertySignature", + "api_optional": false, + "parent_api": [ + { + "api_name": "ConvertOptions", + "api_type": "InterfaceDeclaration" + }, + { + "api_name": "xml", + "api_type": "ModuleDeclaration" + } + ], + "api_property_type": "string", + "code_kind": 170 + }, + "import_path": [ + "@ohos.convertxml", + "@kit.ArkTS" + ], + "is_global": false + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/src/lib/utils/consts/SdkCommonDeprecateWhiteList.ts b/ets2panda/linter/src/lib/utils/consts/SdkCommonDeprecateWhiteList.ts new file mode 100644 index 0000000000000000000000000000000000000000..7eb3ebe1bb38fe27bdcf4d49ce149ff534e26a9c --- /dev/null +++ b/ets2panda/linter/src/lib/utils/consts/SdkCommonDeprecateWhiteList.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2025 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 { FaultID } from '../../Problems'; + +export const SdkCommonApiProblemInfos = new Map([ + ['WhiteList', FaultID.SdkCommonApiWhiteList], + ['BehaviorChange', FaultID.SdkCommonApiBehaviorChange], + ['allDeprecated', FaultID.SdkCommonApiDeprecated] +]); +export const SDK_COMMON_INDEX_CLASS: Set = new Set(['Stack', 'Queue', 'LinkedList', 'PlainArray', 'Buffer']); +export enum SDK_COMMON_BUFFER_API { + apiName = 'Buffer', + full_api = 'buffer.Buffer', + indexof = 'indexOf' +} +export const SDK_COMMON_SYMBOL_ITERATOR: string = 'Symbol.iterator'; +export const SDK_COMMON_SYMBOL_ITERATOR_APINAME: string = '[Symbol.iterator]'; +export const SDK_COMMON_TRANSFORMER: string = 'Transformer'; +export const SDK_COMMON_CONSTRUCTOR: string = 'constructor'; +export const SDK_COMMON_VOID: string = 'void'; + +export const sdkCommonAllDeprecatedTypeName: Set = new Set([ + 'Base64', + 'LruBuffer', + 'Scope', + 'Vector', + 'ConvertXML', + 'ConvertOptions' +]); +export const sdkCommonAllDeprecatedFullTypeName: Set = new Set([ + 'Base64', + 'LruBuffer', + 'Scope', + 'Vector', + 'ConvertXML', + 'ConvertOptions', + 'util.Base64', + 'util.LruBuffer', + 'util.Scope', + 'Vector', + 'xml.ConvertXML', + 'xml.ConvertOptions' +]); diff --git a/ets2panda/linter/test/sdkcommonapi/@ohos.convertxml.d.ts b/ets2panda/linter/test/sdkcommonapi/@ohos.convertxml.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e9aafa2364eabca443067f410c73caf4c4aee3b8 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/@ohos.convertxml.d.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025 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. + */ + +export declare namespace xml { + interface ConvertOptions { + trim: boolean; + ignoreDeclaration?: boolean; + ignoreInstruction?: boolean; + ignoreAttributes?: boolean; + ignoreComment?: boolean; + ignoreCDATA?: boolean; + ignoreDoctype?: boolean; + ignoreText?: boolean; + declarationKey: string; + instructionKey: string; + attributesKey: string; + textKey: string; + cdataKey: string; + doctypeKey: string; + commentKey: string; + parentKey: string; + typeKey: string; + nameKey: string; + elementsKey: string; + } + class ConvertXML { + convert(xml: string, options?: ConvertOptions): Object; + convertToJSObject(xml: string, options?: ConvertOptions): Object; + fastConvertToJSObject(xml: string, options?: ConvertOptions): Object; + } +} +export default xml; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/@ohos.util.ArrayList.d.ts b/ets2panda/linter/test/sdkcommonapi/@ohos.util.ArrayList.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd9e51d62d2dde9375eb7eda160a9eb627d263ae --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/@ohos.util.ArrayList.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 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. + */ + +export declare class ArrayList { + constructor(); + [Symbol.iterator](): IterableIterator; + sort(comparator?: (firstValue: T, secondValue: T) => number): void; + forEach(callbackFn: (value: T, index?: number, arrlist?: ArrayList) => void, thisArg?: Object): void; + replaceAllElements(callbackFn: (value: T, index?: number, arrlist?: ArrayList) => T, thisArg?: Object): void; +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/@ohos.util.Vector.d.ts b/ets2panda/linter/test/sdkcommonapi/@ohos.util.Vector.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8fae94d4d521dba152e072d75f6852c2e24d8157 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/@ohos.util.Vector.d.ts @@ -0,0 +1,338 @@ +/* + * Copyright (c) 2025 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. + */ + +export declare class Vector { + /** + * A constructor used to create a Vector object. + * + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + constructor(); + /** + * Gets the element number of the Vector. This is a number one higher than the highest index in the vector. + * + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + length: number; + /** + * Appends the specified element to the end of this vector. + * + * @param { T } element - Element to be appended to this vector + * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + add(element: T): boolean; + /** + * Inserts the specified element at the specified position in this + * vector. Shifts the element currently at that position (if any) and + * any subsequent elements to the right (adds one to their index). + * + * @param { T } element - Element at which the specified element is to be inserted + * @param { number } index - Index to be inserted + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + insert(element: T, index: number): void; + /** + * Check if vector contains the specified element + * + * @param { T } element - Element to be contained + * @returns { boolean } the boolean type,if vector contains the specified element,return true,else return false + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + has(element: T): boolean; + /** + * Returns the element at the specified position in this Vector,or returns undefined if vector is empty + * + * @param { number } index - Index to be contained + * @returns { T } the number type ,returns the lowest index such that or -1 if there is no such index. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + get(index: number): T; + /** + * Returns the index of the first occurrence of the specified element + * in this vector, or -1 if this vector does not contain the element. + * + * @param { T } element - Element current index + * @returns { number } the number type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getIndexOf(element: T): number; + /** + * Returns the first component (the item at index 0) of this vector. + * or returns undefined if vector is empty + * + * @returns { T } the T type ,returns undefined if vector is empty + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getFirstElement(): T; + /** + * Returns the Last component (the item at index length-1) of this vector. + * or returns undefined if vector is empty + * + * @returns { T } the T type ,returns undefined if vector is empty + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getLastElement(): T; + /** + * Find the corresponding element according to the index, + * delete the element, and move the index of all elements to the right of the element forward by one. + * + * @param { number } index - The index in the vector + * @returns { T } the T type ,returns undefined if vector is empty,If the index is + * out of bounds (greater than or equal to length or less than 0), throw an exception + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + removeByIndex(index: number): T; + /** + * Removes the first occurrence of the specified element from this vector, + * if it is present. If the vector does not contain the element, it is + * unchanged. More formally, removes the element with the lowest index + * + * @param { T } element - Element to remove + * @returns { boolean } the boolean type ,If there is no such element, return false + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + remove(element: T): boolean; + /** + * Replaces the element at the specified position in this Vector with the specified element + * + * @param { number } index - Index to find + * @param { T } element - Element replaced element + * @returns { T } the T type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + set(index: number, element: T): T; + /** + * Returns in the index of the last occurrence of the specified element in this vector , + * or -1 if the vector does not contain the element. + * + * @param { T } element - Element to find + * @returns { number } The number type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getLastIndexOf(element: T): number; + /** + * Returns the index of the last occurrence of the specified element in this vector ,searching backwards from index, + * or returns -1 if the element is not found,or -1 if there is no such index + * + * @param { T } element - Element to find + * @param { number } index - Index start index + * @returns { number } the number type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getLastIndexFrom(element: T, index: number): number; + /** + * Returns the index of the first occurrence of the specified element in this vector ,searching forwards from index, + * or returns -1 if the element is not found,or -1 if there is no such index + * + * @param { T } element - Element to find + * @param { number } index - Index start index + * @returns { number } the number type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getIndexFrom(element: T, index: number): number; + /** + * Removes from this vector all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive. + * + * @param { number } fromIndex - The starting position of the index, containing the value at that index position + * @param { number } toIndex - The end of the index, excluding the value at that index + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + removeByRange(fromIndex: number, toIndex: number): void; + /** + * Replaces each element of this vector with the result of applying the operator to that element. + * + * @param { function } callbackFn - A function that accepts up to four arguments.The function to be called + * for each element in the vector,Returns the result of an operation + * @param { Object } thisArg - The value passed to the function generally uses the + * "this" value.If this parameter is empty, "undefined" will be passed to the "this" value + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + replaceAllElements(callbackFn: (value: T, index?: number, vector?: Vector) => T, thisArg?: Object): void; + /** + * Executes a provided function once for each value in the vector object. + * + * @param { function } callbackFn - callbackFn + * callbackFn (required) A function that accepts up to four arguments.The function to be + * called for each element in the vector + * @param { Object } thisArg - The value passed to the function generally uses the "this" value. + * If this parameter is empty, "undefined" will be passed to the "this" value + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + forEach(callbackFn: (value: T, index?: number, vector?: Vector) => void, thisArg?: Object): void; + /** + * Sorts this vector according to the order induced by the specified comparator,without comparator + * this parameter, it will default to ASCII sorting + * + * @param { function } comparator - comparator + * (Optional) A function that accepts up to two arguments.Specifies the sort order. + * Must be a function,return number type,If it returns firstValue minus secondValue, it returns an vector sorted + * in ascending order;If it returns secondValue minus firstValue, it returns an vector sorted in descending order; + * If this parameter is empty, it will default to ASCII sorting + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + sort(comparator?: (firstValue: T, secondValue: T) => number): void; + /** + * Returns a view of the portion of this vector between the specified fromIndex,inclusive,and toIndex,exclusive + * + * @param { number } fromIndex - The starting position of the index, containing the value at that index position + * @param { number } toIndex - The end of the index, excluding the value at that index + * @returns { Vector } + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + subVector(fromIndex: number, toIndex: number): Vector; + /** + * Removes all of the elements from this vector.The vector will + * be empty after this call returns.length becomes 0 + * + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + clear(): void; + /** + * Returns a shallow copy of this instance. (The elements themselves are not copied.) + * + * @returns { Vector } this vector instance + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + clone(): Vector; + /** + * Sets the length of this vector + * + * @param { number } newSize - newSize + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + setLength(newSize: number): void; + /** + * returns the capacity of this vector + * + * @returns { number } the number type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + getCapacity(): number; + /** + * convert vector to array + * + * @returns { Array } the Array type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + convertToArray(): Array; + /** + * Determine whether vector is empty and whether there is an element + * + * @returns { boolean } the boolean type + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + isEmpty(): boolean; + /** + * If the newCapacity provided by the user is greater than or equal to length, + * change the capacity of the vector to newCapacity, otherwise the capacity will not be changed + * + * @param { number } newCapacity - newCapacity + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + increaseCapacityTo(newCapacity: number): void; + /** + * Returns a string representation of this Vector, + * containing the String representation of each element + * + * @returns { string } + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + toString(): string; + /** + * Limit the capacity to the current length + * + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + trimToCurrentLength(): void; + /** + * Copies the components of this vector into the specified array, + * to overwrite elements of the same index + * + * @param { Array } array - Replaced array + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + copyToArray(array: Array): void; + /** + * returns an ES6 iterator.Each item of the iterator is a Javascript Object + * + * @returns { IterableIterator } + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ + [Symbol.iterator](): IterableIterator; +} +export default Vector; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/@ohos.util.d.ts b/ets2panda/linter/test/sdkcommonapi/@ohos.util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..83195de524f79948d4192d5b8efeeade6fc10169 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/@ohos.util.d.ts @@ -0,0 +1,1191 @@ +/* + * Copyright (c) 2025 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. + */ + +declare namespace util { + class Base64 { + /** + * Constructor for creating base64 encoding and decoding + * + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.constructor + */ + constructor(); + /** + * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. + * + * @param { Uint8Array } src - A Uint8Array value + * @returns { Uint8Array } Return the encoded new Uint8Array. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encodeSync + */ + encodeSync(src: Uint8Array): Uint8Array; + /** + * Encodes the specified byte array into a String using the Base64 encoding scheme. + * + * @param { Uint8Array } src - A Uint8Array value + * @returns { string } Return the encoded string. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encodeToStringSync + */ + encodeToStringSync(src: Uint8Array): string; + /** + * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. + * + * @param { Uint8Array | string } src - A Uint8Array value or value A string value + * @returns { Uint8Array } Return the decoded Uint8Array. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.decodeSync + */ + decodeSync(src: Uint8Array | string): Uint8Array; + /** + * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. + * + * @param { Uint8Array } src - A Uint8Array value + * @returns { Promise } Return the encodes asynchronous new Uint8Array. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encode + */ + encode(src: Uint8Array): Promise; + /** + * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. + * + * @param { Uint8Array } src - A Uint8Array value + * @returns { Promise } Returns the encoded asynchronous string. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encodeToString + */ + encodeToString(src: Uint8Array): Promise; + /** + * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. + * + * @param { Uint8Array | string } src - A Uint8Array value or value A string value + * @returns { Promise } Return the decoded asynchronous Uint8Array. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.decode + */ + decode(src: Uint8Array | string): Promise; + } + class LruBuffer { + /** + * Default constructor used to create a new LruBuffer instance with the default capacity of 64. + * + * @param { number } capacity - Indicates the capacity to customize for the buffer. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.constructor + */ + constructor(capacity?: number); + /** + * Updates the buffer capacity to a specified capacity. + * + * @param { number } newCapacity - Indicates the new capacity to set. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.updateCapacity + */ + updateCapacity(newCapacity: number): void; + /** + * Returns a string representation of the object. + * + * @returns { string } Returns the string representation of the object and outputs the string representation of the object. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.toString + */ + toString(): string; + /** + * Obtains a list of all values in the current buffer. + * + * @type { number } + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.length + */ + length: number; + /** + * Obtains the capacity of the current buffer. + * + * @returns { number } Returns the capacity of the current buffer. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getCapacity + */ + getCapacity(): number; + /** + * Clears key-value pairs from the current buffer. + * + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.clear + */ + clear(): void; + /** + * Obtains the number of times createDefault(Object) returned a value. + * + * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getCreateCount + */ + getCreateCount(): number; + /** + * Obtains the number of times that the queried values are not matched. + * + * @returns { number } Returns the number of times that the queried values are not matched. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getMissCount + */ + getMissCount(): number; + /** + * Obtains the number of times that values are evicted from the buffer. + * + * @returns { number } Returns the number of times that values are evicted from the buffer. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getRemovalCount + */ + getRemovalCount(): number; + /** + * Obtains the number of times that the queried values are successfully matched. + * + * @returns { number } Returns the number of times that the queried values are successfully matched. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getMatchCount + */ + getMatchCount(): number; + /** + * Obtains the number of times that values are added to the buffer. + * + * @returns { number } Returns the number of times that values are added to the buffer. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getPutCount + */ + getPutCount(): number; + /** + * Checks whether the current buffer is empty. + * + * @returns { boolean } Returns true if the current buffer contains no value. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.isEmpty + */ + isEmpty(): boolean; + /** + * Obtains the value associated with a specified key. + * + * @param { K } key - Indicates the key to query. + * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.get + */ + get(key: K): V | undefined; + /** + * Adds a key-value pair to the buffer. + * + * @param { K } key - Indicates the key to add. + * @param { V } value - Indicates the value associated with the key to add. + * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.put + */ + put(key: K, value: V): V; + /** + * Obtains a list of all values in the current buffer. + * + * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.values + */ + values(): V[]; + /** + * Obtains a list of keys for the values in the current buffer. + * + * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.keys + */ + keys(): K[]; + /** + * Deletes a specified key and its associated value from the current buffer. + * + * @param { K } key - Indicates the key to delete. + * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.remove + */ + remove(key: K): V | undefined; + /** + * Executes subsequent operations after a value is deleted. + * + * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, + * and the parameter value is false in other cases. + * @param { K } key - Indicates the deleted key. + * @param { V } value - Indicates the deleted value. + * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) + * method is called and the key to add already exists. The parameter value is null in other cases. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.afterRemoval + */ + afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; + /** + * Checks whether the current buffer contains a specified key. + * + * @param { K } key - Indicates the key to check. + * @returns { boolean } Returns true if the buffer contains the specified key. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.contains + */ + contains(key: K): boolean; + /** + * Called after a cache miss to compute a value for the corresponding key. + * + * @param { K } key - Indicates the missed key. + * @returns { V } Returns the value associated with the key. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.createDefault + */ + createDefault(key: K): V; + /** + * Returns an array of key-value pairs of enumeratable properties of a given object. + * + * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.entries + */ + entries(): IterableIterator<[ + K, + V + ]>; + /** + * Specifies the default iterator for an object. + * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.[Symbol.iterator] + */ + [Symbol.iterator](): IterableIterator<[ + K, + V + ]>; + } + class LRUCache { + /** + * Default constructor used to create a new LruBuffer instance with the default capacity of 64. + * + * @param { number } [capacity] - Indicates the capacity to customize for the buffer. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Default constructor used to create a new LruBuffer instance with the default capacity of 64. + * + * @param { number } [capacity] - Indicates the capacity to customize for the buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Default constructor used to create a new LruBuffer instance with the default capacity of 64. + * + * @param { number } [capacity] - Indicates the capacity to customize for the buffer. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + constructor(capacity?: number); + /** + * Updates the buffer capacity to a specified capacity. + * + * @param { number } newCapacity - Indicates the new capacity to set. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Updates the buffer capacity to a specified capacity. + * + * @param { number } newCapacity - Indicates the new capacity to set. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Updates the buffer capacity to a specified capacity. + * + * @param { number } newCapacity - Indicates the new capacity to set. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + updateCapacity(newCapacity: number): void; + /** + * Returns a string representation of the object. + * + * @returns { string } Returns the string representation of the object and outputs the string representation of the object. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Returns a string representation of the object. + * + * @returns { string } Returns the string representation of the object and outputs the string representation of the object. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Returns a string representation of the object. + * + * @returns { string } Returns the string representation of the object and outputs the string representation of the object. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + toString(): string; + /** + * Obtains a list of all values in the current buffer. + * + * @type { number } + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains a list of all values in the current buffer. + * + * @type { number } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains a list of all values in the current buffer. + * + * @type { number } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + length: number; + /** + * Obtains the capacity of the current buffer. + * + * @returns { number } Returns the capacity of the current buffer. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the capacity of the current buffer. + * + * @returns { number } Returns the capacity of the current buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the capacity of the current buffer. + * + * @returns { number } Returns the capacity of the current buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + getCapacity(): number; + /** + * Clears key-value pairs from the current buffer. + * + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Clears key-value pairs from the current buffer. + * + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Clears key-value pairs from the current buffer. + * + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + clear(): void; + /** + * Obtains the number of times createDefault(Object) returned a value. + * + * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the number of times createDefault(Object) returned a value. + * + * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the number of times createDefault(Object) returned a value. + * + * @returns { number } Returns the number of times createDefault(java.lang.Object) returned a value. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + getCreateCount(): number; + /** + * Obtains the number of times that the queried values are not matched. + * + * @returns { number } Returns the number of times that the queried values are not matched. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the number of times that the queried values are not matched. + * + * @returns { number } Returns the number of times that the queried values are not matched. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the number of times that the queried values are not matched. + * + * @returns { number } Returns the number of times that the queried values are not matched. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + getMissCount(): number; + /** + * Obtains the number of times that values are evicted from the buffer. + * + * @returns { number } Returns the number of times that values are evicted from the buffer. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the number of times that values are evicted from the buffer. + * + * @returns { number } Returns the number of times that values are evicted from the buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the number of times that values are evicted from the buffer. + * + * @returns { number } Returns the number of times that values are evicted from the buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + getRemovalCount(): number; + /** + * Obtains the number of times that the queried values are successfully matched. + * + * @returns { number } Returns the number of times that the queried values are successfully matched. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the number of times that the queried values are successfully matched. + * + * @returns { number } Returns the number of times that the queried values are successfully matched. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the number of times that the queried values are successfully matched. + * + * @returns { number } Returns the number of times that the queried values are successfully matched. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + getMatchCount(): number; + /** + * Obtains the number of times that values are added to the buffer. + * + * @returns { number } Returns the number of times that values are added to the buffer. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the number of times that values are added to the buffer. + * + * @returns { number } Returns the number of times that values are added to the buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the number of times that values are added to the buffer. + * + * @returns { number } Returns the number of times that values are added to the buffer. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + getPutCount(): number; + /** + * Checks whether the current buffer is empty. + * + * @returns { boolean } Returns true if the current buffer contains no value. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Checks whether the current buffer is empty. + * + * @returns { boolean } Returns true if the current buffer contains no value. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Checks whether the current buffer is empty. + * + * @returns { boolean } Returns true if the current buffer contains no value. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + isEmpty(): boolean; + /** + * Obtains the value associated with a specified key. + * + * @param { K } key - Indicates the key to query. + * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains the value associated with a specified key. + * + * @param { K } key - Indicates the key to query. + * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains the value associated with a specified key. + * + * @param { K } key - Indicates the key to query. + * @returns { V | undefined } Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + get(key: K): V | undefined; + /** + * Adds a key-value pair to the buffer. + * + * @param { K } key - Indicates the key to add. + * @param { V } value - Indicates the value associated with the key to add. + * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Adds a key-value pair to the buffer. + * + * @param { K } key - Indicates the key to add. + * @param { V } value - Indicates the value associated with the key to add. + * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Adds a key-value pair to the buffer. + * + * @param { K } key - Indicates the key to add. + * @param { V } value - Indicates the value associated with the key to add. + * @returns { V } Returns the value associated with the added key; returns the original value if the key to add already exists. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + put(key: K, value: V): V; + /** + * Obtains a list of all values in the current buffer. + * + * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains a list of all values in the current buffer. + * + * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains a list of all values in the current buffer. + * + * @returns { V[] } Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + values(): V[]; + /** + * Obtains a list of keys for the values in the current buffer. + * since 9 + * + * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Obtains a list of keys for the values in the current buffer. + * since 9 + * + * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Obtains a list of keys for the values in the current buffer. + * since 9 + * + * @returns { K[] } Returns a list of keys sorted from most recently accessed to least recently accessed. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + keys(): K[]; + /** + * Deletes a specified key and its associated value from the current buffer. + * + * @param { K } key - Indicates the key to delete. + * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Deletes a specified key and its associated value from the current buffer. + * + * @param { K } key - Indicates the key to delete. + * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Deletes a specified key and its associated value from the current buffer. + * + * @param { K } key - Indicates the key to delete. + * @returns { V | undefined } Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + remove(key: K): V | undefined; + /** + * Executes subsequent operations after a value is deleted. + * + * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, + * and the parameter value is false in other cases. + * @param { K } key - Indicates the deleted key. + * @param { V } value - Indicates the deleted value. + * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) + * method is called and the key to add already exists. The parameter value is null in other cases. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Executes subsequent operations after a value is deleted. + * + * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, + * and the parameter value is false in other cases. + * @param { K } key - Indicates the deleted key. + * @param { V } value - Indicates the deleted value. + * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) + * method is called and the key to add already exists. The parameter value is null in other cases. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Executes subsequent operations after a value is deleted. + * + * @param { boolean } isEvict - The parameter value is true if this method is called due to insufficient capacity, + * and the parameter value is false in other cases. + * @param { K } key - Indicates the deleted key. + * @param { V } value - Indicates the deleted value. + * @param { V } newValue - The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) + * method is called and the key to add already exists. The parameter value is null in other cases. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; + /** + * Checks whether the current buffer contains a specified key. + * + * @param { K } key - Indicates the key to check. + * @returns { boolean } Returns true if the buffer contains the specified key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Checks whether the current buffer contains a specified key. + * + * @param { K } key - Indicates the key to check. + * @returns { boolean } Returns true if the buffer contains the specified key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Checks whether the current buffer contains a specified key. + * + * @param { K } key - Indicates the key to check. + * @returns { boolean } Returns true if the buffer contains the specified key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + contains(key: K): boolean; + /** + * Executes subsequent operations if miss to compute a value for the specific key. + * + * @param { K } key - Indicates the missed key. + * @returns { V } Returns the value associated with the key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Executes subsequent operations if miss to compute a value for the specific key. + * + * @param { K } key - Indicates the missed key. + * @returns { V } Returns the value associated with the key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Executes subsequent operations if miss to compute a value for the specific key. + * + * @param { K } key - Indicates the missed key. + * @returns { V } Returns the value associated with the key. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + createDefault(key: K): V; + /** + * Returns an array of key-value pairs of enumeratable properties of a given object. + * + * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Returns an array of key-value pairs of enumeratable properties of a given object. + * + * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Returns an array of key-value pairs of enumeratable properties of a given object. + * + * @returns { IterableIterator<[K, V]> } Returns an array of key-value pairs for the enumeratable properties of the given object itself. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + entries(): IterableIterator<[ + K, + V + ]>; + /** + * Specifies the default iterator for an object. + * + * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + /** + * Specifies the default iterator for an object. + * + * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * Specifies the default iterator for an object. + * + * @returns { IterableIterator<[K, V]> } Returns a two - dimensional array in the form of key - value pairs. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + [Symbol.iterator](): IterableIterator<[ + K, + V + ]>; + } + class Scope { + /** + * A constructor used to create a Scope instance with the lower and upper bounds specified. + * + * @param { ScopeType } lowerObj - A ScopeType value + * @param { ScopeType } upperObj - A ScopeType value + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.constructor + */ + constructor(lowerObj: ScopeType, upperObj: ScopeType); + /** + * Obtains a string representation of the current range. + * + * @returns { string } Returns a string representation of the current range object. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.toString + */ + toString(): string; + /** + * Returns the intersection of a given range and the current range. + * + * @param { Scope } range - A Scope range object + * @returns { Scope } Returns the intersection of a given range and the current range. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.intersect + */ + intersect(range: Scope): Scope; + /** + * Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * + * @param { ScopeType } lowerObj - A ScopeType value + * @param { ScopeType } upperObj - A ScopeType value + * @returns { Scope } Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.intersect + */ + intersect(lowerObj: ScopeType, upperObj: ScopeType): Scope; + /** + * Obtains the upper bound of the current range. + * + * @returns { ScopeType } Returns the upper bound of the current range. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.getUpper + */ + getUpper(): ScopeType; + /** + * Obtains the lower bound of the current range. + * + * @returns { ScopeType } Returns the lower bound of the current range. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.getLower + */ + getLower(): ScopeType; + /** + * Creates the smallest range that includes the current range and the given lower and upper bounds. + * + * @param { ScopeType } lowerObj - A ScopeType value + * @param { ScopeType } upperObj - A ScopeType value + * @returns { Scope } Returns the smallest range that includes the current range and the given lower and upper bounds. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.expand + */ + expand(lowerObj: ScopeType, upperObj: ScopeType): Scope; + /** + * Creates the smallest range that includes the current range and a given range. + * + * @param { Scope } range - A Scope range object + * @returns { Scope } Returns the smallest range that includes the current range and a given range. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.expand + */ + expand(range: Scope): Scope; + /** + * Creates the smallest range that includes the current range and a given value. + * + * @param { ScopeType } value - A ScopeType value + * @returns { Scope } Returns the smallest range that includes the current range and a given value. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.expand + */ + expand(value: ScopeType): Scope; + /** + * Checks whether a given value is within the current range. + * + * @param { ScopeType } value - A ScopeType value + * @returns { boolean } If the value is within the current range return true,otherwise return false. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.contains + */ + contains(value: ScopeType): boolean; + /** + * Checks whether a given range is within the current range. + * + * @param { Scope } range - A Scope range + * @returns { boolean } If the current range is within the given range return true,otherwise return false. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.contains + */ + contains(range: Scope): boolean; + /** + * Clamps a given value to the current range. + * + * @param { ScopeType } value - A ScopeType value + * @returns { ScopeType } Returns a ScopeType object that a given value is clamped to the current range.. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.clamp + */ + clamp(value: ScopeType): ScopeType; + } + interface ScopeComparable { + /** + * The comparison function is used by the scope. + * + * @param { ScopeComparable } other - Other + * @returns { boolean } Returns whether the current object is greater than or equal to the input object. + * @syscap SystemCapability.Utils.Lang + * @since 8 + */ + /** + * The comparison function is used by the scope. + * + * @param { ScopeComparable } other - Other + * @returns { boolean } Returns whether the current object is greater than or equal to the input object. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @since 10 + */ + /** + * The comparison function is used by the scope. + * + * @param { ScopeComparable } other - Other + * @returns { boolean } Returns whether the current object is greater than or equal to the input object. + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 12 + */ + compareTo(other: ScopeComparable): boolean; + } + class types { + isArgumentsObject(value: Object): boolean; + isGeneratorFunction(value: Object): boolean; + isGeneratorObject(value: Object): boolean; + isModuleNamespaceObject(value: Object): boolean; + isProxy(value: Object): boolean; + isSymbolObject(value: Object): boolean; + } + class Aspect { + static addBefore(targetClass: Object, methodName: string, isStatic: boolean, before: Function): void; + static addAfter(targetClass: Object, methodName: string, isStatic: boolean, after: Function): void; + static replace(targetClass: Object, methodName: string, isStatic: boolean, instead: Function): void; + } + class Base64Helper { + encodeToStringSync(src: Uint8Array, options?: Type): string; + } + function getErrorString(errno: number): string; + function printf(format: string, ...args: Object[]): string; + function promiseWrapper(original: (err: Object, value: Object) => void): Object; + interface DecodeWithStreamOptions { + /** + * Does the call follow additional data blocks. The default value is false. + * @type { ?boolean } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 11 + */ + stream?: boolean; + } + class TextDecoder { + constructor(encoding?: string, options?: { + fatal?: boolean; + ignoreBOM?: boolean; + }); + decode(input: Uint8Array, options?: { + stream?: false; + }): string; + decodeWithStream(input: Uint8Array, options?: DecodeWithStreamOptions): string; + } + class TextEncoder { + encode(input?: string): Uint8Array; + encodeInto(input: string, dest: Uint8Array): { + read: number; + written: number; + }; + } +} +export default util; diff --git a/ets2panda/linter/test/sdkcommonapi/api/@arkts.collections.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@arkts.collections.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e48680b12238846f5072b0afd8c2dc9970e0843b --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@arkts.collections.d.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2025 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. + */ + +declare namespace collections { + class Array implements ConcatArray { + constructor(); + constructor(first: T, ...left: T[]); + } + class Float32Array { + constructor(); + } + class Uint8Array { + constructor(); + } + class Uint8ClampedArray { + constructor(); + } + class Uint16Array { + constructor(); + } + class Uint32Array { + constructor(); + } +} + +export default collections; diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.buffer.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.buffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f42a4512357b2ffca4f70ba136daf1dccdc7b91f --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.buffer.d.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2025 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. + */ + +declare namespace buffer { + class Blob { + slice(start?: number, end?: number, type?: string): Blob; + } + class Buffer { + readInt8(offset?: number): number; + readInt16BE(offset?: number): number; + readInt16LE(offset?: number): number; + readInt32BE(offset?: number): number; + readInt32LE(offset?: number): number; + readIntBE(offset: number, byteLength: number): number; + readIntLE(offset: number, byteLength: number): number; + indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; + } + function from(string: String, encoding?: BufferEncoding): Buffer; +} +export default buffer; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.url.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.url.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ad14ed13864098c7c0781410c665dd01d25092f7 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.url.d.ts @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2025 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. + */ + +declare namespace url { + class URLSearchParams { + constructor(init?: string[][] | Record | string | URLSearchParams); + [Symbol.iterator](): IterableIterator<[ + string, + string + ]>; + append(name: string, value: string): void; + delete(name: string): void; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + entries(): IterableIterator<[ + string, + string + ]>; + forEach(callbackFn: (value: string, key: string, searchParams: URLSearchParams) => void, thisArg?: Object): void; + get(name: string): string | null; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + } + class URL { + href: string; + readonly origin: string; + pathname: string; + search: string; + readonly searchParams: URLSearchParams; + } + class URLParams { + constructor(init?: string[][] | Record | string | URLParams); + [Symbol.iterator](): IterableIterator<[ + string, + string + ]>; + } +} +export default url; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.LinkedList.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.LinkedList.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1ba1de3c7b807d35bbe6b20347399600e1e1a6cd --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.LinkedList.d.ts @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 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. + */ +export declare class LinkedList { + constructor(); + length: number; + add(element: T): boolean; + [Symbol.iterator](): IterableIterator; + removeFirstFound(element: T): boolean; + removeLastFound(element: T): boolean; +} +export default LinkedList; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.PlainArray.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.PlainArray.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8eef47deb465a5fa2304701482191e3b1088e5bf --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.PlainArray.d.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025 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. + */ +export declare class PlainArray { + constructor(); + length: number; + add(key: number, value: T): void; + [Symbol.iterator](): IterableIterator<[ + number, + T + ]>; + getValueAt(index: number): T; + setValueAt(index: number, value: T): void; + forEach(callbackFn: (value: T, index?: number, PlainArray?: PlainArray) => void, thisArg?: Object): void; +} +export default PlainArray; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.Queue.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.Queue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..688a9e1b93e348e6641420f5c363aa12d82f6608 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.Queue.d.ts @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2025 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. + */ +declare class Queue { + constructor(); + length: number; + add(element: T): boolean; + [Symbol.iterator](): IterableIterator; +} + +export default Queue; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.Stack.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.Stack.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..65bdc86d2cbb2d73c2e9599d30c97ae7815a3404 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.Stack.d.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ + +export declare class Stack { + [Symbol.iterator](): IterableIterator; +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.TreeMap.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.TreeMap.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0ebb5b14af65af67106552ed41f98e817f53f71 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.TreeMap.d.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 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. + */ +declare class TreeMap{ + constructor(comparator?: (firstValue: K, secondValue: K) => boolean); +} +export default TreeMap; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.json.d.ts b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.json.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3819fda8b6e4cc15e5df077eab7d80bbcc4d95c8 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/api/@ohos.util.json.d.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 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. + */ + +declare namespace json{ + type Transformer = (this: Object, key: string, value: Object) => Object | undefined | null; + function parse(text: string, reviver?: Transformer, options?: ParseOptions): Object | null; + function remove(obj: object, property: string): void; +} +export default json; \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets new file mode 100644 index 0000000000000000000000000000000000000000..a60faf8956cf677096a45d5052bffec0e1c4ed27 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2025 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 collections from './api/@arkts.collections' + +const a: collections.Array = new collections.Array(); +const b: collections.Float32Array = new collections.Float32Array(); +const c: collections.Uint8Array = new collections.Uint8Array(); +const d: collections.Uint8ClampedArray = new collections.Uint8ClampedArray(); +const e: collections.Uint16Array = new collections.Uint16Array(); +const f: collections.Uint32Array = new collections.Uint32Array(); +const a1: collections.Array = new collections.Array("111"); +const a2: collections.Array = new collections.Array(2); +const a3: collections.Array = new collections.Array(); +let arr1 = new collections.Array(2) \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.args.json b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..bfd624d74cad6ca6288220a227c1bce190507fae --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.arkts2.json @@ -0,0 +1,258 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 17, + "column": 10, + "endLine": 17, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 17, + "column": 42, + "endLine": 17, + "endColumn": 53, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 10, + "endLine": 18, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 41, + "endLine": 18, + "endColumn": 52, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 10, + "endLine": 19, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 39, + "endLine": 19, + "endColumn": 50, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 10, + "endLine": 20, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 46, + "endLine": 20, + "endColumn": 57, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 10, + "endLine": 21, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 40, + "endLine": 21, + "endColumn": 51, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 10, + "endLine": 22, + "endColumn": 21, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 40, + "endLine": 22, + "endColumn": 51, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 11, + "endLine": 23, + "endColumn": 22, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 43, + "endLine": 23, + "endColumn": 54, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 11, + "endLine": 24, + "endColumn": 22, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 39, + "endLine": 24, + "endColumn": 63, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 43, + "endLine": 24, + "endColumn": 54, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 61, + "endLine": 24, + "endColumn": 62, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 11, + "endLine": 25, + "endColumn": 22, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 39, + "endLine": 25, + "endColumn": 62, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 43, + "endLine": 25, + "endColumn": 54, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 12, + "endLine": 26, + "endColumn": 36, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 16, + "endLine": 26, + "endColumn": 27, + "problem": "NoNeedStdLibSendableContainer", + "suggest": "", + "rule": "Sendable containers are not supported (arkts-no-need-stdlib-sendable-containers)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 34, + "endLine": 26, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.json b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..7633c79b6aa0073a72cf8f74a66e11dac370f619 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/collections_no_array_sdk.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets new file mode 100755 index 0000000000000000000000000000000000000000..8b3c28decd32ef178c99cc506ea600afa7545e75 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2025 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 buffer from './api/@ohos.buffer' + +let blob: buffer.Blob = new buffer.Blob(['a', 'b', 'c', 'd', 'e']); +const newBlob = blob.slice(0, 2, 'MIME'); //error +const res1 = newBlob.size // 5" + +//indexOf +let buf = buffer.from([-1, 5]); +let index = buf.indexOf(""); // error +let buf1 = new buffer.Buffer().indexOf(""); // error +let index2 = buffer.from("abc").indexOf(""); // error +let buf2 = buffer.from("123"); +let buf3 = buf2; +buf3.indexOf(""); // error +let buf4 = new buffer.Buffer(); +let buf5 = buf4; +buf5.indexOf(""); // error +buf5.indexOf(); // error + +//sum:7 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..8a03909fd78788ddb0a06b2350e7753d8497a1f5 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.arkts2.json @@ -0,0 +1,168 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 18, + "column": 22, + "endLine": 18, + "endColumn": 27, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 28, + "endLine": 18, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 31, + "endLine": 18, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 7, + "endLine": 19, + "endColumn": 26, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 25, + "endLine": 22, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 28, + "endLine": 22, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 5, + "endLine": 23, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 17, + "endLine": 23, + "endColumn": 24, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 5, + "endLine": 24, + "endColumn": 43, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 32, + "endLine": 24, + "endColumn": 39, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 5, + "endLine": 25, + "endColumn": 44, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 33, + "endLine": 25, + "endColumn": 40, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 6, + "endLine": 28, + "endColumn": 13, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 6, + "endLine": 31, + "endColumn": 13, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 6, + "endLine": 32, + "endColumn": 13, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..d4ee73858cf44a3952df70bc44a71923e42b2c24 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_buffer.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 19, + "column": 7, + "endLine": 19, + "endColumn": 26, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_index.ets b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets new file mode 100755 index 0000000000000000000000000000000000000000..00cf58ad143baf8da24010d0f164b38cc7c1de65 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2025 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 {Stack} from './api/@ohos.util.Stack'; +import Queue from './api/@ohos.util.Queue'; +import {LinkedList} from './api/@ohos.util.LinkedList'; +import {PlainArray} from './api/@ohos.util.PlainArray'; + +let stack = new Stack(); +stack.push(1); +const a: number = stack[0]; //error + + +let queue = new Queue(); +queue.add(1); //error +const b: number = queue[0]; //error + + +let linkedList = new LinkedList(); +linkedList.add(1); +const c: number = linkedList[0]; //error + + +let plainArray = new PlainArray(); +stack.push(1); +const d: number = plainArray[0]; //error \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..1cb8764d1bb3cc5845f658139051047efb734bbe --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.arkts2.json @@ -0,0 +1,108 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 22, + "column": 12, + "endLine": 22, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 19, + "endLine": 23, + "endColumn": 27, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 7, + "endLine": 27, + "endColumn": 10, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 11, + "endLine": 27, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 19, + "endLine": 28, + "endColumn": 27, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 16, + "endLine": 32, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 19, + "endLine": 33, + "endColumn": 32, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 12, + "endLine": 37, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 19, + "endLine": 38, + "endColumn": 32, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..fd71430f1ea0e4fa9f4558e3f678859330eaf69c --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_index.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_json.ets b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets new file mode 100755 index 0000000000000000000000000000000000000000..d3bf617e61b92e5c27551c45c4164f50dc4eafa1 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 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 json from './api/@ohos.util.json' + +let obj = json.parse(''); //error +function aa(this: Object, key: string, value: Object): Object | undefined | null { + return null; +} +let obj1 = json.parse('', aa); //error +json.remove(obj, ''); //error +const uppercaseTransformer: json.Transformer = (key, value) => { //error + if (typeof value === 'string') { + return value.toUpperCase(); + } + return value; +}; +//sum:4 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..2a5257b46092670ddfc0746fe5c3161650e33b29 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.arkts2.json @@ -0,0 +1,68 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 17, + "column": 16, + "endLine": 17, + "endColumn": 21, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 13, + "endLine": 18, + "endColumn": 17, + "problem": "InvalidIdentifier", + "suggest": "", + "rule": "This keyword cannot be used as identifiers (arkts-invalid-identifier)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 17, + "endLine": 21, + "endColumn": 22, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 6, + "endLine": 22, + "endColumn": 12, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 29, + "endLine": 23, + "endColumn": 45, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..7633c79b6aa0073a72cf8f74a66e11dac370f619 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_json.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_list.ets b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets new file mode 100755 index 0000000000000000000000000000000000000000..0557951af9b1b4d8995c8478120899a16245393e --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2025 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 { ArrayList } from './@ohos.util.ArrayList'; +import LinkedList from './api/@ohos.util.LinkedList'; +import {PlainArray} from './api/@ohos.util.PlainArray'; +import TreeMap from './api/@ohos.util.TreeMap'; + +let linkedList: LinkedList = new LinkedList(); +linkedList.add(4); +linkedList.add(5); +linkedList.add(4); +let result = linkedList.removeFirstFound(6);//error +let result1 = linkedList.removeLastFound(6); //error + +let plainArray: PlainArray = new PlainArray(); +let result3 = plainArray.getKeyAt(-1); +let result32 = plainArray.getValueAt(-1); +let result4 = plainArray.setValueAt(-2, 0); + +let treeMap: TreeMap = + new TreeMap((firstValue: string, secondValue: string): boolean => { //error + return firstValue > secondValue + }); + +let arrayList: ArrayList = new ArrayList(); +arrayList.add("刘"); +arrayList.add("张三"); +arrayList.add(1); +arrayList.add(2); +arrayList.sort((a, b) => a - b); //error + +function fn() {console.log('Hello');} +let arrayList2: ArrayList = new ArrayList(); +arrayList2.add(2); +arrayList2.forEach((value: number, index?: number) => { //error + console.log('value:' + value, 'index:' + index); +}, fn); + +let arrayList3: ArrayList = new ArrayList(); +arrayList.add(2); +arrayList.add(4); +arrayList.replaceAllElements((value: number): number => { //error + return value; +},fn); + +//sum:6 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..998941c8f79f4b0778a65b37becfe99786a23f90 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.arkts2.json @@ -0,0 +1,278 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 21, + "column": 38, + "endLine": 21, + "endColumn": 54, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 16, + "endLine": 22, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 16, + "endLine": 23, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 16, + "endLine": 24, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 25, + "endLine": 25, + "endColumn": 41, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 42, + "endLine": 25, + "endColumn": 43, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 26, + "endLine": 26, + "endColumn": 41, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 42, + "endLine": 26, + "endColumn": 43, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 5, + "endLine": 29, + "endColumn": 38, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 36, + "endLine": 29, + "endColumn": 37, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 5, + "endLine": 30, + "endColumn": 41, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 39, + "endLine": 30, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 15, + "endLine": 31, + "endColumn": 43, + "problem": "LimitedVoidType", + "suggest": "", + "rule": "Type \"void\" has no instances.(arkts-limited-void-type)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 38, + "endLine": 31, + "endColumn": 39, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 41, + "endLine": 31, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 7, + "endLine": 34, + "endColumn": 14, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 15, + "endLine": 41, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 15, + "endLine": 42, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 11, + "endLine": 43, + "endColumn": 15, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 16, + "endLine": 47, + "endColumn": 17, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 12, + "endLine": 48, + "endColumn": 19, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 29, + "endLine": 52, + "endColumn": 44, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 15, + "endLine": 53, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 15, + "endLine": 54, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 11, + "endLine": 55, + "endColumn": 29, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 30, + "endLine": 55, + "endColumn": 66, + "problem": "StrictDiagnostic", + "suggest": "Argument of type '(value: number) => number' is not assignable to parameter of type '(value: String | Number, index?: number | undefined, arrlist?: ArrayList | undefined) => String | Number'.\n Types of parameters 'value' and 'value' are incompatible.\n Type 'String | Number' is not assignable to type 'number'.\n Type 'String' is not assignable to type 'number'.", + "rule": "Argument of type '(value: number) => number' is not assignable to parameter of type '(value: String | Number, index?: number | undefined, arrlist?: ArrayList | undefined) => String | Number'.\n Types of parameters 'value' and 'value' are incompatible.\n Type 'String | Number' is not assignable to type 'number'.\n Type 'String' is not assignable to type 'number'.", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..a940139c1da991ba394398c6078b800350dbafb3 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_list.ets.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 29, + "column": 5, + "endLine": 29, + "endColumn": 38, + "problem": "AnyType", + "suggest": "", + "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 30, + "endLine": 55, + "endColumn": 66, + "problem": "StrictDiagnostic", + "suggest": "Argument of type '(value: number) => number' is not assignable to parameter of type '(value: String | Number, index?: number | undefined, arrlist?: ArrayList | undefined) => String | Number'.\n Types of parameters 'value' and 'value' are incompatible.\n Type 'String | Number' is not assignable to type 'number'.\n Type 'String' is not assignable to type 'number'.", + "rule": "Argument of type '(value: number) => number' is not assignable to parameter of type '(value: String | Number, index?: number | undefined, arrlist?: ArrayList | undefined) => String | Number'.\n Types of parameters 'value' and 'value' are incompatible.\n Type 'String | Number' is not assignable to type 'number'.\n Type 'String' is not assignable to type 'number'.", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_url.ets b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets new file mode 100755 index 0000000000000000000000000000000000000000..2a2f5e1d0d953a858df25dab88b0049af15bb659 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2025 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 url from './api/@ohos.url'; + +let paramsObj = new url.URLParams('aa=%E4%B8%AD%E5%9B%BD%BD'); //error +console.log(paramsObj.get('aa')) // 中国%BD console.log(paramsObj.toString()) // aa=%E4%B8%AD%E5%9B%BD%25BD" +const paramsObject1 = new url.URLSearchParams('fod=bay&edg=bap');//error +paramsObject1.append('fod', '3');//error + +let objectParams = new url.URLSearchParams([ ['user1', 'abc1'], ['query2', 'first2'], ['query3', 'second3'] ]);//error +let objectParams1 = new url.URLSearchParams({"fod" : '1' , "bard" : '2'});//error +let objectParams2 = new url.URLSearchParams('?fod=1&bard=2');//error +let urlObject1 = new url.URL('https://developer.mozilla.org/?fod=1&bard=2'); +let params1 = new url.URLSearchParams(urlObject1.search); //error*2 + +const paramsObject2 = new url.URLSearchParams('fod=bay&edg=bap');//error +paramsObject2.delete('fod');//error + +let searchParamsObject1 = new url.URLSearchParams("keyName1=valueName1&keyName2=valueName2");//error +let iter: Iterable = searchParamsObject1.entries();//error +let pairs = Array.from(iter); +for (let pair of pairs) { // Show keyName/valueName pairs + console.log(pair[0]+ ', '+ pair[1]); +} + +const myURLObject = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); +myURLObject.searchParams.forEach((value, name, searchParams) => {//error*2 + console.log(name, value, myURLObject.searchParams === searchParams);//error +}); + +let paramsObject3 = new url.URLSearchParams('name=Jonathan&age=18');//error +let name = paramsObject3.get("name"); //error +let age = paramsObject3.get("age"); //error +let getObj = paramsObject3.get("abc"); //error + +let urlObject2 = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); +let params2 = new url.URLSearchParams(urlObject2.search.slice(1));//error*2 +params2.append('fod', '3');//error +console.log(params2.getAll('fod').toString())//error +let paramsObject4 = new url.URLSearchParams(urlObject2.search.slice(1));//error*2 +paramsObject4.has('bard') === true;//error + +let searchParamsObject2 = new url.URLSearchParams("key1=value1&key2=value2"); //error +let keys = Array.from(searchParamsObject2.keys());//error +for (let key of keys) { + console.log(key); +} + +let urlObject3 = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); +let paramsObject = new url.URLSearchParams(urlObject3.search.slice(1));//error*2 +paramsObject.set('baz', '3');//error + +let searchParamsObject = new url.URLSearchParams("c=3&a=9&b=4&d=2");//error +searchParamsObject.sort(); //error +console.log(searchParamsObject.toString());//error +let urlObject = new url.URL('https://developer.exampleUrl/?fod=1&bard=2'); +let params = new url.URLSearchParams(urlObject.search.slice(1));//error*2 +params.append('fod', '3');//error +console.log(params.toString()); //error + +let searchParams = new url.URLSearchParams("key1=value1&key2=value2");//error +let values = Array.from(searchParams.values());//error +for (let value of values) { console.log(value); } + +//sum:40 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..6705a6661c56fd4dfe44e43918b6e4b0d3163c62 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.arkts2.json @@ -0,0 +1,478 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 17, + "column": 21, + "endLine": 17, + "endColumn": 34, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 27, + "endLine": 19, + "endColumn": 46, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 15, + "endLine": 20, + "endColumn": 21, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 24, + "endLine": 22, + "endColumn": 43, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 25, + "endLine": 23, + "endColumn": 44, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 25, + "endLine": 24, + "endColumn": 44, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 19, + "endLine": 26, + "endColumn": 38, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 50, + "endLine": 26, + "endColumn": 56, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 27, + "endLine": 28, + "endColumn": 46, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 15, + "endLine": 29, + "endColumn": 21, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 31, + "endLine": 31, + "endColumn": 50, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 52, + "endLine": 32, + "endColumn": 59, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 15, + "endLine": 35, + "endColumn": 22, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 30, + "endLine": 35, + "endColumn": 37, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 26, + "endLine": 39, + "endColumn": 33, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 13, + "endLine": 39, + "endColumn": 25, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 40, + "endLine": 40, + "endColumn": 52, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 25, + "endLine": 43, + "endColumn": 44, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 26, + "endLine": 44, + "endColumn": 29, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 25, + "endLine": 45, + "endColumn": 28, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 28, + "endLine": 46, + "endColumn": 31, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 19, + "endLine": 49, + "endColumn": 38, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 50, + "endLine": 49, + "endColumn": 56, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 63, + "endLine": 49, + "endColumn": 64, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 9, + "endLine": 50, + "endColumn": 15, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 21, + "endLine": 51, + "endColumn": 27, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 25, + "endLine": 52, + "endColumn": 44, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 56, + "endLine": 52, + "endColumn": 62, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 69, + "endLine": 52, + "endColumn": 70, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 15, + "endLine": 53, + "endColumn": 18, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 31, + "endLine": 55, + "endColumn": 50, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 43, + "endLine": 56, + "endColumn": 47, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 24, + "endLine": 62, + "endColumn": 43, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 55, + "endLine": 62, + "endColumn": 61, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 68, + "endLine": 62, + "endColumn": 69, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 14, + "endLine": 63, + "endColumn": 17, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 30, + "endLine": 65, + "endColumn": 49, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 66, + "column": 20, + "endLine": 66, + "endColumn": 24, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 32, + "endLine": 67, + "endColumn": 40, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 18, + "endLine": 69, + "endColumn": 37, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 48, + "endLine": 69, + "endColumn": 54, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 61, + "endLine": 69, + "endColumn": 62, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 8, + "endLine": 70, + "endColumn": 14, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 71, + "column": 20, + "endLine": 71, + "endColumn": 28, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 73, + "column": 24, + "endLine": 73, + "endColumn": 43, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 38, + "endLine": 74, + "endColumn": 44, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..7633c79b6aa0073a72cf8f74a66e11dac370f619 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_url.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util.ets b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets new file mode 100755 index 0000000000000000000000000000000000000000..8e8394bb921caf8d24336279349ff4dbd387ea03 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2025 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 util from './@ohos.util'; + +//util.Base64 +let base64 = new util.Base64(); //error +let array = new Uint8Array([99,122,69,122]); +base64.decode(array).then((val) => { //error + console.info(val.toString()); // 115,49,51 +}) +let buff = 'czEz'; +let result0 = base64.decodeSync(buff); //error +console.info("result0 = " + result0); // result = 115,49,51" + +base64.encode(array).then((val) => { //error + console.info(val.toString()); // 99,122,69,122 +}) + +let result1 = base64.encodeSync(array); //error +console.info("result1 = " + result1); // result = 99,122,69,122" + +base64.encodeToString(array).then((val) => { //error + console.info(val); // czEz +}) + +let result2 = base64.encodeToStringSync(array); //error +console.info("result2 = "+ result2); // result = czEz +//util.LruBuffer +class ChildLruBuffer extends util.LruBuffer { //error + length: number=0; //error + constructor(capacity?: number) { + super(capacity); //error + } + afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void { //error + if (isEvict === true) { + console.info('key: ' + key); // 输出结果:key: 11 + console.info('value: ' + value); // 输出结果:value: 1 + console.info('newValue: ' + newValue); // 输出结果:newValue: null + } + } + [Symbol.iterator](): IterableIterator<[ //error + K, + V + ]>{ + return <>; + } +} +class ChildLruBuffer1 extends util.LruBuffer { //error +} +let lru: ChildLruBuffer = new ChildLruBuffer(2); +lru.put(11, 1); //error +lru.put(22, 2); //error +lru.afterRemoval(false,22, 2,1); + +let lru1: ChildLruBuffer1 = new ChildLruBuffer1(2); +lru1.afterRemoval(false,22, 2,1); //error + +let pro : util.LruBuffer = new util.LruBuffer(); //error*2 +pro[Symbol.iterator](); //error +pro.afterRemoval(true,1,2,1); //error +pro.length; //error +pro.clear(); //error +let result4 = pro.contains(20); //error +console.info('result4 = ' + result4); // result = false +pro.createDefault(50); //error +pro.put(2,10); //error +pro.entries(); //error +pro.get(2); //error +pro.remove(20); //error +console.info("result = " + pro.toString()); //error +pro.updateCapacity(100); //error + +let pro3: util.LruBuffer = new util.LruBuffer(); //error*2 +pro3.put(2,10); //error +pro3.put(2,"anhu"); //error +pro3.put("afaf","grfb"); //error +let result3 = pro3.values(); //error +console.info("result3 = " + result3); // result = anhu,grfb" + +let pro4: util.LruBuffer= new util.LruBuffer(); //error*2 +pro4.put(2,10); //error +pro4.put(1,8); //error +console.info("result = " + pro4.length); //error + +//util.Scope +class ScopeDemo extends util.Scope {} //error +class Temperature implements util.ScopeComparable { + private readonly _temp: number; + constructor(value: number) { + this._temp = value; + } + compareTo(value: Temperature) { + return this._temp >= value.getTemp(); + } + getTemp() { + return this._temp; + } + toString(): string { + return this._temp.toString(); + } +} +let tempLower = new Temperature(30); +let tempUpper = new Temperature(40); +let tempMiDF = new Temperature(35); +let range = new util.Scope(tempLower, tempUpper); //error +console.info("result = " + range.clamp(tempMiDF)); //error +console.info("range = " + range); // range = [30, 40]" +let tempLess = new Temperature(20); +let tempMore = new Temperature(45); +let rangeSec = new util.Scope(tempLess, tempMore); //error +range.contains(rangeSec); //error + +let tempMiDS = new Temperature(39); +range.expand(tempMiDF, tempMiDS); //error +range.expand(range); //error +console.info("result = " + result); +range.expand(tempMiDF); //error +console.info("result = " + result); +range.getLower(); //error +range.getUpper(); //error +range.intersect(tempMiDF, tempMiDS); //error +range.intersect(range); //error +range.toString(); //error + +//sum:54 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..182f1b5101867c2eaeccecb49407ab8871a36544 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.arkts2.json @@ -0,0 +1,1068 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 18, + "column": 23, + "endLine": 18, + "endColumn": 29, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 29, + "endLine": 19, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 32, + "endLine": 19, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 36, + "endLine": 19, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 39, + "endLine": 19, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 8, + "endLine": 20, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 22, + "endLine": 24, + "endColumn": 32, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 8, + "endLine": 27, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 22, + "endLine": 31, + "endColumn": 32, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 8, + "endLine": 34, + "endColumn": 22, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 22, + "endLine": 38, + "endColumn": 40, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 5, + "endLine": 44, + "endColumn": 20, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 3, + "endLine": 52, + "endColumn": 4, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 3, + "endLine": 58, + "endColumn": 4, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 3, + "endLine": 42, + "endColumn": 20, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 41, + "endLine": 41, + "endColumn": 50, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 18, + "endLine": 42, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 4, + "endLine": 53, + "endColumn": 19, + "problem": "BuiltinSymbolIterator", + "suggest": "", + "rule": "Using \"Symbol.iterator\" is not allowed in this API (arkts-builtin-symbol-iterator)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 12, + "endLine": 57, + "endColumn": 14, + "problem": "TypeAssertion", + "suggest": "", + "rule": "Only \"as T\" syntax is supported for type casts (arkts-as-casts)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 1, + "endLine": 61, + "endColumn": 2, + "problem": "MissingSuperCall", + "suggest": "", + "rule": "The subclass constructor must call the parent class's parametered constructor (arkts-subclass-must-call-super-constructor-with-args)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 42, + "endLine": 60, + "endColumn": 51, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 43, + "endLine": 62, + "endColumn": 64, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 62, + "endLine": 62, + "endColumn": 63, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 5, + "endLine": 63, + "endColumn": 8, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 9, + "endLine": 63, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 13, + "endLine": 63, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 5, + "endLine": 64, + "endColumn": 8, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 9, + "endLine": 64, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 13, + "endLine": 64, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 24, + "endLine": 65, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 28, + "endLine": 65, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 30, + "endLine": 65, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 45, + "endLine": 67, + "endColumn": 67, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 65, + "endLine": 67, + "endColumn": 66, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 6, + "endLine": 68, + "endColumn": 18, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 25, + "endLine": 68, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 29, + "endLine": 68, + "endColumn": 30, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 31, + "endLine": 68, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 11, + "endLine": 70, + "endColumn": 40, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 43, + "endLine": 70, + "endColumn": 63, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 52, + "endLine": 70, + "endColumn": 61, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 71, + "column": 5, + "endLine": 71, + "endColumn": 20, + "problem": "BuiltinSymbolIterator", + "suggest": "", + "rule": "Using \"Symbol.iterator\" is not allowed in this API (arkts-builtin-symbol-iterator)", + "severity": "ERROR" + }, + { + "line": 71, + "column": 5, + "endLine": 71, + "endColumn": 20, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 5, + "endLine": 72, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 23, + "endLine": 72, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 25, + "endLine": 72, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 27, + "endLine": 72, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 73, + "column": 5, + "endLine": 73, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 5, + "endLine": 74, + "endColumn": 10, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 75, + "column": 19, + "endLine": 75, + "endColumn": 27, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 75, + "column": 28, + "endLine": 75, + "endColumn": 30, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 77, + "column": 5, + "endLine": 77, + "endColumn": 18, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 77, + "column": 19, + "endLine": 77, + "endColumn": 21, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 5, + "endLine": 78, + "endColumn": 8, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 9, + "endLine": 78, + "endColumn": 10, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 11, + "endLine": 78, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 79, + "column": 5, + "endLine": 79, + "endColumn": 12, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 5, + "endLine": 80, + "endColumn": 8, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 9, + "endLine": 80, + "endColumn": 10, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 5, + "endLine": 81, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 12, + "endLine": 81, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 82, + "column": 32, + "endLine": 82, + "endColumn": 40, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 83, + "column": 5, + "endLine": 83, + "endColumn": 19, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 83, + "column": 20, + "endLine": 83, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 85, + "column": 11, + "endLine": 85, + "endColumn": 58, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 85, + "column": 61, + "endLine": 85, + "endColumn": 81, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 85, + "column": 70, + "endLine": 85, + "endColumn": 79, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 86, + "column": 6, + "endLine": 86, + "endColumn": 9, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 86, + "column": 10, + "endLine": 86, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 86, + "column": 12, + "endLine": 86, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 87, + "column": 6, + "endLine": 87, + "endColumn": 9, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 87, + "column": 10, + "endLine": 87, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 88, + "column": 6, + "endLine": 88, + "endColumn": 9, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 89, + "column": 20, + "endLine": 89, + "endColumn": 26, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 92, + "column": 11, + "endLine": 92, + "endColumn": 40, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 92, + "column": 42, + "endLine": 92, + "endColumn": 62, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 92, + "column": 51, + "endLine": 92, + "endColumn": 60, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 6, + "endLine": 93, + "endColumn": 9, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 10, + "endLine": 93, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 12, + "endLine": 93, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 94, + "column": 6, + "endLine": 94, + "endColumn": 9, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 94, + "column": 10, + "endLine": 94, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 94, + "column": 12, + "endLine": 94, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 95, + "column": 33, + "endLine": 95, + "endColumn": 39, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 1, + "endLine": 98, + "endColumn": 39, + "problem": "MissingSuperCall", + "suggest": "", + "rule": "The subclass constructor must call the parent class's parametered constructor (arkts-subclass-must-call-super-constructor-with-args)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 31, + "endLine": 98, + "endColumn": 36, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 104, + "column": 13, + "endLine": 104, + "endColumn": 31, + "problem": "MethodInheritRule", + "suggest": "", + "rule": "Overridden method parameters and return types must respect type inheritance principles (arkts-method-inherit-rule)", + "severity": "ERROR" + }, + { + "line": 114, + "column": 33, + "endLine": 114, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 115, + "column": 33, + "endLine": 115, + "endColumn": 35, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 116, + "column": 32, + "endLine": 116, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 117, + "column": 22, + "endLine": 117, + "endColumn": 27, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 118, + "column": 34, + "endLine": 118, + "endColumn": 39, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 120, + "column": 32, + "endLine": 120, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 121, + "column": 32, + "endLine": 121, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 122, + "column": 25, + "endLine": 122, + "endColumn": 30, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 123, + "column": 7, + "endLine": 123, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 125, + "column": 32, + "endLine": 125, + "endColumn": 34, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 126, + "column": 7, + "endLine": 126, + "endColumn": 13, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 127, + "column": 7, + "endLine": 127, + "endColumn": 13, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 129, + "column": 7, + "endLine": 129, + "endColumn": 13, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 131, + "column": 7, + "endLine": 131, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 132, + "column": 7, + "endLine": 132, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 133, + "column": 7, + "endLine": 133, + "endColumn": 16, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 134, + "column": 7, + "endLine": 134, + "endColumn": 16, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 135, + "column": 7, + "endLine": 135, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..3b5a4f9ce58c8f1e99991d43344b3c76576b64ae --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util.ets.json @@ -0,0 +1,28 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 57, + "column": 12, + "endLine": 57, + "endColumn": 14, + "problem": "TypeAssertion", + "suggest": "", + "rule": "Only \"as T\" syntax is supported for type casts (arkts-as-casts)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets new file mode 100755 index 0000000000000000000000000000000000000000..5a08ed392d9eccd237712354ca36724f34305f76 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2025 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 util from './@ohos.util'; + +function test(obj: Object) { + let type = new util.types(); + type.isArgumentsObject(obj); //error + type.isGeneratorFunction(obj); //error + type.isGeneratorObject(obj); //error + type.isModuleNamespaceObject(obj); //error + type.isProxy(obj); //error + type.isSymbolObject(obj); //error +} + +class A { +} + +util.Aspect.addAfter(A, 'foo', true, (str: string) => { //error +}); +util.Aspect.addBefore(A, 'foo', true, (str: string) => { //error +}); +util.Aspect.replace(A, 'foo', true, (str: string) => { //error +}); + +let base64Helper = new util.Base64Helper(); +let array = new Uint8Array([115, 49, 51]); +let result = base64Helper.encodeToStringSync(array); //error +let cache = new util.LRUCache(); //error +let result1 = cache.put(2, 10); //error +console.log('result = ' + result1); // 输出结果:result = 10 +let pro2: util.LRUCache = new util.LRUCache(); //error +let result5 = pro2.getCapacity(); //error +console.info("result5 = " + result5); +pro2.put(1, 8); //error +let result6 = pro2.getCreateCount(); //error +console.info("result6 = " + result6); +pro2.getMatchCount(); //error +pro2.get(2); +console.info("result = " + pro2.getMissCount()); //error +console.info("result = " + pro2.getPutCount()); //error +pro2.updateCapacity(2); //error +pro2.put(50, 22); //error +pro2.length; //error +pro2.getCapacity(); //error +console.info("result = " + pro2.getRemovalCount()); //error +console.info("result = " + pro2.isEmpty()); +console.info("result = " + pro2.keys()); // 输出结果:result = 2" +console.info("result = " + pro2.put(2, 10)); //error +console.info("result = " + pro2.remove(20)); +let a: number = 5; +new util.LRUCache().length; //error*2 + +let errnum = -1; +console.info("" + util.getErrorString(errnum)); //error + +let res = util.printf("\"%s\"", "hello world!"); //error +console.info(res); // 输出结果:hello world! + +async function fn() { return 'hello world'; } +const addCall = util.promiseWrapper(util.callbackWrapper(fn)); //error + +let decodeWithStreamOptions: util.DecodeWithStreamOptions = { stream: false } //error +let textDecoder1 = new util.TextDecoder("utf-8",{ignoreBOM: true}); //error + +let uint8 = new Uint8Array(6); +uint8[0] = 0xEF; +uint8[1] = 0xBB; +uint8[2] = 0xBF; +uint8[3] = 0x61; +uint8[4] = 0x62; +uint8[5] = 0x63; +console.info("input num:"); +textDecoder1.decode(uint8, {stream: false}); //error + +let textDecoderOptions: util.TextDecoderOptions = { + fatal: false, + ignoreBOM : true +} + +let textEncoder3: util.TextEncoder = new util.TextEncoder(); +let resu = textEncoder3.encode(''); //error + +let textEncoder: util.TextEncoder = new util.TextEncoder(); +let buffer = new ArrayBuffer(4); +let uint = new Uint8Array(buffer); +let result10 = textEncoder.encodeInto('', uint); //error + +//sum:35 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..e4b7427ccf36582b5c87843e72b4f6ab60955961 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.arkts2.json @@ -0,0 +1,668 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 19, + "column": 8, + "endLine": 19, + "endColumn": 25, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 8, + "endLine": 20, + "endColumn": 27, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 8, + "endLine": 21, + "endColumn": 25, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 8, + "endLine": 22, + "endColumn": 31, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 8, + "endLine": 23, + "endColumn": 15, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 8, + "endLine": 24, + "endColumn": 22, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 13, + "endLine": 30, + "endColumn": 21, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 13, + "endLine": 32, + "endColumn": 22, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 13, + "endLine": 34, + "endColumn": 20, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 29, + "endLine": 38, + "endColumn": 32, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 34, + "endLine": 38, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 38, + "endLine": 38, + "endColumn": 40, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 27, + "endLine": 39, + "endColumn": 45, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 17, + "endLine": 40, + "endColumn": 30, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 5, + "endLine": 41, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 21, + "endLine": 41, + "endColumn": 24, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 25, + "endLine": 41, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 28, + "endLine": 41, + "endColumn": 30, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 47, + "endLine": 43, + "endColumn": 60, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 43, + "endLine": 43, + "endColumn": 62, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 5, + "endLine": 44, + "endColumn": 33, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 20, + "endLine": 44, + "endColumn": 31, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 6, + "endLine": 46, + "endColumn": 9, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 10, + "endLine": 46, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 13, + "endLine": 46, + "endColumn": 14, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 5, + "endLine": 47, + "endColumn": 36, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 20, + "endLine": 47, + "endColumn": 34, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 6, + "endLine": 49, + "endColumn": 19, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 10, + "endLine": 50, + "endColumn": 11, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 33, + "endLine": 51, + "endColumn": 45, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 33, + "endLine": 52, + "endColumn": 44, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 6, + "endLine": 53, + "endColumn": 20, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 21, + "endLine": 53, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 6, + "endLine": 54, + "endColumn": 9, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 10, + "endLine": 54, + "endColumn": 12, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 14, + "endLine": 54, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 6, + "endLine": 55, + "endColumn": 12, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 6, + "endLine": 56, + "endColumn": 17, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 33, + "endLine": 57, + "endColumn": 48, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 33, + "endLine": 60, + "endColumn": 36, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 37, + "endLine": 60, + "endColumn": 38, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 40, + "endLine": 60, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 61, + "column": 40, + "endLine": 61, + "endColumn": 42, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 17, + "endLine": 62, + "endColumn": 18, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 21, + "endLine": 63, + "endColumn": 27, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 5, + "endLine": 63, + "endColumn": 18, + "problem": "SdkCommonApiBehaviorChange", + "suggest": "", + "rule": "ArkUI sdk common behavior change api check (arkui-sdk-common-behaviorchange-api)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 1, + "endLine": 63, + "endColumn": 20, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 5, + "endLine": 65, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 65, + "column": 15, + "endLine": 65, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 66, + "column": 24, + "endLine": 66, + "endColumn": 38, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 16, + "endLine": 68, + "endColumn": 22, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 72, + "column": 22, + "endLine": 72, + "endColumn": 36, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 74, + "column": 63, + "endLine": 74, + "endColumn": 69, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 75, + "column": 24, + "endLine": 75, + "endColumn": 40, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 77, + "column": 28, + "endLine": 77, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 78, + "column": 1, + "endLine": 78, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 79, + "column": 1, + "endLine": 79, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 80, + "column": 1, + "endLine": 80, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 81, + "column": 1, + "endLine": 81, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 82, + "column": 1, + "endLine": 82, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 83, + "column": 1, + "endLine": 83, + "endColumn": 9, + "problem": "RuntimeArrayCheck", + "suggest": "", + "rule": "Array bound not checked. (arkts-runtime-array-check)", + "severity": "ERROR" + }, + { + "line": 85, + "column": 14, + "endLine": 85, + "endColumn": 20, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 93, + "column": 25, + "endLine": 93, + "endColumn": 31, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + }, + { + "line": 96, + "column": 30, + "endLine": 96, + "endColumn": 31, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 98, + "column": 28, + "endLine": 98, + "endColumn": 38, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..7633c79b6aa0073a72cf8f74a66e11dac370f619 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_util2.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets new file mode 100755 index 0000000000000000000000000000000000000000..94be7b643e8d9d36d8e9d466d1be827991f29192 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2025 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 Vector from './@ohos.util.Vector'; + +let vector : Vector = new Vector(); //error +vector.add(2); //error +vector.add(4); //error +vector.add(5); //error +vector.add(4); //error +// 使用方法一: +let nums: Array = vector.convertToArray() //error +for (let item of nums) { + console.log("testLog value:" + item); +} +vector.clear(); //error +vector.add(2); //error +vector.clone(); //error +vector.add(2); //error +vector.convertToArray(); //error +vector.add(2); //error +let arr: Array = [] +vector.copyToArray(arr); //error + + +vector.add(2); //error +vector.forEach((value: number, index?: number) => { //error + console.log('value = ' + value, 'index = ' + index); +}); +vector.add(2); //error +vector.get(0); //error +vector.add(2); //error +vector.getCapacity(); //error +vector.getFirstElement(); //error +vector.getIndexFrom(2, 0); //error +vector.getIndexOf(2); //error +vector.getLastElement(); //error +vector.getLastIndexFrom(2, 0); //error +vector.getLastIndexOf(2); //error +vector.has(2); //error +vector.increaseCapacityTo(2); //error +vector.insert(2, 0); //error +vector.isEmpty(); //error +vector.remove(2); //error +vector.removeByIndex(0); //error +vector.removeByRange(0, 1); //error +vector.replaceAllElements((value: number) => { //error + return value; +}); +vector.set(0, 0); //error +vector.setLength(0); //error +vector.sort((firstValue: number, secondValue: number) => { //error + return firstValue - secondValue; +}); +vector.subVector(0, 1); //error +vector.toString(); //error +vector.trimToCurrentLength(); //error +let result = vector.length; //error +//sum:40 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..ede0fe5323c815da19291c3f53bac0bc717789fe --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.arkts2.json @@ -0,0 +1,738 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 18, + "column": 14, + "endLine": 18, + "endColumn": 28, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 31, + "endLine": 18, + "endColumn": 43, + "problem": "GenericCallNoTypeArgs", + "suggest": "", + "rule": "Type inference in case of generic function calls is limited (arkts-no-inferred-generic-params)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 8, + "endLine": 19, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 12, + "endLine": 19, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 8, + "endLine": 20, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 12, + "endLine": 20, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 8, + "endLine": 21, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 12, + "endLine": 21, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 8, + "endLine": 22, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 12, + "endLine": 22, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 35, + "endLine": 24, + "endColumn": 49, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 8, + "endLine": 28, + "endColumn": 13, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 8, + "endLine": 29, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 12, + "endLine": 29, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 8, + "endLine": 30, + "endColumn": 13, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 8, + "endLine": 31, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 31, + "column": 12, + "endLine": 31, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 8, + "endLine": 32, + "endColumn": 22, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 8, + "endLine": 33, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 12, + "endLine": 33, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 8, + "endLine": 35, + "endColumn": 19, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 8, + "endLine": 38, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 12, + "endLine": 38, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 8, + "endLine": 39, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 8, + "endLine": 42, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 12, + "endLine": 42, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 8, + "endLine": 43, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 12, + "endLine": 43, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 8, + "endLine": 44, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 12, + "endLine": 44, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 8, + "endLine": 45, + "endColumn": 19, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 8, + "endLine": 46, + "endColumn": 23, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 8, + "endLine": 47, + "endColumn": 20, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 21, + "endLine": 47, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 24, + "endLine": 47, + "endColumn": 25, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 8, + "endLine": 48, + "endColumn": 18, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 19, + "endLine": 48, + "endColumn": 20, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 8, + "endLine": 49, + "endColumn": 22, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 8, + "endLine": 50, + "endColumn": 24, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 25, + "endLine": 50, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 28, + "endLine": 50, + "endColumn": 29, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 8, + "endLine": 51, + "endColumn": 22, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 23, + "endLine": 51, + "endColumn": 24, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 8, + "endLine": 52, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 12, + "endLine": 52, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 8, + "endLine": 53, + "endColumn": 26, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 53, + "column": 27, + "endLine": 53, + "endColumn": 28, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 8, + "endLine": 54, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 15, + "endLine": 54, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 18, + "endLine": 54, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 55, + "column": 8, + "endLine": 55, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 8, + "endLine": 56, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 15, + "endLine": 56, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 8, + "endLine": 57, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 22, + "endLine": 57, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 58, + "column": 8, + "endLine": 58, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 58, + "column": 22, + "endLine": 58, + "endColumn": 23, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 58, + "column": 25, + "endLine": 58, + "endColumn": 26, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 8, + "endLine": 59, + "endColumn": 26, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 8, + "endLine": 62, + "endColumn": 11, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 12, + "endLine": 62, + "endColumn": 13, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 62, + "column": 15, + "endLine": 62, + "endColumn": 16, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 8, + "endLine": 63, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 63, + "column": 18, + "endLine": 63, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 64, + "column": 8, + "endLine": 64, + "endColumn": 12, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 8, + "endLine": 67, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 18, + "endLine": 67, + "endColumn": 19, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 67, + "column": 21, + "endLine": 67, + "endColumn": 22, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 68, + "column": 8, + "endLine": 68, + "endColumn": 16, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 69, + "column": 8, + "endLine": 69, + "endColumn": 27, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 5, + "endLine": 70, + "endColumn": 27, + "problem": "NumericSemantics", + "suggest": "", + "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", + "severity": "ERROR" + }, + { + "line": 70, + "column": 21, + "endLine": 70, + "endColumn": 27, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..7633c79b6aa0073a72cf8f74a66e11dac370f619 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_vector.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets new file mode 100755 index 0000000000000000000000000000000000000000..69329cb6c927ea476fb4520ccb0a5b1e204258de --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2025 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 convertxml from './@ohos.convertxml'; +let xml1 = ''; +let conv = new convertxml.ConvertXML(); //error +let options: convertxml.ConvertOptions = { //error + trim: false, //error + declarationKey: '', //error + instructionKey: '', //error + attributesKey: '', //error + textKey: '', //error + cdataKey: '', //error + doctypeKey: '', //error + commentKey: '', //error + parentKey: '', //error + typeKey: '', //error + nameKey: '', //error + elementsKey: '' //error +} +let result = JSON.stringify(conv.fastConvertToJSObject(xml1, options)); //error +let options2: convertxml.ConvertOptions = { //error + trim: false, //error + ignoreDeclaration: false, //error + ignoreInstruction: false, //error + ignoreAttributes: false, //error + ignoreComment: false, //error + ignoreCDATA: false, //error + ignoreDoctype: false, //error + ignoreText: false, //error + declarationKey: '', //error + instructionKey: '', //error + attributesKey: '', //error + textKey: '', //error + cdataKey: '', //error + doctypeKey: '', //error + commentKey: '', //error + parentKey: '', //error + typeKey: '', //error + nameKey: '', //error + elementsKey: '' //error +} +let opt:convertxml.ConvertXML; //error + +class Demo extends convertxml.ConvertXML implements convertxml.ConvertOptions{ //error*2 + parentKey: string; //error + typeKey: string; //error + nameKey: string; //error + elementsKey: string; //error + convert(xml: string, options?: convertxml.ConvertOptions | undefined): Object { //error*2 + } +} +//sum :44 \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.args.json b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..3d66dfda837a2e2dada0cee9e0ed73ef58ace12f --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.arkts2.json @@ -0,0 +1,498 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 17, + "column": 27, + "endLine": 17, + "endColumn": 37, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 14, + "endLine": 18, + "endColumn": 39, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 19, + "column": 3, + "endLine": 19, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 20, + "column": 3, + "endLine": 20, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 21, + "column": 3, + "endLine": 21, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 22, + "column": 3, + "endLine": 22, + "endColumn": 20, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 23, + "column": 3, + "endLine": 23, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 24, + "column": 3, + "endLine": 24, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 25, + "column": 3, + "endLine": 25, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 26, + "column": 3, + "endLine": 26, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 27, + "column": 3, + "endLine": 27, + "endColumn": 16, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 28, + "column": 3, + "endLine": 28, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 29, + "column": 3, + "endLine": 29, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 30, + "column": 3, + "endLine": 30, + "endColumn": 18, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 32, + "column": 34, + "endLine": 32, + "endColumn": 55, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 33, + "column": 15, + "endLine": 33, + "endColumn": 40, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 34, + "column": 3, + "endLine": 34, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 35, + "column": 3, + "endLine": 35, + "endColumn": 27, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 36, + "column": 3, + "endLine": 36, + "endColumn": 27, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 37, + "column": 3, + "endLine": 37, + "endColumn": 26, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 38, + "column": 3, + "endLine": 38, + "endColumn": 23, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 39, + "column": 3, + "endLine": 39, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 40, + "column": 3, + "endLine": 40, + "endColumn": 23, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 41, + "column": 3, + "endLine": 41, + "endColumn": 20, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 42, + "column": 3, + "endLine": 42, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 43, + "column": 3, + "endLine": 43, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 44, + "column": 3, + "endLine": 44, + "endColumn": 20, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 45, + "column": 3, + "endLine": 45, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 46, + "column": 3, + "endLine": 46, + "endColumn": 15, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 47, + "column": 3, + "endLine": 47, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 48, + "column": 3, + "endLine": 48, + "endColumn": 17, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 49, + "column": 3, + "endLine": 49, + "endColumn": 16, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 50, + "column": 3, + "endLine": 50, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 51, + "column": 3, + "endLine": 51, + "endColumn": 14, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 52, + "column": 3, + "endLine": 52, + "endColumn": 18, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 54, + "column": 9, + "endLine": 54, + "endColumn": 30, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 61, + "column": 3, + "endLine": 62, + "endColumn": 4, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 32, + "endLine": 56, + "endColumn": 42, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 3, + "endLine": 57, + "endColumn": 21, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 58, + "column": 3, + "endLine": 58, + "endColumn": 19, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 59, + "column": 3, + "endLine": 59, + "endColumn": 19, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 60, + "column": 3, + "endLine": 60, + "endColumn": 23, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 56, + "column": 66, + "endLine": 56, + "endColumn": 80, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 61, + "column": 34, + "endLine": 61, + "endColumn": 59, + "problem": "SdkCommonApiDeprecated", + "suggest": "", + "rule": "ArkUI sdk common deprecated api check (arkui-sdk-common-deprecated-api)", + "severity": "ERROR" + }, + { + "line": 57, + "column": 3, + "endLine": 57, + "endColumn": 12, + "problem": "StrictDiagnostic", + "suggest": "Property 'parentKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'parentKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 58, + "column": 3, + "endLine": 58, + "endColumn": 10, + "problem": "StrictDiagnostic", + "suggest": "Property 'typeKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'typeKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 59, + "column": 3, + "endLine": 59, + "endColumn": 10, + "problem": "StrictDiagnostic", + "suggest": "Property 'nameKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'nameKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 60, + "column": 3, + "endLine": 60, + "endColumn": 14, + "problem": "StrictDiagnostic", + "suggest": "Property 'elementsKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'elementsKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.json b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..690a4fa56d734d5584a70c6128e8b2d6bf7ef18f --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/sdk_xml.ets.json @@ -0,0 +1,58 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 57, + "column": 3, + "endLine": 57, + "endColumn": 12, + "problem": "StrictDiagnostic", + "suggest": "Property 'parentKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'parentKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 58, + "column": 3, + "endLine": 58, + "endColumn": 10, + "problem": "StrictDiagnostic", + "suggest": "Property 'typeKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'typeKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 59, + "column": 3, + "endLine": 59, + "endColumn": 10, + "problem": "StrictDiagnostic", + "suggest": "Property 'nameKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'nameKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + }, + { + "line": 60, + "column": 3, + "endLine": 60, + "endColumn": 14, + "problem": "StrictDiagnostic", + "suggest": "Property 'elementsKey' has no initializer and is not definitely assigned in the constructor.", + "rule": "Property 'elementsKey' has no initializer and is not definitely assigned in the constructor.", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets new file mode 100755 index 0000000000000000000000000000000000000000..4cde50ea3696cb906e30b5fdaab79ac7ed5db29a --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 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 { ArrayList } from './@ohos.util.ArrayList' + +let arrayList = new ArrayList(); +arrayList[Symbol.iterator](); //error \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.args.json b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.args.json new file mode 100755 index 0000000000000000000000000000000000000000..4dfa4f20174c5965ff0a03fe9745d4cece7b7efa --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.args.json @@ -0,0 +1,19 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "mode": { + "arkts2": "" + } +} diff --git a/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.arkts2.json b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.arkts2.json new file mode 100755 index 0000000000000000000000000000000000000000..b11452109518f46dba3d27b43306ad2d9cdb1f09 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.arkts2.json @@ -0,0 +1,38 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [ + { + "line": 18, + "column": 11, + "endLine": 18, + "endColumn": 26, + "problem": "BuiltinSymbolIterator", + "suggest": "", + "rule": "Using \"Symbol.iterator\" is not allowed in this API (arkts-builtin-symbol-iterator)", + "severity": "ERROR" + }, + { + "line": 18, + "column": 11, + "endLine": 18, + "endColumn": 26, + "problem": "SdkCommonApiWhiteList", + "suggest": "", + "rule": "ArkUI sdk common whitelist api check (arkui-sdk-common-whitelist-api)", + "severity": "ERROR" + } + ] +} \ No newline at end of file diff --git a/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.json b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.json new file mode 100755 index 0000000000000000000000000000000000000000..7633c79b6aa0073a72cf8f74a66e11dac370f619 --- /dev/null +++ b/ets2panda/linter/test/sdkcommonapi/symbol_iterator.ets.json @@ -0,0 +1,17 @@ +{ + "copyright": [ + "Copyright (c) 2025 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." + ], + "result": [] +} \ No newline at end of file