index.d.mts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  1. import * as vue from 'vue';
  2. import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, PropType, ComponentPublicInstance, FunctionalComponent, DirectiveBinding, Ref, CSSProperties, WritableComputedRef } from 'vue';
  3. type ClassValue = any;
  4. type SlotsToProps<U extends RawSlots, T = MakeInternalSlots<U>> = {
  5. $children?: (VNodeChild | (T extends {
  6. default: infer V;
  7. } ? V : {}) | {
  8. [K in keyof T]?: T[K];
  9. });
  10. 'v-slots'?: {
  11. [K in keyof T]?: T[K] | false;
  12. };
  13. } & {
  14. [K in keyof T as `v-slot:${K & string}`]?: T[K] | false;
  15. };
  16. type RawSlots = Record<string, unknown>;
  17. type Slot<T> = [T] extends [never] ? () => VNodeChild : (arg: T) => VNodeChild;
  18. type VueSlot<T> = [T] extends [never] ? () => VNode[] : (arg: T) => VNode[];
  19. type MakeInternalSlots<T extends RawSlots> = {
  20. [K in keyof T]: Slot<T[K]>;
  21. };
  22. type MakeSlots<T extends RawSlots> = {
  23. [K in keyof T]: VueSlot<T[K]>;
  24. };
  25. type GenericProps<Props, Slots extends Record<string, unknown>> = {
  26. $props: Props & SlotsToProps<Slots>;
  27. $slots: MakeSlots<Slots>;
  28. };
  29. interface FilterPropsOptions<PropsOptions extends Readonly<ComponentPropsOptions>, Props = ExtractPropTypes<PropsOptions>> {
  30. filterProps<T extends Partial<Props>, U extends Exclude<keyof Props, Exclude<keyof Props, keyof T>>>(props: T): Partial<Pick<T, U>>;
  31. }
  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. type SelectionControlSlot = {
  50. model: WritableComputedRef<boolean>;
  51. textColorClasses: Ref<string[]>;
  52. textColorStyles: Ref<CSSProperties>;
  53. backgroundColorClasses: Ref<string[]>;
  54. backgroundColorStyles: Ref<CSSProperties>;
  55. inputNode: VNode;
  56. icon: IconValue | undefined;
  57. props: {
  58. onBlur: (e: Event) => void;
  59. onFocus: (e: FocusEvent) => void;
  60. id: string;
  61. };
  62. };
  63. type VSelectionControlSlots = {
  64. default: {
  65. backgroundColorClasses: Ref<string[]>;
  66. backgroundColorStyles: Ref<CSSProperties>;
  67. };
  68. label: {
  69. label: string | undefined;
  70. props: Record<string, unknown>;
  71. };
  72. input: SelectionControlSlot;
  73. };
  74. declare const VSelectionControl: {
  75. new (...args: any[]): vue.CreateComponentPublicInstance<{
  76. inline: boolean;
  77. error: boolean;
  78. style: vue.StyleValue;
  79. disabled: boolean | null;
  80. multiple: boolean | null;
  81. readonly: boolean | null;
  82. density: Density;
  83. ripple: boolean | {
  84. class: string;
  85. } | undefined;
  86. valueComparator: typeof deepEqual;
  87. } & {
  88. name?: string | undefined;
  89. type?: string | undefined;
  90. id?: string | undefined;
  91. color?: string | undefined;
  92. value?: any;
  93. label?: string | undefined;
  94. class?: any;
  95. theme?: string | undefined;
  96. baseColor?: string | undefined;
  97. defaultsTarget?: string | undefined;
  98. falseIcon?: IconValue | undefined;
  99. trueIcon?: IconValue | undefined;
  100. trueValue?: any;
  101. falseValue?: any;
  102. } & {}, {
  103. isFocused: vue.ShallowRef<boolean>;
  104. input: Ref<HTMLInputElement | undefined>;
  105. }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
  106. 'update:modelValue': (value: any) => true;
  107. }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue" | "v-slot:input" | "v-slot:label">, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
  108. inline: boolean;
  109. error: boolean;
  110. style: vue.StyleValue;
  111. disabled: boolean | null;
  112. multiple: boolean | null;
  113. readonly: boolean | null;
  114. density: Density;
  115. ripple: boolean | {
  116. class: string;
  117. } | undefined;
  118. valueComparator: typeof deepEqual;
  119. } & {
  120. name?: string | undefined;
  121. type?: string | undefined;
  122. id?: string | undefined;
  123. color?: string | undefined;
  124. value?: any;
  125. label?: string | undefined;
  126. class?: any;
  127. theme?: string | undefined;
  128. baseColor?: string | undefined;
  129. defaultsTarget?: string | undefined;
  130. falseIcon?: IconValue | undefined;
  131. trueIcon?: IconValue | undefined;
  132. trueValue?: any;
  133. falseValue?: any;
  134. } & {}, {
  135. inline: boolean;
  136. error: boolean;
  137. style: vue.StyleValue;
  138. disabled: boolean | null;
  139. multiple: boolean | null;
  140. readonly: boolean | null;
  141. density: Density;
  142. ripple: boolean | {
  143. class: string;
  144. } | undefined;
  145. valueComparator: typeof deepEqual;
  146. }, true, {}, vue.SlotsType<Partial<{
  147. default: (arg: {
  148. backgroundColorClasses: Ref<string[]>;
  149. backgroundColorStyles: Ref<CSSProperties>;
  150. }) => VNode[];
  151. label: (arg: {
  152. label: string | undefined;
  153. props: Record<string, unknown>;
  154. }) => VNode[];
  155. input: (arg: SelectionControlSlot) => VNode[];
  156. }>>, {
  157. P: {};
  158. B: {};
  159. D: {};
  160. C: {};
  161. M: {};
  162. Defaults: {};
  163. }, {
  164. inline: boolean;
  165. error: boolean;
  166. style: vue.StyleValue;
  167. disabled: boolean | null;
  168. multiple: boolean | null;
  169. readonly: boolean | null;
  170. density: Density;
  171. ripple: boolean | {
  172. class: string;
  173. } | undefined;
  174. valueComparator: typeof deepEqual;
  175. } & {
  176. name?: string | undefined;
  177. type?: string | undefined;
  178. id?: string | undefined;
  179. color?: string | undefined;
  180. value?: any;
  181. label?: string | undefined;
  182. class?: any;
  183. theme?: string | undefined;
  184. baseColor?: string | undefined;
  185. defaultsTarget?: string | undefined;
  186. falseIcon?: IconValue | undefined;
  187. trueIcon?: IconValue | undefined;
  188. trueValue?: any;
  189. falseValue?: any;
  190. } & {}, {
  191. isFocused: vue.ShallowRef<boolean>;
  192. input: Ref<HTMLInputElement | undefined>;
  193. }, {}, {}, {}, {
  194. inline: boolean;
  195. error: boolean;
  196. style: vue.StyleValue;
  197. disabled: boolean | null;
  198. multiple: boolean | null;
  199. readonly: boolean | null;
  200. density: Density;
  201. ripple: boolean | {
  202. class: string;
  203. } | undefined;
  204. valueComparator: typeof deepEqual;
  205. }>;
  206. __isFragment?: never;
  207. __isTeleport?: never;
  208. __isSuspense?: never;
  209. } & vue.ComponentOptionsBase<{
  210. inline: boolean;
  211. error: boolean;
  212. style: vue.StyleValue;
  213. disabled: boolean | null;
  214. multiple: boolean | null;
  215. readonly: boolean | null;
  216. density: Density;
  217. ripple: boolean | {
  218. class: string;
  219. } | undefined;
  220. valueComparator: typeof deepEqual;
  221. } & {
  222. name?: string | undefined;
  223. type?: string | undefined;
  224. id?: string | undefined;
  225. color?: string | undefined;
  226. value?: any;
  227. label?: string | undefined;
  228. class?: any;
  229. theme?: string | undefined;
  230. baseColor?: string | undefined;
  231. defaultsTarget?: string | undefined;
  232. falseIcon?: IconValue | undefined;
  233. trueIcon?: IconValue | undefined;
  234. trueValue?: any;
  235. falseValue?: any;
  236. } & {}, {
  237. isFocused: vue.ShallowRef<boolean>;
  238. input: Ref<HTMLInputElement | undefined>;
  239. }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
  240. 'update:modelValue': (value: any) => true;
  241. }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue" | "v-slot:input" | "v-slot:label">, string, {
  242. inline: boolean;
  243. error: boolean;
  244. style: vue.StyleValue;
  245. disabled: boolean | null;
  246. multiple: boolean | null;
  247. readonly: boolean | null;
  248. density: Density;
  249. ripple: boolean | {
  250. class: string;
  251. } | undefined;
  252. valueComparator: typeof deepEqual;
  253. }, {}, string, vue.SlotsType<Partial<{
  254. default: (arg: {
  255. backgroundColorClasses: Ref<string[]>;
  256. backgroundColorStyles: Ref<CSSProperties>;
  257. }) => VNode[];
  258. label: (arg: {
  259. label: string | undefined;
  260. props: Record<string, unknown>;
  261. }) => VNode[];
  262. input: (arg: SelectionControlSlot) => VNode[];
  263. }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T>(props: {
  264. modelValue?: T;
  265. "onUpdate:modelValue"?: (value: T) => void;
  266. }, slots: VSelectionControlSlots) => GenericProps<typeof props, typeof slots>) & FilterPropsOptions<{
  267. theme: StringConstructor;
  268. density: {
  269. type: vue.PropType<Density>;
  270. default: string;
  271. validator: (v: any) => boolean;
  272. };
  273. class: vue.PropType<ClassValue>;
  274. style: {
  275. type: vue.PropType<vue.StyleValue>;
  276. default: null;
  277. };
  278. color: StringConstructor;
  279. disabled: {
  280. type: vue.PropType<boolean | null>;
  281. default: null;
  282. };
  283. defaultsTarget: StringConstructor;
  284. error: BooleanConstructor;
  285. id: StringConstructor;
  286. inline: BooleanConstructor;
  287. falseIcon: vue.PropType<IconValue>;
  288. trueIcon: vue.PropType<IconValue>;
  289. ripple: {
  290. type: vue.PropType<RippleDirectiveBinding["value"]>;
  291. default: boolean;
  292. };
  293. multiple: {
  294. type: vue.PropType<boolean | null>;
  295. default: null;
  296. };
  297. name: StringConstructor;
  298. readonly: {
  299. type: vue.PropType<boolean | null>;
  300. default: null;
  301. };
  302. modelValue: null;
  303. type: StringConstructor;
  304. valueComparator: {
  305. type: vue.PropType<typeof deepEqual>;
  306. default: typeof deepEqual;
  307. };
  308. label: StringConstructor;
  309. baseColor: StringConstructor;
  310. trueValue: null;
  311. falseValue: null;
  312. value: null;
  313. }, ExtractPropTypes<{
  314. theme: StringConstructor;
  315. density: {
  316. type: vue.PropType<Density>;
  317. default: string;
  318. validator: (v: any) => boolean;
  319. };
  320. class: vue.PropType<ClassValue>;
  321. style: {
  322. type: vue.PropType<vue.StyleValue>;
  323. default: null;
  324. };
  325. color: StringConstructor;
  326. disabled: {
  327. type: vue.PropType<boolean | null>;
  328. default: null;
  329. };
  330. defaultsTarget: StringConstructor;
  331. error: BooleanConstructor;
  332. id: StringConstructor;
  333. inline: BooleanConstructor;
  334. falseIcon: vue.PropType<IconValue>;
  335. trueIcon: vue.PropType<IconValue>;
  336. ripple: {
  337. type: vue.PropType<RippleDirectiveBinding["value"]>;
  338. default: boolean;
  339. };
  340. multiple: {
  341. type: vue.PropType<boolean | null>;
  342. default: null;
  343. };
  344. name: StringConstructor;
  345. readonly: {
  346. type: vue.PropType<boolean | null>;
  347. default: null;
  348. };
  349. modelValue: null;
  350. type: StringConstructor;
  351. valueComparator: {
  352. type: vue.PropType<typeof deepEqual>;
  353. default: typeof deepEqual;
  354. };
  355. label: StringConstructor;
  356. baseColor: StringConstructor;
  357. trueValue: null;
  358. falseValue: null;
  359. value: null;
  360. }>>;
  361. type VSelectionControl = InstanceType<typeof VSelectionControl>;
  362. export { VSelectionControl };