typings.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import { CompUI } from "./components/CompUI";
  2. export type ICompKeys = keyof typeof CompUI;
  3. export type EditorMode = "editPage" | "editComp" | "preview" | "display";
  4. export type Layout = {
  5. position?: "absolute";
  6. visible?: boolean;
  7. size: [number, number, { unit?: "px" | "%" }?]; // width height wUnit hUnit
  8. direction?: "top" | "bottom"; // 默认top
  9. mask?: string;
  10. alignSelf?: string;
  11. transform?: {
  12. r?: number; // rotate
  13. x?: number; // translateX
  14. y?: number; // marginTop
  15. s?: number; // scale
  16. };
  17. border?: {
  18. style?: string;
  19. width?: number;
  20. color?: string;
  21. radius?: number;
  22. };
  23. zIndex?: number;
  24. margin?: string;
  25. padding?: string;
  26. transformMatrix?: string;
  27. opacity?: number;
  28. radius?: number;
  29. locked?: boolean;
  30. background?: Background;
  31. };
  32. export type Background = {
  33. color?: string;
  34. image?: string;
  35. imageStyle?: string;
  36. position?:
  37. | "bottom"
  38. | "center"
  39. | "left"
  40. | "left-bottom"
  41. | "left-top"
  42. | "right"
  43. | "right-bottom"
  44. | "right-top"
  45. | "top";
  46. repeat?:
  47. | "repeat"
  48. | "no-repeat"
  49. | "repeat-x"
  50. | "repeat-y"
  51. | "repeat-round"
  52. | "repeat-space";
  53. size?: "auto" | "cover" | "contain";
  54. clipPath?: string;
  55. // origin?: "border" | "padding" | "content";
  56. };