import { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";

type $RestProps = SvelteHTMLElements["a"];

type $Props = {
  /**
   * Specify the display name.
   * @default undefined
   */
  name?: string;

  /**
   * Specify the secondary text below the name (for example, a username).
   * @default undefined
   */
  username?: string;

  /**
   * Specify the call-to-action text shown below the identity.
   * Set to a falsy value to hide it.
   * @default "View profile"
   */
  text?: string;

  /**
   * Specify the `href` attribute. When set, the entire block is a link.
   * @default undefined
   */
  href?: string;

  /**
   * Obtain a reference to the HTML element (anchor or div).
   * @default null
   */
  ref?: null | HTMLAnchorElement | HTMLDivElement;

  avatar?: (this: void) => void;

  children?: (this: void) => void;

  [key: `data-${string}`]: unknown;
};

export type ProfileMenuHeaderProps = Omit<$RestProps, keyof $Props> & $Props;

export default class ProfileMenuHeader extends SvelteComponentTyped<
  ProfileMenuHeaderProps,
  { click: WindowEventMap["click"] },
  {
    default: Record<string, never>;
    avatar: Record<string, never>;
  }
> {}
