index.d.mts 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. import * as vue from 'vue';
  2. import { ComponentPropsOptions, ExtractPropTypes, PropType } from 'vue';
  3. interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
  4. filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): [yes: Partial<Pick<T, U>>, no: Omit<T, U>];
  5. }
  6. type DefaultsInstance = undefined | {
  7. [key: string]: undefined | Record<string, unknown>;
  8. global?: Record<string, unknown>;
  9. };
  10. type DefaultsOptions = Partial<DefaultsInstance>;
  11. declare const VDefaultsProvider: {
  12. new (...args: any[]): {
  13. $: vue.ComponentInternalInstance;
  14. $data: {};
  15. $props: {
  16. disabled?: boolean | undefined;
  17. scoped?: boolean | undefined;
  18. key?: string | number | symbol | undefined;
  19. style?: unknown;
  20. reset?: string | number | undefined;
  21. class?: unknown;
  22. root?: string | boolean | undefined;
  23. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  24. default?: (() => vue.VNodeChild) | undefined;
  25. };
  26. ref?: vue.VNodeRef | undefined;
  27. ref_for?: boolean | undefined;
  28. ref_key?: string | undefined;
  29. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  30. 'v-slots'?: {
  31. default?: false | (() => vue.VNodeChild) | undefined;
  32. } | undefined;
  33. defaults?: DefaultsOptions;
  34. onVnodeBeforeMount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  35. [key: string]: any;
  36. }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  37. [key: string]: any;
  38. }>) => void)[] | undefined;
  39. onVnodeMounted?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  40. [key: string]: any;
  41. }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  42. [key: string]: any;
  43. }>) => void)[] | undefined;
  44. onVnodeBeforeUpdate?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  45. [key: string]: any;
  46. }>, oldVNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  47. [key: string]: any;
  48. }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  49. [key: string]: any;
  50. }>, oldVNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  51. [key: string]: any;
  52. }>) => void)[] | undefined;
  53. onVnodeUpdated?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  54. [key: string]: any;
  55. }>, oldVNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  56. [key: string]: any;
  57. }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  58. [key: string]: any;
  59. }>, oldVNode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  60. [key: string]: any;
  61. }>) => void)[] | undefined;
  62. onVnodeBeforeUnmount?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  63. [key: string]: any;
  64. }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  65. [key: string]: any;
  66. }>) => void)[] | undefined;
  67. onVnodeUnmounted?: ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  68. [key: string]: any;
  69. }>) => void) | ((vnode: vue.VNode<vue.RendererNode, vue.RendererElement, {
  70. [key: string]: any;
  71. }>) => void)[] | undefined;
  72. };
  73. $attrs: {
  74. [x: string]: unknown;
  75. };
  76. $refs: {
  77. [x: string]: unknown;
  78. };
  79. $slots: Readonly<{
  80. default?: (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
  81. [key: string]: any;
  82. }>[]) | undefined;
  83. }>;
  84. $root: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
  85. $parent: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
  86. $emit: (event: string, ...args: any[]) => void;
  87. $el: any;
  88. $options: vue.ComponentOptionsBase<{
  89. disabled: boolean;
  90. scoped: boolean;
  91. } & {
  92. reset?: string | number | undefined;
  93. root?: string | boolean | undefined;
  94. defaults?: DefaultsOptions;
  95. } & {
  96. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  97. default?: (() => vue.VNodeChild) | undefined;
  98. };
  99. 'v-slots'?: {
  100. default?: false | (() => vue.VNodeChild) | undefined;
  101. } | undefined;
  102. } & {
  103. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  104. }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
  105. [key: string]: any;
  106. }>[] | undefined, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
  107. disabled: boolean;
  108. scoped: boolean;
  109. }, {}, string, vue.SlotsType<Partial<{
  110. default: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
  111. [key: string]: any;
  112. }>[];
  113. }>>> & {
  114. beforeCreate?: ((() => void) | (() => void)[]) | undefined;
  115. created?: ((() => void) | (() => void)[]) | undefined;
  116. beforeMount?: ((() => void) | (() => void)[]) | undefined;
  117. mounted?: ((() => void) | (() => void)[]) | undefined;
  118. beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
  119. updated?: ((() => void) | (() => void)[]) | undefined;
  120. activated?: ((() => void) | (() => void)[]) | undefined;
  121. deactivated?: ((() => void) | (() => void)[]) | undefined;
  122. beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
  123. beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
  124. destroyed?: ((() => void) | (() => void)[]) | undefined;
  125. unmounted?: ((() => void) | (() => void)[]) | undefined;
  126. renderTracked?: (((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[]) | undefined;
  127. renderTriggered?: (((e: vue.DebuggerEvent) => void) | ((e: vue.DebuggerEvent) => void)[]) | undefined;
  128. errorCaptured?: (((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: vue.ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, vue.ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null, info: string) => boolean | void)[]) | undefined;
  129. };
  130. $forceUpdate: () => void;
  131. $nextTick: typeof vue.nextTick;
  132. $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: vue.WatchOptions<boolean> | undefined): vue.WatchStopHandle;
  133. } & {
  134. disabled: boolean;
  135. scoped: boolean;
  136. } & {
  137. reset?: string | number | undefined;
  138. root?: string | boolean | undefined;
  139. defaults?: DefaultsOptions;
  140. } & {
  141. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  142. default?: (() => vue.VNodeChild) | undefined;
  143. };
  144. 'v-slots'?: {
  145. default?: false | (() => vue.VNodeChild) | undefined;
  146. } | undefined;
  147. } & {
  148. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  149. } & vue.ShallowUnwrapRef<() => vue.VNode<vue.RendererNode, vue.RendererElement, {
  150. [key: string]: any;
  151. }>[] | undefined> & {} & vue.ComponentCustomProperties & {};
  152. __isFragment?: undefined;
  153. __isTeleport?: undefined;
  154. __isSuspense?: undefined;
  155. } & vue.ComponentOptionsBase<{
  156. disabled: boolean;
  157. scoped: boolean;
  158. } & {
  159. reset?: string | number | undefined;
  160. root?: string | boolean | undefined;
  161. defaults?: DefaultsOptions;
  162. } & {
  163. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  164. default?: (() => vue.VNodeChild) | undefined;
  165. };
  166. 'v-slots'?: {
  167. default?: false | (() => vue.VNodeChild) | undefined;
  168. } | undefined;
  169. } & {
  170. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  171. }, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
  172. [key: string]: any;
  173. }>[] | undefined, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, {
  174. disabled: boolean;
  175. scoped: boolean;
  176. }, {}, string, vue.SlotsType<Partial<{
  177. default: () => vue.VNode<vue.RendererNode, vue.RendererElement, {
  178. [key: string]: any;
  179. }>[];
  180. }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
  181. defaults: PropType<DefaultsOptions>;
  182. disabled: BooleanConstructor;
  183. reset: (StringConstructor | NumberConstructor)[];
  184. root: (StringConstructor | BooleanConstructor)[];
  185. scoped: BooleanConstructor;
  186. }, vue.ExtractPropTypes<{
  187. defaults: PropType<DefaultsOptions>;
  188. disabled: BooleanConstructor;
  189. reset: (StringConstructor | NumberConstructor)[];
  190. root: (StringConstructor | BooleanConstructor)[];
  191. scoped: BooleanConstructor;
  192. }>>;
  193. type VDefaultsProvider = InstanceType<typeof VDefaultsProvider>;
  194. export { VDefaultsProvider };