npm.io
1.4.4 • Published 2 years ago

@types/nwmatcher

Licence
MIT
Version
1.4.4
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/nwmatcher

Summary

This package contains type definitions for nwmatcher (https://github.com/dperini/nwmatcher).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nwmatcher.

index.d.ts

declare function nwmatcher(global: { document: Document }): nwmatcher.Matcher;

declare namespace nwmatcher {
    interface Matcher {
        // DOM Selection

        first: (selector: string, context?: Element) => Element | null;
        match: (element: Element, selector: string, context?: Element) => boolean;
        select: (selector: string, context?: Element, callback?: (element: Element) => void) => Element[];

        // DOM Helpers

        byId: (id: string, from?: Element) => Element | null;
        byTag: (tag: string, from?: Element) => Element[];
        byClass: (className: string, from?: Element) => Element[];
        byName: (name: string, from?: Element) => Element[];
        getAttribute: (element: Element, attribute: string) => string | undefined;
        hasAttribute: (element: Element, attribute: string) => boolean;
    }
}

declare global {
    namespace NW {
        const Dom: nwmatcher.Matcher;
    }
}

export = nwmatcher;

Additional Details

  • Last updated: Tue, 07 Nov 2023 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Wouter van Heeswijk.