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 HttpStatus { 26 STATUS0 = 0, 27 STATUS1 = 500, 28 STATUS2 = 503, 29 } 30 interface Human { 31 name: string; 32 age: number; 33 isAboy: true; 34 } 35 36 interface TestClass1 { 37 ahuman: Human; 38 num1: number; 39 str1: string; 40 nums: Array<number>; 41 strs: Array<string>; 42 mans: Array<Human>; 43 if_direct(v1: string, v2: boolean): string; 44 if_callback(v1: string, cb: Callback<string>): string; 45 if_async(v1: string, cb: AsyncCallback<string>): string; 46 } 47 48 function fun2(v2: string, numcc: Array<number>, mancc: Human): Array<Human>; 49 function fun3(v2: string, cb: Callback<string>): void; 50 function fun4(v2: string, cb: AsyncCallback<string>): void; 51 function fun5(v2: boolean, cb: Callback<boolean>): boolean; 52 function fun6(v2: Array<boolean>): boolean; 53 54 namespace Space3 { 55 function fun3(v3: string): string; 56 interface TestClass2 { 57 haha: number; 58 } 59 namespace Space4 { 60 function fun3(v3: string): string; 61 interface TestClass3 { 62 hoho: number; 63 add(v1: Array<number>): number; 64 } 65 } 66 } 67} 68 69export default napitest; 70