版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
755 B

  1. import type { ComputedRef } from 'vue'
  2. // copy form vue core
  3. type DefaultFactory<T> = (
  4. props: Record<string, unknown>
  5. ) => T | null | undefined
  6. interface PropOptions<T> {
  7. type?: any
  8. required?: boolean
  9. default?: T | DefaultFactory<T> | null | undefined | object
  10. validator?(value: unknown): boolean
  11. }
  12. export declare function defineProp<T = any>(
  13. propName?: string,
  14. options?: PropOptions<T>
  15. ): ComputedRef<T>
  16. type MaybeTupleFunction<T, R> = T extends any[]
  17. ? (...args: T) => R
  18. : T extends (...args: any) => any
  19. ? (...args: Parameters<T>) => R
  20. : T
  21. export declare function defineEmit<
  22. T extends ((...args: any) => any) | any[] = any[]
  23. >(
  24. emitName?: string,
  25. validator?: MaybeTupleFunction<T, any>
  26. ): MaybeTupleFunction<T, void>