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
Interface shorthand, sugar syntax, interfaces of same type, types of same type
Can a shorthand be added to create interfaces/types that have all keys of same type.
Reduce the no of lines & also help in readability.
export interface AllStrings { prop1: string; prop2: string; }
to something like
export interface AllStrings<type: string> { prop1,prop2; }
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered:
What about:
type AllStrings = Record<"prop1" | "prop2", string>
Sorry, something went wrong.
No branches or pull requests
Search Terms
Interface shorthand, sugar syntax, interfaces of same type, types of same type
Suggestion
Can a shorthand be added to create interfaces/types that have all keys of same type.
Use Cases
Reduce the no of lines & also help in readability.
Examples
export interface AllStrings { prop1: string; prop2: string; }
to something like
export interface AllStrings<type: string> { prop1,prop2; }
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: