index.d.mts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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): Partial<Pick<T, U>>;
  5. }
  6. type InfiniteScrollSide = 'start' | 'end' | 'both';
  7. type InfiniteScrollStatus = 'ok' | 'empty' | 'loading' | 'error';
  8. type InfiniteScrollSlot = {
  9. side: InfiniteScrollSide;
  10. props: Record<string, any>;
  11. };
  12. declare const VInfiniteScroll: {
  13. new (...args: any[]): vue.CreateComponentPublicInstance<{
  14. direction: "horizontal" | "vertical";
  15. tag: string;
  16. mode: "manual" | "intersect";
  17. side: InfiniteScrollSide;
  18. loadMoreText: string;
  19. emptyText: string;
  20. } & {
  21. height?: string | number | undefined;
  22. width?: string | number | undefined;
  23. color?: string | undefined;
  24. margin?: string | number | undefined;
  25. maxHeight?: string | number | undefined;
  26. maxWidth?: string | number | undefined;
  27. minHeight?: string | number | undefined;
  28. minWidth?: string | number | undefined;
  29. } & {
  30. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  31. default?: (() => vue.VNodeChild) | undefined;
  32. loading?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  33. error?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  34. empty?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  35. 'load-more'?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  36. };
  37. 'v-slots'?: {
  38. default?: false | (() => vue.VNodeChild) | undefined;
  39. loading?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  40. error?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  41. empty?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  42. 'load-more'?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  43. } | undefined;
  44. } & {
  45. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  46. "v-slot:loading"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  47. "v-slot:error"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  48. "v-slot:empty"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  49. "v-slot:load-more"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  50. } & {
  51. onLoad?: ((options: {
  52. side: InfiniteScrollSide;
  53. done: (status: InfiniteScrollStatus) => void;
  54. }) => any) | undefined;
  55. }, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
  56. load: (options: {
  57. side: InfiniteScrollSide;
  58. done: (status: InfiniteScrollStatus) => void;
  59. }) => true;
  60. }, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & {
  61. direction: "horizontal" | "vertical";
  62. tag: string;
  63. mode: "manual" | "intersect";
  64. side: InfiniteScrollSide;
  65. loadMoreText: string;
  66. emptyText: string;
  67. } & {
  68. height?: string | number | undefined;
  69. width?: string | number | undefined;
  70. color?: string | undefined;
  71. margin?: string | number | undefined;
  72. maxHeight?: string | number | undefined;
  73. maxWidth?: string | number | undefined;
  74. minHeight?: string | number | undefined;
  75. minWidth?: string | number | undefined;
  76. } & {
  77. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  78. default?: (() => vue.VNodeChild) | undefined;
  79. loading?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  80. error?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  81. empty?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  82. 'load-more'?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  83. };
  84. 'v-slots'?: {
  85. default?: false | (() => vue.VNodeChild) | undefined;
  86. loading?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  87. error?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  88. empty?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  89. 'load-more'?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  90. } | undefined;
  91. } & {
  92. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  93. "v-slot:loading"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  94. "v-slot:error"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  95. "v-slot:empty"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  96. "v-slot:load-more"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  97. } & {
  98. onLoad?: ((options: {
  99. side: InfiniteScrollSide;
  100. done: (status: InfiniteScrollStatus) => void;
  101. }) => any) | undefined;
  102. }, {
  103. direction: "horizontal" | "vertical";
  104. tag: string;
  105. mode: "manual" | "intersect";
  106. side: InfiniteScrollSide;
  107. loadMoreText: string;
  108. emptyText: string;
  109. }, true, {}, vue.SlotsType<Partial<{
  110. default: () => vue.VNode[];
  111. loading: (arg: InfiniteScrollSlot) => vue.VNode[];
  112. error: (arg: InfiniteScrollSlot) => vue.VNode[];
  113. empty: (arg: InfiniteScrollSlot) => vue.VNode[];
  114. 'load-more': (arg: InfiniteScrollSlot) => vue.VNode[];
  115. }>>, {
  116. P: {};
  117. B: {};
  118. D: {};
  119. C: {};
  120. M: {};
  121. Defaults: {};
  122. }, {
  123. direction: "horizontal" | "vertical";
  124. tag: string;
  125. mode: "manual" | "intersect";
  126. side: InfiniteScrollSide;
  127. loadMoreText: string;
  128. emptyText: string;
  129. } & {
  130. height?: string | number | undefined;
  131. width?: string | number | undefined;
  132. color?: string | undefined;
  133. margin?: string | number | undefined;
  134. maxHeight?: string | number | undefined;
  135. maxWidth?: string | number | undefined;
  136. minHeight?: string | number | undefined;
  137. minWidth?: string | number | undefined;
  138. } & {
  139. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  140. default?: (() => vue.VNodeChild) | undefined;
  141. loading?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  142. error?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  143. empty?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  144. 'load-more'?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  145. };
  146. 'v-slots'?: {
  147. default?: false | (() => vue.VNodeChild) | undefined;
  148. loading?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  149. error?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  150. empty?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  151. 'load-more'?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  152. } | undefined;
  153. } & {
  154. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  155. "v-slot:loading"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  156. "v-slot:error"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  157. "v-slot:empty"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  158. "v-slot:load-more"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  159. } & {
  160. onLoad?: ((options: {
  161. side: InfiniteScrollSide;
  162. done: (status: InfiniteScrollStatus) => void;
  163. }) => any) | undefined;
  164. }, {}, {}, {}, {}, {
  165. direction: "horizontal" | "vertical";
  166. tag: string;
  167. mode: "manual" | "intersect";
  168. side: InfiniteScrollSide;
  169. loadMoreText: string;
  170. emptyText: string;
  171. }>;
  172. __isFragment?: never;
  173. __isTeleport?: never;
  174. __isSuspense?: never;
  175. } & vue.ComponentOptionsBase<{
  176. direction: "horizontal" | "vertical";
  177. tag: string;
  178. mode: "manual" | "intersect";
  179. side: InfiniteScrollSide;
  180. loadMoreText: string;
  181. emptyText: string;
  182. } & {
  183. height?: string | number | undefined;
  184. width?: string | number | undefined;
  185. color?: string | undefined;
  186. margin?: string | number | undefined;
  187. maxHeight?: string | number | undefined;
  188. maxWidth?: string | number | undefined;
  189. minHeight?: string | number | undefined;
  190. minWidth?: string | number | undefined;
  191. } & {
  192. $children?: vue.VNodeChild | (() => vue.VNodeChild) | {
  193. default?: (() => vue.VNodeChild) | undefined;
  194. loading?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  195. error?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  196. empty?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  197. 'load-more'?: ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  198. };
  199. 'v-slots'?: {
  200. default?: false | (() => vue.VNodeChild) | undefined;
  201. loading?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  202. error?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  203. empty?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  204. 'load-more'?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  205. } | undefined;
  206. } & {
  207. "v-slot:default"?: false | (() => vue.VNodeChild) | undefined;
  208. "v-slot:loading"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  209. "v-slot:error"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  210. "v-slot:empty"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  211. "v-slot:load-more"?: false | ((arg: InfiniteScrollSlot) => vue.VNodeChild) | undefined;
  212. } & {
  213. onLoad?: ((options: {
  214. side: InfiniteScrollSide;
  215. done: (status: InfiniteScrollStatus) => void;
  216. }) => any) | undefined;
  217. }, void, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
  218. load: (options: {
  219. side: InfiniteScrollSide;
  220. done: (status: InfiniteScrollStatus) => void;
  221. }) => true;
  222. }, string, {
  223. direction: "horizontal" | "vertical";
  224. tag: string;
  225. mode: "manual" | "intersect";
  226. side: InfiniteScrollSide;
  227. loadMoreText: string;
  228. emptyText: string;
  229. }, {}, string, vue.SlotsType<Partial<{
  230. default: () => vue.VNode[];
  231. loading: (arg: InfiniteScrollSlot) => vue.VNode[];
  232. error: (arg: InfiniteScrollSlot) => vue.VNode[];
  233. empty: (arg: InfiniteScrollSlot) => vue.VNode[];
  234. 'load-more': (arg: InfiniteScrollSlot) => vue.VNode[];
  235. }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{
  236. tag: {
  237. type: StringConstructor;
  238. default: string;
  239. };
  240. height: (StringConstructor | NumberConstructor)[];
  241. maxHeight: (StringConstructor | NumberConstructor)[];
  242. maxWidth: (StringConstructor | NumberConstructor)[];
  243. minHeight: (StringConstructor | NumberConstructor)[];
  244. minWidth: (StringConstructor | NumberConstructor)[];
  245. width: (StringConstructor | NumberConstructor)[];
  246. color: StringConstructor;
  247. direction: {
  248. type: PropType<"vertical" | "horizontal">;
  249. default: string;
  250. validator: (v: any) => boolean;
  251. };
  252. side: {
  253. type: PropType<InfiniteScrollSide>;
  254. default: string;
  255. validator: (v: any) => boolean;
  256. };
  257. mode: {
  258. type: PropType<"intersect" | "manual">;
  259. default: string;
  260. validator: (v: any) => boolean;
  261. };
  262. margin: (StringConstructor | NumberConstructor)[];
  263. loadMoreText: {
  264. type: StringConstructor;
  265. default: string;
  266. };
  267. emptyText: {
  268. type: StringConstructor;
  269. default: string;
  270. };
  271. }, vue.ExtractPropTypes<{
  272. tag: {
  273. type: StringConstructor;
  274. default: string;
  275. };
  276. height: (StringConstructor | NumberConstructor)[];
  277. maxHeight: (StringConstructor | NumberConstructor)[];
  278. maxWidth: (StringConstructor | NumberConstructor)[];
  279. minHeight: (StringConstructor | NumberConstructor)[];
  280. minWidth: (StringConstructor | NumberConstructor)[];
  281. width: (StringConstructor | NumberConstructor)[];
  282. color: StringConstructor;
  283. direction: {
  284. type: PropType<"vertical" | "horizontal">;
  285. default: string;
  286. validator: (v: any) => boolean;
  287. };
  288. side: {
  289. type: PropType<InfiniteScrollSide>;
  290. default: string;
  291. validator: (v: any) => boolean;
  292. };
  293. mode: {
  294. type: PropType<"intersect" | "manual">;
  295. default: string;
  296. validator: (v: any) => boolean;
  297. };
  298. margin: (StringConstructor | NumberConstructor)[];
  299. loadMoreText: {
  300. type: StringConstructor;
  301. default: string;
  302. };
  303. emptyText: {
  304. type: StringConstructor;
  305. default: string;
  306. };
  307. }>>;
  308. type VInfiniteScroll = InstanceType<typeof VInfiniteScroll>;
  309. export { VInfiniteScroll };