Typings
In this library there some useful TypeScript typings for your projects that you can use.
You can create .d.ts file in your project (for example global.d.ts) and add it via references.
CSS-modules typings
This declare types for .module.css and .m.css files.
Usage:
global.d.ts
/// <reference types="@krutoo/utils/typings/css-modules" />
Regular CSS
This declare types for .css files for side effects imports.
Usage:
global.d.ts
/// <reference types="@krutoo/utils/typings/css" />
Using together with css-modules typings
Note that when both css typings and css-modules typings used, css-modules reference must be first, like this:
global.d.ts
/// <reference types="@krutoo/utils/typings/css-modules" />
/// <reference types="@krutoo/utils/typings/css" />
This is because more specific glob (*.module.css) must be used before less specific (*.css).
React-SVG modules typings
This declare types for .svg files as React-components.
Usage:
global.d.ts
/// <reference types="@krutoo/utils/typings/react-svg" />