• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  type Plant = {
19    tomato: string;
20    tomatoId: number;
21    isTomato: boolean;
22    // potato?: string;  //不支持可选参数
23    // potatoId?: number;
24    // isPotato?: boolean;
25  }
26
27  type MyString = string;
28  type MyNumberType = number;
29  type MyBool = boolean;
30  type MyUnion = string | number | boolean;
31  type MyEnumType = 'keyup' | 'keydown';
32
33  interface Animal {
34    cat: string;
35    isCat: boolean;
36
37    catFunc1(v: MyString): MyString;
38    catFunc2(v: MyNumberType): MyNumberType;
39    catFunc3(v: MyBool): MyBool;
40    catFunc4(v: Plant): string;
41    catFunc5(v: number): Plant;
42  }
43
44  function fun1(v: Plant): number;
45  function fun2(v: boolean): Plant;
46  function fun3(v0: MyString, v1: MyNumberType, v2: MyBool): boolean;
47  function fun4(v: string): MyString;
48  function fun5(v: number): MyNumberType;
49  function fun6(v: boolean): MyBool;
50  function fun7(v: MyUnion): number;
51  function fun8(v: MyEnumType): string;
52}
53
54export default napitest;
55
56