useCSSVarRegister.d.ts 743 B

1234567891011121314151617181920
  1. import type { TokenWithCSSVar } from '../util/css-variables';
  2. import type { ExtractStyle } from './useGlobalCache';
  3. export declare const CSS_VAR_PREFIX = "cssVar";
  4. type CSSVarCacheValue<V, T extends Record<string, V> = Record<string, V>> = [
  5. cssVarToken: TokenWithCSSVar<V, T>,
  6. cssVarStr: string,
  7. styleId: string,
  8. cssVarKey: string
  9. ];
  10. declare const useCSSVarRegister: <V, T extends Record<string, V>>(config: {
  11. path: string[];
  12. key: string;
  13. prefix?: string;
  14. unitless?: Record<string, boolean>;
  15. ignore?: Record<string, boolean>;
  16. scope?: string;
  17. token: any;
  18. }, fn: () => T) => CSSVarCacheValue<V, T>;
  19. export declare const extract: ExtractStyle<CSSVarCacheValue<any>>;
  20. export default useCSSVarRegister;