class SomeClass {
public data: any;
}
interface IData<any> {}
class SomeClass {
public data: IData<any>;
}
interface IData<any> {}
interface ISomeData {
value: number;
}
class SomeClass {
public data: IData<any>;
}
let data: IData<ISomeData> = new SomeClass().data;
class SomeClass<T> {
public data: T;
}
let numData: number = new SomeClass<number>().data;
let strData: string = new SomeClass<string>().data;
class SomeClass {
data: any;
}
let numData: number = new SomeClass().data as number;
let strData: string = new SomeClass().data as string;