mirror of
https://github.com/FortAwesome/Font-Awesome.git
synced 2024-12-26 13:31:30 +08:00
Fix usage for decorated class properties
Given the following `tsconfig.json`: ```json { "compilerOptions": { "emitDecoratorMetadata": true, "experimentalDecorators": true } } ``` The following will currently causes an import error: ```ts import { IconName } from '@fortawesome/fontawesome-common-types'; class MyClass { @MyDecorator icon: IconName; } ``` This is because in some situations TypeScript doesn’t know that `IconName` is a only exists as a type. It will generate an import, which can’t be resolved. Simply adding an empty JavaScript file, will make the environment able to import the package, even though the import value of `IconName` will be `undefined`.
This commit is contained in:
parent
57f1632d73
commit
b1f7b53df3
Loading…
Reference in New Issue
Block a user