版博士V2.0程序
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import type { ComponentObjectPropsOptions } from 'vue/types/v3-component-props'
  2. import type { ComputedRef, DeepReadonly, ExtractPropTypes, Ref } from 'vue'
  3. import {} from 'vue/types/v3-setup-context'
  4. export declare type PropRefs<T> = {
  5. [K in keyof T]-?: ComputedRef<DeepReadonly<T[K]>>
  6. }
  7. export declare type NotUndefined<T> = T extends undefined ? never : T
  8. export declare type InferDefault<P, T> = T extends
  9. | null
  10. | number
  11. | string
  12. | boolean
  13. | symbol
  14. | Function
  15. ? T | ((props: P) => T)
  16. : (props: P) => T
  17. export declare type InferDefaults<T> = {
  18. [K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>
  19. }
  20. export declare type PropsWithDefaults<Base, Defaults> = Base & {
  21. [K in keyof Defaults]: K extends keyof Base
  22. ? Defaults[K] extends undefined
  23. ? Base[K]
  24. : NotUndefined<Base[K]>
  25. : never
  26. }
  27. export declare function withDefaults<
  28. PropsWithRefs extends PropRefs<Record<string, any>>,
  29. Defaults extends InferDefaults<Props>,
  30. Props = {
  31. -readonly [K in keyof PropsWithRefs]: PropsWithRefs[K] extends Readonly<
  32. Ref<infer T>
  33. >
  34. ? T
  35. : PropsWithRefs[K]
  36. }
  37. >(props: PropsWithRefs, defaults: Defaults): PropRefs<Props>
  38. export declare function withDefaults<
  39. Props,
  40. Defaults extends InferDefaults<Props>
  41. >(props: Props, defaults: Defaults): PropsWithDefaults<Props, Defaults>
  42. export declare function definePropsRefs<PropNames extends string = string>(
  43. props: PropNames[]
  44. ): PropRefs<{
  45. [key in PropNames]: Ref<any>
  46. }>
  47. export declare function definePropsRefs<
  48. PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions
  49. >(props: PP): PropRefs<ExtractPropTypes<PP>>
  50. export declare function definePropsRefs<TypeProps>(): PropRefs<TypeProps>