utils.d.ts 1.7 KB

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