propTypes.ts 566 B

123456789101112131415161718192021222324
  1. import { VueTypeValidableDef, VueTypesInterface, createTypes, toValidableType } from 'vue-types'
  2. import { CSSProperties } from 'vue'
  3. type PropTypes = VueTypesInterface & {
  4. readonly style: VueTypeValidableDef<CSSProperties>
  5. }
  6. const newPropTypes = createTypes({
  7. func: undefined,
  8. bool: undefined,
  9. string: undefined,
  10. number: undefined,
  11. object: undefined,
  12. integer: undefined
  13. }) as PropTypes
  14. class propTypes extends newPropTypes {
  15. static get style() {
  16. return toValidableType('style', {
  17. type: [String, Object]
  18. })
  19. }
  20. }
  21. export { propTypes }