Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AskSelector<R, E, Mode>

Method signatures that set the delegator selector and instance type of delegating elements.

AskRoot => AskEvent => AskSelector => AskListener builds EventHandler

All overloads return the AskListener interface

Type parameters

Hierarchy

  • AskSelector

Index

Methods

Methods

select

  • Takes the delegation selector.

    Method overload that takes a CSS tag selector for the delegator elements. This provides autocompletion features when starting to type tag-qualified CSS selectors.

    example
    EventDelegation
        .global()
        .events('click')
        .select('button')
    

    Type parameters

    • K: "symbol" | "object" | "a" | "abbr" | "address" | "applet" | "area" | "article" | "aside" | "audio" | "b" | "base" | "basefont" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "dir" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "font" | "footer" | "form" | "frame" | "frameset" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "marquee" | "menu" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "slot" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "tbody" | "td" | "template" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "svg" | "switch" | "text" | "textPath" | "tspan" | "use" | "view"

      the HTML tag name literal type for the selector argument. This param is inferred from the selector argument.

    Parameters

    • selector: K

      An HTML (or SVG) tag selector.

    Returns AskListener<R, E, TagNameMap[K], Mode>

  • Takes the delegation selector.

    The method wil attempt to parse the selector and infer the root element type from it.

    example
    EventDelegation
        .global()
        .events('click')
        .select('form button.my-button[aria-disabled="false"]')
    

    Type parameters

    • S: string

      The CSS-style selector literal type for the selector argument. This param is inferred from the selector argument.

    Parameters

    • selector: S

      A tag-qualified CSS-style selector to parse.

    Returns AskListener<R, E, ParseSelector<S, Element>, Mode>

  • Takes the delegation selector.

    Method overload that can be used when all else fails. If previous overloads failed to match, this one allows you to explicitly specify the expected element type for any selector string.

    example
    EventDelegation
        .global()
        .events('click')
        .select<CustomButton>('custom-button')
    

    Type parameters

    • D: Element

      The element type for the delegator elements. This param can be explicitly given to override the default Element type.

    Parameters

    • selector: string

      Any CSS selector that is expected to select the delegator element type.

    Returns AskListener<R, E, D, Mode>