# @types/mapbox__shelf-pack

> TypeScript definitions for @mapbox/shelf-pack

Latest version **3.0.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/mapbox__shelf-pack
pnpm add @types/mapbox__shelf-pack
yarn add @types/mapbox__shelf-pack
bun add @types/mapbox__shelf-pack
```

## 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 | 3.0.6 |
| Published | 2023-11-07 |
| First published | 2017-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51432 |
| Maintainers | types |

## Links

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

## Recent versions

- 3.0.6 (latest) — 2023-11-07
- 3.0.2 (ts4.3) — 2023-09-01
- 3.0.1 (ts3.6) — 2021-07-08
- 3.0.0 (ts2.0) — 2017-06-28
- 3.0.5 — 2023-10-18
- 3.0.4 — 2023-09-27
- 3.0.3 — 2023-09-27

## README

# Installation
> `npm install --save @types/mapbox__shelf-pack`

# Summary
This package contains type definitions for @mapbox/shelf-pack (https://github.com/mapbox/shelf-pack).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__shelf-pack.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mapbox__shelf-pack/index.d.ts)
````ts
/* eslint-disable @definitelytyped/no-declare-current-package */
// eslint-disable-next-line @definitelytyped/no-single-declare-module
declare module "@mapbox/shelf-pack" {
    export = ShelfPack;

    class ShelfPack {
        constructor(width?: number, height?: number, options?: ShelfPack.CreateOption);

        pack(
            bins: Array<ShelfPack.RequestShort | ShelfPack.RequestLong>,
            options?: ShelfPack.PackOption,
        ): ShelfPack.Bin[];
        packOne(w: number, h: number, id?: ShelfPack.ID): ShelfPack.Bin;
        getBin(id: ShelfPack.ID): ShelfPack.Bin;
        ref(bin: ShelfPack.Bin): number;
        unref(bin: ShelfPack.Bin): number;
        clear(): void;
        resize(w: number, h: number): boolean;

        w: number;
        h: number;
    }

    namespace ShelfPack {
        class Bin {
            constructor(id: ID, x: number, y: number, w: number, h: number, maxw?: number, maxh?: number);

            id: ID;
            x: number;
            y: number;
            w: number;
            h: number;
        }

        type ID = number | string;
        interface Request {
            id?: ID | undefined;
        }
        interface RequestShort extends Request {
            w: number;
            h: number;
        }
        interface RequestLong extends Request {
            width: number;
            height: number;
        }

        interface PackOption {
            /// If true , the supplied bin objects will be updated inplace with x and y properties
            inPlace?: boolean | undefined;
        }

        interface CreateOption {
            /// If true , the sprite will automatically grow
            autoResize?: boolean | undefined;
        }
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Gyusun Yeom](https://github.com/Perlmint).

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