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    export enum HttpStatus {
50        STATUS0 = 0,
51        STATUS1 = 500,
52        STATUS2 = 503,
53    }
54
55    function fun1(v0: string, v1: GrantStatus): GrantStatus;
56    function fun2(v0: number, v1: LaunchReason): LaunchReason;
57    function fun3(v0: string, v1: Action): Action;
58    function fun4(v0: number, v1: PlayingState): PlayingState;
59    function fun5(V0: string, callback: Callback<LaunchReason>): void;
60    function fun6(v0: string, callback: AsyncCallback<GrantStatus>): void;
61    function fun6(v0: string): Promise<GrantStatus>;
62    function fun8(v0: string): Promise<PlayingTest>;
63    function fun9(v0: PlayingTest): string;
64    function fun10(v: TestStatus): string;    
65    function fun11(v: EnumString): string;
66    function fun12(v: HttpStatus): number;
67
68    /*function fun7(v0: LaunchReason[], v1: LaunchReason): number;  待支持*/
69
70    // 数值型枚举
71    export enum TestStatus
72    {
73        STATE_TEST_PERIOD_ONE,
74        STATE_TEST_PERIOD_TWO,
75        STATE_TEST_PERIOD_THREE,
76        STATE_TEST_PERIOD_FOUR,
77        STATE_TEST_PERIOD_FIVE,
78        STATE_TEST_PERIOD_SIX,
79    }
80
81    // 字符型枚举
82    export enum EnumString {
83        ENUM_HOME = 'ohos.want.enum.home',
84        ENUM_DIAL = 'ohos.want.enum.dial',
85        ENUM_SEARCH = 'ohos.want.enum.search',
86        ENUM_WIRELESS_SETTINGS = 'ohos.settings.enum.wireless',
87    }
88}
89
90export default napitest;
91
92