# @types/spritesmith

> TypeScript definitions for spritesmith

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

## Install

```sh
npm install @types/spritesmith
pnpm add @types/spritesmith
yarn add @types/spritesmith
bun add @types/spritesmith
```

## 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.4.5 |
| Published | 2023-11-07 |
| First published | 2023-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51443 |
| Maintainers | types |

## Links

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

## Dependencies (1)

- [@types/vinyl](https://npm.io/package/@types/vinyl.md) *

## Recent versions

- 3.4.5 (latest) — 2023-11-07
- 3.4.2 (ts4.3) — 2023-07-31
- 3.4.1 (ts4.2) — 2023-01-31
- 3.4.4 — 2023-10-18
- 3.4.3 — 2023-09-25
- 3.4.0 — 2023-01-30

## README

# Installation
> `npm install --save @types/spritesmith`

# Summary
This package contains type definitions for spritesmith (https://github.com/twolfson/spritesmith).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/spritesmith.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/spritesmith/index.d.ts)
````ts
import { Transform } from "stream";
import { BufferFile } from "vinyl";

declare class Spritesmith {
    constructor(params?: Spritesmith.SpritesmithParams);
    static run(
        params:
            & Spritesmith.SpritesmithParams
            & Spritesmith.SpritesmithProcessImagesOptions
            & {
                src: Spritesmith.SpritesmithCreateImagesSrc;
            },
        callback: (err: Error | null, result: Spritesmith.SpritesmithResult) => void,
    ): void;
    createImages(
        src: Spritesmith.SpritesmithCreateImagesSrc,
        callback: (err: Error | null, images: Spritesmith.SpritesmithImage[]) => void,
    ): void;
    processImages(
        images: Spritesmith.SpritesmithImage[],
        options?: Spritesmith.SpritesmithProcessImagesOptions,
    ): Spritesmith.SpritesmithResult<Transform>;
}

declare namespace Spritesmith {
    interface SpritesmithParams {
        engine?: string;
        engineOpts?: Record<string, unknown>;
    }

    type SpritesmithCreateImagesSrc = Array<string | BufferFile>;
    interface SpritesmithImage {
        width: number;
        height: number;
        [key: string]: unknown;
    }

    interface SpritesmithProcessImagesOptions {
        padding?: number;
        exportOpts?: {
            format?: "png" | "jpg" | "jpeg" | "webp";
            quality?: number;
            background?: string;
            [key: string]: unknown;
        };
        algorithm?: "top-down" | "left-right" | "diagonal" | "alt-diagonal" | "binary-tree";
        algorithmOpts?: {
            sort?: boolean;
        };
    }

    interface SpritesmithResult<Image extends Buffer | Transform = Buffer> {
        image: Image;
        coordinates: Record<string, { x: number; y: number; width: number; height: number }>;
        properties: { width: number; height: number };
    }
}

export = Spritesmith;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/vinyl](https://npmjs.com/package/@types/vinyl)

# Credits
These definitions were written by [Zenoo](https://github.com/Zenoo).

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