index.d.ts 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import type { ExtractPropType } from 'element-plus/es/utils';
  2. import type { ExtractPropTypes, Ref } from 'vue';
  3. declare const _prop: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => (boolean | null) & {}) | (() => boolean | null) | ((new (...args: any[]) => (boolean | null) & {}) | (() => boolean | null))[], never, never, null, false>;
  4. declare const _event: {
  5. readonly type: import("vue").PropType<(val: boolean) => void>;
  6. readonly required: false;
  7. readonly validator: ((val: unknown) => boolean) | undefined;
  8. __epPropKey: true;
  9. };
  10. export declare type UseModelTogglePropsRaw<T extends string> = {
  11. [K in T]: typeof _prop;
  12. } & {
  13. [K in `onUpdate:${T}`]: typeof _event;
  14. };
  15. export declare type UseModelTogglePropsGeneric<T extends string> = {
  16. [K in T]: ExtractPropType<typeof _prop>;
  17. } & {
  18. [K in `onUpdate:${T}`]: ExtractPropType<typeof _event>;
  19. };
  20. export declare const createModelToggleComposable: <T extends string>(name: T) => {
  21. useModelToggle: ({ indicator, toggleReason, shouldHideWhenRouteChanges, shouldProceed, onShow, onHide, }: ModelToggleParams) => {
  22. hide: (event?: Event) => void;
  23. show: (event?: Event) => void;
  24. toggle: () => void;
  25. hasUpdateHandler: import("vue").ComputedRef<boolean>;
  26. };
  27. useModelToggleProps: UseModelTogglePropsRaw<T>;
  28. useModelToggleEmits: `update:${T}`[];
  29. };
  30. declare const useModelToggle: ({ indicator, toggleReason, shouldHideWhenRouteChanges, shouldProceed, onShow, onHide, }: ModelToggleParams) => {
  31. hide: (event?: Event) => void;
  32. show: (event?: Event) => void;
  33. toggle: () => void;
  34. hasUpdateHandler: import("vue").ComputedRef<boolean>;
  35. }, useModelToggleProps: UseModelTogglePropsRaw<"modelValue">, useModelToggleEmits: "update:modelValue"[];
  36. export { useModelToggle, useModelToggleEmits, useModelToggleProps };
  37. export declare type UseModelToggleProps = ExtractPropTypes<typeof useModelToggleProps>;
  38. export declare type ModelToggleParams = {
  39. indicator: Ref<boolean>;
  40. toggleReason?: Ref<Event | undefined>;
  41. shouldHideWhenRouteChanges?: Ref<boolean>;
  42. shouldProceed?: () => boolean;
  43. onShow?: (event?: Event) => void;
  44. onHide?: (event?: Event) => void;
  45. };