# @types/anchor-js

> TypeScript definitions for anchor-js

Latest version **5.0.3** (published 2023-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/anchor-js
pnpm add @types/anchor-js
yarn add @types/anchor-js
bun add @types/anchor-js
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 5.0.3 |
| Published | 2023-11-06 |
| First published | 2018-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51481 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/anchor-js
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/anchor-js
- npm.io page: https://npm.io/package/@types/anchor-js

## Recent versions

- 5.0.3 (latest) — 2023-11-06
- 5.0.0 (ts4.2) — 2023-02-14
- 4.2.1 (ts3.6) — 2021-07-07
- 4.2.0 (ts2.8) — 2020-01-15
- 4.1.0 (ts2.0) — 2018-02-28
- 5.0.2 — 2023-10-17
- 5.0.1 — 2023-09-22

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/anchor-js/index.d.ts)
````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](https://github.com/xt0rted).

---
_Source: https://npm.io/package/@types/anchor-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
