/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function func1(arg: Type): Type { return arg; } function func2() { } function func3(a: A, b: string): number | boolean { return true; } declare type PromiseConstructorLike = new (executor: (resolve: (value: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike; interface R { a: number, [x: string]: boolean | number, } interface U extends R<[number, string]> { (): number, readonly(): [boolean, number[]]; } func1() func2<() => {}>(); var o = { a: function () { }, b: function () { }, c() { } } class A { public a() { }; private b any[]>() { } } class W extends T< () => number, [number | string][]> { } class X extends Q implements S<(a:number, b:string) => [number]>, A { } var a: new () => () => string; var b: (a: number | string) => { a: number }; var c: B.T>>[0]; var d: A; var e: T<() => {}>; type E = number | T | string; type P = {a:K, b:Q}; async<() => {}>(); async(); ():number => true; async() => {return "foo";};