AB
Size: a a a
AB
AK
AB
abstract class Base {
abstract foo():string;
}
class Child extends Base {
foo() {
return 'foo';
}
}
const map = new Map<any, any>();
function create<T extends Base>(key:any):T {
return map.get(key);
}
const base = create(Base); // ok
const child = create(Child); // ok
base.foo(); // ok
child.foo(); // okAB
AB
AB
AK
AK
AK
AB
abstract class Base implements IBase {
abstract foo():string;
}
abstract class AnotherBase {
abstract bar():number;
}
class Child extends Base {
foo() {
return 'foo';
}
}
const map = new Map<any, any>();
function create<T>(key:any):T {
return <T> map.get(key);
}
const base = create<Base>(Base); // ok
const anotherBase = create<AnotherBase>(AnotherBase); // ok
const child = create<Child>(Child); // ok
base.foo(); // ok
anotherBase.bar(); // ok
child.foo(); // okAB
AB
Config.get<IApplicationConfig>(filename)AB
Config.getApplicationConfig()AB
AB
AB
AB
AK
AB
AK