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.