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
Turns out that TypeScript complains when adding path to meta and I'd love to understand exactly why or whether this is expected or not.
Here goes the message:
Transcription:
(parameter) file: File
Type '{ path: any; }' is not assignable to type '{ name: string; type?: string | undefined; }'.
Object literal may only specify known properties, and 'path' does not exist in type '{ name: string; type?: string | undefined; }'.ts(2322)
index.d.ts(11, 3): The expected type comes from property 'meta' which is declared here on type 'AddFileOptions'
Must anticipate I do understand the technical issue, but can't understand why I can't extend the meta.
Thanks!
The text was updated successfully, but these errors were encountered:
Hmm, so I think when the typings were introduced the idea was to have strongly typed metadata. addFile() doesn't have the TMeta generic parameter that some of the other methods have, so it doesn't pass that through.
If I just add it like on the other methods, it still doesn't work though … will keep looking, at worst we'll have to just loosen the metadata type to be { name: string, type?: string, [anythingElse: string]: any }
Hey there!
I have a dead simple snippet that actually works:
Turns out that TypeScript complains when adding
path
tometa
and I'd love to understand exactly why or whether this is expected or not.Here goes the message:
Must anticipate I do understand the technical issue, but can't understand why I can't extend the meta.
Thanks!
The text was updated successfully, but these errors were encountered: