If I define let bar: Bar; and assign bar = initialFooConfig;, is bar still of type Bar and an object, or is it now an object in literal notation?
As long as this assignment is possible vice versa (provided initialFooConfig not as const), what is the difference between initialFooConfig and initialBarConfig?
interface IFoo {
code: number;
name: string;
}
export const initialFooConfig: IFoo = {
code: 12,
name: "bar"
}
class Bar implements IFoo {
code: number;
name: string;
constructor(code: number, name: string) {
this.code = code;
this.name = name;
}
}
export const initialBarConfig = new Bar(12,"bar");