utils.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import type { PropType } from 'vue';
  2. import type { PickerOption } from '../picker';
  3. type Filter = (columnType: string, options: PickerOption[]) => PickerOption[];
  4. type Formatter = (type: string, option: PickerOption) => PickerOption;
  5. export declare const sharedProps: {
  6. loading: BooleanConstructor;
  7. readonly: BooleanConstructor;
  8. allowHtml: BooleanConstructor;
  9. optionHeight: {
  10. type: (NumberConstructor | StringConstructor)[];
  11. default: number;
  12. };
  13. showToolbar: {
  14. type: BooleanConstructor;
  15. default: true;
  16. };
  17. swipeDuration: {
  18. type: (NumberConstructor | StringConstructor)[];
  19. default: number;
  20. };
  21. visibleOptionNum: {
  22. type: (NumberConstructor | StringConstructor)[];
  23. default: number;
  24. };
  25. } & {
  26. title: StringConstructor;
  27. cancelButtonText: StringConstructor;
  28. confirmButtonText: StringConstructor;
  29. } & {
  30. modelValue: {
  31. type: PropType<string[]>;
  32. default: () => never[];
  33. };
  34. filter: PropType<Filter>;
  35. formatter: {
  36. type: PropType<Formatter>;
  37. default: (type: string, option: PickerOption) => PickerOption;
  38. };
  39. };
  40. export declare const pickerInheritKeys: ("title" | "readonly" | "loading" | "allowHtml" | "optionHeight" | "showToolbar" | "swipeDuration" | "visibleOptionNum" | "cancelButtonText" | "confirmButtonText")[];
  41. export declare function times<T>(n: number, iteratee: (index: number) => T): T[];
  42. export declare const getMonthEndDay: (year: number, month: number) => number;
  43. export declare const genOptions: <T extends string>(min: number, max: number, type: T, formatter: Formatter, filter?: Filter) => PickerOption[];
  44. export declare const formatValueRange: (values: string[], columns: PickerOption[]) => string[];
  45. export {};