You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.
TS2322: Type '{ test: Ref ; addToPlus: () => void; }' is not assignable to type 'Partial >'.
What's interesting about this error in particular is that Partial is not a primitive type, but rather a utility type. This makes me think there is a bug in TypeScript
Playing around with the typings, I managed to get this working on the consuming side of things:
However, while trying to extract this logic out to a sensible version in the library itself, I saw errors. The following is the closest approximation to the types that I wanted to see:
However, this code doesn't work either. I get the following error:
TS2416: Property 'ngOnSetup' in type 'AppComponent' is not assignable to the same property in base type 'OnSetup'. Type '(props: this) => Partial<Record<"prototype", any>>' is not assignable to type '<T>(props: this) => Partial<Record<keyof (T extends new (...args: any) => any ? any : any), any>>'. Type 'Partial<Record<"prototype", any>>' is not assignable to type 'Partial<Record<keyof (T extends new (...args: any) => any ? any : any), any>>'
The text was updated successfully, but these errors were encountered:
I would love for the
ngOnSetup
function to enforce the return type of thesetup
function.While I would love for the typings to be as simple as:
I seem to get errors while doing so:
Playing around with the typings, I managed to get this working on the consuming side of things:
However, while trying to extract this logic out to a sensible version in the library itself, I saw errors. The following is the closest approximation to the types that I wanted to see:
However, this code doesn't work either. I get the following error:
The text was updated successfully, but these errors were encountered: