Typescript
The baka-material-you
package distribute typing specific to the Material You Design Language.
Usage
To enable the contextual types for the Material You Design Language:
- Create an
design.d.ts
file. - Declare a module called
baka-core
:
declare module "baka-core" {}
- Import the Material You Design types:
import { BakaDesignMaterialYou } from "baka-material-you/types/design";
- Extend the
BakaDesign
interface with the Material You Design types:
export interface BakaDesign extends BakaDesignMaterialYou {}
You can further override the Material You Design types by adding additional properties to the BakaDesign
interface.
Here's how the design.d.ts
file should look like:
declare module "baka-core" {
import { BakaDesignMaterialYou } from "baka-material-you/types/design";
export interface BakaDesign extends BakaDesignMaterialYou {
// Extend or override here
}
}