Reputation: 32808
I declared an interface like this:
interface IConfigAdmin {
contentCreatedBy: number;
}
Here I am using it:
private getDefaultAdminConfigs = (): IConfigAdmin => {
return {
contentCreatedBy: null
};
}
If I try to set this to [] instead of null it gives an error as I would expect but why is it that when I hover over contentCreatedBy in VS2013 that it says this is a (property) contentCreatedBy: any
Upvotes: 0
Views: 36
Reputation: 14519
You can fix this by casting it to IConfigAdmin
first. This way you get autocompletion to while typing.
I guess it could have inferred the type because of the return statement but I'm not sure.
return <IConfigAdmin> { }
See playground: link
Upvotes: 2