mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-26 19:04:13 +08:00
Merge branch 'master' into switch-0.9.5
This commit is contained in:
@@ -101,6 +101,7 @@ List of Definitions
|
||||
* [iCheck](http://damirfoy.com/iCheck/) (by [Dániel Tar](https://github.com/qcz))
|
||||
* [Impress.js](https://github.com/bartaz/impress.js) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [iScroll](http://cubiq.org/iscroll-4) (by [Boris Yankov](https://github.com/borisyankov) and [Christiaan Rakowski](https://github.com/csrakowski))
|
||||
* [IxJS (Interactive extensions)](https://github.com/Reactive-Extensions/IxJS) (by [Igor Oleinikov](https://github.com/Igorbek))
|
||||
* [jake](https://github.com/mde/jake) (by [Kon](http://phyzkit.net/))
|
||||
* [Jasmine](http://pivotal.github.com/jasmine/) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Jasmine-jQuery](https://github.com/velesin/jasmine-jquery) (by [Gregor Stamac](https://github.com/gstamac))
|
||||
@@ -154,6 +155,7 @@ List of Definitions
|
||||
* [Knockout.Mapper](https://github.com/LucasLorentz/knockout.mapper) (by [Brandon Meyer](https://github.com/BMeyerKC))
|
||||
* [Knockout.Mapping](https://github.com/SteveSanderson/knockout.mapping) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [Knockout.Postbox](https://github.com/rniemeyer/knockout-postbox) (by [Judah Gabriel Himango](https://github.com/JudahGabriel))
|
||||
* [Knockout.Rx](https://github.com/Igorbek/knockout.rx) (by [Igor Oleinikov](https://github.com/Igorbek))
|
||||
* [Knockout.Validation](https://github.com/ericmbarnard/Knockout-Validation) (by [Dan Ludwig](https://github.com/danludwig))
|
||||
* [Knockout.Viewmodel](http://coderenaissance.github.com/knockout.viewmodel/) (by [Oisin Grehan](https://github.com/oising))
|
||||
* [ko.editables](http://romanych.github.com/ko.editables/) (by [Oisin Grehan](https://github.com/oising))
|
||||
@@ -208,6 +210,7 @@ List of Definitions
|
||||
* [Sencha Touch](http://www.sencha.com/products/touch/) (by [Brian Kotek](https://github.com/brian428))
|
||||
* [SharePoint](http://sptypescript.codeplex.com) (by [Stanislav Vyshchepan](http://gandjustas.blogspot.ru) and [Andrey Markeev](http://markeev.com))
|
||||
* [SignalR](http://www.asp.net/signalr) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
* [simple-cw-node](https://github.com/astronaughts/simple-cw-node) (by [vvakame](https://github.com/vvakame))
|
||||
* [Sinon](http://sinonjs.org/) (by [William Sears](https://github.com/mrbigdog2u))
|
||||
* [SlickGrid](https://github.com/mleibman/SlickGrid) (by [Josh Baldwin](https://github.com/jbaldwin))
|
||||
* [socket.io](http://socket.io) (by [William Orr](https://github.com/worr))
|
||||
|
||||
@@ -48,6 +48,10 @@ function testPieChart() {
|
||||
}
|
||||
|
||||
//Example from http://bl.ocks.org/3887051
|
||||
interface GroupedData {
|
||||
State: string;
|
||||
ages: Array<{ name: string; value: number;}>;
|
||||
}
|
||||
function groupedBarChart() {
|
||||
var margin = { top: 20, right: 20, bottom: 30, left: 40 },
|
||||
width = 960 - margin.left - margin.right,
|
||||
@@ -79,7 +83,7 @@ function groupedBarChart() {
|
||||
.append("g")
|
||||
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
|
||||
|
||||
d3.csv("data.csv", function (error, data) {
|
||||
d3.csv("data.csv", function (error, data: Array<GroupedData>) {
|
||||
var ageNames = d3.keys(data[0]).filter(function (key) { return key !== "State"; });
|
||||
|
||||
data.forEach(function (d) {
|
||||
@@ -731,6 +735,11 @@ function chainedTransitions() {
|
||||
}
|
||||
|
||||
//Example from http://bl.ocks.org/mbostock/4062085
|
||||
interface PyramidData {
|
||||
people: number;
|
||||
year: number;
|
||||
age: number;
|
||||
}
|
||||
function populationPyramid() {
|
||||
var margin = { top: 20, right: 40, bottom: 30, left: 20 },
|
||||
width = 960 - margin.left - margin.right,
|
||||
@@ -766,7 +775,7 @@ function populationPyramid() {
|
||||
.attr("dy", ".71em")
|
||||
.text(2000);
|
||||
|
||||
d3.csv("population.csv", function (error, data) {
|
||||
d3.csv("population.csv", function (error, data: Array<PyramidData>) {
|
||||
|
||||
// Convert strings to numbers.
|
||||
data.forEach(function (d) {
|
||||
@@ -1470,8 +1479,8 @@ function streamGraph() {
|
||||
var n = 20, // number of layers
|
||||
m = 200, // number of samples per layer
|
||||
stack = d3.layout.stack().offset("wiggle"),
|
||||
layers0 = stack(d3.range(n).map(function () { return bumpLayer(m); } )),
|
||||
layers1 = stack(d3.range(n).map(function () { return bumpLayer(m); } ));
|
||||
layers0 = stack(d3.range(n).map(function () { return bumpLayer(m); })),
|
||||
layers1 = stack(d3.range(n).map(function () { return bumpLayer(m); }));
|
||||
|
||||
var width = 960,
|
||||
height = 500;
|
||||
@@ -1481,16 +1490,16 @@ function streamGraph() {
|
||||
.range([0, width]);
|
||||
|
||||
var y = d3.scale.linear()
|
||||
.domain([0, d3.max(layers0.concat(layers1), function (layer) { return d3.max(layer, function (d) { return d.y0 + d.y; } ); } )])
|
||||
.domain([0, d3.max(layers0.concat(layers1), function (layer) { return d3.max(layer, function (d) { return d.y0 + d.y; }); })])
|
||||
.range([height, 0]);
|
||||
|
||||
var color = d3.scale.linear()
|
||||
.range(["#aad", "#556"]);
|
||||
|
||||
var area = d3.svg.area()
|
||||
.x(function (d) { return x(d.x); } )
|
||||
.y0(function (d) { return y(d.y0); } )
|
||||
.y1(function (d) { return y(d.y0 + d.y); } );
|
||||
.x(function (d) { return x(d.x); })
|
||||
.y0(function (d) { return y(d.y0); })
|
||||
.y1(function (d) { return y(d.y0 + d.y); });
|
||||
|
||||
var svg = d3.select("body").append("svg")
|
||||
.attr("width", width)
|
||||
@@ -1500,7 +1509,7 @@ function streamGraph() {
|
||||
.data(layers0)
|
||||
.enter().append("path")
|
||||
.attr("d", area)
|
||||
.style("fill", function () { return color(Math.random()); } );
|
||||
.style("fill", function () { return color(Math.random()); });
|
||||
|
||||
function transition() {
|
||||
d3.selectAll("path")
|
||||
@@ -1508,14 +1517,14 @@ function streamGraph() {
|
||||
var d = layers1;
|
||||
layers1 = layers0;
|
||||
return layers0 = d;
|
||||
} )
|
||||
})
|
||||
.transition()
|
||||
.duration(2500)
|
||||
.attr("d", area);
|
||||
}
|
||||
|
||||
// Inspired by Lee Byron's test data generator.
|
||||
function bumpLayer(n) {
|
||||
function bumpLayer(n): Array<{x: number; y: number;y0?:number;}> {
|
||||
|
||||
function bump(a) {
|
||||
var x = 1 / (.1 + Math.random()),
|
||||
@@ -2123,7 +2132,7 @@ function nestTest () {
|
||||
|
||||
entries = d3.nest()
|
||||
.key(function(d) { return d.foo; })
|
||||
.rollup(function(values) { return d3.sum(values, function(d) { return d.bar; }); })
|
||||
.rollup(function(values) { return d3.sum<any>(values, function(d) { return d.bar; }); })
|
||||
.entries([{foo: 1, bar: 2}, {foo: 1, bar: 0}, {foo: 1, bar: 1}, {foo: 2}]);
|
||||
|
||||
entries = d3.nest()
|
||||
|
||||
4
d3/d3.d.ts
vendored
4
d3/d3.d.ts
vendored
@@ -200,7 +200,7 @@ declare module D3 {
|
||||
*
|
||||
* @param map Array of objects to get the key values from
|
||||
*/
|
||||
keys(map: any[]): any[];
|
||||
keys(map: any): string[];
|
||||
/**
|
||||
* List the values of an associative array.
|
||||
*
|
||||
@@ -1032,7 +1032,7 @@ declare module D3 {
|
||||
}
|
||||
|
||||
export interface StackLayout {
|
||||
(layers: any[], index?: number): any[];
|
||||
<T>(layers: T[], index?: number): T[];
|
||||
values(accessor?: (d: any) => any): StackLayout;
|
||||
offset(offset: string): StackLayout;
|
||||
}
|
||||
|
||||
@@ -669,6 +669,13 @@ $('#calendar').fullCalendar({
|
||||
eventColor: '#378006'
|
||||
});
|
||||
|
||||
interface EventWithDescription extends FullCalendar.EventObject {
|
||||
description: string;
|
||||
}
|
||||
interface JQuery {
|
||||
qtip: any; // dummy plugin interface
|
||||
}
|
||||
|
||||
$('#calendar').fullCalendar({
|
||||
events: [
|
||||
{
|
||||
@@ -678,7 +685,7 @@ $('#calendar').fullCalendar({
|
||||
}
|
||||
// more events here
|
||||
],
|
||||
eventRender: function (event, element) {
|
||||
eventRender: function (event: EventWithDescription, element) {
|
||||
element.qtip({
|
||||
content: event.description
|
||||
});
|
||||
|
||||
36
fullCalendar/fullCalendar.d.ts
vendored
36
fullCalendar/fullCalendar.d.ts
vendored
@@ -69,16 +69,16 @@ declare module FullCalendar {
|
||||
dayNamesShort?: Array<string>;
|
||||
weekNumberTitle?: number;
|
||||
|
||||
dayClick?: (date: Date, allDay: boolean, jsEvent: Event, view: View) => void;
|
||||
eventClick?: (event: EventObject, jsEvent: Event, view: View) => any; // return type boolean or void
|
||||
eventMouseover?: (event: EventObject, jsEvent: Event, view: View) => void;
|
||||
eventMouseout?: (event: EventObject, jsEvent: Event, view: View) => void;
|
||||
dayClick?: (date: Date, allDay: boolean, jsEvent: MouseEvent, view: View) => void;
|
||||
eventClick?: (event: EventObject, jsEvent: MouseEvent, view: View) => any; // return type boolean or void
|
||||
eventMouseover?: (event: EventObject, jsEvent: MouseEvent, view: View) => void;
|
||||
eventMouseout?: (event: EventObject, jsEvent: MouseEvent, view: View) => void;
|
||||
|
||||
selectable?: any; // Boolean/ViewOptionHash
|
||||
selectHelper?: any; // Boolean/Function
|
||||
unselectAuto?: boolean;
|
||||
unselectCancel?: string;
|
||||
select?: (startDate: Date, endDate: Date, allDay: boolean, jsEvent: Event, view: View) => void;
|
||||
select?: (startDate: Date, endDate: Date, allDay: boolean, jsEvent: MouseEvent, view: View) => void;
|
||||
unselect?: (view: View, jsEvent: Event) => void;
|
||||
|
||||
eventSources?: Array<EventSource>;
|
||||
@@ -103,16 +103,16 @@ declare module FullCalendar {
|
||||
disableResizing?: boolean;
|
||||
dragRevertDuration?: number;
|
||||
dragOpacity?: any; // Float/ViewOptionHash
|
||||
eventDragStart?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void;
|
||||
eventDragStop?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void;
|
||||
eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: View) => void;
|
||||
eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: View) => void;
|
||||
eventDrop?: (event: EventObject, dayDelta: number, minuteDelta: number, revertFunc: Function, jsEvent: Event, ui: any, view: View) => void;
|
||||
eventResizeStart?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void;
|
||||
eventResizeStop?: (event: EventObject, jsEvent: Event, ui: any, view: View) => void;
|
||||
eventResizeStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: View) => void;
|
||||
eventResizeStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: View) => void;
|
||||
eventResize?: (event: EventObject, dayDelta: number, minuteDelta: number, revertFunc: Function, jsEvent: Event, ui: any, view: View) => void;
|
||||
|
||||
droppable?: boolean;
|
||||
dropAccept?: any; // String/Function
|
||||
drop?: (date: Date, allDay: boolean, jsEvent: Event, ui: any) => void;
|
||||
drop?: (date: Date, allDay: boolean, jsEvent: MouseEvent, ui: any) => void;
|
||||
}
|
||||
|
||||
export interface View {
|
||||
@@ -194,14 +194,6 @@ declare module FullCalendar {
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Create calendar object
|
||||
*/
|
||||
fullCalendar(options: FullCalendar.Options): JQuery;
|
||||
/**
|
||||
* Generic method function
|
||||
*/
|
||||
fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void;
|
||||
/**
|
||||
* Get/Set option value
|
||||
*/
|
||||
@@ -306,6 +298,14 @@ interface JQuery {
|
||||
* Rerenders all events on the calendar.
|
||||
*/
|
||||
fullCalendar(method: 'rerenderEvents'): void;
|
||||
/**
|
||||
* Create calendar object
|
||||
*/
|
||||
fullCalendar(options: FullCalendar.Options): JQuery;
|
||||
/**
|
||||
* Generic method function
|
||||
*/
|
||||
fullCalendar(method: string, arg1: any, arg2: any, arg3: any): void;
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
|
||||
4
highcharts/highcharts.d.ts
vendored
4
highcharts/highcharts.d.ts
vendored
@@ -230,7 +230,7 @@ interface HighchartsChartOptions {
|
||||
spacingTop?: number;
|
||||
style?: HighchartsCSSObject;
|
||||
type?: string;
|
||||
whidth?: number;
|
||||
width?: number;
|
||||
zoomType?: string;
|
||||
}
|
||||
|
||||
@@ -1020,7 +1020,7 @@ interface HighchartsChartObject {
|
||||
|
||||
interface HighchartsChart {
|
||||
new (options: HighchartsOptions): HighchartsChartObject;
|
||||
new (options: HighchartsOptions, callback: (event: Event) => void ): HighchartsChartObject;
|
||||
new (options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void ): HighchartsChartObject;
|
||||
}
|
||||
|
||||
interface HighchartsElementObject {
|
||||
|
||||
2
jasmine/jasmine.d.ts
vendored
2
jasmine/jasmine.d.ts
vendored
@@ -21,7 +21,7 @@ declare function expect(actual: any): jasmine.Matchers;
|
||||
declare function spyOn(object: any, method: string): jasmine.Spy;
|
||||
|
||||
declare function runs(asyncMethod: Function): void;
|
||||
declare function waitsFor(latchMethod: () => boolean, failureMessage: string, timeout?: number): void;
|
||||
declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void;
|
||||
declare function waits(timeout?: number): void;
|
||||
|
||||
declare module jasmine {
|
||||
|
||||
@@ -24,8 +24,6 @@ interface SimplePaginationOptions {
|
||||
|
||||
interface JQuery {
|
||||
pagination(options?: SimplePaginationOptions): JQuery;
|
||||
pagination(method: string): any;
|
||||
pagination(method: string, value: any): any;
|
||||
pagination(method: 'selectPage', pageNumber: number): void;
|
||||
pagination(method: 'prevPage'): void;
|
||||
pagination(method: 'nextPage'): void;
|
||||
@@ -36,4 +34,6 @@ interface JQuery {
|
||||
pagination(method: 'destroy'): void;
|
||||
pagination(method: 'redraw'): void;
|
||||
pagination(method: 'updateItems', items: number): void;
|
||||
pagination(method: string): any;
|
||||
pagination(method: string, value: any): any;
|
||||
}
|
||||
|
||||
34
jqueryui/jqueryui.d.ts
vendored
34
jqueryui/jqueryui.d.ts
vendored
@@ -781,56 +781,55 @@ declare module JQueryUI {
|
||||
interface JQuery {
|
||||
|
||||
accordion(): JQuery;
|
||||
accordion(methodName: string): JQuery;
|
||||
accordion(methodName: 'destroy'): void;
|
||||
accordion(methodName: 'disable'): void;
|
||||
accordion(methodName: 'enable'): void;
|
||||
accordion(methodName: 'refresh'): void;
|
||||
accordion(methodName: 'widget'): JQuery;
|
||||
accordion(methodName: string): JQuery;
|
||||
accordion(options: JQueryUI.AccordionOptions): JQuery;
|
||||
accordion(optionLiteral: string, optionName: string): any;
|
||||
accordion(optionLiteral: string, options: JQueryUI.AccordionOptions): any;
|
||||
accordion(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
autocomplete(): JQuery;
|
||||
autocomplete(methodName: string): JQuery;
|
||||
autocomplete(methodName: 'close'): void;
|
||||
autocomplete(methodName: 'destroy'): void;
|
||||
autocomplete(methodName: 'disable'): void;
|
||||
autocomplete(methodName: 'enable'): void;
|
||||
autocomplete(methodName: 'search', value?: string): void;
|
||||
autocomplete(methodName: 'widget'): JQuery;
|
||||
autocomplete(methodName: string): JQuery;
|
||||
autocomplete(options: JQueryUI.AutocompleteOptions): JQuery;
|
||||
autocomplete(optionLiteral: string, optionName: string): any;
|
||||
autocomplete(optionLiteral: string, options: JQueryUI.AutocompleteOptions): any;
|
||||
autocomplete(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
button(): JQuery;
|
||||
button(methodName: string): JQuery;
|
||||
button(methodName: 'destroy'): void;
|
||||
button(methodName: 'disable'): void;
|
||||
button(methodName: 'enable'): void;
|
||||
button(methodName: 'refresh'): void;
|
||||
button(methodName: 'widget'): JQuery;
|
||||
button(methodName: string): JQuery;
|
||||
button(options: JQueryUI.ButtonOptions): JQuery;
|
||||
button(optionLiteral: string, optionName: string): any;
|
||||
button(optionLiteral: string, options: JQueryUI.ButtonOptions): any;
|
||||
button(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
buttonset(): JQuery;
|
||||
buttonset(methodName: string): JQuery;
|
||||
buttonset(methodName: 'destroy'): void;
|
||||
buttonset(methodName: 'disable'): void;
|
||||
buttonset(methodName: 'enable'): void;
|
||||
buttonset(methodName: 'refresh'): void;
|
||||
buttonset(methodName: 'widget'): JQuery;
|
||||
buttonset(methodName: string): JQuery;
|
||||
buttonset(options: JQueryUI.ButtonOptions): JQuery;
|
||||
buttonset(optionLiteral: string, optionName: string): any;
|
||||
buttonset(optionLiteral: string, options: JQueryUI.ButtonOptions): any;
|
||||
buttonset(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
datepicker(): JQuery;
|
||||
datepicker(methodName: string): JQuery;
|
||||
datepicker(methodName: 'destroy'): void;
|
||||
datepicker(methodName: 'dialog', date?: Date, onSelect?: () => void , pos?: any): void;
|
||||
datepicker(methodName: 'dialog', date?: string, onSelect?: () => void , pos?: any): void;
|
||||
@@ -842,48 +841,48 @@ interface JQuery {
|
||||
datepicker(methodName: 'setDate', date: string): void;
|
||||
datepicker(methodName: 'show'): void;
|
||||
datepicker(methodName: 'widget'): JQuery;
|
||||
datepicker(methodName: string): JQuery;
|
||||
datepicker(options: JQueryUI.DatepickerOptions): JQuery;
|
||||
datepicker(optionLiteral: string, optionName: string): any;
|
||||
datepicker(optionLiteral: string, options: JQueryUI.DatepickerOptions): any;
|
||||
datepicker(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
dialog(): JQuery;
|
||||
dialog(methodName: string): JQuery;
|
||||
dialog(methodName: 'close'): JQuery;
|
||||
dialog(methodName: 'destroy'): JQuery;
|
||||
dialog(methodName: 'isOpen'): boolean;
|
||||
dialog(methodName: 'moveToTop'): JQuery;
|
||||
dialog(methodName: 'open'): JQuery;
|
||||
dialog(methodName: 'widget'): JQuery;
|
||||
dialog(methodName: string): JQuery;
|
||||
dialog(options: JQueryUI.DialogOptions): JQuery;
|
||||
dialog(optionLiteral: string, optionName: string): any;
|
||||
dialog(optionLiteral: string, options: JQueryUI.DialogOptions): any;
|
||||
dialog(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
draggable(): JQuery;
|
||||
draggable(methodName: string): JQuery;
|
||||
draggable(methodName: 'destroy'): void;
|
||||
draggable(methodName: 'disable'): void;
|
||||
draggable(methodName: 'enable'): void;
|
||||
draggable(methodName: 'widget'): JQuery;
|
||||
draggable(methodName: string): JQuery;
|
||||
draggable(options: JQueryUI.DraggableOptions): JQuery;
|
||||
draggable(optionLiteral: string, optionName: string): any;
|
||||
draggable(optionLiteral: string, options: JQueryUI.DraggableOptions): any;
|
||||
draggable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
droppable(): JQuery;
|
||||
droppable(methodName: string): JQuery;
|
||||
droppable(methodName: 'destroy'): void;
|
||||
droppable(methodName: 'disable'): void;
|
||||
droppable(methodName: 'enable'): void;
|
||||
droppable(methodName: 'widget'): JQuery;
|
||||
droppable(methodName: string): JQuery;
|
||||
droppable(options: JQueryUI.DroppableOptions): JQuery;
|
||||
droppable(optionLiteral: string, optionName: string): any;
|
||||
droppable(optionLiteral: string, options: JQueryUI.DraggableOptions): any;
|
||||
droppable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
menu(): JQuery;
|
||||
menu(methodName: string): JQuery;
|
||||
menu(methodName: 'blur'): void;
|
||||
menu(methodName: 'collapse', event?: JQueryEventObject): void;
|
||||
menu(methodName: 'collapseAll', event?: JQueryEventObject, all?: boolean): void;
|
||||
@@ -901,13 +900,13 @@ interface JQuery {
|
||||
menu(methodName: 'refresh'): void;
|
||||
menu(methodName: 'select', event?: JQueryEventObject): void;
|
||||
menu(methodName: 'widget'): JQuery;
|
||||
menu(methodName: string): JQuery;
|
||||
menu(options: JQueryUI.MenuOptions): JQuery;
|
||||
menu(optionLiteral: string, optionName: string): any;
|
||||
menu(optionLiteral: string, options: JQueryUI.MenuOptions): any;
|
||||
menu(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
progressbar(): JQuery;
|
||||
progressbar(methodName: string): JQuery;
|
||||
progressbar(methodName: 'destroy'): void;
|
||||
progressbar(methodName: 'disable'): void;
|
||||
progressbar(methodName: 'enable'): void;
|
||||
@@ -916,35 +915,35 @@ interface JQuery {
|
||||
progressbar(methodName: 'value', value: number): void;
|
||||
progressbar(methodName: 'value', value: boolean): void;
|
||||
progressbar(methodName: 'widget'): JQuery;
|
||||
progressbar(methodName: string): JQuery;
|
||||
progressbar(options: JQueryUI.ProgressbarOptions): JQuery;
|
||||
progressbar(optionLiteral: string, optionName: string): any;
|
||||
progressbar(optionLiteral: string, options: JQueryUI.ProgressbarOptions): any;
|
||||
progressbar(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
resizable(): JQuery;
|
||||
resizable(methodName: string): JQuery;
|
||||
resizable(methodName: 'destroy'): void;
|
||||
resizable(methodName: 'disable'): void;
|
||||
resizable(methodName: 'enable'): void;
|
||||
resizable(methodName: 'widget'): JQuery;
|
||||
resizable(methodName: string): JQuery;
|
||||
resizable(options: JQueryUI.ResizableOptions): JQuery;
|
||||
resizable(optionLiteral: string, optionName: string): any;
|
||||
resizable(optionLiteral: string, options: JQueryUI.ResizableOptions): any;
|
||||
resizable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
selectable(): JQuery;
|
||||
selectable(methodName: string): JQuery;
|
||||
selectable(methodName: 'destroy'): void;
|
||||
selectable(methodName: 'disable'): void;
|
||||
selectable(methodName: 'enable'): void;
|
||||
selectable(methodName: 'widget'): JQuery;
|
||||
selectable(methodName: string): JQuery;
|
||||
selectable(options: JQueryUI.SelectableOptions): JQuery;
|
||||
selectable(optionLiteral: string, optionName: string): any;
|
||||
selectable(optionLiteral: string, options: JQueryUI.SelectableOptions): any;
|
||||
selectable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
slider(): JQuery;
|
||||
slider(methodName: string): JQuery;
|
||||
slider(methodName: 'destroy'): void;
|
||||
slider(methodName: 'disable'): void;
|
||||
slider(methodName: 'enable'): void;
|
||||
@@ -958,24 +957,24 @@ interface JQuery {
|
||||
slider(methodName: string, values: Array<number>): void;
|
||||
slider(methodName: 'values', values: Array<number>): void;
|
||||
slider(methodName: 'widget'): JQuery;
|
||||
slider(methodName: string): JQuery;
|
||||
slider(options: JQueryUI.SliderOptions): JQuery;
|
||||
slider(optionLiteral: string, optionName: string): any;
|
||||
slider(optionLiteral: string, options: JQueryUI.SliderOptions): any;
|
||||
slider(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
sortable(): JQuery;
|
||||
sortable(methodName: string): JQuery;
|
||||
sortable(methodName: 'destroy'): void;
|
||||
sortable(methodName: 'disable'): void;
|
||||
sortable(methodName: 'enable'): void;
|
||||
sortable(methodName: 'widget'): JQuery;
|
||||
sortable(methodName: string): JQuery;
|
||||
sortable(options: JQueryUI.SortableOptions): JQuery;
|
||||
sortable(optionLiteral: string, optionName: string): any;
|
||||
sortable(optionLiteral: string, options: JQueryUI.SortableOptions): any;
|
||||
sortable(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
spinner(): JQuery;
|
||||
spinner(methodName: string): JQuery;
|
||||
spinner(methodName: 'destroy'): void;
|
||||
spinner(methodName: 'disable'): void;
|
||||
spinner(methodName: 'enable'): void;
|
||||
@@ -986,32 +985,33 @@ interface JQuery {
|
||||
spinner(methodName: 'value'): number;
|
||||
spinner(methodName: 'value', value: number): void;
|
||||
spinner(methodName: 'widget'): JQuery;
|
||||
spinner(methodName: string): JQuery;
|
||||
spinner(options: JQueryUI.SpinnerOptions): JQuery;
|
||||
spinner(optionLiteral: string, optionName: string): any;
|
||||
spinner(optionLiteral: string, options: JQueryUI.SpinnerOptions): any;
|
||||
spinner(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
tabs(): JQuery;
|
||||
tabs(methodName: string): JQuery;
|
||||
tabs(methodName: 'destroy'): void;
|
||||
tabs(methodName: 'disable'): void;
|
||||
tabs(methodName: 'enable'): void;
|
||||
tabs(methodName: 'load', index: number): void;
|
||||
tabs(methodName: 'refresh'): void;
|
||||
tabs(methodName: 'widget'): JQuery;
|
||||
tabs(methodName: string): JQuery;
|
||||
tabs(options: JQueryUI.TabsOptions): JQuery;
|
||||
tabs(optionLiteral: string, optionName: string): any;
|
||||
tabs(optionLiteral: string, options: JQueryUI.TabsOptions): any;
|
||||
tabs(optionLiteral: string, optionName: string, optionValue: any): JQuery;
|
||||
|
||||
tooltip(): JQuery;
|
||||
tooltip(methodName: string): JQuery;
|
||||
tooltip(methodName: 'destroy'): void;
|
||||
tooltip(methodName: 'disable'): void;
|
||||
tooltip(methodName: 'enable'): void;
|
||||
tooltip(methodName: 'open'): void;
|
||||
tooltip(methodName: 'close'): void;
|
||||
tooltip(methodName: 'widget'): JQuery;
|
||||
tooltip(methodName: string): JQuery;
|
||||
tooltip(options: JQueryUI.TooltipOptions): JQuery;
|
||||
tooltip(optionLiteral: string, optionName: string): any;
|
||||
tooltip(optionLiteral: string, options: JQueryUI.TooltipOptions): any;
|
||||
|
||||
11
knockout/knockout.d.ts
vendored
11
knockout/knockout.d.ts
vendored
@@ -68,11 +68,8 @@ interface KnockoutComputedStatic {
|
||||
(options?: any): KnockoutComputed<any>;
|
||||
}
|
||||
|
||||
interface KnockoutComputed<T> extends KnockoutSubscribable<T>, KnockoutComputedFunctions<T> {
|
||||
(): T;
|
||||
(value: T): void;
|
||||
|
||||
peek(): T;
|
||||
interface KnockoutComputed<T> extends KnockoutObservable<T>, KnockoutComputedFunctions<T> {
|
||||
|
||||
dispose(): void;
|
||||
isActive(): boolean;
|
||||
getDependenciesCount(): number;
|
||||
@@ -100,8 +97,8 @@ interface KnockoutObservable<T> extends KnockoutSubscribable<T>, KnockoutObserva
|
||||
(value: T): void;
|
||||
|
||||
peek(): T;
|
||||
valueHasMutated(): void;
|
||||
valueWillMutate(): void;
|
||||
valueHasMutated?:{(): void;};
|
||||
valueWillMutate?:{(): void;};
|
||||
extend(requestedExtenders: { [key: string]: any; }): KnockoutObservable<T>;
|
||||
}
|
||||
|
||||
|
||||
@@ -568,4 +568,17 @@ function test_misc() {
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
|
||||
$(element).datepicker("destroy");
|
||||
});
|
||||
|
||||
this.observableFactory = function(): KnockoutObservable<number>{
|
||||
if (true) {
|
||||
return ko.computed({
|
||||
read:function(){
|
||||
return 3;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
return ko.observable(3);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -86,6 +86,14 @@ moment().weekYear(2);
|
||||
moment().weekYear();
|
||||
moment().isoWeekYear(3);
|
||||
moment().isoWeekYear();
|
||||
moment().week();
|
||||
moment().week(45);
|
||||
moment().weeks();
|
||||
moment().weeks(45);
|
||||
moment().isoWeek();
|
||||
moment().isoWeek(45);
|
||||
moment().isoWeeks();
|
||||
moment().isoWeeks(45);
|
||||
|
||||
var getMilliseconds: number = moment().milliseconds();
|
||||
var getSeconds: number = moment().seconds();
|
||||
|
||||
8
moment/moment.d.ts
vendored
8
moment/moment.d.ts
vendored
@@ -105,6 +105,14 @@ interface Moment {
|
||||
weekYear(d: number): Moment;
|
||||
isoWeekYear(): number;
|
||||
isoWeekYear(d: number): Moment;
|
||||
week(): number;
|
||||
week(d: number): Moment;
|
||||
weeks(): number;
|
||||
weeks(d: number): Moment;
|
||||
isoWeek(): number;
|
||||
isoWeek(d: number): Moment;
|
||||
isoWeeks(): number;
|
||||
isoWeeks(d: number): Moment;
|
||||
|
||||
from(f: Moment): string;
|
||||
from(f: Moment, suffix: boolean): string;
|
||||
|
||||
64
node/node.d.ts
vendored
64
node/node.d.ts
vendored
@@ -752,33 +752,33 @@ declare module "fs" {
|
||||
export function truncate(path: string, callback?: Function): void;
|
||||
export function truncate(path: string, len: number, callback?: Function): void;
|
||||
export function truncateSync(path: string, len?: number): void;
|
||||
export function ftruncate(fd: string, callback?: Function): void;
|
||||
export function ftruncate(fd: string, len: number, callback?: Function): void;
|
||||
export function ftruncateSync(fd: string, len?: number): void;
|
||||
export function ftruncate(fd: number, callback?: Function): void;
|
||||
export function ftruncate(fd: number, len: number, callback?: Function): void;
|
||||
export function ftruncateSync(fd: number, len?: number): void;
|
||||
export function chown(path: string, uid: number, gid: number, callback?: Function): void;
|
||||
export function chownSync(path: string, uid: number, gid: number): void;
|
||||
export function fchown(fd: string, uid: number, gid: number, callback?: Function): void;
|
||||
export function fchownSync(fd: string, uid: number, gid: number): void;
|
||||
export function fchown(fd: number, uid: number, gid: number, callback?: Function): void;
|
||||
export function fchownSync(fd: number, uid: number, gid: number): void;
|
||||
export function lchown(path: string, uid: number, gid: number, callback?: Function): void;
|
||||
export function lchownSync(path: string, uid: number, gid: number): void;
|
||||
export function chmod(path: string, mode: number, callback?: Function): void;
|
||||
export function chmod(path: string, mode: string, callback?: Function): void;
|
||||
export function chmodSync(path: string, mode: number): void;
|
||||
export function chmodSync(path: string, mode: string): void;
|
||||
export function fchmod(fd: string, mode: number, callback?: Function): void;
|
||||
export function fchmod(fd: string, mode: string, callback?: Function): void;
|
||||
export function fchmodSync(fd: string, mode: number): void;
|
||||
export function fchmodSync(fd: string, mode: string): void;
|
||||
export function fchmod(fd: number, mode: number, callback?: Function): void;
|
||||
export function fchmod(fd: number, mode: string, callback?: Function): void;
|
||||
export function fchmodSync(fd: number, mode: number): void;
|
||||
export function fchmodSync(fd: number, mode: string): void;
|
||||
export function lchmod(path: string, mode: number, callback?: Function): void;
|
||||
export function lchmod(path: string, mode: string, callback?: Function): void;
|
||||
export function lchmodSync(path: string, mode: number): void;
|
||||
export function lchmodSync(path: string, mode: string): void;
|
||||
export function stat(path: string, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function lstat(path: string, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function fstat(fd: string, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function fstat(fd: number, callback?: (err: Error, stats: Stats) => any): void;
|
||||
export function statSync(path: string): Stats;
|
||||
export function lstatSync(path: string): Stats;
|
||||
export function fstatSync(fd: string): Stats;
|
||||
export function fstatSync(fd: number): Stats;
|
||||
export function link(srcpath: string, dstpath: string, callback?: Function): void;
|
||||
export function linkSync(srcpath: string, dstpath: string): void;
|
||||
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: Function): void;
|
||||
@@ -799,23 +799,23 @@ declare module "fs" {
|
||||
export function mkdirSync(path: string, mode?: string): void;
|
||||
export function readdir(path: string, callback?: (err: Error, files: string[]) => void): void;
|
||||
export function readdirSync(path: string): string[];
|
||||
export function close(fd: string, callback?: Function): void;
|
||||
export function closeSync(fd: string): void;
|
||||
export function open(path: string, flags: string, callback?: (err: Error, fd: string) => any): void;
|
||||
export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: string) => any): void;
|
||||
export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: string) => any): void;
|
||||
export function openSync(path: string, flags: string, mode?: number): void;
|
||||
export function openSync(path: string, flags: string, mode?: string): void;
|
||||
export function close(fd: number, callback?: Function): void;
|
||||
export function closeSync(fd: number): void;
|
||||
export function open(path: string, flags: string, callback?: (err: Error, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, mode: number, callback?: (err: Error, fd: number) => any): void;
|
||||
export function open(path: string, flags: string, mode: string, callback?: (err: Error, fd: number) => any): void;
|
||||
export function openSync(path: string, flags: string, mode?: number): number;
|
||||
export function openSync(path: string, flags: string, mode?: string): number;
|
||||
export function utimes(path: string, atime: number, mtime: number, callback?: Function): void;
|
||||
export function utimesSync(path: string, atime: number, mtime: number): void;
|
||||
export function futimes(fd: string, atime: number, mtime: number, callback?: Function): void;
|
||||
export function futimesSync(fd: string, atime: number, mtime: number): void;
|
||||
export function fsync(fd: string, callback?: Function): void;
|
||||
export function fsyncSync(fd: string): void;
|
||||
export function write(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) =>any): void;
|
||||
export function writeSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): void;
|
||||
export function read(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void;
|
||||
export function readSync(fd: string, buffer: NodeBuffer, offset: number, length: number, position: number): any[];
|
||||
export function futimes(fd: number, atime: number, mtime: number, callback?: Function): void;
|
||||
export function futimesSync(fd: number, atime: number, mtime: number): void;
|
||||
export function fsync(fd: number, callback?: Function): void;
|
||||
export function fsyncSync(fd: number): void;
|
||||
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void;
|
||||
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
|
||||
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void): void;
|
||||
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
|
||||
export function readFile(filename: string, options: { encoding?: string; flag?: string; }, callback: (err: Error, data: any) => void): void;
|
||||
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
|
||||
export function readFileSync(filename: string, options?: { flag?: string; }): NodeBuffer;
|
||||
@@ -830,11 +830,11 @@ declare module "fs" {
|
||||
export function appendFile(filename: string, data: any, callback?: (err: Error) => void): void;
|
||||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;
|
||||
export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;
|
||||
export function watchFile(filename: string, listener: (curr: Stats, prev: Stats)=>void): void;
|
||||
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats)=>void): void;
|
||||
export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats)=>void): void;
|
||||
export function watch(filename: string, listener?: (event: string, filename: string) =>any): FSWatcher;
|
||||
export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) =>any): FSWatcher;
|
||||
export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;
|
||||
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;
|
||||
export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;
|
||||
export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function exists(path: string, callback?: (exists: boolean) => void): void;
|
||||
export function existsSync(path: string): boolean;
|
||||
export function createReadStream(path: string, options?: {
|
||||
@@ -1142,7 +1142,7 @@ declare module "assert" {
|
||||
declare module "tty" {
|
||||
import net = require("net");
|
||||
|
||||
export function isatty(fd: string): boolean;
|
||||
export function isatty(fd: number): boolean;
|
||||
export interface ReadStream extends net.NodeSocket {
|
||||
isRaw: boolean;
|
||||
setRawMode(mode: boolean): void;
|
||||
|
||||
33
simple-cw-node/simple-cw-node-test.ts
Normal file
33
simple-cw-node/simple-cw-node-test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
/// <reference path="./simple-cw-node.d.ts" />
|
||||
|
||||
import CW = require('simple-cw-node');
|
||||
var client = CW();
|
||||
var Deferred:any = client.Deferred;
|
||||
|
||||
// initialize.
|
||||
client.init({ token: 'YOUR_TOKEN' });
|
||||
|
||||
// get your info.
|
||||
client.get('me', (err, res) => {
|
||||
console.log(arguments);
|
||||
});
|
||||
|
||||
// create room.
|
||||
client.post('rooms', {
|
||||
name: 'room',
|
||||
members_admin_ids: '123456789,987654321',
|
||||
description: 'description'
|
||||
}, (err, res) => {
|
||||
console.log('created.');
|
||||
});
|
||||
|
||||
client
|
||||
.get('me')
|
||||
.done((res:any) => {
|
||||
console.log(res.body)
|
||||
})
|
||||
.fail((err:any) => {
|
||||
console.error(err);
|
||||
});
|
||||
86
simple-cw-node/simple-cw-node.d.ts
vendored
Normal file
86
simple-cw-node/simple-cw-node.d.ts
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
// Type definitions for simple-cw-node
|
||||
// Project: https://github.com/astronaughts/simple-cw-node
|
||||
// Definitions by: vvakame <https://github.com/vvakame>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../superagent/superagent.d.ts" />
|
||||
|
||||
declare module "simple-cw-node" {
|
||||
import superagent = require("superagent");
|
||||
// TODO 1. update superagent with generics
|
||||
// TODO 2. create underscore.deffered .d.ts file
|
||||
// TODO 3. refactor & improve specialized parameter methods
|
||||
|
||||
// Merged declaration, ChatWork is both a callable function and a namespace
|
||||
function ChatWork():ChatWork.ChatWork;
|
||||
|
||||
module ChatWork {
|
||||
interface ChatWorkInitOptions {
|
||||
token:string;
|
||||
}
|
||||
|
||||
interface ChatWork {
|
||||
apiVersion:string;
|
||||
sdkVersion:string;
|
||||
token:string;
|
||||
Deferred: any; // _.Deferred
|
||||
when: any; // _.when
|
||||
|
||||
init(options:ChatWorkInitOptions):void;
|
||||
|
||||
// http://developer.chatwork.com/ja/endpoint_me.html
|
||||
get(api:"me", callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
// http://developer.chatwork.com/ja/endpoint_my.html
|
||||
get(api:"my/status", callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
get(api:"my/tasks", callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
// http://developer.chatwork.com/ja/endpoint_contacts.html
|
||||
get(api:"contacts", callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
// http://developer.chatwork.com/ja/endpoint_rooms.html
|
||||
get(api:"rooms", callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
post(api:"rooms", args:any, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
// can't create specialized parameter
|
||||
// specialized parameter required compile-time constant string literal
|
||||
// GET /rooms/{room_id}
|
||||
// PUT /rooms/{room_id}
|
||||
// DELETE /rooms/{room_id}
|
||||
// GET /rooms/{room_id}/members
|
||||
// PUT /rooms/{room_id}/members
|
||||
// GET /rooms/{room_id}/messages <- not implemented yet
|
||||
// POST /rooms/{room_id}/messages
|
||||
// GET /rooms/{room_id}/messages/{message_id}
|
||||
// GET /rooms/{room_id}/tasks
|
||||
// POST /rooms/{room_id}/tasks
|
||||
// GET /rooms/{room_id}/tasks/{task_id}
|
||||
// GET /rooms/{room_id}/files
|
||||
// GET /rooms/{room_id}/files/{file_id}
|
||||
|
||||
// General functions
|
||||
|
||||
api(method:string, api:string):any; // return same type as _.Deferred()
|
||||
api(method:string, api:string, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
api(method:string, api:string, args:any, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
get(api:string):any; // return same type as _.Deferred()
|
||||
get(api:string, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
get(api:string, args:any, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
post(api:string):any; // return same type as _.Deferred()
|
||||
post(api:string, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
post(api:string, args:any, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
put(api:string):any; // return same type as _.Deferred()
|
||||
put(api:string, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
put(api:string, args:any, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
|
||||
del(api:string):any; // return same type as _.Deferred()
|
||||
del(api:string, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
del(api:string, args:any, callback:(err:Error, res:superagent.Response)=>void):void;
|
||||
}
|
||||
}
|
||||
|
||||
export = ChatWork;
|
||||
}
|
||||
Reference in New Issue
Block a user