fix Fontkit typing
The avocode/fontkit library is in plain JS and does not provide types.
This should fix the "Cannot find type definition file for 'avocode-fontkit'" error popping up in TS project builds when a project uses opendesign/sdk.
(WIP, needs to be tested)
This doesn't build out of the box. Is this an issue with the code or the TypeScript config?
$ tsc --outDir dist --sourceMap --declaration --project ./tsconfig-build.json
src/local/system-font-manager.ts:290:39 - error TS7006: Parameter 'fontInfo' implicitly has an 'any' type.
290 fontCollection.fonts.forEach((fontInfo) => {
~~~~~~~~
Found 1 error.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 2
Command: /usr/local/bin/node
Arguments: /usr/share/yarn/lib/cli.js run build
Directory: /workspaces/open-design-sdk/sdk
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It is an issue with missing typing info, not TS config. I did not have time to test this PR yesterday so I just drafted it out.
The any has to be explicit here fontInfo: any for the error to disappear. Since the library does not have types, I think it is OK to do it this way for now.
As a workaround, you can set "skipLibCheck": true in your tsconfig.json
@xorb good workaround, but I'd love to fix this for real. Ping @petrbrzek @rychlis