@kuma-ui/sheet
Version:
🐻 Kuma UI is a utility-first, zero-runtime CSS-in-JS library that offers an outstanding developer experience and optimized performance.
26 lines (23 loc) • 926 B
TypeScript
import { ICache } from './cache.js';
declare class StyleMap implements ICache<string> {
private static instance;
private map;
private constructor();
static getInstance(): StyleMap;
set(fileName: string, css: string): void;
get(fileName: string): string | undefined;
delete(fileName: string): void;
reset(): void;
}
/**
* The StyleMap singleton class is created to address the issue of unnecessary
* CSS accumulation with Hot Module Replacement (HMR) during development.
* In the previous implementation, the Sheet singleton stores all styles,
* causing problems with HMR, where unnecessary CSS accumulates after each update.
*
* StyleMap associates each file with its corresponding styles, allowing us
* to handle updates for each file individually during HMR. It provides methods
* to add, update and reset styles per file.
*/
declare const styleMap: StyleMap;
export { styleMap };