style.d.ts 947 B

1234567891011121314151617181920212223242526272829
  1. import type { PrefixStyleProps } from '../core';
  2. /**
  3. * 对给定HTML对象应用给定样式
  4. * @param style {[key: string]: Object}
  5. * 样式表参考结构
  6. * {
  7. * '.selector': {
  8. * 'attrName': 'attr',
  9. * 'padding': '0 0 0 0',
  10. * 'background-color': 'red'
  11. * }
  12. * }
  13. */
  14. export declare function applyStyleSheet(element: HTMLElement, style: {
  15. [key: string]: Object;
  16. }): void;
  17. export declare function subStyleProps<T = Record<string, any>>(style: Record<string, any>, prefix: string, invert?: boolean): T;
  18. export declare function superStyleProps<T extends Record<string, any>, P extends string>(style: T, prefix: P): PrefixStyleProps<T, P>;
  19. /**
  20. * extract group style from mixin style
  21. * @param style
  22. * @param ignoreStyleDict style will be ignore from style
  23. * @returns shape style and rest style
  24. */
  25. export declare function splitStyle(style: {
  26. [keys: string]: any;
  27. }, ignoreStyleDict?: string[]): {
  28. [keys: string]: any;
  29. }[];