segmented.d.ts 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
  2. import { ComponentSize } from "../../../constants/size.js";
  3. import "../../../utils/index.js";
  4. import { Option } from "./types.js";
  5. import { _default } from "./segmented.vue.js";
  6. import * as vue from "vue";
  7. import { ExtractPublicPropTypes } from "vue";
  8. //#region ../../packages/components/segmented/src/segmented.d.ts
  9. interface Props {
  10. label?: string;
  11. value?: string;
  12. disabled?: string;
  13. }
  14. declare const defaultProps: Required<Props>;
  15. interface SegmentedProps {
  16. direction?: 'vertical' | 'horizontal';
  17. /**
  18. * @description options of segmented
  19. */
  20. options?: Option[];
  21. /**
  22. * @description binding value
  23. */
  24. modelValue?: string | number | boolean;
  25. /**
  26. * @description configuration options, see the following table
  27. */
  28. props?: Props;
  29. /**
  30. * @description fit width of parent content
  31. */
  32. block?: boolean;
  33. /**
  34. * @description size of component
  35. */
  36. size?: ComponentSize;
  37. /**
  38. * @description whether segmented is disabled
  39. */
  40. disabled?: boolean;
  41. /**
  42. * @description whether to trigger form validation
  43. */
  44. validateEvent?: boolean;
  45. /**
  46. * @description native input id
  47. */
  48. id?: string;
  49. /**
  50. * @description native `name` attribute
  51. */
  52. name?: string;
  53. /**
  54. * @description native `aria-label` attribute
  55. */
  56. ariaLabel?: string;
  57. }
  58. /**
  59. * @deprecated Removed after 3.0.0, Use `SegmentedProps` instead.
  60. */
  61. declare const segmentedProps: {
  62. ariaLabel: StringConstructor;
  63. direction: EpPropFinalized<(new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical") | ((new (...args: any[]) => "horizontal" | "vertical") | (() => "horizontal" | "vertical"))[], unknown, unknown, string, boolean>;
  64. options: EpPropFinalized<(new (...args: any[]) => Option[]) | (() => Option[]) | ((new (...args: any[]) => Option[]) | (() => Option[]))[], unknown, unknown, () => never[], boolean>;
  65. modelValue: EpPropFinalized<(BooleanConstructor | NumberConstructor | StringConstructor)[], unknown, unknown, undefined, boolean>;
  66. props: EpPropFinalized<(new (...args: any[]) => Props) | (() => Props) | ((new (...args: any[]) => Props) | (() => Props))[], unknown, unknown, () => Required<Props>, boolean>;
  67. block: BooleanConstructor;
  68. size: {
  69. readonly type: vue.PropType<EpPropMergeType<StringConstructor, "" | "default" | "small" | "large", never>>;
  70. readonly required: false;
  71. readonly validator: ((val: unknown) => boolean) | undefined;
  72. __epPropKey: true;
  73. };
  74. disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
  75. validateEvent: EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
  76. id: StringConstructor;
  77. name: StringConstructor;
  78. };
  79. /**
  80. * @deprecated Removed after 3.0.0, Use `SegmentedProps` instead.
  81. */
  82. type SegmentedPropsPublic = ExtractPublicPropTypes<typeof segmentedProps>;
  83. declare const segmentedEmits: {
  84. "update:modelValue": (val: any) => val is string | number | boolean;
  85. change: (val: any) => val is string | number | boolean;
  86. };
  87. type SegmentedEmits = typeof segmentedEmits;
  88. type SegmentedInstance = InstanceType<typeof _default> & unknown;
  89. //#endregion
  90. export { Props, SegmentedEmits, SegmentedInstance, SegmentedProps, SegmentedPropsPublic, defaultProps, segmentedEmits, segmentedProps };