index.d.mts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. import * as vue from 'vue';
  2. import { ComponentPropsOptions, ExtractPropTypes, VNodeChild, VNode, PropType, ComponentPublicInstance, FunctionalComponent, ComponentInternalInstance, Ref, ComputedRef } 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 JSXComponent<Props = any> = {
  34. new (): ComponentPublicInstance<Props>;
  35. } | FunctionalComponent<Props>;
  36. type IconValue = string | (string | [path: string, opacity: number])[] | JSXComponent;
  37. declare const IconValue: PropType<IconValue>;
  38. interface GroupItem {
  39. id: number;
  40. value: Ref<unknown>;
  41. disabled: Ref<boolean | undefined>;
  42. useIndexAsValue?: boolean;
  43. }
  44. interface GroupProvide {
  45. register: (item: GroupItem, cmp: ComponentInternalInstance) => void;
  46. unregister: (id: number) => void;
  47. select: (id: number, value: boolean) => void;
  48. selected: Ref<Readonly<number[]>>;
  49. isSelected: (id: number) => boolean;
  50. prev: () => void;
  51. next: () => void;
  52. selectedClass: Ref<string | undefined>;
  53. items: ComputedRef<{
  54. id: number;
  55. value: unknown;
  56. disabled: boolean | undefined;
  57. }[]>;
  58. disabled: Ref<boolean | undefined>;
  59. getItemIndex: (value: unknown) => number;
  60. }
  61. declare const breakpoints: readonly ["sm", "md", "lg", "xl", "xxl"];
  62. type Breakpoint = typeof breakpoints[number];
  63. type DisplayBreakpoint = 'xs' | Breakpoint;
  64. declare const allowedVariants: readonly ["elevated", "flat", "tonal", "outlined", "text", "plain"];
  65. type Variant = typeof allowedVariants[number];
  66. type VChipGroupSlots = {
  67. default: {
  68. isSelected: (id: number) => boolean;
  69. select: (id: number, value: boolean) => void;
  70. next: () => void;
  71. prev: () => void;
  72. selected: readonly number[];
  73. };
  74. };
  75. declare const VChipGroup: {
  76. new (...args: any[]): vue.CreateComponentPublicInstance<{
  77. symbol: any;
  78. filter: boolean;
  79. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  80. direction: "horizontal" | "vertical";
  81. style: vue.StyleValue;
  82. mobile: boolean | null;
  83. disabled: boolean;
  84. multiple: boolean;
  85. tag: string;
  86. column: boolean;
  87. selectedClass: string;
  88. valueComparator: typeof deepEqual;
  89. centerActive: boolean;
  90. nextIcon: IconValue;
  91. prevIcon: IconValue;
  92. } & {
  93. max?: number | undefined;
  94. color?: string | undefined;
  95. class?: any;
  96. theme?: string | undefined;
  97. mandatory?: boolean | "force" | undefined;
  98. mobileBreakpoint?: number | DisplayBreakpoint | undefined;
  99. showArrows?: string | boolean | undefined;
  100. } & {}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
  101. 'update:modelValue': (value: any) => true;
  102. }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue">, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
  103. symbol: any;
  104. filter: boolean;
  105. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  106. direction: "horizontal" | "vertical";
  107. style: vue.StyleValue;
  108. mobile: boolean | null;
  109. disabled: boolean;
  110. multiple: boolean;
  111. tag: string;
  112. column: boolean;
  113. selectedClass: string;
  114. valueComparator: typeof deepEqual;
  115. centerActive: boolean;
  116. nextIcon: IconValue;
  117. prevIcon: IconValue;
  118. } & {
  119. max?: number | undefined;
  120. color?: string | undefined;
  121. class?: any;
  122. theme?: string | undefined;
  123. mandatory?: boolean | "force" | undefined;
  124. mobileBreakpoint?: number | DisplayBreakpoint | undefined;
  125. showArrows?: string | boolean | undefined;
  126. } & {}, {
  127. symbol: any;
  128. filter: boolean;
  129. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  130. direction: "horizontal" | "vertical";
  131. style: vue.StyleValue;
  132. mobile: boolean | null;
  133. disabled: boolean;
  134. multiple: boolean;
  135. tag: string;
  136. column: boolean;
  137. selectedClass: string;
  138. valueComparator: typeof deepEqual;
  139. centerActive: boolean;
  140. nextIcon: IconValue;
  141. prevIcon: IconValue;
  142. }, true, {}, vue.SlotsType<Partial<{
  143. default: (arg: {
  144. isSelected: (id: number) => boolean;
  145. select: (id: number, value: boolean) => void;
  146. next: () => void;
  147. prev: () => void;
  148. selected: readonly number[];
  149. }) => vue.VNode[];
  150. }>>, {
  151. P: {};
  152. B: {};
  153. D: {};
  154. C: {};
  155. M: {};
  156. Defaults: {};
  157. }, {
  158. symbol: any;
  159. filter: boolean;
  160. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  161. direction: "horizontal" | "vertical";
  162. style: vue.StyleValue;
  163. mobile: boolean | null;
  164. disabled: boolean;
  165. multiple: boolean;
  166. tag: string;
  167. column: boolean;
  168. selectedClass: string;
  169. valueComparator: typeof deepEqual;
  170. centerActive: boolean;
  171. nextIcon: IconValue;
  172. prevIcon: IconValue;
  173. } & {
  174. max?: number | undefined;
  175. color?: string | undefined;
  176. class?: any;
  177. theme?: string | undefined;
  178. mandatory?: boolean | "force" | undefined;
  179. mobileBreakpoint?: number | DisplayBreakpoint | undefined;
  180. showArrows?: string | boolean | undefined;
  181. } & {}, {}, {}, {}, {}, {
  182. symbol: any;
  183. filter: boolean;
  184. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  185. direction: "horizontal" | "vertical";
  186. style: vue.StyleValue;
  187. mobile: boolean | null;
  188. disabled: boolean;
  189. multiple: boolean;
  190. tag: string;
  191. column: boolean;
  192. selectedClass: string;
  193. valueComparator: typeof deepEqual;
  194. centerActive: boolean;
  195. nextIcon: IconValue;
  196. prevIcon: IconValue;
  197. }>;
  198. __isFragment?: never;
  199. __isTeleport?: never;
  200. __isSuspense?: never;
  201. } & vue.ComponentOptionsBase<{
  202. symbol: any;
  203. filter: boolean;
  204. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  205. direction: "horizontal" | "vertical";
  206. style: vue.StyleValue;
  207. mobile: boolean | null;
  208. disabled: boolean;
  209. multiple: boolean;
  210. tag: string;
  211. column: boolean;
  212. selectedClass: string;
  213. valueComparator: typeof deepEqual;
  214. centerActive: boolean;
  215. nextIcon: IconValue;
  216. prevIcon: IconValue;
  217. } & {
  218. max?: number | undefined;
  219. color?: string | undefined;
  220. class?: any;
  221. theme?: string | undefined;
  222. mandatory?: boolean | "force" | undefined;
  223. mobileBreakpoint?: number | DisplayBreakpoint | undefined;
  224. showArrows?: string | boolean | undefined;
  225. } & {}, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Omit<{
  226. 'update:modelValue': (value: any) => true;
  227. }, "$children" | "v-slots" | "v-slot:default" | "modelValue" | "update:modelValue">, string, {
  228. symbol: any;
  229. filter: boolean;
  230. variant: "flat" | "text" | "elevated" | "tonal" | "outlined" | "plain";
  231. direction: "horizontal" | "vertical";
  232. style: vue.StyleValue;
  233. mobile: boolean | null;
  234. disabled: boolean;
  235. multiple: boolean;
  236. tag: string;
  237. column: boolean;
  238. selectedClass: string;
  239. valueComparator: typeof deepEqual;
  240. centerActive: boolean;
  241. nextIcon: IconValue;
  242. prevIcon: IconValue;
  243. }, {}, string, vue.SlotsType<Partial<{
  244. default: (arg: {
  245. isSelected: (id: number) => boolean;
  246. select: (id: number, value: boolean) => void;
  247. next: () => void;
  248. prev: () => void;
  249. selected: readonly number[];
  250. }) => vue.VNode[];
  251. }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new <T>(props: {
  252. modelValue?: T;
  253. "onUpdate:modelValue"?: (value: T) => void;
  254. }, slots: VChipGroupSlots) => GenericProps<typeof props, typeof slots>) & FilterPropsOptions<{
  255. color: StringConstructor;
  256. variant: Omit<{
  257. type: PropType<Variant>;
  258. default: string;
  259. validator: (v: any) => boolean;
  260. }, "type" | "default"> & {
  261. type: PropType<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
  262. default: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
  263. };
  264. theme: StringConstructor;
  265. tag: {
  266. type: StringConstructor;
  267. default: string;
  268. };
  269. modelValue: {
  270. type: null;
  271. default: undefined;
  272. };
  273. multiple: BooleanConstructor;
  274. mandatory: PropType<boolean | "force">;
  275. max: NumberConstructor;
  276. selectedClass: {
  277. type: PropType<string>;
  278. default: string;
  279. };
  280. disabled: BooleanConstructor;
  281. class: PropType<ClassValue>;
  282. style: {
  283. type: PropType<vue.StyleValue>;
  284. default: null;
  285. };
  286. mobile: Omit<{
  287. type: PropType<boolean | null>;
  288. default: boolean;
  289. }, "type" | "default"> & {
  290. type: PropType<boolean | null>;
  291. default: NonNullable<boolean | null> | null;
  292. };
  293. mobileBreakpoint: PropType<number | DisplayBreakpoint>;
  294. centerActive: BooleanConstructor;
  295. direction: {
  296. type: PropType<"horizontal" | "vertical">;
  297. default: string;
  298. };
  299. symbol: {
  300. type: null;
  301. default: vue.InjectionKey<GroupProvide>;
  302. };
  303. nextIcon: {
  304. type: PropType<IconValue>;
  305. default: string;
  306. };
  307. prevIcon: {
  308. type: PropType<IconValue>;
  309. default: string;
  310. };
  311. showArrows: {
  312. type: (StringConstructor | BooleanConstructor)[];
  313. validator: (v: any) => boolean;
  314. };
  315. column: BooleanConstructor;
  316. filter: BooleanConstructor;
  317. valueComparator: {
  318. type: PropType<typeof deepEqual>;
  319. default: typeof deepEqual;
  320. };
  321. }, vue.ExtractPropTypes<{
  322. color: StringConstructor;
  323. variant: Omit<{
  324. type: PropType<Variant>;
  325. default: string;
  326. validator: (v: any) => boolean;
  327. }, "type" | "default"> & {
  328. type: PropType<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
  329. default: NonNullable<"flat" | "text" | "elevated" | "tonal" | "outlined" | "plain">;
  330. };
  331. theme: StringConstructor;
  332. tag: {
  333. type: StringConstructor;
  334. default: string;
  335. };
  336. modelValue: {
  337. type: null;
  338. default: undefined;
  339. };
  340. multiple: BooleanConstructor;
  341. mandatory: PropType<boolean | "force">;
  342. max: NumberConstructor;
  343. selectedClass: {
  344. type: PropType<string>;
  345. default: string;
  346. };
  347. disabled: BooleanConstructor;
  348. class: PropType<ClassValue>;
  349. style: {
  350. type: PropType<vue.StyleValue>;
  351. default: null;
  352. };
  353. mobile: Omit<{
  354. type: PropType<boolean | null>;
  355. default: boolean;
  356. }, "type" | "default"> & {
  357. type: PropType<boolean | null>;
  358. default: NonNullable<boolean | null> | null;
  359. };
  360. mobileBreakpoint: PropType<number | DisplayBreakpoint>;
  361. centerActive: BooleanConstructor;
  362. direction: {
  363. type: PropType<"horizontal" | "vertical">;
  364. default: string;
  365. };
  366. symbol: {
  367. type: null;
  368. default: vue.InjectionKey<GroupProvide>;
  369. };
  370. nextIcon: {
  371. type: PropType<IconValue>;
  372. default: string;
  373. };
  374. prevIcon: {
  375. type: PropType<IconValue>;
  376. default: string;
  377. };
  378. showArrows: {
  379. type: (StringConstructor | BooleanConstructor)[];
  380. validator: (v: any) => boolean;
  381. };
  382. column: BooleanConstructor;
  383. filter: BooleanConstructor;
  384. valueComparator: {
  385. type: PropType<typeof deepEqual>;
  386. default: typeof deepEqual;
  387. };
  388. }>>;
  389. type VChipGroup = InstanceType<typeof VChipGroup>;
  390. export { VChipGroup };