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 // 函数单参数非嵌套场景 19 function fun1(mancc: {name: string, age: number}): string; 20 21 interface TestInterfaceAA { 22 an: string; 23 al: string; 24 } 25 interface TestInterface { 26 anchor: string; 27 align: string; 28 // interface域变量场景 29 left: { test1: string, test2: string }; 30 } 31 32 class TestInterfaceBB{ 33 // 函数多参数非嵌套场景 34 func1(name : string, fp3: {nm: string, age: number, flag: boolean}): string; 35 36 // 函数返回值场景 37 func2(input: string): { read: number; written: number; flag: boolean }; 38 39 // Promise返回值逗号场景 40 func3(from: string, to: string): Promise<{result: number, errMsg: string, isT: boolean}>; 41 42 // Promise返回值分号场景 43 func4(from: string, to: string): Promise<{result: number; errMsg: string; isT: boolean}>; 44 } 45 46 function fun2(fp2: TestInterface): string; 47 48 // 函数多参数非嵌套场景 49 function fun3(name : string, fp3: {nm: string, age: number}): string; 50 51 // 函数返回值场景 52 function fun4(input: string): { read: number; written: number }; 53 54 // 函数单参数嵌套场景 55 function fun5(value: {xOffset: number, animation: { duration: number, curve: string}}); 56 57 // 函数多参数嵌套场景 58 function fun6(nm: string, value: {xOffset: number, animation: { duration: number, curve: string}}); 59 60 // 暂不支持 分号场景 61 function fun7(nm: string, value: {xOffset: number; animation: { duration: number; curve: string}}); 62 63 // Promise匿名interface返回值场景, 分号场景 64 function fun8(from: string): Promise<{result: number; errMsg: string; isT: boolean}>; 65 66 // Promise匿名interface返回值场景, 逗号场景 67 function fun9(from: string): Promise<{result: number, errMsg: string, isT: boolean}>; 68} 69 70export default napitest;