We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
keyof T
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
Playground: https://www.typescriptlang.org/play/#src=const%20feature%20%3D%20%7B%0D%0A%09description%3A%20''%2C%0D%0A%09screenshot%3A%20''%2C%0D%0A%09disabled%3A%20''%0D%0A%7D%3B%0D%0A%0D%0Aconst%20keys%20%3D%20Object.keys(feature)%3B
const feature = { description: '', screenshot: '', disabled: '' }; const list = Object.keys(feature);
keys(o: {}): string[];
typeof list = string[]
keys<T extends object>(o: T): Array<keyof T>;
typeof list = Array<"description" | "screenshot" | "disabled">
const feature = { description: '', screenshot: '', disabled: '' }; const list = Object.keys(feature) as Array<keyof typeof feature>;
The text was updated successfully, but these errors were encountered:
Object.keys is not on TSJS-lib-generator. It should be directly fixed in TypeScript repo.
Sorry, something went wrong.
Indeed, moved to microsoft/TypeScript#32321
No branches or pull requests
Playground: https://www.typescriptlang.org/play/#src=const%20feature%20%3D%20%7B%0D%0A%09description%3A%20''%2C%0D%0A%09screenshot%3A%20''%2C%0D%0A%09disabled%3A%20''%0D%0A%7D%3B%0D%0A%0D%0Aconst%20keys%20%3D%20Object.keys(feature)%3B
Current
Expected
Workaround
The text was updated successfully, but these errors were encountered: