• 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    interface Human {
19        name: string;
20        age: number;
21    }
22
23    interface GrandFar extends Human{
24        eyesType: number;
25        getSkin(v: number): string;
26        getSkinSync(v: number, skin: Callback<string>): void;
27        getSkinAsync(v: number, skin: AsyncCallback<string>): void;
28    }
29
30    interface Farther extends GrandFar {
31        getShoes(): string;
32        getShoesSync(shoes: Callback<string>): void;
33        getShoesAsync(shoes: AsyncCallback<string>): void;
34    }
35
36    class Animal {
37        aniName: string;
38        size: number;
39        static getAnimalType(aniId: number): string;
40        setAnimalId(id: number): void;
41    }
42
43    class Cat extends Animal {
44        catName:string;
45        static getCatType(catId: number): string;
46    }
47
48    interface SuperAnimal {
49        aniName: string;
50        size: number;
51        setAnimalId(id: number): void;
52    }
53
54    class SuperHuman {
55        name: string;
56        age: number;
57        static getAnimalType(aniId: number): string;
58    }
59
60    interface Bob extends Human, Animal {
61        bobSkill: string;
62        getBobCardId(): number;
63    }
64
65    class Juliya extends SuperHuman implements SuperAnimal {
66        aniName: string;
67        size: number;
68        setAnimalId(id: number): void;
69        juliyaSkill: string;
70        getJuliyaCardId(): number;
71    }
72
73    function findJuliya(v1: Juliya): Juliya;
74    function findJuliyaSync(v1: string, callback: Callback<Juliya>): void;
75    function findJuliyaAsync(v1: string, callback: AsyncCallback<Juliya>): void;
76
77    interface Tom {
78        name: string;
79        friends: Cat;
80    }
81
82    interface TestMember {
83        getTomcat(v1: string, v2: Array<Tom>): Tom;
84    }
85}
86
87export default napitest;
88