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
Type '({ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; } | ... 8 more ... | { ...; })[]' is not assignable to type 'FlatEmoji[] | MinifiedEmoji[]'.
Type '({ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; } | ... 8 more ... | { ...; })[]' is not assignable to type 'FlatEmoji[]'.
Type '{ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; } | ... 8 more ... | { ...; }' is not assignable to type 'FlatEmoji'.
Type '{ annotation: string; hexcode: string; emoji: string; text: string; type: number; version: number; shortcodes: string[]; tags?: undefined; order?: undefined; group?: undefined; subgroup?: undefined; emoticon?: undefined; skins?: undefined; tone?: undefined; gender?: undefined; }' is not assignable to type 'FlatEmoji'.
Types of property 'type' are incompatible.
Type 'number' is not assignable to type 'Presentation'.ts(2322)
base-moji.d.ts(7, 5): The expected type comes from property 'data' which is declared here on type 'MojiProps'
Possible Solution
Fix the types.
Either change the union type of Presentation from 1 | 2 to number, or update the type of svgmoji/emoji.json to make sure that type is of type 1 | 2. I think that the second option is the best one, maybe you can import the json file in a ts file, then perform some checks to narrow the types or just use a type cast, and then export the data variable.
The text was updated successfully, but these errors were encountered:
Summary
The type definitions of the library are wrong, because the example code gives errors.
Steps to reproduce
Expected results
No type errors.
Actual results
This error:
Possible Solution
Fix the types.
Either change the union type of
Presentation
from1 | 2
tonumber
, or update the type ofsvgmoji/emoji.json
to make sure thattype
is of type1 | 2
. I think that the second option is the best one, maybe you can import the json file in a ts file, then perform some checks to narrow the types or just use a type cast, and then export the data variable.The text was updated successfully, but these errors were encountered: