# @types/node-pixel

> TypeScript definitions for node-pixel

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

## Install

```sh
npm install @types/node-pixel
pnpm add @types/node-pixel
yarn add @types/node-pixel
bun add @types/node-pixel
```

## 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; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.11.2 |
| Published | 2023-11-07 |
| First published | 2023-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

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

## Dependencies (1)

- [@types/johnny-five](https://npm.io/package/@types/johnny-five.md) ^2.1

## Recent versions

- 0.11.2 (latest) — 2023-11-07
- 0.11.1 — 2023-10-30
- 0.11.0 — 2023-10-29

## README

# Installation
> `npm install --save @types/node-pixel`

# Summary
This package contains type definitions for node-pixel (https://github.com/ajfisher/node-pixel#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-pixel.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-pixel/index.d.ts)
````ts
import { Board } from "johnny-five";
export {};

// Opaque types typings
declare const tag: unique symbol;
interface TagContainer<Token> {
    readonly [tag]: Token;
}
type Opaque<Type, Token = unknown> = Type & TagContainer<Token>;

// Lib typings
export const BACKWARD: Opaque<number, "ShiftDirection">;
export const FORWARD: Opaque<number, "ShiftDirection">;
export type Direction = typeof BACKWARD | typeof FORWARD;

export namespace COLOR_ORDER {
    const GRB: Opaque<number, "ColorOrder">;
    const RGB: Opaque<number, "ColorOrder">;
    const BRG: Opaque<number, "ColorOrder">;
}

export interface StripArgs {
    board: Board;
    strips: Array<{ pin: string | number; length: number }> | number[];
    controller?: "FIRMATA" | "I2CBACKPACK";
    color_order?: typeof COLOR_ORDER.GRB | typeof COLOR_ORDER.RGB | typeof COLOR_ORDER.BRG;
    gamma?: number;
}

export class Strip {
    readonly length: number;

    constructor(args: StripArgs);

    pixel(index: number): Pixel;
    shift(index: number, direction: Direction, wrap: boolean): void;
    color(color: string | number[]): void;
    colour(color: string | number[]): void;
    off(): void;
    clear(): void;
    show(): void;

    on(event: string, callback: () => void): void;
    on(event: "error", callback: (e: Error) => void): void;
}

export interface Pixel {
    color(color: string | number[]): void;
    colour(color: string | number[]): void;
    off(): void;
    clear(): void;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/johnny-five](https://npmjs.com/package/@types/johnny-five)

# Credits
These definitions were written by [Andréas "ScreamZ" HANSS](https://github.com/ScreamZ).

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