/*
 * Copyright (c) 2024 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.
 */
import a from 'assert';
interface b {
    (): string;
    (a: number, b: number, c?: string): number;
    new (): string;
    new (s: string): any;
    [n: number]: () => string;
    [s: string]: any;
    p1: any;
    p2: string;
    p3?: any;
    p4?: number;
    p5: (s: number) => string;
    f1(): any;
    f2?(): any;
    f3(a: string): number;
    f4?(s: number): string;
}
interface c {
    (a: number, b: number, c?: string): number;
}
let d: c = (p: number, q: number, r?: string) => 1;
a(d(1, 1) === 1);
interface e {
    new (s: string): any;
}
let f: e = class {
    a: string;
    constructor(o: string) {
        this.a = o;
    }
};
let g = new f("test");
a(g.a = "test");
interface h {
    p1: any;
    p2: string;
    p3?: any;
    p4?: number;
    p5: (s: number) => string;
}
let i: h = {
    p1: 1,
    p2: "1",
    p5: (n: number) => n.toString(),
};
a(i.p1 === 1);
a(i.p2 === "1");
a(i.p3 === undefined);
a(i.p4 === undefined);
a(i.p5(1) === "1");
interface j {
    f1(): any;
    f2?(): any;
    f3(a: string): number;
    f4?(s: number): string;
}
let k: j = {
    f1: () => 1,
    f3: (m: string) => 1,
    f4: (l: number) => l.toString(),
};
a(k.f1() === 1);
a(k.f2 === undefined);
a(k.f3("1") === 1);
a(k.f4!(2) === "2");
