link.d.ts 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { IconPropType } from "../../../utils/vue/icon.js";
  2. import { EpPropFinalized, EpPropMergeType } from "../../../utils/vue/props/types.js";
  3. import _default from "./link.vue.js";
  4. import * as _$vue from "vue";
  5. import { ExtractPublicPropTypes, PropType } from "vue";
  6. //#region ../../packages/components/link/src/link.d.ts
  7. interface LinkProps {
  8. /**
  9. * @description type
  10. */
  11. type?: 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'default';
  12. /**
  13. * @description when underlines should appear
  14. */
  15. underline?: boolean | 'always' | 'never' | 'hover';
  16. /**
  17. * @description whether the component is disabled
  18. */
  19. disabled?: boolean;
  20. /**
  21. * @description same as native hyperlink's `href`
  22. */
  23. href?: string;
  24. /**
  25. * @description same as native hyperlink's `target`
  26. */
  27. target?: '_blank' | '_parent' | '_self' | '_top' | (string & NonNullable<unknown>);
  28. /**
  29. * @description icon component
  30. */
  31. icon?: IconPropType;
  32. }
  33. /**
  34. * @deprecated Removed after 3.0.0, Use `LinkProps` instead.
  35. */
  36. declare const linkProps: {
  37. readonly type: EpPropFinalized<StringConstructor, "default" | "info" | "primary" | "success" | "warning" | "danger", unknown, undefined, boolean>;
  38. readonly underline: EpPropFinalized<readonly [BooleanConstructor, StringConstructor], boolean | "always" | "never" | "hover", unknown, undefined, boolean>;
  39. readonly disabled: BooleanConstructor;
  40. readonly href: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
  41. readonly target: EpPropFinalized<(new (...args: any[]) => string) | (() => string) | (((new (...args: any[]) => string) | (() => string)) | null)[], unknown, unknown, "_self", boolean>;
  42. readonly icon: {
  43. readonly type: PropType<EpPropMergeType<(new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component) | (((new (...args: any[]) => (string | _$vue.Component) & {}) | (() => string | _$vue.Component)) | null)[], unknown, unknown>>;
  44. readonly required: false;
  45. readonly validator: ((val: unknown) => boolean) | undefined;
  46. __epPropKey: true;
  47. };
  48. };
  49. /**
  50. * @deprecated Removed after 3.0.0, Use `LinkProps` instead.
  51. */
  52. type LinkPropsPublic = ExtractPublicPropTypes<typeof linkProps>;
  53. declare const linkEmits: {
  54. click: (evt: MouseEvent) => boolean;
  55. };
  56. type LinkEmits = typeof linkEmits;
  57. type LinkInstance = InstanceType<typeof _default> & unknown;
  58. interface LinkConfigContext {
  59. type?: LinkProps['type'];
  60. underline?: LinkProps['underline'];
  61. }
  62. //#endregion
  63. export { LinkConfigContext, LinkEmits, LinkInstance, LinkProps, LinkPropsPublic, linkEmits, linkProps };