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
How to extract properties interface from class and do exact match?
class A { a: string } const likeA: $ShapeWithExactMatch<A> = {} // need a: string
I try $Shape, but it do not exact match.
EDIT: Full example
export default class A { some: string constructor<K: {[_: $Keys<A>]: string}>(rec?: K, old?: K) { Object.assign(this, this.constructor.defaults, rec, old) } copy(rec: {[_: $Keys<A>]: string}): this { return new this.constructor(rec, this) } static defaults = { some: 'default' } } const a = new A({some: 'test'}) const b = a.copy({info: 'qq'})
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to extract properties interface from class and do exact match?
I try $Shape, but it do not exact match.
EDIT: Full example
The text was updated successfully, but these errors were encountered: