@types/color-namer
TypeScript icon, indicating that this package has built-in type declarations

1.3.3 • Public • Published

Installation

npm install --save @types/color-namer

Summary

This package contains type definitions for color-namer (https://github.com/zeke/color-namer).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-namer.

index.d.ts

export = ColorNamer;
export as namespace ColorNamer;

declare function ColorNamer<T extends ColorNamer.Palette>(color: string, options?: { pick: T[] }): ColorNamer.Colors<T>;
declare function ColorNamer<T extends ColorNamer.Palette>(
    color: string,
    options?: { omit: T[] },
): ColorNamer.Colors<Diff<ColorNamer.Palette, T>>;

type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];

declare namespace ColorNamer {
    type Colors<T extends Palette> = Record<T, Color[]>;

    type Palette = "roygbiv" | "basic" | "html" | "x11" | "pantone" | "ntc";

    interface Color {
        name: string;
        hex: string;
        distance: number;
    }
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Dmitriy Serdtsev.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/color-namer

Weekly Downloads

1,197

Version

1.3.3

License

MIT

Unpacked Size

3.99 kB

Total Files

5

Last publish

Collaborators

  • types