index.d.mts 12 KB

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