- styleのオブジェクトをインデックスシグネチャで参照するように型定義をする
// cssModule.d.ts のようなファイルとして生成
declare module '*.css' {
interface IClassNames {
[className: string]: string
}
const classNames: IClassNames;
export = classNames;
}
// cssModule.d.ts のようなファイルとして生成
declare module '*.css' {
interface IClassNames {
[className: string]: string
}
const classNames: IClassNames;
export = classNames;
}