@types/anchor-js
TypeScript icon, indicating that this package has built-in type declarations

5.0.3 • Public • Published

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 22:41:04 GMT
  • Dependencies: none

Credits

These definitions were written by Brian Surowiec.

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @types/anchor-js

      Weekly Downloads

      549

      Version

      5.0.3

      License

      MIT

      Unpacked Size

      4.92 kB

      Total Files

      5

      Last publish

      Collaborators

      • types