CSS.d.ts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import { CSSUnitValue } from './cssom';
  2. import type { PropertySyntax } from './interfaces';
  3. /**
  4. * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty#parameters
  5. */
  6. export interface PropertyDefinition {
  7. name: string;
  8. /**
  9. * representing the expected syntax of the defined property. Defaults to "*".
  10. */
  11. syntax: PropertySyntax;
  12. /**
  13. * A boolean value defining whether the defined property should be inherited (true), or not (false). Defaults to false.
  14. */
  15. inherits?: boolean;
  16. interpolable?: boolean;
  17. initialValue?: string;
  18. }
  19. /**
  20. * holds useful CSS-related methods.
  21. * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS
  22. *
  23. * * CSS Typed OM @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions
  24. * * register property @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
  25. * * CSS Layout API
  26. */
  27. export declare const CSS: {
  28. /**
  29. * <number>
  30. * @see https://drafts.csswg.org/css-values-4/#number-value
  31. */
  32. number: (n: number) => CSSUnitValue;
  33. /**
  34. * <percentage>
  35. * @see https://drafts.csswg.org/css-values-4/#percentage-value
  36. */
  37. percent: (n: number) => CSSUnitValue;
  38. /**
  39. * <length>
  40. */
  41. px: (n: number) => CSSUnitValue;
  42. /**
  43. * <length>
  44. */
  45. em: (n: number) => CSSUnitValue;
  46. rem: (n: number) => CSSUnitValue;
  47. /**
  48. * <angle>
  49. */
  50. deg: (n: number) => CSSUnitValue;
  51. /**
  52. * <angle>
  53. */
  54. grad: (n: number) => CSSUnitValue;
  55. /**
  56. * <angle>
  57. */
  58. rad: (n: number) => CSSUnitValue;
  59. /**
  60. * <angle>
  61. */
  62. turn: (n: number) => CSSUnitValue;
  63. /**
  64. * <time>
  65. */
  66. s: (n: number) => CSSUnitValue;
  67. /**
  68. * <time>
  69. */
  70. ms: (n: number) => CSSUnitValue;
  71. /**
  72. * CSS Properties & Values API
  73. *
  74. * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API
  75. * @see https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
  76. * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
  77. */
  78. registerProperty: (definition: PropertyDefinition) => void;
  79. /**
  80. * CSS Layout API
  81. * register layout
  82. *
  83. * @see https://github.com/w3c/css-houdini-drafts/blob/main/css-layout-api/EXPLAINER.md
  84. * @see https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini#css_layout_api
  85. */
  86. registerLayout: (name: string, clazz: any) => void;
  87. };
  88. //# sourceMappingURL=CSS.d.ts.map