mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge branch 'master' into patch-2
Conflicts: angularfire/angularfire.d.ts
This commit is contained in:
@@ -29,6 +29,10 @@ module controllers {
|
||||
},
|
||||
file: file
|
||||
})
|
||||
.abort()
|
||||
.xhr((evt: any) => {
|
||||
console.log('xhr');
|
||||
})
|
||||
.progress((evt: angular.angularFileUpload.IFileProgressEvent) => {
|
||||
var percent = parseInt((100.0 * evt.loaded / evt.total).toString(), 10);
|
||||
console.log("upload progress: " + percent + "% for " + evt.config.file.name);
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ declare module angular.angularFileUpload {
|
||||
}
|
||||
|
||||
interface IUploadPromise<T> extends IHttpPromise<T> {
|
||||
|
||||
abort(): IUploadPromise<T>;
|
||||
progress(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
||||
xhr(callback: IHttpPromiseCallback<T>): IUploadPromise<T>;
|
||||
}
|
||||
|
||||
interface IFileUploadConfig extends IRequestConfig {
|
||||
|
||||
@@ -46,7 +46,7 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
|
||||
// AngularFireObject
|
||||
{
|
||||
var obj = sync.$asObject();
|
||||
var obj = $FirebaseObject(ref);
|
||||
|
||||
// $id
|
||||
if (obj.$id !== ref.name()) throw "error";
|
||||
@@ -63,7 +63,7 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
});
|
||||
|
||||
// $ref()
|
||||
if (obj.$ref() !== sync) throw "error";
|
||||
if (obj.$ref() !== ref) throw "error";
|
||||
|
||||
// $bindTo()
|
||||
obj.$bindTo($scope, "data").then(function () {
|
||||
@@ -92,10 +92,10 @@ myapp.controller("MyController", ["$scope", "$firebase", '$FirebaseObject', '$Fi
|
||||
|
||||
// AngularFireArray
|
||||
{
|
||||
var list = sync.$asArray();
|
||||
var list = $FirebaseArray(ref);
|
||||
|
||||
// $ref()
|
||||
if (list.$ref() !== sync) throw "error";
|
||||
if (list.$ref() !== ref) throw "error";
|
||||
|
||||
// $add()
|
||||
list.$add({ foo: "foo value" });
|
||||
|
||||
Vendored
+2
-2
@@ -94,7 +94,7 @@ interface AngularFireObject extends AngularFireSimpleObject {
|
||||
/**
|
||||
* @returns {Firebase} the original Firebase instance used to create this object.
|
||||
*/
|
||||
$ref(): AngularFire;
|
||||
$ref(): Firebase;
|
||||
|
||||
/**
|
||||
* Creates a 3-way data sync between this object, the Firebase server, and a
|
||||
@@ -277,7 +277,7 @@ interface AngularFireArray extends Array<AngularFireSimpleObject> {
|
||||
/**
|
||||
* @returns {Firebase} the original Firebase ref used to create this object.
|
||||
*/
|
||||
$ref(): AngularFire;
|
||||
$ref(): Firebase;
|
||||
|
||||
/**
|
||||
* Listeners passed into this method are notified whenever a new change (add, updated,
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Vendored
+40
@@ -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;
|
||||
}
|
||||
@@ -2,3 +2,7 @@
|
||||
/// <reference path="jquery.placeholder.d.ts"/>
|
||||
|
||||
$('input').placeholder();
|
||||
|
||||
// specify custom class
|
||||
$('input').placeholder({ customClass: 'my-placeholder' });
|
||||
|
||||
|
||||
+4
-5
@@ -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
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+2551
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user