npm.io
5.0.3 • Published 2 years ago

@types/anchor-js

Licence
MIT
Version
5.0.3
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/anchor-js

Summary

This package contains type definitions for anchor-js (https://github.com/bryanbraun/anchorjs).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/anchor-js.

index.d.ts

// TODO: remove @deprecated aliases in next major version (6.*)
declare namespace anchorjs {
    type Placement = "left" | "right";
    type Visibility = "always" | "hover";

    interface Options {
        ariaLabel?: string | undefined;
        base?: string | undefined;
        class?: string | undefined;
        icon?: string | undefined;
        placement?: AnchorPlacement | undefined;
        titleText?: string | undefined;
        truncate?: number | undefined;
        visible?: Visibility | undefined;
    }

    interface AnchorJS {
        options: Options;
        new(options?: Options): this;
        add(selector?: string): this;
        remove(selector?: string): this;
        removeAll(): void;
    }

    /** @deprecated alias for AnchorJS */
    type Anchor = AnchorJS;
    /** @deprecated alias for {Placement} */
    type AnchorPlacement = Placement;
    /** @deprecated alias for {Visibility} */
    type AnchorVisibility = Visibility;
    /** @deprecated alias for {Options} */
    type AnchorOptions = Options;
}

declare const AnchorJS: anchorjs.AnchorJS;

export = AnchorJS;

export as namespace AnchorJS;

declare global {
    const anchors: anchorjs.AnchorJS;
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 2204 GMT
  • Dependencies: none

Credits

These definitions were written by Brian Surowiec.