-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
Type error in v14.0 #532
Comments
In addition to the above, we're getting a TypeScript error when calling |
I made PR #533 to address this issue feedbacks. src/twemoji.d.tsdeclare interface TwemojiOptions {
/**
* Default: MaxCDN
*/
base?: string;
/**
* Default: .png
*/
ext?: string;
/**
* Default: emoji
*/
className?: string;
/**
* Default: 72x72
*/
size?: string | number;
/**
* To render with SVG use `folder: svg, ext: .svg`
*/
folder?: string;
/**
* The function to invoke in order to generate image src(s).
*/
callback?(icon: string, options: TwemojiOptions): void;
/**
* Default () => ({})
*/
attributes?(): void;
}
declare type Twemoji = {
convert: {
fromCodePoint(hexCodePoint: string): string;
toCodePoint(utf16surrogatePairs: string): string;
};
parse(node: HTMLElement | string, options?: TwemojiOptions): void;
};
declare module 'twemoji' {
const twemoji: Twemoji;
export default twemoji;
} tsconfig.json:{
"ts-node": {
"moduleTypes": {
"twemoji": ["src/twemoji.d.ts"]
},
},
// ...
} |
I had some weird issue with that tsconfig.json workaround above to override the index.d.ts while fix is not merged, where module types was ignored on Linux (GitHub CI) but not on macOS, in the end I just added skipLibCheck as a temporary workaround for the workaround. |
Fix is merged now; FWIW I'm happy to merge whatever typescript fixes there are relatively quickly in the future – we don't use TS at Twitter, so there's always a chance that whatever exists for TS types in master is somehow broken or incorrect. Thanks for catching it. |
Thank you @jdecked for quick merge, i have tested
OR
@Saul-Mirone and @BenjaminNolan all good on your side now using 14.0.1 ? |
Describe the bug
To Reproduce
Steps to reproduce the behavior:
git checkout renovate/all
pnpm install && pnpm build --filter=@milkdown/plugin-emoji
Expected behavior
Typescript compile can pass with no error.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
For web, specify your OS and browser version. For mobile, specify device, OS
and version. For libraries, what version of build tools are you using?
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: