egoist / style-inject

Inject style tag to document head.
MIT License
48 stars 23 forks source link

Typescript not supported #26

Open Bielousov opened 2 years ago

Bielousov commented 2 years ago

When trying to use in a TS project, getting an error:

Could not find a declaration file for module 'style-inject'. '/Users/anton/Documents/EasyKnock/git/ek-ui-components/node_modules/style-inject/dist/style-inject.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/style-inject` if it exists or add a new declaration (.d.ts) file containing `declare module 'style-inject';`ts(7016)

tsconfig:

"compilerOptions": {
    "jsx": "react",
    "lib": ["dom", "esnext"],
    "module": "esnext",
    "moduleResolution": "node",
    "outDir": "dist",
    "allowSyntheticDefaultImports": true,
    "declaration": true,
    "esModuleInterop": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "resolveJsonModule": true,
    "sourceMap": true,
    "suppressImplicitAnyIndexErrors": true
  },