Class MethodSelector

Returns a selection object that lazily represents a method with the name within the treespace element (or document). Invoking [call]AttrSelector#get will call the corresponding method on the element selected with the key argument.

This is used as the target of the proxy object returned by method

Example

import { MethodSelector } from 'apption';
document.body.innerHTML = `
<div>I am a div</div>
<p>I am a paragraph</p>
<section>I am a section</section>
<article>I am an article</article>
`;
const slct = new MethodSelector('remove', document.body);
slct.call('section');
console.log(document.querySelector('section')); // null

Hierarchy (view full)

Constructors

Properties

#private: any
#private: any
name: string
treespace?: Element

Methods

  • Parameters

    • key: any
    • Rest ...args: any[]

    Returns any

  • Parameters

    • key: any

    Returns void

  • Parameters

    • key: any

    Returns any

  • Returns any

  • Parameters

    • key: any
    • value: any

    Returns void