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

2.0.35 • Public • Published

Installation

npm install --save @types/farbtastic

Summary

This package contains type definitions for farbtastic (https://github.com/mattfarina/farbtastic).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/farbtastic.

index.d.ts

/// <reference types="jquery" />

declare namespace JQueryFarbtastic {
    type Placeholder = string | Element | JQuery;
    type CallbackFunction = (color: string) => any;
    type Callback = CallbackFunction | Placeholder;

    interface Options {
        callback?: Callback | undefined;
        width?: number | undefined;
        wheelWidth?: number | undefined;
    }

    interface Farbtastic {
        linked: CallbackFunction | JQuery;
        color: string;
        hsl: number[];

        linkTo(callback: Callback): Farbtastic;
        setColor(color: string | number[]): Farbtastic;
        setHSL(hsl: number[]): Farbtastic;
    }
}

interface JQueryStatic {
    farbtastic(
        placeholder: JQueryFarbtastic.Placeholder,
        callback: JQueryFarbtastic.Callback,
    ): JQueryFarbtastic.Farbtastic;
    farbtastic(
        placeholder: JQueryFarbtastic.Placeholder,
        options: JQueryFarbtastic.Options,
    ): JQueryFarbtastic.Farbtastic;
    farbtastic(placeholder: JQueryFarbtastic.Placeholder): JQueryFarbtastic.Farbtastic;
}

interface JQuery {
    farbtastic(callback: JQueryFarbtastic.Callback): JQuery;
    farbtastic(options: JQueryFarbtastic.Options): JQuery;
    farbtastic(): JQuery;
}

Additional Details

  • Last updated: Tue, 30 Jan 2024 21:35:45 GMT
  • Dependencies: @types/jquery

Credits

These definitions were written by Matt Brooks.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/farbtastic

Weekly Downloads

3

Version

2.0.35

License

MIT

Unpacked Size

5.12 kB

Total Files

5

Last publish

Collaborators

  • types