18c339a94Sopenharmony_ci/* 28c339a94Sopenharmony_ci* Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development Co., Ltd. 38c339a94Sopenharmony_ci* Licensed under the Apache License, Version 2.0 (the "License"); 48c339a94Sopenharmony_ci* you may not use this file except in compliance with the License. 58c339a94Sopenharmony_ci* You may obtain a copy of the License at 68c339a94Sopenharmony_ci* 78c339a94Sopenharmony_ci* http://www.apache.org/licenses/LICENSE-2.0 88c339a94Sopenharmony_ci* 98c339a94Sopenharmony_ci* Unless required by applicable law or agreed to in writing, software 108c339a94Sopenharmony_ci* distributed under the License is distributed on an "AS IS" BASIS, 118c339a94Sopenharmony_ci* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128c339a94Sopenharmony_ci* See the License for the specific language governing permissions and 138c339a94Sopenharmony_ci* limitations under the License. 148c339a94Sopenharmony_ci*/ 158c339a94Sopenharmony_ciimport { AsyncCallback, Callback } from './basic'; 168c339a94Sopenharmony_ci 178c339a94Sopenharmony_cideclare namespace napitest { 188c339a94Sopenharmony_ci 198c339a94Sopenharmony_ci export class A { 208c339a94Sopenharmony_ci a: string; 218c339a94Sopenharmony_ci } 228c339a94Sopenharmony_ci 238c339a94Sopenharmony_ci export interface InterfaceA { 248c339a94Sopenharmony_ci // callFunction: (result: number) => void; 258c339a94Sopenharmony_ci onCallFunction(res: number): void; 268c339a94Sopenharmony_ci } 278c339a94Sopenharmony_ci 288c339a94Sopenharmony_ci // export const addByClass: (a: A, b: number, callback: (result: number) => void, c: InterfaceA) => number; 298c339a94Sopenharmony_ci 308c339a94Sopenharmony_ci export interface InterfaceB { 318c339a94Sopenharmony_ci // register形式注册回调 328c339a94Sopenharmony_ci registerInterfaceB(callback: (dd: number) => void); 338c339a94Sopenharmony_ci // unRegister形式注销回调 348c339a94Sopenharmony_ci unRegisterInterfaceB(callback: (dd: number) => void); 358c339a94Sopenharmony_ci 368c339a94Sopenharmony_ci // object注册回调 378c339a94Sopenharmony_ci addInterfaceAListener(listener: InterfaceA); 388c339a94Sopenharmony_ci removeInterfaceAListener(listener: InterfaceA); 398c339a94Sopenharmony_ci 408c339a94Sopenharmony_ci // 调用回调 418c339a94Sopenharmony_ci gByClass: (a: A, b: number) => number; 428c339a94Sopenharmony_ci } 438c339a94Sopenharmony_ci 448c339a94Sopenharmony_ci} 458c339a94Sopenharmony_ci 468c339a94Sopenharmony_ciexport default napitest; 47