/*
 * 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 assert from "assert";
// 单实现interface
interface g {
    a1: number;
}
class h implements g {
    a1: number = 2;
}
let i = new h();
assert(i.a1 === 2);
// 多实现interface
interface j {
    b1(): string;
}
interface k<T> {
    c1(): void;
}
class l<U> implements j, k<number> {
    c1(): void {
        let z = 'i can swim';
        return;
    }
    b1<y>(): string {
        return 'i can fly';
    }
    d1: number;
}
let m = new l();
assert(m.b1() === 'i can fly');
// 单实现class
class o {
    e1() { return 4; }
}
class p implements o {
    e1(): number {
        return 1;
    }
}
let q = new p();
assert(q.e1() === 1);
// 多实现class
class C3 {
    f1: number;
    g1(): number {
        return 1;
    }
}
class t {
    h1(x: string): string {
        return 'hello 4' + x;
    }
}
class u implements C3, t {
    h1(w: string): string {
        return 'hello 44' + w;
    }
    f1: number;
    g1(): number {
        return 33;
    }
}
let v = new u();
assert(v.g1() === 33);
assert(v.h1('55') === 'hello 4455');
