Answer the question
In order to leave comments, you need to log in
How to resolve signature mismatch when using third party libraries?
I create some interface:
export interface Syllable {
readonly id: number;
readonly hiragana?: string;
readonly katakana: string;
readonly transcription: string;
}
Syllable[]
. I inherit from this class, in the body of the method definition I use a function from another library:// underscore.js
return _.shuffle(this.proposed_options);
Syllable[]
, but {}[]
. // underscore.js
<Syllable[]>_.shuffle(this.proposed_options)
Answer the question
In order to leave comments, you need to log in
Shuffle method declaration:
The this.proposed_options class property may not be typed as Syllable.
Rewrite manually but using generic:_.shuffle<Syllable>(this.proposed_options)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question