We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want a type similar to 'any' but can be initialized only with Object compatible type. Is it possible to do this ?
var a : {any}; a.x = 1; // OK a["x"] = 1; // OK a = {}; // OK a = 1; // Error !
The workaround is to use indexer, but then syntax 'a.x' doesn't work.
var a: {[key: string]: any;}; a = 1; // Error
The text was updated successfully, but these errors were encountered:
I think this is roughly a duplicate of the request here #1809.
Sorry, something went wrong.
Yes, exactly what I want. Thanks
No branches or pull requests
I want a type similar to 'any' but can be initialized only with Object compatible type.
Is it possible to do this ?
The workaround is to use indexer, but then syntax 'a.x' doesn't work.
The text was updated successfully, but these errors were encountered: