From a8a5655d0513b97954775c34e47b9e107315b331 Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Wed, 6 Apr 2016 21:25:57 -0700 Subject: [PATCH 01/94] Add typings for redux-debounced. --- redux-debounced/redux-debounced-tests.ts | 7 +++++++ redux-debounced/redux-debounced.d.ts | 11 +++++++++++ 2 files changed, 18 insertions(+) create mode 100644 redux-debounced/redux-debounced-tests.ts create mode 100644 redux-debounced/redux-debounced.d.ts diff --git a/redux-debounced/redux-debounced-tests.ts b/redux-debounced/redux-debounced-tests.ts new file mode 100644 index 0000000000..3b11de0721 --- /dev/null +++ b/redux-debounced/redux-debounced-tests.ts @@ -0,0 +1,7 @@ +/// +/// + +import { applyMiddleware } from 'redux'; +import createDebounce from 'redux-debounced'; + +applyMiddleware(createDebounce()); diff --git a/redux-debounced/redux-debounced.d.ts b/redux-debounced/redux-debounced.d.ts new file mode 100644 index 0000000000..c3e4344f33 --- /dev/null +++ b/redux-debounced/redux-debounced.d.ts @@ -0,0 +1,11 @@ +// Type definitions for redux-debounced v0.2.0 +// Project: https://github.com/ryanseddon/redux-debounced +// Definitions by: Sean Kelley +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "redux-debounced" { + import { Middleware } from 'redux'; + export default function createDebounce(): Middleware; +} From a6c69481272a90431d5097ca0fb87a0c72932e97 Mon Sep 17 00:00:00 2001 From: Horiuchi_H Date: Fri, 8 Apr 2016 16:50:58 +0900 Subject: [PATCH 02/94] add SFTP type in `ssh2` --- ssh2/ssh2-tests.ts | 4 +- ssh2/ssh2.d.ts | 95 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 95 insertions(+), 4 deletions(-) diff --git a/ssh2/ssh2-tests.ts b/ssh2/ssh2-tests.ts index 1c59b13054..d41f146dd0 100644 --- a/ssh2/ssh2-tests.ts +++ b/ssh2/ssh2-tests.ts @@ -132,9 +132,9 @@ var Client = require('ssh2').Client; var conn = new Client(); conn.on('ready', () => { console.log('Client :: ready'); - conn.sftp( (err: Error, sftp: any) => { + conn.sftp( (err: Error, sftp: ssh2.Sftp.Wrapper) => { if (err) throw err; - sftp.readdir('foo', (err: Error, list: any) => { + sftp.readdir('foo', (err: Error, list: ssh2.Sftp.ReadDirItem[]) => { if (err) throw err; console.dir(list); conn.end(); diff --git a/ssh2/ssh2.d.ts b/ssh2/ssh2.d.ts index 6e05e0c826..bae9ac653a 100644 --- a/ssh2/ssh2.d.ts +++ b/ssh2/ssh2.d.ts @@ -9,7 +9,7 @@ declare module "ssh2" { import stream = require('stream'); namespace ssh2 { - interface Client { + interface Client extends NodeJS.EventEmitter { Server: ServerStatic; new(): Client; /** @@ -326,8 +326,99 @@ declare module "ssh2" { EXCL: number; } + interface Attributes { + mode: number; + uid: number; + gid: number; + size: number; + atime: number; + mtime: number; + } + interface InputAttributes { + mode?: number; + uid?: number; + gid?: number; + size?: number; + atime?: number; + mtime?: number; + } + interface Stats extends Attributes { + isDirectory(): boolean; + isFile(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbloicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + } + interface Wrapper extends NodeJS.EventEmitter { - //TODO: extends `ssh2-streams.SFTPStream` + fastGet(remotePath: string, localPath: string, callback: (err: any) => void): void; + fastGet(remotePath: string, localPath: string, options: TransferOptions, callback: (err: any) => void): void; + fastPut(localPath: string, remotePath: string, callback: (err: any) => void): void; + fastPut(localPath: string, remotePath: string, options: TransferOptions, callback: (err: any) => void): void; + + createReadStream(path: string, options?: ReadStreamOptions): stream.Readable; + createWriteStream(path: string, options?: WriteStreamOptions): stream.Writable; + open(filename: string, mode: string, callback: (err: any, handle: Buffer) => void): boolean; + open(filename: string, mode: string, attributes: InputAttributes, callback: (err: any, handle: Buffer) => void): boolean; + close(handle: Buffer, callback: (err: any) => void): boolean; + readData(handle: Buffer, buffer: Buffer, offset: number, length: number, position: number, + callback: (err: any, bytesRead: number, buffer: Buffer, position: number) => void): boolean; + writeData(handle: Buffer, buffer: Buffer, offset: number, length: number, position: number, + callback: (err: any) => void): boolean; + fstat(handle: Buffer, callback: (err: any, stats: Stats) => void): boolean; + fsetstat(handle: Buffer, attributes: InputAttributes, callback: (err: any) => void): boolean; + futimes(handle: Buffer, atime: number | Date, mtime: number | Date, callback: (err: any) => void): boolean; + fchown(handle: Buffer, uid: number, gid: number, callback: (err: any) => void): boolean; + fchmod(handle: Buffer, mode: number | string, callback: (err: any) => void): boolean; + opendir(path: string, callback: (err: any, handle: Buffer) => void): boolean; + readdir(location: string | Buffer, callback: (err: any, list: ReadDirItem[]) => void): boolean; + unlink(path: string, callback: (err: any) => void): boolean; + rename(srcPath: string, destPath: string, callback: (err: any) => void): boolean; + mkdir(path: string, callback: (err: any) => void): boolean; + mkdir(path: string, attributes: InputAttributes, callback: (err: any) => void): boolean; + rmdir(path: string, callback: (err: any) => void): boolean; + stat(path: string, callback: (err: any, stats: Stats) => void): boolean; + lstat(path: string, callback: (err: any, stats: Stats) => void): boolean; + setstat(path: string, attributes: InputAttributes, callback: (err: any) => void): boolean; + utimes(path: string, atime: number | Date, mtime: number | Date, callback: (err: any) => void): boolean; + chown(path: string, uid: number, gid: number, callback: (err: any) => void): boolean; + chmod(path: string, mode: number | string, callback: (err: any) => void): boolean; + readlink(path: string, callback: (err: any, target: string) => void): boolean; + symlink(targetPath: string, linkPath: string, callback: (err: any) => void): boolean; + realpath(path: string, callback: (err: any, absPath: string) => void): boolean; + + ext_openssh_rename(srcPath: string, destPath: string, callback: (err: any) => void): boolean; + ext_openssh_statvfs(path: string, callback: (err: any, fsInfo: any) => void): boolean; + ext_openssh_fstatvfs(handle: Buffer, callback: (err: any, fsInfo: any) => void): boolean; + ext_openssh_hardlink(targetPath: string, linkPath: string, callback: (err: any) => void): boolean; + ext_openssh_fsync(handle: Buffer, callback: (err: any, fsInfo: any) => void): boolean; + } + + interface TransferOptions { + concurrency?: number; + chunkSize?: number; + step?: (total_transferred: number, chunk: number, total: number) => void; + } + interface ReadStreamOptions { + flags?: string; + encoding?: string; + handle?: Buffer; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + } + interface WriteStreamOptions { + flags?: string; + encoding?: string; + mode?: number; + } + interface ReadDirItem { + filename: string; + longname: string; + attrs: Attributes; } } } From ad2462a2ee6e7dfca00c68dcfb9f2b483ad629e7 Mon Sep 17 00:00:00 2001 From: Vyacheslav Pritykin Date: Sat, 9 Apr 2016 14:21:58 +0300 Subject: [PATCH 03/94] New options have been added --- knockout/knockout.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index d50965022f..962a776333 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -535,6 +535,16 @@ interface KnockoutStatic { }; components: KnockoutComponents; + + ///////////////////////////////// + // options.js + ///////////////////////////////// + + options: { + deferUpdates: boolean, + + useOnlyNativeEvents: boolean + } } interface KnockoutBindingProvider { From 73fa26213aa5d2e1de5d7c2cc74118108cb2e5fa Mon Sep 17 00:00:00 2001 From: Felipe Lima Date: Tue, 12 Apr 2016 09:51:05 -0300 Subject: [PATCH 04/94] Firebase: Generic Github, Twitter and Facebook authentication providers (#8870) * Firebase: Generic Github, Twitter and Facebook authentication providers * Firebase: Authentication definitions for Email and Password, Twitter, Github, Facebook and Anonymous --- firebase/firebase.d.ts | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/firebase/firebase.d.ts b/firebase/firebase.d.ts index cceaaf506f..132973e916 100644 --- a/firebase/firebase.d.ts +++ b/firebase/firebase.d.ts @@ -334,6 +334,46 @@ interface FirebaseAuthData { expires: number; auth: Object; google?: FirebaseAuthDataGoogle; + twitter?: FirebaseAuthDataTwitter; + github?: FirebaseAuthDataGithub; + facebook?: FirebaseAuthDataFacebook; + password?: FirebaseAuthDataPassword; + anonymous?: any; +} + +interface FirebaseAuthDataPassword{ + email: string; + isTemporaryPassword: boolean; + profileImageURL: string; +} + +interface FirebaseAuthDataTwitter{ + id: string; + accessToken: string; + accessTokenSecret: string; + displayName: string; + username: string; + profileImageURL: string; + cachedUserProfile: any; +} + +interface FirebaseAuthDataGithub{ + id: string; + accessToken: string; + displayName: string; + email?: string; + username: string; + profileImageURL: string; + cachedUserProfile: any; +} + +interface FirebaseAuthDataFacebook{ + id: string; + accessToken: string; + displayName: string; + email?: string; + profileImageURL: string; + cachedUserProfile: any; } interface FirebaseAuthDataGoogle { From d3407b5a413c307237d54cc92788903f83cd5d3c Mon Sep 17 00:00:00 2001 From: Alex Friedman Date: Tue, 12 Apr 2016 08:52:08 -0400 Subject: [PATCH 05/94] Added definition files for koa-json (#8873) --- koa-json/koa-json-tests.ts | 15 ++++++++++++++ koa-json/koa-json.d.ts | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 koa-json/koa-json-tests.ts create mode 100644 koa-json/koa-json.d.ts diff --git a/koa-json/koa-json-tests.ts b/koa-json/koa-json-tests.ts new file mode 100644 index 0000000000..d173aa83f8 --- /dev/null +++ b/koa-json/koa-json-tests.ts @@ -0,0 +1,15 @@ +/// +/// + +import * as Koa from "koa"; +import * as json from 'koa-json'; + +const app = new Koa(); + +app.use(json({ + pretty: false, + param: 'pretty', + spaces: 2 +})); + +app.listen(80) \ No newline at end of file diff --git a/koa-json/koa-json.d.ts b/koa-json/koa-json.d.ts new file mode 100644 index 0000000000..24c87a8100 --- /dev/null +++ b/koa-json/koa-json.d.ts @@ -0,0 +1,40 @@ +// Type definitions for koa-json v2.x +// Project: https://github.com/koajs/json +// Definitions by: Alex Friedman +// Definitions: https://github.com/brooklyndev/DefinitelyTyped + +/* =================== USAGE =================== + + import * as Koa from 'koa'; + import * as json from 'koa-json'; + + const app = new Koa(); + app.use(json()); + + =============================================== */ +/// + +declare module "koa-json" { + + import * as Koa from "koa"; + + function json(opts?:{ + + /** + * default to pretty response [true] + */ + pretty?: boolean, + + /** + * optional query-string param for pretty responses [none] + */ + param?: string, + + /** + * JSON spaces [2] + */ + spaces?: number + }) : { (ctx: Koa.Context, next?: () => any): any } ; + namespace json {} + export = json; +} \ No newline at end of file From 38d211956dec596b53c9bf8fe001f5fd121497c4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 12 Apr 2016 14:52:33 +0200 Subject: [PATCH 06/94] Add toDate() sanitizer (#8871) --- express-validator/express-validator.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index 93665b381f..52792a391f 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -179,6 +179,12 @@ declare namespace ExpressValidator { /** * Decode HTML entities */ + + /** + * Convert the input string to a date, or null if the input is not a date. + */ + toDate(): Sanitizer; + entityDecode(): Sanitizer; entityEncode(): Sanitizer; /** From f5407eba29c04fb8387c86df27512bd055b195d2 Mon Sep 17 00:00:00 2001 From: Shinya Terasaki Date: Tue, 12 Apr 2016 21:55:27 +0900 Subject: [PATCH 07/94] typo at TextGeometryParameters (#8874) --- threejs/three.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/threejs/three.d.ts b/threejs/three.d.ts index e11a4ca231..65293da1ca 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -6122,7 +6122,7 @@ declare namespace THREE { export interface TextGeometryParameters { font: Font; - site: number; + size: number; height: number; curveSegments: number; bevelEnabled: boolean; @@ -6135,7 +6135,7 @@ declare namespace THREE { parameters: { font: Font; - site: number; + size: number; height: number; curveSegments: number; bevelEnabled: boolean; From f82347d1cb1ab54b0268b698decd636e0a7022e3 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Tue, 12 Apr 2016 16:00:40 +0300 Subject: [PATCH 08/94] Update Kendo UI TypeScript Definitions (#8879) --- kendo-ui/kendo-ui.d.ts | 435 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 429 insertions(+), 6 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 62b6912b81..b8302dafc1 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -1074,6 +1074,31 @@ declare namespace kendo.data { view(): kendo.data.ObservableArray; } + class Query { + data: any[]; + + static process(data: any[], options: DataSourceTransportReadOptionsData): QueryResult; + + constructor(data: any[]); + toArray(): any[]; + range(intex: number, count: number): kendo.data.Query; + skip(count: number): kendo.data.Query; + take(count: number): kendo.data.Query; + select(selector: Function): kendo.data.Query; + order(selector: string, dir?: string): kendo.data.Query; + order(selector: Function, dir?: string): kendo.data.Query; + filter(filters: DataSourceFilterItem): kendo.data.Query; + filter(filters: DataSourceFilterItem[]): kendo.data.Query; + filter(filters: DataSourceFilters): kendo.data.Query; + group(descriptors: DataSourceGroupItem): kendo.data.Query; + group(descriptors: DataSourceGroupItem[]): kendo.data.Query; + } + + interface QueryResult { + total?: number; + data?: any[]; + } + interface DataSourceAggregateItem { field?: string; aggregate?: string; @@ -4209,6 +4234,7 @@ declare namespace kendo.ui { dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; itemTemplate?: Function; + operators?: any; search?: boolean; ignoreCase?: boolean; ui?: string|Function; @@ -5554,9 +5580,11 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; + adjustSize?: any; animation?: PopupAnimation; anchor?: string|JQuery; appendTo?: string|JQuery; + collision?: string; origin?: string; position?: string; activate?(e: PopupActivateEvent): void; @@ -6677,6 +6705,9 @@ declare namespace kendo.ui { enable(element: string, enable?: boolean): kendo.ui.TabStrip; enable(element: Element, enable?: boolean): kendo.ui.TabStrip; enable(element: JQuery, enable?: boolean): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: string): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertAfter(item: any, referenceTab: JQuery): kendo.ui.TabStrip; insertAfter(item: string, referenceTab: string): kendo.ui.TabStrip; insertAfter(item: string, referenceTab: Element): kendo.ui.TabStrip; insertAfter(item: string, referenceTab: JQuery): kendo.ui.TabStrip; @@ -6686,6 +6717,9 @@ declare namespace kendo.ui { insertAfter(item: JQuery, referenceTab: string): kendo.ui.TabStrip; insertAfter(item: JQuery, referenceTab: Element): kendo.ui.TabStrip; insertAfter(item: JQuery, referenceTab: JQuery): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: string): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: Element): kendo.ui.TabStrip; + insertBefore(item: any, referenceTab: JQuery): kendo.ui.TabStrip; insertBefore(item: string, referenceTab: string): kendo.ui.TabStrip; insertBefore(item: string, referenceTab: Element): kendo.ui.TabStrip; insertBefore(item: string, referenceTab: JQuery): kendo.ui.TabStrip; @@ -7213,7 +7247,9 @@ declare namespace kendo.ui { dataItem(row: JQuery): kendo.data.TreeListModel; destroy(): void; editRow(row: JQuery): void; - expand(): void; + expand(row: string): void; + expand(row: Element): void; + expand(row: JQuery): void; itemFor(model: kendo.data.TreeListModel): JQuery; itemFor(model: any): JQuery; items(): any; @@ -7930,6 +7966,7 @@ declare namespace kendo.ui { interface WindowRefreshOptions { url?: string; + cache?: boolean; data?: any; type?: string; template?: string; @@ -7945,6 +7982,7 @@ declare namespace kendo.ui { content?: WindowContent; draggable?: boolean; iframe?: boolean; + height?: number|string; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -7957,7 +7995,6 @@ declare namespace kendo.ui { title?: string|boolean; visible?: boolean; width?: number|string; - height?: number|string; activate?(e: WindowEvent): void; close?(e: WindowCloseEvent): void; deactivate?(e: WindowEvent): void; @@ -8107,6 +8144,174 @@ declare namespace kendo.dataviz.ui { } + interface ChartAxisDefaultsCrosshairTooltipBorder { + color?: string; + dashType?: string; + width?: number; + } + + interface ChartAxisDefaultsCrosshairTooltipPadding { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsCrosshairTooltip { + background?: string; + border?: ChartAxisDefaultsCrosshairTooltipBorder; + color?: string; + font?: string; + format?: string; + padding?: ChartAxisDefaultsCrosshairTooltipPadding; + template?: string|Function; + visible?: boolean; + } + + interface ChartAxisDefaultsCrosshair { + color?: string; + opacity?: number; + tooltip?: ChartAxisDefaultsCrosshairTooltip; + visible?: boolean; + width?: number; + } + + interface ChartAxisDefaultsLabelsMargin { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsLabelsPadding { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsLabelsRotation { + align?: string; + angle?: number|string; + } + + interface ChartAxisDefaultsLabels { + font?: string; + format?: string; + margin?: ChartAxisDefaultsLabelsMargin; + mirror?: boolean; + padding?: ChartAxisDefaultsLabelsPadding; + rotation?: ChartAxisDefaultsLabelsRotation; + skip?: number; + step?: number; + template?: string|Function; + visible?: boolean; + visual?: Function; + } + + interface ChartAxisDefaultsLine { + color?: string; + dashType?: string; + visible?: boolean; + width?: number; + } + + interface ChartAxisDefaultsMajorGridLines { + color?: string; + dashType?: string; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsMajorTicks { + color?: string; + size?: number; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsMinorGridLines { + color?: string; + dashType?: string; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsMinorTicks { + color?: string; + size?: number; + visible?: boolean; + width?: number; + step?: number; + skip?: number; + } + + interface ChartAxisDefaultsPlotBand { + color?: string; + from?: number; + opacity?: number; + to?: number; + } + + interface ChartAxisDefaultsTitleBorder { + color?: string; + dashType?: string; + width?: number; + } + + interface ChartAxisDefaultsTitleMargin { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsTitlePadding { + bottom?: number; + left?: number; + right?: number; + top?: number; + } + + interface ChartAxisDefaultsTitle { + background?: string; + border?: ChartAxisDefaultsTitleBorder; + color?: string; + font?: string; + margin?: ChartAxisDefaultsTitleMargin; + padding?: ChartAxisDefaultsTitlePadding; + position?: string; + rotation?: number; + text?: string; + visible?: boolean; + visual?: Function; + } + + interface ChartAxisDefaults { + background?: string; + color?: string; + crosshair?: ChartAxisDefaultsCrosshair; + labels?: ChartAxisDefaultsLabels; + line?: ChartAxisDefaultsLine; + majorGridLines?: ChartAxisDefaultsMajorGridLines; + majorTicks?: ChartAxisDefaultsMajorTicks; + minorGridLines?: ChartAxisDefaultsMinorGridLines; + minorTicks?: ChartAxisDefaultsMinorTicks; + narrowRange?: boolean; + pane?: string; + plotBands?: ChartAxisDefaultsPlotBand[]; + reverse?: boolean; + startAngle?: number; + title?: ChartAxisDefaultsTitle; + visible?: boolean; + } + interface ChartCategoryAxisItemAutoBaseUnitSteps { seconds?: any; minutes?: any; @@ -9280,6 +9485,7 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; + opacity?: number; padding?: ChartTooltipPadding; shared?: boolean; sharedTemplate?: string|Function; @@ -10183,7 +10389,7 @@ declare namespace kendo.dataviz.ui { interface ChartOptions { name?: string; autoBind?: boolean; - axisDefaults?: any; + axisDefaults?: ChartAxisDefaults; categoryAxis?: ChartCategoryAxisItem[]; chartArea?: ChartChartArea; dataSource?: any|any|kendo.data.DataSource; @@ -10363,9 +10569,9 @@ declare namespace kendo.dataviz.ui { options: DiagramOptions; dataSource: kendo.data.DataSource; - connections: kendo.dataviz.diagram.Connection[]; + connections: DiagramConnection[]; connectionsDataSource: kendo.data.DataSource; - shapes: kendo.dataviz.diagram.Shape[]; + shapes: DiagramShape[]; element: JQuery; wrapper: JQuery; @@ -10432,6 +10638,9 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionDefaultsContent { + color?: string; + fontFamily?: string; + fontSize?: number; template?: string|Function; text?: string; visual?: Function; @@ -10526,6 +10735,9 @@ declare namespace kendo.dataviz.ui { } interface DiagramConnectionContent { + color?: string; + fontFamily?: string; + fontSize?: number; template?: string|Function; text?: string; visual?: Function; @@ -10776,9 +10988,76 @@ declare namespace kendo.dataviz.ui { stroke?: DiagramSelectableStroke; } + interface DiagramShapeDefaultsConnectorDefaultsFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorDefaultsHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorDefaultsHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeDefaultsConnectorDefaultsHover { + fill?: DiagramShapeDefaultsConnectorDefaultsHoverFill; + stroke?: DiagramShapeDefaultsConnectorDefaultsHoverStroke; + } + + interface DiagramShapeDefaultsConnectorDefaultsStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeDefaultsConnectorDefaults { + width?: number; + height?: number; + hover?: DiagramShapeDefaultsConnectorDefaultsHover; + fill?: DiagramShapeDefaultsConnectorDefaultsFill; + stroke?: DiagramShapeDefaultsConnectorDefaultsStroke; + } + + interface DiagramShapeDefaultsConnectorFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeDefaultsConnectorHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeDefaultsConnectorHover { + fill?: DiagramShapeDefaultsConnectorHoverFill; + stroke?: DiagramShapeDefaultsConnectorHoverStroke; + } + + interface DiagramShapeDefaultsConnectorStroke { + color?: string; + dashType?: string; + width?: number; + } + interface DiagramShapeDefaultsConnector { name?: string; position?: Function; + width?: number; + height?: number; + hover?: DiagramShapeDefaultsConnectorHover; + fill?: DiagramShapeDefaultsConnectorFill; + stroke?: DiagramShapeDefaultsConnectorStroke; } interface DiagramShapeDefaultsContent { @@ -10844,6 +11123,7 @@ declare namespace kendo.dataviz.ui { interface DiagramShapeDefaults { connectors?: DiagramShapeDefaultsConnector[]; + connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; editable?: DiagramShapeDefaultsEditable; fill?: DiagramShapeDefaultsFill; @@ -10863,10 +11143,77 @@ declare namespace kendo.dataviz.ui { y?: number; } + interface DiagramShapeConnectorDefaultsFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorDefaultsHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorDefaultsHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeConnectorDefaultsHover { + fill?: DiagramShapeConnectorDefaultsHoverFill; + stroke?: DiagramShapeConnectorDefaultsHoverStroke; + } + + interface DiagramShapeConnectorDefaultsStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeConnectorDefaults { + width?: number; + height?: number; + hover?: DiagramShapeConnectorDefaultsHover; + fill?: DiagramShapeConnectorDefaultsFill; + stroke?: DiagramShapeConnectorDefaultsStroke; + } + + interface DiagramShapeConnectorFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorHoverFill { + color?: string; + opacity?: number; + } + + interface DiagramShapeConnectorHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface DiagramShapeConnectorHover { + fill?: DiagramShapeConnectorHoverFill; + stroke?: DiagramShapeConnectorHoverStroke; + } + + interface DiagramShapeConnectorStroke { + color?: string; + dashType?: string; + width?: number; + } + interface DiagramShapeConnector { description?: string; name?: string; position?: Function; + width?: number; + height?: number; + hover?: DiagramShapeConnectorHover; + fill?: DiagramShapeConnectorFill; + stroke?: DiagramShapeConnectorStroke; } interface DiagramShapeContent { @@ -10930,6 +11277,7 @@ declare namespace kendo.dataviz.ui { interface DiagramShape { connectors?: DiagramShapeConnector[]; + connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; editable?: DiagramShapeEditable; fill?: DiagramShapeFill; @@ -10999,6 +11347,7 @@ declare namespace kendo.dataviz.ui { remove?(e: DiagramRemoveEvent): void; save?(e: DiagramSaveEvent): void; select?(e: DiagramSelectEvent): void; + toolBarClick?(e: DiagramToolBarClickEvent): void; zoomEnd?(e: DiagramZoomEndEvent): void; zoomStart?(e: DiagramZoomStartEvent): void; } @@ -11091,6 +11440,13 @@ declare namespace kendo.dataviz.ui { deselected?: any; } + interface DiagramToolBarClickEvent extends DiagramEvent { + action?: string; + shapes?: any; + connections?: any; + target?: JQuery; + } + interface DiagramZoomEndEvent extends DiagramEvent { point?: kendo.dataviz.diagram.Point; zoom?: number; @@ -14924,6 +15280,9 @@ declare namespace kendo.dataviz.diagram { } interface ConnectionContent { + color?: string; + fontFamily?: string; + fontSize?: number; template?: string|Function; text?: string; visual?: Function; @@ -15022,11 +15381,35 @@ declare namespace kendo.dataviz.diagram { opacity?: number; } + interface ConnectorHoverFill { + color?: string; + opacity?: number; + } + + interface ConnectorHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface ConnectorHover { + fill?: ConnectorHoverFill; + stroke?: ConnectorHoverStroke; + } + + interface ConnectorStroke { + color?: string; + dashType?: string; + width?: number; + } + interface ConnectorOptions { name?: string; width?: number; height?: number; + hover?: ConnectorHover; fill?: ConnectorFill; + stroke?: ConnectorStroke; } interface ConnectorEvent { sender: Connector; @@ -15491,6 +15874,41 @@ declare namespace kendo.dataviz.diagram { } + interface ShapeConnectorDefaultsFill { + color?: string; + opacity?: number; + } + + interface ShapeConnectorDefaultsHoverFill { + color?: string; + opacity?: number; + } + + interface ShapeConnectorDefaultsHoverStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface ShapeConnectorDefaultsHover { + fill?: ShapeConnectorDefaultsHoverFill; + stroke?: ShapeConnectorDefaultsHoverStroke; + } + + interface ShapeConnectorDefaultsStroke { + color?: string; + dashType?: string; + width?: number; + } + + interface ShapeConnectorDefaults { + width?: number; + height?: number; + hover?: ShapeConnectorDefaultsHover; + fill?: ShapeConnectorDefaultsFill; + stroke?: ShapeConnectorDefaultsStroke; + } + interface ShapeConnector { name?: string; description?: string; @@ -15498,8 +15916,11 @@ declare namespace kendo.dataviz.diagram { } interface ShapeContent { - text?: string; align?: string; + color?: string; + fontFamily?: string; + fontSize?: number; + text?: string; } interface ShapeEditable { @@ -15566,6 +15987,7 @@ declare namespace kendo.dataviz.diagram { content?: ShapeContent; selectable?: boolean; visual?: Function; + connectorDefaults?: ShapeConnectorDefaults; } interface ShapeEvent { sender: Shape; @@ -15859,6 +16281,7 @@ declare namespace kendo.spreadsheet { showGridLines(): boolean; showGridLines(showGridLiens?: boolean): void; toJSON(): void; + setDataSource(dataSource: kendo.data.DataSource, columns?: any): void; unhideColumn(index: number): void; unhideRow(index: number): void; From 5ef5579faebcf7c2827d42f911a21bcda8bd0fad Mon Sep 17 00:00:00 2001 From: ArtemZag Date: Tue, 12 Apr 2016 16:05:00 +0300 Subject: [PATCH 09/94] Updated material-ui.d.ts (#8881) Added DOMAttributes to FlatButton and Dialog properties. --- material-ui/material-ui.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index 36e43a6e78..bdb7093265 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -576,7 +576,7 @@ declare namespace __MaterialUI { export class EnhancedButton extends React.Component { } - interface FlatButtonProps extends SharedEnhancedButtonProps { + interface FlatButtonProps extends React.DOMAttributes, SharedEnhancedButtonProps { // is the element that get the 'other' properties backgroundColor?: string; disabled?: boolean; @@ -843,7 +843,7 @@ declare namespace __MaterialUI { ref?: string; text: string; } - interface DialogProps extends React.Props { + interface DialogProps extends React.DOMAttributes, React.Props { /** @deprecated use a custom `actions` property instead */ actionFocus?: string; actions?: Array>; From be1056420eb6f7d48be5692baf7e07470187a36e Mon Sep 17 00:00:00 2001 From: Michael McKenzie Date: Tue, 12 Apr 2016 14:14:06 +0100 Subject: [PATCH 10/94] Methods were missing on kendo.Observable (#8883) --- kendo-ui/kendo-ui.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index b8302dafc1..20b6bf16a2 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -262,8 +262,10 @@ declare namespace kendo { static fn: Observable; static extend(prototype: Object): Observable; + init(...args: any[]): void bind(eventName: string, handler: Function): Observable; one(eventName: string, handler: Function): Observable; + first(eventName: string, handler: Function): Observable; trigger(eventName: string, e?: any): boolean; unbind(eventName: string, handler?: any): Observable; } From fa3294c560ee49f4af43e02a62e3f4b5b6bbe5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Lepp=C3=A4nen?= Date: Tue, 12 Apr 2016 16:32:17 +0300 Subject: [PATCH 11/94] Enable type checking for constant and value (#8885) Using a generic type one can type check the `constant` or `value` in angular.module. --- angularjs/angular.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index e86fd37052..3d2b248637 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -204,7 +204,7 @@ declare namespace angular { * @param name The name of the constant. * @param value The constant value. */ - constant(name: string, value: any): IModule; + constant(name: string, value: T): IModule; constant(object: Object): IModule; /** * The $controller service is used by Angular to create new controllers. @@ -294,7 +294,7 @@ declare namespace angular { * @param name The name of the instance. * @param value The value. */ - value(name: string, value: any): IModule; + value(name: string, value: T): IModule; value(object: Object): IModule; /** From 42da513c2531308b4646fc49dc18898ed6d22f0b Mon Sep 17 00:00:00 2001 From: York Yao Date: Tue, 12 Apr 2016 08:33:14 -0500 Subject: [PATCH 12/94] Try to provide a new definition for ioredis (#8910) * Create ioredis.d.ts * Create ioredis-tests.ts * Update ioredis.d.ts * Update ioredis-tests.ts * expose interfaces as type --- ioredis/ioredis-tests.ts | 54 +++ ioredis/ioredis.d.ts | 699 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 753 insertions(+) create mode 100644 ioredis/ioredis-tests.ts create mode 100644 ioredis/ioredis.d.ts diff --git a/ioredis/ioredis-tests.ts b/ioredis/ioredis-tests.ts new file mode 100644 index 0000000000..9280367917 --- /dev/null +++ b/ioredis/ioredis-tests.ts @@ -0,0 +1,54 @@ +/// + +import * as Redis from "ioredis"; +var redis = new Redis(); + +redis.set('foo', 'bar'); +redis.get('foo', function(err, result) { + console.log(result); +}); + +// Or using a promise if the last argument isn't a function +redis.get('foo').then(function(result: any) { + console.log(result); +}); + +// Arguments to commands are flattened, so the following are the same: +redis.sadd('set', 1, 3, 5, 7); +redis.sadd('set', [1, 3, 5, 7]); + +// All arguments are passed directly to the redis server: +redis.set('key', 100, 'EX', 10); + +new Redis() // Connect to 127.0.0.1:6379 +new Redis(6380) // 127.0.0.1:6380 +new Redis(6379, '192.168.1.1') // 192.168.1.1:6379 +new Redis('/tmp/redis.sock') +new Redis({ + port: 6379, // Redis port + host: '127.0.0.1', // Redis host + family: 4, // 4 (IPv4) or 6 (IPv6) + password: 'auth', + db: 0 +}) + +var pub = new Redis(); +redis.subscribe('news', 'music', function(err: any, count: any) { + // Now we are subscribed to both the 'news' and 'music' channels. + // `count` represents the number of channels we are currently subscribed to. + + pub.publish('news', 'Hello world!'); + pub.publish('music', 'Hello again!'); +}); + +redis.on('message', function(channel: any, message: any) { + // Receive message Hello world! from channel news + // Receive message Hello again! from channel music + console.log('Receive message %s from channel %s', message, channel); +}); + +// There's also an event called 'messageBuffer', which is the same as 'message' except +// it returns buffers instead of strings. +redis.on('messageBuffer', function(channel: any, message: any) { + // Both `channel` and `message` are buffers. +}); diff --git a/ioredis/ioredis.d.ts b/ioredis/ioredis.d.ts new file mode 100644 index 0000000000..d8cd4b3c70 --- /dev/null +++ b/ioredis/ioredis.d.ts @@ -0,0 +1,699 @@ +// Type definitions for ioredis +// Project: https://github.com/luin/ioredis +// Definitions by: York Yao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/* =================== USAGE =================== + import * as Redis from "ioredis"; + var redis = new Redis(); + =============================================== */ + +/// + +declare module "ioredis" { + + + interface RedisStatic { + new (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + new (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + new (options: IORedis.RedisOptions): IORedis.Redis; + new (url: string): IORedis.Redis; + (port?: number, host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + (host?: string, options?: IORedis.RedisOptions): IORedis.Redis; + (options: IORedis.RedisOptions): IORedis.Redis; + (url: string): IORedis.Redis; + Cluster: IORedis.Cluster; + } + + var redis: RedisStatic; + export = redis; +} +declare module IORedis { + interface Commander { + new (): Commander; + getBuiltinCommands(): string[]; + createBuiltinCommand(commandName: string): {}; + defineCommand(name: string, definition: { + numberOfKeys?: number; + lua?: string; + }): any; + sendCommand(): void; + } + + interface Redis extends NodeJS.EventEmitter, Commander { + connect(callback: Function): Promise; + disconnect(): void; + duplicate(): Redis; + monitor(calback: (error: Error, monitor: NodeJS.EventEmitter) => void): Promise; + + send_command(command: string, ...args: any[]): any; + auth(password: string, callback?: ResCallbackT): any; + ping(callback?: ResCallbackT): any; + append(key: string, value: string, callback?: ResCallbackT): any; + bitcount(key: string, callback?: ResCallbackT): any; + bitcount(key: string, start: number, end: number, callback?: ResCallbackT): any; + set(key: string, value: string, callback?: ResCallbackT): any; + get(key: string, callback?: ResCallbackT): any; + exists(key: string, value: string, callback?: ResCallbackT): any; + publish(channel: string, value: any): any; + subscribe(channel: string): any; + get(args: any[], callback?: ResCallbackT): any; + get(...args: any[]): any; + set(args: any[], callback?: ResCallbackT): any; + set(...args: any[]): any; + setnx(args: any[], callback?: ResCallbackT): any; + setnx(...args: any[]): any; + setex(args: any[], callback?: ResCallbackT): any; + setex(...args: any[]): any; + append(args: any[], callback?: ResCallbackT): any; + append(...args: any[]): any; + strlen(args: any[], callback?: ResCallbackT): any; + strlen(...args: any[]): any; + del(args: any[], callback?: ResCallbackT): any; + del(...args: any[]): any; + exists(args: any[], callback?: ResCallbackT): any; + exists(...args: any[]): any; + setbit(args: any[], callback?: ResCallbackT): any; + setbit(...args: any[]): any; + getbit(args: any[], callback?: ResCallbackT): any; + getbit(...args: any[]): any; + setrange(args: any[], callback?: ResCallbackT): any; + setrange(...args: any[]): any; + getrange(args: any[], callback?: ResCallbackT): any; + getrange(...args: any[]): any; + substr(args: any[], callback?: ResCallbackT): any; + substr(...args: any[]): any; + incr(args: any[], callback?: ResCallbackT): any; + incr(...args: any[]): any; + decr(args: any[], callback?: ResCallbackT): any; + decr(...args: any[]): any; + mget(args: any[], callback?: ResCallbackT): any; + mget(...args: any[]): any; + rpush(...args: any[]): any; + lpush(args: any[], callback?: ResCallbackT): any; + lpush(...args: any[]): any; + rpushx(args: any[], callback?: ResCallbackT): any; + rpushx(...args: any[]): any; + lpushx(args: any[], callback?: ResCallbackT): any; + lpushx(...args: any[]): any; + linsert(args: any[], callback?: ResCallbackT): any; + linsert(...args: any[]): any; + rpop(args: any[], callback?: ResCallbackT): any; + rpop(...args: any[]): any; + lpop(args: any[], callback?: ResCallbackT): any; + lpop(...args: any[]): any; + brpop(args: any[], callback?: ResCallbackT): any; + brpop(...args: any[]): any; + brpoplpush(args: any[], callback?: ResCallbackT): any; + brpoplpush(...args: any[]): any; + blpop(args: any[], callback?: ResCallbackT): any; + blpop(...args: any[]): any; + llen(args: any[], callback?: ResCallbackT): any; + llen(...args: any[]): any; + lindex(args: any[], callback?: ResCallbackT): any; + lindex(...args: any[]): any; + lset(args: any[], callback?: ResCallbackT): any; + lset(...args: any[]): any; + lrange(args: any[], callback?: ResCallbackT): any; + lrange(...args: any[]): any; + ltrim(args: any[], callback?: ResCallbackT): any; + ltrim(...args: any[]): any; + lrem(args: any[], callback?: ResCallbackT): any; + lrem(...args: any[]): any; + rpoplpush(args: any[], callback?: ResCallbackT): any; + rpoplpush(...args: any[]): any; + sadd(args: any[], callback?: ResCallbackT): any; + sadd(...args: any[]): any; + srem(args: any[], callback?: ResCallbackT): any; + srem(...args: any[]): any; + smove(args: any[], callback?: ResCallbackT): any; + smove(...args: any[]): any; + sismember(args: any[], callback?: ResCallbackT): any; + sismember(...args: any[]): any; + scard(args: any[], callback?: ResCallbackT): any; + scard(...args: any[]): any; + spop(args: any[], callback?: ResCallbackT): any; + spop(...args: any[]): any; + srandmember(args: any[], callback?: ResCallbackT): any; + srandmember(...args: any[]): any; + sinter(args: any[], callback?: ResCallbackT): any; + sinter(...args: any[]): any; + sinterstore(args: any[], callback?: ResCallbackT): any; + sinterstore(...args: any[]): any; + sunion(args: any[], callback?: ResCallbackT): any; + sunion(...args: any[]): any; + sunionstore(args: any[], callback?: ResCallbackT): any; + sunionstore(...args: any[]): any; + sdiff(args: any[], callback?: ResCallbackT): any; + sdiff(...args: any[]): any; + sdiffstore(args: any[], callback?: ResCallbackT): any; + sdiffstore(...args: any[]): any; + smembers(args: any[], callback?: ResCallbackT): any; + smembers(...args: any[]): any; + zadd(args: any[], callback?: ResCallbackT): any; + zadd(...args: any[]): any; + zincrby(args: any[], callback?: ResCallbackT): any; + zincrby(...args: any[]): any; + zrem(args: any[], callback?: ResCallbackT): any; + zrem(...args: any[]): any; + zremrangebyscore(args: any[], callback?: ResCallbackT): any; + zremrangebyscore(...args: any[]): any; + zremrangebyrank(args: any[], callback?: ResCallbackT): any; + zremrangebyrank(...args: any[]): any; + zunionstore(args: any[], callback?: ResCallbackT): any; + zunionstore(...args: any[]): any; + zinterstore(args: any[], callback?: ResCallbackT): any; + zinterstore(...args: any[]): any; + zrange(args: any[], callback?: ResCallbackT): any; + zrange(...args: any[]): any; + zrangebyscore(args: any[], callback?: ResCallbackT): any; + zrangebyscore(...args: any[]): any; + zrevrangebyscore(args: any[], callback?: ResCallbackT): any; + zrevrangebyscore(...args: any[]): any; + zcount(args: any[], callback?: ResCallbackT): any; + zcount(...args: any[]): any; + zrevrange(args: any[], callback?: ResCallbackT): any; + zrevrange(...args: any[]): any; + zcard(args: any[], callback?: ResCallbackT): any; + zcard(...args: any[]): any; + zscore(args: any[], callback?: ResCallbackT): any; + zscore(...args: any[]): any; + zrank(args: any[], callback?: ResCallbackT): any; + zrank(...args: any[]): any; + zrevrank(args: any[], callback?: ResCallbackT): any; + zrevrank(...args: any[]): any; + hset(args: any[], callback?: ResCallbackT): any; + hset(...args: any[]): any; + hsetnx(args: any[], callback?: ResCallbackT): any; + hsetnx(...args: any[]): any; + hget(args: any[], callback?: ResCallbackT): any; + hget(...args: any[]): any; + hmset(args: any[], callback?: ResCallbackT): any; + hmset(key: string, hash: any, callback?: ResCallbackT): any; + hmset(...args: any[]): any; + hmget(args: any[], callback?: ResCallbackT): any; + hmget(...args: any[]): any; + hincrby(args: any[], callback?: ResCallbackT): any; + hincrby(...args: any[]): any; + hdel(args: any[], callback?: ResCallbackT): any; + hdel(...args: any[]): any; + hlen(args: any[], callback?: ResCallbackT): any; + hlen(...args: any[]): any; + hkeys(args: any[], callback?: ResCallbackT): any; + hkeys(...args: any[]): any; + hvals(args: any[], callback?: ResCallbackT): any; + hvals(...args: any[]): any; + hgetall(args: any[], callback?: ResCallbackT): any; + hgetall(...args: any[]): any; + hgetall(key: string, callback?: ResCallbackT): any; + hexists(args: any[], callback?: ResCallbackT): any; + hexists(...args: any[]): any; + incrby(args: any[], callback?: ResCallbackT): any; + incrby(...args: any[]): any; + decrby(args: any[], callback?: ResCallbackT): any; + decrby(...args: any[]): any; + getset(args: any[], callback?: ResCallbackT): any; + getset(...args: any[]): any; + mset(args: any[], callback?: ResCallbackT): any; + mset(...args: any[]): any; + msetnx(args: any[], callback?: ResCallbackT): any; + msetnx(...args: any[]): any; + randomkey(args: any[], callback?: ResCallbackT): any; + randomkey(...args: any[]): any; + select(args: any[], callback?: ResCallbackT): void; + select(...args: any[]): void; + move(args: any[], callback?: ResCallbackT): any; + move(...args: any[]): any; + rename(args: any[], callback?: ResCallbackT): any; + rename(...args: any[]): any; + renamenx(args: any[], callback?: ResCallbackT): any; + renamenx(...args: any[]): any; + expire(args: any[], callback?: ResCallbackT): any; + expire(...args: any[]): any; + expireat(args: any[], callback?: ResCallbackT): any; + expireat(...args: any[]): any; + keys(args: any[], callback?: ResCallbackT): any; + keys(...args: any[]): any; + dbsize(args: any[], callback?: ResCallbackT): any; + dbsize(...args: any[]): any; + auth(args: any[], callback?: ResCallbackT): void; + auth(...args: any[]): void; + ping(args: any[], callback?: ResCallbackT): any; + ping(...args: any[]): any; + echo(args: any[], callback?: ResCallbackT): any; + echo(...args: any[]): any; + save(args: any[], callback?: ResCallbackT): any; + save(...args: any[]): any; + bgsave(args: any[], callback?: ResCallbackT): any; + bgsave(...args: any[]): any; + bgrewriteaof(args: any[], callback?: ResCallbackT): any; + bgrewriteaof(...args: any[]): any; + shutdown(args: any[], callback?: ResCallbackT): any; + shutdown(...args: any[]): any; + lastsave(args: any[], callback?: ResCallbackT): any; + lastsave(...args: any[]): any; + type(args: any[], callback?: ResCallbackT): any; + type(...args: any[]): any; + multi(args: any[], callback?: ResCallbackT): Pipeline; + multi(...args: any[]): Pipeline; + exec(args: any[], callback?: ResCallbackT): any; + exec(...args: any[]): any; + discard(args: any[], callback?: ResCallbackT): any; + discard(...args: any[]): any; + sync(args: any[], callback?: ResCallbackT): any; + sync(...args: any[]): any; + flushdb(args: any[], callback?: ResCallbackT): any; + flushdb(...args: any[]): any; + flushall(args: any[], callback?: ResCallbackT): any; + flushall(...args: any[]): any; + sort(args: any[], callback?: ResCallbackT): any; + sort(...args: any[]): any; + info(args: any[], callback?: ResCallbackT): any; + info(...args: any[]): any; + monitor(args: any[], callback?: ResCallbackT): any; + monitor(...args: any[]): any; + ttl(args: any[], callback?: ResCallbackT): any; + ttl(...args: any[]): any; + persist(args: any[], callback?: ResCallbackT): any; + persist(...args: any[]): any; + slaveof(args: any[], callback?: ResCallbackT): any; + slaveof(...args: any[]): any; + debug(args: any[], callback?: ResCallbackT): any; + debug(...args: any[]): any; + config(args: any[], callback?: ResCallbackT): any; + config(...args: any[]): any; + subscribe(args: any[], callback?: ResCallbackT): any; + subscribe(...args: any[]): any; + unsubscribe(args: any[], callback?: ResCallbackT): any; + unsubscribe(...args: any[]): any; + psubscribe(args: any[], callback?: ResCallbackT): any; + psubscribe(...args: any[]): any; + punsubscribe(args: any[], callback?: ResCallbackT): any; + punsubscribe(...args: any[]): any; + publish(args: any[], callback?: ResCallbackT): any; + publish(...args: any[]): any; + watch(args: any[], callback?: ResCallbackT): any; + watch(...args: any[]): any; + unwatch(args: any[], callback?: ResCallbackT): any; + unwatch(...args: any[]): any; + cluster(args: any[], callback?: ResCallbackT): any; + cluster(...args: any[]): any; + restore(args: any[], callback?: ResCallbackT): any; + restore(...args: any[]): any; + migrate(args: any[], callback?: ResCallbackT): any; + migrate(...args: any[]): any; + dump(args: any[], callback?: ResCallbackT): any; + dump(...args: any[]): any; + object(args: any[], callback?: ResCallbackT): any; + object(...args: any[]): any; + client(args: any[], callback?: ResCallbackT): any; + client(...args: any[]): any; + eval(args: any[], callback?: ResCallbackT): any; + eval(...args: any[]): any; + evalsha(args: any[], callback?: ResCallbackT): any; + evalsha(...args: any[]): any; + script(args: any[], callback?: ResCallbackT): any; + script(...args: any[]): any; + script(key: string, callback?: ResCallbackT): any; + quit(args: any[], callback?: ResCallbackT): any; + quit(...args: any[]): any; + scan(...args: any[]): any; + scan(args: any[], callback?: ResCallbackT): any; + hscan(...args: any[]): any; + hscan(args: any[], callback?: ResCallbackT): any; + zscan(...args: any[]): any; + zscan(args: any[], callback?: ResCallbackT): any; + + pipeline(): Pipeline; + pipeline(commands: string[][]): Pipeline; + + scanStream(options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; + hscanStream(key: string, options?: IORedis.ScanStreamOption): NodeJS.EventEmitter; + } + + interface Pipeline { + exec(callback?: ResCallbackT): any; + + get(args: any[], callback?: ResCallbackT): Pipeline; + get(...args: any[]): Pipeline; + set(args: any[], callback?: ResCallbackT): Pipeline; + set(...args: any[]): Pipeline; + setnx(args: any[], callback?: ResCallbackT): Pipeline; + setnx(...args: any[]): Pipeline; + setex(args: any[], callback?: ResCallbackT): Pipeline; + setex(...args: any[]): Pipeline; + append(args: any[], callback?: ResCallbackT): Pipeline; + append(...args: any[]): Pipeline; + strlen(args: any[], callback?: ResCallbackT): Pipeline; + strlen(...args: any[]): Pipeline; + del(args: any[], callback?: ResCallbackT): Pipeline; + del(...args: any[]): Pipeline; + exists(args: any[], callback?: ResCallbackT): Pipeline; + exists(...args: any[]): Pipeline; + setbit(args: any[], callback?: ResCallbackT): Pipeline; + setbit(...args: any[]): Pipeline; + getbit(args: any[], callback?: ResCallbackT): Pipeline; + getbit(...args: any[]): Pipeline; + setrange(args: any[], callback?: ResCallbackT): Pipeline; + setrange(...args: any[]): Pipeline; + getrange(args: any[], callback?: ResCallbackT): Pipeline; + getrange(...args: any[]): Pipeline; + substr(args: any[], callback?: ResCallbackT): Pipeline; + substr(...args: any[]): Pipeline; + incr(args: any[], callback?: ResCallbackT): Pipeline; + incr(...args: any[]): Pipeline; + decr(args: any[], callback?: ResCallbackT): Pipeline; + decr(...args: any[]): Pipeline; + mget(args: any[], callback?: ResCallbackT): Pipeline; + mget(...args: any[]): Pipeline; + rpush(...args: any[]): Pipeline; + lpush(args: any[], callback?: ResCallbackT): Pipeline; + lpush(...args: any[]): Pipeline; + rpushx(args: any[], callback?: ResCallbackT): Pipeline; + rpushx(...args: any[]): Pipeline; + lpushx(args: any[], callback?: ResCallbackT): Pipeline; + lpushx(...args: any[]): Pipeline; + linsert(args: any[], callback?: ResCallbackT): Pipeline; + linsert(...args: any[]): Pipeline; + rpop(args: any[], callback?: ResCallbackT): Pipeline; + rpop(...args: any[]): Pipeline; + lpop(args: any[], callback?: ResCallbackT): Pipeline; + lpop(...args: any[]): Pipeline; + brpop(args: any[], callback?: ResCallbackT): Pipeline; + brpop(...args: any[]): Pipeline; + brpoplpush(args: any[], callback?: ResCallbackT): Pipeline; + brpoplpush(...args: any[]): Pipeline; + blpop(args: any[], callback?: ResCallbackT): Pipeline; + blpop(...args: any[]): Pipeline; + llen(args: any[], callback?: ResCallbackT): Pipeline; + llen(...args: any[]): Pipeline; + lindex(args: any[], callback?: ResCallbackT): Pipeline; + lindex(...args: any[]): Pipeline; + lset(args: any[], callback?: ResCallbackT): Pipeline; + lset(...args: any[]): Pipeline; + lrange(args: any[], callback?: ResCallbackT): Pipeline; + lrange(...args: any[]): Pipeline; + ltrim(args: any[], callback?: ResCallbackT): Pipeline; + ltrim(...args: any[]): Pipeline; + lrem(args: any[], callback?: ResCallbackT): Pipeline; + lrem(...args: any[]): Pipeline; + rpoplpush(args: any[], callback?: ResCallbackT): Pipeline; + rpoplpush(...args: any[]): Pipeline; + sadd(args: any[], callback?: ResCallbackT): Pipeline; + sadd(...args: any[]): Pipeline; + srem(args: any[], callback?: ResCallbackT): Pipeline; + srem(...args: any[]): Pipeline; + smove(args: any[], callback?: ResCallbackT): Pipeline; + smove(...args: any[]): Pipeline; + sismember(args: any[], callback?: ResCallbackT): Pipeline; + sismember(...args: any[]): Pipeline; + scard(args: any[], callback?: ResCallbackT): Pipeline; + scard(...args: any[]): Pipeline; + spop(args: any[], callback?: ResCallbackT): Pipeline; + spop(...args: any[]): Pipeline; + srandmember(args: any[], callback?: ResCallbackT): Pipeline; + srandmember(...args: any[]): Pipeline; + sinter(args: any[], callback?: ResCallbackT): Pipeline; + sinter(...args: any[]): Pipeline; + sinterstore(args: any[], callback?: ResCallbackT): Pipeline; + sinterstore(...args: any[]): Pipeline; + sunion(args: any[], callback?: ResCallbackT): Pipeline; + sunion(...args: any[]): Pipeline; + sunionstore(args: any[], callback?: ResCallbackT): Pipeline; + sunionstore(...args: any[]): Pipeline; + sdiff(args: any[], callback?: ResCallbackT): Pipeline; + sdiff(...args: any[]): Pipeline; + sdiffstore(args: any[], callback?: ResCallbackT): Pipeline; + sdiffstore(...args: any[]): Pipeline; + smembers(args: any[], callback?: ResCallbackT): Pipeline; + smembers(...args: any[]): Pipeline; + zadd(args: any[], callback?: ResCallbackT): Pipeline; + zadd(...args: any[]): Pipeline; + zincrby(args: any[], callback?: ResCallbackT): Pipeline; + zincrby(...args: any[]): Pipeline; + zrem(args: any[], callback?: ResCallbackT): Pipeline; + zrem(...args: any[]): Pipeline; + zremrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; + zremrangebyscore(...args: any[]): Pipeline; + zremrangebyrank(args: any[], callback?: ResCallbackT): Pipeline; + zremrangebyrank(...args: any[]): Pipeline; + zunionstore(args: any[], callback?: ResCallbackT): Pipeline; + zunionstore(...args: any[]): Pipeline; + zinterstore(args: any[], callback?: ResCallbackT): Pipeline; + zinterstore(...args: any[]): Pipeline; + zrange(args: any[], callback?: ResCallbackT): Pipeline; + zrange(...args: any[]): Pipeline; + zrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; + zrangebyscore(...args: any[]): Pipeline; + zrevrangebyscore(args: any[], callback?: ResCallbackT): Pipeline; + zrevrangebyscore(...args: any[]): Pipeline; + zcount(args: any[], callback?: ResCallbackT): Pipeline; + zcount(...args: any[]): Pipeline; + zrevrange(args: any[], callback?: ResCallbackT): Pipeline; + zrevrange(...args: any[]): Pipeline; + zcard(args: any[], callback?: ResCallbackT): Pipeline; + zcard(...args: any[]): Pipeline; + zscore(args: any[], callback?: ResCallbackT): Pipeline; + zscore(...args: any[]): Pipeline; + zrank(args: any[], callback?: ResCallbackT): Pipeline; + zrank(...args: any[]): Pipeline; + zrevrank(args: any[], callback?: ResCallbackT): Pipeline; + zrevrank(...args: any[]): Pipeline; + hset(args: any[], callback?: ResCallbackT): Pipeline; + hset(...args: any[]): Pipeline; + hsetnx(args: any[], callback?: ResCallbackT): Pipeline; + hsetnx(...args: any[]): Pipeline; + hget(args: any[], callback?: ResCallbackT): Pipeline; + hget(...args: any[]): Pipeline; + hmset(args: any[], callback?: ResCallbackT): Pipeline; + hmset(key: string, hash: any, callback?: ResCallbackT): Pipeline; + hmset(...args: any[]): Pipeline; + hmget(args: any[], callback?: ResCallbackT): Pipeline; + hmget(...args: any[]): Pipeline; + hincrby(args: any[], callback?: ResCallbackT): Pipeline; + hincrby(...args: any[]): Pipeline; + hdel(args: any[], callback?: ResCallbackT): Pipeline; + hdel(...args: any[]): Pipeline; + hlen(args: any[], callback?: ResCallbackT): Pipeline; + hlen(...args: any[]): Pipeline; + hkeys(args: any[], callback?: ResCallbackT): Pipeline; + hkeys(...args: any[]): Pipeline; + hvals(args: any[], callback?: ResCallbackT): Pipeline; + hvals(...args: any[]): Pipeline; + hgetall(args: any[], callback?: ResCallbackT): Pipeline; + hgetall(...args: any[]): Pipeline; + hgetall(key: string, callback?: ResCallbackT): Pipeline; + hexists(args: any[], callback?: ResCallbackT): Pipeline; + hexists(...args: any[]): Pipeline; + incrby(args: any[], callback?: ResCallbackT): Pipeline; + incrby(...args: any[]): Pipeline; + decrby(args: any[], callback?: ResCallbackT): Pipeline; + decrby(...args: any[]): Pipeline; + getset(args: any[], callback?: ResCallbackT): Pipeline; + getset(...args: any[]): Pipeline; + mset(args: any[], callback?: ResCallbackT): Pipeline; + mset(...args: any[]): Pipeline; + msetnx(args: any[], callback?: ResCallbackT): Pipeline; + msetnx(...args: any[]): Pipeline; + randomkey(args: any[], callback?: ResCallbackT): Pipeline; + randomkey(...args: any[]): Pipeline; + select(args: any[], callback?: ResCallbackT): void; + select(...args: any[]): Pipeline; + move(args: any[], callback?: ResCallbackT): Pipeline; + move(...args: any[]): Pipeline; + rename(args: any[], callback?: ResCallbackT): Pipeline; + rename(...args: any[]): Pipeline; + renamenx(args: any[], callback?: ResCallbackT): Pipeline; + renamenx(...args: any[]): Pipeline; + expire(args: any[], callback?: ResCallbackT): Pipeline; + expire(...args: any[]): Pipeline; + expireat(args: any[], callback?: ResCallbackT): Pipeline; + expireat(...args: any[]): Pipeline; + keys(args: any[], callback?: ResCallbackT): Pipeline; + keys(...args: any[]): Pipeline; + dbsize(args: any[], callback?: ResCallbackT): Pipeline; + dbsize(...args: any[]): Pipeline; + auth(args: any[], callback?: ResCallbackT): void; + auth(...args: any[]): void; + ping(args: any[], callback?: ResCallbackT): Pipeline; + ping(...args: any[]): Pipeline; + echo(args: any[], callback?: ResCallbackT): Pipeline; + echo(...args: any[]): Pipeline; + save(args: any[], callback?: ResCallbackT): Pipeline; + save(...args: any[]): Pipeline; + bgsave(args: any[], callback?: ResCallbackT): Pipeline; + bgsave(...args: any[]): Pipeline; + bgrewriteaof(args: any[], callback?: ResCallbackT): Pipeline; + bgrewriteaof(...args: any[]): Pipeline; + shutdown(args: any[], callback?: ResCallbackT): Pipeline; + shutdown(...args: any[]): Pipeline; + lastsave(args: any[], callback?: ResCallbackT): Pipeline; + lastsave(...args: any[]): Pipeline; + type(args: any[], callback?: ResCallbackT): Pipeline; + type(...args: any[]): Pipeline; + multi(args: any[], callback?: ResCallbackT): Pipeline; + multi(...args: any[]): Pipeline; + exec(args: any[], callback?: ResCallbackT): Pipeline; + exec(...args: any[]): Pipeline; + discard(args: any[], callback?: ResCallbackT): Pipeline; + discard(...args: any[]): Pipeline; + sync(args: any[], callback?: ResCallbackT): Pipeline; + sync(...args: any[]): Pipeline; + flushdb(args: any[], callback?: ResCallbackT): Pipeline; + flushdb(...args: any[]): Pipeline; + flushall(args: any[], callback?: ResCallbackT): Pipeline; + flushall(...args: any[]): Pipeline; + sort(args: any[], callback?: ResCallbackT): Pipeline; + sort(...args: any[]): Pipeline; + info(args: any[], callback?: ResCallbackT): Pipeline; + info(...args: any[]): Pipeline; + monitor(args: any[], callback?: ResCallbackT): Pipeline; + monitor(...args: any[]): Pipeline; + ttl(args: any[], callback?: ResCallbackT): Pipeline; + ttl(...args: any[]): Pipeline; + persist(args: any[], callback?: ResCallbackT): Pipeline; + persist(...args: any[]): Pipeline; + slaveof(args: any[], callback?: ResCallbackT): Pipeline; + slaveof(...args: any[]): Pipeline; + debug(args: any[], callback?: ResCallbackT): Pipeline; + debug(...args: any[]): Pipeline; + config(args: any[], callback?: ResCallbackT): Pipeline; + config(...args: any[]): Pipeline; + subscribe(args: any[], callback?: ResCallbackT): Pipeline; + subscribe(...args: any[]): Pipeline; + unsubscribe(args: any[], callback?: ResCallbackT): Pipeline; + unsubscribe(...args: any[]): Pipeline; + psubscribe(args: any[], callback?: ResCallbackT): Pipeline; + psubscribe(...args: any[]): Pipeline; + punsubscribe(args: any[], callback?: ResCallbackT): Pipeline; + punsubscribe(...args: any[]): Pipeline; + publish(args: any[], callback?: ResCallbackT): Pipeline; + publish(...args: any[]): Pipeline; + watch(args: any[], callback?: ResCallbackT): Pipeline; + watch(...args: any[]): Pipeline; + unwatch(args: any[], callback?: ResCallbackT): Pipeline; + unwatch(...args: any[]): Pipeline; + cluster(args: any[], callback?: ResCallbackT): Pipeline; + cluster(...args: any[]): Pipeline; + restore(args: any[], callback?: ResCallbackT): Pipeline; + restore(...args: any[]): Pipeline; + migrate(args: any[], callback?: ResCallbackT): Pipeline; + migrate(...args: any[]): Pipeline; + dump(args: any[], callback?: ResCallbackT): Pipeline; + dump(...args: any[]): Pipeline; + object(args: any[], callback?: ResCallbackT): Pipeline; + object(...args: any[]): Pipeline; + client(args: any[], callback?: ResCallbackT): Pipeline; + client(...args: any[]): Pipeline; + eval(args: any[], callback?: ResCallbackT): Pipeline; + eval(...args: any[]): Pipeline; + evalsha(args: any[], callback?: ResCallbackT): Pipeline; + evalsha(...args: any[]): Pipeline; + quit(args: any[], callback?: ResCallbackT): Pipeline; + quit(...args: any[]): Pipeline; + scan(...args: any[]): Pipeline; + scan(args: any[], callback?: ResCallbackT): Pipeline; + hscan(...args: any[]): Pipeline; + hscan(args: any[], callback?: ResCallbackT): Pipeline; + zscan(...args: any[]): Pipeline; + zscan(args: any[], callback?: ResCallbackT): Pipeline; + } + + interface Cluster extends NodeJS.EventEmitter, Commander { + new (nodes: { host: string; port: number; }[], options?: IORedis.ClusterOptions): Redis; + connect(callback: Function): Promise; + disconnect(): void; + nodes(role: string): Redis[]; + } + + interface ResCallbackT { + (err: Error, res: R): void; + } + + interface RedisOptions { + port?: number; + host?: string; + /** + * 4 (IPv4) or 6 (IPv6), Defaults to 4. + */ + family?: number; + /** + * Local domain socket path. If set the port, host and family will be ignored. + */ + path?: string; + /** + * TCP KeepAlive on the socket with a X ms delay before start. Set to a non-number value to disable keepAlive. + */ + keepAlive?: number; + connectionName?: string; + /** + * If set, client will send AUTH command with the value of this option when connected. + */ + password?: string; + /** + * Database index to use. + */ + db?: number; + /** + * When a connection is established to the Redis server, the server might still be loading + * the database from disk. While loading, the server not respond to any commands. + * To work around this, when this option is true, ioredis will check the status of the Redis server, + * and when the Redis server is able to process commands, a ready event will be emitted. + */ + enableReadyCheck?: boolean; + keyPrefix?: string; + retryStrategy?: (times: number) => number; + reconnectOnError?: (error: Error) => boolean; + /** + * By default, if there is no active connection to the Redis server, commands are added to a queue + * and are executed once the connection is "ready" (when enableReadyCheck is true, "ready" means + * the Redis server has loaded the database from disk, otherwise means the connection to the Redis + * server has been established). If this option is false, when execute the command when the connection + * isn't ready, an error will be returned. + */ + enableOfflineQueue?: boolean; + /** + * The milliseconds before a timeout occurs during the initial connection to the Redis server. + * default: 10000. + */ + connectTimeout?: number; + /** + * After reconnected, if the previous connection was in the subscriber mode, client will auto re-subscribe these channels. + * default: true. + */ + autoResubscribe?: boolean; + /** + * If true, client will resend unfulfilled commands(e.g. block commands) in the previous connection when reconnected. + * default: true. + */ + autoResendUnfulfilledCommands?: boolean; + lazyConnect?: boolean; + tls?: { + ca: Buffer; + }; + sentinels?: { host: string; port: number; }[]; + name?: string; + /** + * Enable READONLY mode for the connection. Only available for cluster mode. + * default: false. + */ + readOnly?: boolean; + } + + interface ScanStreamOption { + match?: string; + count?: number; + } + + interface ClusterOptions { + clusterRetryStrategy?: (times: number) => number; + enableOfflineQueue?: boolean; + enableReadyCheck?: boolean; + scaleReads?: string; + maxRedirections?: number; + retryDelayOnFailover?: number; + retryDelayOnClusterDown?: number; + retryDelayOnTryAgain?: number; + redisOptions?: RedisOptions; + } +} From 99e58db462a793a03f3db1855a2be55f2d68c47d Mon Sep 17 00:00:00 2001 From: Romke van der Meulen Date: Tue, 12 Apr 2016 15:36:44 +0200 Subject: [PATCH 13/94] mark Response.error() and Response.redirect() as static (#8887) Fixes #7777 --- whatwg-fetch/whatwg-fetch.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whatwg-fetch/whatwg-fetch.d.ts b/whatwg-fetch/whatwg-fetch.d.ts index e2d781081d..32e681bb9b 100644 --- a/whatwg-fetch/whatwg-fetch.d.ts +++ b/whatwg-fetch/whatwg-fetch.d.ts @@ -59,8 +59,8 @@ declare class Body { } declare class Response extends Body { constructor(body?: BodyInit, init?: ResponseInit); - error(): Response; - redirect(url: string, status: number): Response; + static error(): Response; + static redirect(url: string, status: number): Response; type: ResponseType; url: string; status: number; From 3e03f67efeb5e2fed718617c398c4fe8196817a8 Mon Sep 17 00:00:00 2001 From: Chris Charabaruk Date: Tue, 12 Apr 2016 09:40:51 -0400 Subject: [PATCH 14/94] Created definitions for promise-pg (#8888) * Created definitions for promise-pg Dependencies: * node * Q * pg Tests script is cribbed from pg typings and modified for promise-pg. 'promise-pg'.Client does not inherit from 'pg'.Client because the functions redefined to return promises completely replace the originals from 'pg'. * fix: QueryConfig.buffer is optional It's only needed when doing a SELECT anyway, so mark it optional. * Bring promise-pg tests in line with examples from promise-pg readme * Add the promise-pg readme examples as tests --- promise-pg/promise-pg-tests.ts | 95 ++++++++++++++++++++++++++++++++++ promise-pg/promise-pg.d.ts | 61 ++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 promise-pg/promise-pg-tests.ts create mode 100644 promise-pg/promise-pg.d.ts diff --git a/promise-pg/promise-pg-tests.ts b/promise-pg/promise-pg-tests.ts new file mode 100644 index 0000000000..6a2e74a6fd --- /dev/null +++ b/promise-pg/promise-pg-tests.ts @@ -0,0 +1,95 @@ +/// +/// + +import * as pg from 'promise-pg'; + +var conString = "postgres://username:password@localhost/database"; + +// https://github.com/brianc/node-pg-types +pg.raw.types.setTypeParser(20, (val) => Number(val)); + +// Client pooling +pg.connect(conString) + .spread(function (client: pg.Client, done: () => void) { + client.query("SELECT $1::int AS number", ["1"]).promise + .then(function (result) { + // done + }, function (err) { + console.error("Error running query", err); + }) + .finally(done); + }, function (err) { + return console.error("Error fetching client from pool", err); + }).done(); + +// Simple +var client = new pg.Client(conString); +client.connect() + .spread(function (client: pg.Client, done: () => void) { + client.query("SELECT NOW() AS 'theTime'").promise + .then(function (result) { + console.log(result.rows[0]["theTime"]); + client.end(); + return null; + }, function (err) { + return console.error("Error running query", err); + }); + }, function (err) { + return console.error("Could not connect to postgres", err); + }).done(); + +// Using buffer query option +pg.connect(conString) + .spread(function (client: pg.Client, done: () => void) { + client.query({ + text: "SELECT * FROM users", + buffer: true + }).promise.then( + function (result) { console.log(result.rows.length + " rows returned"); }, + function (err) { console.error("Error running query", err); throw err; }, + function (user: any) {} // called for each returned row + ).finally(done); + }).done(); + +// Transactions +pg.connect(conString) + .spread(function (client: pg.Client, done: () => void) { + var INSERT = "INSERT INTO users(name, t_birth, country) VALUES ($1, $2, $3)"; + + console.log("Transaction I:"); + var trans = client.transaction(function () { + return Q.all([{ + text: INSERT, + values: ["Jake1", "now()", "Oo"] + }, { + text: INSERT, + values: ["Cake2", null, "Küche"] + }, { + text: INSERT, + values: ["Mike3", "now()", null] + }].map(function (q) { return client.query(q).promise; })); + }).then(function() { + console.log("Good - Committed Transaction I."); + }, function (err) { + console.log("Bad - Rolled back Transaction I.", err); + }); + + trans.finally(function () { + client.transaction(function () { + return Q.all([{ + text: INSERT, + values: ["Jake", "now()", "Oo"] + }, { + text: INSERT, // Bad, name is NOT NULL + values: [null, null, "Küche"] + }, { + text: INSERT, + values: ["Mike", "now()", null] + }].map(function (q) { return client.query(q).promise; })); + }).then(function () { + console.log("Bad - Committed Transaction II."); + }, function (err) { + console.log("Good - Rolled back Transaction II.", err.message); + }).finally(done).done(); + }); + }).done(); diff --git a/promise-pg/promise-pg.d.ts b/promise-pg/promise-pg.d.ts new file mode 100644 index 0000000000..47321bbf61 --- /dev/null +++ b/promise-pg/promise-pg.d.ts @@ -0,0 +1,61 @@ +// Type definitions for promise-pg +// Project: https://bitbucket.org/lplabs/promise-pg +// Definitions by: Chris Charabaruk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// + +declare module "promise-pg" { + import * as stream from 'stream'; + import * as pg from 'pg'; + + export {pg as raw}; + + export interface ClientConfig extends pg.ClientConfig {} + + export function connect(connection: string): Q.Promise; + export function connect(connection: pg.ClientConfig): Q.Promise; + + export function end(): Q.Promise; + + export interface QueryConfig extends pg.QueryConfig { + buffer?: boolean; + } + + export class Client { + constructor(connection: string); + constructor(config: ClientConfig); + + raw: pg.Client; + + connect(): Q.Promise; + end(): Q.Promise; + + query(queryText: string): Query; + query(config: QueryConfig): Query; + query(queryText: string, values: any[]): Query; + + copyFrom(queryText: string): stream.Writable; + copyTo(queryText: string): stream.Readable; + + pauseDrain(): void; + resumeDrain(): void; + + public on(event: "drain", listener: () => void): Client; + public on(event: "error", listener: (err: Error) => void): Client; + public on(event: "notification", listener: (message: any) => void): Client; + public on(event: "notice", listener: (message: any) => void): Client; + public on(event: string, listener: Function): Client; + + transaction(task: () => Q.Promise): Q.Promise; + } + + export interface QueryResult extends pg.QueryResult {} + export interface ResultBuilder extends pg.ResultBuilder {} + + export class Query extends pg.Query { + promise: Q.Promise; + } +} From 0ea6c46516830bae7d8ee9aa2526052afa1d128d Mon Sep 17 00:00:00 2001 From: Anthony Ciccarello Date: Tue, 12 Apr 2016 09:42:42 -0400 Subject: [PATCH 15/94] Add ControllerService to angular-mocks (#8889) * Add ControllerService to angular-mocks The definition in angular.d.ts changed that used to included this definition. Needed because of 69d2fb9 * Added unit tests for controller service mock --- angularjs/angular-mocks-tests.ts | 9 +++++++++ angularjs/angular-mocks.d.ts | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/angularjs/angular-mocks-tests.ts b/angularjs/angular-mocks-tests.ts index 86bbe6c945..294bcf8982 100644 --- a/angularjs/angular-mocks-tests.ts +++ b/angularjs/angular-mocks-tests.ts @@ -87,6 +87,15 @@ logCall = logService.warn; logs = logCall.logs; +/////////////////////////////////////// +// ControllerService mock +/////////////////////////////////////// +var $controller: ng.IControllerService; +$controller(class TestController {}, {}, {myBinding: 'works!'}); +$controller(function TestController() {}, {someLocal: 42}, {myBinding: 'works!'}); +$controller('TestController', {}, {myBinding: 'works!'}); + + /////////////////////////////////////// // IComponentControllerService /////////////////////////////////////// diff --git a/angularjs/angular-mocks.d.ts b/angularjs/angular-mocks.d.ts index 429c7b5269..c97471e5bf 100644 --- a/angularjs/angular-mocks.d.ts +++ b/angularjs/angular-mocks.d.ts @@ -97,6 +97,18 @@ declare namespace angular { logs: string[]; } + /////////////////////////////////////////////////////////////////////////// + // ControllerService mock + // see https://docs.angularjs.org/api/ngMock/service/$controller + // This interface extends http://docs.angularjs.org/api/ng.$controller + /////////////////////////////////////////////////////////////////////////// + interface IControllerService { + // Although the documentation doesn't state this, locals are optional + (controllerConstructor: new (...args: any[]) => T, locals?: any, bindings?: any): T; + (controllerConstructor: Function, locals?: any, bindings?: any): T; + (controllerName: string, locals?: any, bindings?: any): T; + } + /////////////////////////////////////////////////////////////////////////// // ComponentControllerService // see https://docs.angularjs.org/api/ngMock/service/$componentController From 883f016ef7dd32f43f4d36444ccb10d94910e718 Mon Sep 17 00:00:00 2001 From: Xavier Stouder Date: Tue, 12 Apr 2016 15:43:57 +0200 Subject: [PATCH 16/94] Create html-entities definitions file (#8890) * Create html-entities definitions file * Fix Travis test --- html-entities/html-entities-tests.ts | 10 ++++++++++ html-entities/html-entities.d.ts | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 html-entities/html-entities-tests.ts create mode 100644 html-entities/html-entities.d.ts diff --git a/html-entities/html-entities-tests.ts b/html-entities/html-entities-tests.ts new file mode 100644 index 0000000000..d9c4f76ce7 --- /dev/null +++ b/html-entities/html-entities-tests.ts @@ -0,0 +1,10 @@ +/// + +import * as htmlEntities from "html-entities"; + +let entities = new htmlEntities.AllHtmlEntities(); + +console.log(entities.encode('<>"\'&©®')); // <>"'&©® +console.log(entities.encodeNonUTF('<>"\'&©®')); // <>"'&©® +console.log(entities.encodeNonASCII('<>"\'&©®')); // <>"\'&©® +console.log(entities.decode('<>"'&©®∆')); // <>"'&©®∆ \ No newline at end of file diff --git a/html-entities/html-entities.d.ts b/html-entities/html-entities.d.ts new file mode 100644 index 0000000000..1539b0c4d5 --- /dev/null +++ b/html-entities/html-entities.d.ts @@ -0,0 +1,17 @@ +// Type definitions for html-entities v1.2.0 +// Project: https://www.npmjs.com/package/html-entities +// Definitions by: Xavier Stouder +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "html-entities" { + abstract class Entities { + encode(toEncode: string): string; + encodeNonUTF(toEncode: string): string; + encodeNonASCII(toEncode: string): string; + decode(toDecode: string): string; + } + class XmlEntities extends Entities {} + class Html4Entities extends Entities {} + class Html5Entities extends Entities {} + class AllHtmlEntities extends Entities {} +} \ No newline at end of file From 5c182b9af717f73146399c2485f70f1e2ac0ff2b Mon Sep 17 00:00:00 2001 From: mmmichl Date: Tue, 12 Apr 2016 15:44:38 +0200 Subject: [PATCH 17/94] Introduce done function declaration with fail method (#8891) --- jasmine/jasmine-tests.ts | 10 +++++----- jasmine/jasmine.d.ts | 21 ++++++++++++++------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 81f1a1a886..45b2d155a6 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -747,31 +747,31 @@ describe("Manually ticking the Jasmine Clock", function () { describe("Asynchronous specs", function () { var value: number; - beforeEach(function (done) { + beforeEach(function (done: DoneFn) { setTimeout(function () { value = 0; done(); }, 1); }); - it("should support async execution of test preparation and expectations", function (done) { + it("should support async execution of test preparation and expectations", function (done: DoneFn) { value++; expect(value).toBeGreaterThan(0); done(); }); describe("long asynchronous specs", function() { - beforeEach(function(done) { + beforeEach(function(done: DoneFn) { done(); }, 1000); - it("takes a long time", function(done) { + it("takes a long time", function(done: DoneFn) { setTimeout(function() { done(); }, 9000); }, 10000); - afterEach(function(done) { + afterEach(function(done: DoneFn) { done(); }, 1000); }); diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 4fa5a7adef..aa3acdfbf8 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -11,29 +11,36 @@ declare function fdescribe(description: string, specDefinitions: () => void): vo declare function xdescribe(description: string, specDefinitions: () => void): void; declare function it(expectation: string, assertion?: () => void, timeout?: number): void; -declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; -declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; -declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; +declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ declare function pending(reason?: string): void; declare function beforeEach(action: () => void, timeout?: number): void; -declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; +declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; declare function afterEach(action: () => void, timeout?: number): void; -declare function afterEach(action: (done: () => void) => void, timeout?: number): void; +declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; declare function beforeAll(action: () => void, timeout?: number): void; -declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; +declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; declare function afterAll(action: () => void, timeout?: number): void; -declare function afterAll(action: (done: () => void) => void, timeout?: number): void; +declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; declare function expect(spy: Function): jasmine.Matchers; declare function expect(actual: any): jasmine.Matchers; declare function fail(e?: any): void; +/** Action method that should be called when the async work is complete */ +interface DoneFn extends Function { + (): void; + + /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */ + fail: (message?: Error|string) => void; +} declare function spyOn(object: any, method: string): jasmine.Spy; From 7612f0e546c8429dc0c2a561f0ef5e2b7a6bccae Mon Sep 17 00:00:00 2001 From: Vitor Buzinaro Date: Tue, 12 Apr 2016 10:45:59 -0300 Subject: [PATCH 18/94] Updated node-mssql to v3.2.1 (#8893) * Updated node-mssql to v3.2.1 According to https://github.com/patriksimek/node-mssql#2x-to-3x-changes, updated the definitions. * Update mssql.d.ts * Update mssql.d.ts --- mssql/mssql.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mssql/mssql.d.ts b/mssql/mssql.d.ts index 500be24b86..166c3b80ac 100644 --- a/mssql/mssql.d.ts +++ b/mssql/mssql.d.ts @@ -1,6 +1,6 @@ -// Type definitions for mssql v2.2.0 +// Type definitions for mssql v3.1.0 // Project: https://www.npmjs.com/package/mssql -// Definitions by: COLSA Corporation , Ben Farr +// Definitions by: COLSA Corporation , Ben Farr , Vitor Buzinaro // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -199,14 +199,14 @@ declare module "mssql" { public constructor(transaction: Transaction); public constructor(preparedStatement: PreparedStatement); public execute(procedure: string): Promise; - public execute(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any) => void): void; + public execute(procedure: string, callback: (err?: any, recordsets?: Entity[], returnValue?: any, rowsAffected?: number) => void): void; public input(name: string, value: any): void; public input(name: string, type: any, value: any): void; public output(name: string, type: any, value?: any): void; public pipe(stream: NodeJS.WritableStream): void; public query(command: string): Promise; public query(command: string): Promise; - public query(command: string, callback: (err?: any, recordset?: any) => void): void; + public query(command: string, callback: (err?: any, recordset?: any, rowsAffected?: number) => void): void; public query(command: string, callback: (err?: any, recordset?: Entity[]) => void): void; public batch(batch: string): Promise; public batch(batch: string): Promise; @@ -258,7 +258,7 @@ declare module "mssql" { public prepare(statement?: string, callback?: (err?: any) => void): void; public execute(values: Object): Promise; public execute(values: Object): Promise; - public execute(values: Object, callback: (err: any, recordSet: recordSet) => void): void; + public execute(values: Object, callback: (err: any, recordSet: recordSet, rowsAffected: number) => void): void; public execute(values: Object, callback: (err: any, recordSet: Entity[]) => void): void; public unprepare(): Promise; public unprepare(callback: (err?: any) => void): void; From bf263437d0c2354f1599e6951d3d27c0508b0491 Mon Sep 17 00:00:00 2001 From: mmmichl Date: Tue, 12 Apr 2016 15:47:57 +0200 Subject: [PATCH 19/94] Introduce `unfoundState` type from `$stateNotFound` event (#8894) --- angular-ui-router/angular-ui-router-tests.ts | 11 +++++++++++ angular-ui-router/angular-ui-router.d.ts | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/angular-ui-router/angular-ui-router-tests.ts b/angular-ui-router/angular-ui-router-tests.ts index ba42f16cf4..9c5db1754a 100644 --- a/angular-ui-router/angular-ui-router-tests.ts +++ b/angular-ui-router/angular-ui-router-tests.ts @@ -141,6 +141,8 @@ class UrlLocatorTestService implements IUrlLocatorTestService { private $state: ng.ui.IStateService ) { $rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event)); + $rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) => + this.onStateNotFound(event, unfoundState, fromState, fromParams)); } public currentUser: any; @@ -162,6 +164,15 @@ class UrlLocatorTestService implements IUrlLocatorTestService { }); } } + + private onStateNotFound(event: ng.IAngularEvent, + unfoundState: ng.ui.IUnfoundState, + fromState: ng.ui.IState, + fromParams: {}) { + var unfoundTo: string = unfoundState.to; + var unfoundToParams: {} = unfoundState.toParams; + var unfoundOptions: ng.ui.IStateOptions = unfoundState.options + } private stateServiceTest() { this.$state.go("myState"); diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 17d1570983..0512528097 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -100,6 +100,12 @@ declare namespace angular.ui { cache?: boolean; } + interface IUnfoundState { + to: string, + toParams: {}, + options: IStateOptions + } + interface IStateProvider extends angular.IServiceProvider { state(name:string, config:IState): IStateProvider; state(config:IState): IStateProvider; From abccfd43094624e270fd2d98ad9d012d354b9d50 Mon Sep 17 00:00:00 2001 From: Valentin Robert Date: Tue, 12 Apr 2016 06:54:32 -0700 Subject: [PATCH 20/94] partition's thisArg should be optional (#8895) --- rx/rx.coincidence-lite.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rx/rx.coincidence-lite.d.ts b/rx/rx.coincidence-lite.d.ts index e99eae3b4a..f754f1b38f 100644 --- a/rx/rx.coincidence-lite.d.ts +++ b/rx/rx.coincidence-lite.d.ts @@ -29,6 +29,6 @@ declare namespace Rx { * An array of observables. The first triggers when the predicate returns true, * and the second triggers when the predicate returns false. */ - partition(predicate: (value: T, index: number, source: Observable) => boolean, thisArg: any): Observable[]; + partition(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable[]; } } From c128c346bb24c070b9f4bdbdc979d5e33d3a3dff Mon Sep 17 00:00:00 2001 From: M Clark Date: Tue, 12 Apr 2016 21:56:02 +0800 Subject: [PATCH 21/94] Added react-tagcloud (#8899) --- react-tagcloud/react-tagcloud-tests.tsx | 102 ++++++++++++++++++++++++ react-tagcloud/react-tagcloud.d.ts | 43 ++++++++++ 2 files changed, 145 insertions(+) create mode 100644 react-tagcloud/react-tagcloud-tests.tsx create mode 100644 react-tagcloud/react-tagcloud.d.ts diff --git a/react-tagcloud/react-tagcloud-tests.tsx b/react-tagcloud/react-tagcloud-tests.tsx new file mode 100644 index 0000000000..76a0328670 --- /dev/null +++ b/react-tagcloud/react-tagcloud-tests.tsx @@ -0,0 +1,102 @@ +/// +/// +/// + + +// simple cloud +import * as React from "react"; +import * as ReactDOM from "react-dom"; +import {TagCloud, DefaultRenderer} from "react-tagcloud"; + +let data = [ + { value: "jQuery", count: 25 }, { value: "MongoDB", count: 18 }, + { value: "JavaScript", count: 38 }, { value: "React", count: 30 }, + { value: "Nodejs", count: 28 }, { value: "Express.js", count: 25 }, + { value: "HTML5", count: 33 }, { value: "CSS3", count: 20 } +]; + +ReactDOM.render( + // minSize, maxSize - font size in px + // tags - array of objects with properties value and count + // shuffle - indicates if data should be shuffled (true by default) + // onClick event handler has `tag` and `event` parameter + console.log("clicking on tag:", tag)} />, + document.getElementById("simple-cloud") +); + + + +// default-renderer + +// DefaultRenderer creates default renderer implementation with custom options +// usage of tagRenderer option is described in ./custom-tag-renderer.js + +// custom props will be applied on each tag component +const props = { + style: {border: "1px solid silver", padding: "5px"}, + className: "my-tag-class" +}; + +// custom random color options +// see randomColor package: https://github.com/davidmerfield/randomColor +const colorOptions = { + luminosity: "light", + hue: "blue" +}; + +let customizedDefaultRenderer = new DefaultRenderer({ props, colorOptions }); + +ReactDOM.render( + , + document.getElementById("default-renderer") +); +// +// custom-renderer.js +// using custom renderer the default renderer will be overriden + +// custom renderer is function which takes tag, computed font size and +// elemnt key as arguments, and returns react component +let customRenderer2 = (tag: any, size: number, key: string|number) => { + return {tag.value}; +}; + +ReactDOM.render( + , + document.getElementById("custom-renderer") +); + + +// example from custom-tag-renderer.js +let data2 = [ + { value: { name: "google", link: "http://google.com" }, count: 25 }, + { value: { name: "yahoo", link: "http://yahoo.com" }, count: 18 }, + { value: { name: "facebook", link: "http://facebook.com" }, count: 38 }, + { value: { name: "twitter", link: "http://twitter.com" }, count: 30 }, + { value: { name: "github", link: "http://github.com" }, count: 28 }, + { value: { name: "npmjs", link: "http://npmjs.com" }, count: 25 }, + { value: { name: "stackoverflow", link: "http://stackoverflow.com" }, count: 33 } +]; + +// with tagRenderer option it is possible to customize rendering of each tag +// tagRender is a function which takes tag as argument and returns react component or simple string +const tagRenderer = (tag: any) => ({tag.value.name}); + +const customizedDefaultRenderer4 = new DefaultRenderer({ tagRenderer }); + +ReactDOM.render( + , + document.getElementById("custom-tag-renderer") +); diff --git a/react-tagcloud/react-tagcloud.d.ts b/react-tagcloud/react-tagcloud.d.ts new file mode 100644 index 0000000000..4049070893 --- /dev/null +++ b/react-tagcloud/react-tagcloud.d.ts @@ -0,0 +1,43 @@ +// Type definitions for react-tagcloud v0.4.0 +// Project: https://github.com/madox2/react-tagcloud +// Definitions by: wassname +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ReactTagCloud { + interface TagCloudProps extends __React.Props { + tags: any[]; + maxSize: number; + minSize: number; + shuffle?: boolean; + renderer?: Function; + className?: string; + onClick?: Function; + } + interface TagCloudClass extends __React.ComponentClass { } + + interface DefaultRendererFactoryOptions { + tagRenderer?: Function; + colorOptions?: any; + props?: any; + } + interface RendererFunction { + (tag: any, size: number, key: string | number, handlers: any): any; + } + interface DefaultRendererFactory { + new (_ref?: DefaultRendererFactoryOptions): RendererFunction; + (_ref?: DefaultRendererFactoryOptions): RendererFunction; + } +} + + +// export = TagCloud +declare module reactTagCloud { + const TagCloud: ReactTagCloud.TagCloudClass; + const DefaultRenderer: ReactTagCloud.DefaultRendererFactory; +} + +declare module "react-tagcloud" { + export = reactTagCloud +} From 4841fd3b361dcd3c3ff9dd31ddc415fc2dab0c92 Mon Sep 17 00:00:00 2001 From: Michael Zlatkovsky Date: Tue, 12 Apr 2016 06:59:16 -0700 Subject: [PATCH 22/94] Fixing a few API set annotations in Office-js.d.ts (#8892) Fixed api set annotations on half-a-dozen methods that were erroneously labeled as 1.1, whereas they really belong the the 1.2 set. --- office-js/office-js.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/office-js/office-js.d.ts b/office-js/office-js.d.ts index ff4065fa17..6761ab646c 100644 --- a/office-js/office-js.d.ts +++ b/office-js/office-js.d.ts @@ -2142,7 +2142,7 @@ declare namespace Excel { * * @param across Set true to merge cells in each row of the specified range as separate merged cells. The default value is false. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ merge(across?: boolean): void; /** @@ -2156,7 +2156,7 @@ declare namespace Excel { * * Unmerge the range cells into separate cells. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ unmerge(): void; /** @@ -2473,14 +2473,14 @@ declare namespace Excel { * * Clears all the filters currently applied on the table. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ clearFilters(): void; /** * * Converts the table into a normal range of cells. All data is preserved. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ convertToRange(): Excel.Range; /** @@ -2522,7 +2522,7 @@ declare namespace Excel { * * Reapplies all the filters currently on the table. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ reapplyFilters(): void; /** @@ -2835,14 +2835,14 @@ declare namespace Excel { * * Changes the width of the columns of the current range to achieve the best fit, based on the current data in the columns. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ autofitColumns(): void; /** * * Changes the height of the rows of the current range to achieve the best fit, based on the current data in the columns. * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ autofitRows(): void; /** @@ -3221,7 +3221,7 @@ declare namespace Excel { * @param width (Optional) The desired width of the resulting image. * @param fittingMode (Optional) The method used to scale the chart to the specified to the specified dimensions (if both height and width are set)." * - * [Api set: ExcelApi 1.1] + * [Api set: ExcelApi 1.2] */ getImage(width?: number, height?: number, fittingMode?: string): OfficeExtension.ClientResult; /** From 92b2c03c297b8c5c7c2c7e169134da61f8abee6a Mon Sep 17 00:00:00 2001 From: Dawid Krajewski Date: Tue, 12 Apr 2016 16:01:10 +0200 Subject: [PATCH 23/94] add declare module "nouislider" (#8905) --- nouislider/nouislider.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nouislider/nouislider.d.ts b/nouislider/nouislider.d.ts index 14fb8717f8..b3bd58c727 100644 --- a/nouislider/nouislider.d.ts +++ b/nouislider/nouislider.d.ts @@ -174,3 +174,7 @@ declare namespace noUiSlider { noUiSlider: noUiSlider } } + +declare module "nouislider" { + export = noUiSlider; +} From abe95c4057f17d02e2cd72c292e85143640b2e2a Mon Sep 17 00:00:00 2001 From: Giedrius Grabauskas Date: Tue, 12 Apr 2016 17:04:48 +0300 Subject: [PATCH 24/94] Added Filesize definitions (#8908) * filesize definition file added. * Updated filesize definition. * Added SiJedec type to suffixes * Created filesize tests file. * Added definition file reference in tests. --- filesize/filesize-tests.ts | 15 +++++++ filesize/filesize.d.ts | 84 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 filesize/filesize-tests.ts create mode 100644 filesize/filesize.d.ts diff --git a/filesize/filesize-tests.ts b/filesize/filesize-tests.ts new file mode 100644 index 0000000000..185dfb0720 --- /dev/null +++ b/filesize/filesize-tests.ts @@ -0,0 +1,15 @@ +/// + +import filesize = require("filesize"); + +filesize(500); // "500 B" +filesize(500, { bits: true }); // "4 Kb" +filesize(265318, { base: 10 }); // "265.32 kB" +filesize(265318); // "259.1 KB" +filesize(265318, { round: 0 }); // "259 KB" +filesize(265318, { output: "array" }); // [259.1, "KB"] +filesize(265318, { output: "object" }); // {value: 259.1, suffix: "KB", symbol: "KB"} +filesize(1, { symbols: { B: "Б" } }); // "1 Б" +filesize(1024); // "1 KB" +filesize(1024, { exponent: 0 }); // "1024 B" +filesize(1024, { output: "exponent" }); // 1 diff --git a/filesize/filesize.d.ts b/filesize/filesize.d.ts new file mode 100644 index 0000000000..2ac4de6e05 --- /dev/null +++ b/filesize/filesize.d.ts @@ -0,0 +1,84 @@ +// Type definitions for filesize 3.2.1 +// Project: https://github.com/avoidwork/filesize.js +// Definitions by: Giedrius Grabauskas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Filesize { + + export interface SiJedecBits { + b?: string; + Kb?: string; + Mb?: string; + Gb?: string; + Tb?: string; + Pb?: string; + Eb?: string; + Zb?: string; + Yb?: string; + } + + export interface SiJedecBytes { + B?: string; + KB?: string; + MB?: string; + GB?: string; + TB?: string; + PB?: string; + EB?: string; + ZB?: string; + YB?: string; + } + + type SiJedec = SiJedecBits & SiJedecBytes & { [name: string]: string }; + + export interface Options { + /** + * Enables bit sizes, default is false + */ + bits?: boolean; + /** + * Number base, default is 2 + */ + base?: number; + /** + * Decimal place, default is 2 + */ + round?: number; + /** + * Output of function (array, exponent, object, or string), default is string + */ + output?: string; + /** + * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found + * @deprecated: use 'symbols' + */ + suffixes?: SiJedec; + /** + * Dictionary of SI/JEDEC symbols to replace for localization, defaults to english if no match is found + */ + symbols?: SiJedec; + /** + * Specifies the SI suffix via exponent, e.g. 2 is MB for bytes, default is -1 + */ + exponent?: number; + /** + * Enables unix style human readable output, e.g ls -lh, default is false + */ + unix?: boolean; + /** + * Character between the result and suffix, default is " " + */ + spacer?: string; + } + + export interface IFilesize { + (bytes: number): string; + (bytes: number, options: Options): string; + } +} + + +declare module "filesize" { + let fileSize: Filesize.IFilesize; + export = fileSize; +} From c02da04ba08bda99d2625ec99570a633d2ff1872 Mon Sep 17 00:00:00 2001 From: Kevin Visscher Date: Tue, 12 Apr 2016 16:10:28 +0200 Subject: [PATCH 25/94] Allow import statement from Typescript (#8911) --- chartist/chartist.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chartist/chartist.d.ts b/chartist/chartist.d.ts index ca2b4206d8..6c679dc1d8 100644 --- a/chartist/chartist.d.ts +++ b/chartist/chartist.d.ts @@ -557,3 +557,7 @@ declare namespace Chartist { } declare var Chartist: Chartist.ChartistStatic; + +declare module 'chartist' { + export = Chartist; +} From 10d69f9da63bdf18b802bd34fc528294ec340f86 Mon Sep 17 00:00:00 2001 From: szmeti Date: Tue, 12 Apr 2016 16:14:02 +0200 Subject: [PATCH 26/94] Missing loglevel public API methods added (#8914) --- loglevel/loglevel-tests.ts | 10 ++++++++++ loglevel/loglevel.d.ts | 40 +++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/loglevel/loglevel-tests.ts b/loglevel/loglevel-tests.ts index ab19939569..ca1ebc1664 100644 --- a/loglevel/loglevel-tests.ts +++ b/loglevel/loglevel-tests.ts @@ -16,6 +16,11 @@ log.setLevel("error", false); log.setLevel(LogLevel.WARN); log.setLevel(LogLevel.WARN, false); +log.enableAll(false); +log.enableAll(); +log.disableAll(true); +log.disableAll(); + var logLevel = log.getLevel(); var testLogger = log.getLogger("TestLogger"); @@ -26,3 +31,8 @@ testLogger.warn("logging test"); var logging = log.noConflict(); logging.error("still pretty easy"); + +log.methodFactory = function(methodName: string, level: LogLevel, loggerName :string) { + return function(...messages: any[]) { + }; +}; \ No newline at end of file diff --git a/loglevel/loglevel.d.ts b/loglevel/loglevel.d.ts index 0d8352c652..7ccbe89c33 100644 --- a/loglevel/loglevel.d.ts +++ b/loglevel/loglevel.d.ts @@ -1,6 +1,6 @@ // Type definitions for loglevel 1.4.0 // Project: https://github.com/pimterry/loglevel -// Definitions by: Stefan Profanter , Florian Wagner +// Definitions by: Stefan Profanter , Florian Wagner , Gabor Szmetanko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -15,8 +15,28 @@ declare const enum LogLevel { SILENT = 5 } +interface LoggingMethod { + + (...message : any[]):void; + +} + +interface MethodFactory { + + (methodName : string, level : LogLevel, loggerName : string):LoggingMethod; + +} + interface Log { + /** + * Plugin API entry point. This will be called for each enabled method each time the level is set + * (including initially), and should return a MethodFactory to be used for the given log method, at the given level, + * for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's + * recommended that this wraps the initially provided value of log.methodFactory + */ + methodFactory:MethodFactory; + /** * Output trace message to console. * This will also include a full stack trace @@ -135,6 +155,24 @@ interface Log { */ getLogger(name : String):Log; + /** + * This enables all log messages, and is equivalent to log.setLevel("trace"). + * + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + enableAll(persist? : boolean):void; + + /** + * This disables all log messages, and is equivalent to log.setLevel("silent"). + * + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling + * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + disableAll(persist? : boolean):void; + } declare var log : Log; From b6e28f381b1f30bedafcafd4d703d920d260146d Mon Sep 17 00:00:00 2001 From: Alexander Surinov Date: Tue, 12 Apr 2016 17:14:59 +0300 Subject: [PATCH 27/94] Update definition of Flatten method in chain. (#8901) --- underscore/underscore.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 7c88662149..5952cdea6e 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -39,7 +39,7 @@ declare module _ { * Default value is '/<%-([\s\S]+?)%>/g'. **/ escape?: RegExp; - + /** * By default, 'template()' places the values from your data in the local scope via the 'with' statement. * However, you can specify a single variable name with this setting. @@ -5908,7 +5908,7 @@ interface _ChainSingle { value(): T; } interface _ChainOfArrays extends _Chain { - flatten(): _Chain; + flatten(shallow?: boolean): _Chain; } declare var _: UnderscoreStatic; From 85701ac79cabedfef7ea7caffc1b4ee5425ff711 Mon Sep 17 00:00:00 2001 From: Valentin Robert Date: Tue, 12 Apr 2016 07:17:06 -0700 Subject: [PATCH 28/94] RxJS: resultSelector is optional in combineLatest (#8917) --- rx/rx-lite.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rx/rx-lite.d.ts b/rx/rx-lite.d.ts index ce7a2c6ea7..e155493064 100644 --- a/rx/rx-lite.d.ts +++ b/rx/rx-lite.d.ts @@ -572,10 +572,12 @@ declare namespace Rx { catchError(...sources: Observable[]): Observable; // alias for catch catchError(...sources: IPromise[]): Observable; // alias for catch + combineLatest(first: Observable, second: Observable): Observable<[T, T2]>; combineLatest(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; combineLatest(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; combineLatest(first: Observable, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; combineLatest(first: IPromise, second: IPromise, resultSelector: (v1: T, v2: T2) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable): Observable<[T, T2, T3]>; combineLatest(first: Observable, second: Observable, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; combineLatest(first: Observable, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; combineLatest(first: Observable, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; @@ -584,6 +586,7 @@ declare namespace Rx { combineLatest(first: IPromise, second: Observable, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; combineLatest(first: IPromise, second: IPromise, third: Observable, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; combineLatest(first: IPromise, second: IPromise, third: IPromise, resultSelector: (v1: T, v2: T2, v3: T3) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable): Observable<[T, T2, T3, T4]>; combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; combineLatest(first: Observable, second: Observable, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; combineLatest(first: Observable, second: Observable, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; @@ -600,9 +603,11 @@ declare namespace Rx { combineLatest(first: IPromise, second: IPromise, third: Observable, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; combineLatest(first: IPromise, second: IPromise, third: IPromise, fourth: IPromise, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4) => TResult): Observable; + combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable): Observable<[T, T2, T3, T4, T5]>; combineLatest(first: Observable, second: Observable, third: Observable, fourth: Observable, fifth: Observable, resultSelector: (v1: T, v2: T2, v3: T3, v4: T4, v5: T5) => TResult): Observable; - combineLatest(souces: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; - combineLatest(souces: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; + combineLatest(sources: Observable[]): Observable; + combineLatest(sources: Observable[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; + combineLatest(sources: IPromise[], resultSelector: (...otherValues: TOther[]) => TResult): Observable; withLatestFrom(first: Observable, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; withLatestFrom(first: IPromise, second: Observable, resultSelector: (v1: T, v2: T2) => TResult): Observable; From 94ce78cb0106d45d3bfe2824be1721146cc754f8 Mon Sep 17 00:00:00 2001 From: Isman Usoh Date: Tue, 12 Apr 2016 21:17:59 +0700 Subject: [PATCH 29/94] declare namespace ExpressUseragent (#8918) * declare namespace ExpressUseragent - declare namespace ExpressUseragent - fix error Import declaration conflicts with local declaration of 'express' * Update express-useragent.d.ts * Update express-useragent.d.ts --- express-useragent/express-useragent.d.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/express-useragent/express-useragent.d.ts b/express-useragent/express-useragent.d.ts index 4ea3d91d73..ddf8fdf13f 100644 --- a/express-useragent/express-useragent.d.ts +++ b/express-useragent/express-useragent.d.ts @@ -6,7 +6,16 @@ /// declare namespace Express { - interface ExpressUserAgent { + + interface Request { + useragent?: ExpressUseragent.UserAgent; + } +} + +declare namespace ExpressUseragent { + import express = Express; + + interface UserAgent { isMobile: boolean; isTablet: boolean; isiPad: boolean; @@ -55,14 +64,10 @@ declare namespace Express { source: string; } - interface Request { - useragent?: ExpressUserAgent; - } + function parse(source: string): UserAgent; + function express(): (req: express.Request, res: express.Response, next?: Function) => void; } declare module "express-useragent" { - import express = require("express"); - - export function parse(source: string): Express.ExpressUserAgent; - export function express(): (req: express.Request, res: express.Response, next?: Function) => void; + export = ExpressUseragent; } From 484e00f72f5572ffaea7cbbf8bcb02ae90ec9bd4 Mon Sep 17 00:00:00 2001 From: trevj Date: Tue, 12 Apr 2016 10:20:33 -0400 Subject: [PATCH 30/94] Node.js Buffer should be useable as a Uint8Array and is missing a constructor (#8919) * make NodeBuffer extend Uint8Array * add missing Buffer(ArrayBuffer) constructor * add TODOs for missing Buffer methods --- node/node-tests.ts | 7 +++++++ node/node.d.ts | 17 ++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index 66c4256caf..0cc0b5de6c 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -138,6 +138,7 @@ function bufferTests() { var base64Buffer = new Buffer('','base64'); var octets: Uint8Array = null; var octetBuffer = new Buffer(octets); + var sharedBuffer = new Buffer(octets.buffer); var copiedBuffer = new Buffer(utf8Buffer); console.log(Buffer.isBuffer(octetBuffer)); console.log(Buffer.isEncoding('utf8')); @@ -181,6 +182,12 @@ function bufferTests() { let sb = new ImportedSlowBuffer(43); b.writeUInt8(0, 6); } + + // Buffer has Uint8Array's buffer field (an ArrayBuffer). + { + let buffer = new Buffer('123'); + let octets = new Uint8Array(buffer.buffer); + } } diff --git a/node/node.d.ts b/node/node.d.ts index 66e9a935f7..1b2da31c94 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -108,6 +108,14 @@ declare var Buffer: { * @param array The octets to store. */ new (array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + new (arrayBuffer: ArrayBuffer): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * @@ -382,12 +390,10 @@ declare namespace NodeJS { /** * @deprecated */ -interface NodeBuffer { - [index: number]: number; +interface NodeBuffer extends Uint8Array { write(string: string, offset?: number, length?: number, encoding?: string): number; toString(encoding?: string, start?: number, end?: number): string; toJSON(): any; - length: number; equals(otherBuffer: Buffer): boolean; compare(otherBuffer: Buffer): number; copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; @@ -429,7 +435,12 @@ interface NodeBuffer { writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; fill(value: any, offset?: number, end?: number): Buffer; + // TODO: encoding param indexOf(value: string | number | Buffer, byteOffset?: number): number; + // TODO: entries + // TODO: includes + // TODO: keys + // TODO: values } /************************************************ From 22d18908f72fe750986a874c4bae59634bed41d7 Mon Sep 17 00:00:00 2001 From: Kevin Visscher Date: Tue, 12 Apr 2016 16:21:16 +0200 Subject: [PATCH 31/94] Add option that can be set for CircleMarker (#8912) --- leaflet/leaflet.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 6c487c3ebe..37abb90fb1 100644 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3383,6 +3383,11 @@ declare namespace L { */ className?: string; + /** + * Sets the radius of a circle marker. + */ + radius?: number; + } } From e684481e0cd360db62fd6213ca7248245315e8a2 Mon Sep 17 00:00:00 2001 From: Ken Howard Date: Tue, 12 Apr 2016 07:22:09 -0700 Subject: [PATCH 32/94] Return typed definition from toJSON method (#8859) * Return typed definition from toJSON method * Test toJSON returns IMyResource --- angularjs/angular-resource-tests.ts | 4 +--- angularjs/angular-resource.d.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index 5a9963b14c..89f6d25a26 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -98,9 +98,7 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () { var promise : angular.IPromise; var arrayPromise : angular.IPromise; -var json: { - [index: string]: any; -}; +var json: IMyResource; promise = resource.$delete(); promise = resource.$delete({ key: 'value' }); diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index caae65ccb2..0fb9351342 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -153,9 +153,7 @@ declare namespace angular.resource { /** the promise of the original server interaction that created this instance. **/ $promise : angular.IPromise; $resolved : boolean; - toJSON: () => { - [index: string]: any; - } + toJSON(): T; } /** From f5b469b012f515428f9643ef31395282481031d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=BD=C3=A1k?= Date: Tue, 12 Apr 2016 18:22:23 +0400 Subject: [PATCH 33/94] Update http-status to 0.2.1 (#8920) --- http-status/http-status-tests.ts | 4 ++++ http-status/http-status.d.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/http-status/http-status-tests.ts b/http-status/http-status-tests.ts index 8717e99c3a..12971578fb 100644 --- a/http-status/http-status-tests.ts +++ b/http-status/http-status-tests.ts @@ -39,7 +39,9 @@ str = httpStatus[414]; str = httpStatus[415]; str = httpStatus[416]; str = httpStatus[417]; +str = httpStatus[422]; str = httpStatus[429]; +str = httpStatus[451]; str = httpStatus[500]; str = httpStatus[501]; str = httpStatus[502]; @@ -82,7 +84,9 @@ nmr = httpStatus.REQUEST_URI_TOO_LONG; nmr = httpStatus.UNSUPPORTED_MEDIA_TYPE; nmr = httpStatus.REQUESTED_RANGE_NOT_SATISFIABLE; nmr = httpStatus.EXPECTATION_FAILED; +nmr = httpStatus.UNPROCESSABLE_ENTITY; nmr = httpStatus.TOO_MANY_REQUESTS; +nmr = httpStatus.UNAVAILABLE_FOR_LEGAL_REASONS; nmr = httpStatus.INTERNAL_SERVER_ERROR; nmr = httpStatus.NOT_IMPLEMENTED; nmr = httpStatus.BAD_GATEWAY; diff --git a/http-status/http-status.d.ts b/http-status/http-status.d.ts index d3b12582e4..4beb5aed83 100644 --- a/http-status/http-status.d.ts +++ b/http-status/http-status.d.ts @@ -1,4 +1,4 @@ -// Type definitions for http-status v0.1.8 +// Type definitions for http-status v0.2.1 // Project: https://github.com/wdavidw/node-http-status // Definitions by: Michael Zabka // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -38,7 +38,9 @@ interface HttpStatus { 415: string; 416: string; 417: string; + 422: string; 429: string; + 451: string; 500: string; 501: string; 502: string; @@ -79,7 +81,9 @@ interface HttpStatus { UNSUPPORTED_MEDIA_TYPE: number; REQUESTED_RANGE_NOT_SATISFIABLE: number; EXPECTATION_FAILED: number; + UNPROCESSABLE_ENTITY: number; TOO_MANY_REQUESTS: number; + UNAVAILABLE_FOR_LEGAL_REASONS: number; INTERNAL_SERVER_ERROR: number; NOT_IMPLEMENTED: number; BAD_GATEWAY: number; From 29db5e426cb068704694d53505f17da22e0d8f8f Mon Sep 17 00:00:00 2001 From: Linda_pp Date: Wed, 13 Apr 2016 00:03:52 +0900 Subject: [PATCH 34/94] Add rebass (#8925) * Add type definitions for 'rebass' module https://github.com/jxnblk/rebass * Add tests for rebass.d.ts --- rebass/rebass-tests.tsx | 625 ++++++++++++++++++++++++++++++++++++++++ rebass/rebass.d.ts | 497 ++++++++++++++++++++++++++++++++ 2 files changed, 1122 insertions(+) create mode 100644 rebass/rebass-tests.tsx create mode 100644 rebass/rebass.d.ts diff --git a/rebass/rebass-tests.tsx b/rebass/rebass-tests.tsx new file mode 100644 index 0000000000..e933d3c43f --- /dev/null +++ b/rebass/rebass-tests.tsx @@ -0,0 +1,625 @@ +/// + +import * as React from "react"; +import { + Arrow + , Avatar + , Badge + , Banner + , Block + , Blockquote + , Breadcrumbs + , Button + , ButtonCircle + , ButtonOutline + , Card + , CardImage + , Checkbox + , Close + , Container + , Divider + , Donut + , DotIndicator + , Drawer + , Dropdown + , DropdownMenu + , Embed + , Fixed + , Footer + , Heading + , HeadingLink + , InlineForm + , Input + , Label + , LinkBlock + , Media + , Menu + , Message + , NavItem + , Overlay + , PageHeader + , Panel + , PanelFooter + , PanelHeader + , Pre + , Progress + , Radio + , Rating + , Section + , SectionHeader + , Select + , SequenceMap + , SequenceMapStep + , Slider + , Space + , Stat + , Switch + , Table + , Text + , Textarea + , Toolbar + , Tooltip +} from "rebass"; + +interface IconProps extends React.Props { + fill: string; + height: string; + name: string; + width: string; +} + +class Icon extends React.Component { + render() { + return
; + } +} + +class RebassTest extends React.Component<{}, {}> { + render() { + return
+ + + + +
+ + Rebass + + + + 0.2.0 + + + + Pill + + + + Pill + + + + Circular + + + + 4 + +
+ + + + Rebass + + + + + + + Block + + + Generic box for containing things + + + + +
+ In the sixteenth century, a series of common sizes developed among European typographers, and the series survived with little change and few additions for 400 years. […] Use the old familiar scale, or use new scales of your own devising, but limit yourself, at first, to a modest set of distinct and related intervals. +
+ + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + Example Icon component from react-geomicons + +
+ +
+ + Button + + + Group + + +
+ + + + + Card + + + Cats like cards too + + + +
+ +
+ +
+ + +
+ + + + + Container + + +
+ + +
+ +
+ + + 9/16 + + + +
+ +
+ +
+ + + + + + Hello + + + Hi + + + + + +