@antadesign/anta
    Preparing search index...

    Type Alias CopyTargetUnreviewed

    CopyTarget:
        | {
            copy: string;
            copyWithUrl?: boolean;
            onCopyRequest?: () => void;
            onCopied?: (ok: boolean) => void;
            copyNode?: never;
            copyUrl?: never;
        }
        | {
            copyNode: boolean
            | string;
            onCopied?: (ok: boolean) => void;
            copy?: never;
            copyUrl?: never;
            copyWithUrl?: never;
            onCopyRequest?: never;
        }
        | {
            copyUrl: true;
            onCopied?: (ok: boolean) => void;
            copy?: never;
            copyNode?: never;
            copyWithUrl?: never;
            onCopyRequest?: never;
        }

    The copy target for a copy preset (ButtonCopy / MenuItemCopy) — exactly one of a literal string, a DOM region, or the page URL. The write itself is performed by the slotted <a-copy> element; these props map to its attributes via copyElementProps. copyWithUrl / onCopyRequest are only meaningful for the string target, so the union pins them never elsewhere.

    Type Declaration

    • {
          copy: string;
          copyWithUrl?: boolean;
          onCopyRequest?: () => void;
          onCopied?: (ok: boolean) => void;
          copyNode?: never;
          copyUrl?: never;
      }
      • Unreviewedcopy: string

        Text copied to the clipboard on activation.

      • Optional UnreviewedcopyWithUrl?: boolean

        Prefix the copied text with // URL: <current page URL>.

      • Optional UnreviewedonCopyRequest?: () => void

        Refresh a dynamic copy value before activation. Set the new string in application state so the next render updates copy. Return values are ignored. Fires on pointerdown and Enter/Space keydown.

      • Optional UnreviewedonCopied?: (ok: boolean) => void

        Fires after the copy attempt with whether it succeeded.

      • OptionalcopyNode?: never
      • OptionalcopyUrl?: never
    • {
          copyNode: boolean | string;
          onCopied?: (ok: boolean) => void;
          copy?: never;
          copyUrl?: never;
          copyWithUrl?: never;
          onCopyRequest?: never;
      }
      • UnreviewedcopyNode: boolean | string

        Copy a DOM node as rich text (text/html) + plain text. true copies the nearest ancestor marked data-copy-source; a string is a CSS selector for an ancestor region (closest). The copy control is stripped from the copied output.

      • Optional UnreviewedonCopied?: (ok: boolean) => void

        Fires after the copy attempt with whether it succeeded.

      • Optionalcopy?: never
      • OptionalcopyUrl?: never
      • OptionalcopyWithUrl?: never
      • OptionalonCopyRequest?: never
    • {
          copyUrl: true;
          onCopied?: (ok: boolean) => void;
          copy?: never;
          copyNode?: never;
          copyWithUrl?: never;
          onCopyRequest?: never;
      }
      • UnreviewedcopyUrl: true

        Copy the current page URL (location.href).

      • Optional UnreviewedonCopied?: (ok: boolean) => void

        Fires after the copy attempt with whether it succeeded.

      • Optionalcopy?: never
      • OptionalcopyNode?: never
      • OptionalcopyWithUrl?: never
      • OptionalonCopyRequest?: never