1234567891011121314151617181920212223 |
- interface Person {
- // If age exists, then it must be a number; but it is not required to exist.
- age?: number;
- formatName: () => string;
- name: string;
- }
- abstract class FooBase {
- age: number;
- name: string;
- }
- class Foo extends FooBase implements Person {
- constructor(props: string[]) {
- super();
- this.age = 0;
- this.name = "Doe";
- }
- formatName(): string {
- return this.name;
- }
- }
|