@types/get-image-colors
TypeScript icon, indicating that this package has built-in type declarations

4.0.5 • Public • Published

Installation

npm install --save @types/get-image-colors

Summary

This package contains type definitions for get-image-colors (https://github.com/colorjs/get-image-colors#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/get-image-colors.

index.d.ts

/// <reference types="node" />

import { Color } from "chroma-js";

/**
 * Extract colors from images. Supports GIF, JPG, PNG, and even SVG!
 */
declare function colorPalette(
    input: Buffer | string,
    typeOrOptions: string | colorPalette.Options,
    callback: colorPalette.Callback,
): void;
declare function colorPalette(input: Buffer | string, typeOrOptions?: string | colorPalette.Options): Promise<Color[]>;
declare function colorPalette(input: Buffer | string, callback: colorPalette.Callback): void;

declare namespace colorPalette {
    interface Options {
        /**
         * @default undefined
         */
        type?: string | undefined;
        /**
         * @default 5
         */
        count?: number | undefined;
    }

    /**
     * If you don't like promises, you can use node-style callbacks too
     */
    type Callback = (error: Error | null, colors: Color[]) => void;
}

export = colorPalette;

Additional Details

Credits

These definitions were written by Piotr Błażejewicz.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/get-image-colors

Weekly Downloads

5,278

Version

4.0.5

License

MIT

Unpacked Size

4.68 kB

Total Files

5

Last publish

Collaborators

  • types