import type { Ref } from "vue";

export interface PickerItem {
  /**
   * 显示文本
   */
  text: string;
  /**
   * 选中值
   */
  value: string|number;
}

export interface PickerFieldInstance {
  /**
   * 显示
   */
  show(): void;
  /**
   * 隐藏
   */
  hide(): void;
}

export function usePickerFieldInstance(show: Ref<boolean>) : PickerFieldInstance {
  return {
    show() {
      show.value = true;
    },
    hide() {
      show.value = false;
    }
  }
}