index.d.mts 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. import * as vue from 'vue';
  2. import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, PropType, ComponentPublicInstance, FunctionalComponent, DirectiveBinding } from 'vue';
  3. type SlotsToProps<U extends RawSlots, T = MakeInternalSlots<U>> = {
  4. $children?: (VNodeChild | (T extends {
  5. default: infer V;
  6. } ? V : {}) | {
  7. [K in keyof T]?: T[K];
  8. });
  9. 'v-slots'?: {
  10. [K in keyof T]?: T[K] | false;
  11. };
  12. } & {
  13. [K in keyof T as `v-slot:${K & string}`]?: T[K] | false;
  14. };
  15. type RawSlots = Record<string, unknown>;
  16. type Slot<T> = [T] extends [never] ? () => VNodeChild : (arg: T) => VNodeChild;
  17. type VueSlot<T> = [T] extends [never] ? () => VNode[] : (arg: T) => VNode[];
  18. type MakeInternalSlots<T extends RawSlots> = {
  19. [K in keyof T]: Slot<T[K]>;
  20. };
  21. type MakeSlots<T extends RawSlots> = {
  22. [K in keyof T]: VueSlot<T[K]>;
  23. };
  24. type GenericProps<Props, Slots extends Record<string, unknown>> = {
  25. $props: Props & SlotsToProps<Slots>;
  26. $slots: MakeSlots<Slots>;
  27. };
  28. interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
  29. filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): Partial<Pick<T, U>>;
  30. }
  31. type ClassValue = any;
  32. declare function deepEqual(a: any, b: any): boolean;
  33. type Density = null | 'default' | 'comfortable' | 'compact';
  34. type JSXComponent<Props = any> = {
  35. new (): ComponentPublicInstance<Props>;
  36. } | FunctionalComponent<Props>;
  37. type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
  38. declare const IconValue: PropType<IconValue>;
  39. interface RippleDirectiveBinding extends Omit<DirectiveBinding, 'modifiers' | 'value'> {
  40. value?: boolean | {
  41. class: string;
  42. };
  43. modifiers: {
  44. center?: boolean;
  45. circle?: boolean;
  46. stop?: boolean;
  47. };
  48. }
  49. declare const VSelectionControlGroup: {
  50. new (...args: any[]): vue.CreateComponentPublicInstance<{
  51. inline: boolean;
  52. error: boolean;
  53. style: vue.StyleValue;
  54. disabled: boolean | null;
  55. multiple: boolean | null;
  56. readonly: boolean | null;
  57. density: Density;
  58. ripple: boolean | {
  59. class: string;
  60. } | undefined;
  61. defaultsTarget: string;
  62. valueComparator: typeof deepEqual;
  63. } & {
  64. name?: string | undefined;
  65. type?: string | undefined;
  66. id?: string | undefined;
  67. color?: string | undefined;
  68. class?: any;
  69. theme?: string | undefined;
  70. falseIcon?: IconValue | undefined;
  71. trueIcon?: IconValue | undefined;
  72. } & {}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
  73. 'update:modelValue': (value: any) => true;
  74. }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue">, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
  75. inline: boolean;
  76. error: boolean;
  77. style: vue.StyleValue;
  78. disabled: boolean | null;
  79. multiple: boolean | null;
  80. readonly: boolean | null;
  81. density: Density;
  82. ripple: boolean | {
  83. class: string;
  84. } | undefined;
  85. defaultsTarget: string;
  86. valueComparator: typeof deepEqual;
  87. } & {
  88. name?: string | undefined;
  89. type?: string | undefined;
  90. id?: string | undefined;
  91. color?: string | undefined;
  92. class?: any;
  93. theme?: string | undefined;
  94. falseIcon?: IconValue | undefined;
  95. trueIcon?: IconValue | undefined;
  96. } & {}, {
  97. inline: boolean;
  98. error: boolean;
  99. style: vue.StyleValue;
  100. disabled: boolean | null;
  101. multiple: boolean | null;
  102. readonly: boolean | null;
  103. density: Density;
  104. ripple: boolean | {
  105. class: string;
  106. } | undefined;
  107. defaultsTarget: string;
  108. valueComparator: typeof deepEqual;
  109. }, true, {}, vue.SlotsType<Partial<{
  110. default: () => vue.VNode[];
  111. }>>, {
  112. P: {};
  113. B: {};
  114. D: {};
  115. C: {};
  116. M: {};
  117. Defaults: {};
  118. }, {
  119. inline: boolean;
  120. error: boolean;
  121. style: vue.StyleValue;
  122. disabled: boolean | null;
  123. multiple: boolean | null;
  124. readonly: boolean | null;
  125. density: Density;
  126. ripple: boolean | {
  127. class: string;
  128. } | undefined;
  129. defaultsTarget: string;
  130. valueComparator: typeof deepEqual;
  131. } & {
  132. name?: string | undefined;
  133. type?: string | undefined;
  134. id?: string | undefined;
  135. color?: string | undefined;
  136. class?: any;
  137. theme?: string | undefined;
  138. falseIcon?: IconValue | undefined;
  139. trueIcon?: IconValue | undefined;
  140. } & {}, {}, {}, {}, {}, {
  141. inline: boolean;
  142. error: boolean;
  143. style: vue.StyleValue;
  144. disabled: boolean | null;
  145. multiple: boolean | null;
  146. readonly: boolean | null;
  147. density: Density;
  148. ripple: boolean | {
  149. class: string;
  150. } | undefined;
  151. defaultsTarget: string;
  152. valueComparator: typeof deepEqual;
  153. }>;
  154. __isFragment?: never;
  155. __isTeleport?: never;
  156. __isSuspense?: never;
  157. } & vue.ComponentOptionsBase<{
  158. inline: boolean;
  159. error: boolean;
  160. style: vue.StyleValue;
  161. disabled: boolean | null;
  162. multiple: boolean | null;
  163. readonly: boolean | null;
  164. density: Density;
  165. ripple: boolean | {
  166. class: string;
  167. } | undefined;
  168. defaultsTarget: string;
  169. valueComparator: typeof deepEqual;
  170. } & {
  171. name?: string | undefined;
  172. type?: string | undefined;
  173. id?: string | undefined;
  174. color?: string | undefined;
  175. class?: any;
  176. theme?: string | undefined;
  177. falseIcon?: IconValue | undefined;
  178. trueIcon?: IconValue | undefined;
  179. } & {}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
  180. 'update:modelValue': (value: any) => true;
  181. }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue">, string, {
  182. inline: boolean;
  183. error: boolean;
  184. style: vue.StyleValue;
  185. disabled: boolean | null;
  186. multiple: boolean | null;
  187. readonly: boolean | null;
  188. density: Density;
  189. ripple: boolean | {
  190. class: string;
  191. } | undefined;
  192. defaultsTarget: string;
  193. valueComparator: typeof deepEqual;
  194. }, {}, string, vue.SlotsType<Partial<{
  195. default: () => vue.VNode[];
  196. }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T>(props: {
  197. modelValue?: T;
  198. "onUpdate:modelValue"?: (value: T) => void;
  199. }, slots: {
  200. default: never;
  201. }) => GenericProps<typeof props, typeof slots>) & FilterPropsOptions<{
  202. theme: StringConstructor;
  203. density: {
  204. type: PropType<Density>;
  205. default: string;
  206. validator: (v: any) => boolean;
  207. };
  208. class: PropType<ClassValue>;
  209. style: {
  210. type: PropType<vue.StyleValue>;
  211. default: null;
  212. };
  213. color: StringConstructor;
  214. disabled: {
  215. type: PropType<boolean | null>;
  216. default: null;
  217. };
  218. defaultsTarget: {
  219. type: PropType<string>;
  220. default: string;
  221. };
  222. error: BooleanConstructor;
  223. id: StringConstructor;
  224. inline: BooleanConstructor;
  225. falseIcon: PropType<IconValue>;
  226. trueIcon: PropType<IconValue>;
  227. ripple: {
  228. type: PropType<RippleDirectiveBinding["value"]>;
  229. default: boolean;
  230. };
  231. multiple: {
  232. type: PropType<boolean | null>;
  233. default: null;
  234. };
  235. name: StringConstructor;
  236. readonly: {
  237. type: PropType<boolean | null>;
  238. default: null;
  239. };
  240. modelValue: null;
  241. type: StringConstructor;
  242. valueComparator: {
  243. type: PropType<typeof deepEqual>;
  244. default: typeof deepEqual;
  245. };
  246. }, vue.ExtractPropTypes<{
  247. theme: StringConstructor;
  248. density: {
  249. type: PropType<Density>;
  250. default: string;
  251. validator: (v: any) => boolean;
  252. };
  253. class: PropType<ClassValue>;
  254. style: {
  255. type: PropType<vue.StyleValue>;
  256. default: null;
  257. };
  258. color: StringConstructor;
  259. disabled: {
  260. type: PropType<boolean | null>;
  261. default: null;
  262. };
  263. defaultsTarget: {
  264. type: PropType<string>;
  265. default: string;
  266. };
  267. error: BooleanConstructor;
  268. id: StringConstructor;
  269. inline: BooleanConstructor;
  270. falseIcon: PropType<IconValue>;
  271. trueIcon: PropType<IconValue>;
  272. ripple: {
  273. type: PropType<RippleDirectiveBinding["value"]>;
  274. default: boolean;
  275. };
  276. multiple: {
  277. type: PropType<boolean | null>;
  278. default: null;
  279. };
  280. name: StringConstructor;
  281. readonly: {
  282. type: PropType<boolean | null>;
  283. default: null;
  284. };
  285. modelValue: null;
  286. type: StringConstructor;
  287. valueComparator: {
  288. type: PropType<typeof deepEqual>;
  289. default: typeof deepEqual;
  290. };
  291. }>>;
  292. type VSelectionControlGroup = InstanceType<typeof VSelectionControlGroup>;
  293. export { VSelectionControlGroup };