propTypes.ts 810 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { createTypes } from 'vue-types';
  2. import type { VueTypeValidableDef, VueTypesInterface } from 'vue-types';
  3. import type { CSSProperties, VNodeChild } from 'vue';
  4. export type VueNode = VNodeChild | JSX.Element;
  5. type PropTypes = VueTypesInterface & {
  6. readonly style: VueTypeValidableDef<CSSProperties>;
  7. readonly VNodeChild: VueTypeValidableDef<VueNode>;
  8. // readonly trueBool: VueTypeValidableDef<boolean>;
  9. };
  10. const propTypes = createTypes({
  11. func: undefined,
  12. bool: undefined,
  13. string: undefined,
  14. number: undefined,
  15. object: undefined,
  16. integer: undefined,
  17. }) as PropTypes;
  18. propTypes.extend([
  19. {
  20. name: 'style',
  21. getter: true,
  22. type: [String, Object],
  23. default: undefined,
  24. },
  25. {
  26. name: 'VNodeChild',
  27. getter: true,
  28. type: undefined,
  29. },
  30. ]);
  31. export { propTypes };