forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
farbtastic.d.ts
40 lines (33 loc) · 1.38 KB
/
farbtastic.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Type definitions for Farbtastic: jQuery Color Wheel v2.0.0-alpha.1
// Project: http://mattfarina.github.io/farbtastic/
// Definitions by: Matt Brooks <https://github.com/EnableSoftware>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare namespace JQueryFarbtastic {
type Placeholder = string | Element | JQuery;
type CallbackFunction = (color: string) => any;
type Callback = CallbackFunction | Placeholder;
interface Options {
callback?: Callback;
width?: number;
wheelWidth?: number;
}
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;
}