1/* 2* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 3* Licensed under the Apache License, Version 2.0 (the "License"); 4* you may not use this file except in compliance with the License. 5* You may obtain a copy of the License at 6* 7* http://www.apache.org/licenses/LICENSE-2.0 8* 9* Unless required by applicable law or agreed to in writing, software 10* distributed under the License is distributed on an "AS IS" BASIS, 11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12* See the License for the specific language governing permissions and 13* limitations under the License. 14*/ 15import { AsyncCallback, Callback } from './../basic'; 16 17declare namespace napitest { 18 export enum GrantStatus { 19 PERMISSION_DEFAULT = "", 20 PERMISSION_DENIED = "-1", 21 PERMISSION_GRANTED = "2", 22 PERMISSION_PASS = "3", 23 } 24 25 export enum LaunchReason { 26 UNKNOWN = 0, 27 START_ABILITY = 1, 28 CALL = 2, 29 CONTINUATION = 3, 30 } 31 32 export enum Action { 33 ACTION_HOME = "ohos.want.action.home", 34 ACTION_DIAL = "ohos.want.action.dial", 35 ACTION_SEARCH = "ohos.want.action.search", 36 } 37 38 export enum PlayingState { 39 STATE_NOT_PLAYING, 40 STATE_PLAYING, 41 } 42 43 export enum PlayingTest 44 { 45 STATE_TEST_START, 46 STATE_TEST_END, 47 } 48 49 function fun1(v0: string, v1: GrantStatus): GrantStatus; 50 function fun2(v0: number, v1: LaunchReason): LaunchReason; 51 function fun3(v0: string, v1: Action): Action; 52 function fun4(v0: number, v1: PlayingState): PlayingState; 53 function fun5(V0: string, callback: Callback<LaunchReason>): void; 54 function fun6(v0: string, callback: AsyncCallback<GrantStatus>): void; 55 function fun6(v0: string): Promise<GrantStatus>; 56 function fun8(v0: string): Promise<PlayingTest>; 57 function fun9(v0: PlayingTest): string; 58 function fun10(v: TestStatus): string; 59 function fun11(v: EnumString): string; 60 61 //function fun10(v: TestStatus): string; 62 /*function fun7(v0: LaunchReason[], v1: LaunchReason): number;*/ 63 64 // 数值型枚举 65 export enum TestStatus 66 { 67 STATE_TEST_PERIOD_ONE, 68 STATE_TEST_PERIOD_TWO, 69 STATE_TEST_PERIOD_THREE, 70 STATE_TEST_PERIOD_FOUR, 71 STATE_TEST_PERIOD_FIVE, 72 STATE_TEST_PERIOD_SIX, 73 } 74 75 // 字符型枚举 76 export enum EnumString { 77 ENUM_HOME = 'ohos.want.enum.home', 78 ENUM_DIAL = 'ohos.want.enum.dial', 79 ENUM_SEARCH = 'ohos.want.enum.search', 80 ENUM_WIRELESS_SETTINGS = 'ohos.settings.enum.wireless', 81 } 82} 83 84export default napitest; 85 86