forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: angularfire/angularfire.d.ts
- Loading branch information
Showing
10 changed files
with
5,207 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
/// <reference path="farbtastic.d.ts" /> | ||
|
||
var callback = () => {}; | ||
var domNode = document.createElement("div"); | ||
|
||
// Basic usage | ||
|
||
// Can add a ready() handler to the document which initializes the color picker and links it to the text field | ||
$(document).ready(function() { | ||
$("#colorpicker").farbtastic("#color"); | ||
}); | ||
|
||
// Advanced Usage: jQuery Method | ||
|
||
// Create color pickers in the selected objects | ||
$("#colorpicker").farbtastic(); | ||
|
||
// Optional callback using a callback function | ||
$("#colorpicker").farbtastic(callback); | ||
$("#colourpicker").farbtastic(function (color) { | ||
console.log(typeof color === "string"); | ||
}); | ||
|
||
// Optional callback using a DOM node | ||
$("#colorpicker").farbtastic(domNode); | ||
|
||
// Optional callback using a jQuery object | ||
$("#colorpicker").farbtastic($("#color")); | ||
|
||
// Optional callback using a jQuery selector | ||
$("#colorpicker").farbtastic("#color"); | ||
|
||
// Advanced Usage: Object | ||
|
||
// Can invoke method for returning Farbtastic object instead of a jQuery object | ||
$.farbtastic(domNode); | ||
$.farbtastic($("#color")); | ||
$.farbtastic("#color"); | ||
|
||
// Optional callback using a callback function | ||
$.farbtastic(domNode, callback); | ||
$.farbtastic($("#color"), callback); | ||
$.farbtastic("#color", callback); | ||
|
||
// Optional callback using a DOM node | ||
$.farbtastic(domNode, domNode); | ||
$.farbtastic($("#color"), domNode); | ||
$.farbtastic("#color", domNode); | ||
|
||
// Optional callback using a jQuery object | ||
$.farbtastic(domNode, $("#color")); | ||
$.farbtastic($("#color"), $("#color")); | ||
$.farbtastic("#color", $("#color")); | ||
|
||
// Optional callback using a jQuery selector | ||
$.farbtastic(domNode, "#color"); | ||
$.farbtastic($("#color"), "#color"); | ||
$.farbtastic("#color", "#color"); | ||
|
||
// Advanced Usage: Options | ||
$("#colorpicker").farbtastic({ | ||
callback: (color) => { | ||
console.log(color); | ||
} | ||
}); | ||
$.farbtastic(domNode, { | ||
width: 500 | ||
}); | ||
$.farbtastic($("#color"), { | ||
wheelWidth: 300 | ||
}); | ||
$.farbtastic("#color", {}); | ||
|
||
// Advanced Usage: Methods | ||
$.farbtastic("#colorpicker").linkTo(callback); | ||
$.farbtastic("#colorpicker").linkTo(domNode); | ||
$.farbtastic("#colorpicker").linkTo("#color"); | ||
$.farbtastic("#colorpicker").linkTo($("#color")); | ||
|
||
$.farbtastic("#colorpicker").setColor("#aabbcc"); | ||
$.farbtastic("#colorpicker").setColor([0.1, 0.2, 0.3]); | ||
$.farbtastic("#colorpicker").setHSL([0.1, 0.2, 0.3]); | ||
|
||
// Advanced Usage: Properties | ||
$.farbtastic("#colorpicker").color === "#aabbcc"; | ||
$.farbtastic("#colorpicker").hsl === [0.1, 0.2, 0.3]; | ||
$.farbtastic("#colorpicker").linked === $("#colorpicker"); | ||
$.farbtastic("#colorpicker").linked === callback; | ||
|
||
// Can chain jQuery methods | ||
$("#colorpicker") | ||
.farbtastic() | ||
.addClass("color-picker"); | ||
|
||
// Can chain Farbtastic methods | ||
$.farbtastic("#colorpicker") | ||
.linkTo(domNode) | ||
.setColor("#000000") | ||
.setHSL([0, 0, 0]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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/borisyankov/DefinitelyTyped | ||
|
||
/// <reference path="../jquery/jquery.d.ts" /> | ||
|
||
declare module 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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
// Type definitions for jquery.placeholder.js 2.0.7 | ||
// Type definitions for jquery.placeholder.js 2.1.1 | ||
// Project: https://github.com/mathiasbynens/jquery-placeholder | ||
// Definitions by: Peter Gill <https://github.com/majorsilence> | ||
// Definitions by: Peter Gill <https://github.com/majorsilence>, Neil Culver <https://github.com/EnableSoftware> | ||
// Definitions: https://github.com/borisyankov/DefinitelyTyped | ||
|
||
/// <reference path="../jquery/jquery.d.ts"/> | ||
|
||
interface JQuery { | ||
|
||
placeholder() : void; | ||
|
||
placeholder(options: { customClass: string }) : JQuery | ||
placeholder() : JQuery | ||
} | ||
|
Oops, something went wrong.