package.json
...
"@fortawesome/fontawesome": "^1.1.2",
"@fortawesome/fontawesome-free-brands": "^5.0.4",
"@fortawesome/fontawesome-free-regular": "^5.0.4",
"@fortawesome/fontawesome-free-solid": "^5.0.4",
...
index.d.ts
export interface DOM {
i2svg(params: { node: Node; callback: () => void }): void;
css(): string;
insertCss(): string;
}
because i2svg takes a non optional params object I can't call it fontawsome.dom.i2svg() as typescript compiler rightly complains.
if you change i2svg(params: { node: Node; callback: () => void }): void;
css(): string; to i2svg(params?: { node: Node; callback: () => void }): void;
css(): string; it seems to work.
@robmadole could you please check this?
Are you the right person to deal with typescript issues or there is someone else in the team?
Hey @tagliala I'll throw this one to @mlwilkerson. He's the TS SME.
Any progress on this issue? It's preventing me to use in my Typescript project as well
No update yet. We'll get to it as soon as we can.
Hi @robmadole @mlwilkerson
Any progress on this issue? I got some similar problems when using this in my TS project. :-(
Regards
Martin
Ok we鈥檝e got the simple fix in a PR in our build system and aim to have this out as part of the 5.1 prereleases
For anyone else running into this that is as unfamiliar with TypeScript as me, I muddled around and managed to get this working by merging a new, correct declaration in locally just before the call to i2svg:
declare module "@fortawesome/fontawesome" {
interface DOM {
i2svg(params?: { node?: Node; callback?: () => void }): void;
}
}
I think this issue can be closed now, since it's appear to be fixed
Thanks for the clean-up hint @tomyam1 :+1:
Most helpful comment
Hi @robmadole @mlwilkerson
Any progress on this issue? I got some similar problems when using this in my TS project. :-(
Regards
Martin