From 4e00b9e8dc11eef0b7ef4bd2f1bbfb91f3e2cc2f Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Thu, 12 May 2016 22:24:49 +0100 Subject: [PATCH 001/105] Update to version 2.20.4 Update methods from node-validator (https://github.com/chriso/validator.js) and update express-validator methods to adhere to the latest api. --- express-validator/express-validator-tests.ts | 14 +- express-validator/express-validator.d.ts | 136 ++++++++++++------- 2 files changed, 99 insertions(+), 51 deletions(-) diff --git a/express-validator/express-validator-tests.ts b/express-validator/express-validator-tests.ts index 74bd277e46..ebd61d6cfc 100644 --- a/express-validator/express-validator-tests.ts +++ b/express-validator/express-validator-tests.ts @@ -15,19 +15,23 @@ app.post('/:urlparam', function(req: express.Request, res: express.Response) { // Similarly checkParams only checks in req.params (URL params) and // checkQuery only checks req.query (GET params). req.checkBody('postparam', 'Invalid postparam').notEmpty().isInt(); - req.checkParams('urlparam', 'Invalid urlparam').isAlpha(); + req.checkParams('urlparam', 'Invalid urlparam').isAlpha().matches(/test?/i).matches('test?', 'i'); req.checkQuery('getparam', 'Invalid getparam').isInt(); - req.checkHeader('testHeader', 'Invalid testHeader').isLowercase().isUppercase(); - req.checkFiles('testFiles', 'Invalid testFiles').isUrl(); - + req.checkHeaders('testHeader', 'Invalid testHeader').isLowercase().isUppercase(); + req.checkFiles('testFiles', 'Invalid testFiles').isURL(); // OR assert can be used to check on all 3 types of params. // req.assert('postparam', 'Invalid postparam').notEmpty().isInt(); // req.assert('urlparam', 'Invalid urlparam').isAlpha(); // req.assert('getparam', 'Invalid getparam').isInt(); - req.sanitize('postparam').toBoolean(); req.filter('postparam').toBoolean(); + req.sanitize('postparam').blacklist('t').blacklist(['']).whitelist('hello').whitelist(['h', 'e', 'l']); + req.sanitizeBody('postvar').trim().stripLow().escape(); + req.sanitizeQuery('queryvar').toDate(); + req.sanitizeParams('urlparam').toFloat().toInt().toInt(10); + req.sanitizeHeaders('header').normalizeEmail(); + var errors = req.validationErrors(); var mappedErrors = req.validationErrors(true); diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index 52792a391f..cb15aebf8f 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -1,9 +1,10 @@ -// Type definitions for express-validator 2.9.0 +// Type definitions for express-validator 2.20.4 // Project: https://github.com/ctavan/express-validator -// Definitions by: Nathan Ridley , Jonathan Häberle +// Definitions by: Nathan Ridley , Jonathan Häberle , Peter Harris // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +/// // Add RequestValidation Interface on to Express's Request Interface. declare namespace Express { @@ -31,25 +32,33 @@ declare namespace ExpressValidator { param: string; } - interface ValidatorFunction { (item: string, message: string): Validator; } + interface ValidatorFunction { (item: string | {}, message?: string): Validator; } + interface ValidatorExtraFunction extends ValidatorFunction { (matchIndex: number, message?: string): Validator; }; interface SanitizerFunction { (item: string): Sanitizer; } interface Dictionary { [key: string]: T; } export interface RequestValidation { - assert: ValidatorFunction; - check: ValidatorFunction; + assert: ValidatorExtraFunction; + validate: ValidatorExtraFunction; + check: ValidatorExtraFunction; checkBody: ValidatorFunction; checkFiles: ValidatorFunction; - checkHeader: ValidatorFunction; + checkHeaders: ValidatorFunction; checkParams: ValidatorFunction; checkQuery: ValidatorFunction; - validate: ValidatorFunction; - + filter: SanitizerFunction; sanitize: SanitizerFunction; - + sanitizeBody: SanitizerFunction; + sanitizeQuery: SanitizerFunction; + sanitizeParams: SanitizerFunction; + sanitizeHeaders: SanitizerFunction; + onValidationError(errback: (msg: string) => void): void; - validationErrors(mapped?: boolean): Dictionary | any[]; + validationErrors(mapped?: boolean): Dictionary | MappedError[]; + validationErrors(mapped?: boolean): Dictionary | T[]; + asyncValidationErrors(mapped?: boolean): Promise>; + asyncValidationErrors(mapped?: boolean): Promise>; } export interface Validator { @@ -61,12 +70,13 @@ declare namespace ExpressValidator { * Alias for notRegex() */ not(): Validator; - isEmail(): Validator; + isEmail(options?:{}): Validator; /** * Accepts http, https, ftp */ - isUrl(): Validator; - + isURL(): Validator; + isFQDN(options?: MinMaxOptions): Validator; + /** * Combines isIPv4 and isIPv6 */ @@ -74,8 +84,21 @@ declare namespace ExpressValidator { isIPv4(): Validator; isIPv6(): Validator; isMACAddress(): Validator; - isAlpha(): Validator; - isAlphanumeric(): Validator; + isISBN(version?: number): Validator; + isISIN(): Validator; + isISO8601(): Validator; + isMobilePhone(locale: string): Validator; + isMongoId(): Validator; + isMultibyte(): Validator; + isAlpha(locale?: string): Validator; + isAlphanumeric(locale?: string): Validator; + isAscii(): Validator; + isBase64(): Validator; + isBoolean(): Validator; + isByteLength(options: MinMaxOptions): Validator; + isCurrency(options: {}): Validator; + isDataURI(): Validator; + isDivisibleBy(num: number): Validator; isNumeric(): Validator; isHexadecimal(): Validator; /** @@ -85,7 +108,7 @@ declare namespace ExpressValidator { /** * isNumeric accepts zero padded numbers, e.g. '001', isInt doesn't */ - isInt(): Validator; + isInt(options?: MinMaxOptions): Validator; isLowercase(): Validator; isUppercase(): Validator; isDecimal(): Validator; @@ -93,10 +116,13 @@ declare namespace ExpressValidator { * Alias for isDecimal */ isFloat(): Validator; + isFullWidth(): Validator; + isHalfWidth(): Validator; + isVariableWidth(): Validator; /** * Check if length is 0 */ - notNull(): Validator; + //notNull(): Validator; // I don't see this in the documentation or code anywhere. isNull(): Validator; /** * Not just whitespace (input.trim().length !== 0) @@ -104,12 +130,14 @@ declare namespace ExpressValidator { notEmpty(): Validator; equals(equals:any): Validator; contains(str:string): Validator; - notContains(str:string): Validator; + //notContains(str:string): Validator; // I don't see this in the documentation or code anywhere. + matches(pattern:string, modifiers?:string): Validator; + matches(pattern: RegExp): Validator; /** * Usage: regex(/[a-z]/i) or regex('[a-z]','i') */ - regex(pattern:string, modifiers:string): Validator; - notRegex(pattern:string, modifiers:string): Validator; + //regex(pattern:string, modifiers:string): Validator; // I don't see this in the documentation or code anywhere. + //notRegex(pattern:string, modifiers:string): Validator; // I don't see this in the documentation or code anywhere. /** * max is optional */ @@ -117,7 +145,7 @@ declare namespace ExpressValidator { /** * Version can be 3, 4 or 5 or empty, see http://en.wikipedia.org/wiki/Universally_unique_identifier */ - isUUID(version:number): Validator; + isUUID(version?:number): Validator; /** * Alias for isUUID(3) */ @@ -137,17 +165,20 @@ declare namespace ExpressValidator { /** * Argument is optional and defaults to today. Comparison is non-inclusive */ - isAfter(date:Date): Validator; + isAfter(date?:Date): Validator; /** * Argument is optional and defaults to today. Comparison is non-inclusive */ - isBefore(date:Date): Validator; + isBefore(date?:Date): Validator; isIn(options:string): Validator; isIn(options:string[]): Validator; notIn(options:string): Validator; notIn(options:string[]): Validator; max(val:string): Validator; min(val:string): Validator; + isJSON(): Validator; + isLength(options: MinMaxOptions): Validator; + isWhitelisted(chars: string); /** * Will work against Visa, MasterCard, American Express, Discover, Diners Club, and JCB card numbering formats */ @@ -155,7 +186,10 @@ declare namespace ExpressValidator { /** * Check an input only when the input exists */ - optional(): Validator; + isSurrogatePar(): Validator; + + optional(options?: { checkFalsy?: boolean }): Validator; + withMessage(message: string): Validator; } interface Sanitizer { @@ -165,40 +199,50 @@ declare namespace ExpressValidator { trim(...chars:string[]): Sanitizer; ltrim(...chars:string[]): Sanitizer; rtrim(...chars:string[]): Sanitizer; - ifNull(replace:any): Sanitizer; + stripLow(keep_new_lines?: boolean): Sanitizer; + //ifNull(replace:any): Sanitizer; // I don't see this in the documentation or code anywhere. toFloat(): Sanitizer; - toInt(): Sanitizer; + toInt(radix?: number): Sanitizer; /** - * True unless str = '0', 'false', or str.length == 0 - */ - toBoolean(): Sanitizer; - /** - * False unless str = '1' or 'true' - */ - toBooleanStrict(): Sanitizer; - /** - * Decode HTML entities + * True unless str = '0', 'false', or str.length == 0. In strict mode only '1' and 'true' return true. */ + toBoolean(strict?: boolean): Sanitizer; /** - * Convert the input string to a date, or null if the input is not a date. - */ - toDate(): Sanitizer; - - entityDecode(): Sanitizer; - entityEncode(): Sanitizer; + * Convert the input string to a date, or null if the input is not a date. + */ + toDate(): Sanitizer; + /** * Escape &, <, >, and " */ escape(): Sanitizer; + /** - * Remove common XSS attack vectors from user-supplied HTML + * Replaces HTML encoded entities with <, >, &, ', " and /. */ - xss(): Sanitizer; + unescape(): Sanitizer; + + blacklist(chars: string): Sanitizer; + blacklist(chars: string[]): Sanitizer; + whitelist(chars: string): Sanitizer; + whitelist(chars: string[]): Sanitizer; + + normalizeEmail(options?: { lowercase?: boolean; remove_dots?: boolean; remove_extensions?: boolean }): Sanitizer; + /** - * Remove common XSS attack vectors from images + * !!! XSS sanitization was removed from the library (see: https://github.com/chriso/validator.js#xss-sanitization) */ - xss(fromImages:boolean): Sanitizer; } - + + interface MappedError { + param: string; + msg: string; + value: string; + } + + interface MinMaxOptions { + min?: number; + max?: number; + } } From 396e37eb8b17cace44ba2bce0f2aa59a88d17fd0 Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Thu, 12 May 2016 22:38:26 +0100 Subject: [PATCH 002/105] Remove ambient semicolon --- express-validator/express-validator.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index cb15aebf8f..583ffbf6e8 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -33,7 +33,7 @@ declare namespace ExpressValidator { } interface ValidatorFunction { (item: string | {}, message?: string): Validator; } - interface ValidatorExtraFunction extends ValidatorFunction { (matchIndex: number, message?: string): Validator; }; + interface ValidatorExtraFunction extends ValidatorFunction { (matchIndex: number, message?: string): Validator; } interface SanitizerFunction { (item: string): Sanitizer; } interface Dictionary { [key: string]: T; } From 10bc473fe57df9c5acb2926faf785ece99beb37f Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Thu, 12 May 2016 22:44:39 +0100 Subject: [PATCH 003/105] Add return type to isWhitelisted method. --- express-validator/express-validator.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index 583ffbf6e8..71797efce2 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -178,7 +178,7 @@ declare namespace ExpressValidator { min(val:string): Validator; isJSON(): Validator; isLength(options: MinMaxOptions): Validator; - isWhitelisted(chars: string); + isWhitelisted(chars: string): Validator; /** * Will work against Visa, MasterCard, American Express, Discover, Diners Club, and JCB card numbering formats */ From c8d5f64ef86cd7c3227bef1d412c034db8bbaf6d Mon Sep 17 00:00:00 2001 From: Gayan Ranasinghe Date: Mon, 4 Jul 2016 16:20:28 +0530 Subject: [PATCH 004/105] added some fields --- kendo-ui/kendo-ui.d.ts | 1425 ++++++++++++++++++++-------------------- 1 file changed, 717 insertions(+), 708 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 934a8cd8b1..b8aea8a61a 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -3,7 +3,7 @@ // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// + declare namespace kendo { function culture(): { @@ -89,40 +89,10 @@ declare namespace kendo { }; }; - var cultures: {[culture: string] : { - name?: string; - calendar?: { - AM: string[]; - PM: string[]; - days: { - names: string[]; - namesAbbr: string[]; - namesShort: string[]; - firstDay: number; - }; - months: { - names: string[]; - namesAbbr: string[]; - }; - patterns: { - D: string; - F: string; - G: string; - M: string; - T: string; - Y: string; - d: string; - g: string; - m: string; - s: string; - t: string; - u: string; - y: string; - }; - twoDigitYearMax: number; - }; - calendars?: { - standard: { + var cultures: { + [culture: string]: { + name?: string; + calendar?: { AM: string[]; PM: string[]; days: { @@ -152,25 +122,57 @@ declare namespace kendo { }; twoDigitYearMax: number; }; - }; - numberFormat?: { - currency: { + calendars?: { + standard: { + AM: string[]; + PM: string[]; + days: { + names: string[]; + namesAbbr: string[]; + namesShort: string[]; + firstDay: number; + }; + months: { + names: string[]; + namesAbbr: string[]; + }; + patterns: { + D: string; + F: string; + G: string; + M: string; + T: string; + Y: string; + d: string; + g: string; + m: string; + s: string; + t: string; + u: string; + y: string; + }; + twoDigitYearMax: number; + }; + }; + numberFormat?: { + currency: { + decimals: number; + groupSize: number[]; + pattern: string[]; + symbol: string; + }; decimals: number; groupSize: number[]; pattern: string[]; - symbol: string; + percent: { + decimals: number; + groupSize: number[]; + pattern: string[]; + symbol: string; + }; }; - decimals: number; - groupSize: number[]; - pattern: string[]; - percent: { - decimals: number; - groupSize: number[]; - pattern: string[]; - symbol: string; - }; - }; - }}; + } + }; function format(format: string, ...values: any[]): string; @@ -300,7 +302,7 @@ declare namespace kendo { } class ViewContainer extends Observable { - view: View; + view: View; } class Layout extends View { @@ -488,8 +490,8 @@ declare namespace kendo.data { change(e: Object): void; start(source: kendo.Observable): void; stop(source: kendo.Observable): void; - get (): any; - set (value: any): void; + get(): any; + set(value: any): void; destroy(): void; } @@ -500,7 +502,7 @@ declare namespace kendo.data { } class EventBinding extends Binding { - get (): void; + get(): void; } class TemplateBinding extends Binding { @@ -508,7 +510,8 @@ declare namespace kendo.data { render(value: Object): string; } - namespace binders { } + module binders { } + export var binders; interface Bindings { [key: string]: Binding; @@ -531,7 +534,7 @@ declare namespace kendo.data { interface BinderOptions { } - class ObservableObject extends Observable{ + class ObservableObject extends Observable { constructor(value?: any); uid: string; init(value?: any): void; @@ -571,6 +574,8 @@ declare namespace kendo.data { isAllDay?: boolean; id?: any; start?: Date; + ownerId?: number; + taskId?: number; startTimezone?: string; recurrenceId?: any; recurrenceRule?: string; @@ -583,7 +588,8 @@ declare namespace kendo.data { static fields: DataSourceSchemaModelFields; constructor(data?: SchedulerEventData); - + ownerId: number; + taskId: number; description: string; end: Date; endTimezone: string; @@ -839,7 +845,7 @@ declare namespace kendo.data { columns: PivotSchemaColumnAxis; } - interface PivotSchema extends DataSourceSchema{ + interface PivotSchema extends DataSourceSchema { axes?: any; catalogs?: any; cubes?: any; @@ -948,7 +954,7 @@ declare namespace kendo.data { } interface DataSourceSchemaWithConstructorModel extends DataSourceSchema { - model?: typeof Model; + model?: typeof Model; } interface DataSourceSchemaModel { @@ -996,7 +1002,7 @@ declare namespace kendo.data { every(callback: (item: Object, index: number, source: ObservableArray) => boolean): boolean; filter(callback: (item: Object, index: number, source: ObservableArray) => boolean): any[]; find(callback: (item: Object, index: number, source: ObservableArray) => boolean): any; - forEach(callback: (item: Object, index: number, source: ObservableArray) => void ): void; + forEach(callback: (item: Object, index: number, source: ObservableArray) => void): void; indexOf(item: any): number; join(separator: string): string; map(callback: (item: Object, index: number, source: ObservableArray) => any): any[]; @@ -1022,7 +1028,7 @@ declare namespace kendo.data { items?: kendo.data.Model[]; } - class DataSource extends Observable{ + class DataSource extends Observable { options: DataSourceOptions; static create(options?: DataSourceOptions): DataSource; @@ -1242,7 +1248,7 @@ declare namespace kendo.data { sort?: any; transport?: DataSourceTransport; type?: string; - change? (e: DataSourceChangeEvent): void; + change?(e: DataSourceChangeEvent): void; error?(e: DataSourceErrorEvent): void; sync?(e: DataSourceEvent): void; requestStart?(e: DataSourceRequestStartEvent): void; @@ -1325,7 +1331,7 @@ declare namespace kendo.ui { function plugin(widget: typeof kendo.ui.Widget, register?: typeof kendo.dataviz.ui, prefix?: String): void; function plugin(widget: any, register?: typeof kendo.dataviz.ui, prefix?: String): void; - class Draggable extends kendo.ui.Widget{ + class Draggable extends kendo.ui.Widget { element: JQuery; currentTarget: JQuery; constructor(element: Element, options?: DraggableOptions); @@ -1336,7 +1342,7 @@ declare namespace kendo.ui { sender?: Draggable; } - class DropTarget extends kendo.ui.Widget{ + class DropTarget extends kendo.ui.Widget { element: JQuery; constructor(element: Element, options?: DropTargetOptions); options: DropTargetOptions; @@ -1366,7 +1372,7 @@ declare namespace kendo.ui { draggable?: kendo.ui.Draggable; } - class DropTargetArea extends kendo.ui.Widget{ + class DropTargetArea extends kendo.ui.Widget { element: JQuery; constructor(element: Element, options?: DropTargetAreaOptions); options: DropTargetAreaOptions; @@ -1517,7 +1523,7 @@ declare namespace kendo.dataviz.map.layer { declare namespace kendo.drawing.pdf { function saveAs(group: kendo.drawing.Group, fileName: string, - proxyUrl?: string, callback?: Function): void; + proxyUrl?: string, callback?: Function): void; } declare namespace kendo.geometry { @@ -1690,7 +1696,7 @@ declare namespace kendo.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + constructor(origin: kendo.geometry.Point | any, size: kendo.geometry.Size | any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -1916,7 +1922,7 @@ declare namespace kendo.drawing { } - interface FillOptions { + interface FillOptions { @@ -2215,7 +2221,7 @@ declare namespace kendo.drawing { } - interface PDFOptions { + interface PDFOptions { @@ -2319,7 +2325,7 @@ declare namespace kendo.drawing { interface RadialGradientOptions { name?: string; - center?: any|kendo.geometry.Point; + center?: any | kendo.geometry.Point; radius?: number; stops?: any; } @@ -2403,7 +2409,7 @@ declare namespace kendo.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -2457,8 +2463,8 @@ declare namespace kendo.drawing { } interface SurfaceTooltip { - animation?: boolean|SurfaceTooltipAnimation; - appendTo?: string|JQuery; + animation?: boolean | SurfaceTooltipAnimation; + appendTo?: string | JQuery; } interface SurfaceOptions { @@ -2553,20 +2559,20 @@ declare namespace kendo.drawing { } - interface TooltipOptions { + interface TooltipOptions { autoHide?: boolean; - content?: string|Function; + content?: string | Function; position?: string; - height?: number|string; + height?: number | string; hideDelay?: number; offset?: number; shared?: boolean; showAfter?: number; showOn?: string; - width?: number|string; + width?: number | string; @@ -2636,14 +2642,14 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; - animation?: boolean|AutoCompleteAnimation; - dataSource?: any|any|kendo.data.DataSource; + animation?: boolean | AutoCompleteAnimation; + dataSource?: any | any | kendo.data.DataSource; dataTextField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; + fixedGroupTemplate?: string | Function; + groupTemplate?: string | Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; @@ -2652,10 +2658,11 @@ declare namespace kendo.ui { popup?: any; separator?: string; suggest?: boolean; - headerTemplate?: string|Function; - template?: string|Function; + value?: any; + headerTemplate?: string | Function; + template?: string | Function; valuePrimitive?: boolean; - virtual?: boolean|AutoCompleteVirtual; + virtual?: boolean | AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; close?(e: AutoCompleteCloseEvent): void; dataBound?(e: AutoCompleteDataBoundEvent): void; @@ -2773,8 +2780,8 @@ declare namespace kendo.ui { culture?: string; dates?: any; depth?: string; - disableDates?: any|Function; - footer?: string|Function; + disableDates?: any | Function; + footer?: string | Function; format?: string; max?: Date; min?: Date; @@ -2821,7 +2828,7 @@ declare namespace kendo.ui { interface ColorPaletteOptions { name?: string; - palette?: string|any; + palette?: string | any; columns?: number; tileSize?: ColorPaletteTileSize; value?: string; @@ -2876,7 +2883,7 @@ declare namespace kendo.ui { columns?: number; tileSize?: ColorPickerTileSize; messages?: ColorPickerMessages; - palette?: string|any; + palette?: string | any; opacity?: boolean; preview?: boolean; toolIcon?: string; @@ -2976,14 +2983,14 @@ declare namespace kendo.ui { autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; + fixedGroupTemplate?: string | Function; + groupTemplate?: string | Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; @@ -2992,12 +2999,12 @@ declare namespace kendo.ui { placeholder?: string; popup?: ComboBoxPopup; suggest?: boolean; - headerTemplate?: string|Function; - template?: string|Function; + headerTemplate?: string | Function; + template?: string | Function; text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean|ComboBoxVirtual; + virtual?: boolean | ComboBoxVirtual; change?(e: ComboBoxChangeEvent): void; close?(e: ComboBoxCloseEvent): void; dataBound?(e: ComboBoxDataBoundEvent): void; @@ -3092,16 +3099,16 @@ declare namespace kendo.ui { interface ContextMenuOptions { name?: string; alignToAnchor?: boolean; - animation?: boolean|ContextMenuAnimation; + animation?: boolean | ContextMenuAnimation; closeOnClick?: boolean; - dataSource?: any|any; + dataSource?: any | any; direction?: string; filter?: string; hoverDelay?: number; orientation?: string; popupCollision?: string; showOn?: string; - target?: string|JQuery; + target?: string | JQuery; close?(e: ContextMenuCloseEvent): void; open?(e: ContextMenuOpenEvent): void; activate?(e: ContextMenuActivateEvent): void; @@ -3202,13 +3209,13 @@ declare namespace kendo.ui { interface DatePickerOptions { name?: string; - animation?: boolean|DatePickerAnimation; + animation?: boolean | DatePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; depth?: string; - disableDates?: any|Function; - footer?: string|Function; + disableDates?: any | Function; + footer?: string | Function; format?: string; max?: Date; min?: Date; @@ -3292,12 +3299,12 @@ declare namespace kendo.ui { interface DateTimePickerOptions { name?: string; - animation?: boolean|DateTimePickerAnimation; + animation?: boolean | DateTimePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; depth?: string; - disableDates?: any|Function; + disableDates?: any | Function; footer?: string; format?: string; interval?: number; @@ -3403,32 +3410,32 @@ declare namespace kendo.ui { interface DropDownListOptions { name?: string; - animation?: boolean|DropDownListAnimation; + animation?: boolean | DropDownListAnimation; autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; + fixedGroupTemplate?: string | Function; + groupTemplate?: string | Function; height?: number; ignoreCase?: boolean; index?: number; minLength?: number; popup?: DropDownListPopup; - optionLabel?: string|any; - optionLabelTemplate?: string|Function; - headerTemplate?: string|Function; - template?: string|Function; - valueTemplate?: string|Function; + optionLabel?: string | any; + optionLabelTemplate?: string | Function; + headerTemplate?: string | Function; + template?: string | Function; + valueTemplate?: string | Function; text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean|DropDownListVirtual; + virtual?: boolean | DropDownListVirtual; change?(e: DropDownListChangeEvent): void; close?(e: DropDownListCloseEvent): void; dataBound?(e: DropDownListDataBoundEvent): void; @@ -3550,32 +3557,32 @@ declare namespace kendo.ui { interface EditorFileBrowserTransportCreate { contentType?: string; - data?: any|string|Function; + data?: any | string | Function; dataType?: string; type?: string; - url?: string|Function; + url?: string | Function; } interface EditorFileBrowserTransportDestroy { contentType?: string; - data?: any|string|Function; + data?: any | string | Function; dataType?: string; type?: string; - url?: string|Function; + url?: string | Function; } interface EditorFileBrowserTransportRead { contentType?: string; - data?: any|string|Function; + data?: any | string | Function; dataType?: string; type?: string; - url?: string|Function; + url?: string | Function; } interface EditorFileBrowserTransport { read?: EditorFileBrowserTransportRead; uploadUrl?: string; - fileUrl?: string|Function; + fileUrl?: string | Function; destroy?: EditorFileBrowserTransportDestroy; create?: EditorFileBrowserTransportCreate; } @@ -3632,33 +3639,33 @@ declare namespace kendo.ui { interface EditorImageBrowserTransportCreate { contentType?: string; - data?: any|string|Function; + data?: any | string | Function; dataType?: string; type?: string; - url?: string|Function; + url?: string | Function; } interface EditorImageBrowserTransportDestroy { contentType?: string; - data?: any|string|Function; + data?: any | string | Function; dataType?: string; type?: string; - url?: string|Function; + url?: string | Function; } interface EditorImageBrowserTransportRead { contentType?: string; - data?: any|string|Function; + data?: any | string | Function; dataType?: string; type?: string; - url?: string|Function; + url?: string | Function; } interface EditorImageBrowserTransport { read?: EditorImageBrowserTransportRead; - thumbnailUrl?: string|Function; + thumbnailUrl?: string | Function; uploadUrl?: string; - imageUrl?: string|Function; + imageUrl?: string | Function; destroy?: EditorImageBrowserTransportDestroy; create?: EditorImageBrowserTransportCreate; } @@ -3747,15 +3754,15 @@ declare namespace kendo.ui { } interface EditorPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface EditorPdf { author?: string; - avoidLinks?: boolean|string; + avoidLinks?: boolean | string; creator?: string; date?: Date; fileName?: string; @@ -3763,7 +3770,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: EditorPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -3814,7 +3821,7 @@ declare namespace kendo.ui { messages?: EditorMessages; pasteCleanup?: EditorPasteCleanup; pdf?: EditorPdf; - resizable?: boolean|EditorResizable; + resizable?: boolean | EditorResizable; serialization?: EditorSerialization; stylesheets?: any; tools?: EditorTool[]; @@ -3930,7 +3937,7 @@ declare namespace kendo.ui { interface FilterMenuOptions { name?: string; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; extra?: boolean; field?: string; messages?: FilterMenuMessages; @@ -4034,7 +4041,7 @@ declare namespace kendo.ui { } interface GanttAssignments { - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataResourceIdField?: string; dataTaskIdField?: string; dataValueField?: string; @@ -4044,7 +4051,7 @@ declare namespace kendo.ui { field?: string; title?: string; format?: string; - width?: string|number; + width?: string | number; editable?: boolean; sortable?: boolean; } @@ -4055,7 +4062,7 @@ declare namespace kendo.ui { interface GanttEditable { confirmation?: boolean; - template?: string|Function; + template?: string | Function; } interface GanttMessagesActions { @@ -4102,15 +4109,15 @@ declare namespace kendo.ui { } interface GanttPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface GanttPdf { author?: string; - avoidLinks?: boolean|string; + avoidLinks?: boolean | string; creator?: string; date?: Date; fileName?: string; @@ -4118,7 +4125,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: GanttPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -4128,31 +4135,31 @@ declare namespace kendo.ui { interface GanttResources { dataFormatField?: string; dataColorField?: string; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataTextField?: string; field?: string; } interface GanttToolbarItem { name?: string; - template?: string|Function; + template?: string | Function; text?: string; } interface GanttTooltip { - template?: string|Function; + template?: string | Function; visible?: boolean; } interface GanttView { type?: string; selected?: boolean; - slotSize?: number|string; - timeHeaderTemplate?: string|Function; - dayHeaderTemplate?: string|Function; - weekHeaderTemplate?: string|Function; - monthHeaderTemplate?: string|Function; - yearHeaderTemplate?: string|Function; + slotSize?: number | string; + timeHeaderTemplate?: string | Function; + dayHeaderTemplate?: string | Function; + weekHeaderTemplate?: string | Function; + monthHeaderTemplate?: string | Function; + yearHeaderTemplate?: string | Function; resizeTooltipFormat?: string; } @@ -4162,10 +4169,10 @@ declare namespace kendo.ui { autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GanttColumn[]; - currentTimeMarker?: boolean|GanttCurrentTimeMarker; - dataSource?: any|any|kendo.data.GanttDataSource; - dependencies?: any|any|kendo.data.GanttDependencyDataSource; - editable?: boolean|GanttEditable; + currentTimeMarker?: boolean | GanttCurrentTimeMarker; + dataSource?: any | any | kendo.data.GanttDataSource; + dependencies?: any | any | kendo.data.GanttDependencyDataSource; + editable?: boolean | GanttEditable; navigatable?: boolean; workDayStart?: Date; workDayEnd?: Date; @@ -4173,20 +4180,20 @@ declare namespace kendo.ui { workWeekEnd?: number; hourSpan?: number; snap?: boolean; - height?: number|string; - listWidth?: string|number; + height?: number | string; + listWidth?: string | number; messages?: GanttMessages; pdf?: GanttPdf; resizable?: boolean; selectable?: boolean; showWorkDays?: boolean; showWorkHours?: boolean; - taskTemplate?: string|Function; + taskTemplate?: string | Function; toolbar?: GanttToolbarItem[]; tooltip?: GanttTooltip; views?: GanttView[]; resources?: GanttResources; - rowHeight?: number|string; + rowHeight?: number | string; dataBinding?(e: GanttDataBindingEvent): void; dataBound?(e: GanttDataBoundEvent): void; add?(e: GanttAddEvent): void; @@ -4380,7 +4387,7 @@ declare namespace kendo.ui { } interface GridAllowCopy { - delimeter?: string|any; + delimeter?: string | any; } interface GridColumnMenuMessages { @@ -4416,7 +4423,7 @@ declare namespace kendo.ui { } interface GridColumnFilterableCell { - dataSource?: any|kendo.data.DataSource; + dataSource?: any | kendo.data.DataSource; dataTextField?: string; delay?: number; inputWidth?: number; @@ -4431,13 +4438,13 @@ declare namespace kendo.ui { interface GridColumnFilterable { cell?: GridColumnFilterableCell; multi?: boolean; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; checkAll?: boolean; itemTemplate?: Function; operators?: any; search?: boolean; ignoreCase?: boolean; - ui?: string|Function; + ui?: string | Function; } interface GridColumnSortable { @@ -4451,35 +4458,36 @@ declare namespace kendo.ui { command?: GridColumnCommandItem[]; encoded?: boolean; field?: string; - filterable?: boolean|GridColumnFilterable; + filterable?: boolean | GridColumnFilterable; footerAttributes?: any; - footerTemplate?: string|Function; + footerTemplate?: string | Function; format?: string; groupable?: boolean; - groupHeaderTemplate?: string|Function; - groupFooterTemplate?: string|Function; + groupHeaderTemplate?: string | Function; + groupFooterTemplate?: string | Function; headerAttributes?: any; - headerTemplate?: string|Function; + headerTemplate?: string | Function; hidden?: boolean; locked?: boolean; lockable?: boolean; minScreenWidth?: number; - sortable?: boolean|GridColumnSortable; - template?: string|Function; + sortable?: boolean | GridColumnSortable; + template?: string | Function; title?: string; - width?: string|number; + width?: string | number; values?: any; menu?: boolean; + type?: any; } interface GridEditable { - confirmation?: boolean|string|Function; + confirmation?: boolean | string | Function; cancelDelete?: string; confirmDelete?: string; createAt?: string; destroy?: boolean; mode?: string; - template?: string|Function; + template?: string | Function; update?: boolean; window?: any; } @@ -4592,7 +4600,7 @@ declare namespace kendo.ui { } interface GridNoRecords { - template?: string|Function; + template?: string | Function; } interface GridPageableMessages { @@ -4615,23 +4623,23 @@ declare namespace kendo.ui { numeric?: boolean; buttonCount?: number; input?: boolean; - pageSizes?: boolean|any; + pageSizes?: boolean | any; refresh?: boolean; info?: boolean; messages?: GridPageableMessages; } interface GridPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface GridPdf { allPages?: boolean; author?: string; - avoidLinks?: boolean|string; + avoidLinks?: boolean | string; creator?: string; date?: Date; fileName?: string; @@ -4639,7 +4647,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: GridPdfMargin; - paperSize?: string|any; + paperSize?: string | any; template?: string; repeatHeaders?: boolean; scale?: number; @@ -4660,38 +4668,38 @@ declare namespace kendo.ui { interface GridToolbarItem { name?: string; - template?: string|Function; + template?: string | Function; text?: string; } interface GridOptions { name?: string; - allowCopy?: boolean|GridAllowCopy; - altRowTemplate?: string|Function; + allowCopy?: boolean | GridAllowCopy; + altRowTemplate?: string | Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; - columnMenu?: boolean|GridColumnMenu; - dataSource?: any|any|kendo.data.DataSource; - detailTemplate?: string|Function; - editable?: boolean|GridEditable; + columnMenu?: boolean | GridColumnMenu; + dataSource?: any | any | kendo.data.DataSource; + detailTemplate?: string | Function; + editable?: boolean | GridEditable; excel?: GridExcel; - filterable?: boolean|GridFilterable; - groupable?: boolean|GridGroupable; - height?: number|string; + filterable?: boolean | GridFilterable; + groupable?: boolean | GridGroupable; + height?: number | string; messages?: GridMessages; - mobile?: boolean|string; + mobile?: boolean | string; navigatable?: boolean; - noRecords?: boolean|GridNoRecords; - pageable?: boolean|GridPageable; + noRecords?: boolean | GridNoRecords; + pageable?: boolean | GridPageable; pdf?: GridPdf; reorderable?: boolean; resizable?: boolean; - rowTemplate?: string|Function; - scrollable?: boolean|GridScrollable; - selectable?: boolean|string; - sortable?: boolean|GridSortable; - toolbar?: string | ((...args:any[]) => string) | GridToolbarItem[]; + rowTemplate?: string | Function; + scrollable?: boolean | GridScrollable; + selectable?: boolean | string; + sortable?: boolean | GridSortable; + toolbar?: string | ((...args: any[]) => string) | GridToolbarItem[]; cancel?(e: GridCancelEvent): void; change?(e: GridChangeEvent): void; columnHide?(e: GridColumnHideEvent): void; @@ -4865,10 +4873,10 @@ declare namespace kendo.ui { interface ListViewOptions { name?: string; autoBind?: boolean; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; editTemplate?: Function; navigatable?: boolean; - selectable?: boolean|string; + selectable?: boolean | string; template?: Function; altTemplate?: Function; cancel?(e: ListViewCancelEvent): void; @@ -5007,9 +5015,9 @@ declare namespace kendo.ui { interface MenuOptions { name?: string; - animation?: boolean|MenuAnimation; + animation?: boolean | MenuAnimation; closeOnClick?: boolean; - dataSource?: any|any; + dataSource?: any | any; direction?: string; hoverDelay?: number; openOnClick?: boolean; @@ -5114,17 +5122,17 @@ declare namespace kendo.ui { interface MultiSelectOptions { name?: string; - animation?: boolean|MultiSelectAnimation; + animation?: boolean | MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string|Function; - groupTemplate?: string|Function; + fixedGroupTemplate?: string | Function; + groupTemplate?: string | Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; @@ -5132,13 +5140,13 @@ declare namespace kendo.ui { maxSelectedItems?: number; placeholder?: string; popup?: MultiSelectPopup; - headerTemplate?: string|Function; - itemTemplate?: string|Function; + headerTemplate?: string | Function; + itemTemplate?: string | Function; tagTemplate?: string; tagMode?: string; value?: any; valuePrimitive?: boolean; - virtual?: boolean|MultiSelectVirtual; + virtual?: boolean | MultiSelectVirtual; change?(e: MultiSelectChangeEvent): void; close?(e: MultiSelectCloseEvent): void; dataBound?(e: MultiSelectDataBoundEvent): void; @@ -5227,16 +5235,16 @@ declare namespace kendo.ui { interface NotificationOptions { name?: string; allowHideAfter?: number; - animation?: any|boolean; - appendTo?: string|JQuery; + animation?: any | boolean; + appendTo?: string | JQuery; autoHideAfter?: number; button?: boolean; - height?: number|string; + height?: number | string; hideOnClick?: boolean; position?: NotificationPosition; stacking?: string; templates?: NotificationTemplate[]; - width?: number|string; + width?: number | string; hide?(e: NotificationHideEvent): void; show?(e: NotificationShowEvent): void; } @@ -5361,13 +5369,13 @@ declare namespace kendo.ui { name?: string; autoBind?: boolean; buttonCount?: number; - dataSource?: any|kendo.data.DataSource; + dataSource?: any | kendo.data.DataSource; selectTemplate?: string; linkTemplate?: string; info?: boolean; input?: boolean; numeric?: boolean; - pageSizes?: boolean|any; + pageSizes?: boolean | any; previousNext?: boolean; refresh?: boolean; messages?: PagerMessages; @@ -5475,9 +5483,9 @@ declare namespace kendo.ui { interface PanelBarOptions { name?: string; - animation?: boolean|PanelBarAnimation; + animation?: boolean | PanelBarAnimation; contentUrls?: any; - dataSource?: any|any; + dataSource?: any | any; expandMode?: string; activate?(e: PanelBarActivateEvent): void; collapse?(e: PanelBarCollapseEvent): void; @@ -5581,10 +5589,10 @@ declare namespace kendo.ui { interface PivotConfiguratorOptions { name?: string; - dataSource?: any|kendo.data.PivotDataSource; + dataSource?: any | kendo.data.PivotDataSource; filterable?: boolean; - sortable?: boolean|PivotConfiguratorSortable; - height?: number|string; + sortable?: boolean | PivotConfiguratorSortable; + height?: number | string; messages?: PivotConfiguratorMessages; } interface PivotConfiguratorEvent { @@ -5660,15 +5668,15 @@ declare namespace kendo.ui { } interface PivotGridPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface PivotGridPdf { author?: string; - avoidLinks?: boolean|string; + avoidLinks?: boolean | string; creator?: string; date?: Date; fileName?: string; @@ -5676,7 +5684,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: PivotGridPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -5689,20 +5697,20 @@ declare namespace kendo.ui { interface PivotGridOptions { name?: string; - dataSource?: any|kendo.data.PivotDataSource; + dataSource?: any | kendo.data.PivotDataSource; autoBind?: boolean; reorderable?: boolean; excel?: PivotGridExcel; pdf?: PivotGridPdf; filterable?: boolean; - sortable?: boolean|PivotGridSortable; + sortable?: boolean | PivotGridSortable; columnWidth?: number; - height?: number|string; - columnHeaderTemplate?: string|Function; - dataCellTemplate?: string|Function; - kpiStatusTemplate?: string|Function; - kpiTrendTemplate?: string|Function; - rowHeaderTemplate?: string|Function; + height?: number | string; + columnHeaderTemplate?: string | Function; + dataCellTemplate?: string | Function; + kpiStatusTemplate?: string | Function; + kpiTrendTemplate?: string | Function; + rowHeaderTemplate?: string | Function; messages?: PivotGridMessages; dataBinding?(e: PivotGridDataBindingEvent): void; dataBound?(e: PivotGridDataBoundEvent): void; @@ -5784,9 +5792,9 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; adjustSize?: any; - animation?: boolean|PopupAnimation; - anchor?: string|JQuery; - appendTo?: string|JQuery; + animation?: boolean | PopupAnimation; + anchor?: string | JQuery; + appendTo?: string | JQuery; collision?: string; origin?: string; position?: string; @@ -5889,6 +5897,7 @@ declare namespace kendo.ui { destroy(): void; enable(enable: boolean): void; value(): any; + values(): any; value(selectionStart: number, selectionEnd: number): void; resize(): void; @@ -6017,19 +6026,19 @@ declare namespace kendo.ui { } interface SchedulerEditable { - confirmation?: boolean|string; + confirmation?: boolean | string; create?: boolean; destroy?: boolean; editRecurringMode?: string; move?: boolean; resize?: boolean; - template?: string|Function; + template?: string | Function; update?: boolean; window?: any; } interface SchedulerFooter { - command?: string|boolean; + command?: string | boolean; } interface SchedulerGroup { @@ -6166,15 +6175,15 @@ declare namespace kendo.ui { } interface SchedulerPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface SchedulerPdf { author?: string; - avoidLinks?: boolean|string; + avoidLinks?: boolean | string; creator?: string; date?: Date; fileName?: string; @@ -6182,7 +6191,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: SchedulerPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -6191,7 +6200,7 @@ declare namespace kendo.ui { interface SchedulerResource { dataColorField?: string; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataTextField?: string; dataValueField?: string; field?: string; @@ -6216,26 +6225,26 @@ declare namespace kendo.ui { } interface SchedulerView { - allDayEventTemplate?: string|Function; + allDayEventTemplate?: string | Function; allDaySlot?: boolean; - allDaySlotTemplate?: string|Function; + allDaySlotTemplate?: string | Function; columnWidth?: number; - dateHeaderTemplate?: string|Function; - dayTemplate?: string|Function; - editable?: boolean|SchedulerViewEditable; + dateHeaderTemplate?: string | Function; + dayTemplate?: string | Function; + editable?: boolean | SchedulerViewEditable; endTime?: Date; eventHeight?: number; - eventTemplate?: string|Function; - eventTimeTemplate?: string|Function; + eventTemplate?: string | Function; + eventTimeTemplate?: string | Function; group?: SchedulerViewGroup; majorTick?: number; - majorTimeHeaderTemplate?: string|Function; + majorTimeHeaderTemplate?: string | Function; minorTickCount?: number; - minorTimeHeaderTemplate?: string|Function; + minorTimeHeaderTemplate?: string | Function; selected?: boolean; selectedDateFormat?: string; showWorkHours?: boolean; - slotTemplate?: string|Function; + slotTemplate?: string | Function; startTime?: Date; title?: string; type?: string; @@ -6253,27 +6262,27 @@ declare namespace kendo.ui { interface SchedulerOptions { name?: string; - allDayEventTemplate?: string|Function; + allDayEventTemplate?: string | Function; allDaySlot?: boolean; autoBind?: boolean; - currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; - dataSource?: any|any|kendo.data.SchedulerDataSource; + currentTimeMarker?: boolean | SchedulerCurrentTimeMarker; + dataSource?: any | any | kendo.data.SchedulerDataSource; date?: Date; - dateHeaderTemplate?: string|Function; - editable?: boolean|SchedulerEditable; + dateHeaderTemplate?: string | Function; + editable?: boolean | SchedulerEditable; endTime?: Date; - eventTemplate?: string|Function; - footer?: boolean|SchedulerFooter; + eventTemplate?: string | Function; + footer?: boolean | SchedulerFooter; group?: SchedulerGroup; - height?: number|string; + height?: number | string; majorTick?: number; - majorTimeHeaderTemplate?: string|Function; + majorTimeHeaderTemplate?: string | Function; max?: Date; messages?: SchedulerMessages; min?: Date; minorTickCount?: number; - minorTimeHeaderTemplate?: string|Function; - mobile?: boolean|string; + minorTimeHeaderTemplate?: string | Function; + mobile?: boolean | string; pdf?: SchedulerPdf; resources?: SchedulerResource[]; selectable?: boolean; @@ -6283,8 +6292,8 @@ declare namespace kendo.ui { timezone?: string; toolbar?: SchedulerToolbarItem[]; views?: SchedulerView[]; - groupHeaderTemplate?: string|Function; - width?: number|string; + groupHeaderTemplate?: string | Function; + width?: number | string; workDayStart?: Date; workDayEnd?: Date; workWeekStart?: number; @@ -6480,17 +6489,17 @@ declare namespace kendo.ui { name?: string; axis?: string; autoScroll?: boolean; - container?: string|JQuery; + container?: string | JQuery; connectWith?: string; cursor?: string; cursorOffset?: SortableCursorOffset; disabled?: string; filter?: string; handler?: string; - hint?: Function|string|JQuery; + hint?: Function | string | JQuery; holdToDrag?: boolean; ignore?: string; - placeholder?: Function|string|JQuery; + placeholder?: Function | string | JQuery; start?(e: SortableStartEvent): void; move?(e: SortableMoveEvent): void; end?(e: SortableEndEvent): void; @@ -6677,10 +6686,10 @@ declare namespace kendo.ui { } interface SpreadsheetPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface SpreadsheetPdf { @@ -6696,7 +6705,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: SpreadsheetPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -6720,7 +6729,7 @@ declare namespace kendo.ui { index?: number; logic?: string; type?: string; - value?: number|string|Date; + value?: number | string | Date; values?: any; } @@ -6778,7 +6787,7 @@ declare namespace kendo.ui { link?: string; textAlign?: string; underline?: boolean; - value?: number|string|boolean|Date; + value?: number | string | boolean | Date; validation?: SpreadsheetSheetRowCellValidation; verticalAlign?: string; wrap?: boolean; @@ -6816,9 +6825,9 @@ declare namespace kendo.ui { } interface SpreadsheetToolbar { - home?: boolean|any; - insert?: boolean|any; - data?: boolean|any; + home?: boolean | any; + insert?: boolean | any; + data?: boolean | any; } interface SpreadsheetInsertSheetOptions { @@ -6845,7 +6854,7 @@ declare namespace kendo.ui { rows?: number; sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; - toolbar?: boolean|SpreadsheetToolbar; + toolbar?: boolean | SpreadsheetToolbar; change?(e: SpreadsheetChangeEvent): void; render?(e: SpreadsheetRenderEvent): void; excelExport?(e: SpreadsheetExcelExportEvent): void; @@ -6871,7 +6880,7 @@ declare namespace kendo.ui { } interface SpreadsheetExcelImportEvent extends SpreadsheetEvent { - file?: Blob|File; + file?: Blob | File; progress?: JQueryPromise; } @@ -6971,18 +6980,18 @@ declare namespace kendo.ui { interface TabStripOptions { name?: string; - animation?: boolean|TabStripAnimation; + animation?: boolean | TabStripAnimation; collapsible?: boolean; contentUrls?: any; dataContentField?: string; dataContentUrlField?: string; dataImageUrlField?: string; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; dataSpriteCssClass?: string; dataTextField?: string; dataUrlField?: string; navigatable?: boolean; - scrollable?: boolean|TabStripScrollable; + scrollable?: boolean | TabStripScrollable; tabPosition?: string; value?: string; activate?(e: TabStripActivateEvent): void; @@ -7073,7 +7082,7 @@ declare namespace kendo.ui { interface TimePickerOptions { name?: string; - animation?: boolean|TimePickerAnimation; + animation?: boolean | TimePickerAnimation; culture?: string; dates?: any; format?: string; @@ -7179,13 +7188,13 @@ declare namespace kendo.ui { imageUrl?: string; menuButtons?: ToolBarItemMenuButton[]; overflow?: string; - overflowTemplate?: string|Function; + overflowTemplate?: string | Function; primary?: boolean; selected?: boolean; showIcon?: string; showText?: string; spriteCssClass?: string; - template?: string|Function; + template?: string | Function; text?: string; togglable?: boolean; toggle?: Function; @@ -7280,7 +7289,7 @@ declare namespace kendo.ui { interface TooltipOptions { name?: string; autoHide?: boolean; - animation?: boolean|TooltipAnimation; + animation?: boolean | TooltipAnimation; content?: TooltipContent; callout?: boolean; filter?: string; @@ -7505,7 +7514,7 @@ declare namespace kendo.ui { } interface TreeListColumnFilterable { - ui?: string|Function; + ui?: string | Function; } interface TreeListColumnSortable { @@ -7518,16 +7527,16 @@ declare namespace kendo.ui { encoded?: boolean; expandable?: boolean; field?: string; - filterable?: boolean|TreeListColumnFilterable; - footerTemplate?: string|Function; + filterable?: boolean | TreeListColumnFilterable; + footerTemplate?: string | Function; format?: string; headerAttributes?: any; - headerTemplate?: string|Function; + headerTemplate?: string | Function; minScreenWidth?: number; - sortable?: boolean|TreeListColumnSortable; - template?: string|Function; + sortable?: boolean | TreeListColumnSortable; + template?: string | Function; title?: string; - width?: string|number; + width?: string | number; hidden?: boolean; menu?: boolean; locked?: boolean; @@ -7537,7 +7546,7 @@ declare namespace kendo.ui { interface TreeListEditable { mode?: string; move?: boolean; - template?: string|Function; + template?: string | Function; window?: any; } @@ -7586,15 +7595,15 @@ declare namespace kendo.ui { } interface TreeListPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface TreeListPdf { author?: string; - avoidLinks?: boolean|string; + avoidLinks?: boolean | string; creator?: string; date?: Date; fileName?: string; @@ -7602,7 +7611,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: TreeListPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -7625,17 +7634,17 @@ declare namespace kendo.ui { columns?: TreeListColumn[]; resizable?: boolean; reorderable?: boolean; - columnMenu?: boolean|TreeListColumnMenu; - dataSource?: any|any|kendo.data.TreeListDataSource; - editable?: boolean|TreeListEditable; + columnMenu?: boolean | TreeListColumnMenu; + dataSource?: any | any | kendo.data.TreeListDataSource; + editable?: boolean | TreeListEditable; excel?: TreeListExcel; - filterable?: boolean|TreeListFilterable; - height?: number|string; + filterable?: boolean | TreeListFilterable; + height?: number | string; messages?: TreeListMessages; pdf?: TreeListPdf; - scrollable?: boolean|any; - selectable?: boolean|string; - sortable?: boolean|TreeListSortable; + scrollable?: boolean | any; + selectable?: boolean | string; + sortable?: boolean | TreeListSortable; toolbar?: TreeListToolbarItem[]; cancel?(e: TreeListCancelEvent): void; change?(e: TreeListChangeEvent): void; @@ -7850,14 +7859,14 @@ declare namespace kendo.ui { } interface TreeViewAnimation { - collapse?: boolean|TreeViewAnimationCollapse; - expand?: boolean|TreeViewAnimationExpand; + collapse?: boolean | TreeViewAnimationCollapse; + expand?: boolean | TreeViewAnimationExpand; } interface TreeViewCheckboxes { checkChildren?: boolean; name?: string; - template?: string|Function; + template?: string | Function; } interface TreeViewMessages { @@ -7868,19 +7877,19 @@ declare namespace kendo.ui { interface TreeViewOptions { name?: string; - animation?: boolean|TreeViewAnimation; + animation?: boolean | TreeViewAnimation; autoBind?: boolean; autoScroll?: boolean; - checkboxes?: boolean|TreeViewCheckboxes; + checkboxes?: boolean | TreeViewCheckboxes; dataImageUrlField?: string; - dataSource?: any|any|kendo.data.HierarchicalDataSource; + dataSource?: any | any | kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; - dataTextField?: string|any; + dataTextField?: string | any; dataUrlField?: string; dragAndDrop?: boolean; loadOnDemand?: boolean; messages?: TreeViewMessages; - template?: string|Function; + template?: string | Function; change?(e: TreeViewEvent): void; check?(e: TreeViewCheckEvent): void; collapse?(e: TreeViewCollapseEvent): void; @@ -8013,7 +8022,7 @@ declare namespace kendo.ui { localization?: UploadLocalization; multiple?: boolean; showFileList?: boolean; - template?: string|Function; + template?: string | Function; cancel?(e: UploadCancelEvent): void; complete?(e: UploadEvent): void; error?(e: UploadErrorEvent): void; @@ -8167,8 +8176,8 @@ declare namespace kendo.ui { } interface WindowPosition { - top?: number|string; - left?: number|string; + top?: number | string; + left?: number | string; } interface WindowRefreshOptions { @@ -8183,13 +8192,13 @@ declare namespace kendo.ui { interface WindowOptions { name?: string; actions?: any; - animation?: boolean|WindowAnimation; - appendTo?: any|string; + animation?: boolean | WindowAnimation; + appendTo?: any | string; autoFocus?: boolean; content?: WindowContent; draggable?: boolean; iframe?: boolean; - height?: number|string; + height?: number | string; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -8199,9 +8208,9 @@ declare namespace kendo.ui { position?: WindowPosition; resizable?: boolean; scrollable?: boolean; - title?: string|boolean; + title?: string | boolean; visible?: boolean; - width?: number|string; + width?: number | string; activate?(e: WindowEvent): void; close?(e: WindowCloseEvent): void; deactivate?(e: WindowEvent): void; @@ -8371,7 +8380,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartAxisDefaultsCrosshairTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -8399,7 +8408,7 @@ declare namespace kendo.dataviz.ui { interface ChartAxisDefaultsLabelsRotation { align?: string; - angle?: number|string; + angle?: number | string; } interface ChartAxisDefaultsLabels { @@ -8411,7 +8420,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartAxisDefaultsLabelsRotation; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; visual?: Function; } @@ -8549,7 +8558,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartCategoryAxisItemCrosshairTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -8591,7 +8600,7 @@ declare namespace kendo.dataviz.ui { interface ChartCategoryAxisItemLabelsRotation { align?: string; - angle?: number|string; + angle?: number | string; } interface ChartCategoryAxisItemLabels { @@ -8608,7 +8617,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartCategoryAxisItemLabelsRotation; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; visual?: Function; } @@ -8680,7 +8689,7 @@ declare namespace kendo.dataviz.ui { border?: ChartCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -8726,7 +8735,7 @@ declare namespace kendo.dataviz.ui { border?: ChartCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -8804,7 +8813,7 @@ declare namespace kendo.dataviz.ui { interface ChartCategoryAxisItem { autoBaseUnitSteps?: ChartCategoryAxisItemAutoBaseUnitSteps; - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; background?: string; baseUnit?: string; baseUnitStep?: any; @@ -8833,6 +8842,7 @@ declare namespace kendo.dataviz.ui { type?: string; visible?: boolean; weekStartDay?: number; + axisCrossingValues?: number[]; notes?: ChartCategoryAxisItemNotes; } @@ -8867,7 +8877,7 @@ declare namespace kendo.dataviz.ui { interface ChartLegendInactiveItemsLabels { color?: string; font?: string; - template?: string|Function; + template?: string | Function; } interface ChartLegendInactiveItems { @@ -8898,7 +8908,7 @@ declare namespace kendo.dataviz.ui { font?: string; margin?: ChartLegendLabelsMargin; padding?: ChartLegendLabelsPadding; - template?: string|Function; + template?: string | Function; } interface ChartLegendMargin { @@ -8996,10 +9006,10 @@ declare namespace kendo.dataviz.ui { } interface ChartPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface ChartPdf { @@ -9011,7 +9021,7 @@ declare namespace kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: ChartPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -9047,10 +9057,10 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemBorder { - color?: string|Function; - dashType?: string|Function; - opacity?: number|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + opacity?: number | Function; + width?: number | Function; } interface ChartSeriesItemConnectors { @@ -9065,26 +9075,26 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemErrorBars { - value?: string|number|any|Function; + value?: string | number | any | Function; visual?: Function; - xValue?: string|number|any|Function; - yValue?: string|number|any|Function; + xValue?: string | number | any | Function; + yValue?: string | number | any | Function; endCaps?: boolean; color?: string; line?: ChartSeriesItemErrorBarsLine; } interface ChartSeriesItemExtremesBorder { - color?: string|Function; - width?: number|Function; + color?: string | Function; + width?: number | Function; } interface ChartSeriesItemExtremes { - background?: string|Function; + background?: string | Function; border?: ChartSeriesItemExtremesBorder; - size?: number|Function; - type?: string|Function; - rotation?: number|Function; + size?: number | Function; + type?: string | Function; + rotation?: number | Function; } interface ChartSeriesItemHighlightBorder { @@ -9110,15 +9120,15 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface ChartSeriesItemLabelsFromBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface ChartSeriesItemLabelsFromMargin { @@ -9136,16 +9146,16 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsFrom { - background?: string|Function; + background?: string | Function; border?: ChartSeriesItemLabelsFromBorder; - color?: string|Function; - font?: string|Function; - format?: string|Function; + color?: string | Function; + font?: string | Function; + format?: string | Function; margin?: ChartSeriesItemLabelsFromMargin; padding?: ChartSeriesItemLabelsFromPadding; - position?: string|Function; - template?: string|Function; - visible?: boolean|Function; + position?: string | Function; + template?: string | Function; + visible?: boolean | Function; } interface ChartSeriesItemLabelsMargin { @@ -9163,9 +9173,9 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsToBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface ChartSeriesItemLabelsToMargin { @@ -9183,31 +9193,31 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsTo { - background?: string|Function; + background?: string | Function; border?: ChartSeriesItemLabelsToBorder; - color?: string|Function; - font?: string|Function; - format?: string|Function; + color?: string | Function; + font?: string | Function; + format?: string | Function; margin?: ChartSeriesItemLabelsToMargin; padding?: ChartSeriesItemLabelsToPadding; - position?: string|Function; - template?: string|Function; - visible?: boolean|Function; + position?: string | Function; + template?: string | Function; + visible?: boolean | Function; } interface ChartSeriesItemLabels { align?: string; - background?: string|Function; + background?: string | Function; border?: ChartSeriesItemLabelsBorder; - color?: string|Function; + color?: string | Function; distance?: number; - font?: string|Function; - format?: string|Function; + font?: string | Function; + format?: string | Function; margin?: ChartSeriesItemLabelsMargin; padding?: ChartSeriesItemLabelsPadding; - position?: string|Function; - template?: string|Function; - visible?: boolean|Function; + position?: string | Function; + template?: string | Function; + visible?: boolean | Function; visual?: Function; from?: ChartSeriesItemLabelsFrom; to?: ChartSeriesItemLabelsTo; @@ -9228,18 +9238,18 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemMarkersBorder { - color?: string|Function; - width?: number|Function; + color?: string | Function; + width?: number | Function; } interface ChartSeriesItemMarkers { - background?: string|Function; + background?: string | Function; border?: ChartSeriesItemMarkersBorder; - size?: number|Function; - type?: string|Function; - visible?: boolean|Function; + size?: number | Function; + type?: string | Function; + visible?: boolean | Function; visual?: Function; - rotation?: number|Function; + rotation?: number | Function; } interface ChartSeriesItemNegativeValues { @@ -9271,7 +9281,7 @@ declare namespace kendo.dataviz.ui { border?: ChartSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -9293,16 +9303,16 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemOutliersBorder { - color?: string|Function; - width?: number|Function; + color?: string | Function; + width?: number | Function; } interface ChartSeriesItemOutliers { - background?: string|Function; + background?: string | Function; border?: ChartSeriesItemOutliersBorder; - size?: number|Function; - type?: string|Function; - rotation?: number|Function; + size?: number | Function; + type?: string | Function; + rotation?: number | Function; } interface ChartSeriesItemOverlay { @@ -9315,18 +9325,18 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemTargetBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface ChartSeriesItemTargetLine { - width?: any|Function; + width?: any | Function; } interface ChartSeriesItemTarget { border?: ChartSeriesItemTargetBorder; - color?: string|Function; + color?: string | Function; line?: ChartSeriesItemTargetLine; } @@ -9349,23 +9359,23 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartSeriesItemTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } interface ChartSeriesItem { - aggregate?: string|Function; + aggregate?: string | Function; axis?: string; border?: ChartSeriesItemBorder; categoryField?: string; closeField?: string; - color?: string|Function; + color?: string | Function; colorField?: string; connectors?: ChartSeriesItemConnectors; currentField?: string; dashType?: string; data?: any; - downColor?: string|Function; + downColor?: string | Function; downColorField?: string; segmentSpacing?: number; summaryField?: string; @@ -9416,7 +9426,7 @@ declare namespace kendo.dataviz.ui { size?: number; sizeField?: string; spacing?: number; - stack?: boolean|ChartSeriesItemStack; + stack?: boolean | ChartSeriesItemStack; startAngle?: number; target?: ChartSeriesItemTarget; targetField?: string; @@ -9475,7 +9485,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsFromMargin; padding?: ChartSeriesDefaultsLabelsFromPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -9521,7 +9531,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsToMargin; padding?: ChartSeriesDefaultsLabelsToPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -9533,7 +9543,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsMargin; padding?: ChartSeriesDefaultsLabelsPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; visual?: Function; from?: ChartSeriesDefaultsLabelsFrom; @@ -9564,7 +9574,7 @@ declare namespace kendo.dataviz.ui { border?: ChartSeriesDefaultsNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -9611,7 +9621,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartSeriesDefaultsTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -9632,7 +9642,7 @@ declare namespace kendo.dataviz.ui { scatter?: any; scatterLine?: any; spacing?: number; - stack?: boolean|ChartSeriesDefaultsStack; + stack?: boolean | ChartSeriesDefaultsStack; type?: string; tooltip?: ChartSeriesDefaultsTooltip; verticalArea?: any; @@ -9695,8 +9705,8 @@ declare namespace kendo.dataviz.ui { opacity?: number; padding?: ChartTooltipPadding; shared?: boolean; - sharedTemplate?: string|Function; - template?: string|Function; + sharedTemplate?: string | Function; + template?: string | Function; visible?: boolean; } @@ -9720,7 +9730,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartValueAxisItemCrosshairTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -9754,7 +9764,7 @@ declare namespace kendo.dataviz.ui { interface ChartValueAxisItemLabelsRotation { align?: string; - angle?: number|string; + angle?: number | string; } interface ChartValueAxisItemLabels { @@ -9769,7 +9779,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartValueAxisItemLabelsRotation; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; visual?: Function; } @@ -9842,7 +9852,7 @@ declare namespace kendo.dataviz.ui { border?: ChartValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -9888,7 +9898,7 @@ declare namespace kendo.dataviz.ui { border?: ChartValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -9952,7 +9962,7 @@ declare namespace kendo.dataviz.ui { } interface ChartValueAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; background?: string; color?: string; crosshair?: ChartValueAxisItemCrosshair; @@ -9997,7 +10007,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartXAxisItemCrosshairTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -10039,7 +10049,7 @@ declare namespace kendo.dataviz.ui { interface ChartXAxisItemLabelsRotation { align?: string; - angle?: number|string; + angle?: number | string; } interface ChartXAxisItemLabels { @@ -10056,7 +10066,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartXAxisItemLabelsRotation; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; visual?: Function; } @@ -10128,7 +10138,7 @@ declare namespace kendo.dataviz.ui { border?: ChartXAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -10174,7 +10184,7 @@ declare namespace kendo.dataviz.ui { border?: ChartXAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -10238,7 +10248,7 @@ declare namespace kendo.dataviz.ui { } interface ChartXAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; background?: string; baseUnit?: string; color?: string; @@ -10285,7 +10295,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartYAxisItemCrosshairTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -10344,7 +10354,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartYAxisItemLabelsRotation; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; visual?: Function; } @@ -10416,7 +10426,7 @@ declare namespace kendo.dataviz.ui { border?: ChartYAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -10462,7 +10472,7 @@ declare namespace kendo.dataviz.ui { border?: ChartYAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -10526,7 +10536,7 @@ declare namespace kendo.dataviz.ui { } interface ChartYAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; background?: string; baseUnit?: string; color?: string; @@ -10562,8 +10572,8 @@ declare namespace kendo.dataviz.ui { } interface ChartZoomable { - mousewheel?: boolean|ChartZoomableMousewheel; - selection?: boolean|ChartZoomableSelection; + mousewheel?: boolean | ChartZoomableMousewheel; + selection?: boolean | ChartZoomableSelection; } interface ChartExportImageOptions { @@ -10596,13 +10606,13 @@ declare namespace kendo.dataviz.ui { interface ChartOptions { name?: string; autoBind?: boolean; - axisDefaults?: ChartAxisDefaults; + axisDefaults?: any; categoryAxis?: ChartCategoryAxisItem[]; + valueAxis?: ChartValueAxisItem[]; chartArea?: ChartChartArea; - dataSource?: any|any|kendo.data.DataSource; + dataSource?: any; legend?: ChartLegend; panes?: ChartPane[]; - pannable?: boolean|ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -10613,10 +10623,8 @@ declare namespace kendo.dataviz.ui { title?: ChartTitle; tooltip?: ChartTooltip; transitions?: boolean; - valueAxis?: ChartValueAxisItem[]; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; - zoomable?: boolean|ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; legendItemClick?(e: ChartLegendItemClickEvent): void; legendItemHover?(e: ChartLegendItemHoverEvent): void; @@ -10627,13 +10635,14 @@ declare namespace kendo.dataviz.ui { noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; - plotAreaHover?(e: ChartPlotAreaHoverEvent): void; + pannable?:any; render?(e: ChartEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; selectStart?(e: ChartSelectStartEvent): void; seriesClick?(e: ChartSeriesClickEvent): void; seriesHover?(e: ChartSeriesHoverEvent): void; + zoomable?:any; zoom?(e: ChartZoomEvent): void; zoomEnd?(e: ChartZoomEndEvent): void; zoomStart?(e: ChartZoomStartEvent): void; @@ -10866,7 +10875,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string|Function; + template?: string | Function; text?: string; visual?: Function; } @@ -10947,7 +10956,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnectionDefaults { content?: DiagramConnectionDefaultsContent; - editable?: boolean|DiagramConnectionDefaultsEditable; + editable?: boolean | DiagramConnectionDefaultsEditable; endCap?: DiagramConnectionDefaultsEndCap; fromConnector?: string; hover?: DiagramConnectionDefaultsHover; @@ -10965,7 +10974,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string|Function; + template?: string | Function; text?: string; visual?: Function; } @@ -11059,7 +11068,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnection { content?: DiagramConnectionContent; - editable?: boolean|DiagramConnectionEditable; + editable?: boolean | DiagramConnectionEditable; endCap?: DiagramConnectionEndCap; from?: DiagramConnectionFrom; fromConnector?: string; @@ -11078,7 +11087,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableDrag { - snap?: boolean|DiagramEditableDragSnap; + snap?: boolean | DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -11141,12 +11150,12 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditable { - connectionTemplate?: string|Function; - drag?: boolean|DiagramEditableDrag; + connectionTemplate?: string | Function; + drag?: boolean | DiagramEditableDrag; remove?: boolean; - resize?: boolean|DiagramEditableResize; - rotate?: boolean|DiagramEditableRotate; - shapeTemplate?: string|Function; + resize?: boolean | DiagramEditableResize; + rotate?: boolean | DiagramEditableRotate; + shapeTemplate?: string | Function; tools?: DiagramEditableTool[]; } @@ -11182,10 +11191,10 @@ declare namespace kendo.dataviz.ui { } interface DiagramPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface DiagramPdf { @@ -11197,7 +11206,7 @@ declare namespace kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: DiagramPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -11294,7 +11303,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string|Function; + template?: string | Function; text?: string; } @@ -11354,7 +11363,7 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeDefaultsConnector[]; connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; - editable?: boolean|DiagramShapeDefaultsEditable; + editable?: boolean | DiagramShapeDefaultsEditable; fill?: DiagramShapeDefaultsFill; height?: number; hover?: DiagramShapeDefaultsHover; @@ -11452,7 +11461,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string|Function; + template?: string | Function; text?: string; } @@ -11510,7 +11519,7 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeConnector[]; connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; - editable?: boolean|DiagramShapeEditable; + editable?: boolean | DiagramShapeEditable; fill?: DiagramShapeFill; height?: number; hover?: DiagramShapeHover; @@ -11547,16 +11556,16 @@ declare namespace kendo.dataviz.ui { autoBind?: boolean; connectionDefaults?: DiagramConnectionDefaults; connections?: DiagramConnection[]; - connectionsDataSource?: any|any|kendo.data.DataSource; - dataSource?: any|any|kendo.data.DataSource; - editable?: boolean|DiagramEditable; + connectionsDataSource?: any | any | kendo.data.DataSource; + dataSource?: any | any | kendo.data.DataSource; + editable?: boolean | DiagramEditable; layout?: DiagramLayout; - pannable?: boolean|DiagramPannable; + pannable?: boolean | DiagramPannable; pdf?: DiagramPdf; - selectable?: boolean|DiagramSelectable; + selectable?: boolean | DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; - template?: string|Function; + template?: string | Function; zoom?: number; zoomMax?: number; zoomMin?: number; @@ -11764,7 +11773,7 @@ declare namespace kendo.dataviz.ui { interface LinearGaugePointerItem { border?: LinearGaugePointerItemBorder; color?: string; - margin?: number|any; + margin?: number | any; opacity?: number; shape?: string; size?: number; @@ -11800,7 +11809,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: LinearGaugeScaleLabelsMargin; padding?: LinearGaugeScaleLabelsPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -11932,9 +11941,9 @@ declare namespace kendo.dataviz.ui { } interface MapControls { - attribution?: boolean|MapControlsAttribution; - navigator?: boolean|MapControlsNavigator; - zoom?: boolean|MapControlsZoom; + attribution?: boolean | MapControlsAttribution; + navigator?: boolean | MapControlsNavigator; + zoom?: boolean | MapControlsZoom; } interface MapLayerDefaultsBing { @@ -11968,7 +11977,7 @@ declare namespace kendo.dataviz.ui { maxSize?: number; minSize?: number; style?: MapLayerDefaultsBubbleStyle; - symbol?: string|Function; + symbol?: string | Function; } interface MapLayerDefaultsMarkerTooltipAnimationClose { @@ -12102,8 +12111,8 @@ declare namespace kendo.dataviz.ui { interface MapLayer { attribution?: string; autoBind?: boolean; - dataSource?: any|any|kendo.data.DataSource; - extent?: any|kendo.dataviz.map.Extent; + dataSource?: any | any | kendo.data.DataSource; + extent?: any | kendo.dataviz.map.Extent; key?: string; imagerySet?: string; culture?: string; @@ -12116,7 +12125,7 @@ declare namespace kendo.dataviz.ui { minSize?: number; opacity?: number; subdomains?: any; - symbol?: string|Function; + symbol?: string | Function; type?: string; style?: MapLayerStyle; urlTemplate?: string; @@ -12196,7 +12205,7 @@ declare namespace kendo.dataviz.ui { } interface MapMarker { - location?: any|kendo.dataviz.map.Location; + location?: any | kendo.dataviz.map.Location; shape?: string; title?: string; tooltip?: MapMarkerTooltip; @@ -12204,7 +12213,7 @@ declare namespace kendo.dataviz.ui { interface MapOptions { name?: string; - center?: any|kendo.dataviz.map.Location; + center?: any | kendo.dataviz.map.Location; controls?: MapControls; layerDefaults?: MapLayerDefaults; layers?: MapLayer[]; @@ -12369,8 +12378,8 @@ declare namespace kendo.dataviz.ui { errorCorrection?: string; padding?: number; renderAs?: string; - size?: number|string; - value?: number|string; + size?: number | string; + value?: number | string; } interface QRCodeEvent { sender: QRCode; @@ -12470,7 +12479,7 @@ declare namespace kendo.dataviz.ui { margin?: RadialGaugeScaleLabelsMargin; padding?: RadialGaugeScaleLabelsPadding; position?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -12575,8 +12584,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -12601,13 +12610,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; + margin?: number | any; mirror?: boolean; - padding?: number|any; + padding?: number | any; rotation?: number; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; culture?: string; dateFormats?: any; @@ -12680,7 +12689,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -12726,7 +12735,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -12765,7 +12774,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineCategoryAxisItemTitleBorder; color?: string; font?: string; - margin?: number|any; + margin?: number | any; position?: string; rotation?: number; text?: string; @@ -12773,7 +12782,7 @@ declare namespace kendo.dataviz.ui { } interface SparklineCategoryAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; categories?: any; color?: string; field?: string; @@ -12813,7 +12822,7 @@ declare namespace kendo.dataviz.ui { opacity?: number; border?: SparklineChartAreaBorder; height?: number; - margin?: number|any; + margin?: number | any; width?: number; } @@ -12827,14 +12836,14 @@ declare namespace kendo.dataviz.ui { background?: string; opacity?: number; border?: SparklinePlotAreaBorder; - margin?: number|any; + margin?: number | any; } interface SparklineSeriesItemBorder { - color?: string|Function; - dashType?: string|Function; - opacity?: number|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + opacity?: number | Function; + width?: number | Function; } interface SparklineSeriesItemConnectors { @@ -12857,24 +12866,24 @@ declare namespace kendo.dataviz.ui { } interface SparklineSeriesItemLabelsBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface SparklineSeriesItemLabels { align?: string; - background?: string|Function; + background?: string | Function; border?: SparklineSeriesItemLabelsBorder; - color?: string|Function; + color?: string | Function; distance?: number; - font?: string|Function; - format?: string|Function; - margin?: number|any; - padding?: number|any; - position?: string|Function; - template?: string|Function; - visible?: boolean|Function; + font?: string | Function; + format?: string | Function; + margin?: number | any; + padding?: number | any; + position?: string | Function; + template?: string | Function; + visible?: boolean | Function; } interface SparklineSeriesItemLine { @@ -12885,17 +12894,17 @@ declare namespace kendo.dataviz.ui { } interface SparklineSeriesItemMarkersBorder { - color?: string|Function; - width?: number|Function; + color?: string | Function; + width?: number | Function; } interface SparklineSeriesItemMarkers { - background?: string|Function; + background?: string | Function; border?: SparklineSeriesItemMarkersBorder; - size?: number|Function; - type?: string|Function; - visible?: boolean|Function; - rotation?: number|Function; + size?: number | Function; + type?: string | Function; + visible?: boolean | Function; + rotation?: number | Function; } interface SparklineSeriesItemNotesIconBorder { @@ -12922,7 +12931,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -12952,18 +12961,18 @@ declare namespace kendo.dataviz.ui { } interface SparklineSeriesItemTargetBorder { - color?: string|Function; - dashType?: string|Function; + color?: string | Function; + dashType?: string | Function; width?: number; } interface SparklineSeriesItemTargetLine { - width?: any|Function; + width?: any | Function; } interface SparklineSeriesItemTarget { line?: SparklineSeriesItemTargetLine; - color?: string|Function; + color?: string | Function; border?: SparklineSeriesItemTargetBorder; } @@ -12978,8 +12987,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -12993,11 +13002,11 @@ declare namespace kendo.dataviz.ui { field?: string; name?: string; highlight?: SparklineSeriesItemHighlight; - aggregate?: string|Function; + aggregate?: string | Function; axis?: string; border?: SparklineSeriesItemBorder; categoryField?: string; - color?: string|Function; + color?: string | Function; colorField?: string; connectors?: SparklineSeriesItemConnectors; gap?: number; @@ -13013,7 +13022,7 @@ declare namespace kendo.dataviz.ui { size?: number; startAngle?: number; spacing?: number; - stack?: boolean|SparklineSeriesItemStack; + stack?: boolean | SparklineSeriesItemStack; tooltip?: SparklineSeriesItemTooltip; width?: number; target?: SparklineSeriesItemTarget; @@ -13039,9 +13048,9 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; - padding?: number|any; - template?: string|Function; + margin?: number | any; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -13060,8 +13069,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -13076,7 +13085,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean|SparklineSeriesDefaultsStack; + stack?: boolean | SparklineSeriesDefaultsStack; type?: string; tooltip?: SparklineSeriesDefaultsTooltip; } @@ -13092,8 +13101,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; shared?: boolean; sharedTemplate?: string; @@ -13110,8 +13119,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -13136,13 +13145,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; + margin?: number | any; mirror?: boolean; - padding?: number|any; + padding?: number | any; rotation?: number; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -13212,7 +13221,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -13258,7 +13267,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -13297,8 +13306,8 @@ declare namespace kendo.dataviz.ui { border?: SparklineValueAxisItemTitleBorder; color?: string; font?: string; - margin?: number|any; - padding?: number|any; + margin?: number | any; + padding?: number | any; position?: string; rotation?: number; text?: string; @@ -13306,7 +13315,7 @@ declare namespace kendo.dataviz.ui { } interface SparklineValueAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; color?: string; labels?: SparklineValueAxisItemLabels; line?: SparklineValueAxisItemLine; @@ -13502,8 +13511,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -13528,13 +13537,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; + margin?: number | any; mirror?: boolean; - padding?: number|any; + padding?: number | any; rotation?: number; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; culture?: string; dateFormats?: any; @@ -13607,7 +13616,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -13653,7 +13662,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -13705,7 +13714,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartCategoryAxisItemTitleBorder; color?: string; font?: string; - margin?: number|any; + margin?: number | any; position?: string; rotation?: number; text?: string; @@ -13713,7 +13722,7 @@ declare namespace kendo.dataviz.ui { } interface StockChartCategoryAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; categories?: any; color?: string; field?: string; @@ -13756,7 +13765,7 @@ declare namespace kendo.dataviz.ui { opacity?: number; border?: StockChartChartAreaBorder; height?: number; - margin?: number|any; + margin?: number | any; width?: number; } @@ -13797,10 +13806,10 @@ declare namespace kendo.dataviz.ui { border?: StockChartLegendBorder; item?: StockChartLegendItem; labels?: StockChartLegendLabels; - margin?: number|any; + margin?: number | any; offsetX?: number; offsetY?: number; - padding?: number|any; + padding?: number | any; position?: string; reverse?: boolean; visible?: boolean; @@ -13837,7 +13846,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: StockChartNavigatorCategoryAxisItemCrosshairTooltipPadding; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -13891,7 +13900,7 @@ declare namespace kendo.dataviz.ui { rotation?: number; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -13962,7 +13971,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartNavigatorCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -14008,7 +14017,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartNavigatorCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -14071,7 +14080,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorCategoryAxisItem { autoBaseUnitSteps?: StockChartNavigatorCategoryAxisItemAutoBaseUnitSteps; - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; background?: string; baseUnit?: string; baseUnitStep?: any; @@ -14100,7 +14109,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorHint { visible?: boolean; - template?: string|Function; + template?: string | Function; format?: string; } @@ -14201,10 +14210,10 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; - padding?: number|any; + margin?: number | any; + padding?: number | any; position?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -14222,7 +14231,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorSeriesItemMarkers { background?: string; border?: StockChartNavigatorSeriesItemMarkersBorder; - rotation?: number|Function; + rotation?: number | Function; size?: number; type?: string; visible?: boolean; @@ -14248,8 +14257,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -14262,7 +14271,7 @@ declare namespace kendo.dataviz.ui { categoryField?: string; name?: string; highlight?: StockChartNavigatorSeriesItemHighlight; - aggregate?: string|Function; + aggregate?: string | Function; axis?: string; border?: StockChartNavigatorSeriesItemBorder; closeField?: string; @@ -14281,7 +14290,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartNavigatorSeriesItemOverlay; spacing?: number; - stack?: boolean|StockChartNavigatorSeriesItemStack; + stack?: boolean | StockChartNavigatorSeriesItemStack; tooltip?: StockChartNavigatorSeriesItemTooltip; width?: number; } @@ -14315,7 +14324,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartPaneTitleBorder; color?: string; font?: string; - margin?: number|any; + margin?: number | any; position?: string; text?: string; visible?: boolean; @@ -14323,8 +14332,8 @@ declare namespace kendo.dataviz.ui { interface StockChartPane { name?: string; - margin?: number|any; - padding?: number|any; + margin?: number | any; + padding?: number | any; background?: string; border?: StockChartPaneBorder; clip?: boolean; @@ -14333,10 +14342,10 @@ declare namespace kendo.dataviz.ui { } interface StockChartPdfMargin { - bottom?: number|string; - left?: number|string; - right?: number|string; - top?: number|string; + bottom?: number | string; + left?: number | string; + right?: number | string; + top?: number | string; } interface StockChartPdf { @@ -14348,7 +14357,7 @@ declare namespace kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: StockChartPdfMargin; - paperSize?: string|any; + paperSize?: string | any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -14365,14 +14374,14 @@ declare namespace kendo.dataviz.ui { background?: string; opacity?: number; border?: StockChartPlotAreaBorder; - margin?: number|any; + margin?: number | any; } interface StockChartSeriesItemBorder { - color?: string|Function; - dashType?: string|Function; - opacity?: number|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + opacity?: number | Function; + width?: number | Function; } interface StockChartSeriesItemHighlightBorder { @@ -14396,22 +14405,22 @@ declare namespace kendo.dataviz.ui { } interface StockChartSeriesItemLabelsBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface StockChartSeriesItemLabels { - background?: string|Function; + background?: string | Function; border?: StockChartSeriesItemLabelsBorder; - color?: string|Function; - font?: string|Function; - format?: string|Function; - margin?: number|any; - padding?: number|any; - position?: string|Function; - template?: string|Function; - visible?: boolean|Function; + color?: string | Function; + font?: string | Function; + format?: string | Function; + margin?: number | any; + padding?: number | any; + position?: string | Function; + template?: string | Function; + visible?: boolean | Function; } interface StockChartSeriesItemLine { @@ -14422,17 +14431,17 @@ declare namespace kendo.dataviz.ui { } interface StockChartSeriesItemMarkersBorder { - color?: string|Function; - width?: number|Function; + color?: string | Function; + width?: number | Function; } interface StockChartSeriesItemMarkers { - background?: string|Function; + background?: string | Function; border?: StockChartSeriesItemMarkersBorder; - size?: number|Function; - rotation?: number|Function; - type?: string|Function; - visible?: boolean|Function; + size?: number | Function; + rotation?: number | Function; + type?: string | Function; + visible?: boolean | Function; } interface StockChartSeriesItemNotesIconBorder { @@ -14459,7 +14468,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -14489,18 +14498,18 @@ declare namespace kendo.dataviz.ui { } interface StockChartSeriesItemTargetBorder { - color?: string|Function; - dashType?: string|Function; - width?: number|Function; + color?: string | Function; + dashType?: string | Function; + width?: number | Function; } interface StockChartSeriesItemTargetLine { - width?: any|Function; + width?: any | Function; } interface StockChartSeriesItemTarget { line?: StockChartSeriesItemTargetLine; - color?: string|Function; + color?: string | Function; border?: StockChartSeriesItemTargetBorder; } @@ -14515,8 +14524,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -14531,13 +14540,13 @@ declare namespace kendo.dataviz.ui { targetField?: string; name?: string; highlight?: StockChartSeriesItemHighlight; - aggregate?: string|Function; + aggregate?: string | Function; axis?: string; border?: StockChartSeriesItemBorder; closeField?: string; - color?: string|Function; + color?: string | Function; colorField?: string; - downColor?: string|Function; + downColor?: string | Function; downColorField?: string; gap?: number; labels?: StockChartSeriesItemLabels; @@ -14551,7 +14560,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartSeriesItemOverlay; spacing?: number; - stack?: boolean|StockChartSeriesItemStack; + stack?: boolean | StockChartSeriesItemStack; tooltip?: StockChartSeriesItemTooltip; visibleInLegend?: boolean; width?: number; @@ -14578,9 +14587,9 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; - padding?: number|any; - template?: string|Function; + margin?: number | any; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -14599,8 +14608,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -14616,7 +14625,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean|StockChartSeriesDefaultsStack; + stack?: boolean | StockChartSeriesDefaultsStack; type?: string; tooltip?: StockChartSeriesDefaultsTooltip; } @@ -14633,8 +14642,8 @@ declare namespace kendo.dataviz.ui { border?: StockChartTitleBorder; font?: string; color?: string; - margin?: number|any; - padding?: number|any; + margin?: number | any; + padding?: number | any; position?: string; text?: string; visible?: boolean; @@ -14651,8 +14660,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; shared?: boolean; sharedTemplate?: string; @@ -14669,8 +14678,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number|any; - template?: string|Function; + padding?: number | any; + template?: string | Function; visible?: boolean; } @@ -14695,13 +14704,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number|any; + margin?: number | any; mirror?: boolean; - padding?: number|any; + padding?: number | any; rotation?: number; skip?: number; step?: number; - template?: string|Function; + template?: string | Function; visible?: boolean; } @@ -14771,7 +14780,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -14817,7 +14826,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string|Function; + template?: string | Function; visible?: boolean; rotation?: number; format?: string; @@ -14856,8 +14865,8 @@ declare namespace kendo.dataviz.ui { border?: StockChartValueAxisItemTitleBorder; color?: string; font?: string; - margin?: number|any; - padding?: number|any; + margin?: number | any; + padding?: number | any; position?: string; rotation?: number; text?: string; @@ -14865,7 +14874,7 @@ declare namespace kendo.dataviz.ui { } interface StockChartValueAxisItem { - axisCrossingValue?: any|Date|any; + axisCrossingValue?: any | Date | any; background?: string; color?: string; labels?: StockChartValueAxisItemLabels; @@ -15106,14 +15115,14 @@ declare namespace kendo.dataviz.ui { interface TreeMapOptions { name?: string; - dataSource?: any|any|kendo.data.HierarchicalDataSource; + dataSource?: any | any | kendo.data.HierarchicalDataSource; autoBind?: boolean; type?: string; theme?: string; valueField?: string; colorField?: string; textField?: string; - template?: string|Function; + template?: string | Function; colors?: any; itemCreated?(e: TreeMapItemCreatedEvent): void; dataBound?(e: TreeMapDataBoundEvent): void; @@ -15125,7 +15134,7 @@ declare namespace kendo.dataviz.ui { } interface TreeMapItemCreatedEvent extends TreeMapEvent { - element?: JQuery|Element; + element?: JQuery | Element; } interface TreeMapDataBoundEvent extends TreeMapEvent { @@ -15170,7 +15179,7 @@ declare namespace kendo.dataviz.map { nw: kendo.dataviz.map.Location; se: kendo.dataviz.map.Location; - constructor(nw: kendo.dataviz.map.Location|any, se: kendo.dataviz.map.Location|any); + constructor(nw: kendo.dataviz.map.Location | any, se: kendo.dataviz.map.Location | any); static create(a: kendo.dataviz.map.Location, b?: kendo.dataviz.map.Location): kendo.dataviz.map.Extent; static create(a: kendo.dataviz.map.Location, b?: any): kendo.dataviz.map.Extent; @@ -15310,7 +15319,7 @@ declare namespace kendo.dataviz.map { interface MarkerOptions { name?: string; - location?: any|kendo.dataviz.map.Location; + location?: any | kendo.dataviz.map.Location; shape?: string; title?: string; tooltip?: MarkerTooltip; @@ -15538,7 +15547,7 @@ declare namespace kendo.dataviz.diagram { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string|Function; + template?: string | Function; text?: string; visual?: Function; } @@ -16235,7 +16244,7 @@ declare namespace kendo.dataviz.diagram { interface ShapeOptions { name?: string; id?: string; - editable?: boolean|ShapeEditable; + editable?: boolean | ShapeEditable; path?: string; stroke?: ShapeStroke; type?: string; @@ -16335,10 +16344,10 @@ declare namespace kendo { namespace drawing { function align(elements: any, rect: kendo.geometry.Rect, alignment: string): void; - function drawDOM(element: JQuery, options: any): JQueryPromise; - function exportImage(group: kendo.drawing.Group, options: any): JQueryPromise; - function exportPDF(group: kendo.drawing.Group, options: kendo.drawing.PDFOptions): JQueryPromise; - function exportSVG(group: kendo.drawing.Group, options: any): JQueryPromise; + function drawDOM(element: JQuery, options?: any): JQueryPromise; + function exportImage(group: kendo.drawing.Group, options?: any): JQueryPromise; + function exportPDF(group: kendo.drawing.Group, options?: kendo.drawing.PDFOptions): JQueryPromise; + function exportSVG(group: kendo.drawing.Group, options?: any): JQueryPromise; function fit(element: kendo.drawing.Element, rect: kendo.geometry.Rect): void; function stack(elements: any): void; function vAlign(elements: any, rect: kendo.geometry.Rect, alignment: string): void; @@ -16354,40 +16363,40 @@ declare namespace kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } - function antiForgeryTokens(): any; - function bind(element: string, viewModel: any, namespace?: any): void; - function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: JQuery, viewModel: any, namespace?: any): void; - function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: Element, viewModel: any, namespace?: any): void; - function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function observableHierarchy(array: any): void; - function culture(culture: string): void; - function destroy(element: string): void; - function destroy(element: JQuery): void; - function destroy(element: Element): void; - function htmlEncode(value: string): string; - function parseDate(value: string, formats?: string, culture?: string): Date; - function parseDate(value: string, formats?: any, culture?: string): Date; - function parseFloat(value: string, culture?: string): number; - function parseInt(value: string, culture?: string): number; - function parseColor(color: string, noerror: boolean): kendo.Color; - function proxyModelSetters(): void; - function proxyModelSetters(data: kendo.data.Model): void; - function resize(element: string, force: boolean): void; - function resize(element: JQuery, force: boolean): void; - function resize(element: Element, force: boolean): void; - function saveAs(options: any): void; - function stringify(value: any): string; - function throttle(fn: Function, timeout: number): void; - function touchScroller(element: string): void; - function touchScroller(element: JQuery): void; - function touchScroller(element: Element): void; - function toString(value: Date, format: string, culture?: string): string; - function toString(value: number, format: string, culture?: string): string; - function unbind(element: string): void; - function unbind(element: JQuery): void; - function unbind(element: Element): void; + function antiForgeryTokens(): any; + function bind(element: string, viewModel: any, namespace?: any): void; + function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: JQuery, viewModel: any, namespace?: any): void; + function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: Element, viewModel: any, namespace?: any): void; + function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function observableHierarchy(array: any): void; + function culture(culture: string): void; + function destroy(element: string): void; + function destroy(element: JQuery): void; + function destroy(element: Element): void; + function htmlEncode(value: string): string; + function parseDate(value: string, formats?: string, culture?: string): Date; + function parseDate(value: string, formats?: any, culture?: string): Date; + function parseFloat(value: string, culture?: string): number; + function parseInt(value: string, culture?: string): number; + function parseColor(color: string, noerror: boolean): kendo.Color; + function proxyModelSetters(): void; + function proxyModelSetters(data: kendo.data.Model): void; + function resize(element: string, force: boolean): void; + function resize(element: JQuery, force: boolean): void; + function resize(element: Element, force: boolean): void; + function saveAs(options: any): void; + function stringify(value: any): string; + function throttle(fn: Function, timeout: number): void; + function touchScroller(element: string): void; + function touchScroller(element: JQuery): void; + function touchScroller(element: Element): void; + function toString(value: Date, format: string, culture?: string): string; + function toString(value: number, format: string, culture?: string): string; + function unbind(element: string): void; + function unbind(element: JQuery): void; + function unbind(element: Element): void; namespace pdf { function defineFont(map: any): void; @@ -16639,9 +16648,9 @@ declare namespace kendo.mobile.ui { } interface ActionSheetPopup { - direction?: number|string; - height?: number|string; - width?: number|string; + direction?: number | string; + height?: number | string; + width?: number | string; } interface ActionSheetOptions { @@ -17009,18 +17018,18 @@ declare namespace kendo.mobile.ui { name?: string; appendOnRefresh?: boolean; autoBind?: boolean; - dataSource?: kendo.data.DataSource|any; + dataSource?: kendo.data.DataSource | any; endlessScroll?: boolean; fixedHeaders?: boolean; - headerTemplate?: string|Function; + headerTemplate?: string | Function; loadMore?: boolean; messages?: ListViewMessages; pullToRefresh?: boolean; pullParameters?: Function; style?: string; - template?: string|Function; + template?: string | Function; type?: string; - filterable?: boolean|ListViewFilterable; + filterable?: boolean | ListViewFilterable; virtualViewSize?: number; click?(e: ListViewClickEvent): void; dataBound?(e: ListViewEvent): void; @@ -17232,8 +17241,8 @@ declare namespace kendo.mobile.ui { } interface PopOverPopup { - height?: number|string; - width?: number|string; + height?: number | string; + width?: number | string; } interface PopOverOptions { @@ -17289,8 +17298,8 @@ declare namespace kendo.mobile.ui { name?: string; autoBind?: boolean; bounceVelocityThreshold?: number; - contentHeight?: number|string; - dataSource?: kendo.data.DataSource|any; + contentHeight?: number | string; + dataSource?: kendo.data.DataSource | any; duration?: number; emptyTemplate?: string; enablePager?: boolean; @@ -17669,7 +17678,7 @@ declare namespace kendo.ooxml { wrap?: boolean; vAlign?: string; verticalAlign?: string; - value?: Date|number|string|boolean; + value?: Date | number | string | boolean; } interface WorkbookSheetRow { @@ -17875,7 +17884,7 @@ declare namespace kendo.dataviz.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + constructor(origin: kendo.geometry.Point | any, size: kendo.geometry.Size | any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -18101,7 +18110,7 @@ declare namespace kendo.dataviz.drawing { } - interface FillOptions { + interface FillOptions { @@ -18400,7 +18409,7 @@ declare namespace kendo.dataviz.drawing { } - interface PDFOptions { + interface PDFOptions { @@ -18504,7 +18513,7 @@ declare namespace kendo.dataviz.drawing { interface RadialGradientOptions { name?: string; - center?: any|kendo.geometry.Point; + center?: any | kendo.geometry.Point; radius?: number; stops?: any; } @@ -18588,7 +18597,7 @@ declare namespace kendo.dataviz.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -18642,8 +18651,8 @@ declare namespace kendo.dataviz.drawing { } interface SurfaceTooltip { - animation?: boolean|SurfaceTooltipAnimation; - appendTo?: string|JQuery; + animation?: boolean | SurfaceTooltipAnimation; + appendTo?: string | JQuery; } interface SurfaceOptions { @@ -18738,20 +18747,20 @@ declare namespace kendo.dataviz.drawing { } - interface TooltipOptions { + interface TooltipOptions { autoHide?: boolean; - content?: string|Function; + content?: string | Function; position?: string; - height?: number|string; + height?: number | string; hideDelay?: number; offset?: number; shared?: boolean; showAfter?: number; showOn?: string; - width?: number|string; + width?: number | string; From fdb47e573f9c4d593094069136c1f12a0c17edd4 Mon Sep 17 00:00:00 2001 From: Gayan Ranasinghe Date: Mon, 4 Jul 2016 16:22:02 +0530 Subject: [PATCH 005/105] jquery reference --- kendo-ui/kendo-ui.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index b8aea8a61a..9d99d0bbfe 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -2,7 +2,7 @@ // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +/// declare namespace kendo { From 96817eace15d945f7202b8dc6ba00f4b7fe5f5dd Mon Sep 17 00:00:00 2001 From: Gayan Ranasinghe Date: Mon, 4 Jul 2016 16:27:55 +0530 Subject: [PATCH 006/105] removed implicitly has an 'any' type --- kendo-ui/kendo-ui.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 9d99d0bbfe..9974c78775 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -511,7 +511,6 @@ declare namespace kendo.data { } module binders { } - export var binders; interface Bindings { [key: string]: Binding; From 950ce5c6c168a26b1e18ea0aa9f9354a27ccaaf9 Mon Sep 17 00:00:00 2001 From: Gayan Ranasinghe Date: Mon, 25 Jul 2016 10:22:19 +0530 Subject: [PATCH 007/105] remove formatting --- kendo-ui/kendo-ui.d.ts | 1302 ++++++++++++++++++++-------------------- 1 file changed, 651 insertions(+), 651 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 6fd787863f..941a432d81 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -2,6 +2,7 @@ // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// @@ -302,7 +303,7 @@ declare namespace kendo { } class ViewContainer extends Observable { - view: View; + view: View; } class Layout extends View { @@ -573,7 +574,6 @@ declare namespace kendo.data { isAllDay?: boolean; id?: any; start?: Date; - ownerId?: number; taskId?: number; startTimezone?: string; recurrenceId?: any; @@ -587,7 +587,6 @@ declare namespace kendo.data { static fields: DataSourceSchemaModelFields; constructor(data?: SchedulerEventData); - ownerId: number; taskId: number; description: string; end: Date; @@ -844,7 +843,7 @@ declare namespace kendo.data { columns: PivotSchemaColumnAxis; } - interface PivotSchema extends DataSourceSchema { + interface PivotSchema extends DataSourceSchema{ axes?: any; catalogs?: any; cubes?: any; @@ -953,7 +952,7 @@ declare namespace kendo.data { } interface DataSourceSchemaWithConstructorModel extends DataSourceSchema { - model?: typeof Model; + model?: typeof Model; } interface DataSourceSchemaModel { @@ -1001,7 +1000,7 @@ declare namespace kendo.data { every(callback: (item: Object, index: number, source: ObservableArray) => boolean): boolean; filter(callback: (item: Object, index: number, source: ObservableArray) => boolean): any[]; find(callback: (item: Object, index: number, source: ObservableArray) => boolean): any; - forEach(callback: (item: Object, index: number, source: ObservableArray) => void): void; + forEach(callback: (item: Object, index: number, source: ObservableArray) => void ): void; indexOf(item: any): number; join(separator: string): string; map(callback: (item: Object, index: number, source: ObservableArray) => any): any[]; @@ -1027,7 +1026,7 @@ declare namespace kendo.data { items?: kendo.data.Model[]; } - class DataSource extends Observable { + class DataSource extends Observable{ options: DataSourceOptions; static create(options?: DataSourceOptions): DataSource; @@ -1247,7 +1246,7 @@ declare namespace kendo.data { sort?: any; transport?: DataSourceTransport; type?: string; - change?(e: DataSourceChangeEvent): void; + change? (e: DataSourceChangeEvent): void; error?(e: DataSourceErrorEvent): void; sync?(e: DataSourceEvent): void; requestStart?(e: DataSourceRequestStartEvent): void; @@ -1330,7 +1329,7 @@ declare namespace kendo.ui { function plugin(widget: typeof kendo.ui.Widget, register?: typeof kendo.dataviz.ui, prefix?: String): void; function plugin(widget: any, register?: typeof kendo.dataviz.ui, prefix?: String): void; - class Draggable extends kendo.ui.Widget { + class Draggable extends kendo.ui.Widget{ element: JQuery; currentTarget: JQuery; constructor(element: Element, options?: DraggableOptions); @@ -1341,7 +1340,7 @@ declare namespace kendo.ui { sender?: Draggable; } - class DropTarget extends kendo.ui.Widget { + class DropTarget extends kendo.ui.Widget{ element: JQuery; constructor(element: Element, options?: DropTargetOptions); options: DropTargetOptions; @@ -1371,7 +1370,7 @@ declare namespace kendo.ui { draggable?: kendo.ui.Draggable; } - class DropTargetArea extends kendo.ui.Widget { + class DropTargetArea extends kendo.ui.Widget{ element: JQuery; constructor(element: Element, options?: DropTargetAreaOptions); options: DropTargetAreaOptions; @@ -1522,7 +1521,7 @@ declare namespace kendo.dataviz.map.layer { declare namespace kendo.drawing.pdf { function saveAs(group: kendo.drawing.Group, fileName: string, - proxyUrl?: string, callback?: Function): void; + proxyUrl?: string, callback?: Function): void; } declare namespace kendo.geometry { @@ -1695,7 +1694,7 @@ declare namespace kendo.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point | any, size: kendo.geometry.Size | any); + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -1921,7 +1920,7 @@ declare namespace kendo.drawing { } - interface FillOptions { + interface FillOptions { @@ -2220,7 +2219,7 @@ declare namespace kendo.drawing { } - interface PDFOptions { + interface PDFOptions { @@ -2324,7 +2323,7 @@ declare namespace kendo.drawing { interface RadialGradientOptions { name?: string; - center?: any | kendo.geometry.Point; + center?: any|kendo.geometry.Point; radius?: number; stops?: any; } @@ -2408,7 +2407,7 @@ declare namespace kendo.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -2462,8 +2461,8 @@ declare namespace kendo.drawing { } interface SurfaceTooltip { - animation?: boolean | SurfaceTooltipAnimation; - appendTo?: string | JQuery; + animation?: boolean|SurfaceTooltipAnimation; + appendTo?: string|JQuery; } interface SurfaceOptions { @@ -2558,20 +2557,20 @@ declare namespace kendo.drawing { } - interface TooltipOptions { + interface TooltipOptions { autoHide?: boolean; - content?: string | Function; + content?: string|Function; position?: string; - height?: number | string; + height?: number|string; hideDelay?: number; offset?: number; shared?: boolean; showAfter?: number; showOn?: string; - width?: number | string; + width?: number|string; @@ -2641,14 +2640,14 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; - animation?: boolean | AutoCompleteAnimation; - dataSource?: any | any | kendo.data.DataSource; + animation?: boolean|AutoCompleteAnimation; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string | Function; - groupTemplate?: string | Function; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; @@ -2657,11 +2656,11 @@ declare namespace kendo.ui { popup?: any; separator?: string; suggest?: boolean; - value?: any; + headerTemplate?: string|Function; headerTemplate?: string | Function; template?: string | Function; valuePrimitive?: boolean; - virtual?: boolean | AutoCompleteVirtual; + virtual?: boolean|AutoCompleteVirtual; change?(e: AutoCompleteChangeEvent): void; close?(e: AutoCompleteCloseEvent): void; dataBound?(e: AutoCompleteDataBoundEvent): void; @@ -2779,8 +2778,8 @@ declare namespace kendo.ui { culture?: string; dates?: any; depth?: string; - disableDates?: any | Function; - footer?: string | Function; + disableDates?: any|Function; + footer?: string|Function; format?: string; max?: Date; min?: Date; @@ -2827,7 +2826,7 @@ declare namespace kendo.ui { interface ColorPaletteOptions { name?: string; - palette?: string | any; + palette?: string|any; columns?: number; tileSize?: ColorPaletteTileSize; value?: string; @@ -2882,7 +2881,7 @@ declare namespace kendo.ui { columns?: number; tileSize?: ColorPickerTileSize; messages?: ColorPickerMessages; - palette?: string | any; + palette?: string|any; opacity?: boolean; preview?: boolean; toolIcon?: string; @@ -2982,14 +2981,14 @@ declare namespace kendo.ui { autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string | Function; - groupTemplate?: string | Function; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; @@ -2998,12 +2997,12 @@ declare namespace kendo.ui { placeholder?: string; popup?: ComboBoxPopup; suggest?: boolean; - headerTemplate?: string | Function; - template?: string | Function; + headerTemplate?: string|Function; + template?: string|Function; text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean | ComboBoxVirtual; + virtual?: boolean|ComboBoxVirtual; change?(e: ComboBoxChangeEvent): void; close?(e: ComboBoxCloseEvent): void; dataBound?(e: ComboBoxDataBoundEvent): void; @@ -3098,16 +3097,16 @@ declare namespace kendo.ui { interface ContextMenuOptions { name?: string; alignToAnchor?: boolean; - animation?: boolean | ContextMenuAnimation; + animation?: boolean|ContextMenuAnimation; closeOnClick?: boolean; - dataSource?: any | any; + dataSource?: any|any; direction?: string; filter?: string; hoverDelay?: number; orientation?: string; popupCollision?: string; showOn?: string; - target?: string | JQuery; + target?: string|JQuery; close?(e: ContextMenuCloseEvent): void; open?(e: ContextMenuOpenEvent): void; activate?(e: ContextMenuActivateEvent): void; @@ -3208,13 +3207,13 @@ declare namespace kendo.ui { interface DatePickerOptions { name?: string; - animation?: boolean | DatePickerAnimation; + animation?: boolean|DatePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; depth?: string; - disableDates?: any | Function; - footer?: string | Function; + disableDates?: any|Function; + footer?: string|Function; format?: string; max?: Date; min?: Date; @@ -3298,12 +3297,12 @@ declare namespace kendo.ui { interface DateTimePickerOptions { name?: string; - animation?: boolean | DateTimePickerAnimation; + animation?: boolean|DateTimePickerAnimation; ARIATemplate?: string; culture?: string; dates?: any; depth?: string; - disableDates?: any | Function; + disableDates?: any|Function; footer?: string; format?: string; interval?: number; @@ -3409,32 +3408,32 @@ declare namespace kendo.ui { interface DropDownListOptions { name?: string; - animation?: boolean | DropDownListAnimation; + animation?: boolean|DropDownListAnimation; autoBind?: boolean; cascadeFrom?: string; cascadeFromField?: string; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string | Function; - groupTemplate?: string | Function; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; ignoreCase?: boolean; index?: number; minLength?: number; popup?: DropDownListPopup; - optionLabel?: string | any; - optionLabelTemplate?: string | Function; - headerTemplate?: string | Function; - template?: string | Function; - valueTemplate?: string | Function; + optionLabel?: string|any; + optionLabelTemplate?: string|Function; + headerTemplate?: string|Function; + template?: string|Function; + valueTemplate?: string|Function; text?: string; value?: string; valuePrimitive?: boolean; - virtual?: boolean | DropDownListVirtual; + virtual?: boolean|DropDownListVirtual; change?(e: DropDownListChangeEvent): void; close?(e: DropDownListCloseEvent): void; dataBound?(e: DropDownListDataBoundEvent): void; @@ -3556,32 +3555,32 @@ declare namespace kendo.ui { interface EditorFileBrowserTransportCreate { contentType?: string; - data?: any | string | Function; + data?: any|string|Function; dataType?: string; type?: string; - url?: string | Function; + url?: string|Function; } interface EditorFileBrowserTransportDestroy { contentType?: string; - data?: any | string | Function; + data?: any|string|Function; dataType?: string; type?: string; - url?: string | Function; + url?: string|Function; } interface EditorFileBrowserTransportRead { contentType?: string; - data?: any | string | Function; + data?: any|string|Function; dataType?: string; type?: string; - url?: string | Function; + url?: string|Function; } interface EditorFileBrowserTransport { read?: EditorFileBrowserTransportRead; uploadUrl?: string; - fileUrl?: string | Function; + fileUrl?: string|Function; destroy?: EditorFileBrowserTransportDestroy; create?: EditorFileBrowserTransportCreate; } @@ -3638,33 +3637,33 @@ declare namespace kendo.ui { interface EditorImageBrowserTransportCreate { contentType?: string; - data?: any | string | Function; + data?: any|string|Function; dataType?: string; type?: string; - url?: string | Function; + url?: string|Function; } interface EditorImageBrowserTransportDestroy { contentType?: string; - data?: any | string | Function; + data?: any|string|Function; dataType?: string; type?: string; - url?: string | Function; + url?: string|Function; } interface EditorImageBrowserTransportRead { contentType?: string; - data?: any | string | Function; + data?: any|string|Function; dataType?: string; type?: string; - url?: string | Function; + url?: string|Function; } interface EditorImageBrowserTransport { read?: EditorImageBrowserTransportRead; - thumbnailUrl?: string | Function; + thumbnailUrl?: string|Function; uploadUrl?: string; - imageUrl?: string | Function; + imageUrl?: string|Function; destroy?: EditorImageBrowserTransportDestroy; create?: EditorImageBrowserTransportCreate; } @@ -3753,15 +3752,15 @@ declare namespace kendo.ui { } interface EditorPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface EditorPdf { author?: string; - avoidLinks?: boolean | string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -3769,7 +3768,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: EditorPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -3820,7 +3819,7 @@ declare namespace kendo.ui { messages?: EditorMessages; pasteCleanup?: EditorPasteCleanup; pdf?: EditorPdf; - resizable?: boolean | EditorResizable; + resizable?: boolean|EditorResizable; serialization?: EditorSerialization; stylesheets?: any; tools?: EditorTool[]; @@ -3936,7 +3935,7 @@ declare namespace kendo.ui { interface FilterMenuOptions { name?: string; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; extra?: boolean; field?: string; messages?: FilterMenuMessages; @@ -4040,7 +4039,7 @@ declare namespace kendo.ui { } interface GanttAssignments { - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataResourceIdField?: string; dataTaskIdField?: string; dataValueField?: string; @@ -4050,7 +4049,7 @@ declare namespace kendo.ui { field?: string; title?: string; format?: string; - width?: string | number; + width?: string|number; editable?: boolean; sortable?: boolean; } @@ -4061,7 +4060,7 @@ declare namespace kendo.ui { interface GanttEditable { confirmation?: boolean; - template?: string | Function; + template?: string|Function; } interface GanttMessagesActions { @@ -4108,15 +4107,15 @@ declare namespace kendo.ui { } interface GanttPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface GanttPdf { author?: string; - avoidLinks?: boolean | string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -4124,7 +4123,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: GanttPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -4134,31 +4133,31 @@ declare namespace kendo.ui { interface GanttResources { dataFormatField?: string; dataColorField?: string; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; field?: string; } interface GanttToolbarItem { name?: string; - template?: string | Function; + template?: string|Function; text?: string; } interface GanttTooltip { - template?: string | Function; + template?: string|Function; visible?: boolean; } interface GanttView { type?: string; selected?: boolean; - slotSize?: number | string; - timeHeaderTemplate?: string | Function; - dayHeaderTemplate?: string | Function; - weekHeaderTemplate?: string | Function; - monthHeaderTemplate?: string | Function; - yearHeaderTemplate?: string | Function; + slotSize?: number|string; + timeHeaderTemplate?: string|Function; + dayHeaderTemplate?: string|Function; + weekHeaderTemplate?: string|Function; + monthHeaderTemplate?: string|Function; + yearHeaderTemplate?: string|Function; resizeTooltipFormat?: string; } @@ -4168,10 +4167,10 @@ declare namespace kendo.ui { autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GanttColumn[]; - currentTimeMarker?: boolean | GanttCurrentTimeMarker; - dataSource?: any | any | kendo.data.GanttDataSource; - dependencies?: any | any | kendo.data.GanttDependencyDataSource; - editable?: boolean | GanttEditable; + currentTimeMarker?: boolean|GanttCurrentTimeMarker; + dataSource?: any|any|kendo.data.GanttDataSource; + dependencies?: any|any|kendo.data.GanttDependencyDataSource; + editable?: boolean|GanttEditable; navigatable?: boolean; workDayStart?: Date; workDayEnd?: Date; @@ -4179,20 +4178,20 @@ declare namespace kendo.ui { workWeekEnd?: number; hourSpan?: number; snap?: boolean; - height?: number | string; - listWidth?: string | number; + height?: number|string; + listWidth?: string|number; messages?: GanttMessages; pdf?: GanttPdf; resizable?: boolean; selectable?: boolean; showWorkDays?: boolean; showWorkHours?: boolean; - taskTemplate?: string | Function; + taskTemplate?: string|Function; toolbar?: GanttToolbarItem[]; tooltip?: GanttTooltip; views?: GanttView[]; resources?: GanttResources; - rowHeight?: number | string; + rowHeight?: number|string; dataBinding?(e: GanttDataBindingEvent): void; dataBound?(e: GanttDataBoundEvent): void; add?(e: GanttAddEvent): void; @@ -4386,7 +4385,7 @@ declare namespace kendo.ui { } interface GridAllowCopy { - delimeter?: string | any; + delimeter?: string|any; } interface GridColumnMenuMessages { @@ -4423,7 +4422,7 @@ declare namespace kendo.ui { } interface GridColumnFilterableCell { - dataSource?: any | kendo.data.DataSource; + dataSource?: any|kendo.data.DataSource; dataTextField?: string; delay?: number; inputWidth?: number; @@ -4438,13 +4437,13 @@ declare namespace kendo.ui { interface GridColumnFilterable { cell?: GridColumnFilterableCell; multi?: boolean; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; checkAll?: boolean; itemTemplate?: Function; operators?: any; search?: boolean; ignoreCase?: boolean; - ui?: string | Function; + ui?: string|Function; } interface GridColumnSortable { @@ -4458,36 +4457,36 @@ declare namespace kendo.ui { command?: GridColumnCommandItem[]; encoded?: boolean; field?: string; - filterable?: boolean | GridColumnFilterable; + filterable?: boolean|GridColumnFilterable; footerAttributes?: any; - footerTemplate?: string | Function; + footerTemplate?: string|Function; format?: string; groupable?: boolean; - groupHeaderTemplate?: string | Function; - groupFooterTemplate?: string | Function; + groupHeaderTemplate?: string|Function; + groupFooterTemplate?: string|Function; headerAttributes?: any; - headerTemplate?: string | Function; + headerTemplate?: string|Function; hidden?: boolean; locked?: boolean; lockable?: boolean; minScreenWidth?: number; - sortable?: boolean | GridColumnSortable; - template?: string | Function; + sortable?: boolean|GridColumnSortable; + template?: string|Function; title?: string; - width?: string | number; + width?: string|number; values?: any; menu?: boolean; type?: any; } interface GridEditable { - confirmation?: boolean | string | Function; + confirmation?: boolean|string|Function; cancelDelete?: string; confirmDelete?: string; createAt?: string; destroy?: boolean; mode?: string; - template?: string | Function; + template?: string|Function; update?: boolean; window?: any; } @@ -4600,7 +4599,7 @@ declare namespace kendo.ui { } interface GridNoRecords { - template?: string | Function; + template?: string|Function; } interface GridPageableMessages { @@ -4623,23 +4622,23 @@ declare namespace kendo.ui { numeric?: boolean; buttonCount?: number; input?: boolean; - pageSizes?: boolean | any; + pageSizes?: boolean|any; refresh?: boolean; info?: boolean; messages?: GridPageableMessages; } interface GridPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface GridPdf { allPages?: boolean; author?: string; - avoidLinks?: boolean | string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -4647,7 +4646,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: GridPdfMargin; - paperSize?: string | any; + paperSize?: string|any; template?: string; repeatHeaders?: boolean; scale?: number; @@ -4668,38 +4667,38 @@ declare namespace kendo.ui { interface GridToolbarItem { name?: string; - template?: string | Function; + template?: string|Function; text?: string; } interface GridOptions { name?: string; - allowCopy?: boolean | GridAllowCopy; - altRowTemplate?: string | Function; + allowCopy?: boolean|GridAllowCopy; + altRowTemplate?: string|Function; autoBind?: boolean; columnResizeHandleWidth?: number; columns?: GridColumn[]; - columnMenu?: boolean | GridColumnMenu; - dataSource?: any | any | kendo.data.DataSource; - detailTemplate?: string | Function; - editable?: boolean | GridEditable; + columnMenu?: boolean|GridColumnMenu; + dataSource?: any|any|kendo.data.DataSource; + detailTemplate?: string|Function; + editable?: boolean|GridEditable; excel?: GridExcel; - filterable?: boolean | GridFilterable; - groupable?: boolean | GridGroupable; - height?: number | string; + filterable?: boolean|GridFilterable; + groupable?: boolean|GridGroupable; + height?: number|string; messages?: GridMessages; - mobile?: boolean | string; + mobile?: boolean|string; navigatable?: boolean; - noRecords?: boolean | GridNoRecords; - pageable?: boolean | GridPageable; + noRecords?: boolean|GridNoRecords; + pageable?: boolean|GridPageable; pdf?: GridPdf; reorderable?: boolean; resizable?: boolean; - rowTemplate?: string | Function; - scrollable?: boolean | GridScrollable; - selectable?: boolean | string; - sortable?: boolean | GridSortable; - toolbar?: string | ((...args: any[]) => string) | GridToolbarItem[]; + rowTemplate?: string|Function; + scrollable?: boolean|GridScrollable; + selectable?: boolean|string; + sortable?: boolean|GridSortable; + toolbar?: string | ((...args:any[]) => string) | GridToolbarItem[]; cancel?(e: GridCancelEvent): void; change?(e: GridChangeEvent): void; columnHide?(e: GridColumnHideEvent): void; @@ -4873,10 +4872,10 @@ declare namespace kendo.ui { interface ListViewOptions { name?: string; autoBind?: boolean; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; editTemplate?: Function; navigatable?: boolean; - selectable?: boolean | string; + selectable?: boolean|string; template?: Function; altTemplate?: Function; cancel?(e: ListViewCancelEvent): void; @@ -5015,9 +5014,9 @@ declare namespace kendo.ui { interface MenuOptions { name?: string; - animation?: boolean | MenuAnimation; + animation?: boolean|MenuAnimation; closeOnClick?: boolean; - dataSource?: any | any; + dataSource?: any|any; direction?: string; hoverDelay?: number; openOnClick?: boolean; @@ -5122,17 +5121,17 @@ declare namespace kendo.ui { interface MultiSelectOptions { name?: string; - animation?: boolean | MultiSelectAnimation; + animation?: boolean|MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; delay?: number; enable?: boolean; filter?: string; - fixedGroupTemplate?: string | Function; - groupTemplate?: string | Function; + fixedGroupTemplate?: string|Function; + groupTemplate?: string|Function; height?: number; highlightFirst?: boolean; ignoreCase?: boolean; @@ -5140,13 +5139,13 @@ declare namespace kendo.ui { maxSelectedItems?: number; placeholder?: string; popup?: MultiSelectPopup; - headerTemplate?: string | Function; - itemTemplate?: string | Function; + headerTemplate?: string|Function; + itemTemplate?: string|Function; tagTemplate?: string; tagMode?: string; value?: any; valuePrimitive?: boolean; - virtual?: boolean | MultiSelectVirtual; + virtual?: boolean|MultiSelectVirtual; change?(e: MultiSelectChangeEvent): void; close?(e: MultiSelectCloseEvent): void; dataBound?(e: MultiSelectDataBoundEvent): void; @@ -5235,16 +5234,16 @@ declare namespace kendo.ui { interface NotificationOptions { name?: string; allowHideAfter?: number; - animation?: any | boolean; - appendTo?: string | JQuery; + animation?: any|boolean; + appendTo?: string|JQuery; autoHideAfter?: number; button?: boolean; - height?: number | string; + height?: number|string; hideOnClick?: boolean; position?: NotificationPosition; stacking?: string; templates?: NotificationTemplate[]; - width?: number | string; + width?: number|string; hide?(e: NotificationHideEvent): void; show?(e: NotificationShowEvent): void; } @@ -5369,13 +5368,13 @@ declare namespace kendo.ui { name?: string; autoBind?: boolean; buttonCount?: number; - dataSource?: any | kendo.data.DataSource; + dataSource?: any|kendo.data.DataSource; selectTemplate?: string; linkTemplate?: string; info?: boolean; input?: boolean; numeric?: boolean; - pageSizes?: boolean | any; + pageSizes?: boolean|any; previousNext?: boolean; refresh?: boolean; messages?: PagerMessages; @@ -5483,9 +5482,9 @@ declare namespace kendo.ui { interface PanelBarOptions { name?: string; - animation?: boolean | PanelBarAnimation; + animation?: boolean|PanelBarAnimation; contentUrls?: any; - dataSource?: any | any; + dataSource?: any|any; expandMode?: string; activate?(e: PanelBarActivateEvent): void; collapse?(e: PanelBarCollapseEvent): void; @@ -5589,10 +5588,10 @@ declare namespace kendo.ui { interface PivotConfiguratorOptions { name?: string; - dataSource?: any | kendo.data.PivotDataSource; + dataSource?: any|kendo.data.PivotDataSource; filterable?: boolean; - sortable?: boolean | PivotConfiguratorSortable; - height?: number | string; + sortable?: boolean|PivotConfiguratorSortable; + height?: number|string; messages?: PivotConfiguratorMessages; } interface PivotConfiguratorEvent { @@ -5668,15 +5667,15 @@ declare namespace kendo.ui { } interface PivotGridPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface PivotGridPdf { author?: string; - avoidLinks?: boolean | string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -5684,7 +5683,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: PivotGridPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -5697,20 +5696,20 @@ declare namespace kendo.ui { interface PivotGridOptions { name?: string; - dataSource?: any | kendo.data.PivotDataSource; + dataSource?: any|kendo.data.PivotDataSource; autoBind?: boolean; reorderable?: boolean; excel?: PivotGridExcel; pdf?: PivotGridPdf; filterable?: boolean; - sortable?: boolean | PivotGridSortable; + sortable?: boolean|PivotGridSortable; columnWidth?: number; - height?: number | string; - columnHeaderTemplate?: string | Function; - dataCellTemplate?: string | Function; - kpiStatusTemplate?: string | Function; - kpiTrendTemplate?: string | Function; - rowHeaderTemplate?: string | Function; + height?: number|string; + columnHeaderTemplate?: string|Function; + dataCellTemplate?: string|Function; + kpiStatusTemplate?: string|Function; + kpiTrendTemplate?: string|Function; + rowHeaderTemplate?: string|Function; messages?: PivotGridMessages; dataBinding?(e: PivotGridDataBindingEvent): void; dataBound?(e: PivotGridDataBoundEvent): void; @@ -5792,9 +5791,9 @@ declare namespace kendo.ui { interface PopupOptions { name?: string; adjustSize?: any; - animation?: boolean | PopupAnimation; - anchor?: string | JQuery; - appendTo?: string | JQuery; + animation?: boolean|PopupAnimation; + anchor?: string|JQuery; + appendTo?: string|JQuery; collision?: string; origin?: string; position?: string; @@ -6026,19 +6025,19 @@ declare namespace kendo.ui { } interface SchedulerEditable { - confirmation?: boolean | string; + confirmation?: boolean|string; create?: boolean; destroy?: boolean; editRecurringMode?: string; move?: boolean; resize?: boolean; - template?: string | Function; + template?: string|Function; update?: boolean; window?: any; } interface SchedulerFooter { - command?: string | boolean; + command?: string|boolean; } interface SchedulerGroup { @@ -6175,15 +6174,15 @@ declare namespace kendo.ui { } interface SchedulerPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface SchedulerPdf { author?: string; - avoidLinks?: boolean | string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -6191,7 +6190,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: SchedulerPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -6200,7 +6199,7 @@ declare namespace kendo.ui { interface SchedulerResource { dataColorField?: string; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; dataValueField?: string; field?: string; @@ -6225,26 +6224,26 @@ declare namespace kendo.ui { } interface SchedulerView { - allDayEventTemplate?: string | Function; + allDayEventTemplate?: string|Function; allDaySlot?: boolean; - allDaySlotTemplate?: string | Function; + allDaySlotTemplate?: string|Function; columnWidth?: number; - dateHeaderTemplate?: string | Function; - dayTemplate?: string | Function; - editable?: boolean | SchedulerViewEditable; + dateHeaderTemplate?: string|Function; + dayTemplate?: string|Function; + editable?: boolean|SchedulerViewEditable; endTime?: Date; eventHeight?: number; - eventTemplate?: string | Function; - eventTimeTemplate?: string | Function; + eventTemplate?: string|Function; + eventTimeTemplate?: string|Function; group?: SchedulerViewGroup; majorTick?: number; - majorTimeHeaderTemplate?: string | Function; + majorTimeHeaderTemplate?: string|Function; minorTickCount?: number; - minorTimeHeaderTemplate?: string | Function; + minorTimeHeaderTemplate?: string|Function; selected?: boolean; selectedDateFormat?: string; showWorkHours?: boolean; - slotTemplate?: string | Function; + slotTemplate?: string|Function; startTime?: Date; title?: string; type?: string; @@ -6262,27 +6261,27 @@ declare namespace kendo.ui { interface SchedulerOptions { name?: string; - allDayEventTemplate?: string | Function; + allDayEventTemplate?: string|Function; allDaySlot?: boolean; autoBind?: boolean; - currentTimeMarker?: boolean | SchedulerCurrentTimeMarker; - dataSource?: any | any | kendo.data.SchedulerDataSource; + currentTimeMarker?: boolean|SchedulerCurrentTimeMarker; + dataSource?: any|any|kendo.data.SchedulerDataSource; date?: Date; - dateHeaderTemplate?: string | Function; - editable?: boolean | SchedulerEditable; + dateHeaderTemplate?: string|Function; + editable?: boolean|SchedulerEditable; endTime?: Date; - eventTemplate?: string | Function; - footer?: boolean | SchedulerFooter; + eventTemplate?: string|Function; + footer?: boolean|SchedulerFooter; group?: SchedulerGroup; - height?: number | string; + height?: number|string; majorTick?: number; - majorTimeHeaderTemplate?: string | Function; + majorTimeHeaderTemplate?: string|Function; max?: Date; messages?: SchedulerMessages; min?: Date; minorTickCount?: number; - minorTimeHeaderTemplate?: string | Function; - mobile?: boolean | string; + minorTimeHeaderTemplate?: string|Function; + mobile?: boolean|string; pdf?: SchedulerPdf; resources?: SchedulerResource[]; selectable?: boolean; @@ -6292,8 +6291,8 @@ declare namespace kendo.ui { timezone?: string; toolbar?: SchedulerToolbarItem[]; views?: SchedulerView[]; - groupHeaderTemplate?: string | Function; - width?: number | string; + groupHeaderTemplate?: string|Function; + width?: number|string; workDayStart?: Date; workDayEnd?: Date; workWeekStart?: number; @@ -6489,17 +6488,17 @@ declare namespace kendo.ui { name?: string; axis?: string; autoScroll?: boolean; - container?: string | JQuery; + container?: string|JQuery; connectWith?: string; cursor?: string; cursorOffset?: SortableCursorOffset; disabled?: string; filter?: string; handler?: string; - hint?: Function | string | JQuery; + hint?: Function|string|JQuery; holdToDrag?: boolean; ignore?: string; - placeholder?: Function | string | JQuery; + placeholder?: Function|string|JQuery; start?(e: SortableStartEvent): void; move?(e: SortableMoveEvent): void; end?(e: SortableEndEvent): void; @@ -6686,10 +6685,10 @@ declare namespace kendo.ui { } interface SpreadsheetPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface SpreadsheetPdf { @@ -6705,7 +6704,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: SpreadsheetPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -6729,7 +6728,7 @@ declare namespace kendo.ui { index?: number; logic?: string; type?: string; - value?: number | string | Date; + value?: number|string|Date; values?: any; } @@ -6787,7 +6786,7 @@ declare namespace kendo.ui { link?: string; textAlign?: string; underline?: boolean; - value?: number | string | boolean | Date; + value?: number|string|boolean|Date; validation?: SpreadsheetSheetRowCellValidation; verticalAlign?: string; wrap?: boolean; @@ -6825,9 +6824,9 @@ declare namespace kendo.ui { } interface SpreadsheetToolbar { - home?: boolean | any; - insert?: boolean | any; - data?: boolean | any; + home?: boolean|any; + insert?: boolean|any; + data?: boolean|any; } interface SpreadsheetInsertSheetOptions { @@ -6854,7 +6853,7 @@ declare namespace kendo.ui { rows?: number; sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; - toolbar?: boolean | SpreadsheetToolbar; + toolbar?: boolean|SpreadsheetToolbar; change?(e: SpreadsheetChangeEvent): void; render?(e: SpreadsheetRenderEvent): void; excelExport?(e: SpreadsheetExcelExportEvent): void; @@ -6880,7 +6879,7 @@ declare namespace kendo.ui { } interface SpreadsheetExcelImportEvent extends SpreadsheetEvent { - file?: Blob | File; + file?: Blob|File; progress?: JQueryPromise; } @@ -6980,18 +6979,18 @@ declare namespace kendo.ui { interface TabStripOptions { name?: string; - animation?: boolean | TabStripAnimation; + animation?: boolean|TabStripAnimation; collapsible?: boolean; contentUrls?: any; dataContentField?: string; dataContentUrlField?: string; dataImageUrlField?: string; - dataSource?: any | any | kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; dataSpriteCssClass?: string; dataTextField?: string; dataUrlField?: string; navigatable?: boolean; - scrollable?: boolean | TabStripScrollable; + scrollable?: boolean|TabStripScrollable; tabPosition?: string; value?: string; activate?(e: TabStripActivateEvent): void; @@ -7082,7 +7081,7 @@ declare namespace kendo.ui { interface TimePickerOptions { name?: string; - animation?: boolean | TimePickerAnimation; + animation?: boolean|TimePickerAnimation; culture?: string; dates?: any; format?: string; @@ -7188,13 +7187,13 @@ declare namespace kendo.ui { imageUrl?: string; menuButtons?: ToolBarItemMenuButton[]; overflow?: string; - overflowTemplate?: string | Function; + overflowTemplate?: string|Function; primary?: boolean; selected?: boolean; showIcon?: string; showText?: string; spriteCssClass?: string; - template?: string | Function; + template?: string|Function; text?: string; togglable?: boolean; toggle?: Function; @@ -7289,7 +7288,7 @@ declare namespace kendo.ui { interface TooltipOptions { name?: string; autoHide?: boolean; - animation?: boolean | TooltipAnimation; + animation?: boolean|TooltipAnimation; content?: TooltipContent; callout?: boolean; filter?: string; @@ -7514,7 +7513,7 @@ declare namespace kendo.ui { } interface TreeListColumnFilterable { - ui?: string | Function; + ui?: string|Function; } interface TreeListColumnSortable { @@ -7527,16 +7526,16 @@ declare namespace kendo.ui { encoded?: boolean; expandable?: boolean; field?: string; - filterable?: boolean | TreeListColumnFilterable; - footerTemplate?: string | Function; + filterable?: boolean|TreeListColumnFilterable; + footerTemplate?: string|Function; format?: string; headerAttributes?: any; - headerTemplate?: string | Function; + headerTemplate?: string|Function; minScreenWidth?: number; - sortable?: boolean | TreeListColumnSortable; - template?: string | Function; + sortable?: boolean|TreeListColumnSortable; + template?: string|Function; title?: string; - width?: string | number; + width?: string|number; hidden?: boolean; menu?: boolean; locked?: boolean; @@ -7546,7 +7545,7 @@ declare namespace kendo.ui { interface TreeListEditable { mode?: string; move?: boolean; - template?: string | Function; + template?: string|Function; window?: any; } @@ -7595,15 +7594,15 @@ declare namespace kendo.ui { } interface TreeListPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface TreeListPdf { author?: string; - avoidLinks?: boolean | string; + avoidLinks?: boolean|string; creator?: string; date?: Date; fileName?: string; @@ -7611,7 +7610,7 @@ declare namespace kendo.ui { keywords?: string; landscape?: boolean; margin?: TreeListPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -7634,17 +7633,17 @@ declare namespace kendo.ui { columns?: TreeListColumn[]; resizable?: boolean; reorderable?: boolean; - columnMenu?: boolean | TreeListColumnMenu; - dataSource?: any | any | kendo.data.TreeListDataSource; - editable?: boolean | TreeListEditable; + columnMenu?: boolean|TreeListColumnMenu; + dataSource?: any|any|kendo.data.TreeListDataSource; + editable?: boolean|TreeListEditable; excel?: TreeListExcel; - filterable?: boolean | TreeListFilterable; - height?: number | string; + filterable?: boolean|TreeListFilterable; + height?: number|string; messages?: TreeListMessages; pdf?: TreeListPdf; - scrollable?: boolean | any; - selectable?: boolean | string; - sortable?: boolean | TreeListSortable; + scrollable?: boolean|any; + selectable?: boolean|string; + sortable?: boolean|TreeListSortable; toolbar?: TreeListToolbarItem[]; cancel?(e: TreeListCancelEvent): void; change?(e: TreeListChangeEvent): void; @@ -7859,14 +7858,14 @@ declare namespace kendo.ui { } interface TreeViewAnimation { - collapse?: boolean | TreeViewAnimationCollapse; - expand?: boolean | TreeViewAnimationExpand; + collapse?: boolean|TreeViewAnimationCollapse; + expand?: boolean|TreeViewAnimationExpand; } interface TreeViewCheckboxes { checkChildren?: boolean; name?: string; - template?: string | Function; + template?: string|Function; } interface TreeViewMessages { @@ -7877,19 +7876,19 @@ declare namespace kendo.ui { interface TreeViewOptions { name?: string; - animation?: boolean | TreeViewAnimation; + animation?: boolean|TreeViewAnimation; autoBind?: boolean; autoScroll?: boolean; - checkboxes?: boolean | TreeViewCheckboxes; + checkboxes?: boolean|TreeViewCheckboxes; dataImageUrlField?: string; - dataSource?: any | any | kendo.data.HierarchicalDataSource; + dataSource?: any|any|kendo.data.HierarchicalDataSource; dataSpriteCssClassField?: string; - dataTextField?: string | any; + dataTextField?: string|any; dataUrlField?: string; dragAndDrop?: boolean; loadOnDemand?: boolean; messages?: TreeViewMessages; - template?: string | Function; + template?: string|Function; change?(e: TreeViewEvent): void; check?(e: TreeViewCheckEvent): void; collapse?(e: TreeViewCollapseEvent): void; @@ -8022,7 +8021,7 @@ declare namespace kendo.ui { localization?: UploadLocalization; multiple?: boolean; showFileList?: boolean; - template?: string | Function; + template?: string|Function; cancel?(e: UploadCancelEvent): void; complete?(e: UploadEvent): void; error?(e: UploadErrorEvent): void; @@ -8176,8 +8175,8 @@ declare namespace kendo.ui { } interface WindowPosition { - top?: number | string; - left?: number | string; + top?: number|string; + left?: number|string; } interface WindowRefreshOptions { @@ -8192,13 +8191,13 @@ declare namespace kendo.ui { interface WindowOptions { name?: string; actions?: any; - animation?: boolean | WindowAnimation; - appendTo?: any | string; + animation?: boolean|WindowAnimation; + appendTo?: any|string; autoFocus?: boolean; content?: WindowContent; draggable?: boolean; iframe?: boolean; - height?: number | string; + height?: number|string; maxHeight?: number; maxWidth?: number; minHeight?: number; @@ -8208,9 +8207,9 @@ declare namespace kendo.ui { position?: WindowPosition; resizable?: boolean; scrollable?: boolean; - title?: string | boolean; + title?: string|boolean; visible?: boolean; - width?: number | string; + width?: number|string; activate?(e: WindowEvent): void; close?(e: WindowCloseEvent): void; deactivate?(e: WindowEvent): void; @@ -8380,7 +8379,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartAxisDefaultsCrosshairTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -8408,7 +8407,7 @@ declare namespace kendo.dataviz.ui { interface ChartAxisDefaultsLabelsRotation { align?: string; - angle?: number | string; + angle?: number|string; } interface ChartAxisDefaultsLabels { @@ -8420,7 +8419,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartAxisDefaultsLabelsRotation; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -8558,7 +8557,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartCategoryAxisItemCrosshairTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -8600,7 +8599,7 @@ declare namespace kendo.dataviz.ui { interface ChartCategoryAxisItemLabelsRotation { align?: string; - angle?: number | string; + angle?: number|string; } interface ChartCategoryAxisItemLabels { @@ -8617,7 +8616,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartCategoryAxisItemLabelsRotation; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -8689,7 +8688,7 @@ declare namespace kendo.dataviz.ui { border?: ChartCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8735,7 +8734,7 @@ declare namespace kendo.dataviz.ui { border?: ChartCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -8813,7 +8812,7 @@ declare namespace kendo.dataviz.ui { interface ChartCategoryAxisItem { autoBaseUnitSteps?: ChartCategoryAxisItemAutoBaseUnitSteps; - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; baseUnitStep?: any; @@ -8877,7 +8876,7 @@ declare namespace kendo.dataviz.ui { interface ChartLegendInactiveItemsLabels { color?: string; font?: string; - template?: string | Function; + template?: string|Function; } interface ChartLegendInactiveItems { @@ -8908,7 +8907,7 @@ declare namespace kendo.dataviz.ui { font?: string; margin?: ChartLegendLabelsMargin; padding?: ChartLegendLabelsPadding; - template?: string | Function; + template?: string|Function; } interface ChartLegendMargin { @@ -9006,10 +9005,10 @@ declare namespace kendo.dataviz.ui { } interface ChartPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface ChartPdf { @@ -9021,7 +9020,7 @@ declare namespace kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: ChartPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -9057,10 +9056,10 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemBorder { - color?: string | Function; - dashType?: string | Function; - opacity?: number | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + opacity?: number|Function; + width?: number|Function; } interface ChartSeriesItemConnectors { @@ -9075,26 +9074,26 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemErrorBars { - value?: string | number | any | Function; + value?: string|number|any|Function; visual?: Function; - xValue?: string | number | any | Function; - yValue?: string | number | any | Function; + xValue?: string|number|any|Function; + yValue?: string|number|any|Function; endCaps?: boolean; color?: string; line?: ChartSeriesItemErrorBarsLine; } interface ChartSeriesItemExtremesBorder { - color?: string | Function; - width?: number | Function; + color?: string|Function; + width?: number|Function; } interface ChartSeriesItemExtremes { - background?: string | Function; + background?: string|Function; border?: ChartSeriesItemExtremesBorder; - size?: number | Function; - type?: string | Function; - rotation?: number | Function; + size?: number|Function; + type?: string|Function; + rotation?: number|Function; } interface ChartSeriesItemHighlightBorder { @@ -9120,15 +9119,15 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemLabelsFromBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemLabelsFromMargin { @@ -9146,16 +9145,16 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsFrom { - background?: string | Function; + background?: string|Function; border?: ChartSeriesItemLabelsFromBorder; - color?: string | Function; - font?: string | Function; - format?: string | Function; + color?: string|Function; + font?: string|Function; + format?: string|Function; margin?: ChartSeriesItemLabelsFromMargin; padding?: ChartSeriesItemLabelsFromPadding; - position?: string | Function; - template?: string | Function; - visible?: boolean | Function; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface ChartSeriesItemLabelsMargin { @@ -9173,9 +9172,9 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsToBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemLabelsToMargin { @@ -9193,31 +9192,31 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemLabelsTo { - background?: string | Function; + background?: string|Function; border?: ChartSeriesItemLabelsToBorder; - color?: string | Function; - font?: string | Function; - format?: string | Function; + color?: string|Function; + font?: string|Function; + format?: string|Function; margin?: ChartSeriesItemLabelsToMargin; padding?: ChartSeriesItemLabelsToPadding; - position?: string | Function; - template?: string | Function; - visible?: boolean | Function; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface ChartSeriesItemLabels { align?: string; - background?: string | Function; + background?: string|Function; border?: ChartSeriesItemLabelsBorder; - color?: string | Function; + color?: string|Function; distance?: number; - font?: string | Function; - format?: string | Function; + font?: string|Function; + format?: string|Function; margin?: ChartSeriesItemLabelsMargin; padding?: ChartSeriesItemLabelsPadding; - position?: string | Function; - template?: string | Function; - visible?: boolean | Function; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; visual?: Function; from?: ChartSeriesItemLabelsFrom; to?: ChartSeriesItemLabelsTo; @@ -9238,18 +9237,18 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemMarkersBorder { - color?: string | Function; - width?: number | Function; + color?: string|Function; + width?: number|Function; } interface ChartSeriesItemMarkers { - background?: string | Function; + background?: string|Function; border?: ChartSeriesItemMarkersBorder; - size?: number | Function; - type?: string | Function; - visible?: boolean | Function; + size?: number|Function; + type?: string|Function; + visible?: boolean|Function; visual?: Function; - rotation?: number | Function; + rotation?: number|Function; } interface ChartSeriesItemNegativeValues { @@ -9281,7 +9280,7 @@ declare namespace kendo.dataviz.ui { border?: ChartSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -9303,16 +9302,16 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemOutliersBorder { - color?: string | Function; - width?: number | Function; + color?: string|Function; + width?: number|Function; } interface ChartSeriesItemOutliers { - background?: string | Function; + background?: string|Function; border?: ChartSeriesItemOutliersBorder; - size?: number | Function; - type?: string | Function; - rotation?: number | Function; + size?: number|Function; + type?: string|Function; + rotation?: number|Function; } interface ChartSeriesItemOverlay { @@ -9325,18 +9324,18 @@ declare namespace kendo.dataviz.ui { } interface ChartSeriesItemTargetBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface ChartSeriesItemTargetLine { - width?: any | Function; + width?: any|Function; } interface ChartSeriesItemTarget { border?: ChartSeriesItemTargetBorder; - color?: string | Function; + color?: string|Function; line?: ChartSeriesItemTargetLine; } @@ -9359,23 +9358,23 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartSeriesItemTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } interface ChartSeriesItem { - aggregate?: string | Function; + aggregate?: string|Function; axis?: string; border?: ChartSeriesItemBorder; categoryField?: string; closeField?: string; - color?: string | Function; + color?: string|Function; colorField?: string; connectors?: ChartSeriesItemConnectors; currentField?: string; dashType?: string; data?: any; - downColor?: string | Function; + downColor?: string|Function; downColorField?: string; segmentSpacing?: number; summaryField?: string; @@ -9426,7 +9425,7 @@ declare namespace kendo.dataviz.ui { size?: number; sizeField?: string; spacing?: number; - stack?: boolean | ChartSeriesItemStack; + stack?: boolean|ChartSeriesItemStack; startAngle?: number; target?: ChartSeriesItemTarget; targetField?: string; @@ -9485,7 +9484,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsFromMargin; padding?: ChartSeriesDefaultsLabelsFromPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -9531,7 +9530,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsToMargin; padding?: ChartSeriesDefaultsLabelsToPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -9543,7 +9542,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsMargin; padding?: ChartSeriesDefaultsLabelsPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; visual?: Function; from?: ChartSeriesDefaultsLabelsFrom; @@ -9574,7 +9573,7 @@ declare namespace kendo.dataviz.ui { border?: ChartSeriesDefaultsNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -9621,7 +9620,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartSeriesDefaultsTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -9642,7 +9641,7 @@ declare namespace kendo.dataviz.ui { scatter?: any; scatterLine?: any; spacing?: number; - stack?: boolean | ChartSeriesDefaultsStack; + stack?: boolean|ChartSeriesDefaultsStack; type?: string; tooltip?: ChartSeriesDefaultsTooltip; verticalArea?: any; @@ -9705,8 +9704,8 @@ declare namespace kendo.dataviz.ui { opacity?: number; padding?: ChartTooltipPadding; shared?: boolean; - sharedTemplate?: string | Function; - template?: string | Function; + sharedTemplate?: string|Function; + template?: string|Function; visible?: boolean; } @@ -9730,7 +9729,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartValueAxisItemCrosshairTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -9764,7 +9763,7 @@ declare namespace kendo.dataviz.ui { interface ChartValueAxisItemLabelsRotation { align?: string; - angle?: number | string; + angle?: number|string; } interface ChartValueAxisItemLabels { @@ -9779,7 +9778,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartValueAxisItemLabelsRotation; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -9852,7 +9851,7 @@ declare namespace kendo.dataviz.ui { border?: ChartValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -9898,7 +9897,7 @@ declare namespace kendo.dataviz.ui { border?: ChartValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -9962,7 +9961,7 @@ declare namespace kendo.dataviz.ui { } interface ChartValueAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; background?: string; color?: string; crosshair?: ChartValueAxisItemCrosshair; @@ -10007,7 +10006,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartXAxisItemCrosshairTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -10049,7 +10048,7 @@ declare namespace kendo.dataviz.ui { interface ChartXAxisItemLabelsRotation { align?: string; - angle?: number | string; + angle?: number|string; } interface ChartXAxisItemLabels { @@ -10066,7 +10065,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartXAxisItemLabelsRotation; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -10138,7 +10137,7 @@ declare namespace kendo.dataviz.ui { border?: ChartXAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -10184,7 +10183,7 @@ declare namespace kendo.dataviz.ui { border?: ChartXAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -10248,7 +10247,7 @@ declare namespace kendo.dataviz.ui { } interface ChartXAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; color?: string; @@ -10295,7 +10294,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: ChartYAxisItemCrosshairTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -10354,7 +10353,7 @@ declare namespace kendo.dataviz.ui { rotation?: ChartYAxisItemLabelsRotation; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; visual?: Function; } @@ -10426,7 +10425,7 @@ declare namespace kendo.dataviz.ui { border?: ChartYAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -10472,7 +10471,7 @@ declare namespace kendo.dataviz.ui { border?: ChartYAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -10536,7 +10535,7 @@ declare namespace kendo.dataviz.ui { } interface ChartYAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; color?: string; @@ -10572,8 +10571,8 @@ declare namespace kendo.dataviz.ui { } interface ChartZoomable { - mousewheel?: boolean | ChartZoomableMousewheel; - selection?: boolean | ChartZoomableSelection; + mousewheel?: boolean|ChartZoomableMousewheel; + selection?: boolean|ChartZoomableSelection; } interface ChartExportImageOptions { @@ -10606,13 +10605,14 @@ declare namespace kendo.dataviz.ui { interface ChartOptions { name?: string; autoBind?: boolean; - axisDefaults?: any; + axisDefaults?: ChartAxisDefaults; categoryAxis?: ChartCategoryAxisItem[]; valueAxis?: ChartValueAxisItem[]; chartArea?: ChartChartArea; - dataSource?: any; + dataSource?: any|any|kendo.data.DataSource; legend?: ChartLegend; panes?: ChartPane[]; + pannable?: boolean|ChartPannable; pdf?: ChartPdf; plotArea?: ChartPlotArea; renderAs?: string; @@ -10625,6 +10625,7 @@ declare namespace kendo.dataviz.ui { transitions?: boolean; xAxis?: ChartXAxisItem[]; yAxis?: ChartYAxisItem[]; + zoomable?: boolean|ChartZoomable; axisLabelClick?(e: ChartAxisLabelClickEvent): void; legendItemClick?(e: ChartLegendItemClickEvent): void; legendItemHover?(e: ChartLegendItemHoverEvent): void; @@ -10635,14 +10636,13 @@ declare namespace kendo.dataviz.ui { noteClick?(e: ChartNoteClickEvent): void; noteHover?(e: ChartNoteHoverEvent): void; plotAreaClick?(e: ChartPlotAreaClickEvent): void; - pannable?:any; + plotAreaHover?(e: ChartPlotAreaHoverEvent): void; render?(e: ChartEvent): void; select?(e: ChartSelectEvent): void; selectEnd?(e: ChartSelectEndEvent): void; selectStart?(e: ChartSelectStartEvent): void; seriesClick?(e: ChartSeriesClickEvent): void; seriesHover?(e: ChartSeriesHoverEvent): void; - zoomable?:any; zoom?(e: ChartZoomEvent): void; zoomEnd?(e: ChartZoomEndEvent): void; zoomStart?(e: ChartZoomStartEvent): void; @@ -10875,7 +10875,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string | Function; + template?: string|Function; text?: string; visual?: Function; } @@ -10956,7 +10956,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnectionDefaults { content?: DiagramConnectionDefaultsContent; - editable?: boolean | DiagramConnectionDefaultsEditable; + editable?: boolean|DiagramConnectionDefaultsEditable; endCap?: DiagramConnectionDefaultsEndCap; fromConnector?: string; hover?: DiagramConnectionDefaultsHover; @@ -10974,7 +10974,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string | Function; + template?: string|Function; text?: string; visual?: Function; } @@ -11068,7 +11068,7 @@ declare namespace kendo.dataviz.ui { interface DiagramConnection { content?: DiagramConnectionContent; - editable?: boolean | DiagramConnectionEditable; + editable?: boolean|DiagramConnectionEditable; endCap?: DiagramConnectionEndCap; from?: DiagramConnectionFrom; fromConnector?: string; @@ -11087,7 +11087,7 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditableDrag { - snap?: boolean | DiagramEditableDragSnap; + snap?: boolean|DiagramEditableDragSnap; } interface DiagramEditableResizeHandlesFill { @@ -11150,12 +11150,12 @@ declare namespace kendo.dataviz.ui { } interface DiagramEditable { - connectionTemplate?: string | Function; - drag?: boolean | DiagramEditableDrag; + connectionTemplate?: string|Function; + drag?: boolean|DiagramEditableDrag; remove?: boolean; - resize?: boolean | DiagramEditableResize; - rotate?: boolean | DiagramEditableRotate; - shapeTemplate?: string | Function; + resize?: boolean|DiagramEditableResize; + rotate?: boolean|DiagramEditableRotate; + shapeTemplate?: string|Function; tools?: DiagramEditableTool[]; } @@ -11191,10 +11191,10 @@ declare namespace kendo.dataviz.ui { } interface DiagramPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface DiagramPdf { @@ -11206,7 +11206,7 @@ declare namespace kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: DiagramPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -11303,7 +11303,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string | Function; + template?: string|Function; text?: string; } @@ -11363,7 +11363,7 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeDefaultsConnector[]; connectorDefaults?: DiagramShapeDefaultsConnectorDefaults; content?: DiagramShapeDefaultsContent; - editable?: boolean | DiagramShapeDefaultsEditable; + editable?: boolean|DiagramShapeDefaultsEditable; fill?: DiagramShapeDefaultsFill; height?: number; hover?: DiagramShapeDefaultsHover; @@ -11461,7 +11461,7 @@ declare namespace kendo.dataviz.ui { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string | Function; + template?: string|Function; text?: string; } @@ -11519,7 +11519,7 @@ declare namespace kendo.dataviz.ui { connectors?: DiagramShapeConnector[]; connectorDefaults?: DiagramShapeConnectorDefaults; content?: DiagramShapeContent; - editable?: boolean | DiagramShapeEditable; + editable?: boolean|DiagramShapeEditable; fill?: DiagramShapeFill; height?: number; hover?: DiagramShapeHover; @@ -11556,16 +11556,16 @@ declare namespace kendo.dataviz.ui { autoBind?: boolean; connectionDefaults?: DiagramConnectionDefaults; connections?: DiagramConnection[]; - connectionsDataSource?: any | any | kendo.data.DataSource; - dataSource?: any | any | kendo.data.DataSource; - editable?: boolean | DiagramEditable; + connectionsDataSource?: any|any|kendo.data.DataSource; + dataSource?: any|any|kendo.data.DataSource; + editable?: boolean|DiagramEditable; layout?: DiagramLayout; - pannable?: boolean | DiagramPannable; + pannable?: boolean|DiagramPannable; pdf?: DiagramPdf; - selectable?: boolean | DiagramSelectable; + selectable?: boolean|DiagramSelectable; shapeDefaults?: DiagramShapeDefaults; shapes?: DiagramShape[]; - template?: string | Function; + template?: string|Function; zoom?: number; zoomMax?: number; zoomMin?: number; @@ -11773,7 +11773,7 @@ declare namespace kendo.dataviz.ui { interface LinearGaugePointerItem { border?: LinearGaugePointerItemBorder; color?: string; - margin?: number | any; + margin?: number|any; opacity?: number; shape?: string; size?: number; @@ -11809,7 +11809,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: LinearGaugeScaleLabelsMargin; padding?: LinearGaugeScaleLabelsPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -11941,9 +11941,9 @@ declare namespace kendo.dataviz.ui { } interface MapControls { - attribution?: boolean | MapControlsAttribution; - navigator?: boolean | MapControlsNavigator; - zoom?: boolean | MapControlsZoom; + attribution?: boolean|MapControlsAttribution; + navigator?: boolean|MapControlsNavigator; + zoom?: boolean|MapControlsZoom; } interface MapLayerDefaultsBing { @@ -11977,7 +11977,7 @@ declare namespace kendo.dataviz.ui { maxSize?: number; minSize?: number; style?: MapLayerDefaultsBubbleStyle; - symbol?: string | Function; + symbol?: string|Function; } interface MapLayerDefaultsMarkerTooltipAnimationClose { @@ -12111,8 +12111,8 @@ declare namespace kendo.dataviz.ui { interface MapLayer { attribution?: string; autoBind?: boolean; - dataSource?: any | any | kendo.data.DataSource; - extent?: any | kendo.dataviz.map.Extent; + dataSource?: any|any|kendo.data.DataSource; + extent?: any|kendo.dataviz.map.Extent; key?: string; imagerySet?: string; culture?: string; @@ -12125,7 +12125,7 @@ declare namespace kendo.dataviz.ui { minSize?: number; opacity?: number; subdomains?: any; - symbol?: string | Function; + symbol?: string|Function; type?: string; style?: MapLayerStyle; urlTemplate?: string; @@ -12205,7 +12205,7 @@ declare namespace kendo.dataviz.ui { } interface MapMarker { - location?: any | kendo.dataviz.map.Location; + location?: any|kendo.dataviz.map.Location; shape?: string; title?: string; tooltip?: MapMarkerTooltip; @@ -12213,7 +12213,7 @@ declare namespace kendo.dataviz.ui { interface MapOptions { name?: string; - center?: any | kendo.dataviz.map.Location; + center?: any|kendo.dataviz.map.Location; controls?: MapControls; layerDefaults?: MapLayerDefaults; layers?: MapLayer[]; @@ -12378,8 +12378,8 @@ declare namespace kendo.dataviz.ui { errorCorrection?: string; padding?: number; renderAs?: string; - size?: number | string; - value?: number | string; + size?: number|string; + value?: number|string; } interface QRCodeEvent { sender: QRCode; @@ -12479,7 +12479,7 @@ declare namespace kendo.dataviz.ui { margin?: RadialGaugeScaleLabelsMargin; padding?: RadialGaugeScaleLabelsPadding; position?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -12584,8 +12584,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -12610,13 +12610,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; + margin?: number|any; mirror?: boolean; - padding?: number | any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; culture?: string; dateFormats?: any; @@ -12689,7 +12689,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12735,7 +12735,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12774,7 +12774,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineCategoryAxisItemTitleBorder; color?: string; font?: string; - margin?: number | any; + margin?: number|any; position?: string; rotation?: number; text?: string; @@ -12782,7 +12782,7 @@ declare namespace kendo.dataviz.ui { } interface SparklineCategoryAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; categories?: any; color?: string; field?: string; @@ -12822,7 +12822,7 @@ declare namespace kendo.dataviz.ui { opacity?: number; border?: SparklineChartAreaBorder; height?: number; - margin?: number | any; + margin?: number|any; width?: number; } @@ -12836,14 +12836,14 @@ declare namespace kendo.dataviz.ui { background?: string; opacity?: number; border?: SparklinePlotAreaBorder; - margin?: number | any; + margin?: number|any; } interface SparklineSeriesItemBorder { - color?: string | Function; - dashType?: string | Function; - opacity?: number | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + opacity?: number|Function; + width?: number|Function; } interface SparklineSeriesItemConnectors { @@ -12866,24 +12866,24 @@ declare namespace kendo.dataviz.ui { } interface SparklineSeriesItemLabelsBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface SparklineSeriesItemLabels { align?: string; - background?: string | Function; + background?: string|Function; border?: SparklineSeriesItemLabelsBorder; - color?: string | Function; + color?: string|Function; distance?: number; - font?: string | Function; - format?: string | Function; - margin?: number | any; - padding?: number | any; - position?: string | Function; - template?: string | Function; - visible?: boolean | Function; + font?: string|Function; + format?: string|Function; + margin?: number|any; + padding?: number|any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface SparklineSeriesItemLine { @@ -12894,17 +12894,17 @@ declare namespace kendo.dataviz.ui { } interface SparklineSeriesItemMarkersBorder { - color?: string | Function; - width?: number | Function; + color?: string|Function; + width?: number|Function; } interface SparklineSeriesItemMarkers { - background?: string | Function; + background?: string|Function; border?: SparklineSeriesItemMarkersBorder; - size?: number | Function; - type?: string | Function; - visible?: boolean | Function; - rotation?: number | Function; + size?: number|Function; + type?: string|Function; + visible?: boolean|Function; + rotation?: number|Function; } interface SparklineSeriesItemNotesIconBorder { @@ -12931,7 +12931,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -12961,18 +12961,18 @@ declare namespace kendo.dataviz.ui { } interface SparklineSeriesItemTargetBorder { - color?: string | Function; - dashType?: string | Function; + color?: string|Function; + dashType?: string|Function; width?: number; } interface SparklineSeriesItemTargetLine { - width?: any | Function; + width?: any|Function; } interface SparklineSeriesItemTarget { line?: SparklineSeriesItemTargetLine; - color?: string | Function; + color?: string|Function; border?: SparklineSeriesItemTargetBorder; } @@ -12987,8 +12987,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -13002,11 +13002,11 @@ declare namespace kendo.dataviz.ui { field?: string; name?: string; highlight?: SparklineSeriesItemHighlight; - aggregate?: string | Function; + aggregate?: string|Function; axis?: string; border?: SparklineSeriesItemBorder; categoryField?: string; - color?: string | Function; + color?: string|Function; colorField?: string; connectors?: SparklineSeriesItemConnectors; gap?: number; @@ -13022,7 +13022,7 @@ declare namespace kendo.dataviz.ui { size?: number; startAngle?: number; spacing?: number; - stack?: boolean | SparklineSeriesItemStack; + stack?: boolean|SparklineSeriesItemStack; tooltip?: SparklineSeriesItemTooltip; width?: number; target?: SparklineSeriesItemTarget; @@ -13048,9 +13048,9 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; - padding?: number | any; - template?: string | Function; + margin?: number|any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -13069,8 +13069,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -13085,7 +13085,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean | SparklineSeriesDefaultsStack; + stack?: boolean|SparklineSeriesDefaultsStack; type?: string; tooltip?: SparklineSeriesDefaultsTooltip; } @@ -13101,8 +13101,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; shared?: boolean; sharedTemplate?: string; @@ -13119,8 +13119,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -13145,13 +13145,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; + margin?: number|any; mirror?: boolean; - padding?: number | any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -13221,7 +13221,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -13267,7 +13267,7 @@ declare namespace kendo.dataviz.ui { border?: SparklineValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -13306,8 +13306,8 @@ declare namespace kendo.dataviz.ui { border?: SparklineValueAxisItemTitleBorder; color?: string; font?: string; - margin?: number | any; - padding?: number | any; + margin?: number|any; + padding?: number|any; position?: string; rotation?: number; text?: string; @@ -13315,7 +13315,7 @@ declare namespace kendo.dataviz.ui { } interface SparklineValueAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; color?: string; labels?: SparklineValueAxisItemLabels; line?: SparklineValueAxisItemLine; @@ -13511,8 +13511,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -13537,13 +13537,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; + margin?: number|any; mirror?: boolean; - padding?: number | any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; culture?: string; dateFormats?: any; @@ -13616,7 +13616,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -13662,7 +13662,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -13714,7 +13714,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartCategoryAxisItemTitleBorder; color?: string; font?: string; - margin?: number | any; + margin?: number|any; position?: string; rotation?: number; text?: string; @@ -13722,7 +13722,7 @@ declare namespace kendo.dataviz.ui { } interface StockChartCategoryAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; categories?: any; color?: string; field?: string; @@ -13765,7 +13765,7 @@ declare namespace kendo.dataviz.ui { opacity?: number; border?: StockChartChartAreaBorder; height?: number; - margin?: number | any; + margin?: number|any; width?: number; } @@ -13806,10 +13806,10 @@ declare namespace kendo.dataviz.ui { border?: StockChartLegendBorder; item?: StockChartLegendItem; labels?: StockChartLegendLabels; - margin?: number | any; + margin?: number|any; offsetX?: number; offsetY?: number; - padding?: number | any; + padding?: number|any; position?: string; reverse?: boolean; visible?: boolean; @@ -13846,7 +13846,7 @@ declare namespace kendo.dataviz.ui { font?: string; format?: string; padding?: StockChartNavigatorCategoryAxisItemCrosshairTooltipPadding; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -13900,7 +13900,7 @@ declare namespace kendo.dataviz.ui { rotation?: number; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -13971,7 +13971,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartNavigatorCategoryAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -14017,7 +14017,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartNavigatorCategoryAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -14080,7 +14080,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorCategoryAxisItem { autoBaseUnitSteps?: StockChartNavigatorCategoryAxisItemAutoBaseUnitSteps; - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; baseUnitStep?: any; @@ -14109,7 +14109,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorHint { visible?: boolean; - template?: string | Function; + template?: string|Function; format?: string; } @@ -14210,10 +14210,10 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; - padding?: number | any; + margin?: number|any; + padding?: number|any; position?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -14231,7 +14231,7 @@ declare namespace kendo.dataviz.ui { interface StockChartNavigatorSeriesItemMarkers { background?: string; border?: StockChartNavigatorSeriesItemMarkersBorder; - rotation?: number | Function; + rotation?: number|Function; size?: number; type?: string; visible?: boolean; @@ -14257,8 +14257,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -14271,7 +14271,7 @@ declare namespace kendo.dataviz.ui { categoryField?: string; name?: string; highlight?: StockChartNavigatorSeriesItemHighlight; - aggregate?: string | Function; + aggregate?: string|Function; axis?: string; border?: StockChartNavigatorSeriesItemBorder; closeField?: string; @@ -14290,7 +14290,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartNavigatorSeriesItemOverlay; spacing?: number; - stack?: boolean | StockChartNavigatorSeriesItemStack; + stack?: boolean|StockChartNavigatorSeriesItemStack; tooltip?: StockChartNavigatorSeriesItemTooltip; width?: number; } @@ -14324,7 +14324,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartPaneTitleBorder; color?: string; font?: string; - margin?: number | any; + margin?: number|any; position?: string; text?: string; visible?: boolean; @@ -14332,8 +14332,8 @@ declare namespace kendo.dataviz.ui { interface StockChartPane { name?: string; - margin?: number | any; - padding?: number | any; + margin?: number|any; + padding?: number|any; background?: string; border?: StockChartPaneBorder; clip?: boolean; @@ -14342,10 +14342,10 @@ declare namespace kendo.dataviz.ui { } interface StockChartPdfMargin { - bottom?: number | string; - left?: number | string; - right?: number | string; - top?: number | string; + bottom?: number|string; + left?: number|string; + right?: number|string; + top?: number|string; } interface StockChartPdf { @@ -14357,7 +14357,7 @@ declare namespace kendo.dataviz.ui { keywords?: string; landscape?: boolean; margin?: StockChartPdfMargin; - paperSize?: string | any; + paperSize?: string|any; proxyURL?: string; proxyTarget?: string; subject?: string; @@ -14374,14 +14374,14 @@ declare namespace kendo.dataviz.ui { background?: string; opacity?: number; border?: StockChartPlotAreaBorder; - margin?: number | any; + margin?: number|any; } interface StockChartSeriesItemBorder { - color?: string | Function; - dashType?: string | Function; - opacity?: number | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + opacity?: number|Function; + width?: number|Function; } interface StockChartSeriesItemHighlightBorder { @@ -14405,22 +14405,22 @@ declare namespace kendo.dataviz.ui { } interface StockChartSeriesItemLabelsBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface StockChartSeriesItemLabels { - background?: string | Function; + background?: string|Function; border?: StockChartSeriesItemLabelsBorder; - color?: string | Function; - font?: string | Function; - format?: string | Function; - margin?: number | any; - padding?: number | any; - position?: string | Function; - template?: string | Function; - visible?: boolean | Function; + color?: string|Function; + font?: string|Function; + format?: string|Function; + margin?: number|any; + padding?: number|any; + position?: string|Function; + template?: string|Function; + visible?: boolean|Function; } interface StockChartSeriesItemLine { @@ -14431,17 +14431,17 @@ declare namespace kendo.dataviz.ui { } interface StockChartSeriesItemMarkersBorder { - color?: string | Function; - width?: number | Function; + color?: string|Function; + width?: number|Function; } interface StockChartSeriesItemMarkers { - background?: string | Function; + background?: string|Function; border?: StockChartSeriesItemMarkersBorder; - size?: number | Function; - rotation?: number | Function; - type?: string | Function; - visible?: boolean | Function; + size?: number|Function; + rotation?: number|Function; + type?: string|Function; + visible?: boolean|Function; } interface StockChartSeriesItemNotesIconBorder { @@ -14468,7 +14468,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartSeriesItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -14498,18 +14498,18 @@ declare namespace kendo.dataviz.ui { } interface StockChartSeriesItemTargetBorder { - color?: string | Function; - dashType?: string | Function; - width?: number | Function; + color?: string|Function; + dashType?: string|Function; + width?: number|Function; } interface StockChartSeriesItemTargetLine { - width?: any | Function; + width?: any|Function; } interface StockChartSeriesItemTarget { line?: StockChartSeriesItemTargetLine; - color?: string | Function; + color?: string|Function; border?: StockChartSeriesItemTargetBorder; } @@ -14524,8 +14524,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -14540,13 +14540,13 @@ declare namespace kendo.dataviz.ui { targetField?: string; name?: string; highlight?: StockChartSeriesItemHighlight; - aggregate?: string | Function; + aggregate?: string|Function; axis?: string; border?: StockChartSeriesItemBorder; closeField?: string; - color?: string | Function; + color?: string|Function; colorField?: string; - downColor?: string | Function; + downColor?: string|Function; downColorField?: string; gap?: number; labels?: StockChartSeriesItemLabels; @@ -14560,7 +14560,7 @@ declare namespace kendo.dataviz.ui { openField?: string; overlay?: StockChartSeriesItemOverlay; spacing?: number; - stack?: boolean | StockChartSeriesItemStack; + stack?: boolean|StockChartSeriesItemStack; tooltip?: StockChartSeriesItemTooltip; visibleInLegend?: boolean; width?: number; @@ -14587,9 +14587,9 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; - padding?: number | any; - template?: string | Function; + margin?: number|any; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -14608,8 +14608,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -14625,7 +14625,7 @@ declare namespace kendo.dataviz.ui { overlay?: any; pie?: any; spacing?: number; - stack?: boolean | StockChartSeriesDefaultsStack; + stack?: boolean|StockChartSeriesDefaultsStack; type?: string; tooltip?: StockChartSeriesDefaultsTooltip; } @@ -14642,8 +14642,8 @@ declare namespace kendo.dataviz.ui { border?: StockChartTitleBorder; font?: string; color?: string; - margin?: number | any; - padding?: number | any; + margin?: number|any; + padding?: number|any; position?: string; text?: string; visible?: boolean; @@ -14660,8 +14660,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; shared?: boolean; sharedTemplate?: string; @@ -14678,8 +14678,8 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - padding?: number | any; - template?: string | Function; + padding?: number|any; + template?: string|Function; visible?: boolean; } @@ -14704,13 +14704,13 @@ declare namespace kendo.dataviz.ui { color?: string; font?: string; format?: string; - margin?: number | any; + margin?: number|any; mirror?: boolean; - padding?: number | any; + padding?: number|any; rotation?: number; skip?: number; step?: number; - template?: string | Function; + template?: string|Function; visible?: boolean; } @@ -14780,7 +14780,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartValueAxisItemNotesDataItemLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -14826,7 +14826,7 @@ declare namespace kendo.dataviz.ui { border?: StockChartValueAxisItemNotesLabelBorder; color?: string; font?: string; - template?: string | Function; + template?: string|Function; visible?: boolean; rotation?: number; format?: string; @@ -14865,8 +14865,8 @@ declare namespace kendo.dataviz.ui { border?: StockChartValueAxisItemTitleBorder; color?: string; font?: string; - margin?: number | any; - padding?: number | any; + margin?: number|any; + padding?: number|any; position?: string; rotation?: number; text?: string; @@ -14874,7 +14874,7 @@ declare namespace kendo.dataviz.ui { } interface StockChartValueAxisItem { - axisCrossingValue?: any | Date | any; + axisCrossingValue?: any|Date|any; background?: string; color?: string; labels?: StockChartValueAxisItemLabels; @@ -15115,14 +15115,14 @@ declare namespace kendo.dataviz.ui { interface TreeMapOptions { name?: string; - dataSource?: any | any | kendo.data.HierarchicalDataSource; + dataSource?: any|any|kendo.data.HierarchicalDataSource; autoBind?: boolean; type?: string; theme?: string; valueField?: string; colorField?: string; textField?: string; - template?: string | Function; + template?: string|Function; colors?: any; itemCreated?(e: TreeMapItemCreatedEvent): void; dataBound?(e: TreeMapDataBoundEvent): void; @@ -15134,7 +15134,7 @@ declare namespace kendo.dataviz.ui { } interface TreeMapItemCreatedEvent extends TreeMapEvent { - element?: JQuery | Element; + element?: JQuery|Element; } interface TreeMapDataBoundEvent extends TreeMapEvent { @@ -15179,7 +15179,7 @@ declare namespace kendo.dataviz.map { nw: kendo.dataviz.map.Location; se: kendo.dataviz.map.Location; - constructor(nw: kendo.dataviz.map.Location | any, se: kendo.dataviz.map.Location | any); + constructor(nw: kendo.dataviz.map.Location|any, se: kendo.dataviz.map.Location|any); static create(a: kendo.dataviz.map.Location, b?: kendo.dataviz.map.Location): kendo.dataviz.map.Extent; static create(a: kendo.dataviz.map.Location, b?: any): kendo.dataviz.map.Extent; @@ -15319,7 +15319,7 @@ declare namespace kendo.dataviz.map { interface MarkerOptions { name?: string; - location?: any | kendo.dataviz.map.Location; + location?: any|kendo.dataviz.map.Location; shape?: string; title?: string; tooltip?: MarkerTooltip; @@ -15547,7 +15547,7 @@ declare namespace kendo.dataviz.diagram { fontSize?: number; fontStyle?: string; fontWeight?: string; - template?: string | Function; + template?: string|Function; text?: string; visual?: Function; } @@ -16244,7 +16244,7 @@ declare namespace kendo.dataviz.diagram { interface ShapeOptions { name?: string; id?: string; - editable?: boolean | ShapeEditable; + editable?: boolean|ShapeEditable; path?: string; stroke?: ShapeStroke; type?: string; @@ -16344,10 +16344,10 @@ declare namespace kendo { namespace drawing { function align(elements: any, rect: kendo.geometry.Rect, alignment: string): void; - function drawDOM(element: JQuery, options?: any): JQueryPromise; - function exportImage(group: kendo.drawing.Group, options?: any): JQueryPromise; - function exportPDF(group: kendo.drawing.Group, options?: kendo.drawing.PDFOptions): JQueryPromise; - function exportSVG(group: kendo.drawing.Group, options?: any): JQueryPromise; + function drawDOM(element: JQuery, options: any): JQueryPromise; + function exportImage(group: kendo.drawing.Group, options: any): JQueryPromise; + function exportPDF(group: kendo.drawing.Group, options: kendo.drawing.PDFOptions): JQueryPromise; + function exportSVG(group: kendo.drawing.Group, options: any): JQueryPromise; function fit(element: kendo.drawing.Element, rect: kendo.geometry.Rect): void; function stack(elements: any): void; function vAlign(elements: any, rect: kendo.geometry.Rect, alignment: string): void; @@ -16363,40 +16363,40 @@ declare namespace kendo { function transformOrigin(firstElement: HTMLElement, secondElement: HTMLElement): any; } - function antiForgeryTokens(): any; - function bind(element: string, viewModel: any, namespace?: any): void; - function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: JQuery, viewModel: any, namespace?: any): void; - function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function bind(element: Element, viewModel: any, namespace?: any): void; - function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; - function observableHierarchy(array: any): void; - function culture(culture: string): void; - function destroy(element: string): void; - function destroy(element: JQuery): void; - function destroy(element: Element): void; - function htmlEncode(value: string): string; - function parseDate(value: string, formats?: string, culture?: string): Date; - function parseDate(value: string, formats?: any, culture?: string): Date; - function parseFloat(value: string, culture?: string): number; - function parseInt(value: string, culture?: string): number; - function parseColor(color: string, noerror: boolean): kendo.Color; - function proxyModelSetters(): void; - function proxyModelSetters(data: kendo.data.Model): void; - function resize(element: string, force: boolean): void; - function resize(element: JQuery, force: boolean): void; - function resize(element: Element, force: boolean): void; - function saveAs(options: any): void; - function stringify(value: any): string; - function throttle(fn: Function, timeout: number): void; - function touchScroller(element: string): void; - function touchScroller(element: JQuery): void; - function touchScroller(element: Element): void; - function toString(value: Date, format: string, culture?: string): string; - function toString(value: number, format: string, culture?: string): string; - function unbind(element: string): void; - function unbind(element: JQuery): void; - function unbind(element: Element): void; + function antiForgeryTokens(): any; + function bind(element: string, viewModel: any, namespace?: any): void; + function bind(element: string, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: JQuery, viewModel: any, namespace?: any): void; + function bind(element: JQuery, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function bind(element: Element, viewModel: any, namespace?: any): void; + function bind(element: Element, viewModel: kendo.data.ObservableObject, namespace?: any): void; + function observableHierarchy(array: any): void; + function culture(culture: string): void; + function destroy(element: string): void; + function destroy(element: JQuery): void; + function destroy(element: Element): void; + function htmlEncode(value: string): string; + function parseDate(value: string, formats?: string, culture?: string): Date; + function parseDate(value: string, formats?: any, culture?: string): Date; + function parseFloat(value: string, culture?: string): number; + function parseInt(value: string, culture?: string): number; + function parseColor(color: string, noerror: boolean): kendo.Color; + function proxyModelSetters(): void; + function proxyModelSetters(data: kendo.data.Model): void; + function resize(element: string, force: boolean): void; + function resize(element: JQuery, force: boolean): void; + function resize(element: Element, force: boolean): void; + function saveAs(options: any): void; + function stringify(value: any): string; + function throttle(fn: Function, timeout: number): void; + function touchScroller(element: string): void; + function touchScroller(element: JQuery): void; + function touchScroller(element: Element): void; + function toString(value: Date, format: string, culture?: string): string; + function toString(value: number, format: string, culture?: string): string; + function unbind(element: string): void; + function unbind(element: JQuery): void; + function unbind(element: Element): void; namespace pdf { function defineFont(map: any): void; @@ -16648,9 +16648,9 @@ declare namespace kendo.mobile.ui { } interface ActionSheetPopup { - direction?: number | string; - height?: number | string; - width?: number | string; + direction?: number|string; + height?: number|string; + width?: number|string; } interface ActionSheetOptions { @@ -17018,18 +17018,18 @@ declare namespace kendo.mobile.ui { name?: string; appendOnRefresh?: boolean; autoBind?: boolean; - dataSource?: kendo.data.DataSource | any; + dataSource?: kendo.data.DataSource|any; endlessScroll?: boolean; fixedHeaders?: boolean; - headerTemplate?: string | Function; + headerTemplate?: string|Function; loadMore?: boolean; messages?: ListViewMessages; pullToRefresh?: boolean; pullParameters?: Function; style?: string; - template?: string | Function; + template?: string|Function; type?: string; - filterable?: boolean | ListViewFilterable; + filterable?: boolean|ListViewFilterable; virtualViewSize?: number; click?(e: ListViewClickEvent): void; dataBound?(e: ListViewEvent): void; @@ -17241,8 +17241,8 @@ declare namespace kendo.mobile.ui { } interface PopOverPopup { - height?: number | string; - width?: number | string; + height?: number|string; + width?: number|string; } interface PopOverOptions { @@ -17298,8 +17298,8 @@ declare namespace kendo.mobile.ui { name?: string; autoBind?: boolean; bounceVelocityThreshold?: number; - contentHeight?: number | string; - dataSource?: kendo.data.DataSource | any; + contentHeight?: number|string; + dataSource?: kendo.data.DataSource|any; duration?: number; emptyTemplate?: string; enablePager?: boolean; @@ -17678,7 +17678,7 @@ declare namespace kendo.ooxml { wrap?: boolean; vAlign?: string; verticalAlign?: string; - value?: Date | number | string | boolean; + value?: Date|number|string|boolean; } interface WorkbookSheetRow { @@ -17884,7 +17884,7 @@ declare namespace kendo.dataviz.geometry { origin: kendo.geometry.Point; size: kendo.geometry.Size; - constructor(origin: kendo.geometry.Point | any, size: kendo.geometry.Size | any); + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; @@ -18110,7 +18110,7 @@ declare namespace kendo.dataviz.drawing { } - interface FillOptions { + interface FillOptions { @@ -18409,7 +18409,7 @@ declare namespace kendo.dataviz.drawing { } - interface PDFOptions { + interface PDFOptions { @@ -18513,7 +18513,7 @@ declare namespace kendo.dataviz.drawing { interface RadialGradientOptions { name?: string; - center?: any | kendo.geometry.Point; + center?: any|kendo.geometry.Point; radius?: number; stops?: any; } @@ -18597,7 +18597,7 @@ declare namespace kendo.dataviz.drawing { } - interface StrokeOptions { + interface StrokeOptions { @@ -18651,8 +18651,8 @@ declare namespace kendo.dataviz.drawing { } interface SurfaceTooltip { - animation?: boolean | SurfaceTooltipAnimation; - appendTo?: string | JQuery; + animation?: boolean|SurfaceTooltipAnimation; + appendTo?: string|JQuery; } interface SurfaceOptions { @@ -18747,20 +18747,20 @@ declare namespace kendo.dataviz.drawing { } - interface TooltipOptions { + interface TooltipOptions { autoHide?: boolean; - content?: string | Function; + content?: string|Function; position?: string; - height?: number | string; + height?: number|string; hideDelay?: number; offset?: number; shared?: boolean; showAfter?: number; showOn?: string; - width?: number | string; + width?: number|string; From 41827bc8172dd4443e138a8d34e4ab90bfadd0e1 Mon Sep 17 00:00:00 2001 From: Gayan Ranasinghe Date: Mon, 25 Jul 2016 10:24:56 +0530 Subject: [PATCH 008/105] remove duplicates --- kendo-ui/kendo-ui.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 941a432d81..ab09a8882f 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -2657,7 +2657,6 @@ declare namespace kendo.ui { separator?: string; suggest?: boolean; headerTemplate?: string|Function; - headerTemplate?: string | Function; template?: string | Function; valuePrimitive?: boolean; virtual?: boolean|AutoCompleteVirtual; From c80a0222639890181395715c21c3e2b6ba86347c Mon Sep 17 00:00:00 2001 From: Maxim Samoilov Date: Tue, 2 Aug 2016 20:25:07 +0700 Subject: [PATCH 009/105] Fix StatelessComponent interface Props always pass to StatelessComponent even if we pass no props. Example: ```js function Test(props) { return
props: {JSON.stringify(props)}
} React.render(, document.body) ``` will render into `props: {}` [jsfiddle](https://jsfiddle.net/LL25c28c/) We need to fix this because otherwise we have error: `Property 'propName' does not exist on type 'IntrinsicAttributes & (IMyInterface | undefined)'.` for that code: ```js const MyComponent: React.SFC = ({ propName }: IMyInterface) => { // ... } ``` --- react/react.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react.d.ts b/react/react.d.ts index da99fc737a..919b16d386 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -197,7 +197,7 @@ declare namespace __React { type SFC

= StatelessComponent

; interface StatelessComponent

{ - (props?: P, context?: any): ReactElement; + (props: P, context?: any): ReactElement; propTypes?: ValidationMap

; contextTypes?: ValidationMap; defaultProps?: P; From cef1aab3400c1bec327573860d21e4b89622a593 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 13:40:48 +0200 Subject: [PATCH 010/105] Typings for the mongoose-paginate plugin --- mongoose-paginate/mongoose-paginate.d.ts | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 mongoose-paginate/mongoose-paginate.d.ts diff --git a/mongoose-paginate/mongoose-paginate.d.ts b/mongoose-paginate/mongoose-paginate.d.ts new file mode 100644 index 0000000000..48b0282bb4 --- /dev/null +++ b/mongoose-paginate/mongoose-paginate.d.ts @@ -0,0 +1,40 @@ +/// + +declare module 'mongoose' { + export interface PaginateOptions { + select?: Object | string; + sort?: Object | string; + populate?: Array | Array | Object | string; + lean?: boolean; + leanWithId?: boolean; + offset?: number; + page?: number; + limit?: number; + } + + export interface PaginateResult { + docs: Array; + total: number; + limit: number; + page?: number; + pages?: number; + offset?: number; + } + + export type PaginateModel = _PaginateModel & Model; + interface _PaginateModel { + paginate(query?: Object, options?: PaginateOptions, callback?: (err: any, result: PaginateResult) => void): Promise>; + } + + export function model( + name: string, + schema?: Schema, + collection?: string, + skipInit?: boolean): Statics & PaginateModel; +} + +declare module 'mongoose-paginate' { + import mongoose = require('mongoose'); + var _: (schema: mongoose.Schema) => void; + export = _; +} From ab34ec01c15dedbaec3de23400e73df593b4c043 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 13:46:21 +0200 Subject: [PATCH 011/105] Typings for the passport-local-mongoose plugin --- .../passport-local-mongoose.d.ts | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 passport-local-mongoose/passport-local-mongoose.d.ts diff --git a/passport-local-mongoose/passport-local-mongoose.d.ts b/passport-local-mongoose/passport-local-mongoose.d.ts new file mode 100644 index 0000000000..c0fd0bf6de --- /dev/null +++ b/passport-local-mongoose/passport-local-mongoose.d.ts @@ -0,0 +1,83 @@ +/// +/// + +declare module 'mongoose' { + import passportLocal = require('passport-local'); + + // methods + export interface PassportLocalDocument { + setPassword(password: string, cb: (err: any, res: any) => void): void; + authenticate(password: string, cb: (err: any, res: any, error: any) => void): void; + } + + // statics + export type PassportLocalModel = _PassportLocalModel & Model; + interface _PassportLocalModel { + authenticate(): (username: string, password: string, cb: (err: any, res: T, error: any) => void) => void; + serializeUser(): (user: PassportLocalModel, cb: (err: any) => void) => void; + deserializeUser(): (username: string, cb: (err: any) => void) => void; + register(user: PassportLocalModel, password: string, cb: (err: any) => void): void; + findByUsername(username: string, selectHashSaltFields: boolean, cb: (err: any) => void): any; + createStrategy(): passportLocal.Strategy; + } + + // error messages + export interface PassportLocalErrorMessages { + MissingPasswordError?: string; + AttemptTooSoonError?: string; + TooManyAttemptsError?: string; + NoSaltValueStoredError?: string; + IncorrectPasswordError?: string; + IncorrectUsernameError?: string; + MissingUsernameError?: string; + UserExistsError?: string; + } + + // plugin options + export interface PassportLocalOptions { + saltlen?: number; + iterations?: number; + keylen?: number; + encoding?: string; + digestAlgorithm?: string; + passwordValidator?: (password: string, cb: (err: any) => void) => void; + + usernameField?: string; + usernameUnique?: boolean; + + usernameQueryFields: Array; + + usernameLowerCase?: boolean; + + hashField?: string; + saltField?: string; + + limitAttempts?: boolean; + lastLoginField?: string; + attemptsField?: string; + interval?: number; + maxInterval?: number; + maxAttempts?: number; + + errorMessages?: PassportLocalErrorMessages; + } + + export interface PassportLocalSchema extends Schema { + plugin( + plugin: (schema: PassportLocalSchema, options?: PassportLocalOptions) => void, + options?: PassportLocalOptions + ): this; + } + + export function model( + name: string, + schema?: PassportLocalSchema, + collection?: string, + skipInit?: boolean): Statics & PassportLocalModel; +} + +declare module 'passport-local-mongoose' { + import mongoose = require('mongoose'); + var _: (schema: mongoose.Schema, options?: Object) => void; + export = _; +} From c33fce7326815671fae64b7b300a2ecd4b0a0727 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 13:55:15 +0200 Subject: [PATCH 012/105] Added header --- mongoose-paginate/mongoose-paginate.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mongoose-paginate/mongoose-paginate.d.ts b/mongoose-paginate/mongoose-paginate.d.ts index 48b0282bb4..9b90c1012e 100644 --- a/mongoose-paginate/mongoose-paginate.d.ts +++ b/mongoose-paginate/mongoose-paginate.d.ts @@ -1,3 +1,7 @@ +// Type definitions for mongoose-paginate 5.0.0 +// Project: https://github.com/edwardhotchkiss/mongoose-paginate +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// declare module 'mongoose' { From 0bb4aa560e9838fccc2a8bbac2d8b0f834e57e2c Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 13:59:13 +0200 Subject: [PATCH 013/105] Added more information to header --- mongoose-paginate/mongoose-paginate.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/mongoose-paginate/mongoose-paginate.d.ts b/mongoose-paginate/mongoose-paginate.d.ts index 9b90c1012e..5481c42775 100644 --- a/mongoose-paginate/mongoose-paginate.d.ts +++ b/mongoose-paginate/mongoose-paginate.d.ts @@ -1,5 +1,6 @@ // Type definitions for mongoose-paginate 5.0.0 // Project: https://github.com/edwardhotchkiss/mongoose-paginate +// Definitions by: Linus Brolin , simonxca // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 096eda0b3d8fd58b96f727150ce2d58e43554f70 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 14:03:19 +0200 Subject: [PATCH 014/105] Added header --- passport-local-mongoose/passport-local-mongoose.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/passport-local-mongoose/passport-local-mongoose.d.ts b/passport-local-mongoose/passport-local-mongoose.d.ts index c0fd0bf6de..8830a927ff 100644 --- a/passport-local-mongoose/passport-local-mongoose.d.ts +++ b/passport-local-mongoose/passport-local-mongoose.d.ts @@ -1,3 +1,8 @@ +// Type definitions for passport-local-mongoose 4.0.0 +// Project: https://github.com/saintedlama/passport-local-mongoose +// Definitions by: Linus Brolin , simonxca +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// /// From 276a66f8e0bc20135ae5bf89733c556407b33070 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 15:22:45 +0200 Subject: [PATCH 015/105] Added tests --- .../passport-local-mongoose-tests.ts | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 passport-local-mongoose/passport-local-mongoose-tests.ts diff --git a/passport-local-mongoose/passport-local-mongoose-tests.ts b/passport-local-mongoose/passport-local-mongoose-tests.ts new file mode 100644 index 0000000000..8bdf0dded5 --- /dev/null +++ b/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -0,0 +1,133 @@ +/// + +/** + * Created by Linus Brolin . + */ + +import { + Schema, + model, + PassportLocalDocument, + PassportLocalSchema, + PassportLocalModel, + PassportLocalOptions, + PassportLocalErrorMessages +} from 'mongoose'; +import * as passportLocalMongoose from 'passport-local-mongoose'; + +import { Router, Request, Response } from 'express'; +import * as passport from 'passport'; +import { Strategy as LocalStrategy } from 'passport-local'; + + +//#region Test Models +interface User extends PassportLocalDocument { + _id: string; + username: string; + hash: string; + salt: string; + attempts: number; + last: Date; +} + +const UserSchema: PassportLocalSchema = new Schema({ + username: String, + hash: String, + salt: String, + attempts: Number, + last: Date +}); + +let options: PassportLocalOptions = {}; +options.iterations = 25000; +options.keylen = 512; +options.digestAlgorithm = 'sha256'; +options.interval = 100; +options.usernameField = 'username'; +options.usernameUnique = true; +options.usernameLowerCase = true; +options.hashField = 'hash'; +options.saltField = 'salt'; +options.saltlen = 32; +options.attemptsField = 'attempts'; +options.lastLoginField = 'last'; +// TODO: +// options.selectFields = 'undefined'; +// options.populateFields = 'undefined'; +options.encoding = 'hex'; +options.limitAttempts = false; +options.maxAttempts = Infinity; +options.passwordValidator = function(password: string, cb: (err: any) => void): void {}; +options.usernameQueryFields = []; + +let errorMessages: PassportLocalErrorMessages = {}; +errorMessages.MissingPasswordError = 'No password was given'; +errorMessages.AttemptTooSoonError = 'Account is currently locked. Try again later'; +errorMessages.TooManyAttemptsError = 'Account locked due to too many failed login attempts'; +errorMessages.NoSaltValueStoredError = 'Authentication not possible. No salt value stored'; +errorMessages.IncorrectPasswordError = 'Password or username are incorrect'; +errorMessages.IncorrectUsernameError = 'Password or username are incorrect'; +errorMessages.MissingUsernameError = 'No username was given'; +errorMessages.UserExistsError = 'A user with the given username is already registered'; + +options.errorMessages = errorMessages; + +UserSchema.plugin(passportLocalMongoose, options); + +type UserModel = _UserModel & PassportLocalModel; +interface _UserModel {} + +let UserModel: UserModel = model('User', UserSchema) as UserModel; +//#endregion + + +//#region Test Passport/Passport-Local +passport.use(UserModel.createStrategy()); + +passport.use('login', new LocalStrategy({ + passReqToCallback: true, + usernameField: 'username', + passwordField: 'password' + }, + (req: any, username: string, password: string, done: (err: any, res: any, msg?: any) => void) => { + process.nextTick(() => { + UserModel + .findOne({ 'username': username }) + .exec((err: any, user: model) => { + if (err) { + console.log(err); + return done(err, null); + } + + if (!user) { + console.log(errorMessages.IncorrectUsernameError); + return done(null, false, errorMessages.IncorrectUsernameError); + } + + user.authenticate(password, function(autherr: any, authuser: User, autherrmsg: any) { + if (autherr) { + console.log(autherr); + return done(autherr, null); + } + + if (!authuser) { + console.log(errorMessages.IncorrectPasswordError); + return done(null, false, errorMessages.IncorrectPasswordError); + } + + return done(null, authuser); + }); + }); + }); + }) +); + +passport.serializeUser(UserModel.serializeUser()); +passport.deserializeUser(UserModel.deserializeUser()); + +let router: Router = Router(); + +router.post('/login', passport.authenticate('local'), function(req: Request, res: Response) { + res.redirect('/'); +}); +//#endregion From a8ad49221dbae4b50c0bdf0ba523c1ac69184802 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 16:01:27 +0200 Subject: [PATCH 016/105] Added reference paths --- passport-local-mongoose/passport-local-mongoose-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/passport-local-mongoose/passport-local-mongoose-tests.ts b/passport-local-mongoose/passport-local-mongoose-tests.ts index 8bdf0dded5..24e2bb9076 100644 --- a/passport-local-mongoose/passport-local-mongoose-tests.ts +++ b/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -1,4 +1,7 @@ /// +/// +/// +/// /** * Created by Linus Brolin . From d482fccde9bf30517fa5729760e4f1d56d66c3c2 Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 16:44:02 +0200 Subject: [PATCH 017/105] Added tests --- mongoose-paginate/mongoose-paginate-tests.ts | 75 ++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 mongoose-paginate/mongoose-paginate-tests.ts diff --git a/mongoose-paginate/mongoose-paginate-tests.ts b/mongoose-paginate/mongoose-paginate-tests.ts new file mode 100644 index 0000000000..7857ffda33 --- /dev/null +++ b/mongoose-paginate/mongoose-paginate-tests.ts @@ -0,0 +1,75 @@ +/// +/// +/// + +/** + * Created by Linus Brolin . + */ + +import { + Schema, + model, + PaginateModel, + PaginateOptions, + PaginateResult +} from 'mongoose'; +import * as mongoosePaginate from 'mongoose-paginate'; +import { Router, Request, Response } from 'express'; + + +//#region Test Models +interface User { + email: string; + username: string; + password: string; +} + +const UserSchema: Schema = new Schema({ + email: String, + username: String, + password: String +}); + +UserSchema.plugin(mongoosePaginate); + +type UserModel = _UserModel & PaginateModel; +interface _UserModel {} + +let UserModel: UserModel = model('User', UserSchema) as UserModel; +//#endregion + + +//#region Test Paginate +let router: Router = Router(); + +router.get('/users.json', function(req: Request, res: Response) { + let descending: boolean = true; + let options: PaginateOptions = {}; + options.select = 'email username'; + options.sort = { 'username': (descending ? -1 : 1) }; + options.populate = ''; + options.lean = true; + options.leanWithId = false; + options.offset = 0; + options.page = 1; + options.limit = 10; + + UserModel + .paginate({}, options, (err: any, value: PaginateResult) => { + if (err) { + console.log(err); + return res.status(500).send(err); + } + + console.log('total: ' + value.total); + console.log('limit: ' + value.limit); + console.log('page: ' + value.page); + console.log('pages: ' + value.pages); + console.log('offset: ' + value.offset); + console.log('docs: '); + console.dir(value.docs); + return res.json(value); + }); + +}); +//#endregion From 17765b050ae21b11066b5f6c9cf8d5726af69c8b Mon Sep 17 00:00:00 2001 From: linusbrolin Date: Tue, 9 Aug 2016 16:52:31 +0200 Subject: [PATCH 018/105] Added options for selectFields and populateFields, and mongoose reference --- passport-local-mongoose/passport-local-mongoose-tests.ts | 6 +++--- passport-local-mongoose/passport-local-mongoose.d.ts | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/passport-local-mongoose/passport-local-mongoose-tests.ts b/passport-local-mongoose/passport-local-mongoose-tests.ts index 24e2bb9076..cf41176f08 100644 --- a/passport-local-mongoose/passport-local-mongoose-tests.ts +++ b/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -2,6 +2,7 @@ /// /// /// +/// /** * Created by Linus Brolin . @@ -54,9 +55,8 @@ options.saltField = 'salt'; options.saltlen = 32; options.attemptsField = 'attempts'; options.lastLoginField = 'last'; -// TODO: -// options.selectFields = 'undefined'; -// options.populateFields = 'undefined'; +options.selectFields = 'undefined'; +options.populateFields = 'undefined'; options.encoding = 'hex'; options.limitAttempts = false; options.maxAttempts = Infinity; diff --git a/passport-local-mongoose/passport-local-mongoose.d.ts b/passport-local-mongoose/passport-local-mongoose.d.ts index 8830a927ff..8e4a6bb777 100644 --- a/passport-local-mongoose/passport-local-mongoose.d.ts +++ b/passport-local-mongoose/passport-local-mongoose.d.ts @@ -52,6 +52,9 @@ declare module 'mongoose' { usernameQueryFields: Array; + selectFields?: string; + populateFields?: string; + usernameLowerCase?: boolean; hashField?: string; From b5b1fd28260ad040a545e3841f1e0b5f8ac959e3 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Sat, 13 Aug 2016 18:38:52 +0300 Subject: [PATCH 019/105] Adding missing methods from SyntheticEvent --- react/react.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/react/react.d.ts b/react/react.d.ts index 691b9c7a0e..f3ce283545 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -278,6 +278,8 @@ declare namespace __React { preventDefault(): void; stopPropagation(): void; persist(): void; + isDefaultPrevented(): boolean; + isPropagationStopped(): boolean; target: EventTarget; timeStamp: Date; type: string; From eb05cd3c8d1ac5c15df7ea4c961f92bf9e04cfa7 Mon Sep 17 00:00:00 2001 From: Nicholas Iannone Date: Mon, 15 Aug 2016 10:46:34 -0500 Subject: [PATCH 020/105] Added db-migrate and db-migrate/pg definitions. --- db-migrate-pg/db-migrate-pg-tests.ts | 411 +++++++++++++++++++++++++++ db-migrate-pg/db-migrate-pg.d.ts | 59 ++++ db-migrate/db-migrate-tests.ts | 322 +++++++++++++++++++++ db-migrate/db-migrate.d.ts | 150 ++++++++++ 4 files changed, 942 insertions(+) create mode 100644 db-migrate-pg/db-migrate-pg-tests.ts create mode 100644 db-migrate-pg/db-migrate-pg.d.ts create mode 100644 db-migrate/db-migrate-tests.ts create mode 100644 db-migrate/db-migrate.d.ts diff --git a/db-migrate-pg/db-migrate-pg-tests.ts b/db-migrate-pg/db-migrate-pg-tests.ts new file mode 100644 index 0000000000..ad2430440c --- /dev/null +++ b/db-migrate-pg/db-migrate-pg-tests.ts @@ -0,0 +1,411 @@ +// Test file for db-migrate-pg Definition file +/// + +import * as DbMigratePg from "DbMigratePg"; + +// Throw together a dummy driver +let db = {}; + +let callback = (err: any, response: any) => { + // Do nothing. +}; + +/// createTable(tableName, columnSpec, callback) +db.createTable('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}, callback); + +db.createTable('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}, callback); + +/// dropTable(tableName, [options,] callback) +db.dropTable('pets', callback); + +db.dropTable('pets', { ifExists: true }, callback); + +/// renameTable(tableName, newTableName, callback) +db.renameTable('pets', 'pets_OLD', callback); + +/// addColumn(tableName, columnName, columnSpec, callback) +db.addColumn('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}, callback); + +db.addColumn('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}, callback); + +/// renameColumn(tableName, oldColumnName, newColumnName, callback) +db.renameColumn('pets', 'id', 'pet_id', callback); + +/// changeColumn(tableName, columnName, columnSpec, callback) +db.changeColumn('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}, callback); + +/// addIndex(tableName, indexName, columns, [unique,] callback) +db.addIndex('pets', 'pets_eye_color_idx', ['eye_color'], callback); +db.addIndex('pets', 'pets_registration_code_idx', ['registration_code'], true, callback); + +/// addForeignKey(tableName, referencedTableName, keyName, fieldMapping, rules, callback) +db.addForeignKey('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}, callback); + +/// removeForeignKey(tableName, keyName, options, callback) +db.removeForeignKey('module_user', 'module_uer_module_id_foreign', callback); +db.removeForeignKey('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}, callback); + +/// insert(tableName, [columnNameArray,] valueArray, callback) +db.insert('module_user', ['first_name', 'last_name'], ['Test', 'Testerson'], callback); +db.insert('module_user', ['Test', 'Testerson'], callback); + +/// removeIndex([tableName,] indexName, callback) +db.removeIndex('pets', 'pets_eye_color_idx', callback); +db.removeIndex('pets_eye_color_idx', callback); + +/// runSql(sql, [params,] callback) +db.runSql('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +], callback); +db.runSql('DROP TABLE `pets`', callback); + +/// all(sql, [params,] callback) +db.all('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test'], callback); +db.all('SELECT * FROM `module_user`', callback); + +/// ========= +/// Async +/// ========= + +let onResolve = (result: any) => {}; + +/// createTableAsync(tableName, columnSpec) +db.createTableAsync('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}).then(onResolve); + +db.createTableAsync('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}).then(onResolve); + +/// dropTableAsync(tableName, [options]) +db.dropTableAsync('pets').then(onResolve); +db.dropTableAsync('pets', { ifExists: true }).then(onResolve); + +/// renameTableAsync(tableName, newTableName) +db.renameTableAsync('pets', 'pets_OLD').then(onResolve); + +/// addColumnAsync(tableName, columnName, columnSpec) +db.addColumnAsync('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}).then(onResolve); + +db.addColumnAsync('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}).then(onResolve); + +/// renameColumnAsync(tableName, oldColumnName, newColumnName) +db.renameColumnAsync('pets', 'id', 'pet_id').then(onResolve); + +/// changeColumnAsync(tableName, columnName, columnSpec) +db.changeColumnAsync('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}).then(onResolve); + +/// addIndexAsync(tableName, indexName, columns, [unique]) +db.addIndexAsync('pets', 'pets_eye_color_idx', ['eye_color']).then(onResolve); +db.addIndexAsync('pets', 'pets_registration_code_idx', ['registration_code'], true).then(onResolve); + +/// addForeignKeyAsync(tableName, referencedTableName, keyName, fieldMapping, rules) +db.addForeignKeyAsync('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}).then(onResolve); + +/// removeForeignKeyAsync(tableName, keyName, options) +db.removeForeignKeyAsync('module_user', 'module_uer_module_id_foreign').then(onResolve); +db.removeForeignKeyAsync('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}).then(onResolve); + +/// insertAsync(tableName, [columnNameArray,] valueArray) +db.insertAsync('module_user', ['first_name', 'last_name'], ['Test', 'Testerson']).then(onResolve); +db.insertAsync('module_user', ['Test', 'Testerson']).then(onResolve); + +/// removeIndexAsync([tableName,] indexName) +db.removeIndexAsync('pets', 'pets_eye_color_idx').then(onResolve); +db.removeIndexAsync('pets_eye_color_idx').then(onResolve); + +/// runSqlAsync(sql, [params]) +db.runSqlAsync('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +]).then(onResolve); +db.runSqlAsync('DROP TABLE `pets`').then(onResolve); + +/// allAsync(sql, [params]) +db.allAsync('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test']).then(onResolve); +db.allAsync('SELECT * FROM `module_user`').then(onResolve); + +/// ==================== +/// PG-specific tests +/// ==================== + +/// createColumnConstraint(spec, options, tableName, columnName) (INTERNAL USE ONLY) +let constraint: DbMigratePg.ColumnConstraint; + +constraint = db.createColumnConstraint({ + type: 'int', + length: 10, + unsigned: true, + primaryKey: false, + autoIncrement: false, + notNull: true, + unique: false, + defaultValue: 0, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + 'eye_color': 'id' + } + } +}, { + emitPrimaryKey: false +}, 'pets', 'eye_color'); + +// Print the SQL constraints +console.log(constraint.constraints); + +// Invoke the foreign key builder +constraint.foreignKey(callback); + +/// Public Callback Methods: + +/// createDatabase(dbName, [options,] callback) +db.createDatabase('petstore', callback); +db.createDatabase('petstore', {}, callback); + +/// dropDatabase(dbName, [options,] callback) +db.dropDatabase('petstore', callback); +db.dropDatabase('petstore', { ifExists: true }, callback); + +/// createSequence(sqName, [options,] callback) +db.createSequence('pets_id_sq', callback); +db.createSequence('pets_id_sq', { temp: true }, callback); + +/// switchDatabase(options, callback) +db.switchDatabase('petstore', callback); +db.switchDatabase({ database: 'petstore' }, callback); + +/// dropSequence(sqName, [options,] callback) +db.dropSequence('pets_id_sq', callback); +db.dropSequence('pets_id_sq', { + ifExists: true, + cascade: true, + restrict: true, +}, callback); + +/// Public Promisified Methods: + +/// createDatabaseAsync(dbName, [options]) +db.createDatabaseAsync('petstore').then(onResolve); +db.createDatabaseAsync('petstore', {}).then(onResolve); + +/// dropDatabaseAsync(dbName, [options]) +db.dropDatabaseAsync('petstore').then(onResolve); +db.dropDatabaseAsync('petstore', { ifExists: true }).then(onResolve); + +/// createSequenceAsync(sqName, [options]) +db.createSequenceAsync('pets_id_sq').then(onResolve); +db.createSequenceAsync('pets_id_sq', { temp: true }).then(onResolve); + +/// switchDatabaseAsync(options) +db.switchDatabaseAsync('petstore').then(onResolve); +db.switchDatabaseAsync({ database: 'petstore' }).then(onResolve); + +/// dropSequenceAsync(sqName, [options]) +db.dropSequenceAsync('pets_id_sq').then(onResolve); +db.dropSequenceAsync('pets_id_sq', { + ifExists: true, + cascade: true, + restrict: true, +}).then(onResolve); diff --git a/db-migrate-pg/db-migrate-pg.d.ts b/db-migrate-pg/db-migrate-pg.d.ts new file mode 100644 index 0000000000..056c0c71ce --- /dev/null +++ b/db-migrate-pg/db-migrate-pg.d.ts @@ -0,0 +1,59 @@ +// Type definitions for db-migrate-pg +// Project: https://github.com/db-migrate/pg +// Definitions by: nickiannone https://github.com/nickiannone +// Definitions: https://github.com/nickiannone/DefinitelyTyped + +/// +/// + +declare module "DbMigratePg" { + + import * as pg from "pg"; + import * as DbMigrate from "DbMigrate"; + + // Yes, this is a dummy interface for now; the current implementation of the pg driver doesn't need any options. + export interface CreateDatabaseOptions {} + + export interface DropDatabaseOptions { + ifExists?: boolean; + } + + export interface CreateSequenceOptions { + temp?: boolean; + } + + export interface SwitchDatabaseOptions { + database?: string; + } + + export interface DropSequenceOptions { + ifExists?: boolean; + cascade?: boolean; + restrict?: boolean; + } + + export interface ColumnConstraint { + foreignKey: (callback: DbMigrate.CallbackFunction) => void; + constraints: string; + } + + export interface ColumnConstraintOptions { + emitPrimaryKey?: boolean; + } + + export class PgDriver extends DbMigrate.Base { + constructor(connection: pg.Client, schema: string, intern: DbMigrate.InternalOptions); + createDatabase(dbName: string, optionsOrCb: CreateDatabaseOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; + dropDatabase(dbName: string, optionsOrCb: DropDatabaseOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; + createSequence(sqName: string, optionsOrCb: CreateSequenceOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; + switchDatabase(options: string | SwitchDatabaseOptions, callback: DbMigrate.CallbackFunction): void; + dropSequence(dbName: string, optionsOrCb: DropSequenceOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; + createColumnConstraint(spec: DbMigrate.ColumnSpec, options: ColumnConstraintOptions, tableName: string, columnName: string): ColumnConstraint; + + createDatabaseAsync(dbName: string, options?: CreateDatabaseOptions): Promise; + dropDatabaseAsync(dbName: string, options?: DropDatabaseOptions): Promise; + createSequenceAsync(sqName: string, options?: CreateSequenceOptions): Promise; + switchDatabaseAsync(options: string | SwitchDatabaseOptions): Promise; + dropSequenceAsync(dbName: string, options?: DropSequenceOptions): Promise; + } +} \ No newline at end of file diff --git a/db-migrate/db-migrate-tests.ts b/db-migrate/db-migrate-tests.ts new file mode 100644 index 0000000000..9bdaafed5b --- /dev/null +++ b/db-migrate/db-migrate-tests.ts @@ -0,0 +1,322 @@ +// Test file for db.js Definition file +/// + +import * as DbMigrate from "DbMigrate"; + +// Throw together a dummy driver +let db = {}; + +let callback = (err: any, response: any) => { + // Do nothing. +}; + +/// createTable(tableName, columnSpec, callback) +db.createTable('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}, callback); + +db.createTable('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}, callback); + +/// dropTable(tableName, [options,] callback) +db.dropTable('pets', callback); + +db.dropTable('pets', { ifExists: true }, callback); + +/// renameTable(tableName, newTableName, callback) +db.renameTable('pets', 'pets_OLD', callback); + +/// addColumn(tableName, columnName, columnSpec, callback) +db.addColumn('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}, callback); + +db.addColumn('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}, callback); + +/// renameColumn(tableName, oldColumnName, newColumnName, callback) +db.renameColumn('pets', 'id', 'pet_id', callback); + +/// changeColumn(tableName, columnName, columnSpec, callback) +db.changeColumn('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}, callback); + +/// addIndex(tableName, indexName, columns, [unique,] callback) +db.addIndex('pets', 'pets_eye_color_idx', ['eye_color'], callback); +db.addIndex('pets', 'pets_registration_code_idx', ['registration_code'], true, callback); + +/// addForeignKey(tableName, referencedTableName, keyName, fieldMapping, rules, callback) +db.addForeignKey('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}, callback); + +/// removeForeignKey(tableName, keyName, options, callback) +db.removeForeignKey('module_user', 'module_uer_module_id_foreign', callback); +db.removeForeignKey('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}, callback); + +/// insert(tableName, [columnNameArray,] valueArray, callback) +db.insert('module_user', ['first_name', 'last_name'], ['Test', 'Testerson'], callback); +db.insert('module_user', ['Test', 'Testerson'], callback); + +/// removeIndex([tableName,] indexName, callback) +db.removeIndex('pets', 'pets_eye_color_idx', callback); +db.removeIndex('pets_eye_color_idx', callback); + +/// runSql(sql, [params,] callback) +db.runSql('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +], callback); +db.runSql('DROP TABLE `pets`', callback); + +/// all(sql, [params,] callback) +db.all('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test'], callback); +db.all('SELECT * FROM `module_user`', callback); + +/// ========= +/// Async +/// ========= + +let onResolve = (result: any) => {}; + +/// createTableAsync(tableName, columnSpec) +db.createTableAsync('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}).then(onResolve); + +db.createTableAsync('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}).then(onResolve); + +/// dropTableAsync(tableName, [options]) +db.dropTableAsync('pets').then(onResolve); +db.dropTableAsync('pets', { ifExists: true }).then(onResolve); + +/// renameTableAsync(tableName, newTableName) +db.renameTableAsync('pets', 'pets_OLD').then(onResolve); + +/// addColumnAsync(tableName, columnName, columnSpec) +db.addColumnAsync('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}).then(onResolve); + +db.addColumnAsync('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}).then(onResolve); + +/// renameColumnAsync(tableName, oldColumnName, newColumnName) +db.renameColumnAsync('pets', 'id', 'pet_id').then(onResolve); + +/// changeColumnAsync(tableName, columnName, columnSpec) +db.changeColumnAsync('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}).then(onResolve); + +/// addIndexAsync(tableName, indexName, columns, [unique]) +db.addIndexAsync('pets', 'pets_eye_color_idx', ['eye_color']).then(onResolve); +db.addIndexAsync('pets', 'pets_registration_code_idx', ['registration_code'], true).then(onResolve); + +/// addForeignKeyAsync(tableName, referencedTableName, keyName, fieldMapping, rules) +db.addForeignKeyAsync('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}).then(onResolve); + +/// removeForeignKeyAsync(tableName, keyName, options) +db.removeForeignKeyAsync('module_user', 'module_uer_module_id_foreign').then(onResolve); +db.removeForeignKeyAsync('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}).then(onResolve); + +/// insertAsync(tableName, [columnNameArray,] valueArray) +db.insertAsync('module_user', ['first_name', 'last_name'], ['Test', 'Testerson']).then(onResolve); +db.insertAsync('module_user', ['Test', 'Testerson']).then(onResolve); + +/// removeIndexAsync([tableName,] indexName) +db.removeIndexAsync('pets', 'pets_eye_color_idx').then(onResolve); +db.removeIndexAsync('pets_eye_color_idx').then(onResolve); + +/// runSqlAsync(sql, [params]) +db.runSqlAsync('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +]).then(onResolve); +db.runSqlAsync('DROP TABLE `pets`').then(onResolve); + +/// allAsync(sql, [params]) +db.allAsync('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test']).then(onResolve); +db.allAsync('SELECT * FROM `module_user`').then(onResolve); \ No newline at end of file diff --git a/db-migrate/db-migrate.d.ts b/db-migrate/db-migrate.d.ts new file mode 100644 index 0000000000..465dfb1c68 --- /dev/null +++ b/db-migrate/db-migrate.d.ts @@ -0,0 +1,150 @@ +/// +/// + +// Type definitions for db-migrate/db-migrate-base +// Project: https://github.com/db-migrate/db-migrate-base +// Definitions by: nickiannone https://github.com/nickiannone +// Definitions: https://github.com/nickiannone/DefinitelyTyped + +declare module "DbMigrate" { + + export interface CallbackFunction { (err: any, response: any): void; } + + export interface InternalModule { + log: any; + type: any; + } + + export interface InternalOptions { + mod: InternalModule; + } + + export interface ColumnSpec { + length?: number; + type: string; + unsigned?: boolean; + primaryKey?: boolean; + autoIncrement?: boolean; + notNull?: boolean; + unique?: boolean; + defaultValue?: any; + foreignKey?: ForeignKeySpec; + } + + export interface ForeignKeySpec { + name: string; + table: string; + rules?: ForeignKeyRules; + mapping: string | any; + } + + export interface ForeignKeyRules { + onDelete: string; + onUpdate: string; + } + + export interface RemoveForeignKeyOptions { + dropIndex?: boolean; + } + + export interface ColumnDef { + foreignKey?: any; // TODO Figure this out! + constraints: string; + } + + export interface CreateTableOptions { + columns?: Array; + ifNotExists?: boolean; + } + + export interface DropTableOptions { + ifExists?: boolean; + } + + export class Base { + constructor(intern: InternalOptions); + + close(callback?: CallbackFunction): void; + mapDataType(str: string): string; + truncate(tableName: string, callback: CallbackFunction): void; + checkDBMS(dbms: any, callback: CallbackFunction): void; + createDatabase(...options: any[]): void; + switchDatabase(...options: any[]): void; + dropDatabase(...options: any[]): void; + recurseCallbackArray(foreignKeys: Array, callback: CallbackFunction): void; + bindForeignKey(tableName: string, columnName: string, fkOptions: ForeignKeySpec): (callback: CallbackFunction) => void; + createColumnDef(name: string, spec: ColumnSpec, options?: any): ColumnDef; // TODO Figure out a type for `options`! + //createColumnConstraint(spec: ColumnSpec, options?: any, ...implementationDefinedOptions: any[]): string; + createMigrationsTable(callback: CallbackFunction): void; + createSeedsTable(callback: CallbackFunction): void; + createTable(tableName: string, options: any | CreateTableOptions, callback: CallbackFunction): void; + dropTable(tableName: string, optionsOrCb?: DropTableOptions | CallbackFunction, callback?: CallbackFunction): void; + renameTable(tableName: string, newTableName: string, callback: CallbackFunction): void; + addColumn(tableName: string, columnName: string, columnSpec: ColumnSpec, callback: CallbackFunction): void; + removeColumn(tableName: string, columnName: string, callback: CallbackFunction): void; + renameColumn(tableName: string, oldColumnName: string, newColumnName: string, callback: CallbackFunction): void; + changeColumn(tableName: string, columnName: string, columnSpec: ColumnSpec, callback: CallbackFunction): void; + quoteDDLArr(arr: Array): Array; + quoteArr(arr: Array): Array; + addIndex(tableName: string, indexName: string, columns: string | Array, uniqueOrCb?: boolean | CallbackFunction, callback?: CallbackFunction): void; + insert(tableName: string, columnNameOrValueArray: any, valueArrayOrCb?: any | CallbackFunction, callback?: CallbackFunction): void; + update(tableName: string, columnNameOrValueArray: any, valueArrayOrIds?: any, idsOrCb?: any | CallbackFunction, callback?: CallbackFunction): void; + lookup(tableName: string, column: string, id?: any, callback?: CallbackFunction): void; + removeIndex(tableNameOrIndexName: string, indexNameOrCb?: string | CallbackFunction, callback?: CallbackFunction): void; + addForeignKey(tableName: string, referencedTableName: string, keyName: string, fieldMapping: any, rules: ForeignKeyRules, callback: CallbackFunction): void; + removeForeignKey(tableName: string, keyName: string, optionsOrCb?: RemoveForeignKeyOptions | CallbackFunction, callback?: CallbackFunction): void; + normalizeColumnSpec(spec: string | ColumnSpec): ColumnSpec; + addMigrationRecord(name: string, callback: CallbackFunction): void; + addSeedRecord(name: string, callback: CallbackFunction): void; + startMigration(callback: CallbackFunction): void; + endMigration(callback: CallbackFunction): void; + runSql(sql?: string, paramsOrCb?: Array | CallbackFunction, callback?: CallbackFunction): void; + allLoadedMigrations(callback: CallbackFunction): void; + allLoadedSeeds(callback: CallbackFunction): void; + deleteMigration(migrationName: string, callback: CallbackFunction): void; + remove(table: string, ids: any, callback: CallbackFunction): void; // TODO Make ids match the type of ids in buildWhereClause(ids); + buildWhereClause(ids: any): string; + deleteSeed(seedName: string, callback: CallbackFunction): void; + all(sql: string, paramsOrCb?: Array | CallbackFunction, callback?: CallbackFunction): void; + escape(str: string): string; + escapeString(str: string): string; + escapeDDL(str: string): string; + + // Promisified methods + closeAsync(): Promise; + truncateAsync(tableName: string): Promise; + checkDBMSAsync(dbms: any): Promise; + createDatabaseAsync(...options: any[]): Promise; + switchDatabaseAsync(...options: any[]): Promise; + dropDatabaseAsync(...options: any[]): Promise; + recurseCallbackArrayAsync(foreignKeys: Array): Promise; + createMigrationsTableAsync(): Promise; + createSeedsTableAsync(): Promise; + createTableAsync(tableName: string, options: any | CreateTableOptions): Promise; + dropTableAsync(tableName: string, options?: DropTableOptions): Promise; + renameTableAsync(tableName: string, newTableName: string): Promise; + addColumnAsync(tableName: string, columnName: string, columnSpec: ColumnSpec): Promise; + removeColumnAsync(tableName: string, columnName: string): Promise; + renameColumnAsync(tableName: string, oldColumnName: string, newColumnName: string): Promise; + changeColumnAsync(tableName: string, columnName: string, columnSpec: ColumnSpec): Promise; + addIndexAsync(tableName: string, indexName: string, columns: string | Array, unique?: boolean): Promise; + insertAsync(tableName: string, columnNameOrValueArray: any, valueArrayOrCb?: any | CallbackFunction, callback?: CallbackFunction): Promise; + updateAsync(tableName: string, columnNameOrValueArray: any, valueArrayOrIds?: any, idsOrCb?: any | CallbackFunction, callback?: CallbackFunction): Promise; + lookupAsync(tableName: string, column: string, id?: any, callback?: CallbackFunction): Promise; + removeIndexAsync(tableNameOrIndexName: string, indexName?: string): Promise; + addForeignKeyAsync(tableName: string, referencedTableName: string, keyName: string, fieldMapping: any, rules: ForeignKeyRules): Promise; + removeForeignKeyAsync(tableName: string, keyName: string, options?: RemoveForeignKeyOptions): Promise; + addMigrationRecordAsync(name: string): Promise; + addSeedRecordAsync(name: string): Promise; + startMigrationAsync(): Promise; + endMigrationAsync(callback: CallbackFunction): Promise; + runSqlAsync(sql?: string, params?: Array): Promise; + allLoadedMigrationsAsync(): Promise; + allLoadedSeedsAsync(): Promise; + deleteMigrationAsync(migrationName: string): Promise; + removeAsync(table: string, ids: any): Promise; + deleteSeedAsync(seedName: string): Promise; + allAsync(sql: string, params?: Array): Promise; + } + +} \ No newline at end of file From 3b17086389f9ff0441376735df25f7ad0ee861ca Mon Sep 17 00:00:00 2001 From: Nicholas Iannone Date: Mon, 15 Aug 2016 11:39:47 -0500 Subject: [PATCH 021/105] Fix headers. --- db-migrate-pg/db-migrate-pg.d.ts | 2 +- db-migrate/db-migrate.d.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db-migrate-pg/db-migrate-pg.d.ts b/db-migrate-pg/db-migrate-pg.d.ts index 056c0c71ce..23e9025a21 100644 --- a/db-migrate-pg/db-migrate-pg.d.ts +++ b/db-migrate-pg/db-migrate-pg.d.ts @@ -1,6 +1,6 @@ // Type definitions for db-migrate-pg // Project: https://github.com/db-migrate/pg -// Definitions by: nickiannone https://github.com/nickiannone +// Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped /// diff --git a/db-migrate/db-migrate.d.ts b/db-migrate/db-migrate.d.ts index 465dfb1c68..88223ca4b0 100644 --- a/db-migrate/db-migrate.d.ts +++ b/db-migrate/db-migrate.d.ts @@ -1,11 +1,11 @@ -/// -/// - -// Type definitions for db-migrate/db-migrate-base +// Type definitions for db-migrate-base // Project: https://github.com/db-migrate/db-migrate-base -// Definitions by: nickiannone https://github.com/nickiannone +// Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped +/// +/// + declare module "DbMigrate" { export interface CallbackFunction { (err: any, response: any): void; } From 2c5dc32b68c0a022a3b7a1c46e8bd8878ca57da6 Mon Sep 17 00:00:00 2001 From: Nicholas Iannone Date: Mon, 15 Aug 2016 11:42:00 -0500 Subject: [PATCH 022/105] Tweaked name to match npm --- db-migrate/db-migrate.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db-migrate/db-migrate.d.ts b/db-migrate/db-migrate.d.ts index 88223ca4b0..66b4515f30 100644 --- a/db-migrate/db-migrate.d.ts +++ b/db-migrate/db-migrate.d.ts @@ -1,5 +1,5 @@ -// Type definitions for db-migrate-base -// Project: https://github.com/db-migrate/db-migrate-base +// Type definitions for db-migrate +// Project: https://github.com/db-migrate/db-migrate // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped From 2675fa3a2e380e114181e5be481b32ed5269ec4c Mon Sep 17 00:00:00 2001 From: Nicholas Iannone Date: Mon, 15 Aug 2016 12:04:09 -0500 Subject: [PATCH 023/105] Fixed package name and project link --- .../db-migrate-base-tests.ts | 8 +++---- .../db-migrate-base.d.ts | 6 ++--- db-migrate-pg/db-migrate-pg.d.ts | 22 +++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) rename db-migrate/db-migrate-tests.ts => db-migrate-base/db-migrate-base-tests.ts (97%) rename db-migrate/db-migrate.d.ts => db-migrate-base/db-migrate-base.d.ts (98%) diff --git a/db-migrate/db-migrate-tests.ts b/db-migrate-base/db-migrate-base-tests.ts similarity index 97% rename from db-migrate/db-migrate-tests.ts rename to db-migrate-base/db-migrate-base-tests.ts index 9bdaafed5b..68c61e6f6c 100644 --- a/db-migrate/db-migrate-tests.ts +++ b/db-migrate-base/db-migrate-base-tests.ts @@ -1,10 +1,10 @@ -// Test file for db.js Definition file -/// +// Test file for db-migrate-base Definition file +/// -import * as DbMigrate from "DbMigrate"; +import * as DbMigrateBase from "DbMigrateBase"; // Throw together a dummy driver -let db = {}; +let db = {}; let callback = (err: any, response: any) => { // Do nothing. diff --git a/db-migrate/db-migrate.d.ts b/db-migrate-base/db-migrate-base.d.ts similarity index 98% rename from db-migrate/db-migrate.d.ts rename to db-migrate-base/db-migrate-base.d.ts index 66b4515f30..47dd8ce1c2 100644 --- a/db-migrate/db-migrate.d.ts +++ b/db-migrate-base/db-migrate-base.d.ts @@ -1,12 +1,12 @@ -// Type definitions for db-migrate -// Project: https://github.com/db-migrate/db-migrate +// Type definitions for db-migrate-base +// Project: https://github.com/db-migrate/db-migrate-base // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped /// /// -declare module "DbMigrate" { +declare module "DbMigrateBase" { export interface CallbackFunction { (err: any, response: any): void; } diff --git a/db-migrate-pg/db-migrate-pg.d.ts b/db-migrate-pg/db-migrate-pg.d.ts index 23e9025a21..4d2823ec52 100644 --- a/db-migrate-pg/db-migrate-pg.d.ts +++ b/db-migrate-pg/db-migrate-pg.d.ts @@ -3,13 +3,13 @@ // Definitions by: nickiannone // Definitions: https://github.com/nickiannone/DefinitelyTyped -/// +/// /// declare module "DbMigratePg" { import * as pg from "pg"; - import * as DbMigrate from "DbMigrate"; + import * as DbMigrateBase from "DbMigrateBase"; // Yes, this is a dummy interface for now; the current implementation of the pg driver doesn't need any options. export interface CreateDatabaseOptions {} @@ -33,7 +33,7 @@ declare module "DbMigratePg" { } export interface ColumnConstraint { - foreignKey: (callback: DbMigrate.CallbackFunction) => void; + foreignKey: (callback: DbMigrateBase.CallbackFunction) => void; constraints: string; } @@ -41,14 +41,14 @@ declare module "DbMigratePg" { emitPrimaryKey?: boolean; } - export class PgDriver extends DbMigrate.Base { - constructor(connection: pg.Client, schema: string, intern: DbMigrate.InternalOptions); - createDatabase(dbName: string, optionsOrCb: CreateDatabaseOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; - dropDatabase(dbName: string, optionsOrCb: DropDatabaseOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; - createSequence(sqName: string, optionsOrCb: CreateSequenceOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; - switchDatabase(options: string | SwitchDatabaseOptions, callback: DbMigrate.CallbackFunction): void; - dropSequence(dbName: string, optionsOrCb: DropSequenceOptions | DbMigrate.CallbackFunction, callback?: DbMigrate.CallbackFunction): void; - createColumnConstraint(spec: DbMigrate.ColumnSpec, options: ColumnConstraintOptions, tableName: string, columnName: string): ColumnConstraint; + export class PgDriver extends DbMigrateBase.Base { + constructor(connection: pg.Client, schema: string, intern: DbMigrateBase.InternalOptions); + createDatabase(dbName: string, optionsOrCb: CreateDatabaseOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + dropDatabase(dbName: string, optionsOrCb: DropDatabaseOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + createSequence(sqName: string, optionsOrCb: CreateSequenceOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + switchDatabase(options: string | SwitchDatabaseOptions, callback: DbMigrateBase.CallbackFunction): void; + dropSequence(dbName: string, optionsOrCb: DropSequenceOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + createColumnConstraint(spec: DbMigrateBase.ColumnSpec, options: ColumnConstraintOptions, tableName: string, columnName: string): ColumnConstraint; createDatabaseAsync(dbName: string, options?: CreateDatabaseOptions): Promise; dropDatabaseAsync(dbName: string, options?: DropDatabaseOptions): Promise; From 3b613b085dfe0f388310bedbc15726eeaea23ebd Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 Aug 2016 13:25:00 -0500 Subject: [PATCH 024/105] Added electron-notify --- electron-notify/electron-notify-tests.ts | 0 electron-notify/electron-notify.d.ts | 27 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 electron-notify/electron-notify-tests.ts create mode 100644 electron-notify/electron-notify.d.ts diff --git a/electron-notify/electron-notify-tests.ts b/electron-notify/electron-notify-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts new file mode 100644 index 0000000000..3678c00e3d --- /dev/null +++ b/electron-notify/electron-notify.d.ts @@ -0,0 +1,27 @@ +// Type definitions for electron-notify v0.1.0 +// Project: https://github.com/hankbao/electron-notify +// Definitions by: Daniel Pereira +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace ElectronNotify { +} + +/** Nice and simple notifications for electron apps */ +declare module 'electron-notifications' { + + /** Change some config options. Can be run multiple times, also between notify()-calls to change electron-notifys behaviour. */ + export function setConfig(configObj); + + /** Displays new notification. */ + export function notify(notificationObj); + + /** Clears the animation queue and closes all windows opened by electron-notify. Call this to clean up before quiting your app. */ + export function closeAll(); + + export function setTemplatePath(path); + + /** Returns the maximum amount of notifications that fit onto the users screen. */ + export function calcMaxVisibleNotification(): number; +} \ No newline at end of file From 07084d3ae632574dae4785a5caaaccde674527c9 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 Aug 2016 15:14:45 -0500 Subject: [PATCH 025/105] Wrong module name --- electron-notify/electron-notify.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts index 3678c00e3d..f6f4d47b07 100644 --- a/electron-notify/electron-notify.d.ts +++ b/electron-notify/electron-notify.d.ts @@ -9,7 +9,7 @@ declare namespace ElectronNotify { } /** Nice and simple notifications for electron apps */ -declare module 'electron-notifications' { +declare module 'electron-notify' { /** Change some config options. Can be run multiple times, also between notify()-calls to change electron-notifys behaviour. */ export function setConfig(configObj); From dd7de3e50c342bdf77de61d725083d3d20ab8d9e Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 Aug 2016 15:57:19 -0500 Subject: [PATCH 026/105] Added INotification and IConfiguration to electron notify --- electron-notify/electron-notify-tests.ts | 23 +++++++++++++ electron-notify/electron-notify.d.ts | 42 +++++++++++++++++++++--- 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/electron-notify/electron-notify-tests.ts b/electron-notify/electron-notify-tests.ts index e69de29bb2..9194a11f1b 100644 --- a/electron-notify/electron-notify-tests.ts +++ b/electron-notify/electron-notify-tests.ts @@ -0,0 +1,23 @@ +/// + +import * as eNotify from 'electron-notify'; + +eNotify.setConfig({ + appIcon: 'images/otherIcon.png', + displayTime: 6000, + defaultStyleText: { + color: '#FF0000', + fontWeight: 'bold' + } +}); + +eNotify.notify({ + title: 'Title', + text: 'Some text', + image: 'path/to/image.png', + url: 'http://google.de', + sound: 'notification.wav', + onClickFunc: function () { console.log('onClick') }, + onShowFunc: function () { console.log('onShow') }, + onCloseFunc: function () { console.log('onClose') } +}); \ No newline at end of file diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts index f6f4d47b07..d5ac7f1966 100644 --- a/electron-notify/electron-notify.d.ts +++ b/electron-notify/electron-notify.d.ts @@ -6,22 +6,54 @@ /// declare namespace ElectronNotify { + + interface INotification { + title: string, + text?: string, + image?: string, + url?: string, + sound?: string, + onClickFunc?: (event: string, id: number, closeNotification) => void, + onShowFunc?: (event: string, id: number, closeNotification) => void, + onCloseFunc?: (event: string, id: number) => void + } + + interface IConfiguration { + width?: number, + height?: number, + padding?: number, + borderRadius?: number, + displayTime?: number, + animationSteps?: number, + animationStepMs?: number, + animateInParallel?: boolean, + appIcon?: string, + pathToModule?: string, + logging?: boolean, + defaultWindow?: Electron.BrowserWindowOptions, + defaultStyleContainer?: any, + defaultStyleAppIcon?: any, + defaultStyleImage?: any, + defaultStyleClose?: any, + defaultStyleText?: any + } + } /** Nice and simple notifications for electron apps */ declare module 'electron-notify' { /** Change some config options. Can be run multiple times, also between notify()-calls to change electron-notifys behaviour. */ - export function setConfig(configObj); + export function setConfig(customConfig: ElectronNotify.IConfiguration); /** Displays new notification. */ - export function notify(notificationObj); + export function notify(notification: ElectronNotify.INotification); /** Clears the animation queue and closes all windows opened by electron-notify. Call this to clean up before quiting your app. */ export function closeAll(); - export function setTemplatePath(path); + export function getTemplatePath(): string; + + export function setTemplatePath(path: string); - /** Returns the maximum amount of notifications that fit onto the users screen. */ - export function calcMaxVisibleNotification(): number; } \ No newline at end of file From 8f082a028691948ef922e39ebc03b06e63f23518 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 Aug 2016 15:59:05 -0500 Subject: [PATCH 027/105] Return voids --- electron-notify/electron-notify.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts index d5ac7f1966..2984bd4876 100644 --- a/electron-notify/electron-notify.d.ts +++ b/electron-notify/electron-notify.d.ts @@ -44,16 +44,16 @@ declare namespace ElectronNotify { declare module 'electron-notify' { /** Change some config options. Can be run multiple times, also between notify()-calls to change electron-notifys behaviour. */ - export function setConfig(customConfig: ElectronNotify.IConfiguration); + export function setConfig(customConfig: ElectronNotify.IConfiguration): void; /** Displays new notification. */ - export function notify(notification: ElectronNotify.INotification); + export function notify(notification: ElectronNotify.INotification): void; /** Clears the animation queue and closes all windows opened by electron-notify. Call this to clean up before quiting your app. */ - export function closeAll(); + export function closeAll(): void; export function getTemplatePath(): string; - export function setTemplatePath(path: string); + export function setTemplatePath(path: string): void; } \ No newline at end of file From 306ceee471b09371f44e7daeaffb94ae92ec8b07 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 Aug 2016 15:59:55 -0500 Subject: [PATCH 028/105] Fix syntax issues --- electron-notify/electron-notify.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts index 2984bd4876..198f8cafb6 100644 --- a/electron-notify/electron-notify.d.ts +++ b/electron-notify/electron-notify.d.ts @@ -13,8 +13,8 @@ declare namespace ElectronNotify { image?: string, url?: string, sound?: string, - onClickFunc?: (event: string, id: number, closeNotification) => void, - onShowFunc?: (event: string, id: number, closeNotification) => void, + onClickFunc?: (event: string, id: number, closeNotification: any) => void, + onShowFunc?: (event: string, id: number, closeNotification: any) => void, onCloseFunc?: (event: string, id: number) => void } From a0d70238a7d366bbefcdbabd2c59ccbd63c32713 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Mon, 15 Aug 2016 16:45:28 -0500 Subject: [PATCH 029/105] Update events --- electron-notify/electron-notify-tests.ts | 9 ++++++--- electron-notify/electron-notify.d.ts | 15 ++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/electron-notify/electron-notify-tests.ts b/electron-notify/electron-notify-tests.ts index 9194a11f1b..95e2edf998 100644 --- a/electron-notify/electron-notify-tests.ts +++ b/electron-notify/electron-notify-tests.ts @@ -17,7 +17,10 @@ eNotify.notify({ image: 'path/to/image.png', url: 'http://google.de', sound: 'notification.wav', - onClickFunc: function () { console.log('onClick') }, - onShowFunc: function () { console.log('onShow') }, - onCloseFunc: function () { console.log('onClose') } + onClickFunc: (event) => { + console.log('onClick ' + event.id); + event.closeNotification('onClick'); + }, + onShowFunc: (event) => { console.log('onShow ' + event.id) }, + onCloseFunc: (event) => { console.log('onClose ' + event.id) } }); \ No newline at end of file diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts index 198f8cafb6..3ad6906205 100644 --- a/electron-notify/electron-notify.d.ts +++ b/electron-notify/electron-notify.d.ts @@ -7,15 +7,24 @@ declare namespace ElectronNotify { + interface ICloseNotificationEvent { + event: 'close' | 'show' | 'click', + id: number + } + + interface INotificationEvent extends ICloseNotificationEvent { + closeNotification: (reason: any) => void, + } + interface INotification { title: string, text?: string, image?: string, url?: string, sound?: string, - onClickFunc?: (event: string, id: number, closeNotification: any) => void, - onShowFunc?: (event: string, id: number, closeNotification: any) => void, - onCloseFunc?: (event: string, id: number) => void + onClickFunc?: (event: INotificationEvent) => void, + onShowFunc?: (event: INotificationEvent) => void, + onCloseFunc?: (event: ICloseNotificationEvent) => void } interface IConfiguration { From 4595e61ad1e8c5f48255a016471487f100a818f8 Mon Sep 17 00:00:00 2001 From: minodisk Date: Tue, 16 Aug 2016 18:44:27 +0900 Subject: [PATCH 030/105] Update react-helmet - Add `titleTemplate` to `HelmetProps` - Remove blank lines --- react-helmet/react-helmet.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/react-helmet/react-helmet.d.ts b/react-helmet/react-helmet.d.ts index 2ea19ae469..553a69ed56 100644 --- a/react-helmet/react-helmet.d.ts +++ b/react-helmet/react-helmet.d.ts @@ -7,9 +7,10 @@ declare namespace ReactHelmet { import React = __React; - + interface HelmetProps { base?: any; + defaultTitle?: string; htmlAttributes?: any; link?: Array; meta?: Array; @@ -27,7 +28,7 @@ declare namespace ReactHelmet { script: HelmetDatum; title: HelmetDatum; } - + interface HelmetDatum { toString(): string; toComponent(): React.Component; @@ -41,6 +42,6 @@ declare module "react-helmet" { (): ReactHelmet.HelmetComponent rewind(): ReactHelmet.HelmetData } - + export = Helmet; } From 9bb6206f477a736748689cd95c8ed98468a3456f Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Tue, 16 Aug 2016 14:17:25 +0200 Subject: [PATCH 031/105] Add Buffer.swap16, Buffer.swap32 and Buffer.swap64 functions --- node/node-tests.ts | 8 ++++++++ node/node.d.ts | 3 +++ 2 files changed, 11 insertions(+) diff --git a/node/node-tests.ts b/node/node-tests.ts index 32bdc94fdb..e5e0a7397b 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -183,6 +183,14 @@ function bufferTests() { var result1 = Buffer.concat([utf8Buffer, base64Buffer]); var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); + // Class Methods: Buffer.swap16(), Buffer.swa32(), Buffer.swap64() + { + const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + buf.swap16(); + buf.swap32(); + buf.swap64(); + } + // Class Method: Buffer.from(array) { const buf: Buffer = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]); diff --git a/node/node.d.ts b/node/node.d.ts index 99963bf49e..46e347d562 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -485,6 +485,9 @@ interface NodeBuffer extends Uint8Array { readFloatBE(offset: number, noAssert?: boolean): number; readDoubleLE(offset: number, noAssert?: boolean): number; readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; writeUInt8(value: number, offset: number, noAssert?: boolean): number; writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; From 4d8e6c5a4f2230652314f8e1cb6169b85ce33d02 Mon Sep 17 00:00:00 2001 From: Koloto Date: Tue, 16 Aug 2016 16:07:12 +0300 Subject: [PATCH 032/105] slickgrid: fixed getCellFromEvent signature, using DOMEvent in subscribe --- slickgrid/SlickGrid-tests.ts | 7 +++++-- slickgrid/SlickGrid.d.ts | 10 ++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/slickgrid/SlickGrid-tests.ts b/slickgrid/SlickGrid-tests.ts index e267a85948..592b966e6c 100644 --- a/slickgrid/SlickGrid-tests.ts +++ b/slickgrid/SlickGrid-tests.ts @@ -155,8 +155,6 @@ grid.getCellCssStyles("test")[0]["number_column"]; grid.getCellEditor(); -grid.getCellFromEvent(new Slick.Event()); - grid.getCellFromPoint(5, 10); grid.getCellNode(5, 10); @@ -210,3 +208,8 @@ columns.forEach(column => { grid.onSort.subscribe((e, args) => { var sortCol:string = args.sortCols[0].sortCol.field; }); + +grid.onMouseEnter.subscribe((e: DOMEvent, args) => { + let cell: Slick.Cell = args.grid.getCellFromEvent(e); + if (!cell) { return; } +}); \ No newline at end of file diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index 96f91eaaf1..bae31aab21 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -92,14 +92,16 @@ declare namespace Slick { * @method subscribe * @param fn {Function} Event handler. */ - public subscribe(fn: (eventData: EventData, data: T) => any ): void; + public subscribe(fn: (e: EventData, data: T) => any): void; + public subscribe(fn: (e: DOMEvent, data: T) => any): void; /*** * Removes an event handler added with subscribe(fn). * @method unsubscribe * @param fn {Function} Event handler to be removed. */ - public unsubscribe(fn: (eventData: EventData, data: T) => any ): void; + public unsubscribe(fn: (e: EventData, data: T) => any): void; + public unsubscribe(fn: (e: DOMEvent, data: T) => any): void; /*** * Fires an event notifying all subscribers. @@ -1037,7 +1039,7 @@ declare namespace Slick { * @param e A standard W3C/jQuery event. * @return **/ - public getCellFromEvent(e: Event): Cell; // todo: !! Unsure on return type !! + public getCellFromEvent(e: DOMEvent): Cell; /** * Returns a hash containing row and cell indexes. Coordinates are relative to the top left corner of the grid beginning with the first row (not including the column headers). @@ -1045,7 +1047,7 @@ declare namespace Slick { * @param y A y coordinate. * @return **/ - public getCellFromPoint(x: number, y: number): Cell; // todo: !! Unsure on return type !! + public getCellFromPoint(x: number, y: number): Cell; /** * Returns a DOM element containing a cell at a given row and cell. From f222c07219b1fad49639395dd32b0257d8480d1e Mon Sep 17 00:00:00 2001 From: Koloto Date: Tue, 16 Aug 2016 16:17:30 +0300 Subject: [PATCH 033/105] slickgrid: fixed getCellFromEvent signature, using DOMEvent in subscribe (fixed Travis CI failure) --- slickgrid/SlickGrid-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slickgrid/SlickGrid-tests.ts b/slickgrid/SlickGrid-tests.ts index 592b966e6c..5221f7c19d 100644 --- a/slickgrid/SlickGrid-tests.ts +++ b/slickgrid/SlickGrid-tests.ts @@ -209,7 +209,7 @@ grid.onSort.subscribe((e, args) => { var sortCol:string = args.sortCols[0].sortCol.field; }); -grid.onMouseEnter.subscribe((e: DOMEvent, args) => { +grid.onMouseEnter.subscribe((e: DOMEvent, args: Slick.OnMouseEnterEventArgs) => { let cell: Slick.Cell = args.grid.getCellFromEvent(e); if (!cell) { return; } -}); \ No newline at end of file +}); From e847d83c47a87cc71909a77e228094977ed76d54 Mon Sep 17 00:00:00 2001 From: msucheck Date: Tue, 16 Aug 2016 15:35:02 +0200 Subject: [PATCH 034/105] Added useExternalSorting property to IGridOptions interface in ui-grid --- ui-grid/ui-grid.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index 1ce953885f..084a6ac17a 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -832,6 +832,11 @@ declare namespace uiGrid { * @default false */ useExternalFiltering?: boolean; + /** + * Disables client side sorting. When true, handle the sortChanged event and do the sorting there + * @default false + */ + useExternalSorting?: boolean; /** * Default time in milliseconds to throttle scroll events to, defaults to 70ms * @default 70 @@ -3558,7 +3563,7 @@ declare namespace uiGrid { * Algorithm to use for sorting this column. Takes 'a' and 'b' parameters * like any normal sorting function with additional 'rowA', 'rowB', and 'direction' * parameters that are the row objects and the current direction of the sort - * respectively. + * respectively. */ sortingAlgorithm?: (a: any, b: any, rowA: IGridRowOf, rowB: IGridRowOf, direction: string) => number; /** Column width */ @@ -3793,7 +3798,7 @@ declare namespace uiGrid { * Algorithm to use for sorting this column. Takes 'a' and 'b' parameters * like any normal sorting function with additional 'rowA', 'rowB', and 'direction' * parameters that are the row objects and the current direction of the sort - * respectively. + * respectively. */ sortingAlgorithm?: (a: any, b: any, rowA: IGridRowOf, rowB: IGridRowOf, direction: string) => number; /** From 0d1bc9c0da57e6bdb510dd86d5dd8e519ad06de8 Mon Sep 17 00:00:00 2001 From: msucheck Date: Tue, 16 Aug 2016 16:00:15 +0200 Subject: [PATCH 035/105] Added definitions for highcharts-more --- highcharts/highcharts-more.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 highcharts/highcharts-more.d.ts diff --git a/highcharts/highcharts-more.d.ts b/highcharts/highcharts-more.d.ts new file mode 100644 index 0000000000..1d42764b3c --- /dev/null +++ b/highcharts/highcharts-more.d.ts @@ -0,0 +1,12 @@ +// Type definitions for Highcharts 4.2.6 +// Project: http://www.highcharts.com/ +// Definitions by: Maciej Suchecki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var HighchartsMore: (H: HighchartsStatic) => HighchartsStatic; + +declare module "highcharts/highcharts-more" { + export = HighchartsMore; +} From a28758054fd5ee6d86e2f599e37e790a8c3a4e37 Mon Sep 17 00:00:00 2001 From: york yao Date: Tue, 16 Aug 2016 22:14:23 +0800 Subject: [PATCH 036/105] add 3 missing methods in crypto module: getCiphers, getCurves and getHashes --- node/node.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 99963bf49e..723f6daed4 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -2166,6 +2166,9 @@ declare module "crypto" { } export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer + export function getCiphers(): string[]; + export function getCurves(): string[]; + export function getHashes(): string[]; } declare module "stream" { From 0b7a922c8349ac89481ab8ef99b01cdd930287d6 Mon Sep 17 00:00:00 2001 From: msucheck Date: Tue, 16 Aug 2016 16:15:51 +0200 Subject: [PATCH 037/105] Added definitions for highcharts-modules-exporting --- highcharts/highcharts-modules-exporting.d.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 highcharts/highcharts-modules-exporting.d.ts diff --git a/highcharts/highcharts-modules-exporting.d.ts b/highcharts/highcharts-modules-exporting.d.ts new file mode 100644 index 0000000000..55368a7491 --- /dev/null +++ b/highcharts/highcharts-modules-exporting.d.ts @@ -0,0 +1,12 @@ +// Type definitions for Highcharts 4.2.6 (exporting module) +// Project: http://www.highcharts.com/ +// Definitions by: Maciej Suchecki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var HighchartsExporting: (H: HighchartsStatic) => HighchartsStatic; + +declare module "highcharts/highcharts-modules-exporting" { + export = HighchartsExporting; +} From 2fc3a43ab80b98afaabcc676e9de92517b3c2d35 Mon Sep 17 00:00:00 2001 From: msucheck Date: Tue, 16 Aug 2016 16:43:23 +0200 Subject: [PATCH 038/105] Fixed module name for Highcharts Exporting Module - fixes #10540 --- highcharts/highcharts-modules-exporting.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highcharts/highcharts-modules-exporting.d.ts b/highcharts/highcharts-modules-exporting.d.ts index 55368a7491..4d3bdaa648 100644 --- a/highcharts/highcharts-modules-exporting.d.ts +++ b/highcharts/highcharts-modules-exporting.d.ts @@ -7,6 +7,6 @@ declare var HighchartsExporting: (H: HighchartsStatic) => HighchartsStatic; -declare module "highcharts/highcharts-modules-exporting" { +declare module "highcharts/modules/exporting" { export = HighchartsExporting; } From 00a6998f4e16aa2009ca5545768151d0e7ab7998 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Tue, 16 Aug 2016 10:10:39 -0500 Subject: [PATCH 039/105] Move interfaces in the 'electron-notify' module, and export them --- electron-notify/electron-notify.d.ts | 50 +++++++++++++--------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/electron-notify/electron-notify.d.ts b/electron-notify/electron-notify.d.ts index 3ad6906205..b29efa0e50 100644 --- a/electron-notify/electron-notify.d.ts +++ b/electron-notify/electron-notify.d.ts @@ -5,29 +5,10 @@ /// -declare namespace ElectronNotify { +/** Nice and simple notifications for electron apps */ +declare module 'electron-notify' { - interface ICloseNotificationEvent { - event: 'close' | 'show' | 'click', - id: number - } - - interface INotificationEvent extends ICloseNotificationEvent { - closeNotification: (reason: any) => void, - } - - interface INotification { - title: string, - text?: string, - image?: string, - url?: string, - sound?: string, - onClickFunc?: (event: INotificationEvent) => void, - onShowFunc?: (event: INotificationEvent) => void, - onCloseFunc?: (event: ICloseNotificationEvent) => void - } - - interface IConfiguration { + export interface ICustomConfig { width?: number, height?: number, padding?: number, @@ -47,16 +28,31 @@ declare namespace ElectronNotify { defaultStyleText?: any } -} + export interface ICloseNotificationEvent { + event: 'close' | 'show' | 'click', + id: number + } -/** Nice and simple notifications for electron apps */ -declare module 'electron-notify' { + export interface INotificationEvent extends ICloseNotificationEvent { + closeNotification: (reason: any) => void, + } + + export interface INotification { + title: string, + text?: string, + image?: string, + url?: string, + sound?: string, + onClickFunc?: (event: INotificationEvent) => void, + onShowFunc?: (event: INotificationEvent) => void, + onCloseFunc?: (event: ICloseNotificationEvent) => void + } /** Change some config options. Can be run multiple times, also between notify()-calls to change electron-notifys behaviour. */ - export function setConfig(customConfig: ElectronNotify.IConfiguration): void; + export function setConfig(customConfig: ICustomConfig): void; /** Displays new notification. */ - export function notify(notification: ElectronNotify.INotification): void; + export function notify(notification: INotification): void; /** Clears the animation queue and closes all windows opened by electron-notify. Call this to clean up before quiting your app. */ export function closeAll(): void; From a1b6081ba37e8bb42d8ed51d07a281597b177b5f Mon Sep 17 00:00:00 2001 From: rchaser53 Date: Wed, 17 Aug 2016 00:30:11 +0900 Subject: [PATCH 040/105] add arguments type for using stateless functional component I added the type for DragSource arguments. But I forgot to add the other function arguments type. --- react-dnd/react-dnd.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-dnd/react-dnd.d.ts b/react-dnd/react-dnd.d.ts index 71b6adb51b..000cd04ee2 100644 --- a/react-dnd/react-dnd.d.ts +++ b/react-dnd/react-dnd.d.ts @@ -47,16 +47,16 @@ declare module __ReactDnd { spec: DropTargetSpec

, collect: DropTargetCollector, options?: DndOptions

- ): (componentClass: React.ComponentClass

) => DndComponentClass

; + ): (componentClass: React.ComponentClass

| React.StatelessComponent

) => DndComponentClass

; export function DragDropContext

( backend: Backend - ): (componentClass: React.ComponentClass

) => ContextComponentClass

; + ):

(componentClass: React.ComponentClass

| React.StatelessComponent

) => ContextComponentClass

; export function DragLayer

( collect: DragLayerCollector, options?: DndOptions

- ): (componentClass: React.ComponentClass

) => DndComponentClass

; + ): (componentClass: React.ComponentClass

| React.StatelessComponent

) => DndComponentClass

; type DragSourceCollector = (connect: DragSourceConnector, monitor: DragSourceMonitor) => Object; type DropTargetCollector = (connect: DropTargetConnector, monitor: DropTargetMonitor) => Object; From e75095f1fdf63af6b1576b7aa0ec49f8f5963b1a Mon Sep 17 00:00:00 2001 From: David Poetzsch-Heffter Date: Tue, 16 Aug 2016 19:02:50 +0200 Subject: [PATCH 041/105] made sessionToken option available for all db operations (needed for cloud code in self-hosted parse-server) --- parse/parse.d.ts | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 6cf51a98b4..3a7d6b25f8 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -45,6 +45,9 @@ declare namespace Parse { useMasterKey?: boolean; } + interface ScopeOptions extends SessionTokenOption, UseMasterKeyOption { + } + interface SilentOption { /** * Set to true to avoid firing the event. @@ -363,15 +366,15 @@ declare namespace Parse { } namespace Object { - interface DestroyOptions extends SuccessFailureOptions, WaitOption, UseMasterKeyOption { } + interface DestroyOptions extends SuccessFailureOptions, WaitOption, ScopeOptions { } - interface DestroyAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface DestroyAllOptions extends SuccessFailureOptions, ScopeOptions { } - interface FetchOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface FetchOptions extends SuccessFailureOptions, ScopeOptions { } - interface SaveOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption, WaitOption { } + interface SaveOptions extends SuccessFailureOptions, SilentOption, ScopeOptions, WaitOption { } - interface SaveAllOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface SaveAllOptions extends SuccessFailureOptions, ScopeOptions { } interface SetOptions extends ErrorOption, SilentOption { promise?: any; @@ -462,10 +465,10 @@ declare namespace Parse { at?: number; } - interface CreateOptions extends SuccessFailureOptions, WaitOption, SilentOption, UseMasterKeyOption { + interface CreateOptions extends SuccessFailureOptions, WaitOption, SilentOption, ScopeOptions { } - interface FetchOptions extends SuccessFailureOptions, SilentOption, UseMasterKeyOption { } + interface FetchOptions extends SuccessFailureOptions, SilentOption, ScopeOptions { } interface RemoveOptions extends SilentOption { } @@ -623,11 +626,11 @@ declare namespace Parse { } namespace Query { - interface EachOptions extends SuccessFailureOptions, UseMasterKeyOption { } - interface CountOptions extends SuccessFailureOptions, UseMasterKeyOption { } - interface FindOptions extends SuccessFailureOptions, UseMasterKeyOption { } - interface FirstOptions extends SuccessFailureOptions, UseMasterKeyOption { } - interface GetOptions extends SuccessFailureOptions, UseMasterKeyOption { } + interface EachOptions extends SuccessFailureOptions, ScopeOptions { } + interface CountOptions extends SuccessFailureOptions, ScopeOptions { } + interface FindOptions extends SuccessFailureOptions, ScopeOptions { } + interface FirstOptions extends SuccessFailureOptions, ScopeOptions { } + interface GetOptions extends SuccessFailureOptions, ScopeOptions { } } /** @@ -893,7 +896,7 @@ declare namespace Parse { function run(name: string, data?: any, options?: RunOptions): Promise; function useMasterKey(): void; - interface RunOptions extends SuccessFailureOptions, UseMasterKeyOption, SessionTokenOption { } + interface RunOptions extends SuccessFailureOptions, ScopeOptions { } /** * To use this Cloud Module in Cloud Code, you must require 'buffer' in your JavaScript file. From b8e87fd5302d9b7df7ef4498b64e1fd5961aea2e Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Wed, 17 Aug 2016 01:35:43 +0800 Subject: [PATCH 042/105] node.d.ts : dgram : Allow option parameters to be omitted. --- node/node-tests.ts | 3 +++ node/node.d.ts | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/node/node-tests.ts b/node/node-tests.ts index 32bdc94fdb..50242e9c31 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -507,9 +507,12 @@ namespace tty_tests { var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => { }); +ds.bind(); +ds.bind(41234); var ai: dgram.AddressInfo = ds.address(); ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => { }); +ds.send(new Buffer("hello"), 5000, "127.0.0.1"); //////////////////////////////////////////////////// ///Querystring tests : https://nodejs.org/api/querystring.html diff --git a/node/node.d.ts b/node/node.d.ts index 99963bf49e..61d98fb1ee 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1371,7 +1371,8 @@ declare module "dgram" { interface Socket extends events.EventEmitter { send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; - bind(port: number, address?: string, callback?: () => void): void; + send(buf: Buffer, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + bind(port?: number, address?: string, callback?: () => void): void; close(): void; address(): AddressInfo; setBroadcast(flag: boolean): void; From 190beb00269d2a34ae7c60eab75c15690caef4b1 Mon Sep 17 00:00:00 2001 From: Andrew Connell Date: Tue, 16 Aug 2016 15:57:28 -0400 Subject: [PATCH 043/105] update wallabyjs.d.ts - richer typing Added better support for custom compilers, built in compilers and typing for the wallaby object passed in. --- wallabyjs/wallabyjs-tests.ts | 4 +-- wallabyjs/wallabyjs.d.ts | 54 ++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 7 deletions(-) diff --git a/wallabyjs/wallabyjs-tests.ts b/wallabyjs/wallabyjs-tests.ts index 832a775cd0..132984d039 100644 --- a/wallabyjs/wallabyjs-tests.ts +++ b/wallabyjs/wallabyjs-tests.ts @@ -13,7 +13,7 @@ export class WallabyConfig implements wallabyjs.IWallabyConfig { 'src/**/*.spec.ts' ]; - public compilers: wallabyjs.IWallabyCompiler = { + public compilers: wallabyjs.IWallabyCompilers = { 'src/**/*.js': this.wallaby.compilers.babel({}), 'src/**/*.ts': this.wallaby.compilers.typeScript({}) }; @@ -36,5 +36,5 @@ export class WallabyConfig implements wallabyjs.IWallabyConfig { } }; - constructor(private wallaby: any) { } + constructor(private wallaby: wallabyjs.IWallaby) { } } diff --git a/wallabyjs/wallabyjs.d.ts b/wallabyjs/wallabyjs.d.ts index 4f90762c2b..211963c8b3 100644 --- a/wallabyjs/wallabyjs.d.ts +++ b/wallabyjs/wallabyjs.d.ts @@ -24,7 +24,7 @@ declare module 'wallabyjs' { * @see {@link https://wallabyjs.com/docs/config/overview.html} for details. */ export interface IWallabyConfig { - comilers?: IWallabyCompiler; + comilers?: IWallabyCompilers; debug?: boolean; env?: IWallabyEnvironment; files: string[] | IWallabyFilePattern[]; @@ -36,16 +36,60 @@ declare module 'wallabyjs' { } /** - * Wallaby compiler configuration. + * Wallaby compilers. * + * @export * @interface IWallabyCompiler * * @see {@link https://wallabyjs.com/docs/config/compilers.html} for details. */ - export interface IWallabyCompiler { + export interface IWallabyCompilers { [pattern: string]: any } + /** + * Wallaby built in compiler options. These are name-value pairs passed into each compiler. + * + * @export + * @interface IWallabyCompilerOptions + * + * @see {@link https://wallabyjs.com/docs/config/compilers.html} for details. + */ + export interface IWallabyBuiltInCompilerOptions { + [option: string]: string; + } + + /** + * Wallaby build in compilers. + * + * @export + * @interface IWallabyBuiltInCompilers + * + * @see {@link https://wallabyjs.com/docs/config/compilers.html} for details. + */ + export interface IWallabyBuiltInCompilers { + babel(compilerOptions?: IWallabyBuiltInCompilerOptions): IWallabyCompilerResult; + coffeeScript(compilerOptions?: IWallabyBuiltInCompilerOptions): IWallabyCompilerResult; + typeScript(compilerOptions?: IWallabyBuiltInCompilerOptions): IWallabyCompilerResult; + } + + /** + * Wallaby compiler result entity. + * + * @export + * @interface IWallabyCompilerResult + * + * @property {string} map - Source map. + * @property {string} code - Code transformed to JavaScript. + * @property {any} ranges - All converable ranges of the original file. + * + * @see {@link https://wallabyjs.com/docs/config/compilers.html} for details. + */ + export interface IWallabyCompilerResult { + map: string; + code: string; + ranges: any; + } /** * Wallaby processor used in pre & post processors. @@ -149,7 +193,7 @@ declare module 'wallabyjs' { * * @property {string=} localProjectDir - String property which returns the project local folder. * @property {string=} projectCacheDir - String property which returns the project cache folder. - * @property {IWallabyCompiler=} compilers - Property which allows you to access the built-in TypeScript, CoffeeScript and Babel compilers. + * @property {IWallabyBuiltInCompilers=} compilers - Property which allows you to access the built-in TypeScript, CoffeeScript and Babel compilers. * @property {object=} defaults - Property which allows you to set the default values for file object properties. * * @see {@link https://wallabyjs.com/docs/config/overview.html} for details. @@ -157,7 +201,7 @@ declare module 'wallabyjs' { export interface IWallaby { localProjectDir?: string; projectCacheDir?: string; - compilers?: IWallabyCompiler; + compilers?: IWallabyBuiltInCompilers; defaults?: any; } } From b7802eae32129e2ca63bee58eec8df50fa691153 Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Tue, 16 Aug 2016 14:38:37 -0500 Subject: [PATCH 044/105] Add redis-scripto typings with tests. --- redis-scripto/redis-scripto-tests.ts | 37 ++++++++++++++++++++++++++ redis-scripto/redis-scripto.d.ts | 39 ++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 redis-scripto/redis-scripto-tests.ts create mode 100644 redis-scripto/redis-scripto.d.ts diff --git a/redis-scripto/redis-scripto-tests.ts b/redis-scripto/redis-scripto-tests.ts new file mode 100644 index 0000000000..235ebeb819 --- /dev/null +++ b/redis-scripto/redis-scripto-tests.ts @@ -0,0 +1,37 @@ +/// +/// + +import * as redis from 'redis'; +import * as Scripto from 'redis-scripto'; + +var num: number; +var str: string; +var options: redis.ClientOpts; +var redisClient = redis.createClient(num, str, options); + +var scriptManager = new Scripto(redisClient); +scriptManager.loadFromDir('/path/to/lua/scripts'); + +var keys = ['keyOne', 'keyTwo']; +var values = [10, 20]; +scriptManager.run('your-script', keys, values, function(err, result) { + +}); + +scriptManager.eval('your-script', keys, values, function(err, result) { + +}); + +scriptManager.loadFromFile('script-one', '/path/to/the/file'); +scriptManager.run('script-one', [], [], function(err, result) { + +}); + +var scripts: Scripto.Scripts = { + 'script-two': 'return 1000' +}; + +scriptManager.load(scripts); +scriptManager.run('script-two', [], [], function(err, result) { + +}); diff --git a/redis-scripto/redis-scripto.d.ts b/redis-scripto/redis-scripto.d.ts new file mode 100644 index 0000000000..e62e239210 --- /dev/null +++ b/redis-scripto/redis-scripto.d.ts @@ -0,0 +1,39 @@ +// Type definitions for redis-scripto 0.1.3 +// Project: https://github.com/arunoda/node-redis-scripto +// Definitions by: Seth Westphal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "redis-scripto" { + + import * as redis from 'redis'; + + class Scripto { + + constructor(redisClient: redis.RedisClient); + + eval(scriptName: string, keys: string[], args: any[], callback: (err: Error, result: any) => void): void; + evalSha(scriptName: string, keys: string[], args: any[], callback: (err: Error, result: any) => void): void; + + load(scripts: Scripto.Scripts): void; + loadFromDir(scriptsDir: string): void; + loadFromFile(name: string, filepath: string): void; + + run(scriptName: string, keys: string[], args: any[], callback: (err: Error, result: any) => void): void; + + } + + namespace Scripto { + + export type Script = string; + + export interface Scripts { + [scriptName: string]: Script; + } + + } + + export = Scripto; + +} From be6fac9f8ce56d7975c5ece31a144e96848fa33a Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Tue, 16 Aug 2016 15:55:10 -0500 Subject: [PATCH 045/105] Add redis-rate-limiter and tests. --- .../redis-rate-limiter-tests.ts | 41 +++++++++++++++++ redis-rate-limiter/redis-rate-limiter.d.ts | 44 +++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 redis-rate-limiter/redis-rate-limiter-tests.ts create mode 100644 redis-rate-limiter/redis-rate-limiter.d.ts diff --git a/redis-rate-limiter/redis-rate-limiter-tests.ts b/redis-rate-limiter/redis-rate-limiter-tests.ts new file mode 100644 index 0000000000..8fb68941ac --- /dev/null +++ b/redis-rate-limiter/redis-rate-limiter-tests.ts @@ -0,0 +1,41 @@ +/// +/// +/// + +import * as express from 'express'; +import * as redis from 'redis'; +import * as rateLimiter from 'redis-rate-limiter'; + +var num: number; +var str: string; +var options: redis.ClientOpts; +var redisClient = redis.createClient(num, str, options); + +var limit = rateLimiter.create({ + redis: redisClient, + key: function(x) { return x.ip }, + rate: '100/minute' +}); + +var request = {} as express.Request; +limit(request, function(err, rate) { + if (err) { + console.warn('Rate limiting not available'); + } else { + console.log('Rate window: ' + rate.window); // 60 + console.log('Rate limit: ' + rate.limit); // 100 + console.log('Rate current: ' + rate.current); // 74 + if (rate.over) { + console.error('Over the limit!'); + } + } +}); + +var middleware = rateLimiter.middleware({ + redis: redisClient, + key: 'ip', + rate: '100/minute' +}); + +var app = express(); +app.use(middleware); diff --git a/redis-rate-limiter/redis-rate-limiter.d.ts b/redis-rate-limiter/redis-rate-limiter.d.ts new file mode 100644 index 0000000000..6fa9998a0a --- /dev/null +++ b/redis-rate-limiter/redis-rate-limiter.d.ts @@ -0,0 +1,44 @@ +// Type definitions for redis-rate-limiter 1.0.3 +// Project: https://github.com/TabDigital/redis-rate-limiter +// Definitions by: Seth Westphal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "redis-rate-limiter" { + + import * as express from 'express'; + import * as redis from 'redis'; + + class RedisRateLimiter { + + public static create(options: RedisRateLimiter.Options): + (req: express.Request, callback: (err: Error, res: RedisRateLimiter.Response) => void) => void; + public static middleware(options: RedisRateLimiter.Options): express.RequestHandler; + + } + + namespace RedisRateLimiter { + + export interface Options { + redis: redis.RedisClient; + key: 'ip' | ((req: express.Request) => string); + window?: number; + limit?: number; + rate?: string; + } + + export interface Response { + key: string; + current: number; + limit: number; + window: number; + over: boolean; + } + + } + + export = RedisRateLimiter; + +} From ad2267039b655754ecd546dd7414abe3787538df Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Tue, 16 Aug 2016 17:51:14 -0500 Subject: [PATCH 046/105] Rename auth0 -> auth0-js. --- auth0/auth0-tests.ts => auth0-js/auth0-js-tests.ts | 2 +- auth0/auth0.d.ts => auth0-js/auth0-js.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename auth0/auth0-tests.ts => auth0-js/auth0-js-tests.ts (91%) rename auth0/auth0.d.ts => auth0-js/auth0-js.d.ts (98%) diff --git a/auth0/auth0-tests.ts b/auth0-js/auth0-js-tests.ts similarity index 91% rename from auth0/auth0-tests.ts rename to auth0-js/auth0-js-tests.ts index 9cd903b306..c92251db91 100644 --- a/auth0/auth0-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -1,4 +1,4 @@ -/// +/// var auth0 = new Auth0({ domain: 'mine.auth0.com', diff --git a/auth0/auth0.d.ts b/auth0-js/auth0-js.d.ts similarity index 98% rename from auth0/auth0.d.ts rename to auth0-js/auth0-js.d.ts index 5ca8487f85..1ee4ab9d7c 100644 --- a/auth0/auth0.d.ts +++ b/auth0-js/auth0-js.d.ts @@ -1,5 +1,5 @@ // Type definitions for Auth0.js -// Project: http://auth0.com +// Project: https://github.com/auth0/auth0.js // Definitions by: Robert McLaws // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From f471b0f7d78f0401773299e3f0634619e211b115 Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Tue, 16 Aug 2016 19:24:53 -0500 Subject: [PATCH 047/105] Fix auth0 -> auth0-js imports. --- auth0.lock/auth0.lock-tests.ts | 2 +- auth0.lock/auth0.lock.d.ts | 2 +- auth0.widget/auth0.widget-tests.ts | 2 +- auth0.widget/auth0.widget.d.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth0.lock/auth0.lock-tests.ts b/auth0.lock/auth0.lock-tests.ts index 07a7cf8323..d466cf5937 100644 --- a/auth0.lock/auth0.lock-tests.ts +++ b/auth0.lock/auth0.lock-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID"; diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts index 7a459afd97..43d842aecc 100644 --- a/auth0.lock/auth0.lock.d.ts +++ b/auth0.lock/auth0.lock.d.ts @@ -3,7 +3,7 @@ // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface Auth0LockAdditionalSignUpFieldOption { value: string; diff --git a/auth0.widget/auth0.widget-tests.ts b/auth0.widget/auth0.widget-tests.ts index 012e9b9769..f44601986e 100644 --- a/auth0.widget/auth0.widget-tests.ts +++ b/auth0.widget/auth0.widget-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// var widget: Auth0WidgetStatic = new Auth0Widget({ diff --git a/auth0.widget/auth0.widget.d.ts b/auth0.widget/auth0.widget.d.ts index 20694526c3..e36a7f868a 100644 --- a/auth0.widget/auth0.widget.d.ts +++ b/auth0.widget/auth0.widget.d.ts @@ -3,7 +3,7 @@ // Definitions by: Robert McLaws // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface Auth0WidgetStatic { From 0fdba28d3871b1e649567b1f41c2d053a358bdbd Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Tue, 16 Aug 2016 19:46:02 -0500 Subject: [PATCH 048/105] Add auth0 typings and tests. --- auth0/auth0-tests.ts | 51 ++++++++++++++++++++++++ auth0/auth0.d.ts | 95 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 auth0/auth0-tests.ts create mode 100644 auth0/auth0.d.ts diff --git a/auth0/auth0-tests.ts b/auth0/auth0-tests.ts new file mode 100644 index 0000000000..a1357246f3 --- /dev/null +++ b/auth0/auth0-tests.ts @@ -0,0 +1,51 @@ +/// + +import * as auth0 from 'auth0'; + +const management = new auth0.ManagementClient({ + token: '{YOUR_API_V2_TOKEN}', + domain: '{YOUR_ACCOUNT}.auth0.com' +}); + +const auth = new auth0.AuthenticationClient({ + domain: '{YOUR_ACCOUNT}.auth0.com', + clientId: '{OPTIONAL_CLIENT_ID}' +}); + +// Using a callback. +management.getUsers((err: Error, users: auth0.User[]) => { + if (err) { + // Handle error. + } + console.log(users); +}); + +// Using a Promise. +management + .getUsers() + .then((users) => { + console.log(users); + }) + .catch((err) => { + // Handle the error. + }); + +management + .createUser({ + connection: 'My-Connection', + email: 'hi@me.co', + }).then((user) => { + console.log(user); + }).catch((err) => { + // Handle the error. + }); + +auth + .requestChangePasswordEmail({ + connection: 'My-Connection', + email: 'hi@me.co', + }).then((response) => { + console.log(response); + }).catch((err) => { + // Handle the error. + }); diff --git a/auth0/auth0.d.ts b/auth0/auth0.d.ts new file mode 100644 index 0000000000..e367d30411 --- /dev/null +++ b/auth0/auth0.d.ts @@ -0,0 +1,95 @@ +// Type definitions for auth0 v2.3.1 +// Project: https://github.com/auth0/node-auth0 +// Definitions by: Seth Westphal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "auth0" { + + import * as Promise from 'bluebird'; + + export interface ManagementClientOptions { + token: string; + domain?: string; + } + + export interface UserData { + connection: string; + email?: string; + username?: string; + password?: string; + phone_number?: string; + user_metadata?: {}; + email_verified?: boolean; + app_metadata?: {}; + } + + export interface GetUsersData { + per_page?: number; + page?: number; + include_totals?: boolean; + sort?: string; + connection?: string; + fields?: string; + include_fields?: boolean; + q?: string; + search_engine?: string; + } + + export interface User { + email?: string; + email_verified?: boolean; + username?: string; + phone_number?: string; + phone_verified?: boolean; + user_id?: string; + created_at?: string; + updated_at?: string; + identities?: Identity[]; + app_metadata?: {}; + user_metadata?: {}; + picture?: string; + name?: string; + nickname?: string; + multifactor?: string[]; + last_ip?: string; + last_login?: string; + logins_count?: number; + blocked?: boolean; + } + + export interface Identity { + connection: string; + user_id: string; + provider: string; + isSocial: boolean; + } + + export class ManagementClient { + constructor(options: ManagementClientOptions); + + getUsers(params?: GetUsersData): Promise; + getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void; + createUser(data: UserData): Promise; + createUser(data: UserData, cb: (err: Error, data: User) => void): void; + } + + export interface AuthenticationClientOptions { + clientId?: string; + domain: string; + } + + export interface RequestChangePasswordEmailData { + connection: string; + email: string; + } + + export class AuthenticationClient { + constructor(options: AuthenticationClientOptions); + + requestChangePasswordEmail(data: RequestChangePasswordEmailData): Promise; + requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void; + } + +} From d887ba6c3cb656316d96d06a5499910358963c20 Mon Sep 17 00:00:00 2001 From: rhysd Date: Wed, 17 Aug 2016 15:16:22 +0900 Subject: [PATCH 049/105] electron-prebuilt was renamed to electron http://electron.atom.io/blog/2016/08/16/npm-install-electron --- .../{electron-prebuilt-tests.ts => electron-tests.ts} | 4 ++-- github-electron/{electron-prebuilt.d.ts => electron.d.ts} | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) rename github-electron/{electron-prebuilt-tests.ts => electron-tests.ts} (56%) rename github-electron/{electron-prebuilt.d.ts => electron.d.ts} (53%) diff --git a/github-electron/electron-prebuilt-tests.ts b/github-electron/electron-tests.ts similarity index 56% rename from github-electron/electron-prebuilt-tests.ts rename to github-electron/electron-tests.ts index 771fd06016..00b34d60b1 100644 --- a/github-electron/electron-prebuilt-tests.ts +++ b/github-electron/electron-tests.ts @@ -1,7 +1,7 @@ -/// +/// /// -import electron = require('electron-prebuilt'); +import electron = require('electron'); import child_process = require('child_process'); child_process.spawn(electron); diff --git a/github-electron/electron-prebuilt.d.ts b/github-electron/electron.d.ts similarity index 53% rename from github-electron/electron-prebuilt.d.ts rename to github-electron/electron.d.ts index d6b6dffc0e..5e331b3e47 100644 --- a/github-electron/electron-prebuilt.d.ts +++ b/github-electron/electron.d.ts @@ -1,9 +1,9 @@ -// Type definitions for electron-prebuilt 0.30.1 -// Project: https://github.com/mafintosh/electron-prebuilt +// Type definitions for electron 1.3.3 +// Project: https://github.com/electron-userland/electron-prebuilt // Definitions by: rhysd // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module 'electron-prebuilt' { +declare module 'electron' { var electron: string; export = electron; } From f1c88a8096d9892bec602a4bb1f560d33d0c82c7 Mon Sep 17 00:00:00 2001 From: Maxim Samoilov Date: Tue, 16 Aug 2016 14:40:01 +0700 Subject: [PATCH 050/105] test(react): add strictNullChecks test #10421 --- react/react-tsx-tests.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 react/react-tsx-tests.tsx diff --git a/react/react-tsx-tests.tsx b/react/react-tsx-tests.tsx new file mode 100644 index 0000000000..303a6b1f42 --- /dev/null +++ b/react/react-tsx-tests.tsx @@ -0,0 +1,16 @@ +/// +import React = require("react"); + +interface SCProps { + foo?: number; +} + +var StatelessComponent: React.SFC = ({ foo }: SCProps) => { + return

{ foo }
; +}; +StatelessComponent.displayName = "StatelessComponent3"; +StatelessComponent.defaultProps = { + foo: 42 +}; + +; From d72a787f0dfc80d3320842697d23f122644533ab Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Wed, 17 Aug 2016 10:06:23 +0300 Subject: [PATCH 051/105] Update react.d.ts --- react/react.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/react.d.ts b/react/react.d.ts index f3ce283545..7f3c87082a 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -276,10 +276,10 @@ declare namespace __React { isTrusted: boolean; nativeEvent: Event; preventDefault(): void; - stopPropagation(): void; - persist(): void; isDefaultPrevented(): boolean; + stopPropagation(): void; isPropagationStopped(): boolean; + persist(): void; target: EventTarget; timeStamp: Date; type: string; From 5073eb65dc9d6617d67d2c7b0a11e25d3b9ca6cb Mon Sep 17 00:00:00 2001 From: TonyYang Date: Wed, 17 Aug 2016 17:07:40 +0800 Subject: [PATCH 052/105] http.IncomingMessage: destroy not found Please refer to https://nodejs.org/api/http.html#http_message_destroy_error --- node/node.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/node/node.d.ts b/node/node.d.ts index 99963bf49e..8b944dda8d 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -670,6 +670,7 @@ declare module "http" { */ statusMessage?: string; socket: net.Socket; + destroy(error: Error): void; } /** * @deprecated Use IncomingMessage From 75bfef43c60910b770bbee513c019f055d16ab85 Mon Sep 17 00:00:00 2001 From: TonyYang Date: Wed, 17 Aug 2016 17:36:04 +0800 Subject: [PATCH 053/105] destroy has a optional argument --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 8b944dda8d..3177d9d290 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -670,7 +670,7 @@ declare module "http" { */ statusMessage?: string; socket: net.Socket; - destroy(error: Error): void; + destroy(error?: Error): void; } /** * @deprecated Use IncomingMessage From ab22123c9c46173dda11d0d4d636fe336f492923 Mon Sep 17 00:00:00 2001 From: TonyYang Date: Wed, 17 Aug 2016 17:36:56 +0800 Subject: [PATCH 054/105] destroy has a optional argument From 79dcf14a6ba1ae5fd1d2962916201fe45a48c98d Mon Sep 17 00:00:00 2001 From: Andrew Connell Date: Wed, 17 Aug 2016 06:16:16 -0400 Subject: [PATCH 055/105] update header with my GH link for DT-BOT --- wallabyjs/wallabyjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wallabyjs/wallabyjs.d.ts b/wallabyjs/wallabyjs.d.ts index 211963c8b3..7b791e44ff 100644 --- a/wallabyjs/wallabyjs.d.ts +++ b/wallabyjs/wallabyjs.d.ts @@ -1,6 +1,6 @@ // Type definitions for WallabyJS // Project: http://wallabyjs.com -// Definitions by: Andrew Connell +// Definitions by: Andrew Connell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module 'wallabyjs' { From 739bd1a4746ed933a388321bcd02975c11c3430a Mon Sep 17 00:00:00 2001 From: york yao Date: Wed, 17 Aug 2016 18:54:40 +0800 Subject: [PATCH 056/105] the muster.array() 's parameter is optional --- multer/multer.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multer/multer.d.ts b/multer/multer.d.ts index 4b70555af8..2a4eea805f 100644 --- a/multer/multer.d.ts +++ b/multer/multer.d.ts @@ -90,7 +90,7 @@ declare module "multer" { /** Accept a single file with the name fieldname. The single file will be stored in req.file. */ single(fieldame: string): express.RequestHandler; /** Accept an array of files, all with the name fieldname. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ - array(fieldame: string, maxCount?: number): express.RequestHandler; + array(fieldame?: string, maxCount?: number): express.RequestHandler; /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ fields(fields: Field[]): express.RequestHandler; /** Accepts all files that comes over the wire. An array of files will be stored in req.files. */ From 8039434c204a56b575f56fa2860654da808db208 Mon Sep 17 00:00:00 2001 From: Nicholas Iannone Date: Wed, 17 Aug 2016 09:53:59 -0500 Subject: [PATCH 057/105] Renamed modules. --- db-migrate-base/db-migrate-base-tests.ts | 2 +- db-migrate-base/db-migrate-base.d.ts | 2 +- db-migrate-pg/db-migrate-pg-tests.ts | 2 +- db-migrate-pg/db-migrate-pg.d.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db-migrate-base/db-migrate-base-tests.ts b/db-migrate-base/db-migrate-base-tests.ts index 68c61e6f6c..55d471b98f 100644 --- a/db-migrate-base/db-migrate-base-tests.ts +++ b/db-migrate-base/db-migrate-base-tests.ts @@ -1,7 +1,7 @@ // Test file for db-migrate-base Definition file /// -import * as DbMigrateBase from "DbMigrateBase"; +import * as DbMigrateBase from "db-migrate-base"; // Throw together a dummy driver let db = {}; diff --git a/db-migrate-base/db-migrate-base.d.ts b/db-migrate-base/db-migrate-base.d.ts index 47dd8ce1c2..fe1f4ade47 100644 --- a/db-migrate-base/db-migrate-base.d.ts +++ b/db-migrate-base/db-migrate-base.d.ts @@ -6,7 +6,7 @@ /// /// -declare module "DbMigrateBase" { +declare module "db-migrate-base" { export interface CallbackFunction { (err: any, response: any): void; } diff --git a/db-migrate-pg/db-migrate-pg-tests.ts b/db-migrate-pg/db-migrate-pg-tests.ts index ad2430440c..3878c54607 100644 --- a/db-migrate-pg/db-migrate-pg-tests.ts +++ b/db-migrate-pg/db-migrate-pg-tests.ts @@ -1,7 +1,7 @@ // Test file for db-migrate-pg Definition file /// -import * as DbMigratePg from "DbMigratePg"; +import * as DbMigratePg from "db-migrate-pg"; // Throw together a dummy driver let db = {}; diff --git a/db-migrate-pg/db-migrate-pg.d.ts b/db-migrate-pg/db-migrate-pg.d.ts index 4d2823ec52..aa1a52d34e 100644 --- a/db-migrate-pg/db-migrate-pg.d.ts +++ b/db-migrate-pg/db-migrate-pg.d.ts @@ -6,10 +6,10 @@ /// /// -declare module "DbMigratePg" { +declare module "db-migrate-pg" { import * as pg from "pg"; - import * as DbMigrateBase from "DbMigrateBase"; + import * as DbMigrateBase from "db-migrate-base"; // Yes, this is a dummy interface for now; the current implementation of the pg driver doesn't need any options. export interface CreateDatabaseOptions {} From 896f3172983d25c405be5ad21f3cc20f136ae0ee Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 17 Aug 2016 11:56:21 -0400 Subject: [PATCH 058/105] lodash: Added flush method to debounced & throttled functions --- lodash/lodash.d.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 52f274fd3c..e64c868354 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -172,6 +172,7 @@ Other changes - [x] Ensured _.range preserves the sign of start of -0 - [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch - [x] Fixed rounding issue with the precision param of _.floor +- [x] Added flush method to debounced & throttled functions ** LATER ** Misc: @@ -185,7 +186,6 @@ Misc: - [ ] _.extend as an alias of _.assignIn - [ ] _.extendWith as an alias of _.assignInWith - [ ] Added clear method to _.memoize.Cache -- [ ] Added flush method to debounced & throttled functions - [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray - [ ] Enabled _.flow & _.flowRight to accept an array of functions - [ ] Ensured “Collection” methods treat functions as objects @@ -10132,9 +10132,9 @@ declare module _ { /** * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since * the last time the debounced function was invoked. The debounced function comes with a cancel method to - * cancel delayed invocations. Provide an options object to indicate that func should be invoked on the - * leading and/or trailing edge of the wait timeout. Subsequent calls to the debounced function return the - * result of the last func invocation. + * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to + * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent + * calls to the debounced function return the result of the last func invocation. * * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only * if the the debounced function is invoked more than once during the wait timeout. @@ -10755,9 +10755,9 @@ declare module _ { interface LoDashStatic { /** * Creates a throttled function that only invokes func at most once per every wait milliseconds. The throttled - * function comes with a cancel method to cancel delayed invocations. Provide an options object to indicate - * that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent calls to - * the throttled function return the result of the last func call. + * function comes with a cancel method to cancel delayed invocations and a flush method to immediately invoke + * them. Provide an options object to indicate that func should be invoked on the leading and/or trailing edge + * of the wait timeout. Subsequent calls to the throttled function return the result of the last func call. * * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only if * the the throttled function is invoked more than once during the wait timeout. @@ -19159,6 +19159,7 @@ declare module _ { interface Cancelable { cancel(): void; + flush(): void; } } From dcaf000f890831e3e8431f0f682c7fffd06241ee Mon Sep 17 00:00:00 2001 From: Marcel Haldemann Date: Wed, 17 Aug 2016 19:12:21 +0200 Subject: [PATCH 059/105] make express.Application compatible with http.createServer --- express-serve-static-core/express-serve-static-core.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/express-serve-static-core/express-serve-static-core.d.ts b/express-serve-static-core/express-serve-static-core.d.ts index de91c521cc..f83e509e63 100644 --- a/express-serve-static-core/express-serve-static-core.d.ts +++ b/express-serve-static-core/express-serve-static-core.d.ts @@ -22,7 +22,7 @@ declare module "express-serve-static-core" { } interface RequestHandler { - (req: Request, res: Response, next: NextFunction): any; + (req: Request, res: Response, next?: NextFunction): any; } interface ErrorRequestHandler { From 5953dd4f6c9cebee89f6f26da74280d525c21d08 Mon Sep 17 00:00:00 2001 From: Daryl LaBar Date: Wed, 17 Aug 2016 14:08:01 -0400 Subject: [PATCH 060/105] Verified that addPreSearch returns a ContextSensitiveHandler, and since the handler is added against a control, the getEventSource can return a Control as well.. --- xrm/xrm.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xrm/xrm.d.ts b/xrm/xrm.d.ts index cf2b4c77c3..824c91ba0c 100644 --- a/xrm/xrm.d.ts +++ b/xrm/xrm.d.ts @@ -786,7 +786,7 @@ declare namespace Xrm * * @return The event source. */ - getEventSource(): Attribute | Entity; + getEventSource(): Attribute | Control | Entity; /** * Gets the shared variable with the specified key. @@ -1726,7 +1726,7 @@ declare namespace Xrm * * @param {Function} handler The handler. */ - addPreSearch( handler: () => void ): void; + addPreSearch( handler: ContextSensitiveHandler ): void; /** * Adds an additional custom filter to the lookup, with the "AND" filter operator. From 40c950b9239ddfc16a3e4b45add90bc9b06f3647 Mon Sep 17 00:00:00 2001 From: Schmulik Raskin Date: Wed, 17 Aug 2016 23:43:33 +0300 Subject: [PATCH 061/105] Add namespace to gulp-rename to make export work --- gulp-rename/gulp-rename-tests.ts | 5 ++++- gulp-rename/gulp-rename.d.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gulp-rename/gulp-rename-tests.ts b/gulp-rename/gulp-rename-tests.ts index 6b204a36d9..b27f0f5ba9 100644 --- a/gulp-rename/gulp-rename-tests.ts +++ b/gulp-rename/gulp-rename-tests.ts @@ -3,6 +3,9 @@ import gulp = require("gulp"); import rename = require("gulp-rename"); +// Test that new import syntax works +import * as newRename from 'gulp-rename'; + // rename via string gulp.src("./src/main/text/hello.txt") .pipe(rename("main/text/ciao/goodbye.md")) @@ -26,4 +29,4 @@ gulp.src("./src/main/text/hello.txt", { base: process.cwd() }) suffix: "-hola", extname: ".md" })) - .pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/bonjour-aloha-hola.md \ No newline at end of file + .pipe(gulp.dest("./dist")); // ./dist/main/text/ciao/bonjour-aloha-hola.md diff --git a/gulp-rename/gulp-rename.d.ts b/gulp-rename/gulp-rename.d.ts index 11368e9698..4c68aecde7 100644 --- a/gulp-rename/gulp-rename.d.ts +++ b/gulp-rename/gulp-rename.d.ts @@ -20,5 +20,12 @@ declare module "gulp-rename" { function rename(name: string): NodeJS.ReadWriteStream; function rename(callback: (path: ParsedPath) => any): NodeJS.ReadWriteStream; function rename(opts: Options): NodeJS.ReadWriteStream; + + /** + * This is required as per: + * https://github.com/Microsoft/TypeScript/issues/5073 + */ + namespace rename {} + export = rename; -} \ No newline at end of file +} From 61e748a7c0af30f8b38d9793960b394990e30a72 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Wed, 17 Aug 2016 18:20:41 -0400 Subject: [PATCH 062/105] Chores Fixes Enhancements Additions: * d3-array: Changed name of import alias in test file for consistency with other test files. Deleted excess line at end of definition. * d3-axis: Enhanced Axis.scale() getter to use generic for refined return type casting. Return type can now be more specific than AxisScale minimal interface compliance. Used `this` as return type for chainable setter methods on Axis. * d3-brush: Use ValueFn type alias from d3-selection for harmonization of callbacks. Use `this` as return type of chainable setter methods. Fixed return type of BrushBehavior.move(...) to be void * d3-chord: Use `this` as return type of chainable setter methods. * d3-collection: Use `this` as return type of chainable setter methods. * d3-color: Use `this` as return type of chainable setter methods. Added helper interface ColorCommonInstance as a fallback to allow extensibility of color spaces e.g. as through d3-hsv * d3-dispatch: Use `this` as return type of chainable setter methods. * d3-drag: Use ValueFn type alias from d3-selection for harmonization of callbacks. Use `this` as return type of chainable setter methods. * d3-ease: Removed excess space. * d3-force: Use `this` as return type of chainable setter methods. Fixed return type of Simulation.tick() to be void. Fixed Force.initialize(...) to be optional when defining a custom force. Enhanced Simulation.force(...) getter to use generic to to cast return type to specific force type, when details are know. Updated related tests. * d3-hsv: New definitions and tests added * d3-interpolate: Use ColorCommonInstance to allow more general color spaces than the color space objects defined in d3-color, e.g. d3-hsv. Added related tests. * d3-quadtree: Use `this` as return type of chainable setter methods. * d3-scale: Fixed missing support of coercible numeric value as input to ScaleSequential. Use `this` as return type of chainable setter methods. * d3-selection: Added type alias ValueFn which is used to harmonize callback functions. Use `this` as return type of chainable setter methods, where no new selection is returned. Removed outdated comments. * d3-selection-multi: Added new definitions with tests. * d3-shape: Use `this` as return type of chainable setter methods. Removed spurious `?` from callback signatures. * d3-time: Use `this` as return type of chainable setter methods. * d3-transition: Added type alias ValueFn which is used to harmonize callback functions. Use `this` as return type of chainable setter methods, where no new transition is returned. * d3-voronoi: Use `this` as return type of chainable setter methods. * d3-zoom: Use `this` as return type of chainable setter methods. Note that ZoomTransform.scale(...) and ZoomTransform.translate(...) return new ZoomTranform objects. Use ValueFn to harmonize callbacks. Updates the prime for the newly developed D3 version 4 definitions on a file-by-file basis. --- d3-array/d3-array-tests.ts | 208 +++++++-------- d3-array/index.d.ts | 21 +- d3-axis/d3-axis-tests.ts | 9 +- d3-axis/index.d.ts | 39 ++- d3-brush/index.d.ts | 30 +-- d3-chord/index.d.ts | 36 +-- d3-collection/index.d.ts | 10 +- d3-color/index.d.ts | 46 ++-- d3-dispatch/index.d.ts | 6 +- d3-drag/index.d.ts | 30 +-- d3-ease/index.d.ts | 76 +++--- d3-force/d3-force-tests.ts | 18 +- d3-force/index.d.ts | 84 +++--- d3-format/index.d.ts | 2 +- d3-hierarchy/index.d.ts | 2 +- d3-hsv/d3-hsv-tests.ts | 45 ++++ d3-hsv/index.d.ts | 26 ++ d3-hsv/tsconfig.json | 19 ++ d3-interpolate/d3-interpolate-tests.ts | 16 +- d3-interpolate/index.d.ts | 22 +- d3-path/index.d.ts | 2 +- d3-polygon/index.d.ts | 2 +- d3-quadtree/index.d.ts | 24 +- d3-queue/index.d.ts | 2 +- d3-random/index.d.ts | 2 +- d3-scale/index.d.ts | 118 ++++----- .../d3-selection-multi-tests.ts | 151 +++++++++++ d3-selection-multi/index.d.ts | 93 +++++++ d3-selection-multi/tsconfig.json | 19 ++ d3-selection/index.d.ts | 101 ++++---- d3-shape/index.d.ts | 242 +++++++++--------- d3-time-format/index.d.ts | 2 +- d3-time/index.d.ts | 4 +- d3-timer/index.d.ts | 2 +- d3-transition/index.d.ts | 58 ++--- d3-voronoi/index.d.ts | 10 +- d3-zoom/index.d.ts | 66 ++--- 37 files changed, 1005 insertions(+), 638 deletions(-) create mode 100644 d3-hsv/d3-hsv-tests.ts create mode 100644 d3-hsv/index.d.ts create mode 100644 d3-hsv/tsconfig.json create mode 100644 d3-selection-multi/d3-selection-multi-tests.ts create mode 100644 d3-selection-multi/index.d.ts create mode 100644 d3-selection-multi/tsconfig.json diff --git a/d3-array/d3-array-tests.ts b/d3-array/d3-array-tests.ts index 3ec1a8fcfd..7183320b71 100644 --- a/d3-array/d3-array-tests.ts +++ b/d3-array/d3-array-tests.ts @@ -6,7 +6,7 @@ * are not intended as functional tests. */ -import * as d3 from 'd3-array'; +import * as d3Array from 'd3-array'; import { scaleTime } from 'd3-scale'; import { timeYear } from 'd3-time'; @@ -47,8 +47,8 @@ let date: Date; let extentNum: [number, number]; let extentStr: [string, string]; let extentNumeric: [NumCoercible, NumCoercible]; -let extentDateMixed: [d3.Primitive, d3.Primitive]; -let extentMixed: [d3.Primitive | NumCoercible, d3.Primitive | NumCoercible]; +let extentDateMixed: [d3Array.Primitive, d3Array.Primitive]; +let extentMixed: [d3Array.Primitive | NumCoercible, d3Array.Primitive | NumCoercible]; let extentDate: [Date, Date]; let numbersArray = [10, 20, 30, 40, 50]; @@ -72,35 +72,35 @@ let mixedObjectArray = [ // without accessors -num = d3.max(numbersArray); -str = d3.max(stringyNumbersArray); -numeric = d3.max(numericArray); -date = d3.max(dateArray); +num = d3Array.max(numbersArray); +str = d3Array.max(stringyNumbersArray); +numeric = d3Array.max(numericArray); +date = d3Array.max(dateArray); // with accessors -num = d3.max(mixedObjectArray, function (datum, index, array) { +num = d3Array.max(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.num; }); -str = d3.max(mixedObjectArray, function (datum, index, array) { +str = d3Array.max(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.str; }); -numeric = d3.max(mixedObjectArray, function (datum, index, array) { +numeric = d3Array.max(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.numeric; }); -date = d3.max(mixedObjectArray, function (datum, index, array) { +date = d3Array.max(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -111,35 +111,35 @@ date = d3.max(mixedObjectArray, function (datum, index, array) { // without accessors -num = d3.min(numbersArray); -str = d3.min(stringyNumbersArray); -numeric = d3.min(numericArray); -date = d3.min(dateArray); +num = d3Array.min(numbersArray); +str = d3Array.min(stringyNumbersArray); +numeric = d3Array.min(numericArray); +date = d3Array.min(dateArray); // with accessors -num = d3.min(mixedObjectArray, function (datum, index, array) { +num = d3Array.min(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.num; }); -str = d3.min(mixedObjectArray, function (datum, index, array) { +str = d3Array.min(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.str; }); -numeric = d3.min(mixedObjectArray, function (datum, index, array) { +numeric = d3Array.min(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.numeric; }); -date = d3.min(mixedObjectArray, function (datum, index, array) { +date = d3Array.min(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -150,36 +150,36 @@ date = d3.min(mixedObjectArray, function (datum, index, array) { // without accessors -extentNum = d3.extent(numbersArray); -extentStr = d3.extent(stringyNumbersArray); -extentNumeric = d3.extent(numericArray); -extentDate = d3.extent(dateArray); -extentMixed = d3.extent([new NumCoercible(10), 13, '12', true]); +extentNum = d3Array.extent(numbersArray); +extentStr = d3Array.extent(stringyNumbersArray); +extentNumeric = d3Array.extent(numericArray); +extentDate = d3Array.extent(dateArray); +extentMixed = d3Array.extent([new NumCoercible(10), 13, '12', true]); // with accessors -extentNum = d3.extent(mixedObjectArray, function (datum, index, array) { +extentNum = d3Array.extent(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.num; }); -extentStr = d3.extent(mixedObjectArray, function (datum, index, array) { +extentStr = d3Array.extent(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.str; }); -extentMixed = d3.extent(mixedObjectArray, function (datum, index, array) { +extentMixed = d3Array.extent(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; return datum.numeric; }); -extentDateMixed = d3.extent(mixedObjectArray, function (datum, index, array) { +extentDateMixed = d3Array.extent(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -188,9 +188,9 @@ extentDateMixed = d3.extent(mixedObjectArray, function (datum, index, array) { // mean() ---------------------------------------------------------------------- -num = d3.mean(numbersArray); +num = d3Array.mean(numbersArray); -num = d3.mean(mixedObjectArray, function (datum, index, array) { +num = d3Array.mean(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -199,9 +199,9 @@ num = d3.mean(mixedObjectArray, function (datum, index, array) { // median() -------------------------------------------------------------------- -num = d3.median(numbersArray); +num = d3Array.median(numbersArray); -num = d3.median(mixedObjectArray, function (datum, index, array) { +num = d3Array.median(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -210,9 +210,9 @@ num = d3.median(mixedObjectArray, function (datum, index, array) { // quantile() ------------------------------------------------------------------ -num = d3.quantile(numbersArray, 0.5); +num = d3Array.quantile(numbersArray, 0.5); -num = d3.quantile(mixedObjectArray, 0.5, function (datum, index, array) { +num = d3Array.quantile(mixedObjectArray, 0.5, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -222,9 +222,9 @@ num = d3.quantile(mixedObjectArray, 0.5, function (datum, index, array) { // sum() ----------------------------------------------------------------------- -num = d3.sum(numbersArray); +num = d3Array.sum(numbersArray); -num = d3.sum(mixedObjectArray, function (datum, index, array) { +num = d3Array.sum(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -233,9 +233,9 @@ num = d3.sum(mixedObjectArray, function (datum, index, array) { // deviation() ----------------------------------------------------------------- -num = d3.deviation(numbersArray); +num = d3Array.deviation(numbersArray); -num = d3.deviation(mixedObjectArray, function (datum, index, array) { +num = d3Array.deviation(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -244,9 +244,9 @@ num = d3.deviation(mixedObjectArray, function (datum, index, array) { // variance() ------------------------------------------------------------------ -num = d3.variance(numbersArray); +num = d3Array.variance(numbersArray); -num = d3.variance(mixedObjectArray, function (datum, index, array) { +num = d3Array.variance(mixedObjectArray, function (datum, index, array) { let d: MixedObject = datum; let i: number = index; let arr: Array = array; @@ -259,65 +259,65 @@ num = d3.variance(mixedObjectArray, function (datum, index, array) { // scan() ---------------------------------------------------------------------- -num = d3.scan(mixedObjectArray, function (a, b) { +num = d3Array.scan(mixedObjectArray, function (a, b) { return a.num - b.num; // a and b are of type MixedObject }); // bisectLeft() ---------------------------------------------------------------- -num = d3.bisectLeft([0, 2, 3, 4, 7, 8], 4); -num = d3.bisectLeft([0, 2, 3, 4, 7, 8], 4, 1); -num = d3.bisectLeft([0, 2, 3, 4, 7, 8], 4, 1, 4); +num = d3Array.bisectLeft([0, 2, 3, 4, 7, 8], 4); +num = d3Array.bisectLeft([0, 2, 3, 4, 7, 8], 4, 1); +num = d3Array.bisectLeft([0, 2, 3, 4, 7, 8], 4, 1, 4); -num = d3.bisectLeft(['0', '2', '3', '4', '7', '8'], '21'); -num = d3.bisectLeft(['0', '2', '3', '4', '7', '8'], '21', 1); -num = d3.bisectLeft(['0', '2', '3', '4', '7', '8'], '21', 1, 4); +num = d3Array.bisectLeft(['0', '2', '3', '4', '7', '8'], '21'); +num = d3Array.bisectLeft(['0', '2', '3', '4', '7', '8'], '21', 1); +num = d3Array.bisectLeft(['0', '2', '3', '4', '7', '8'], '21', 1, 4); -num = d3.bisectLeft([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1)); -num = d3.bisectLeft([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1); -num = d3.bisectLeft([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1, 2); +num = d3Array.bisectLeft([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1)); +num = d3Array.bisectLeft([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1); +num = d3Array.bisectLeft([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1, 2); // bisectRight() --------------------------------------------------------------- -num = d3.bisectRight([0, 2, 3, 4, 7, 8], 4); -num = d3.bisectRight([0, 2, 3, 4, 7, 8], 4, 1); -num = d3.bisectRight([0, 2, 3, 4, 7, 8], 4, 1, 4); +num = d3Array.bisectRight([0, 2, 3, 4, 7, 8], 4); +num = d3Array.bisectRight([0, 2, 3, 4, 7, 8], 4, 1); +num = d3Array.bisectRight([0, 2, 3, 4, 7, 8], 4, 1, 4); -num = d3.bisectRight(['0', '2', '3', '4', '7', '8'], '21'); -num = d3.bisectRight(['0', '2', '3', '4', '7', '8'], '21', 1); -num = d3.bisectRight(['0', '2', '3', '4', '7', '8'], '21', 1, 4); +num = d3Array.bisectRight(['0', '2', '3', '4', '7', '8'], '21'); +num = d3Array.bisectRight(['0', '2', '3', '4', '7', '8'], '21', 1); +num = d3Array.bisectRight(['0', '2', '3', '4', '7', '8'], '21', 1, 4); -num = d3.bisectRight([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1)); -num = d3.bisectRight([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1); -num = d3.bisectRight([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1, 2); +num = d3Array.bisectRight([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1)); +num = d3Array.bisectRight([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1); +num = d3Array.bisectRight([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1, 2); // bisect() -------------------------------------------------------------------- -num = d3.bisect([0, 2, 3, 4, 7, 8], 4); -num = d3.bisect([0, 2, 3, 4, 7, 8], 4, 1); -num = d3.bisect([0, 2, 3, 4, 7, 8], 4, 1, 4); +num = d3Array.bisect([0, 2, 3, 4, 7, 8], 4); +num = d3Array.bisect([0, 2, 3, 4, 7, 8], 4, 1); +num = d3Array.bisect([0, 2, 3, 4, 7, 8], 4, 1, 4); -num = d3.bisect(['0', '2', '3', '4', '7', '8'], '21'); -num = d3.bisect(['0', '2', '3', '4', '7', '8'], '21', 1); -num = d3.bisect(['0', '2', '3', '4', '7', '8'], '21', 1, 4); +num = d3Array.bisect(['0', '2', '3', '4', '7', '8'], '21'); +num = d3Array.bisect(['0', '2', '3', '4', '7', '8'], '21', 1); +num = d3Array.bisect(['0', '2', '3', '4', '7', '8'], '21', 1, 4); -num = d3.bisect([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1)); -num = d3.bisect([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1); -num = d3.bisect([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1, 2); +num = d3Array.bisect([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1)); +num = d3Array.bisect([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1); +num = d3Array.bisect([new Date(2010, 1, 1), new Date(2011, 1, 1), new Date(2012, 1, 1), new Date(2013, 1, 1)], new Date(2011, 2, 1), 1, 2); // bisector() ------------------------------------------------------------------ mixedObjectArray.sort(function (a, b) { return a.date.valueOf() - b.date.valueOf(); }); -let mixedObjectDateBisectorObject: d3.Bisector; +let mixedObjectDateBisectorObject: d3Array.Bisector; // define using accessor -mixedObjectDateBisectorObject = d3.bisector(function (el) { +mixedObjectDateBisectorObject = d3Array.bisector(function (el) { return el.date; }); // define using comparator -mixedObjectDateBisectorObject = d3.bisector(function (el, x) { +mixedObjectDateBisectorObject = d3Array.bisector(function (el, x) { return el.date.valueOf() - x.valueOf(); }); @@ -334,15 +334,15 @@ num = mixedObjectDateBisectorObject.right(mixedObjectArray, new Date(2015, 3, 14 // ascending() ----------------------------------------------------------------- -num = d3.ascending(10, 20); -num = d3.ascending('10', '20'); -num = d3.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14)); +num = d3Array.ascending(10, 20); +num = d3Array.ascending('10', '20'); +num = d3Array.ascending(new Date(2016, 6, 13), new Date(2016, 6, 14)); // descending() ---------------------------------------------------------------- -num = d3.descending(10, 20); -num = d3.descending('10', '20'); -num = d3.descending(new Date(2016, 6, 13), new Date(2016, 6, 14)); +num = d3Array.descending(10, 20); +num = d3Array.descending('10', '20'); +num = d3Array.descending(new Date(2016, 6, 13), new Date(2016, 6, 14)); // ----------------------------------------------------------------------------- // Test Transforming Arrays @@ -367,20 +367,20 @@ let testArrays: MixedObject[][] = [ let mergedArray: MixedObject[]; -mergedArray = d3.merge(testArrays); // inferred type -mergedArray = d3.merge(testArrays); // explicit type +mergedArray = d3Array.merge(testArrays); // inferred type +mergedArray = d3Array.merge(testArrays); // explicit type // mergedArray = d3.merge([[10, 40, 30], [15, 30]]); // fails, type mismatch // pairs() --------------------------------------------------------------------- let pairs: Array<[MixedObject, MixedObject]>; -pairs = d3.pairs(mergedArray); +pairs = d3Array.pairs(mergedArray); // permute() ------------------------------------------------------------------- // getting a permutation of array elements -mergedArray = d3.permute(mergedArray, [1, 0, 2, 5, 3, 4, 6]); +mergedArray = d3Array.permute(mergedArray, [1, 0, 2, 5, 3, 4, 6]); // Getting an ordered array with object properties @@ -391,35 +391,35 @@ let testObject = { more: [10, 30, 40] }; -let x: Array = d3.permute(testObject, ['name', 'val', 'when', 'more']); +let x: Array = d3Array.permute(testObject, ['name', 'val', 'when', 'more']); // range() --------------------------------------------------------------------- -numbersArray = d3.range(10); -numbersArray = d3.range(1, 10); -numbersArray = d3.range(1, 10, 0.5); +numbersArray = d3Array.range(10); +numbersArray = d3Array.range(1, 10); +numbersArray = d3Array.range(1, 10, 0.5); // shuffle() ------------------------------------------------------------------- -mergedArray = d3.shuffle(mergedArray); +mergedArray = d3Array.shuffle(mergedArray); -mergedArray = d3.shuffle(mergedArray, 1); +mergedArray = d3Array.shuffle(mergedArray, 1); -mergedArray = d3.shuffle(mergedArray, 1, 3); +mergedArray = d3Array.shuffle(mergedArray, 1, 3); // ticks() --------------------------------------------------------------------- -numbersArray = d3.ticks(1, 10, 5); +numbersArray = d3Array.ticks(1, 10, 5); // tickStep() ------------------------------------------------------------------ -numbersArray = d3.tickStep(1, 10, 5); +numbersArray = d3Array.tickStep(1, 10, 5); // transpose() ----------------------------------------------------------------- -testArrays = d3.transpose([ +testArrays = d3Array.transpose([ [ new MixedObject(10, new Date(2016, 6, 1)), new MixedObject(50, new Date(2017, 4, 15)) @@ -432,7 +432,7 @@ testArrays = d3.transpose([ // zip() ----------------------------------------------------------------------- -testArrays = d3.zip( +testArrays = d3Array.zip( [ new MixedObject(10, new Date(2016, 6, 1)), new MixedObject(20, new Date(2016, 7, 30)), @@ -454,11 +454,11 @@ let tScale = scaleTime(); // Create histogram generator ================================================== -let defaultHistogram: d3.HistogramGenerator; -defaultHistogram = d3.histogram(); +let defaultHistogram: d3Array.HistogramGenerator; +defaultHistogram = d3Array.histogram(); -let testHistogram: d3.HistogramGenerator; -testHistogram = d3.histogram(); +let testHistogram: d3Array.HistogramGenerator; +testHistogram = d3Array.histogram(); // Configure histogram generator =============================================== @@ -501,7 +501,7 @@ domainAccessorFn = testHistogram.domain(); defaultHistogram = defaultHistogram.thresholds(3); // with threshold count generator -defaultHistogram = defaultHistogram.thresholds(d3.thresholdScott); +defaultHistogram = defaultHistogram.thresholds(d3Array.thresholdScott); // with thresholds value array @@ -518,10 +518,10 @@ testHistogram = testHistogram.thresholds(tScale.ticks(timeYear)); // Use histogram generator ===================================================== -let defaultBins: Array>; +let defaultBins: Array>; defaultBins = defaultHistogram([-1, 0, 1, 1, 3, 20, 234]); -let defaultBin: d3.Bin; +let defaultBin: d3Array.Bin; defaultBin = defaultBins[0]; num = defaultBin.length; // defaultBin is array @@ -529,10 +529,10 @@ num = defaultBin[0]; // with element type number num = defaultBin.x0; // bin lower bound is number num = defaultBin.x1; // bin upper bound is number -let testBins: Array>; +let testBins: Array>; testBins = testHistogram(mixedObjectArray); -let testBin: d3.Bin; +let testBin: d3Array.Bin; testBin = testBins[0]; num = testBin.length; // defaultBin is array @@ -544,8 +544,8 @@ date = testBin.x1; // bin upper bound is Date // Histogram Tresholds ========================================================= -num = d3.thresholdFreedmanDiaconis([-1, 0, 1, 1, 3, 20, 234], -1, 234); +num = d3Array.thresholdFreedmanDiaconis([-1, 0, 1, 1, 3, 20, 234], -1, 234); -num = d3.thresholdScott([-1, 0, 1, 1, 3, 20, 234], -1, 234); +num = d3Array.thresholdScott([-1, 0, 1, 1, 3, 20, 234], -1, 234); -num = d3.thresholdSturges([-1, 0, 1, 1, 3, 20, 234]); +num = d3Array.thresholdSturges([-1, 0, 1, 1, 3, 20, 234]); diff --git a/d3-array/index.d.ts b/d3-array/index.d.ts index 40563fa880..933f59e5a6 100644 --- a/d3-array/index.d.ts +++ b/d3-array/index.d.ts @@ -157,7 +157,7 @@ export function sum(array: T[], accessor: (datum: T, index: number, array: T[ export function deviation(array: number[]): number | undefined; /** - * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, + * Compute the standard deviation, defined as the square root of the bias-corrected variance, of the given array, * using the given accessor to convert values to numbers. */ export function deviation(array: T[], accessor: (datum: T, index: number, array: T[]) => number): number | undefined; @@ -255,7 +255,7 @@ export function range(start: number, stop: number, step?: number): number[]; export function shuffle(array: T[], lo?: number, hi?: number): T[]; /** - * Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive). + * Generate an array of approximately count + 1 uniformly-spaced, nicely-rounded values between start and stop (inclusive). */ export function ticks(start: number, stop: number, count: number): number[]; @@ -274,7 +274,7 @@ export function transpose(matrix: T[][]): T[][]; /** * Returns an array of arrays, where the ith array contains the ith element from each of the argument arrays. - * The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array + * The returned array is truncated in length to the shortest array in arrays. If arrays contains only a single array, the returned array * contains one-element arrays. With no arguments, the returned array is empty. */ export function zip(...arrays: T[][]): T[][]; @@ -311,7 +311,7 @@ export interface HistogramGenerator { /** * Divide the domain uniformly into approximately count bins. IMPORTANT: This threshold * setting approach only works, when the materialized values are numbers! - * + * * @param count The desired number of uniform bins. */ thresholds(count: number): this; @@ -319,10 +319,10 @@ export interface HistogramGenerator { * Set a threshold accessor function, which returns the desired number of bins. * Divides the domain uniformly into approximately count bins. IMPORTANT: This threshold * setting approach only works, when the materialized values are numbers! - * + * * @param count A function which accepts as arguments the array of materialized values, and * optionally the domain minimum and maximum. The function calcutates and returns the suggested - * number of bins. + * number of bins. */ thresholds(count: ThresholdCountGenerator): this; /** @@ -332,12 +332,12 @@ export interface HistogramGenerator { */ thresholds(thresholds: Value[]): this; /** - * Set a threshold accessor function, which returns the array of values to be used as + * Set a threshold accessor function, which returns the array of values to be used as * thresholds in determining the bins. - * + * * @param thresholds A function which accepts as arguments the array of materialized values, and - * optionally the domain minimum and maximum. The function calcutates and returns the array of values to be used as - * thresholds in determining the bins. + * optionally the domain minimum and maximum. The function calcutates and returns the array of values to be used as + * thresholds in determining the bins. */ thresholds(thresholds: ThresholdArrayGenerator): this; } @@ -354,4 +354,3 @@ export function thresholdFreedmanDiaconis(values: number[], min: number, max: nu export function thresholdScott(values: number[], min: number, max: number): number; // of type ThresholdCountGenerator export function thresholdSturges(values: number[]): number; // of type ThresholdCountGenerator - diff --git a/d3-axis/d3-axis-tests.ts b/d3-axis/d3-axis-tests.ts index 54fa6479c5..a95c58c8b3 100644 --- a/d3-axis/d3-axis-tests.ts +++ b/d3-axis/d3-axis-tests.ts @@ -13,6 +13,7 @@ import { scaleOrdinal, ScaleOrdinal, scalePow, + ScalePower, scaleTime, ScaleTime, } from 'd3-scale'; @@ -70,11 +71,17 @@ let leftAxis: d3Axis.Axis = d3Axis.axisLeft(scal // scale(...) ---------------------------------------------------------------- leftAxis = leftAxis.scale(scalePow()); +let powerScale: ScalePower = leftAxis.scale>(); +// powerScale = leftAxis.scale(); // fails, without casting as AxisScale is purposely generic + + +bottomAxis = bottomAxis.scale(scaleOrdinal()); // bottomAxis = bottomAxis.scale(scalePow()) // fails, domain of scale incompatible with domain of axis let axisScale: d3Axis.AxisScale = bottomAxis.scale(); -// let ordinalScale: ScaleOrdinal = bottomAxis.scale(); // fails, without casting as AxisScale is purposely generic +let ordinalScale: ScaleOrdinal = bottomAxis.scale>(); +// ordinalScale = bottomAxis.scale(); // fails, without casting as AxisScale is purposely generic // ticks(...) ---------------------------------------------------------------- diff --git a/d3-axis/index.d.ts b/d3-axis/index.d.ts index 33c3b2927f..233dd5f40d 100644 --- a/d3-axis/index.d.ts +++ b/d3-axis/index.d.ts @@ -1,11 +1,10 @@ // Type definitions for D3JS d3-axis module 1.0.0 // Project: https://github.com/d3/d3-axis/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { Selection, TransitionLike } from 'd3-selection'; - // -------------------------------------------------------------------------- // Shared Types and Interfaces // -------------------------------------------------------------------------- @@ -67,14 +66,14 @@ export interface Axis { /** * Gets the current scale underlying the axis. */ - scale(): AxisScale; + scale>(): A; /** * Sets the scale and returns the axis. * * @param scale The scale to be used for axis generation */ - scale(scale: AxisScale): Axis; + scale(scale: AxisScale): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. @@ -82,7 +81,7 @@ export interface Axis { * @param count Number of ticks that should be rendered * @param specifier An optional format specifier to customize how the tick values are formatted. */ - ticks(count: number, specifier?: string): Axis; + ticks(count: number, specifier?: string): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. @@ -92,12 +91,12 @@ export interface Axis { * in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). * @param specifier An optional format specifier to customize how the tick values are formatted. */ - ticks(interval: AxisTimeInterval, specifier?: string): Axis; + ticks(interval: AxisTimeInterval, specifier?: string): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. */ - ticks(arg0: any, ...args: any[]): Axis; + ticks(arg0: any, ...args: any[]): this; /** * Get an array containing the currently set arguments to be passed into scale.ticks and scale.tickFormat. @@ -109,7 +108,7 @@ export interface Axis { * * @param args An array containing a single element representing the count, i.e. number of ticks to be rendered. */ - tickArguments(args: [number]): Axis; + tickArguments(args: [number]): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. @@ -117,7 +116,7 @@ export interface Axis { * @param args An array containing two elements. The first element represents the count, i.e. number of ticks to be rendered. The second * element is a string representing the format specifier to customize how the tick values are formatted. */ - tickArguments(args: [number, string]): Axis; + tickArguments(args: [number, string]): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. @@ -126,7 +125,7 @@ export interface Axis { * @param args An array containing a single element representing a time interval used to generate date-based ticks. * This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). */ - tickArguments(args: [AxisTimeInterval]): Axis; + tickArguments(args: [AxisTimeInterval]): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. @@ -136,14 +135,14 @@ export interface Axis { * This is typically a TimeInterval/CountableTimeInterval as defined in d3-time. E.g. as obtained by passing in d3.timeMinute.every(15). * The second element is a string representing the format specifier to customize how the tick values are formatted. */ - tickArguments(args: [AxisTimeInterval, string]): Axis; + tickArguments(args: [AxisTimeInterval, string]): this; /** * Sets the arguments that will be passed to scale.ticks and scale.tickFormat when the axis is rendered, and returns the axis generator. * * @param args An array with arguments suitable for the scale to be used for tick generation */ - tickArguments(args: any[]): Axis; + tickArguments(args: any[]): this; /** * Returns the current tick values, which defaults to null. @@ -158,14 +157,14 @@ export interface Axis { * * @param values An array with values from the Domain of the scale underlying the axis. */ - tickValues(values: Domain[]): Axis; + tickValues(values: Domain[]): this; /** * Clears any previously-set explicit tick values and reverts back to the scale’s tick generator. * * @param values null */ - tickValues(values: null): Axis; + tickValues(values: null): this; /** @@ -179,7 +178,7 @@ export interface Axis { * @param format A function mapping a value from the axis Domain to a formatted string * for display purposes. */ - tickFormat(format: (domainValue: Domain) => string): Axis; + tickFormat(format: (domainValue: Domain) => string): this; /** * Reset the tick format function. A null format indicates that the scale’s @@ -189,7 +188,7 @@ export interface Axis { * * @param format null */ - tickFormat(format: null): Axis; + tickFormat(format: null): this; /** * Get the current inner tick size, which defaults to 6. @@ -200,7 +199,7 @@ export interface Axis { * * @param size Tick size in pixels (Default is 6). */ - tickSize(size: number): Axis; + tickSize(size: number): this; /** * Get the current inner tick size, which defaults to 6. @@ -216,7 +215,7 @@ export interface Axis { * * @param size Tick size in pixels (Default is 6). */ - tickSizeInner(size: number): Axis; + tickSizeInner(size: number): this; /** * Get the current outer tick size, which defaults to 6. @@ -240,7 +239,7 @@ export interface Axis { * * @param size Tick size in pixels (Default is 6). */ - tickSizeOuter(size: number): Axis; + tickSizeOuter(size: number): this; /** * Get the current padding, which defaults to 3. @@ -252,7 +251,7 @@ export interface Axis { * * @param padding Padding in pixels (Default is 3). */ - tickPadding(padding: number): Axis; + tickPadding(padding: number): this; } diff --git a/d3-brush/index.d.ts b/d3-brush/index.d.ts index a91946b5c9..bfca8da856 100644 --- a/d3-brush/index.d.ts +++ b/d3-brush/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for D3JS d3-brush module 1.0.1 // Project: https://github.com/d3/d3-brush/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ArrayLike, Selection, TransitionLike } from 'd3-selection'; +import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; /** * Type alias for a BrushSelection. For a two-dimensional brush, it must be defined as [[x0, y0], [x1, y1]], @@ -15,20 +15,20 @@ export type BrushSelection = [[number, number], [number, number]] | [number, num export interface BrushBehavior { (group: Selection, ...args: any[]): void; - move(group: Selection, selection: BrushSelection): BrushBehavior; - move(group: Selection, selection: (this: SVGGElement, d?: Datum, i?: number, group?: Array | ArrayLike) => BrushSelection): BrushBehavior; - move(group: TransitionLike, selection: BrushSelection): BrushBehavior; - move(group: TransitionLike, selection: (this: SVGGElement, d?: Datum, i?: number, group?: Array | ArrayLike) => BrushSelection): BrushBehavior; - extent(): (this: SVGGElement, d: Datum, i: number, group: Array | ArrayLike) => [[number, number], [number, number]]; - extent(extent: [[number, number], [number, number]]): BrushBehavior; - extent(extent: (this: SVGGElement, d: Datum, i: number, group: Array | ArrayLike) => [[number, number], [number, number]]): BrushBehavior; - filter(): (this: SVGGElement, datum: Datum, index: number, group: Array | ArrayLike) => boolean; - filter(filterFn: (this: SVGGElement, datum: Datum, index: number, group: Array | ArrayLike) => boolean): BrushBehavior; + move(group: Selection, selection: BrushSelection): void; + move(group: Selection, selection: ValueFn): void; + move(group: TransitionLike, selection: BrushSelection): void; + move(group: TransitionLike, selection: ValueFn): void; + extent(): ValueFn; + extent(extent: [[number, number], [number, number]]): this; + extent(extent: ValueFn): this; + filter(): ValueFn; + filter(filterFn: ValueFn): this; handleSize(): number; - handleSize(size: number): BrushBehavior; - on(typenames: string): (this: SVGGElement, datum: Datum, index: number, group: Array | ArrayLike) => void; - on(typenames: string, callback: null): BrushBehavior; - on(typenames: string, callback: (this: SVGGElement, datum: Datum, index: number, group: Array | ArrayLike) => void): BrushBehavior; + handleSize(size: number): this; + on(typenames: string): ValueFn; + on(typenames: string, callback: null): this; + on(typenames: string, callback: ValueFn): this; } diff --git a/d3-chord/index.d.ts b/d3-chord/index.d.ts index 3c232c15a6..f78cb62b78 100644 --- a/d3-chord/index.d.ts +++ b/d3-chord/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-chord module 1.0.0 // Project: https://github.com/d3/d3-chord/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // --------------------------------------------------------------------- @@ -34,16 +34,16 @@ export interface Chords extends Array { export interface ChordLayout { (matrix: number[][]): Chords; padAngle(): number; - padAngle(angle: number): ChordLayout; + padAngle(angle: number): this; sortGroups(): ((a: number, b: number) => number) | null; - sortGroups(compare: null): ChordLayout; - sortGroups(compare: (a: number, b: number) => number): ChordLayout; + sortGroups(compare: null): this; + sortGroups(compare: (a: number, b: number) => number): this; sortSubgroups(): ((a: number, b: number) => number) | null; - sortSubgroups(compare: null): ChordLayout; - sortSubgroups(compare: (a: number, b: number) => number): ChordLayout; + sortSubgroups(compare: null): this; + sortSubgroups(compare: (a: number, b: number) => number): this; sortChords(): ((a: number, b: number) => number) | null; - sortChords(compare: null): ChordLayout; - sortChords(compare: (a: number, b: number) => number): ChordLayout; + sortChords(compare: null): this; + sortChords(compare: (a: number, b: number) => number): this; } export function chord(): ChordLayout; @@ -56,21 +56,21 @@ export function chord(): ChordLayout; export interface RibbonGenerator { (this: This, d: ChordDatum, ...args: any[]): string | undefined; source(): (this: This, d: ChordDatum, ...args: any[]) => ChordSubgroupDatum; - source(source: (this: This, d: ChordDatum, ...args: any[]) => ChordSubgroupDatum): RibbonGenerator; + source(source: (this: This, d: ChordDatum, ...args: any[]) => ChordSubgroupDatum): this; target(): (this: This, d: ChordDatum, ...args: any[]) => ChordSubgroupDatum; - target(target: (this: This, d: ChordDatum, ...args: any[]) => ChordSubgroupDatum): RibbonGenerator; + target(target: (this: This, d: ChordDatum, ...args: any[]) => ChordSubgroupDatum): this; radius(): (this: This, d: ChordSubgroupDatum, ...args: any[]) => number; - radius(radius: number): RibbonGenerator; - radius(radius: (this: This, d: ChordSubgroupDatum, ...args: any[]) => number): RibbonGenerator; + radius(radius: number): this; + radius(radius: (this: This, d: ChordSubgroupDatum, ...args: any[]) => number): this; startAngle(): (this: This, d: ChordSubgroupDatum, ...args: any[]) => number; - startAngle(angle: number): RibbonGenerator; - startAngle(angle: (this: This, d: ChordSubgroupDatum, ...args: any[]) => number): RibbonGenerator; + startAngle(angle: number): this; + startAngle(angle: (this: This, d: ChordSubgroupDatum, ...args: any[]) => number): this; endAngle(): (this: This, d: ChordSubgroupDatum, ...args: any[]) => number; - endAngle(angle: number): RibbonGenerator; - endAngle(angle: (this: This, d: ChordSubgroupDatum, ...args: any[]) => number): RibbonGenerator; + endAngle(angle: number): this; + endAngle(angle: (this: This, d: ChordSubgroupDatum, ...args: any[]) => number): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): RibbonGenerator; - context(context: null): RibbonGenerator; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; } export function ribbon(): RibbonGenerator; diff --git a/d3-collection/index.d.ts b/d3-collection/index.d.ts index fea25224a4..889879681f 100644 --- a/d3-collection/index.d.ts +++ b/d3-collection/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-collection module 1.0.0 // Project: https://github.com/d3/d3-collection/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -104,10 +104,10 @@ export interface NestedObject { } interface Nest { - key(func: (datum: Datum) => string): Nest; - sortKeys(comparator: (a: string, b: string) => number): Nest; - sortValues(comparator: (a: Datum, b: Datum) => number): Nest; - rollup(func: (values: Datum[]) => RollupType): Nest; + key(func: (datum: Datum) => string): this; + sortKeys(comparator: (a: string, b: string) => number): this; + sortValues(comparator: (a: Datum, b: Datum) => number): this; + rollup(func: (values: Datum[]) => RollupType): this; map(array: Datum[]): Map; // more specifically it returns NestedMap object(array: Datum[]): { [key: string]: any }; // more specifically it returns NestedObject entries(array: Datum[]): Array<{ key: string; values: any; value: RollupType | undefined }>; // more specifically it returns NestedArray diff --git a/d3-color/index.d.ts b/d3-color/index.d.ts index e13aafbe6c..36124b3a03 100644 --- a/d3-color/index.d.ts +++ b/d3-color/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-color module 1.0.0 // Project: https://github.com/d3/d3-color/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // --------------------------------------------------------------------------- @@ -12,6 +12,17 @@ */ export type ColorSpaceObject = RGBColor | HSLColor | LabColor | HCLColor | CubehelixColor; +/** + * A helper interface of methods common to color objects (including colors defined outside the d3-color standard module, + * e.g. in d3-hsv). This interface + */ +export interface ColorCommonInstance { + displayable(): boolean; + toString(): string; + brighter(k?: number): this; + darker(k?: number): this; + rgb(): RGBColor; +} export interface Color { displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color @@ -20,7 +31,7 @@ export interface Color { export interface ColorFactory extends Function { (cssColorSpecifier: string): RGBColor | HSLColor; - (color: ColorSpaceObject): RGBColor | HSLColor; + (color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor; // prototype: Color; } @@ -29,8 +40,8 @@ export interface RGBColor extends Color { g: number; b: number; opacity: number; - brighter(k?: number): RGBColor; - darker(k?: number): RGBColor; + brighter(k?: number): this; + darker(k?: number): this; displayable(): boolean; rgb(): RGBColor; toString(): string; @@ -39,7 +50,7 @@ export interface RGBColor extends Color { export interface RGBColorFactory extends Function { (r: number, g: number, b: number, opacity?: number): RGBColor; (cssColorSpecifier: string): RGBColor; - (color: ColorSpaceObject): RGBColor; + (color: ColorSpaceObject | ColorCommonInstance): RGBColor; // prototype: RGBColor; } @@ -48,8 +59,8 @@ export interface HSLColor extends Color { s: number; l: number; opacity: number; - brighter(k?: number): HSLColor; - darker(k?: number): HSLColor; + brighter(k?: number): this; + darker(k?: number): this; displayable(): boolean; rgb(): RGBColor; } @@ -57,7 +68,7 @@ export interface HSLColor extends Color { export interface HSLColorFactory extends Function { (h: number, s: number, l: number, opacity?: number): HSLColor; (cssColorSpecifier: string): HSLColor; - (color: ColorSpaceObject): HSLColor; + (color: ColorSpaceObject | ColorCommonInstance): HSLColor; // prototype: HSLColor; } @@ -66,15 +77,15 @@ export interface LabColor extends Color { a: number; b: number; opacity: number; - brighter(k?: number): LabColor; - darker(k?: number): LabColor; + brighter(k?: number): this; + darker(k?: number): this; rgb(): RGBColor; } export interface LabColorFactory extends Function { (l: number, a: number, b: number, opacity?: number): LabColor; (cssColorSpecifier: string): LabColor; - (color: ColorSpaceObject): LabColor; + (color: ColorSpaceObject | ColorCommonInstance): LabColor; // prototype: LabColor; } @@ -83,15 +94,15 @@ export interface HCLColor extends Color { c: number; l: number; opacity: number; - brighter(k?: number): HCLColor; - darker(k?: number): HCLColor; + brighter(k?: number): this; + darker(k?: number): this; rgb(): RGBColor; } export interface HCLColorFactory extends Function { (h: number, l: number, c: number, opacity?: number): HCLColor; (cssColorSpecifier: string): HCLColor; - (color: ColorSpaceObject): HCLColor; + (color: ColorSpaceObject | ColorCommonInstance): HCLColor; // prototype: HCLColor; } @@ -100,15 +111,15 @@ export interface CubehelixColor extends Color { s: number; l: number; opacity: number; - brighter(k?: number): CubehelixColor; - darker(k?: number): CubehelixColor; + brighter(k?: number): this; + darker(k?: number): this; rgb(): RGBColor; } export interface CubehelixColorFactory extends Function { (h: number, s: number, l: number, opacity?: number): CubehelixColor; (cssColorSpecifier: string): CubehelixColor; - (color: ColorSpaceObject): CubehelixColor; + (color: ColorSpaceObject | ColorCommonInstance): CubehelixColor; // prototype: CubehelixColor; } @@ -127,4 +138,3 @@ export var lab: LabColorFactory; export var hcl: HCLColorFactory; export var cubehelix: CubehelixColorFactory; - diff --git a/d3-dispatch/index.d.ts b/d3-dispatch/index.d.ts index 41f03e75db..00f63de565 100644 --- a/d3-dispatch/index.d.ts +++ b/d3-dispatch/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-dispatch module 1.0.0 // Project: https://github.com/d3/d3-dispatch/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Dispatch { @@ -9,8 +9,8 @@ export interface Dispatch { copy(): Dispatch; on(typenames: string): (this: T, ...args: any[]) => void; - on(typenames: string, callback: null): Dispatch; - on(typenames: string, callback: (this: T, ...args: any[]) => void): Dispatch; + on(typenames: string, callback: null): this; + on(typenames: string, callback: (this: T, ...args: any[]) => void): this; } export function dispatch(...types: string[]): Dispatch; diff --git a/d3-drag/index.d.ts b/d3-drag/index.d.ts index e6bfc4086b..698dcad238 100644 --- a/d3-drag/index.d.ts +++ b/d3-drag/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for D3JS d3-drag module 1.0.0 // Project: https://github.com/d3/d3-drag/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ArrayLike, Selection } from 'd3-selection'; +import { ArrayLike, Selection, ValueFn } from 'd3-selection'; // -------------------------------------------------------------------------- @@ -35,16 +35,16 @@ export interface SubjectPosition { export interface DragBehavior extends Function { (selection: Selection, ...args: any[]): void; - container(): (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => DragContainerElement; - container(accessor: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => DragContainerElement): DragBehavior; - container(container: DragContainerElement): DragBehavior; - filter(): (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => boolean; - filter(filterFn: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => boolean): DragBehavior; - subject(): (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => Subject; - subject(accessor: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => Subject): DragBehavior; - on(typenames: string): (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => any; - on(typenames: string, callback: null): DragBehavior; - on(typenames: string, callback: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => any): DragBehavior; + container(): ValueFn; + container(accessor: ValueFn): this; + container(container: DragContainerElement): this; + filter(): ValueFn; + filter(filterFn: ValueFn): this; + subject(): ValueFn; + subject(accessor: ValueFn): this; + on(typenames: string): ValueFn; + on(typenames: string, callback: null): this; + on(typenames: string, callback: ValueFn): this; } export function drag(): DragBehavior; @@ -62,9 +62,9 @@ export interface D3DragEvent | ArrayLike) => void; - on(typenames: string, callback: null): D3DragEvent; - on(typenames: string, callback: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => void): D3DragEvent; + on(typenames: string): ValueFn; + on(typenames: string, callback: null): this; + on(typenames: string, callback: ValueFn): this; } export function dragDisable(window: Window): void; diff --git a/d3-ease/index.d.ts b/d3-ease/index.d.ts index 9f1ba66de6..b971cc9c14 100644 --- a/d3-ease/index.d.ts +++ b/d3-ease/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-ease module 1.0.0 // Project: https://github.com/d3/d3-ease/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -------------------------------------------------------------------------- @@ -8,49 +8,49 @@ // -------------------------------------------------------------------------- -export function easeLinear(normalizedTime: number): number; +export function easeLinear(normalizedTime: number): number; -export function easeQuad(normalizedTime: number): number; -export function easeQuadIn(normalizedTime: number): number; -export function easeQuadOut(normalizedTime: number): number; -export function easeQuadInOut(normalizedTime: number): number; +export function easeQuad(normalizedTime: number): number; +export function easeQuadIn(normalizedTime: number): number; +export function easeQuadOut(normalizedTime: number): number; +export function easeQuadInOut(normalizedTime: number): number; -export function easeCubic(normalizedTime: number): number; -export function easeCubicIn(normalizedTime: number): number; -export function easeCubicOut(normalizedTime: number): number; -export function easeCubicInOut(normalizedTime: number): number; +export function easeCubic(normalizedTime: number): number; +export function easeCubicIn(normalizedTime: number): number; +export function easeCubicOut(normalizedTime: number): number; +export function easeCubicInOut(normalizedTime: number): number; -export function easePoly(normalizedTime: number): number; -export function easePolyIn(normalizedTime: number): number; -export function easePolyOut(normalizedTime: number): number; -export function easePolyInOut(normalizedTime: number): number; +export function easePoly(normalizedTime: number): number; +export function easePolyIn(normalizedTime: number): number; +export function easePolyOut(normalizedTime: number): number; +export function easePolyInOut(normalizedTime: number): number; -export function easeSin(normalizedTime: number): number; -export function easeSinIn(normalizedTime: number): number; -export function easeSinOut(normalizedTime: number): number; -export function easeSinInOut(normalizedTime: number): number; +export function easeSin(normalizedTime: number): number; +export function easeSinIn(normalizedTime: number): number; +export function easeSinOut(normalizedTime: number): number; +export function easeSinInOut(normalizedTime: number): number; -export function easeExp(normalizedTime: number): number; -export function easeExpIn(normalizedTime: number): number; -export function easeExpOut(normalizedTime: number): number; -export function easeExpInOut(normalizedTime: number): number; +export function easeExp(normalizedTime: number): number; +export function easeExpIn(normalizedTime: number): number; +export function easeExpOut(normalizedTime: number): number; +export function easeExpInOut(normalizedTime: number): number; -export function easeCircle(normalizedTime: number): number; -export function easeCircleIn(normalizedTime: number): number; -export function easeCircleOut(normalizedTime: number): number; -export function easeCircleInOut(normalizedTime: number): number; +export function easeCircle(normalizedTime: number): number; +export function easeCircleIn(normalizedTime: number): number; +export function easeCircleOut(normalizedTime: number): number; +export function easeCircleInOut(normalizedTime: number): number; -export function easeBounce(normalizedTime: number): number; -export function easeBounceIn(normalizedTime: number): number; -export function easeBounceOut(normalizedTime: number): number; -export function easeBounceInOut(normalizedTime: number): number; +export function easeBounce(normalizedTime: number): number; +export function easeBounceIn(normalizedTime: number): number; +export function easeBounceOut(normalizedTime: number): number; +export function easeBounceInOut(normalizedTime: number): number; -export function easeBack(normalizedTime: number): number; -export function easeBackIn(normalizedTime: number): number; -export function easeBackOut(normalizedTime: number): number; -export function easeBackInOut(normalizedTime: number): number; +export function easeBack(normalizedTime: number): number; +export function easeBackIn(normalizedTime: number): number; +export function easeBackOut(normalizedTime: number): number; +export function easeBackInOut(normalizedTime: number): number; -export function easeElastic(normalizedTime: number): number; -export function easeElasticIn(normalizedTime: number): number; -export function easeElasticOut(normalizedTime: number): number; -export function easeElasticInOut(normalizedTime: number): number; +export function easeElastic(normalizedTime: number): number; +export function easeElasticIn(normalizedTime: number): number; +export function easeElasticOut(normalizedTime: number): number; +export function easeElasticInOut(normalizedTime: number): number; diff --git a/d3-force/d3-force-tests.ts b/d3-force/d3-force-tests.ts index f7e7ae8a05..eb06dae3fc 100644 --- a/d3-force/d3-force-tests.ts +++ b/d3-force/d3-force-tests.ts @@ -452,22 +452,26 @@ nodeLinkSimulation let f: d3Force.Force; +// getter with generic force returned + f = nodeLinkSimulation.force('charge'); f = nodeLinkSimulation.force('link'); + +// getter with force type cast to improve return type specificity + let fLink: d3Force.ForceLink; -// fLink = nodeLinkSimulation.force('link'); // fails, as ForceLink specific properties are missing from 'generic' force - // Need explicit, careful type casting to a specific force type -fLink = >nodeLinkSimulation.force('link'); +fLink = nodeLinkSimulation.force>('link'); // This is mainly an issue for ForceLinks, if once wants to get the links from an initialized force // or re-set new links for an initialized force, e.g.: -simLinks = (>nodeLinkSimulation.force('link')).links(); +simLinks = nodeLinkSimulation.force>('link').links(); + +// fLink = nodeLinkSimulation.force('link'); // fails, as ForceLink specific properties are missing from 'generic' force -// The same could be followed for custom forces. // on() -------------------------------------------------------------------------------- @@ -511,11 +515,11 @@ nodeSimulation = nodeSimulation.on('tick', null); // restart() -------------------------------------------------------------------------- -nodeLinkSimulation.restart(); +nodeLinkSimulation = nodeLinkSimulation.restart(); // stop() ----------------------------------------------------------------------------- -nodeLinkSimulation.stop(); +nodeLinkSimulation = nodeLinkSimulation.stop(); // tick() ----------------------------------------------------------------------------- diff --git a/d3-force/index.d.ts b/d3-force/index.d.ts index 9d0f0d747f..2e296368be 100644 --- a/d3-force/index.d.ts +++ b/d3-force/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-force module 1.0.0 // Project: https://github.com/d3/d3-force/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -31,28 +31,28 @@ export interface SimulationLinkDatum { } export interface Simulation> { - restart(): Simulation; - stop(): Simulation; - tick(): Simulation; + restart(): this; + stop(): this; + tick(): void; nodes(): Array; - nodes(nodesData: Array): Simulation; + nodes(nodesData: Array): this; alpha(): number; - alpha(alpha: number): Simulation; + alpha(alpha: number): this; alphaMin(): number; - alphaMin(min: number): Simulation; + alphaMin(min: number): this; alphaDecay(): number; - alphaDecay(decay: number): Simulation; + alphaDecay(decay: number): this; alphaTarget(): number; - alphaTarget(target: number): Simulation; + alphaTarget(target: number): this; velocityDecay(): number; - velocityDecay(decay: number): Simulation; - force(name: string): Force; // force names are arbitrary, so return type inference is not possible - force(name: string, force: null): Simulation; - force(name: string, force: Force): Simulation; + velocityDecay(decay: number): this; + force>(name: string): F; // force names are arbitrary, so return type inference is not possible + force(name: string, force: null): this; + force(name: string, force: Force): this; find(x: number, y: number, radius?: number): NodeDatum | undefined; on(typenames: 'tick' | 'end' | string): (this: Simulation) => void; - on(typenames: 'tick' | 'end' | string, listener: null): Simulation; - on(typenames: 'tick' | 'end' | string, listener: (this: this) => void): Simulation; + on(typenames: 'tick' | 'end' | string, listener: null): this; + on(typenames: 'tick' | 'end' | string, listener: (this: this) => void): this; } export function forceSimulation(nodesData?: Array): Simulation; @@ -65,7 +65,7 @@ export function forceSimulation> { (alpha: number): void; - initialize(nodes: Array): void; + initialize?(nodes: Array): void; } @@ -73,9 +73,9 @@ export interface Force extends Force { x(): number; - x(x: number): ForceCenter; + x(x: number): this; y(): number; - y(y: number): ForceCenter; + y(y: number): this; } export function forceCenter(x?: number, y?: number): ForceCenter; @@ -84,12 +84,12 @@ export function forceCenter(x?: number, y export interface ForceCollide extends Force { radius(): (node: NodeDatum, i: number, nodes: Array) => number; - radius(radius: number): ForceCollide; - radius(radius: (node: NodeDatum, i: number, nodes: Array) => number): ForceCollide; + radius(radius: number): this; + radius(radius: (node: NodeDatum, i: number, nodes: Array) => number): this; strength(): number; - strength(strength: number): ForceCollide; + strength(strength: number): this; iterations(): number; - iterations(iterations: number): ForceCollide; + iterations(iterations: number): this; } export function forceCollide(): ForceCollide; @@ -100,17 +100,17 @@ export function forceCollide(radius: (nod export interface ForceLink> extends Force { links(): Array; - links(links: Array): ForceLink; + links(links: Array): this; id(): (node: NodeDatum, i: number, nodesData: Array) => (string | number); - id(id: (node: NodeDatum, i: number, nodesData: Array) => string): ForceLink; + id(id: (node: NodeDatum, i: number, nodesData: Array) => string): this; distance(): (link: LinkDatum, i: number, links: Array) => number; - distance(distance: number): ForceLink; - distance(distance: (link: LinkDatum, i: number, links: Array) => number): ForceLink; + distance(distance: number): this; + distance(distance: (link: LinkDatum, i: number, links: Array) => number): this; strength(): (link: LinkDatum, i: number, links: Array) => number; - strength(strength: number): ForceLink; - strength(strength: (link: LinkDatum, i: number, links: Array) => number): ForceLink; + strength(strength: number): this; + strength(strength: (link: LinkDatum, i: number, links: Array) => number): this; iterations(): number; - iterations(iterations: number): ForceLink; + iterations(iterations: number): this; } export function forceLink>(): ForceLink; @@ -120,14 +120,14 @@ export function forceLink extends Force { strength(): (d: NodeDatum, i: number, data: Array) => number; - strength(strength: number): ForceManyBody; - strength(strength: (d: NodeDatum, i: number, data: Array) => number): ForceManyBody; + strength(strength: number): this; + strength(strength: (d: NodeDatum, i: number, data: Array) => number): this; theta(): number; - theta(theta: number): ForceManyBody; + theta(theta: number): this; distanceMin(): number; - distanceMin(distance: number): ForceManyBody; + distanceMin(distance: number): this; distanceMax(): number; - distanceMax(distance: number): ForceManyBody; + distanceMax(distance: number): this; } export function forceManyBody(): ForceManyBody; @@ -136,11 +136,11 @@ export function forceManyBody(): ForceMan export interface ForceX extends Force { strength(): (d: NodeDatum, i: number, data: Array) => number; - strength(strength: number): ForceX; - strength(strength: (d: NodeDatum, i: number, data: Array) => number): ForceX; + strength(strength: number): this; + strength(strength: (d: NodeDatum, i: number, data: Array) => number): this; x(): (d: NodeDatum, i: number, data: Array) => number; - x(x: number): ForceX; - x(x: (d: NodeDatum, i: number, data: Array) => number): ForceX; + x(x: number): this; + x(x: (d: NodeDatum, i: number, data: Array) => number): this; } export function forceX(): ForceX; @@ -149,11 +149,11 @@ export function forceX(x: (d: NodeDatum, export interface ForceY extends Force { strength(): (d: NodeDatum, i: number, data: Array) => number; - strength(strength: number): ForceY; - strength(strength: (d: NodeDatum, i: number, data: Array) => number): ForceY; + strength(strength: number): this; + strength(strength: (d: NodeDatum, i: number, data: Array) => number): this; y(): (d: NodeDatum, i: number, data: Array) => number; - y(y: number): ForceY; - y(y: (d: NodeDatum, i: number, data: Array) => number): ForceY; + y(y: number): this; + y(y: (d: NodeDatum, i: number, data: Array) => number): this; } export function forceY(): ForceY; diff --git a/d3-format/index.d.ts b/d3-format/index.d.ts index 0f7275bdc9..31c63f7fdf 100644 --- a/d3-format/index.d.ts +++ b/d3-format/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-format module 1.0.0 // Project: https://github.com/d3/d3-format/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/d3-hierarchy/index.d.ts b/d3-hierarchy/index.d.ts index dbd62ddb5b..2009406c82 100644 --- a/d3-hierarchy/index.d.ts +++ b/d3-hierarchy/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-hierarchy module 1.0.0 // Project: https://github.com/d3/d3-hierarchy/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // ----------------------------------------------------------------------- diff --git a/d3-hsv/d3-hsv-tests.ts b/d3-hsv/d3-hsv-tests.ts new file mode 100644 index 0000000000..fff2e55935 --- /dev/null +++ b/d3-hsv/d3-hsv-tests.ts @@ -0,0 +1,45 @@ +/** + * Typescript definition tests for d3/d3-hsv module + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +import {hsv, HSVColor} from 'd3-hsv'; +import {rgb, RGBColor} from 'd3-color'; + +let c: RGBColor, + cHSV: HSVColor, + displayable: boolean, + cString: string; + +// hsv signature +cHSV = hsv(120, 0.4, 0.5); +cHSV = hsv(120, 0.4, 0.5, 0.5); + +// specifier signature +cHSV = hsv('rgb(255, 255, 255)'); +cHSV = hsv('rgb(10%, 20%, 30%)'); +cHSV = hsv('rgba(255, 255, 255, 0.4)'); +cHSV = hsv('rgba(10%, 20%, 30%, 0.4)'); +cHSV = hsv('hsl(120, 50%, 20%)'); +cHSV = hsv('hsla(120, 50%, 20%, 0.4)'); +cHSV = hsv('#ffeeaa'); +cHSV = hsv('#fea'); +cHSV = hsv('steelblue'); + +// color signature +c = rgb('steelblue'); +cHSV = hsv(c); +cHSV = hsv(cHSV); + +// method signatures +cHSV = cHSV.brighter(); +cHSV = cHSV.brighter(0.2); +cHSV = cHSV.darker(); +cHSV = cHSV.darker(0.2); +displayable = cHSV.displayable(); +cString = cHSV.toString(); +console.log('Channels = (h : %d, s: %d, v: %d)', cHSV.h, cHSV.s, cHSV.v); +console.log('Opacity = %d', cHSV.opacity); diff --git a/d3-hsv/index.d.ts b/d3-hsv/index.d.ts new file mode 100644 index 0000000000..bc1b775498 --- /dev/null +++ b/d3-hsv/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for D3JS d3-hsv module 0.0.3 +// Project: https://github.com/d3/d3-hsv/ +// Definitions by: Yuri Feldman +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import {Color, RGBColor, ColorSpaceObject, ColorCommonInstance} from 'd3-color'; + +type ColorSpaceObjectWithHSV = ColorSpaceObject | HSVColor; + +export interface HSVColorFactory extends Function { + (h: number, s: number, v: number, opacity?: number): HSVColor; + (cssColorSpecifier: string): HSVColor; + (color: HSVColor | ColorSpaceObject | ColorCommonInstance): HSVColor; +} + +export interface HSVColor extends Color { + h: number; + s: number; + v: number; + opacity: number; + brighter(k?: number): this; + darker(k?: number): this; + rgb(): RGBColor; +} + +export var hsv: HSVColorFactory; diff --git a/d3-hsv/tsconfig.json b/d3-hsv/tsconfig.json new file mode 100644 index 0000000000..f6493750fd --- /dev/null +++ b/d3-hsv/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "d3-hsv-tests.ts" + ] +} diff --git a/d3-interpolate/d3-interpolate-tests.ts b/d3-interpolate/d3-interpolate-tests.ts index 64600ec1f6..2ada5864cd 100644 --- a/d3-interpolate/d3-interpolate-tests.ts +++ b/d3-interpolate/d3-interpolate-tests.ts @@ -6,8 +6,9 @@ * are not intended as functional tests. */ -import * as d3Interpolate from 'd3-interpolate'; import * as d3Color from 'd3-color'; +import * as d3Interpolate from 'd3-interpolate'; +import * as d3Hsv from 'd3-hsv'; // Preparatory steps ------------------------------------------------------------------- @@ -56,6 +57,7 @@ let num: number, arrStr: string[], objKeyVal: { [key: string]: any }, objRGBColor: d3Color.RGBColor, + objHSVColor: d3Hsv.HSVColor, zoom: [number, number, number]; // test interpolate(a, b) signature ---------------------------------------------------- @@ -65,6 +67,7 @@ iNum = d3Interpolate.interpolate('1', 5); // color interpolator returning a color string iString = d3Interpolate.interpolate('seagreen', d3Color.rgb(100, 100, 100)); +iString = d3Interpolate.interpolate('seagreen', d3Hsv.hsv(60, 1, 0.2, 0.4)); iString = d3Interpolate.interpolate('seagreen', 'steelblue'); // as used with valid color name string // date interpolator @@ -168,6 +171,7 @@ arrStr = d3Interpolate.quantize(d3Interpolate.interpolateString('-1', '2 // without gamma correction iString = d3Interpolate.interpolateRgb('seagreen', 'steelblue'); iString = d3Interpolate.interpolateRgb(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateRgb(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); str = iString(0.5); // with gamma correction @@ -176,34 +180,41 @@ iString = d3Interpolate.interpolateRgb.gamma(2.2)('purple', 'orange'); // test interpolateRgbBasis(color) and interpolateRgbBasisClosed(color) signatures ------------------------- iString = d3Interpolate.interpolateRgbBasis(['seagreen', d3Color.rgb('steelblue'), 'rgb(100, 100, 100)']); -iString = d3Interpolate.interpolateRgbBasisClosed(['seagreen', d3Color.rgb('steelblue'), 'rgb(100, 100, 100)']); +iString = d3Interpolate.interpolateRgbBasis(['seagreen', d3Hsv.hsv('steelblue'), 'rgb(100, 100, 100)']); +iString = d3Interpolate.interpolateRgbBasisClosed(['seagreen', d3Hsv.hsv('steelblue'), 'rgb(100, 100, 100)']); // test interpolateHsl(a, b) and interpolateHslLong(a, b)---------------------------------------------------------------- iString = d3Interpolate.interpolateHsl('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHsl(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateHsl(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); iString = d3Interpolate.interpolateHslLong('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHslLong(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateHslLong(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); // test interpolateLab(a, b) -------------------------------------------------------------------------------------------- iString = d3Interpolate.interpolateLab('seagreen', 'steelblue'); iString = d3Interpolate.interpolateLab(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateLab(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); // test interpolateHcl(a, b) and interpolateHclLong(a, b) ---------------------------------------------------------------- iString = d3Interpolate.interpolateHcl('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHcl(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateHcl(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); iString = d3Interpolate.interpolateHclLong('seagreen', 'steelblue'); iString = d3Interpolate.interpolateHclLong(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateHclLong(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); // test interpolateCubehelix(a, b) and interpolateCubehelixLong(a, b) --------------------------------------------------- // without gamma correction iString = d3Interpolate.interpolateCubehelix('seagreen', 'steelblue'); iString = d3Interpolate.interpolateCubehelix(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateCubehelix(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); str = iString(0.5); // with gamma correction @@ -212,6 +223,7 @@ iString = d3Interpolate.interpolateCubehelix.gamma(2.2)('purple', 'orange'); // without gamma correction iString = d3Interpolate.interpolateCubehelixLong('seagreen', 'steelblue'); iString = d3Interpolate.interpolateCubehelixLong(d3Color.rgb('seagreen'), d3Color.hcl('steelblue')); +iString = d3Interpolate.interpolateCubehelixLong(d3Color.rgb('seagreen'), d3Hsv.hsv('steelblue')); str = iString(0.5); // with gamma correction diff --git a/d3-interpolate/index.d.ts b/d3-interpolate/index.d.ts index 7b711486c5..0b065fe104 100644 --- a/d3-interpolate/index.d.ts +++ b/d3-interpolate/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for D3JS d3-interpolate module 1.1.0 // Project: https://github.com/d3/d3-interpolate/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ColorSpaceObject } from '../d3-color'; +import { ColorCommonInstance } from 'd3-color'; // -------------------------------------------------------------------------- @@ -20,7 +20,7 @@ export interface ZoomInterpolator extends Function { } export interface ColorGammaInterpolationFactory extends Function { - (a: string | ColorSpaceObject, b: string | ColorSpaceObject): ((t: number) => string); + (a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); gamma(g: number): ColorGammaInterpolationFactory; } @@ -39,7 +39,7 @@ export type ZoomView = [number, number, number]; export function interpolate(a: any, b: null): ((t: number) => null); export function interpolate(a: number | { valueOf(): number }, b: number): ((t: number) => number); -export function interpolate(a: any, b: ColorSpaceObject): ((t: number) => string); +export function interpolate(a: any, b: ColorCommonInstance): ((t: number) => string); export function interpolate(a: Date, b: Date): ((t: number) => Date); export function interpolate(a: string | { toString(): string }, b: string): ((t: number) => string); export function interpolate>(a: Array, b: U): ((t: number) => U); @@ -78,14 +78,14 @@ export function quantize(interpolator: ((t: number) => T), n: number): Array< export var interpolateRgb: ColorGammaInterpolationFactory; -export function interpolateRgbBasis(colors: Array): ((t: number) => string); -export function interpolateRgbBasisClosed(colors: Array): ((t: number) => string); +export function interpolateRgbBasis(colors: Array): ((t: number) => string); +export function interpolateRgbBasisClosed(colors: Array): ((t: number) => string); -export function interpolateHsl(a: string | ColorSpaceObject, b: string | ColorSpaceObject): ((t: number) => string); -export function interpolateHslLong(a: string | ColorSpaceObject, b: string | ColorSpaceObject): ((t: number) => string); -export function interpolateLab(a: string | ColorSpaceObject, b: string | ColorSpaceObject): ((t: number) => string); -export function interpolateHcl(a: string | ColorSpaceObject, b: string | ColorSpaceObject): ((t: number) => string); -export function interpolateHclLong(a: string | ColorSpaceObject, b: string | ColorSpaceObject): ((t: number) => string); +export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); +export function interpolateHslLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); +export function interpolateLab(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); +export function interpolateHcl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); +export function interpolateHclLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); export var interpolateCubehelix: ColorGammaInterpolationFactory; export var interpolateCubehelixLong: ColorGammaInterpolationFactory; diff --git a/d3-path/index.d.ts b/d3-path/index.d.ts index 0ff751fcae..6949affa95 100644 --- a/d3-path/index.d.ts +++ b/d3-path/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-path module 1.0.0 // Project: https://github.com/d3/d3-path/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Path { diff --git a/d3-polygon/index.d.ts b/d3-polygon/index.d.ts index e0e9e4ad7a..ae7e8dfd45 100644 --- a/d3-polygon/index.d.ts +++ b/d3-polygon/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-polygon module 1.0.0 // Project: https://github.com/d3/d3-polygon/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/d3-quadtree/index.d.ts b/d3-quadtree/index.d.ts index 94b38e9486..db21e4c920 100644 --- a/d3-quadtree/index.d.ts +++ b/d3-quadtree/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-quadtree module 1.0.0 // Project: https://github.com/d3/d3-quadtree/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** @@ -20,27 +20,27 @@ export interface QuadtreeLeaf { * * A child quadrant may be undefined if it is empty. */ -export interface QuadtreeInternalNode extends Array | QuadtreeLeaf | undefined> {} +export interface QuadtreeInternalNode extends Array | QuadtreeLeaf | undefined> { } export interface Quadtree { x(): (d: T) => number; - x(x: (d: T) => number): Quadtree; + x(x: (d: T) => number): this; y(): (d: T) => number; - y(y: (d: T) => number): Quadtree; + y(y: (d: T) => number): this; extent(): [[number, number], [number, number]] | undefined; - extent(extend: [[number, number], [number, number]]): Quadtree; - cover(x: number, y: number): Quadtree; - add(datum: T): Quadtree; - addAll(data: Array): Quadtree; - remove(datum: T): Quadtree; - removeAll(data: Array): Quadtree; + extent(extend: [[number, number], [number, number]]): this; + cover(x: number, y: number): this; + add(datum: T): this; + addAll(data: Array): this; + remove(datum: T): this; + removeAll(data: Array): this; copy(): Quadtree; root(): QuadtreeInternalNode | QuadtreeLeaf; data(): Array; size(): number; find(x: number, y: number, radius?: number): T | undefined; - visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => (void | boolean)): Quadtree; - visitAfter(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => void): Quadtree; + visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => (void | boolean)): this; + visitAfter(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => void): this; } diff --git a/d3-queue/index.d.ts b/d3-queue/index.d.ts index d57572a423..75f7324d04 100644 --- a/d3-queue/index.d.ts +++ b/d3-queue/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-queue module 3.0.1 // Project: https://github.com/d3/d3-queue/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/d3-random/index.d.ts b/d3-random/index.d.ts index 436db7193a..807d217bdb 100644 --- a/d3-random/index.d.ts +++ b/d3-random/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-random module 1.0.0 // Project: https://github.com/d3/d3-random/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/d3-scale/index.d.ts b/d3-scale/index.d.ts index fa77f42c0d..26db326b00 100644 --- a/d3-scale/index.d.ts +++ b/d3-scale/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-scale module 1.0.1 // Project: https://github.com/d3/d3-scale/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import { CountableTimeInterval, TimeInterval } from 'd3-time'; @@ -28,22 +28,22 @@ export interface ScaleLinear { */ invert(value: number | { valueOf(): number }): number; domain(): Array; - domain(domain: Array): ScaleLinear; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleLinear; + range(range: Array): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): ScaleLinear; + rangeRound(range: Array): this; clamp(): boolean; clamp(clamp: boolean): ScaleLinear; interpolate(): InterpolatorFactory; - interpolate(interpolate: InterpolatorFactory): ScaleLinear; + interpolate(interpolate: InterpolatorFactory): this; interpolate(interpolate: InterpolatorFactory): ScaleLinear; ticks(count?: number): Array; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - nice(count?: number): ScaleLinear; + nice(count?: number): this; copy(): ScaleLinear; } @@ -64,26 +64,26 @@ export interface ScalePower { */ invert(value: number | { valueOf(): number }): number; domain(): Array; - domain(domain: Array): ScalePower; + domain(domain: Array): this; range(): Array; - range(range: Array): ScalePower; + range(range: Array): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): ScalePower; + rangeRound(range: Array): this; clamp(): boolean; - clamp(clamp: boolean): ScalePower; + clamp(clamp: boolean): this; interpolate(): InterpolatorFactory; - interpolate(interpolate: InterpolatorFactory): ScalePower; + interpolate(interpolate: InterpolatorFactory): this; interpolate(interpolate: InterpolatorFactory): ScalePower; ticks(count?: number): Array; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - nice(count?: number): ScalePower; + nice(count?: number): this; copy(): ScalePower; exponent(): number; - exponent(exponent: number): ScalePower; + exponent(exponent: number): this; } export function scalePow(): ScalePower; @@ -107,26 +107,26 @@ export interface ScaleLogarithmic { */ invert(value: number | { valueOf(): number }): number; domain(): Array; - domain(domain: Array): ScaleLogarithmic; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleLogarithmic; + range(range: Array): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): ScaleLogarithmic; + rangeRound(range: Array): this; clamp(): boolean; - clamp(clamp: boolean): ScaleLogarithmic; + clamp(clamp: boolean): this; interpolate(): InterpolatorFactory; - interpolate(interpolate: InterpolatorFactory): ScaleLogarithmic; + interpolate(interpolate: InterpolatorFactory): this; interpolate(interpolate: InterpolatorFactory): ScaleLogarithmic; ticks(count?: number): Array; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - nice(count?: number): ScaleLogarithmic; + nice(count?: number): this; copy(): ScaleLogarithmic; base(): number; - base(base: number): ScaleLogarithmic; + base(base: number): this; } export function scaleLog(): ScaleLogarithmic; @@ -146,12 +146,12 @@ export interface ScaleIdentity { */ invert(value: number | { valueOf(): number }): number; domain(): Array; - domain(domain: Array): ScaleIdentity; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleIdentity; + range(range: Array): this; ticks(count?: number): Array; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - nice(count?: number): ScaleIdentity; + nice(count?: number): this; copy(): ScaleIdentity; } @@ -170,18 +170,18 @@ export interface ScaleTime { */ invert(value: number | { valueOf(): number }): Date; domain(): Array; - domain(domain: Array): ScaleTime; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleTime; + range(range: Array): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): ScaleTime; + rangeRound(range: Array): this; clamp(): boolean; - clamp(clamp: boolean): ScaleTime; + clamp(clamp: boolean): this; interpolate(): InterpolatorFactory; - interpolate(interpolate: InterpolatorFactory): ScaleTime; + interpolate(interpolate: InterpolatorFactory): this; interpolate(interpolate: InterpolatorFactory): ScaleTime; ticks(): Array; ticks(count: number): Array; @@ -189,9 +189,9 @@ export interface ScaleTime { tickFormat(): ((d: Date) => string); tickFormat(count: number, specifier?: string): ((d: Date) => string); tickFormat(interval: TimeInterval, specifier?: string): ((d: Date) => string); - nice(): ScaleTime; - nice(count: number): ScaleTime; - nice(interval: CountableTimeInterval, step?: number): ScaleTime; + nice(): this; + nice(count: number): this; + nice(interval: CountableTimeInterval, step?: number): this; copy(): ScaleTime; } @@ -209,13 +209,13 @@ export function scaleUtc(): ScaleTime; export interface ScaleSequential { - (value: number): Output; + (value: number | { valueOf(): number }): Output; domain(): [number, number]; - domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): ScaleSequential; + domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; clamp(): boolean; - clamp(clamp: boolean): ScaleSequential; + clamp(clamp: boolean): this; interpolator(): ((t: number) => Output); - interpolator(interpolator: ((t: number) => Output)): ScaleSequential; + interpolator(interpolator: ((t: number) => Output)): this; interpolator(interpolator: ((t: number) => NewOutput)): ScaleSequential; copy(): ScaleSequential; } @@ -255,12 +255,12 @@ export interface ScaleQuantize { */ invertExtent(value: Range): [number, number]; domain(): [number, number]; - domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): ScaleQuantize; + domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; range(): Array; - range(range: Array): ScaleQuantize; + range(range: Array): this; ticks(count?: number): Array; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); - nice(count?: number): ScaleQuantize; + nice(count?: number): this; copy(): ScaleQuantize; } @@ -275,9 +275,9 @@ export interface ScaleQuantile { (value: number | { valueOf(): number }): Range; invertExtent(value: Range): [number, number]; domain(): Array; - domain(domain: Array): ScaleQuantile; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleQuantile; + range(range: Array): this; quantiles(): Array; copy(): ScaleQuantile; } @@ -298,9 +298,9 @@ export interface ScaleThreshold { */ invertExtent(value: Range): [Domain, Domain] | [undefined, Domain] | [Domain, undefined] | [undefined, undefined]; domain(): Array; - domain(domain: Array): ScaleThreshold; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleThreshold; + range(range: Array): this; copy(): ScaleThreshold; } @@ -315,11 +315,11 @@ export function scaleThreshold(): export interface ScaleOrdinal { (x: Domain): Range; domain(): Array; - domain(domain: Array): ScaleOrdinal; + domain(domain: Array): this; range(): Array; - range(range: Array): ScaleOrdinal; + range(range: Array): this; unknown(): Range | { name: 'implicit' }; - unknown(value: Range | { name: 'implicit' }): ScaleOrdinal; + unknown(value: Range | { name: 'implicit' }): this; copy(): ScaleOrdinal; } @@ -336,16 +336,16 @@ export const scaleImplicit: { name: 'implicit' }; export interface ScaleBand { (x: Domain): number | undefined; domain(): Array; - domain(domain: Array): ScaleBand; + domain(domain: Array): this; range(): [number, number]; - range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): ScaleBand; - rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): ScaleBand; + range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; + rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; round(): boolean; - round(round: boolean): ScaleBand; + round(round: boolean): this; paddingInner(): number; - paddingInner(padding: number): ScaleBand; + paddingInner(padding: number): this; paddingOuter(): number; - paddingOuter(padding: number): ScaleBand; + paddingOuter(padding: number): this; /** * Returns the inner padding. */ @@ -353,9 +353,9 @@ export interface ScaleBand { /** * A convenience method for setting the inner and outer padding to the same padding value. */ - padding(padding: number): ScaleBand; + padding(padding: number): this; align(): number; - align(align: number): ScaleBand; + align(align: number): this; bandwidth(): number; step(): number; copy(): ScaleBand; @@ -371,12 +371,12 @@ export function scaleBand(): ScaleBand { (x: Domain): number | undefined; domain(): Array; - domain(domain: Array): ScalePoint; + domain(domain: Array): this; range(): [number, number]; - range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): ScalePoint; - rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): ScalePoint; + range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; + rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; round(): boolean; - round(round: boolean): ScalePoint; + round(round: boolean): this; /** * Returns the current outer padding which defaults to 0. * The outer padding determines the ratio of the range that is reserved for blank space @@ -388,9 +388,9 @@ export interface ScalePoint { * The outer padding determines the ratio of the range that is reserved for blank space * before the first point and after the last point. */ - padding(padding: number): ScalePoint; + padding(padding: number): this; align(): number; - align(align: number): ScalePoint; + align(align: number): this; bandwidth(): number; step(): number; copy(): ScalePoint; diff --git a/d3-selection-multi/d3-selection-multi-tests.ts b/d3-selection-multi/d3-selection-multi-tests.ts new file mode 100644 index 0000000000..8557cdf51b --- /dev/null +++ b/d3-selection-multi/d3-selection-multi-tests.ts @@ -0,0 +1,151 @@ + +/** + * Typescript definition tests for d3/d3-selection-multi module + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +import {Selection} from 'd3-selection'; +import {Transition} from 'd3-transition'; + +import * as d3SelectionMulti from 'd3-selection-multi'; + +let selection: Selection; + +// Selection.attrs + +// Simple object +selection = selection.attrs({ + foo: 1, + bar: '2', + baz: true, +}); + +// Function values +selection = selection.attrs({ + foo: () => 1, + bar: (d) => d, + baz: (d, i) => i !== 0, + bat: function () { + return this.href; + }, +}); + +// Function that returns a map +selection = selection.attrs(function (d) { + return this.id ? null : { id: d }; +}); + +// Selection.styles +// Each test is repeated twice: once without the priority, and another time with + +// Simple object +selection = selection.styles({ + top: 0, + color: 'red', +}); + +selection = selection.styles({ + top: 0, + color: 'red', +}, 'important'); + +// Function values +selection = selection.styles({ + top: (d, i) => i + 'px', + color: d => d, +}); + +selection = selection.styles({ + top: (d, i) => i + 'px', + color: d => d, +}, 'important'); + +// Functions that return a map +selection.styles(function (d) { + return this.id ? { color: 'red' } : { color: d }; +}); + +selection = selection.styles(function (d) { + return this.id ? { color: 'red' } : { color: d }; +}, 'important'); + +// Selection.properties +// Simple object +selection = selection.properties({ + foo: 1, + bar: 'bar', +}); + +// Function values +selection = selection.properties({ + foo: (d, i) => i, + bar: d => d, +}); + +// Function that returns an object +selection = selection.properties(function (d) { + return this.href ? null : { href: d }; +}); + +let transition: Transition; + +// Transition.attrs + +// Simple object +transition = transition.attrs({ + foo: 1, + bar: '2', + baz: true, +}); + +// Function values +transition = transition.attrs({ + foo: () => 1, + bar: (d) => d, + baz: (d, i) => i !== 0, + bat: function () { + return this.href; + }, +}); + +// Function that returns a map +transition = transition.attrs(function (d) { + return this.id ? null : { id: d }; +}); + +// Transition.styles +// As above, the tests are repeated with the priority 'important' passed in + +// Simple object +transition = transition.styles({ + top: 0, + color: 'red', +}); + +transition = transition.styles({ + top: 0, + color: 'red', +}, 'important'); + +// Function values +transition = transition.styles({ + top: (d, i) => i + 'px', + color: d => d, +}); + +transition = transition.styles({ + top: (d, i) => i + 'px', + color: d => d, +}, 'important'); + +// Function that returns a map +transition = transition.styles(function (d) { + return this.id ? { color: 'red' } : { color: d }; +}); + +transition = transition.styles(function (d) { + return this.id ? { color: 'red' } : { color: d }; +}, 'important'); diff --git a/d3-selection-multi/index.d.ts b/d3-selection-multi/index.d.ts new file mode 100644 index 0000000000..455fe8e91a --- /dev/null +++ b/d3-selection-multi/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for D3JS d3-selection-multi module 1.0.0 +// Project: https://github.com/d3/d3-selection-multi/ +// Definitions by: Alex Ford , Boris Yankov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import {Selection, BaseType, ArrayLike, ValueFn} from 'd3-selection'; +import {Transition} from 'd3-transition'; + + +// An object mapping attribute (or style or property) names to value accessors +export type ValueMap = { [key: string]: number | string | boolean | null | ValueFn }; + +declare module 'd3-selection' { + export interface Selection { + /** + * Set multiple attributes on the given selection. Attribute values may be constant or derived from each node and its bound data. + * + * @param attrs An object used as a map of attribute names to set + */ + attrs(attrs: ValueMap): this; + + /** + * Derive a map of attributes to be set on the selection. + * + * @param attrs A function that returns an object of attribute names and values to set. + */ + attrs(attrs: ValueFn>): this; + + /** + * Set multiple CSS style properties on the given selection. Style properties may be constant or derived from each node and its bound data. + * + * @param style An object used as a map of style properties to set. + * @param priority The CSS priority (either "important" or undefined). + */ + styles(style: ValueMap, priority?: 'important'): this; + + /** + * Derive a map of style properties to be set on the selection. + * + * @param style A function that returns an object of style properties and the values to be set. + * @param priority The CSS priority (either "important" or undefined) + */ + styles(style: ValueFn>, priority?: 'important'): this; + + /** + * Set multiple object properties directly on the selection's node(s). Property values may be constants or derived from each node and its bound data. + * + * @param props An object used as a map of object properties to be set. + */ + properties(props: ValueMap): this; + + /** + * Derive a map of object properties to be set on the selection's node(s). + * + * @param props A function that returns an object of properties and their values. + */ + properties(props: ValueFn>): this; + } +} + +declare module 'd3-transition' { + export interface Transition { + /** + * Set multiple attribute values. The transition will animate from the present value to the new value. Attribute values may be constant or derived from each node and its bound data. + * + * @param attrs An object used as a map of attributes and their values. + */ + attrs(attrs: ValueMap): this; + + /** + * Derive a map of attribute values to set. + * + * @param attrs A function returning a map of attributes and their values. + */ + attrs(attrs: ValueFn>): this; + + /** + * Set multiple style properties. The transition will animate from the present value to the new value. Attribute values may be constant or derived from each node and its bound data. + * + * @param style A map of style properties and their values + * @param priority The CSS priority (either "important" or undefined) + */ + styles(style: ValueMap, priority?: 'important'): this; + + /** + * Derive a map of style properties to be set. + * + * @param style A function returning a map of style properties and their values + * @param priority The CSS priority (either "important" or undefined) + */ + styles(style: ValueFn>, priority?: 'important'): this; + } +} diff --git a/d3-selection-multi/tsconfig.json b/d3-selection-multi/tsconfig.json new file mode 100644 index 0000000000..0cd4419b55 --- /dev/null +++ b/d3-selection-multi/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "d3-selection-multi-tests.ts" + ] +} diff --git a/d3-selection/index.d.ts b/d3-selection/index.d.ts index 08c07e3f7c..46b6d3fa5d 100644 --- a/d3-selection/index.d.ts +++ b/d3-selection/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-selection module 1.0.0 // Project: https://github.com/d3/d3-selection/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -------------------------------------------------------------------------- @@ -21,7 +21,7 @@ export interface ArrayLike { [index: number]: T; } -// TODO: Review Use for enter() + export interface EnterElement { ownerDocument: Document; namespaceURI: string; @@ -56,6 +56,11 @@ export type CustomEventParameters = { detail: any; } +/** + * Callback type for selections and transitions + */ +export type ValueFn = (this: Element, datum: Datum, index: number, groups: Array | ArrayLike) => Result; + /** * TransitionLike is a helper interface to represent a quasi-Transition, without specifying the full Transition interface in this file. @@ -70,9 +75,9 @@ export type CustomEventParameters = { export interface TransitionLike { selection(): Selection; on(type: string, listener: null): TransitionLike; - on(type: string, listener: (this: GElement, datum: Datum, index: number, group: Array | ArrayLike) => any): TransitionLike; + on(type: string, listener: ValueFn): TransitionLike; tween(name: string, tweenFn: null): TransitionLike; - tween(name: string, tweenFn: (this: GElement, datum?: Datum, i?: number, group?: GElement[] | ArrayLike) => ((t: number) => void)): TransitionLike; + tween(name: string, tweenFn: ValueFn void)>): TransitionLike; } @@ -100,115 +105,105 @@ interface Selection(selector: string): Selection; select(selector: null): Selection; // _groups are set to empty array, first generic type is set to null by convention - select(selector: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => DescElement): Selection; + select(selector: ValueFn): Selection; selectAll(): Selection; // _groups are set to empty array, first generic type is set to null by convention selectAll(selector: null): Selection; // _groups are set to empty array, first generic type is set to null by convention selectAll(selector: string): Selection; - selectAll(selector: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (Array | ArrayLike)): Selection; + selectAll(selector: ValueFn | ArrayLike>): Selection; // Modifying ------------------------------- attr(name: string): string; - attr(name: string, value: null): Selection; - attr(name: string, value: string | number | boolean): Selection; - attr(name: string, value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (string | number | boolean)): Selection; + attr(name: string, value: null): this; + attr(name: string, value: string | number | boolean): this; + attr(name: string, value: ValueFn): this; classed(name: string): boolean; - classed(name: string, value: boolean): Selection; - classed(name: string, value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => boolean): Selection; + classed(name: string, value: boolean): this; + classed(name: string, value: ValueFn): this; style(name: string): string; - style(name: string, value: null): Selection; - style(name: string, value: string | number | boolean, priority?: null | 'important'): Selection; - style(name: string, value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (string | number | boolean), priority?: null | 'important'): Selection; + style(name: string, value: null): this; + style(name: string, value: string | number | boolean, priority?: null | 'important'): this; + style(name: string, value: ValueFn, priority?: null | 'important'): this; property(name: string): any; - property(name: string, value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => any): Selection; - property(name: string, value: null): Selection; - property(name: string, value: any): Selection; + property(name: string, value: ValueFn): this; + property(name: string, value: null): this; + property(name: string, value: any): this; text(): string; - text(value: string | number | boolean): Selection; - text(value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (string | number | boolean)): Selection; + text(value: string | number | boolean): this; + text(value: ValueFn): this; html(): string; - html(value: string): Selection; - html(value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => string): Selection; + html(value: string): this; + html(value: ValueFn): this; append(type: string): Selection; - append(type: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => ChildElement): Selection; + append(type: ValueFn): Selection; insert(type: string, before: string): Selection; - insert(type: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => ChildElement, before: string): Selection; - insert(type: string, before: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => BaseType): Selection; - insert(type: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => ChildElement, - before: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => BaseType): Selection; + insert(type: ValueFn, before: string): Selection; + insert(type: string, before: ValueFn): Selection; + insert(type: ValueFn, before: ValueFn): Selection; /** * Removes the selected elements from the document. * Returns this selection (the removed elements) which are now detached from the DOM. */ - remove(): Selection; + remove(): this; merge(other: Selection): Selection; - filter(selector: string): Selection; - filter(selector: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => boolean): Selection; + filter(selector: string): this; + filter(selector: ValueFn): this; - sort(comparator?: (a: Datum, b: Datum) => number): Selection; + sort(comparator?: (a: Datum, b: Datum) => number): this; - order(): Selection; + order(): this; - raise(): Selection; + raise(): this; - lower(): Selection; + lower(): this; // Data Join --------------------------------- datum(): Datum; datum(value: null): Selection; - datum(value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => NewDatum): Selection; + datum(value: ValueFn): Selection; datum(value: NewDatum): Selection; data(): Datum[]; - data( - data: Array, - key?: (this: GElement | PElement, datum?: Datum | NewDatum, index?: number, group?: Array | ArrayLike) => string - ): Selection; - data( - data: (this: PElement, datum?: PDatum, index?: number, group?: Array | ArrayLike) => Array, - key?: (this: GElement | PElement, datum?: Datum | NewDatum, index?: number, group?: Array | ArrayLike) => string - ): Selection; + data(data: Array, key?: ValueFn): Selection; + data(data: ValueFn>, key?: ValueFn): Selection; - // TODO: Enter Selection returns GElements of type EnterNode, which do not meet the minimum interface of BaseType = Element - // HACK: Keep enter() selection 'as-if' they are of type GElement, while overly permissive, this may be of little practical relevance, - // given that the normal next step is an .append(...), which would address the matter enter(): Selection; - // TODO: Review this: The type Datum on the exit items is actually of the type prior to calling data(...), as by definition, no new data of type NewDatum exists for these + // The type Datum on the exit items is actually of the type prior to calling data(...), as by definition, no new data of type NewDatum exists for these // elements. Due to the chaining, .data(...).exit(...), however, the definition would imply that the exit group elements have assumed the NewDatum type. // This seems to imply the following workaroud: Recast the exit Selection to OldDatum, if needed, or ommit and allow exit group elements to be of type any. exit(): Selection; // Event Handling ------------------- - on(type: string): (this: GElement, datum: Datum, index: number, group: Array | ArrayLike) => void; - on(type: string, listener: null): Selection; - on(type: string, listener: (this: GElement, datum: Datum, index: number, group: Array | ArrayLike) => void, capture?: boolean): Selection; + on(type: string): ValueFn; + on(type: string, listener: null): this; + on(type: string, listener: ValueFn, capture?: boolean): this; - dispatch(type: string, parameters?: CustomEventParameters): Selection; - dispatch(type: string, parameters?: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => CustomEventParameters): Selection; + dispatch(type: string, parameters?: CustomEventParameters): this; + dispatch(type: string, parameters?: ValueFn): this; // Control Flow ---------------------- - each(valueFn: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => void): Selection; + each(valueFn: ValueFn): this; - call(func: (selection: Selection, ...args: any[]) => void, ...args: any[]): Selection; + call(func: (selection: Selection, ...args: any[]) => void, ...args: any[]): this; empty(): boolean; diff --git a/d3-shape/index.d.ts b/d3-shape/index.d.ts index 7ca39c7a06..aefe7a93fb 100644 --- a/d3-shape/index.d.ts +++ b/d3-shape/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-shape module 1.0.0 // Project: https://github.com/d3/d3-shape/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // ----------------------------------------------------------------------------------- @@ -19,26 +19,26 @@ export interface Arc { (this: This, d: Datum, ...args: any[]): string | undefined; centroid(d: Datum, ...args: any[]): [number, number]; innerRadius(): (this: This, d: Datum, ...args: any[]) => number; - innerRadius(radius: number): Arc; - innerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): Arc; + innerRadius(radius: number): this; + innerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; outerRadius(): (this: This, d: Datum, ...args: any[]) => number; - outerRadius(radius: number): Arc; - outerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): Arc; + outerRadius(radius: number): this; + outerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; cornerRadius(): (this: This, d: Datum, ...args: any[]) => number; - cornerRadius(radius: number): Arc; - cornerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): Arc; + cornerRadius(radius: number): this; + cornerRadius(radius: (this: This, d: Datum, ...args: any[]) => number): this; startAngle(): (this: This, d: Datum, ...args: any[]) => number; - startAngle(angle: number): Arc; - startAngle(angle: (this: This, d: Datum, ...args: any[]) => number): Arc; + startAngle(angle: number): this; + startAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; endAngle(): (this: This, d: Datum, ...args: any[]) => number; - endAngle(angle: number): Arc; - endAngle(angle: (this: This, d: Datum, ...args: any[]) => number): Arc; + endAngle(angle: number): this; + endAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; padAngle(): (this: This, d: Datum, ...args: any[]) => number; - padAngle(angle: number): Arc; - padAngle(angle: (this: This, d: Datum, ...args: any[]) => number): Arc; + padAngle(angle: number): this; + padAngle(angle: (this: This, d: Datum, ...args: any[]) => number): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): Arc; - context(context: null): Arc; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; } export function arc(): Arc; @@ -62,24 +62,24 @@ export interface PieArcDatum { export interface Pie { (this: This, data: Array, ...args: any[]): Array>; - value(): (d: Datum, i?: number, data?: Array) => number; - value(value: number): Pie; - value(value: (d: Datum, i?: number, data?: Array) => number): Pie; + value(): (d: Datum, i: number, data: Array) => number; + value(value: number): this; + value(value: (d: Datum, i: number, data: Array) => number): this; sort(): ((a: Datum, b: Datum) => number) | null; - sort(comparator: (a: Datum, b: Datum) => number): Pie; - sort(comparator: null): Pie; + sort(comparator: (a: Datum, b: Datum) => number): this; + sort(comparator: null): this; sortValues(): ((a: number, b: number) => number) | null; - sortValues(comparator: (a: number, b: number) => number): Pie; - sortValues(comparator: null): Pie; + sortValues(comparator: (a: number, b: number) => number): this; + sortValues(comparator: null): this; startAngle(): (this: This, data: Array, ...args: any[]) => number; - startAngle(angle: number): Pie; - startAngle(angle: (this: This, data: Array, ...args: any[]) => number): Pie; + startAngle(angle: number): this; + startAngle(angle: (this: This, data: Array, ...args: any[]) => number): this; endAngle(): (this: This, data: Array, ...args: any[]) => number; - endAngle(angle: number): Pie; - endAngle(angle: (this: This, data: Array, ...args: any[]) => number): Pie; + endAngle(angle: number): this; + endAngle(angle: (this: This, data: Array, ...args: any[]) => number): this; padAngle(): (this: This, data: Array, ...args: any[]) => number; - padAngle(angle: number): Pie; - padAngle(angle: (this: This, data: Array, ...args: any[]) => number): Pie; + padAngle(angle: number): this; + padAngle(angle: (this: This, data: Array, ...args: any[]) => number): this; } export function pie(): Pie; @@ -93,20 +93,20 @@ export function pie(): Pie; export interface Line { (data: Array): string | undefined; - x(): (d: Datum, index?: number, data?: Array) => number; - x(x: number): Line; - x(x: (d: Datum, index?: number, data?: Array) => number): Line; - y(): (d: Datum, index?: number, data?: Array) => number; - y(y: number): Line; - y(y: (d: Datum, index?: number, data?: Array) => number): Line; - defined(): (d: Datum, index?: number, data?: Array) => boolean; - defined(defined: boolean): Line; - defined(defined: (d: Datum, index?: number, data?: Array) => boolean): Line; + x(): (d: Datum, index: number, data: Array) => number; + x(x: number): this; + x(x: (d: Datum, index: number, data: Array) => number): this; + y(): (d: Datum, index: number, data: Array) => number; + y(y: number): this; + y(y: (d: Datum, index: number, data: Array) => number): this; + defined(): (d: Datum, index: number, data: Array) => boolean; + defined(defined: boolean): this; + defined(defined: (d: Datum, index: number, data: Array) => boolean): this; curve(): CurveFactory | CurveFactoryLineOnly; - curve(curve: CurveFactory | CurveFactoryLineOnly): Line; + curve(curve: CurveFactory | CurveFactoryLineOnly): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): Line; - context(context: null): Line; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; } export function line(): Line<[number, number]>; export function line(): Line; @@ -114,20 +114,20 @@ export function line(): Line; export interface RadialLine { (data: Array): string | undefined; - angle(): (d: Datum, index?: number, data?: Array) => number; - angle(angle: number): RadialLine; - angle(angle: (d: Datum, index?: number, data?: Array) => number): RadialLine; - radius(): (d: Datum, index?: number, data?: Array) => number; - radius(radius: number): RadialLine; - radius(radius: (d: Datum, index?: number, data?: Array) => number): RadialLine; - defined(): (d: Datum, index?: number, data?: Array) => boolean; - defined(defined: boolean): RadialLine; - defined(defined: (d: Datum, index?: number, data?: Array) => boolean): RadialLine; + angle(): (d: Datum, index: number, data: Array) => number; + angle(angle: number): this; + angle(angle: (d: Datum, index: number, data: Array) => number): this; + radius(): (d: Datum, index: number, data: Array) => number; + radius(radius: number): this; + radius(radius: (d: Datum, index: number, data: Array) => number): this; + defined(): (d: Datum, index: number, data: Array) => boolean; + defined(defined: boolean): this; + defined(defined: (d: Datum, index: number, data: Array) => boolean): this; curve(): CurveFactory | CurveFactoryLineOnly; - curve(curve: CurveFactory | CurveFactoryLineOnly): RadialLine; + curve(curve: CurveFactory | CurveFactoryLineOnly): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): RadialLine; - context(context: null): RadialLine; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; } export function radialLine(): RadialLine<[number, number]>; @@ -140,32 +140,32 @@ export function radialLine(): RadialLine; export interface Area { (data: Array): string | undefined; - x(): (d: Datum, index?: number, data?: Array) => number; - x(x: number): Area; - x(x: (d: Datum, index?: number, data?: Array) => number): Area; - x0(): (d: Datum, index?: number, data?: Array) => number; - x0(x0: number): Area; - x0(x0: (d: Datum, index?: number, data?: Array) => number): Area; - x1(): ((d: Datum, index?: number, data?: Array) => number) | null; - x1(x: number): Area; - x1(x: (d: Datum, index?: number, data?: Array) => number): Area; - y(): (d: Datum, index?: number, data?: Array) => number; - y(y: number): Area; - y(y: (d: Datum, index?: number, data?: Array) => number): Area; - y0(): (d: Datum, index?: number, data?: Array) => number; - y0(y: number): Area; - y0(y: (d: Datum, index?: number, data?: Array) => number): Area; - y1(): (d: Datum, index?: number, data?: Array) => number; - y1(y: number): Area; - y1(y: (d: Datum, index?: number, data?: Array) => number): Area; - defined(): (d: Datum, index?: number, data?: Array) => boolean; - defined(defined: boolean): Area; - defined(defined: (d: Datum, index?: number, data?: Array) => boolean): Area; + x(): (d: Datum, index: number, data: Array) => number; + x(x: number): this; + x(x: (d: Datum, index: number, data: Array) => number): this; + x0(): (d: Datum, index: number, data: Array) => number; + x0(x0: number): this; + x0(x0: (d: Datum, index: number, data: Array) => number): this; + x1(): ((d: Datum, index: number, data: Array) => number) | null; + x1(x: number): this; + x1(x: (d: Datum, index: number, data: Array) => number): this; + y(): (d: Datum, index: number, data: Array) => number; + y(y: number): this; + y(y: (d: Datum, index: number, data: Array) => number): this; + y0(): (d: Datum, index: number, data: Array) => number; + y0(y: number): this; + y0(y: (d: Datum, index: number, data: Array) => number): this; + y1(): (d: Datum, index: number, data: Array) => number; + y1(y: number): this; + y1(y: (d: Datum, index: number, data: Array) => number): this; + defined(): (d: Datum, index: number, data: Array) => boolean; + defined(defined: boolean): this; + defined(defined: (d: Datum, index: number, data: Array) => boolean): this; curve(): CurveFactory; - curve(curve: CurveFactory): Area; + curve(curve: CurveFactory): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): Area; - context(context: null): Area; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; lineX0(): Line; lineY0(): Line; lineX1(): Line; @@ -178,32 +178,32 @@ export function area(): Area; export interface RadialArea { (data: Array): string | undefined; - angle(): (d: Datum, index?: number, data?: Array) => number; - angle(angle: number): RadialArea; - angle(angle: (d: Datum, index?: number, data?: Array) => number): RadialArea; - startAngle(): (d: Datum, index?: number, data?: Array) => number; - startAngle(angle: number): RadialArea; - startAngle(angle: (d: Datum, index?: number, data?: Array) => number): RadialArea; - endAngle(): ((d: Datum, index?: number, data?: Array) => number) | null; - endAngle(angle: number): RadialArea; - endAngle(angle: (d: Datum, index?: number, data?: Array) => number): RadialArea; - radius(): (d: Datum, index?: number, data?: Array) => number; - radius(radius: number): RadialArea; - radius(radius: (d: Datum, index?: number, data?: Array) => number): RadialArea; - innerRadius(): (d: Datum, index?: number, data?: Array) => number; - innerRadius(radius: number): RadialArea; - innerRadius(radius: (d: Datum, index?: number, data?: Array) => number): RadialArea; - outerRadius(): (d: Datum, index?: number, data?: Array) => number; - outerRadius(radius: number): RadialArea; - outerRadius(radius: (d: Datum, index?: number, data?: Array) => number): RadialArea; - defined(): (d: Datum, index?: number, data?: Array) => boolean; - defined(defined: boolean): RadialArea; - defined(defined: (d: Datum, index?: number, data?: Array) => boolean): RadialArea; + angle(): (d: Datum, index: number, data: Array) => number; + angle(angle: number): this; + angle(angle: (d: Datum, index: number, data: Array) => number): this; + startAngle(): (d: Datum, index: number, data: Array) => number; + startAngle(angle: number): this; + startAngle(angle: (d: Datum, index: number, data: Array) => number): this; + endAngle(): ((d: Datum, index: number, data: Array) => number) | null; + endAngle(angle: number): this; + endAngle(angle: (d: Datum, index: number, data: Array) => number): this; + radius(): (d: Datum, index: number, data: Array) => number; + radius(radius: number): this; + radius(radius: (d: Datum, index: number, data: Array) => number): this; + innerRadius(): (d: Datum, index: number, data: Array) => number; + innerRadius(radius: number): this; + innerRadius(radius: (d: Datum, index: number, data: Array) => number): this; + outerRadius(): (d: Datum, index: number, data: Array) => number; + outerRadius(radius: number): this; + outerRadius(radius: (d: Datum, index: number, data: Array) => number): this; + defined(): (d: Datum, index: number, data: Array) => boolean; + defined(defined: boolean): this; + defined(defined: (d: Datum, index: number, data: Array) => boolean): this; curve(): CurveFactory; - curve(curve: CurveFactory): RadialArea; + curve(curve: CurveFactory): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): RadialArea; - context(context: null): RadialArea; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; lineStartAngle(): RadialLine; lineInnerRadius(): RadialLine; lineEndAngle(): RadialLine; @@ -243,13 +243,13 @@ export var curveBasisOpen: CurveFactory; export var curveBasisClosed: CurveFactory; export interface CurveBundleFactory extends CurveFactoryLineOnly { - beta(beta: number): CurveBundleFactory; + beta(beta: number): this; } export var curveBundle: CurveBundleFactory; export interface CurveCardinalFactory extends CurveFactory { - tension(tension: number): CurveCardinalFactory; + tension(tension: number): this; } export var curveCardinal: CurveCardinalFactory; @@ -257,7 +257,7 @@ export var curveCardinalOpen: CurveCardinalFactory; export var curveCardinalClosed: CurveCardinalFactory; export interface CurveCatmullRomFactory extends CurveFactory { - alpha(alpha: number): CurveCatmullRomFactory; + alpha(alpha: number): this; } export var curveCatmullRom: CurveCatmullRomFactory; @@ -292,15 +292,15 @@ export interface SymbolType { export interface Symbol { (this: This, d?: Datum, ...args: any[]): undefined | string; - size(): (this: This, d?: Datum, ...args: any[]) => number; - size(size: number): Symbol; - size(size: (this: This, d?: Datum, ...args: any[]) => number): Symbol; - type(): (this: This, d?: Datum, ...args: any[]) => SymbolType; - type(type: SymbolType): Symbol; - type(type: (this: This, d?: Datum, ...args: any[]) => SymbolType): Symbol; + size(): (this: This, d: Datum, ...args: any[]) => number; + size(size: number): this; + size(size: (this: This, d: Datum, ...args: any[]) => number): this; + type(): (this: This, d: Datum, ...args: any[]) => SymbolType; + type(type: SymbolType): this; + type(type: (this: This, d: Datum, ...args: any[]) => SymbolType): this; context(): CanvasRenderingContext2D | null; - context(context: CanvasRenderingContext2D): Symbol; - context(context: null): Symbol; + context(context: CanvasRenderingContext2D): this; + context(context: null): this; } @@ -342,21 +342,21 @@ export interface Stack { (data: Array, ...args: any[]): Array>; keys(): (this: This, data: Array, ...args: any[]) => Array; - keys(keys: Array): Stack; - keys(keys: (this: This, data: Array, ...args: any[]) => Array): Stack; + keys(keys: Array): this; + keys(keys: (this: This, data: Array, ...args: any[]) => Array): this; - value(): (d: Datum, key: Key, j?: number, data?: Array) => number; - value(value: number): Stack; - value(value: (d: Datum, key: Key, j?: number, data?: Array) => number): Stack; + value(): (d: Datum, key: Key, j: number, data: Array) => number; + value(value: number): this; + value(value: (d: Datum, key: Key, j: number, data: Array) => number): this; order(): (series: Series) => Array; - order(order: null): Stack; - order(order: Array): Stack; - order(order: (series: Series) => Array): Stack; + order(order: null): this; + order(order: Array): this; + order(order: (series: Series) => Array): this; offset(): (series: Series, order: Array) => void; - offset(offset: null): Stack; - offset(offset: (series: Series, order: Array) => void): Stack; + offset(offset: null): this; + offset(offset: (series: Series, order: Array) => void): this; } diff --git a/d3-time-format/index.d.ts b/d3-time-format/index.d.ts index 425a37b48d..3615911cbd 100644 --- a/d3-time-format/index.d.ts +++ b/d3-time-format/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for d3JS d3-time-format module 2.0.0 // Project: https://github.com/d3/d3-time-format/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/d3-time/index.d.ts b/d3-time/index.d.ts index 11b055f8c3..99d0ed9d40 100644 --- a/d3-time/index.d.ts +++ b/d3-time/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-time module 1.0.0 // Project: https://github.com/d3/d3-time/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // --------------------------------------------------------------- @@ -14,7 +14,7 @@ export interface TimeInterval { ceil(date: Date): Date; offset(date: Date, step?: number): Date; range(start: Date, stop: Date, step?: number): Date[]; - filter(test: (date: Date) => boolean): TimeInterval; + filter(test: (date: Date) => boolean): this; } export interface CountableTimeInterval extends TimeInterval { diff --git a/d3-timer/index.d.ts b/d3-timer/index.d.ts index 7d0cef9212..c5eded7606 100644 --- a/d3-timer/index.d.ts +++ b/d3-timer/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for d3JS d3-timer module 1.0.1 // Project: https://github.com/d3/d3-timer/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/d3-transition/index.d.ts b/d3-transition/index.d.ts index 39cd5e157f..1f51884f1d 100644 --- a/d3-transition/index.d.ts +++ b/d3-transition/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for D3JS d3-transition module 1.0.0 // Project: https://github.com/d3/d3-transition/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ArrayLike, BaseType, Selection } from 'd3-selection'; +import { ArrayLike, BaseType, Selection, ValueFn } from 'd3-selection'; /** * Extend interface 'Selection' by declaration merging with 'd3-selection' @@ -26,56 +26,56 @@ export interface Transition(selector: string): Transition; - select(selector: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => DescElement): Transition; + select(selector: ValueFn): Transition; // NB: while the empty selections (null or undefined selector) are defined on the underlying object, they should not be exposed in the type definition API // as they are meaningless on transitions.) // selectAll(): Transition; // _groups are set to empty array, first generic type is set to undefined by convention // selectAll(selector: null): Transition; // _groups are set to empty array, first generic type is set to undefined by convention selectAll(selector: string): Transition; - selectAll(selector: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (Array | ArrayLike)): Transition; + selectAll(selector: ValueFn | ArrayLike>): Transition; selection(): Selection; transition(): Transition; // Modifying ------------------------------- - attr(name: string, value: null): Transition; - attr(name: string, value: string | number | boolean): Transition; - attr(name: string, value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (string | number | boolean)): Transition; - attrTween(name: string, tweenFn: (this: GElement, datum?: Datum, i?: number, group?: GElement[] | ArrayLike) => ((t: number) => (string | number | boolean))): Transition; + attr(name: string, value: null): this; + attr(name: string, value: string | number | boolean): this; + attr(name: string, value: ValueFn): this; + attrTween(name: string, tweenFn: ValueFn (string | number | boolean)>): this; - style(name: string, value: null): Transition; - style(name: string, value: string | number | boolean, priority?: null | 'important'): Transition; - style(name: string, value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (string | number | boolean), priority?: null | 'important'): Transition; - styleTween(name: string, tweenFn: (this: GElement, datum?: Datum, i?: number, group?: GElement[] | ArrayLike) => ((t: number) => (string | number | boolean)), priority?: null | 'important'): Transition; + style(name: string, value: null): this; + style(name: string, value: string | number | boolean, priority?: null | 'important'): this; + style(name: string, value: ValueFn, priority?: null | 'important'): this; + styleTween(name: string, tweenFn: ValueFn (string | number | boolean)>, priority?: null | 'important'): this; - text(value: null): Transition; - text(value: string | number | boolean): Transition; - text(value: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => (string | number | boolean)): Transition; + text(value: null): this; + text(value: string | number | boolean): this; + text(value: ValueFn): this; - tween(name: string): (this: GElement, datum?: Datum, i?: number, group?: GElement[] | ArrayLike) => ((t: number) => void); - tween(name: string, tweenFn: null): Transition; - tween(name: string, tweenFn: (this: GElement, datum?: Datum, i?: number, group?: GElement[] | ArrayLike) => ((t: number) => void)): Transition; + tween(name: string): ValueFn void>; + tween(name: string, tweenFn: null): this; + tween(name: string, tweenFn: ValueFn void>): this; - remove(): Transition; + remove(): this; merge(other: Transition): Transition; - filter(filter: string): Transition; - filter(filter: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => boolean): Transition; + filter(filter: string): this; + filter(filter: ValueFn): this; // Event Handling ------------------- - on(type: string): (this: GElement, datum: Datum, index: number, group: Array | ArrayLike) => any; - on(type: string, listener: null): Transition; - on(type: string, listener: (this: GElement, datum: Datum, index: number, group: Array | ArrayLike) => any): Transition; + on(type: string): ValueFn; + on(type: string, listener: null): this; + on(type: string, listener: ValueFn): this; // Control Flow ---------------------- - each(valueFn: (this: GElement, datum?: Datum, index?: number, group?: Array | ArrayLike) => void): Transition; + each(valueFn: ValueFn): this; - call(func: (transition: Transition, ...args: any[]) => any, ...args: any[]): Transition; + call(func: (transition: Transition, ...args: any[]) => any, ...args: any[]): this; empty(): boolean; @@ -87,13 +87,13 @@ export interface Transition; + delay(milliseconds: number): this; duration(): number; - duration(milliseconds: number): Transition; + duration(milliseconds: number): this; ease(): (normalizedTime: number) => number; - ease(easingFn: (normalizedTime: number) => number): Transition; + ease(easingFn: (normalizedTime: number) => number): this; } diff --git a/d3-voronoi/index.d.ts b/d3-voronoi/index.d.ts index 8b3ff002e4..29482438c1 100644 --- a/d3-voronoi/index.d.ts +++ b/d3-voronoi/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for D3JS d3-voronoi module 1.0.1 // Project: https://github.com/d3/d3-voronoi/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -------------------------------------------------------------------------- @@ -53,13 +53,13 @@ export interface VoronoiLink { export interface VoronoiLayout { (data: Array): VoronoiDiagram; x(): (d: T) => number; - x(x: (d: T) => number): VoronoiLayout; + x(x: (d: T) => number): this; y(): (d: T) => number; - y(y: (d: T) => number): VoronoiLayout; + y(y: (d: T) => number): this; extent(): [[number, number], [number, number]] | null; - extent(extent: [[number, number], [number, number]]): VoronoiLayout; + extent(extent: [[number, number], [number, number]]): this; size(): [number, number] | null; - size(size: [number, number]): VoronoiLayout; + size(size: [number, number]): this; polygons(data: Array): Array>; triangles(data: Array): Array>; links(data: Array): Array>; diff --git a/d3-zoom/index.d.ts b/d3-zoom/index.d.ts index f3352168fb..ad48cb80fa 100644 --- a/d3-zoom/index.d.ts +++ b/d3-zoom/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for d3JS d3-zoom module 1.0.2 // Project: https://github.com/d3/d3-zoom/ -// Definitions by: Alex Ford , Boris Yankov , Tom Wanzek +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { ArrayLike, Selection, TransitionLike } from 'd3-selection'; +import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; // -------------------------------------------------------------------------- @@ -24,9 +24,9 @@ type ZoomedElementBaseType = Element; */ export interface ZoomScale { domain(): Array; - domain(domain: Array): ZoomScale; + domain(domain: Array): this; range(): Array; - range(range: Array): ZoomScale; + range(range: Array): this; copy(): ZoomScale; invert(value: number): number; } @@ -39,60 +39,48 @@ export interface ZoomScale { export interface ZoomBehavior extends Function { (selection: Selection, ...args: any[]): void; transform(selection: Selection, transform: ZoomTransform): void; - transform(selection: Selection, transform: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => ZoomTransform): void; + transform(selection: Selection, transform: ValueFn): void; transform(transition: TransitionLike, transform: ZoomTransform): void; - transform(transition: TransitionLike, transform: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => ZoomTransform): void; + transform(transition: TransitionLike, transform: ValueFn): void; translateBy(selection: Selection, x: number, y: number): void; - translateBy(selection: Selection, - x: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number, - y: number): void; - translateBy(selection: Selection, - x: number, - y: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; - translateBy(selection: Selection, - x: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number, - y: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array) => number): void; + translateBy(selection: Selection, x: ValueFn, y: number): void; + translateBy(selection: Selection, x: number, y: ValueFn): void; + translateBy(selection: Selection, x: ValueFn, y: ValueFn): void; translateBy(transition: TransitionLike, x: number, y: number): void; - translateBy(transition: TransitionLike, - x: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number, - y: number): void; - translateBy(transition: TransitionLike, - x: number, - y: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; - translateBy(transition: TransitionLike, - x: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number, - y: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; + translateBy(transition: TransitionLike, x: ValueFn, y: number): void; + translateBy(transition: TransitionLike, x: number, y: ValueFn): void; + translateBy(transition: TransitionLike, x: ValueFn, y: ValueFn): void; scaleBy(selection: Selection, k: number): void; - scaleBy(selection: Selection, k: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; + scaleBy(selection: Selection, k: ValueFn): void; scaleBy(transition: TransitionLike, k: number): void; - scaleBy(transition: TransitionLike, k: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; + scaleBy(transition: TransitionLike, k: ValueFn): void; scaleTo(selection: Selection, k: number): void; - scaleTo(selection: Selection, k: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; + scaleTo(selection: Selection, k: ValueFn): void; scaleTo(transition: TransitionLike, k: number): void; - scaleTo(transition: TransitionLike, k: (this: ZoomRefElement, d?: Datum, i?: number, group?: Array | ArrayLike) => number): void; + scaleTo(transition: TransitionLike, k: ValueFn): void; - filter(): (this: ZoomRefElement, datum: Datum, index: number, group: Array | ArrayLike) => boolean; - filter(filterFn: (this: ZoomRefElement, d?: Datum, index?: number, group?: Array | ArrayLike) => boolean): ZoomBehavior; + filter(): ValueFn; + filter(filterFn: ValueFn): this; - extent(): (this: ZoomRefElement, d: Datum, index: number, group: Array | ArrayLike) => [[number, number], [number, number]]; - extent(extent: [[number, number], [number, number]]): ZoomBehavior; - extent(extent: (this: ZoomRefElement, d?: Datum, index?: number, group?: Array | ArrayLike) => [[number, number], [number, number]]): ZoomBehavior; + extent(): ValueFn; + extent(extent: [[number, number], [number, number]]): this; + extent(extent: ValueFn): this; scaleExtent(): [number, number]; - scaleExtent(extent: [number, number]): ZoomBehavior; + scaleExtent(extent: [number, number]): this; translateExtent(): [[number, number], [number, number]]; - translateExtent(extent: [[number, number], [number, number]]): ZoomBehavior; + translateExtent(extent: [[number, number], [number, number]]): this; duration(): number; - duration(duration: number): ZoomBehavior; + duration(duration: number): this; - on(typenames: string): (this: ZoomRefElement, datum: Datum, index: number, group: Array | ArrayLike) => void; - on(typenames: string, callback: null): ZoomBehavior; - on(typenames: string, callback: (this: ZoomRefElement, datum: Datum, index: number, group: Array | ArrayLike) => void): ZoomBehavior; + on(typenames: string): ValueFn; + on(typenames: string, callback: null): this; + on(typenames: string, callback: ValueFn): this; } From 4d42a7f7bda33685b99e633c6785bbaef6810e14 Mon Sep 17 00:00:00 2001 From: york yao Date: Thu, 18 Aug 2016 06:54:59 +0800 Subject: [PATCH 063/105] add override method of the multer methods (.single(), .array(), fields()) --- multer/multer.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multer/multer.d.ts b/multer/multer.d.ts index 2a4eea805f..2ffaf61760 100644 --- a/multer/multer.d.ts +++ b/multer/multer.d.ts @@ -89,12 +89,18 @@ declare module "multer" { interface Instance { /** Accept a single file with the name fieldname. The single file will be stored in req.file. */ single(fieldame: string): express.RequestHandler; + /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + single(): express.RequestHandler; /** Accept an array of files, all with the name fieldname. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ - array(fieldame?: string, maxCount?: number): express.RequestHandler; + array(fieldame: string, maxCount?: number): express.RequestHandler; + /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + array(): express.RequestHandler; /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ fields(fields: Field[]): express.RequestHandler; /** Accepts all files that comes over the wire. An array of files will be stored in req.files. */ any(): express.RequestHandler; + /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + any(): express.RequestHandler; } } From 3c322e8e4dfae92f16a191d9e9a0b528860c96e9 Mon Sep 17 00:00:00 2001 From: Stefan Valentin Date: Wed, 17 Aug 2016 19:19:09 -0500 Subject: [PATCH 064/105] eventemitter2: Namespaces allow string[] for on/emit --- eventemitter2/eventemitter2.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eventemitter2/eventemitter2.d.ts b/eventemitter2/eventemitter2.d.ts index 39a349c6b6..de1be0d064 100644 --- a/eventemitter2/eventemitter2.d.ts +++ b/eventemitter2/eventemitter2.d.ts @@ -43,7 +43,7 @@ declare class EventEmitter2 { * @param event * @param listener */ - on(event: string, listener: Function): EventEmitter2; + on(event: string | string[], listener: Function): EventEmitter2; /** * Adds a listener that will be fired when any event is emitted. @@ -128,7 +128,7 @@ declare class EventEmitter2 { * @param event * @param args */ - emit(event: string, ...args: any[]): boolean; + emit(event: string | string[], ...args: any[]): boolean; /** * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. @@ -156,7 +156,7 @@ declare module "eventemitter2" { * @param event * @param listener */ - on(event: string, listener: Function): EventEmitter2; + on(event: string | string[], listener: Function): EventEmitter2; /** * Adds a listener that will be fired when any event is emitted. @@ -241,7 +241,7 @@ declare module "eventemitter2" { * @param event * @param args */ - emit(event: string, ...args: any[]): boolean; + emit(event: string | string[], ...args: any[]): boolean; /** * Execute each of the listeners that may be listening for the specified event name in order with the list of arguments. From b711ae75b8e05ffa4ce31981009bb1e59001ba92 Mon Sep 17 00:00:00 2001 From: bradley cushing Date: Wed, 17 Aug 2016 22:35:10 -0400 Subject: [PATCH 065/105] Update TabListProps interface with new optional props Changes were introduced in react-tabs PR #108. --- react-tabs/react-tabs.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/react-tabs/react-tabs.d.ts b/react-tabs/react-tabs.d.ts index 758db0d75c..565b055304 100644 --- a/react-tabs/react-tabs.d.ts +++ b/react-tabs/react-tabs.d.ts @@ -21,6 +21,8 @@ declare namespace ReactTabs { interface TabListProps { className?: string; + activeTabClassName?: string; + disabledTabClassName?: string; } interface TabList extends __React.ComponentClass {} From 26eda7418efd2ad3fd4412f1259976c001dfb378 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Wed, 17 Aug 2016 22:56:29 -0400 Subject: [PATCH 066/105] d3-selection and d3-selection-multi * d3-selection: Change BaseType to include Window into type alias. Updated related tests. * d3-selection-multi: Add explicit tests for ValueMap interface --- .../d3-selection-multi-tests.ts | 51 ++++++++++++++++++- d3-selection/d3-selection-tests.ts | 3 +- d3-selection/index.d.ts | 2 +- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/d3-selection-multi/d3-selection-multi-tests.ts b/d3-selection-multi/d3-selection-multi-tests.ts index 8557cdf51b..370b02eb5c 100644 --- a/d3-selection-multi/d3-selection-multi-tests.ts +++ b/d3-selection-multi/d3-selection-multi-tests.ts @@ -7,8 +7,8 @@ * are not intended as functional tests. */ -import {Selection} from 'd3-selection'; -import {Transition} from 'd3-transition'; +import { Selection, ArrayLike } from 'd3-selection'; +import { Transition } from 'd3-transition'; import * as d3SelectionMulti from 'd3-selection-multi'; @@ -149,3 +149,50 @@ transition = transition.styles(function (d) { transition = transition.styles(function (d) { return this.id ? { color: 'red' } : { color: d }; }, 'important'); + +// Test ValueMap interface ---------------------------------------------- + +interface SampleDatum { + name: string; + r: number; + filled: boolean; +} + +let valueMap: d3SelectionMulti.ValueMap; + +valueMap = { + foo1: 'test', + foo2: 2, + foo3: true, + foo4: null, + bar1: function (d) { + let that: SVGCircleElement = this; + let datum: SampleDatum = d; + return d.name; + }, + bar2: function (d, i) { + let that: SVGCircleElement = this; + let datum: SampleDatum = d; + let index: number = i; + return d.r; + }, + bar3: function (d, i, g) { + let that: SVGCircleElement = this; + let datum: SampleDatum = d; + let index: number = i; + let group: Array | ArrayLike = g; + return d.filled; + } +}; + +// valueMap = { // fails, as an array is not a permissible value type +// foo1: [1, 2] +// }; + +// valueMap = { // fails, as a ValueFunction returning an array is not a permissible value type +// foo1: function (d) { +// let that: SVGCircleElement = this; +// let datum: SampleDatum = d; +// return [1, 2]; +// } +// }; diff --git a/d3-selection/d3-selection-tests.ts b/d3-selection/d3-selection-tests.ts index e56005b897..dfcecd457a 100644 --- a/d3-selection/d3-selection-tests.ts +++ b/d3-selection/d3-selection-tests.ts @@ -89,10 +89,9 @@ let body4: d3Selection.Selection = // d3Selection.select(baseTypeEl.node()); // fails as baseTypeEl.node() is not of type HTMLBodyElement -// TODO: The below are related to github issue #2 (BaseType choice) d3Selection.select(xDoc); -// d3Selection.select(xWindow); // Window cannot does not match type BaseType = Element | EnterElement +d3Selection.select(xWindow); // test top-level selectAll() ------------------------------------------------------------- diff --git a/d3-selection/index.d.ts b/d3-selection/index.d.ts index 46b6d3fa5d..d63ef95d15 100644 --- a/d3-selection/index.d.ts +++ b/d3-selection/index.d.ts @@ -12,7 +12,7 @@ * without 'd3-selection' trying to use properties internally which would otherwise not * be supported. */ -export type BaseType = Element | EnterElement; +export type BaseType = Element | EnterElement | Window; // export type BaseType = any; // Alternative, very permissive BaseType specification for edge cases export interface ArrayLike { From 5baa6e08ea662c63e73a820451f9e85ddc5d63bc Mon Sep 17 00:00:00 2001 From: TonyYang Date: Thu, 18 Aug 2016 11:34:00 +0800 Subject: [PATCH 067/105] express.Application is compatible with http.createServer Add test case: express.Application is compatible with http.createServer --- express/express-tests.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/express/express-tests.ts b/express/express-tests.ts index ed9265b66a..439ef95012 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -1,4 +1,5 @@ /// +/// import * as express from 'express'; var app = express(); @@ -91,3 +92,10 @@ app.listen(3000); const next: express.NextFunction = () => {}; const nextWithArgument: express.NextFunction = (err: any) => {}; + +/** + * The express.Application is compatible with http.createServer + */ + +import * as http from 'http'; +http.createServer(app); From 7d940e6e669eb3a267523b1995718f268044c2b0 Mon Sep 17 00:00:00 2001 From: Gayan Ranasinghe Date: Thu, 18 Aug 2016 10:44:23 +0530 Subject: [PATCH 068/105] fixes --- kendo-ui/kendo-ui.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index ab09a8882f..e8f02f1776 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -5,7 +5,6 @@ /// - declare namespace kendo { function culture(): { name: string; @@ -511,7 +510,7 @@ declare namespace kendo.data { render(value: Object): string; } - module binders { } + namespace binders { } interface Bindings { [key: string]: Binding; From 64ee4c96285cad9bf3e96d511c88849d654558a8 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 09:23:56 +0300 Subject: [PATCH 069/105] getInputNode should return HTMLInputElement --- material-ui/material-ui.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/material-ui/material-ui.d.ts b/material-ui/material-ui.d.ts index 58a36f9cf9..6d48b46e58 100644 --- a/material-ui/material-ui.d.ts +++ b/material-ui/material-ui.d.ts @@ -1712,7 +1712,7 @@ declare namespace __MaterialUI { focus(): void; select(): void; getValue(): string; - getInputNode(): Element; + getInputNode(): HTMLInputElement; } interface TimePickerProps extends React.Props { From 81742efd81d2d70b63636678f54e4e03af23d318 Mon Sep 17 00:00:00 2001 From: Finn Poppinga Date: Thu, 18 Aug 2016 13:00:30 +0200 Subject: [PATCH 070/105] add missing command HINCRBYFLOAT --- redis/redis.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/redis/redis.d.ts b/redis/redis.d.ts index de52145261..5c8fd6b39f 100644 --- a/redis/redis.d.ts +++ b/redis/redis.d.ts @@ -109,7 +109,7 @@ declare module "redis" { "lset", "lrange", "ltrim", "lrem", "rpoplpush", "sadd", "srem", "smove", "sismember", "scard", "spop", "srandmember", "sinter", "sinterstore", "sunion", "sunionstore", "sdiff", "sdiffstore", "smembers", "zadd", "zincrby", "zrem", "zremrangebyscore", "zremrangebyrank", "zunionstore", "zinterstore", "zrange", "zrangebyscore", "zrevrangebyscore", "zcount", "zrevrange", "zcard", "zscore", "zrank", "zrevrank", "hset", "hsetnx", - "hget", "hmset", "hmget", "hincrby", "hdel", "hlen", "hkeys", "hvals", "hgetall", "hexists", "incrby", "decrby", "getset", "mset", "msetnx", + "hget", "hmset", "hmget", "hincrby", "hincrbyfloat", "hdel", "hlen", "hkeys", "hvals", "hgetall", "hexists", "incrby", "decrby", "getset", "mset", "msetnx", "randomkey", "select", "move", "rename", "renamenx", "expire", "expireat", "keys", "dbsize", "auth", "ping", "echo", "save", "bgsave", "bgrewriteaof", "shutdown", "lastsave", "type", "multi", "exec", "discard", "sync", "flushdb", "flushall", "sort", "info", "monitor", "ttl", "persist", "slaveof", "debug", "config", "subscribe", "unsubscribe", "psubscribe", "punsubscribe", "publish", "watch", "unwatch", "cluster", @@ -254,6 +254,8 @@ declare module "redis" { hmget(...args:any[]): boolean; hincrby(args:any[], callback?:ResCallbackT): boolean; hincrby(...args:any[]): boolean; + hincrbyfloat(args:any[], callback?:ResCallbackT): boolean; + hincrbyfloat(...args:any[]): boolean; hdel(args:any[], callback?:ResCallbackT): boolean; hdel(...args:any[]): boolean; hlen(args:any[], callback?:ResCallbackT): boolean; From cb827241b88929adce8708fad4395452e4b76941 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 15:42:15 +0300 Subject: [PATCH 071/105] Create simple-assign.d.ts --- simple-assign/simple-assign.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 simple-assign/simple-assign.d.ts diff --git a/simple-assign/simple-assign.d.ts b/simple-assign/simple-assign.d.ts new file mode 100644 index 0000000000..594e0f98ef --- /dev/null +++ b/simple-assign/simple-assign.d.ts @@ -0,0 +1,8 @@ +// Type definitions for simple-assign 0.1.0 +// Project: https://github.com/sindresorhus/object-assign +// Definitions by: Ivo Stratev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "simple-assign" { + export defualt function(target: any, ...sources: any[]): any; +} From 50e30a81c79d885db610d9733bf0d05721cbadda Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 15:45:04 +0300 Subject: [PATCH 072/105] Create simple-assign-tests.d.ts --- simple-assign/simple-assign-tests.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 simple-assign/simple-assign-tests.d.ts diff --git a/simple-assign/simple-assign-tests.d.ts b/simple-assign/simple-assign-tests.d.ts new file mode 100644 index 0000000000..3b901540e4 --- /dev/null +++ b/simple-assign/simple-assign-tests.d.ts @@ -0,0 +1,15 @@ + +/// +import * as assign from "simple-assign"; + +function assign1() { + return assign({hello: "world"}); +} + +function assign2() { + return assign({hello: "world"}, {hello: "worlds", second: "extra"}); +} + +function assign3() { + return assign({hello: "world"}, {hello: "worlds", second: "extra"}, {hello: "stop", the: "spinning"}); +} From 224e661e5b10b072a72111b9871ad7da95aea6da Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 15:46:20 +0300 Subject: [PATCH 073/105] Update simple-assign.d.ts --- simple-assign/simple-assign.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-assign/simple-assign.d.ts b/simple-assign/simple-assign.d.ts index 594e0f98ef..ee122703fa 100644 --- a/simple-assign/simple-assign.d.ts +++ b/simple-assign/simple-assign.d.ts @@ -1,5 +1,5 @@ // Type definitions for simple-assign 0.1.0 -// Project: https://github.com/sindresorhus/object-assign +// Project: https://github.com/newoga/simple-assign // Definitions by: Ivo Stratev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 7e8ee0b8ce9e28426dcd0485a7abcb3955fedbb9 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 15:52:44 +0300 Subject: [PATCH 074/105] Update simple-assign.d.ts --- simple-assign/simple-assign.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-assign/simple-assign.d.ts b/simple-assign/simple-assign.d.ts index ee122703fa..f16d87fad5 100644 --- a/simple-assign/simple-assign.d.ts +++ b/simple-assign/simple-assign.d.ts @@ -4,5 +4,5 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "simple-assign" { - export defualt function(target: any, ...sources: any[]): any; + export default function(target: any, ...sources: any[]): any; } From aca9b1cd2895eeabf9152ffc58ddea2ec3ff6c47 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 15:52:54 +0300 Subject: [PATCH 075/105] Rename simple-assign-tests.d.ts to simple-assign-tests.ts --- .../{simple-assign-tests.d.ts => simple-assign-tests.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename simple-assign/{simple-assign-tests.d.ts => simple-assign-tests.ts} (100%) diff --git a/simple-assign/simple-assign-tests.d.ts b/simple-assign/simple-assign-tests.ts similarity index 100% rename from simple-assign/simple-assign-tests.d.ts rename to simple-assign/simple-assign-tests.ts From 875b8b14b2ea73242eea76660c568e527abb9ba3 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 15:58:06 +0300 Subject: [PATCH 076/105] Update simple-assign-tests.ts --- simple-assign/simple-assign-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-assign/simple-assign-tests.ts b/simple-assign/simple-assign-tests.ts index 3b901540e4..9afada70dd 100644 --- a/simple-assign/simple-assign-tests.ts +++ b/simple-assign/simple-assign-tests.ts @@ -1,6 +1,6 @@ /// -import * as assign from "simple-assign"; +import assign from "simple-assign"; function assign1() { return assign({hello: "world"}); From 648906b7c7de03a0032ed66d850582856ebef97e Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 16:16:29 +0300 Subject: [PATCH 077/105] Update simple-assign.d.ts --- simple-assign/simple-assign.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simple-assign/simple-assign.d.ts b/simple-assign/simple-assign.d.ts index f16d87fad5..1c65a8e0f9 100644 --- a/simple-assign/simple-assign.d.ts +++ b/simple-assign/simple-assign.d.ts @@ -4,5 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "simple-assign" { - export default function(target: any, ...sources: any[]): any; + function simpleAssign(target: any, ...sources: any[]): any; + export = simpleAssign; } From 8fa7243389ed378b73fbac7f2b525d5cbd225412 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 16:16:56 +0300 Subject: [PATCH 078/105] Update simple-assign-tests.ts --- simple-assign/simple-assign-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-assign/simple-assign-tests.ts b/simple-assign/simple-assign-tests.ts index 9afada70dd..3970356f5b 100644 --- a/simple-assign/simple-assign-tests.ts +++ b/simple-assign/simple-assign-tests.ts @@ -1,6 +1,6 @@ /// -import assign from "simple-assign"; +import assign = require("simple-assign"); function assign1() { return assign({hello: "world"}); From 718c73a6bb01fdc5f8a44aad0b90d5de741525e1 Mon Sep 17 00:00:00 2001 From: Daniel Pereira Date: Thu, 18 Aug 2016 09:50:21 -0500 Subject: [PATCH 079/105] Added mock-require --- mock-require/mock-require-tests.ts | 47 ++++++++++++++++++++++++++++++ mock-require/mock-require.d.ts | 35 ++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 mock-require/mock-require-tests.ts create mode 100644 mock-require/mock-require.d.ts diff --git a/mock-require/mock-require-tests.ts b/mock-require/mock-require-tests.ts new file mode 100644 index 0000000000..528d466064 --- /dev/null +++ b/mock-require/mock-require-tests.ts @@ -0,0 +1,47 @@ +/// + +import mock = require('mock-require'); + +function testMock() { + mock('http', { + request: function () { + console.log('http.request called'); + } + }); + + const http = require('http'); + http.request(); // 'http.request called' +} + +function testStop() { + mock('fs', { mockedFS: true }); + + const fs1 = require('fs'); + mock.stop('fs'); + + const fs2 = require('fs'); + fs1 === fs2; // false +} + +function testStopAll() { + mock('fs', {}); + mock('path', {}); + + const fs1 = require('fs'); + const path1 = require('path'); + + mock.stopAll(); + + const fs2 = require('fs'); + const path2 = require('path'); + + fs1 === fs2; // false + path1 === path2; // false +} + +function testReRequire() { + const fs = require('fs'); + let fileToTest = require('./fileToTest'); + mock('fs', {}); // fileToTest is still using the unmocked fs module + fileToTest = mock.reRequire('./fileToTest'); // fileToTest is now using your mock +} \ No newline at end of file diff --git a/mock-require/mock-require.d.ts b/mock-require/mock-require.d.ts new file mode 100644 index 0000000000..dded6f4224 --- /dev/null +++ b/mock-require/mock-require.d.ts @@ -0,0 +1,35 @@ +// Type definitions for mock-require v1.3.0 +// Project: https://github.com/boblauer/mock-require +// Definitions by: Daniel Pereira +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** Simple, intuitive mocking of Node.js modules. */ +declare module 'mock-require' { + + interface Mock { + + /** + * @param {string} path The module you that you want to mock. + * @param {any} mockExport The function or object you want to be returned from require, instead of the path module's exports, or the module you want to be returned from require, instead of the path module's export. + */ + (path: string, mockExport: any | Function | string): void; + + /** + * @param {string} path The module you that you want to stop mocking. + */ + stop(path: string): void; + + /** This function can be used to remove all registered mocks without the need to remove them individually using mock.stop(). */ + stopAll(): void; + + /** + * @param {string} path The file whose cache you want to refresh. + */ + reRequire(path: string): void; + } + + const myModule: Mock; + export = myModule; +} \ No newline at end of file From 612e4169c6bf8b0b29d27af170d166c84f36948b Mon Sep 17 00:00:00 2001 From: Leo Liang Date: Thu, 18 Aug 2016 22:56:13 +0800 Subject: [PATCH 080/105] Change overload function order to help with resolution. --- node/node.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/node.d.ts b/node/node.d.ts index 61d98fb1ee..3f47be401d 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1370,8 +1370,8 @@ declare module "dgram" { export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; interface Socket extends events.EventEmitter { - send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; send(buf: Buffer, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; + send(buf: Buffer, offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void; bind(port?: number, address?: string, callback?: () => void): void; close(): void; address(): AddressInfo; From 903f09834da3cde4b2bd1bab80c1fd1f26597b1e Mon Sep 17 00:00:00 2001 From: Nicholas Iannone Date: Thu, 18 Aug 2016 10:31:28 -0500 Subject: [PATCH 081/105] Imported working promise library for downstream use. --- db-migrate-base/db-migrate-base.d.ts | 2 ++ db-migrate-pg/db-migrate-pg.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/db-migrate-base/db-migrate-base.d.ts b/db-migrate-base/db-migrate-base.d.ts index fe1f4ade47..d24388fdaf 100644 --- a/db-migrate-base/db-migrate-base.d.ts +++ b/db-migrate-base/db-migrate-base.d.ts @@ -8,6 +8,8 @@ declare module "db-migrate-base" { + import * as Promise from "bluebird"; + export interface CallbackFunction { (err: any, response: any): void; } export interface InternalModule { diff --git a/db-migrate-pg/db-migrate-pg.d.ts b/db-migrate-pg/db-migrate-pg.d.ts index aa1a52d34e..533b8ff91d 100644 --- a/db-migrate-pg/db-migrate-pg.d.ts +++ b/db-migrate-pg/db-migrate-pg.d.ts @@ -10,6 +10,7 @@ declare module "db-migrate-pg" { import * as pg from "pg"; import * as DbMigrateBase from "db-migrate-base"; + import * as Promise from "bluebird"; // Yes, this is a dummy interface for now; the current implementation of the pg driver doesn't need any options. export interface CreateDatabaseOptions {} From 2104b9c513c514bc4194d72b6c3d3ece89ba0ef3 Mon Sep 17 00:00:00 2001 From: Prashant Tiwari Date: Thu, 18 Aug 2016 21:50:59 +0530 Subject: [PATCH 082/105] Distinguish between Server and Request Ext Points These are two different methods with different signatures depending on the type of the extension event. --- hapi/hapi.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 68f6857110..fab645ca71 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -1605,6 +1605,9 @@ declare module "hapi" { addEventListener: any; info: IServerConnectionInfo; } + + type RequestExtPoints = "onRequest" | "onPreResponse" | "onPreAuth" | "onPostAuth" | "onPreHandler" | "onPostHandler" | "onPreResponse"; + type ServerExtPoints = "onPreStart" | "onPostStart" | "onPreStop" | "onPostStop"; /** Server http://hapijs.com/api#server rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080). @@ -2039,8 +2042,9 @@ declare module "hapi" { server.route({ method: 'GET', path: '/test', handler: handler }); server.start(); // All requests will get routed to '/test'*/ - ext(event: string, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; - ext(event: string, method: (request: Request, reply: IStrictReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; + ext(event: RequestExtPoints, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; + ext(event: RequestExtPoints, method: (request: Request, reply: IStrictReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; + ext(event: ServerExtPoints, method: (server: Server, next: (err?: any) => void, bind?: any) => void): void; /** server.handler(name, method) Registers a new handler type to be used in routes where: From 7d23177b1abff1b80b9a2d6ffbc881f6562a2359 Mon Sep 17 00:00:00 2001 From: Prashant Tiwari Date: Thu, 18 Aug 2016 22:03:03 +0530 Subject: [PATCH 083/105] Missed options in ServerExtPoints --- hapi/hapi.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index fab645ca71..ff5e1d9fe8 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -2044,7 +2044,7 @@ declare module "hapi" { // All requests will get routed to '/test'*/ ext(event: RequestExtPoints, method: (request: Request, reply: IReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; ext(event: RequestExtPoints, method: (request: Request, reply: IStrictReply, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; - ext(event: ServerExtPoints, method: (server: Server, next: (err?: any) => void, bind?: any) => void): void; + ext(event: ServerExtPoints, method: (server: Server, next: (err?: any) => void, bind?: any) => void, options?: { before: string | string[]; after: string | string[]; bind?: any }): void; /** server.handler(name, method) Registers a new handler type to be used in routes where: From c38064c1864c5c4b92c073ada511cf23b348582b Mon Sep 17 00:00:00 2001 From: Marcel Haldemann Date: Thu, 18 Aug 2016 19:54:31 +0200 Subject: [PATCH 084/105] added support for jasmine.getEnv().defaultTimeoutInterval Its the timeout for async calls as describt here: https://github.com/mhevery/jasmine-node/blob/master/README.md --- jasmine-node/jasmine-node.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jasmine-node/jasmine-node.d.ts b/jasmine-node/jasmine-node.d.ts index f547f844f6..f535d8c3e3 100644 --- a/jasmine-node/jasmine-node.d.ts +++ b/jasmine-node/jasmine-node.d.ts @@ -7,6 +7,12 @@ declare function it(expectation:string, assertion:(done:(err?:any) => void) => void, timeout?:number):void; +declare namespace jasmine { + interface Env { + defaultTimeoutInterval: number; + } +} + declare module "jasmine-node" { interface ExecuteSpecsOptions { specFolders: string[], From 906c5660479d5b5c36fcbfd23bae2874e80a32a5 Mon Sep 17 00:00:00 2001 From: CodeAnimal Date: Thu, 18 Aug 2016 19:23:38 +0100 Subject: [PATCH 085/105] Remove commented out code Remove the code commented out. - Update the "usage" method documentation to apply to the `matches` method rather than the `regex` method. --- express-validator/express-validator.d.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/express-validator/express-validator.d.ts b/express-validator/express-validator.d.ts index 71797efce2..3599b9b79b 100644 --- a/express-validator/express-validator.d.ts +++ b/express-validator/express-validator.d.ts @@ -122,7 +122,6 @@ declare namespace ExpressValidator { /** * Check if length is 0 */ - //notNull(): Validator; // I don't see this in the documentation or code anywhere. isNull(): Validator; /** * Not just whitespace (input.trim().length !== 0) @@ -130,14 +129,13 @@ declare namespace ExpressValidator { notEmpty(): Validator; equals(equals:any): Validator; contains(str:string): Validator; - //notContains(str:string): Validator; // I don't see this in the documentation or code anywhere. + + /** + * Usage: matches(/[a-z]/i) or matches('[a-z]','i') + */ matches(pattern:string, modifiers?:string): Validator; matches(pattern: RegExp): Validator; - /** - * Usage: regex(/[a-z]/i) or regex('[a-z]','i') - */ - //regex(pattern:string, modifiers:string): Validator; // I don't see this in the documentation or code anywhere. - //notRegex(pattern:string, modifiers:string): Validator; // I don't see this in the documentation or code anywhere. + /** * max is optional */ @@ -200,7 +198,6 @@ declare namespace ExpressValidator { ltrim(...chars:string[]): Sanitizer; rtrim(...chars:string[]): Sanitizer; stripLow(keep_new_lines?: boolean): Sanitizer; - //ifNull(replace:any): Sanitizer; // I don't see this in the documentation or code anywhere. toFloat(): Sanitizer; toInt(radix?: number): Sanitizer; /** From 85da09fde6698a068e30da5ce464465c5c545fd5 Mon Sep 17 00:00:00 2001 From: Ivo Stratev Date: Thu, 18 Aug 2016 21:54:51 +0300 Subject: [PATCH 086/105] Update simple-assign.d.ts --- simple-assign/simple-assign.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simple-assign/simple-assign.d.ts b/simple-assign/simple-assign.d.ts index 1c65a8e0f9..3b9229bd65 100644 --- a/simple-assign/simple-assign.d.ts +++ b/simple-assign/simple-assign.d.ts @@ -4,6 +4,11 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module "simple-assign" { + function simpleAssign(target: T, source: U): T & U; + function simpleAssign(target: T, source1: U, source2: V): T & U & V; + function simpleAssign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + function simpleAssign(target: T, source1: U, source2: V, source3: W, source4: Q): T & U & V & W & Q; + function simpleAssign(target: T, source1: U, source2: V, source3: W, source4: Q, source5: T): T & U & V & W & Q & R; function simpleAssign(target: any, ...sources: any[]): any; export = simpleAssign; } From 227ee0d1f5c6d73e1c5ec75049ba664dab0bd6d1 Mon Sep 17 00:00:00 2001 From: Meirion Hughes Date: Thu, 18 Aug 2016 14:59:41 +0100 Subject: [PATCH 087/105] Fix SAXParser startTag attrs type. update ASTAttribute to include optional prefix field update target version improve tests --- parse5/parse5-tests.ts | 35 +++++++++++++++++++++++++++++------ parse5/parse5.d.ts | 9 +++++---- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/parse5/parse5-tests.ts b/parse5/parse5-tests.ts index 420fda5992..090217a6e2 100644 --- a/parse5/parse5-tests.ts +++ b/parse5/parse5-tests.ts @@ -1,6 +1,6 @@ // Type definitions for parse5 2.1.5 // Project: https://github.com/inikulin/parse5 -// Definitions by: Nico Jansen +// Definitions by: Nico Jansen , Meirion Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -9,33 +9,56 @@ import * as parse5 from 'parse5'; // parse5.SAXParser() var parser = new parse5.SAXParser({ locationInfo: true }); + +var _wasCalled = false; + parser.on('startTag', (name, attrs, selfClosing, location) => { console.log(name, attrs, selfClosing, location); + console.log(attrs[0].name); + console.log(attrs[0].prefix); + console.log(attrs[0].value); + + if(name == "use") + if(attrs[0].prefix === undefined) + throw "prefix wasn't defined on known attr" + + _wasCalled = true; }); + parser.on('text', (text, location) => { console.log(text, location); }); +parser.write('some text'); +parser.write(''); + +if(!_wasCalled) + throw "parser.on 'startTag' wasn't called"; + // parse5.parse() -parse5.parse('html', { locationInfo: true, treeAdapter: parse5.treeAdapters.default }); +parse5.parse('', { locationInfo: true, treeAdapter: parse5.treeAdapters.default }); parse5.parse('html', {}); -parse5.parse('html'); +parse5.parse(''); // parse5.ParserStream() var parserStream = new parse5.ParserStream({ locationInfo: true, treeAdapter: parse5.treeAdapters.htmlparser2 }); parserStream = new parse5.ParserStream({ }); parserStream = new parse5.ParserStream(); + +parserStream.write(""); + var node = parserStream.document.childNodes[0]; + node.parentNode.attrs = [{name: '', value: ''}]; // parse5.parseFragment() -var fragment = parse5.parseFragment(''); -fragment = parse5.parseFragment('', {locationInfo: true}); +var fragment = parse5.parseFragment('
'); +fragment = parse5.parseFragment('
', {locationInfo: true}); // parse5.ASTNode fragment.quirksMode = true; fragment.namespaceURI = ''; fragment.nodeName = ''; fragment.value = ''; -fragment = fragment.parentNode; fragment = fragment.childNodes[0]; +fragment = fragment.parentNode; diff --git a/parse5/parse5.d.ts b/parse5/parse5.d.ts index 69bfd1419e..bb77d6c0c3 100644 --- a/parse5/parse5.d.ts +++ b/parse5/parse5.d.ts @@ -1,6 +1,6 @@ -// Type definitions for parse5 2.1.5 +// Type definitions for parse5 2.2.0 // Project: https://github.com/inikulin/parse5 -// Definitions by: Nico Jansen +// Definitions by: Nico Jansen , Meirion Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -45,6 +45,7 @@ declare module 'parse5' { export interface ASTAttribute { name: string; value: string; + prefix?: string; } export interface Attribute { @@ -126,10 +127,10 @@ declare module 'parse5' { /** * Raised when the parser encounters a start tag. * Listener function has 4 parameters: - * Tag name, List of attributes in the { key: String, value: String } form, selfClosing boolean + * Tag name, List of attributes in the { name: String, value: String, prefix?: String } form, selfClosing boolean * and start tag source code location info. Available if location info is enabled in SAXParserOptions. */ - on(event: 'startTag', listener: (name: string, attrs: Attribute[], selfClosing: boolean, location?: StartTagLocationInfo) => void): this; + on(event: 'startTag', listener: (name: string, attrs: ASTAttribute[], selfClosing: boolean, location?: StartTagLocationInfo) => void): this; /** * Raised when parser encounters an end tag. * Listener function has 2 parameters: From b110a22d2660d42dc4708c1a0f44828f6737d554 Mon Sep 17 00:00:00 2001 From: Meirion Hughes Date: Thu, 18 Aug 2016 21:03:32 +0100 Subject: [PATCH 088/105] Fix target version in test file --- parse5/parse5-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse5/parse5-tests.ts b/parse5/parse5-tests.ts index 090217a6e2..05e1ea683e 100644 --- a/parse5/parse5-tests.ts +++ b/parse5/parse5-tests.ts @@ -1,4 +1,4 @@ -// Type definitions for parse5 2.1.5 +// Type definitions for parse5 2.2.0 // Project: https://github.com/inikulin/parse5 // Definitions by: Nico Jansen , Meirion Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 07b2e6b616344176a6bc8da71edd2f54c0b9e090 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Thu, 18 Aug 2016 13:07:30 -0700 Subject: [PATCH 089/105] Remove duplicate method and re-order some --- multer/multer.d.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/multer/multer.d.ts b/multer/multer.d.ts index 2ffaf61760..d9abb4a87c 100644 --- a/multer/multer.d.ts +++ b/multer/multer.d.ts @@ -87,18 +87,16 @@ declare module "multer" { } interface Instance { + /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ + single(): express.RequestHandler; /** Accept a single file with the name fieldname. The single file will be stored in req.file. */ single(fieldame: string): express.RequestHandler; /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ - single(): express.RequestHandler; + array(): express.RequestHandler; /** Accept an array of files, all with the name fieldname. Optionally error out if more than maxCount files are uploaded. The array of files will be stored in req.files. */ array(fieldame: string, maxCount?: number): express.RequestHandler; - /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ - array(): express.RequestHandler; /** Accept a mix of files, specified by fields. An object with arrays of files will be stored in req.files. */ fields(fields: Field[]): express.RequestHandler; - /** Accepts all files that comes over the wire. An array of files will be stored in req.files. */ - any(): express.RequestHandler; /** In case you need to handle a text-only multipart form, you can use any of the multer methods (.single(), .array(), fields()), req.body contains the text fields */ any(): express.RequestHandler; } From a3fcaef699dd2c5b127cb8bea9f15c6c39b1b9c4 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Thu, 18 Aug 2016 17:48:06 -0400 Subject: [PATCH 090/105] d3-geo * added definitions and tests --- d3-geo/d3-geo-tests.ts | 625 +++++++++++++++++++++++++++++++++++++++++ d3-geo/index.d.ts | 358 +++++++++++++++++++++++ d3-geo/tsconfig.json | 19 ++ 3 files changed, 1002 insertions(+) create mode 100644 d3-geo/d3-geo-tests.ts create mode 100644 d3-geo/index.d.ts create mode 100644 d3-geo/tsconfig.json diff --git a/d3-geo/d3-geo-tests.ts b/d3-geo/d3-geo-tests.ts new file mode 100644 index 0000000000..2e9f3e8719 --- /dev/null +++ b/d3-geo/d3-geo-tests.ts @@ -0,0 +1,625 @@ +/** + * Typescript definition tests for d3/d3-geo module + * + * Note: These tests are intended to test the definitions only + * in the sense of typing and call signature consistency. They + * are not intended as functional tests. + */ + +import * as d3Geo from 'd3-geo'; +import { Selection } from 'd3-selection'; + +// ---------------------------------------------------------------------- +// Tests setup +// ---------------------------------------------------------------------- + +interface SampleProperties1 { + name: string; +} + +interface SampleProperties2 { + name: string; + value: number; +} + +const samplePolygon: GeoJSON.Polygon = { + type: 'Polygon', + coordinates: [ + [[0, 0], [0, 90], [90, 0], [0, 0]] + ] +}; + +const sampleSphere: d3Geo.GeoSphere = { + type: 'Sphere' +}; + +const sampleGeometryCollection: GeoJSON.GeometryCollection = { + type: 'GeometryCollection', + geometries: [ + samplePolygon, + samplePolygon + ] +}; + +const sampleExtendedGeometryCollection: d3Geo.ExtendedGeometryCollection = { + type: 'GeometryCollection', + geometries: [ + samplePolygon, + sampleSphere + ] +}; + +const sampleFeature: GeoJSON.Feature = { + type: 'Feature', + geometry: samplePolygon, + properties: { + name: 'Alabama' + } +}; + +const sampleExtendedFeature1: d3Geo.ExtendedFeature = { + type: 'Feature', + geometry: samplePolygon, + properties: { + name: 'Alabama' + } +}; + +const sampleExtendedFeature2: d3Geo.ExtendedFeature = { + type: 'Feature', + geometry: sampleSphere, + properties: { + name: 'earth', + value: 42 + } +}; + +const sampleFeatureCollection: GeoJSON.FeatureCollection = { + type: 'FeatureCollection', + features: [ + sampleFeature, + sampleFeature + ] +}; + +const sampleExtendedFeatureCollection: d3Geo.ExtendedFeatureCollection | d3Geo.ExtendedFeature> = { + type: 'FeatureCollection', + features: [ + sampleExtendedFeature1, + sampleExtendedFeature2 + ] +}; + +// ---------------------------------------------------------------------- +// Spherical Math +// ---------------------------------------------------------------------- + +// geoArea(...) ========================================================= + +let area: number = d3Geo.geoArea(samplePolygon); +area = d3Geo.geoArea(sampleSphere); +area = d3Geo.geoArea(sampleGeometryCollection); +area = d3Geo.geoArea(sampleExtendedGeometryCollection); +area = d3Geo.geoArea(sampleFeature); +area = d3Geo.geoArea(sampleExtendedFeature1); +area = d3Geo.geoArea(sampleExtendedFeature2); +area = d3Geo.geoArea(sampleFeatureCollection); +area = d3Geo.geoArea(sampleExtendedFeatureCollection); + +// geoBounds(...) ========================================================= + +let bounds: [[number, number], [number, number]] = d3Geo.geoBounds(samplePolygon); +bounds = d3Geo.geoBounds(sampleSphere); +bounds = d3Geo.geoBounds(sampleGeometryCollection); +bounds = d3Geo.geoBounds(sampleExtendedGeometryCollection); +bounds = d3Geo.geoBounds(sampleFeature); +bounds = d3Geo.geoBounds(sampleExtendedFeature1); +bounds = d3Geo.geoBounds(sampleExtendedFeature2); +bounds = d3Geo.geoBounds(sampleFeatureCollection); +bounds = d3Geo.geoBounds(sampleExtendedFeatureCollection); + +// geoCentroid(...) ======================================================= + +let centroid: [number, number] = d3Geo.geoCentroid(samplePolygon); +centroid = d3Geo.geoCentroid(sampleSphere); +centroid = d3Geo.geoCentroid(sampleGeometryCollection); +centroid = d3Geo.geoCentroid(sampleExtendedGeometryCollection); +centroid = d3Geo.geoCentroid(sampleFeature); +centroid = d3Geo.geoCentroid(sampleExtendedFeature1); +centroid = d3Geo.geoCentroid(sampleExtendedFeature2); +centroid = d3Geo.geoCentroid(sampleFeatureCollection); +centroid = d3Geo.geoCentroid(sampleExtendedFeatureCollection); + +// geoDistance(...) ======================================================= + +let distance: number = d3Geo.geoDistance([54, 2], [53, 1]); + +// geoLength(...) ========================================================= + +let length: number = d3Geo.geoLength(samplePolygon); +length = d3Geo.geoLength(sampleSphere); +length = d3Geo.geoLength(sampleGeometryCollection); +length = d3Geo.geoLength(sampleExtendedGeometryCollection); +length = d3Geo.geoLength(sampleFeature); +length = d3Geo.geoLength(sampleExtendedFeature1); +length = d3Geo.geoLength(sampleExtendedFeature2); +length = d3Geo.geoLength(sampleFeatureCollection); +length = d3Geo.geoLength(sampleExtendedFeatureCollection); + +// geoInterpolate(...) ==================================================== + +let interpolateFct: (t: number) => [number, number] = d3Geo.geoInterpolate([54, 2], [53, 1]); + +// geoRotation(...) ======================================================= + +// create rotation ----------------------------------------------------- + +let rotation: d3Geo.GeoRotation = d3Geo.geoRotation([90, 45]); +let rotation2: d3Geo.GeoRotation = d3Geo.geoRotation([90, 45, 27.5]); + +// use rotation -------------------------------------------------------- + +let point: [number, number] = rotation([54, 2]); +let inverted: [number, number] = rotation.invert([54, 2]); + +// ---------------------------------------------------------------------- +// Spherical Shapes - geoCircle +// ---------------------------------------------------------------------- + +// Create GeoCircleGenerator ============================================ + +// simple use case +let circleGeneratorSimple: d3Geo.GeoCircleGenerator = d3Geo.geoCircle(); + +// complex use as part of object +class Circulator { + + constructor(radius: number, precision: number) { + this.r = radius; + this.p = precision; + this.circleGenerator = d3Geo.geoCircle() + .radius(function (datum) { + let t: Circulator = this; + let d: [number, number] | undefined = datum; + return this.r; + }) + .precision(function (datum) { + let t: Circulator = this; + let d: [number, number] | undefined = datum; + return this.p; + }) + .center(function (datum) { + let t: Circulator = this; + let d: [number, number] | undefined = datum; + return d ? d : [0, 0]; + }); + } + private r: number; + private p: number; + private circleGenerator: d3Geo.GeoCircleGenerator; + + public getCirclePolygon(center?: [number, number]): GeoJSON.Polygon { + if (center && center.length === 2 && typeof center[0] === 'number' && typeof center[1] === 'number') { + return this.circleGenerator(center); + } else { + return this.circleGenerator(); + } + } +} + +let circulator = new Circulator(50, 2); + +// Configure CircleGenerator ============================================ + +// center(...) ---------------------------------------------------------- + +let centerFctSimple: ((this: any, d: any, ...args: any[]) => [number, number]) = circleGeneratorSimple.center(); + +let c: [number, number] = [54, 2]; + +circleGeneratorSimple = circleGeneratorSimple.center(() => c); +circleGeneratorSimple = circleGeneratorSimple.center(c); + +// radius(...) ----------------------------------------------------------- + +let radius: ((...args: any[]) => number) = circleGeneratorSimple.radius(); +circleGeneratorSimple = circleGeneratorSimple.radius(() => 5); +circleGeneratorSimple = circleGeneratorSimple.radius(2); + +// precision(...) -------------------------------------------------------- + +let precision: ((...args: any[]) => number) = circleGeneratorSimple.precision(); +circleGeneratorSimple = circleGeneratorSimple.precision(() => 5); +circleGeneratorSimple = circleGeneratorSimple.precision(2); + +// Use CircleGenerator ==================================================== + +// use simple geoCircleGenerator +let circlePolygon: GeoJSON.Polygon = circleGeneratorSimple(); + +// use encapsulated geoCircleGenerator +circlePolygon = circulator.getCirclePolygon([5, 5]); +circlePolygon = circulator.getCirclePolygon(); + + +// ---------------------------------------------------------------------- +// Spherical Shapes - geoGraticule +// ---------------------------------------------------------------------- + +// Create GeoGraticuleGenerator ========================================= + +let graticuleGenerator: d3Geo.GeoGraticuleGenerator = d3Geo.geoGraticule(); + +// Configure GeoGraticuleGenerator ======================================= + +// extent(...) ----------------------------------------------------------- + +let extent: [[number, number], [number, number]] = graticuleGenerator.extent(); +graticuleGenerator = graticuleGenerator.extent([[-180, -80], [180, 80]]); + +// extentMajor(...) --------------------------------------------------------- + +let extentMajor: [[number, number], [number, number]] = graticuleGenerator.extentMajor(); +graticuleGenerator = graticuleGenerator.extentMajor([[-180, -80], [180, 80]]); + +// extentMinor(...) --------------------------------------------------------- + +let extentMinor: [[number, number], [number, number]] = graticuleGenerator.extentMinor(); +graticuleGenerator = graticuleGenerator.extentMinor([[-180, -80], [180, 80]]); + +// step(...) ---------------------------------------------------------------- + +let step: [number, number] = graticuleGenerator.step(); +graticuleGenerator = graticuleGenerator.step([10, 10]); + +// stepMajor(...) ----------------------------------------------------------- + +let stepMajor: [number, number] = graticuleGenerator.stepMajor(); +graticuleGenerator = graticuleGenerator.stepMajor([10, 10]); + +// stepMinor(...) ------------------------------------------------------------ + +let stepMinor: [number, number] = graticuleGenerator.stepMinor(); +graticuleGenerator = graticuleGenerator.stepMinor([10, 10]); + +// precision(...) ------------------------------------------------------------- + +let precision1: number = graticuleGenerator.precision(); +graticuleGenerator = graticuleGenerator.precision(5); + +// Use GeoGraticuleGenerator ============================================ + +let multiString: GeoJSON.MultiLineString = graticuleGenerator(); +let lines: GeoJSON.LineString[] = graticuleGenerator.lines(); +let polygon2: GeoJSON.Polygon = graticuleGenerator.outline(); + +// ---------------------------------------------------------------------- +// Raw Projections +// ---------------------------------------------------------------------- + +// Pre-Defined Raw Projection Factories ================================= + +let azimuthalEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEqualAreaRaw(); +let azimuthalEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoAzimuthalEquidistantRaw(); +let conicConformalRaw: d3Geo.GeoRawProjection = d3Geo.geoConicConformalRaw(0, 0); +let conicEqualAreaRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEqualAreaRaw(0, 0); +let conicEquidistantRaw: d3Geo.GeoRawProjection = d3Geo.geoConicEquidistantRaw(0, 0); +let equirectangularRaw: d3Geo.GeoRawProjection = d3Geo.geoEquirectangularRaw(); +let gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); +let mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); +let orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); +let stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); +let transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); + +// Use Raw Projection ===================================================== + +let rawProjectionPoint: [number, number] = azimuthalEqualAreaRaw(54, 2); +let rawProjectionInvertedPoint: [number, number] = azimuthalEqualAreaRaw.invert(180, 6); + + + +// ---------------------------------------------------------------------- +// Pre-Defined Projections +// ---------------------------------------------------------------------- + +// Create predefined Projection from factory ============================= + +let albers: d3Geo.GeoConicProjection = d3Geo.geoAlbers(); +let albersUsa: d3Geo.GeoProjection = d3Geo.geoAlbersUsa(); +let azimuthalEqualArea: d3Geo.GeoProjection = d3Geo.geoAzimuthalEqualArea(); +let azimuthalEquidistant: d3Geo.GeoProjection = d3Geo.geoAzimuthalEquidistant(); +let conicConformal: d3Geo.GeoConicProjection = d3Geo.geoConicConformal(); +let conicEqualArea: d3Geo.GeoConicProjection = d3Geo.geoConicEqualArea(); +let conicEquidistant: d3Geo.GeoConicProjection = d3Geo.geoConicEquidistant(); +let cquirectangular: d3Geo.GeoProjection = d3Geo.geoEquirectangular(); +let gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic(); +let mercator: d3Geo.GeoProjection = d3Geo.geoMercator(); +let orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic(); +let stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic(); +let transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator(); + +// ---------------------------------------------------------------------- +// Create New Projections +// ---------------------------------------------------------------------- + + +let geoProjection: d3Geo.GeoProjection = d3Geo.geoProjection(azimuthalEqualAreaRaw); + +let mutate: () => d3Geo.GeoProjection = d3Geo.geoProjectionMutator(() => azimuthalEqualAreaRaw); +let constructedProjection: d3Geo.GeoProjection = mutate(); + +// Use Projection ========================================================== + +let projected: [number, number] = constructedProjection([54, 2]); +let inverted2: [number, number] = constructedProjection.invert([54, 2]); + +// TODO ????? +// let stream: d3Geo.Stream = constructedProjection.stream([54, 2]); + +let clipAngle: number = constructedProjection.clipAngle(); +constructedProjection = constructedProjection.clipAngle(null); +constructedProjection = constructedProjection.clipAngle(45); + +let clipExtent: [[number, number], [number, number]] = constructedProjection.clipExtent(); +constructedProjection = constructedProjection.clipExtent(null); +constructedProjection = constructedProjection.clipExtent([[0, 0], [1, 1]]); + +let scale: number = constructedProjection.scale(); +constructedProjection = constructedProjection.scale(45); + +let translate: [number, number] = constructedProjection.translate(); +constructedProjection = constructedProjection.translate([480, 250]); + +let center: [number, number] = constructedProjection.center(); +constructedProjection = constructedProjection.center([0, 0]); + +let rotate: [number, number, number] = constructedProjection.rotate(); +constructedProjection = constructedProjection.rotate([0, 0]); +constructedProjection = constructedProjection.rotate([0, 0, 0]); + +let precision2: number = constructedProjection.precision(); +constructedProjection = constructedProjection.precision(0.707); + +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], samplePolygon); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleSphere); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleGeometryCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedGeometryCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleFeature); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeature1); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeature2); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleFeatureCollection); +constructedProjection = constructedProjection.fitExtent([[0, 0], [960, 500]], sampleExtendedFeatureCollection); + +constructedProjection = constructedProjection.fitSize([960, 500], samplePolygon); +constructedProjection = constructedProjection.fitSize([960, 500], sampleSphere); +constructedProjection = constructedProjection.fitSize([960, 500], sampleGeometryCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedGeometryCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleFeature); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeature1); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeature2); +constructedProjection = constructedProjection.fitSize([960, 500], sampleFeatureCollection); +constructedProjection = constructedProjection.fitSize([960, 500], sampleExtendedFeatureCollection); + +// ---------------------------------------------------------------------- +// GeoConicProjection interface +// ---------------------------------------------------------------------- + +// parallels(...) ------------------------------------------------------ +let parallels: [number, number] = conicConformal.parallels(); +conicConformal = conicConformal.parallels([20, 20]); + +// test method inheritance from GeoProjection --------------------------- + +conicConformal = conicConformal.fitSize([960, 500], samplePolygon); // inherited + +// ---------------------------------------------------------------------- +// GeoPath Generator +// ---------------------------------------------------------------------- + +// Create geoPath Generator ============================================= + +let geoPathCanvas: d3Geo.GeoPath; +geoPathCanvas = d3Geo.geoPath(); + +let geoPathSVG: d3Geo.GeoPath>; +geoPathSVG = d3Geo.geoPath>(); + +// Configure geoPath Generator ========================================== + +// projection(...) ------------------------------------------------------ + +geoPathCanvas = geoPathCanvas.projection(azimuthalEqualArea); +let geoPathProjectionMinimal: d3Geo.GeoStreamWrapper = geoPathCanvas.projection(); +let geoPathProjectionUnion: d3Geo.GeoProjection | d3Geo.GeoConicProjection | d3Geo.GeoStreamWrapper = geoPathCanvas.projection(); +let geoPathProjection: d3Geo.GeoProjection = geoPathCanvas.projection(); + +geoPathSVG = geoPathSVG.projection(conicConformal); +let geoPathConicProjection: d3Geo.GeoConicProjection = geoPathSVG.projection(); +// geoPathConicProjection = geoPathSVG.projection(); // fails without casting to GeoConicProjection, or alternatively custom typeguard +// geoPathConicProjection = geoPathSVG.projection(); // fails as SampleProperties does not extend minimal interface + +// context(...) ------------------------------------------------------ + +// minimal context interface +geoPathCanvas = geoPathCanvas.context({ + beginPath: () => { return; }, + moveTo: (x: number, y: number) => { return; }, + lineTo: (x: number, y: number) => { return; }, + arc: (x, y, radius, startAngle, endAngle) => { return; }, + closePath: () => { return; } +}); + + +let geoPathContext: d3Geo.GeoContext = geoPathCanvas.context(); + +// reset +geoPathCanvas = geoPathCanvas.context(null); + +// With canvas 2D rendering context +let canvasContext: CanvasRenderingContext2D; + +geoPathCanvas = geoPathCanvas.context(canvasContext); + +canvasContext = geoPathCanvas.context(); +// canvasContext = geoPathSimple.context(); // fails without casting to CanvasRenderingContext2D +// canvasContext = geoPathSimple.context(); // fails as SampleProperties does not extend GeoCanvas + +// pointRadius(...) ------------------------------------------------------ + +geoPathCanvas = geoPathCanvas.pointRadius(5); +let geoPathCanvasPointRadiusAccessor: (this: any, d: d3Geo.GeoPermissibleObjects, ...args: any[]) => number = geoPathCanvas.pointRadius(); + +geoPathSVG = geoPathSVG.pointRadius(function (datum) { + let that: SVGPathElement = this; + let d: d3Geo.ExtendedFeature = datum; + return datum.properties.name === 'Alabama' ? 10 : 15; +}); + +let geoPathSVGPointRadiusAccessor: (this: SVGPathElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number = geoPathSVG.pointRadius(); +// let geoPathSVGPointRadiusAccessorWrong1: (this: SVGCircleElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number = geoPathSVG.pointRadius(); // fails, mismatch in this context +// let geoPathSVGPointRadiusAccessorWrong2: (this: SVGPathElement, d: d3Geo.GeoGeometryObjects, ...args: any[]) => number = geoPathSVG.pointRadius(); // fails, mismatch in object datum type + +// Use geoPath Generator ================================================ + +// area(...) ------------------------------------------------------ + +let geoPathArea: number = geoPathCanvas.area(samplePolygon); +geoPathArea = geoPathCanvas.area(sampleSphere); +geoPathArea = geoPathCanvas.area(sampleGeometryCollection); +geoPathArea = geoPathCanvas.area(sampleExtendedGeometryCollection); +geoPathArea = geoPathCanvas.area(sampleFeature); +geoPathArea = geoPathCanvas.area(sampleExtendedFeature1); +geoPathArea = geoPathCanvas.area(sampleExtendedFeature2); +geoPathArea = geoPathCanvas.area(sampleFeatureCollection); +geoPathArea = geoPathCanvas.area(sampleExtendedFeatureCollection); + +// geoPathArea = geoPathSVG.area(sampleExtendedFeatureCollection); // fails, wrong data object type + + +// bounds(...) ------------------------------------------------------ + +let geoPathBounds: [[number, number], [number, number]] = geoPathCanvas.bounds(samplePolygon); +geoPathBounds = geoPathCanvas.bounds(sampleSphere); +geoPathBounds = geoPathCanvas.bounds(sampleGeometryCollection); +geoPathBounds = geoPathCanvas.bounds(sampleExtendedGeometryCollection); +geoPathBounds = geoPathCanvas.bounds(sampleFeature); +geoPathBounds = geoPathCanvas.bounds(sampleExtendedFeature1); +geoPathBounds = geoPathCanvas.bounds(sampleExtendedFeature2); +geoPathBounds = geoPathCanvas.bounds(sampleFeatureCollection); +geoPathBounds = geoPathCanvas.bounds(sampleExtendedFeatureCollection); + +// geoPathBounds = geoPathSVG.bounds(sampleExtendedFeatureCollection); // fails, wrong data object type + +// centroid(...) ------------------------------------------------------ + +let geoPathCentroid: [number, number] = geoPathCanvas.centroid(samplePolygon); +geoPathCentroid = geoPathCanvas.centroid(sampleSphere); +geoPathCentroid = geoPathCanvas.centroid(sampleGeometryCollection); +geoPathCentroid = geoPathCanvas.centroid(sampleExtendedGeometryCollection); +geoPathCentroid = geoPathCanvas.centroid(sampleFeature); +geoPathCentroid = geoPathCanvas.centroid(sampleExtendedFeature1); +geoPathCentroid = geoPathCanvas.centroid(sampleExtendedFeature2); +geoPathCentroid = geoPathCanvas.centroid(sampleFeatureCollection); +geoPathCentroid = geoPathCanvas.centroid(sampleExtendedFeatureCollection); + +// geoPathCentroid = geoPathSVG.centroid(sampleExtendedFeatureCollection); // fails, wrong data object type + +// render path to context of get path string---------------------------- + +// render to GeoContext/Canvas + +geoPathCanvas(samplePolygon); +geoPathCanvas(sampleSphere); +geoPathCanvas(sampleGeometryCollection); +geoPathCanvas(sampleExtendedGeometryCollection); +geoPathCanvas(sampleFeature); +geoPathCanvas(sampleExtendedFeature1); +geoPathCanvas(sampleExtendedFeature2); +geoPathCanvas(sampleFeatureCollection); +geoPathCanvas(sampleExtendedFeatureCollection); + +// Use path string generator for SVGPathElement + +let svgPath: Selection, any, any>; +svgPath.attr('d', geoPathSVG); + +let svgCircleWrong: Selection, any, any>; +// svgCircleWrong.attr('d', geoPathSVG); // fails, mismatch in `this` context + +let svgPathWrong: Selection; +// svgPathWrong.attr('d', geoPathSVG); // fails, mismatch in datum type + +// ---------------------------------------------------------------------- +// geoClipExtent +// ---------------------------------------------------------------------- + +let geoClipExtent: d3Geo.GeoExtent = d3Geo.geoClipExtent(); + +// extent(...) ---------------------------------------------------------- + +let extent2: [[number, number], [number, number]] = geoClipExtent.extent(); +geoClipExtent = geoClipExtent.extent([[0, 0], [960, 500]]); + +// stream(...) ---------------------------------------------------------- + +let stream: d3Geo.GeoStream; +stream = geoClipExtent.stream(stream); + +// ---------------------------------------------------------------------- +// Stream interface +// ---------------------------------------------------------------------- + +stream.point(0, 0); +stream.point(0, 0, 0); +stream.lineStart(); +stream.lineEnd(); +stream.polygonStart(); +stream.polygonEnd(); +stream.sphere(); + +// ---------------------------------------------------------------------- +// Context interface +// ---------------------------------------------------------------------- +let context: d3Geo.GeoContext = { + beginPath: () => { return; }, + moveTo: (x: number, y: number) => { return; }, + lineTo: (x: number, y: number) => { return; }, + arc: (x, y, radius, startAngle, endAngle) => { return; }, + closePath: () => { return; } +}; + +// ---------------------------------------------------------------------- +// Projection Streams +// ---------------------------------------------------------------------- + +// geoTransform(...) ==================================================== + +let transformFunction: { stream: (s: d3Geo.GeoStream) => {} } = d3Geo.geoTransform({}); + +interface CustomTranformProto extends d3Geo.GeoTransformPrototype { + a: number; +} + +let customTransformProto: CustomTranformProto; + +customTransformProto = { + point: function (x, y) { + return this.stream.point(x + this.a, -y); + }, + a: 10 +}; + +let t: { stream: (s: d3Geo.GeoStream) => (CustomTranformProto & d3Geo.GeoStream) } = d3Geo.geoTransform(customTransformProto); + +// geoStream(...) ======================================================== + +d3Geo.geoStream(samplePolygon, stream); +d3Geo.geoStream(sampleSphere, stream); +d3Geo.geoStream(sampleGeometryCollection, stream); +d3Geo.geoStream(sampleExtendedGeometryCollection, stream); +d3Geo.geoStream(sampleFeature, stream); +d3Geo.geoStream(sampleExtendedFeature1, stream); +d3Geo.geoStream(sampleExtendedFeature2, stream); +d3Geo.geoStream(sampleFeatureCollection, stream); +d3Geo.geoStream(sampleExtendedFeatureCollection, stream); + diff --git a/d3-geo/index.d.ts b/d3-geo/index.d.ts new file mode 100644 index 0000000000..beac52518d --- /dev/null +++ b/d3-geo/index.d.ts @@ -0,0 +1,358 @@ +// Type definitions for D3JS d3-geo module 1.2.0 +// Project: https://github.com/d3/d3-geo/ +// Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// ---------------------------------------------------------------------- +// Shared Interfaces and Types +// ---------------------------------------------------------------------- + +/** + * A basic geometry for a sphere, which is supported by d3-geo + * beyond the GeoJSON geometries. + */ +export interface GeoSphere { + type: 'Sphere'; +} + +/** + * Type Alias for GeoJSON Geometry Object and GeoSphere additional + * geometry supported by d3-geo + */ +export type GeoGeometryObjects = GeoJSON.GeometryObject | GeoSphere; + +/** + * A GeoJSON-style GeometryCollection which supports GeoJSON geometry objects + * and additionally GeoSphere + */ +export interface ExtendedGeometryCollection { + type: string; + bbox?: number[]; + crs?: GeoJSON.CoordinateReferenceSystem; + geometries: GeometryType[]; +} + +/** + * A GeoJSON-style Feature which support features built on GeoJSON GeometryObjects + * or GeoSphere + */ +export interface ExtendedFeature extends GeoJSON.GeoJsonObject { + geometry: GeometryType; + properties: Properties; + id?: string; +} + +/** + * A GeoJSON-style FeatureCollection which supports GeoJSON features + * and features built on GeoSphere + */ +export interface ExtendedFeatureCollection> extends GeoJSON.GeoJsonObject { + features: FeatureType[]; +} + +/** + * Type Alias for permissible objects which can be used with d3-geo + * methods + */ +export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollection | ExtendedFeature | ExtendedFeatureCollection>; + +// ---------------------------------------------------------------------- +// Spherical Math +// ---------------------------------------------------------------------- + +/**Returns the spherical area of the specified GeoJSON feature in steradians. */ +export function geoArea(feature: ExtendedFeature): number; +export function geoArea(feature: ExtendedFeatureCollection>): number; +export function geoArea(feature: GeoGeometryObjects): number; +export function geoArea(feature: ExtendedGeometryCollection): number; + +/**Returns the spherical bounding box for the specified GeoJSON feature. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. */ +export function geoBounds(feature: ExtendedFeature): [[number, number], [number, number]]; +export function geoBounds(feature: ExtendedFeatureCollection>): [[number, number], [number, number]]; +export function geoBounds(feature: GeoGeometryObjects): [[number, number], [number, number]]; +export function geoBounds(feature: ExtendedGeometryCollection): [[number, number], [number, number]]; + +/**Returns the spherical centroid of the specified GeoJSON feature. See also path.centroid, which computes the projected planar centroid.*/ +export function geoCentroid(feature: ExtendedFeature): [number, number]; +export function geoCentroid(feature: ExtendedFeatureCollection>): [number, number]; +export function geoCentroid(feature: GeoGeometryObjects): [number, number]; +export function geoCentroid(feature: ExtendedGeometryCollection): [number, number]; + +/**Returns the great-arc distance in radians between the two points a and b. Each point must be specified as a two-element array [longitude, latitude] in degrees. */ +export function geoDistance(a: [number, number], b: [number, number]): number; + +/**Returns the great-arc length of the specified GeoJSON feature in radians.*/ +export function geoLength(feature: ExtendedFeature): number; +export function geoLength(feature: ExtendedFeatureCollection>): number; +export function geoLength(feature: GeoGeometryObjects): number; +export function geoLength(feature: ExtendedGeometryCollection): number; + +/**Returns an interpolator function given two points a and b. Each point must be specified as a two-element array [longitude, latitude] in degrees. */ +export function geoInterpolate(a: [number, number], b: [number, number]): (t: number) => [number, number]; + + +export interface GeoRotation { + (point: [number, number]): [number, number]; + invert(point: [number, number]): [number, number]; +} + +/**Returns a rotation function for the given angles, which must be a two- or three-element array of numbers [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. */ +export function geoRotation(angles: [number, number] | [number, number, number]): GeoRotation; + + +// ---------------------------------------------------------------------- +// Spherical Shapes +// ---------------------------------------------------------------------- + +// geoCircle ============================================================ + +export interface GeoCircleGenerator { + /**Returns a new GeoJSON geometry object of type “Polygon” approximating a circle on the surface of a sphere, with the current center, radius and precision. */ + (this: This, d?: Datum, ...args: any[]): GeoJSON.Polygon; + center(): ((this: This, d: Datum, ...args: any[]) => [number, number]); + center(center: [number, number]): this; + center(center: ((this: This, d: Datum, ...args: any[]) => [number, number])): this; + + radius(): ((this: This, d: Datum, ...args: any[]) => number); + radius(radius: number): this; + radius(radius: ((this: This, d: Datum, ...args: any[]) => number)): this; + + precision(): ((this: This, d: Datum, ...args: any[]) => number); + precision(precision: number): this; + precision(precision: (this: This, d: Datum, ...args: any[]) => number): this; +} + +export function geoCircle(): GeoCircleGenerator; +export function geoCircle(): GeoCircleGenerator; +export function geoCircle(): GeoCircleGenerator; + +// geoGraticule ============================================================ + +export interface GeoGraticuleGenerator { + /**Returns a GeoJSON MultiLineString geometry object representing all meridians and parallels for this graticule. */ + (): GeoJSON.MultiLineString; + + lines(): GeoJSON.LineString[]; + outline(): GeoJSON.Polygon; + extent(): [[number, number], [number, number]]; + extent(extent: [[number, number], [number, number]]): this; + extentMajor(): [[number, number], [number, number]]; + extentMajor(extent: [[number, number], [number, number]]): this; + extentMinor(): [[number, number], [number, number]]; + extentMinor(extent: [[number, number], [number, number]]): this; + step(): [number, number]; + step(step: [number, number]): this; + stepMajor(): [number, number]; + stepMajor(step: [number, number]): this; + stepMinor(): [number, number]; + stepMinor(step: [number, number]): this; + precision(): number; + precision(angle: number): this; +} + +export function geoGraticule(): GeoGraticuleGenerator; + +// ---------------------------------------------------------------------- +// Projections +// ---------------------------------------------------------------------- + +export interface GeoStream { + lineEnd(): void; + lineStart(): void; + point(x: number, y: number, z?: number): void; + polygonEnd(): void; + polygonStart(): void; + sphere?(): void; +} + +export interface GeoStreamWrapper { + stream(stream: GeoStream): GeoStream; +} + + +export interface GeoRawProjection { + (longitude: number, latitude: number): [number, number]; + invert?(x: number, y: number): [number, number]; +} + + +export interface GeoProjection extends GeoStreamWrapper { + /**Returns a new array x, y representing the projected point of the given point. The point must be specified as a two-element array [longitude, latitude] in degrees. */ + (point: [number, number]): [number, number] | null; + + center(): [number, number]; + center(point: [number, number]): this; + + clipAngle(): number | null; + clipAngle(angle: null): this; + clipAngle(angle: number): this; + + clipExtent(): [[number, number], [number, number]] | null; + clipExtent(extent: null): this; + clipExtent(extent: [[number, number], [number, number]]): this; + + /**Sets the projection’s scale and translate to fit the specified GeoJSON object in the center of the given extent. */ + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; + fitExtent(extent: [[number, number], [number, number]], object: GeoGeometryObjects): this; + fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; + + + /**A convenience method for projection.fitExtent where the top-left corner of the extent is [0,0]. */ + fitSize(size: [number, number], object: ExtendedFeature): this; + fitSize(size: [number, number], object: ExtendedFeatureCollection>): this; + fitSize(size: [number, number], object: GeoGeometryObjects): this; + fitSize(size: [number, number], object: ExtendedGeometryCollection): this; + + /**Returns a new array [longitude, latitude] in degrees representing the unprojected point of the given projected point. */ + invert?(point: [number, number]): [number, number] | null; + + precision(): number; + precision(precision: number): this; + + rotate(): [number, number, number]; + rotate(angles: [number, number] | [number, number, number]): this; + + scale(): number; + scale(scale: number): this; + + translate(): [number, number]; + translate(point: [number, number]): this; +} + +export interface GeoConicProjection extends GeoProjection { + parallels(value: [number, number]): this; + parallels(): [number, number]; +} + + +// geoPath ============================================================== + +export interface GeoContext { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; + beginPath(): void; + closePath(): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; +} + +export interface GeoPath { + + (this: This, object: DatumObject, ...args: any[]): string; + + area(object: DatumObject): number; + bounds(object: DatumObject): [[number, number], [number, number]]; + centroid(object: DatumObject): [number, number]; + context(): C | null; + context(context: GeoContext | null): this; + + /** + * Get the current projection. The generic parameter can be used to cast the result to the + * correct, known type of the projection, e.g. GeoProjection or GeoConicProjection. Otherwise, + * the return type defaults to the minimum type requirement for a projection which + * can be passed into a GeoPath. + */ + projection

(): P | null; + + /** + * Set the projection to the identity projection + */ + projection(projection: null): this; + + /** + * Set the projection to be used with the geo path generator. + */ + projection(projection: GeoProjection): this; + + /** + * Set the projection to be used with the geo path generator to a custom projection. + * Custom projections must minimally contain a stream method. + */ + projection(projection: GeoStreamWrapper): this; + + pointRadius(): (this: This, object: DatumObject, ...args: any[]) => number; + pointRadius(value: number): this; + pointRadius(value: (this: This, object: DatumObject, ...args: any[]) => number): this; + +} + +export function geoPath(): GeoPath; +export function geoPath(): GeoPath; +export function geoPath(): GeoPath; + +// Raw Projections ======================================================== + +export function geoAzimuthalEqualAreaRaw(): GeoRawProjection; +export function geoAzimuthalEquidistantRaw(): GeoRawProjection; +export function geoConicConformalRaw(phi0: number, phi1: number): GeoRawProjection; +export function geoConicEqualAreaRaw(phi0: number, phi1: number): GeoRawProjection; +export function geoConicEquidistantRaw(phi0: number, phi1: number): GeoRawProjection; +export function geoEquirectangularRaw(): GeoRawProjection; +export function geoGnomonicRaw(): GeoRawProjection; +export function geoMercatorRaw(): GeoRawProjection; +export function geoOrthographicRaw(): GeoRawProjection; +export function geoStereographicRaw(): GeoRawProjection; +export function geoTransverseMercatorRaw(): GeoRawProjection; + +// geoProjection ========================================================== + +export function geoProjection(project: GeoRawProjection): GeoProjection; + +// geoProjectionMutator ==================================================== + +export function geoProjectionMutator(factory: (...args: any[]) => GeoRawProjection): () => GeoProjection; + +// Pre-Defined Projections ================================================= + +export function geoAlbers(): GeoConicProjection; +export function geoAlbersUsa(): GeoProjection; +export function geoAzimuthalEqualArea(): GeoProjection; +export function geoAzimuthalEquidistant(): GeoProjection; +export function geoConicConformal(): GeoConicProjection; +export function geoConicEqualArea(): GeoConicProjection; +export function geoConicEquidistant(): GeoConicProjection; +export function geoEquirectangular(): GeoProjection; +export function geoGnomonic(): GeoProjection; +export function geoMercator(): GeoProjection; +export function geoOrthographic(): GeoProjection; +export function geoStereographic(): GeoProjection; +export function geoTransverseMercator(): GeoProjection; + +// geoClipExtent ============================================================= + +export interface GeoExtent { + extent(): [[number, number], [number, number]]; + extent(extent: [[number, number], [number, number]]): this; + stream(stream: GeoStream): GeoStream; +} + + +export function geoClipExtent(): GeoExtent; + +// ---------------------------------------------------------------------- +// Projection Streams +// ---------------------------------------------------------------------- + +// geoTransform(...) ==================================================== + +export interface GeoTransformPrototype { + lineEnd?(this: this & { stream: GeoStream }): void; + lineStart?(this: this & { stream: GeoStream }): void; + point?(this: this & { stream: GeoStream }, x: number, y: number, z?: number): void; + polygonEnd?(this: this & { stream: GeoStream }): void; + polygonStart?(this: this & { stream: GeoStream }): void; + sphere?(this: this & { stream: GeoStream }): void; +} +// TODO: Review whether GeoStreamWrapper should be included into return value union type, i.e. ({ stream: (s: GeoStream) => (T & GeoStream & GeoStreamWrapper)})? +// It probably should be omitted for purposes of this API. The stream method added to (T & GeoStream) is more of a private member used internally to +// implement the Transform factory +export function geoTransform(prototype: T): { stream: (s: GeoStream) => (T & GeoStream) }; + +// geoStream(...) ======================================================= + +export function geoStream(object: ExtendedFeature, stream: GeoStream): void; +export function geoStream(object: ExtendedFeatureCollection>, stream: GeoStream): void; +export function geoStream(object: GeoGeometryObjects, stream: GeoStream): void; +export function geoStream(object: ExtendedGeometryCollection, stream: GeoStream): void; diff --git a/d3-geo/tsconfig.json b/d3-geo/tsconfig.json new file mode 100644 index 0000000000..2ec957f5d4 --- /dev/null +++ b/d3-geo/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "d3-geo-tests.ts" + ] +} From 2a10e28ad4f99ca96641450e3f879e61a33ef6f5 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Thu, 18 Aug 2016 16:39:16 -0700 Subject: [PATCH 091/105] New typings migrated to 2.0 --- auth0-js/auth0-js-tests.ts | 23 + auth0-js/index.d.ts | 132 ++++++ auth0-js/tsconfig.json | 19 + db-migrate-base/db-migrate-base-tests.ts | 321 ++++++++++++++ db-migrate-base/index.d.ts | 147 +++++++ db-migrate-base/tsconfig.json | 19 + db-migrate-pg/db-migrate-pg-tests.ts | 410 ++++++++++++++++++ db-migrate-pg/index.d.ts | 54 +++ db-migrate-pg/tsconfig.json | 19 + electron-notify/electron-notify-tests.ts | 24 + electron-notify/index.d.ts | 60 +++ electron-notify/tsconfig.json | 19 + mock-require/index.d.ts | 31 ++ mock-require/mock-require-tests.ts | 45 ++ mock-require/tsconfig.json | 19 + react/react-tests.ts | 2 +- react/react-tsx-tests.tsx | 15 + react/tsconfig.json | 6 +- redis-rate-limiter/index.d.ts | 33 ++ .../redis-rate-limiter-tests.ts | 37 ++ redis-rate-limiter/tsconfig.json | 19 + redis-scripto/index.d.ts | 35 ++ redis-scripto/redis-scripto-tests.ts | 34 ++ redis-scripto/tsconfig.json | 19 + simple-assign/index.d.ts | 13 + simple-assign/simple-assign-tests.ts | 14 + simple-assign/tsconfig.json | 19 + 27 files changed, 1585 insertions(+), 3 deletions(-) create mode 100644 auth0-js/auth0-js-tests.ts create mode 100644 auth0-js/index.d.ts create mode 100644 auth0-js/tsconfig.json create mode 100644 db-migrate-base/db-migrate-base-tests.ts create mode 100644 db-migrate-base/index.d.ts create mode 100644 db-migrate-base/tsconfig.json create mode 100644 db-migrate-pg/db-migrate-pg-tests.ts create mode 100644 db-migrate-pg/index.d.ts create mode 100644 db-migrate-pg/tsconfig.json create mode 100644 electron-notify/electron-notify-tests.ts create mode 100644 electron-notify/index.d.ts create mode 100644 electron-notify/tsconfig.json create mode 100644 mock-require/index.d.ts create mode 100644 mock-require/mock-require-tests.ts create mode 100644 mock-require/tsconfig.json create mode 100644 react/react-tsx-tests.tsx create mode 100644 redis-rate-limiter/index.d.ts create mode 100644 redis-rate-limiter/redis-rate-limiter-tests.ts create mode 100644 redis-rate-limiter/tsconfig.json create mode 100644 redis-scripto/index.d.ts create mode 100644 redis-scripto/redis-scripto-tests.ts create mode 100644 redis-scripto/tsconfig.json create mode 100644 simple-assign/index.d.ts create mode 100644 simple-assign/simple-assign-tests.ts create mode 100644 simple-assign/tsconfig.json diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts new file mode 100644 index 0000000000..197256ddd5 --- /dev/null +++ b/auth0-js/auth0-js-tests.ts @@ -0,0 +1,23 @@ +/// + +var auth0 = new Auth0({ + domain: 'mine.auth0.com', + clientID: 'dsa7d77dsa7d7', + callbackURL: 'http://my-app.com/callback', + callbackOnLocationHash: true +}); + +auth0.login({ + connection: 'google-oauth2', + popup: true, + popupOptions: { + width: 450, + height: 800 + } +}, (err, profile, idToken, accessToken, state) => { + if (err) { + alert("something went wrong: " + err.message); + return; + } + alert('hello ' + profile.name); + }); diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts new file mode 100644 index 0000000000..50041bb5d1 --- /dev/null +++ b/auth0-js/index.d.ts @@ -0,0 +1,132 @@ +// Type definitions for Auth0.js +// Project: https://github.com/auth0/auth0.js +// Definitions by: Robert McLaws +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** Extensions to the browser Window object. */ +interface Window { + /** Allows you to pass the id_token to other APIs, as specified in https://docs.auth0.com/apps-apis */ + token: string; +} + +/** This is the interface for the main Auth0 client. */ +interface Auth0Static { + + new(options: Auth0ClientOptions): Auth0Static; + changePassword(options: any, callback?: Function): void; + decodeJwt(jwt: string): any; + login(options: any, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void; + loginWithPopup(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void; + loginWithResourceOwner(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: any) => any): void; + loginWithUsernamePassword(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void; + logout(query: string): void; + getConnections(callback?: Function): void; + refreshToken(refreshToken: string, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; + getDelegationToken(targetClientId: string, id_token: string, options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; + getProfile(id_token: string, callback?: Function): Auth0UserProfile; + getSSOData(withActiveDirectories: any, callback?: Function): void; + parseHash(hash: string): Auth0DecodedHash; + signup(options: Auth0SignupOptions, callback: Function): void; + validateUser(options: any, callback: (error?: Auth0Error, valid?: any) => any): void; +} + +/** Represents constructor options for the Auth0 client. */ +interface Auth0ClientOptions { + clientID: string; + callbackURL: string; + callbackOnLocationHash?: boolean; + domain: string; + forceJSONP?: boolean; +} + +/** Represents a normalized UserProfile. */ +interface Auth0UserProfile { + email: string; + family_name: string; + gender: string; + given_name: string; + locale: string; + name: string; + nickname: string; + picture: string; + user_id: string; + /** Represents one or more Identities that may be associated with the User. */ + identities: Auth0Identity[]; + user_metadata?: any; + app_metadata?: any; +} + +/** Represents an Auth0UserProfile that has a Microsoft Account as the primary identity. */ +interface MicrosoftUserProfile extends Auth0UserProfile { + emails: string[]; +} + +/** Represents an Auth0UserProfile that has an Office365 account as the primary identity. */ +interface Office365UserProfile extends Auth0UserProfile { + tenantid: string; + upn: string; +} + +/** Represents an Auth0UserProfile that has an Active Directory account as the primary identity. */ +interface AdfsUserProfile extends Auth0UserProfile { + issuer: string; +} + +/** Represents multiple identities assigned to a user. */ +interface Auth0Identity { + access_token: string; + connection: string; + isSocial: boolean; + provider: string; + user_id: string; +} + +interface Auth0DecodedHash { + access_token: string; + id_token: string; + profile: Auth0UserProfile; + state: any; +} + +interface Auth0PopupOptions { + width: number; + height: number; +} + +interface Auth0LoginOptions { + auto_login?: boolean; + connection?: string; + email?: string; + username?: string; + password?: string; + popup?: boolean; + popupOptions?: Auth0PopupOptions; +} + +interface Auth0SignupOptions extends Auth0LoginOptions { + auto_login: boolean; +} + +interface Auth0Error { + code: any; + details: any; + name: string; + message: string; + status: any; +} + +/** Represents the response from an API Token Delegation request. */ +interface Auth0DelegationToken { + /** The length of time in seconds the token is valid for. */ + expires_in: string; + /** The JWT for delegated access. */ + id_token: string; + /** The type of token being returned. Possible values: "Bearer" */ + token_type: string; +} + +declare const Auth0: Auth0Static; + +declare module "auth0" { + export = Auth0 +} diff --git a/auth0-js/tsconfig.json b/auth0-js/tsconfig.json new file mode 100644 index 0000000000..7a0a649c3b --- /dev/null +++ b/auth0-js/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "auth0-js-tests.ts" + ] +} \ No newline at end of file diff --git a/db-migrate-base/db-migrate-base-tests.ts b/db-migrate-base/db-migrate-base-tests.ts new file mode 100644 index 0000000000..79d81a75f9 --- /dev/null +++ b/db-migrate-base/db-migrate-base-tests.ts @@ -0,0 +1,321 @@ +// Test file for db-migrate-base Definition file + +import * as DbMigrateBase from "db-migrate-base"; + +// Throw together a dummy driver +let db = {}; + +let callback = (err: any, response: any) => { + // Do nothing. +}; + +/// createTable(tableName, columnSpec, callback) +db.createTable('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}, callback); + +db.createTable('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}, callback); + +/// dropTable(tableName, [options,] callback) +db.dropTable('pets', callback); + +db.dropTable('pets', { ifExists: true }, callback); + +/// renameTable(tableName, newTableName, callback) +db.renameTable('pets', 'pets_OLD', callback); + +/// addColumn(tableName, columnName, columnSpec, callback) +db.addColumn('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}, callback); + +db.addColumn('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}, callback); + +/// renameColumn(tableName, oldColumnName, newColumnName, callback) +db.renameColumn('pets', 'id', 'pet_id', callback); + +/// changeColumn(tableName, columnName, columnSpec, callback) +db.changeColumn('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}, callback); + +/// addIndex(tableName, indexName, columns, [unique,] callback) +db.addIndex('pets', 'pets_eye_color_idx', ['eye_color'], callback); +db.addIndex('pets', 'pets_registration_code_idx', ['registration_code'], true, callback); + +/// addForeignKey(tableName, referencedTableName, keyName, fieldMapping, rules, callback) +db.addForeignKey('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}, callback); + +/// removeForeignKey(tableName, keyName, options, callback) +db.removeForeignKey('module_user', 'module_uer_module_id_foreign', callback); +db.removeForeignKey('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}, callback); + +/// insert(tableName, [columnNameArray,] valueArray, callback) +db.insert('module_user', ['first_name', 'last_name'], ['Test', 'Testerson'], callback); +db.insert('module_user', ['Test', 'Testerson'], callback); + +/// removeIndex([tableName,] indexName, callback) +db.removeIndex('pets', 'pets_eye_color_idx', callback); +db.removeIndex('pets_eye_color_idx', callback); + +/// runSql(sql, [params,] callback) +db.runSql('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +], callback); +db.runSql('DROP TABLE `pets`', callback); + +/// all(sql, [params,] callback) +db.all('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test'], callback); +db.all('SELECT * FROM `module_user`', callback); + +/// ========= +/// Async +/// ========= + +let onResolve = (result: any) => {}; + +/// createTableAsync(tableName, columnSpec) +db.createTableAsync('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}).then(onResolve); + +db.createTableAsync('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}).then(onResolve); + +/// dropTableAsync(tableName, [options]) +db.dropTableAsync('pets').then(onResolve); +db.dropTableAsync('pets', { ifExists: true }).then(onResolve); + +/// renameTableAsync(tableName, newTableName) +db.renameTableAsync('pets', 'pets_OLD').then(onResolve); + +/// addColumnAsync(tableName, columnName, columnSpec) +db.addColumnAsync('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}).then(onResolve); + +db.addColumnAsync('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}).then(onResolve); + +/// renameColumnAsync(tableName, oldColumnName, newColumnName) +db.renameColumnAsync('pets', 'id', 'pet_id').then(onResolve); + +/// changeColumnAsync(tableName, columnName, columnSpec) +db.changeColumnAsync('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}).then(onResolve); + +/// addIndexAsync(tableName, indexName, columns, [unique]) +db.addIndexAsync('pets', 'pets_eye_color_idx', ['eye_color']).then(onResolve); +db.addIndexAsync('pets', 'pets_registration_code_idx', ['registration_code'], true).then(onResolve); + +/// addForeignKeyAsync(tableName, referencedTableName, keyName, fieldMapping, rules) +db.addForeignKeyAsync('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}).then(onResolve); + +/// removeForeignKeyAsync(tableName, keyName, options) +db.removeForeignKeyAsync('module_user', 'module_uer_module_id_foreign').then(onResolve); +db.removeForeignKeyAsync('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}).then(onResolve); + +/// insertAsync(tableName, [columnNameArray,] valueArray) +db.insertAsync('module_user', ['first_name', 'last_name'], ['Test', 'Testerson']).then(onResolve); +db.insertAsync('module_user', ['Test', 'Testerson']).then(onResolve); + +/// removeIndexAsync([tableName,] indexName) +db.removeIndexAsync('pets', 'pets_eye_color_idx').then(onResolve); +db.removeIndexAsync('pets_eye_color_idx').then(onResolve); + +/// runSqlAsync(sql, [params]) +db.runSqlAsync('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +]).then(onResolve); +db.runSqlAsync('DROP TABLE `pets`').then(onResolve); + +/// allAsync(sql, [params]) +db.allAsync('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test']).then(onResolve); +db.allAsync('SELECT * FROM `module_user`').then(onResolve); \ No newline at end of file diff --git a/db-migrate-base/index.d.ts b/db-migrate-base/index.d.ts new file mode 100644 index 0000000000..de3a4c0812 --- /dev/null +++ b/db-migrate-base/index.d.ts @@ -0,0 +1,147 @@ +// Type definitions for db-migrate-base +// Project: https://github.com/db-migrate/db-migrate-base +// Definitions by: nickiannone +// Definitions: https://github.com/nickiannone/DefinitelyTyped + +/// + +import * as Promise from "bluebird"; + +export interface CallbackFunction { (err: any, response: any): void; } + +export interface InternalModule { + log: any; + type: any; +} + +export interface InternalOptions { + mod: InternalModule; +} + +export interface ColumnSpec { + length?: number; + type: string; + unsigned?: boolean; + primaryKey?: boolean; + autoIncrement?: boolean; + notNull?: boolean; + unique?: boolean; + defaultValue?: any; + foreignKey?: ForeignKeySpec; +} + +export interface ForeignKeySpec { + name: string; + table: string; + rules?: ForeignKeyRules; + mapping: string | any; +} + +export interface ForeignKeyRules { + onDelete: string; + onUpdate: string; +} + +export interface RemoveForeignKeyOptions { + dropIndex?: boolean; +} + +export interface ColumnDef { + foreignKey?: any; // TODO Figure this out! + constraints: string; +} + +export interface CreateTableOptions { + columns?: Array; + ifNotExists?: boolean; +} + +export interface DropTableOptions { + ifExists?: boolean; +} + +export class Base { + constructor(intern: InternalOptions); + + close(callback?: CallbackFunction): void; + mapDataType(str: string): string; + truncate(tableName: string, callback: CallbackFunction): void; + checkDBMS(dbms: any, callback: CallbackFunction): void; + createDatabase(...options: any[]): void; + switchDatabase(...options: any[]): void; + dropDatabase(...options: any[]): void; + recurseCallbackArray(foreignKeys: Array, callback: CallbackFunction): void; + bindForeignKey(tableName: string, columnName: string, fkOptions: ForeignKeySpec): (callback: CallbackFunction) => void; + createColumnDef(name: string, spec: ColumnSpec, options?: any): ColumnDef; // TODO Figure out a type for `options`! + //createColumnConstraint(spec: ColumnSpec, options?: any, ...implementationDefinedOptions: any[]): string; + createMigrationsTable(callback: CallbackFunction): void; + createSeedsTable(callback: CallbackFunction): void; + createTable(tableName: string, options: any | CreateTableOptions, callback: CallbackFunction): void; + dropTable(tableName: string, optionsOrCb?: DropTableOptions | CallbackFunction, callback?: CallbackFunction): void; + renameTable(tableName: string, newTableName: string, callback: CallbackFunction): void; + addColumn(tableName: string, columnName: string, columnSpec: ColumnSpec, callback: CallbackFunction): void; + removeColumn(tableName: string, columnName: string, callback: CallbackFunction): void; + renameColumn(tableName: string, oldColumnName: string, newColumnName: string, callback: CallbackFunction): void; + changeColumn(tableName: string, columnName: string, columnSpec: ColumnSpec, callback: CallbackFunction): void; + quoteDDLArr(arr: Array): Array; + quoteArr(arr: Array): Array; + addIndex(tableName: string, indexName: string, columns: string | Array, uniqueOrCb?: boolean | CallbackFunction, callback?: CallbackFunction): void; + insert(tableName: string, columnNameOrValueArray: any, valueArrayOrCb?: any | CallbackFunction, callback?: CallbackFunction): void; + update(tableName: string, columnNameOrValueArray: any, valueArrayOrIds?: any, idsOrCb?: any | CallbackFunction, callback?: CallbackFunction): void; + lookup(tableName: string, column: string, id?: any, callback?: CallbackFunction): void; + removeIndex(tableNameOrIndexName: string, indexNameOrCb?: string | CallbackFunction, callback?: CallbackFunction): void; + addForeignKey(tableName: string, referencedTableName: string, keyName: string, fieldMapping: any, rules: ForeignKeyRules, callback: CallbackFunction): void; + removeForeignKey(tableName: string, keyName: string, optionsOrCb?: RemoveForeignKeyOptions | CallbackFunction, callback?: CallbackFunction): void; + normalizeColumnSpec(spec: string | ColumnSpec): ColumnSpec; + addMigrationRecord(name: string, callback: CallbackFunction): void; + addSeedRecord(name: string, callback: CallbackFunction): void; + startMigration(callback: CallbackFunction): void; + endMigration(callback: CallbackFunction): void; + runSql(sql?: string, paramsOrCb?: Array | CallbackFunction, callback?: CallbackFunction): void; + allLoadedMigrations(callback: CallbackFunction): void; + allLoadedSeeds(callback: CallbackFunction): void; + deleteMigration(migrationName: string, callback: CallbackFunction): void; + remove(table: string, ids: any, callback: CallbackFunction): void; // TODO Make ids match the type of ids in buildWhereClause(ids); + buildWhereClause(ids: any): string; + deleteSeed(seedName: string, callback: CallbackFunction): void; + all(sql: string, paramsOrCb?: Array | CallbackFunction, callback?: CallbackFunction): void; + escape(str: string): string; + escapeString(str: string): string; + escapeDDL(str: string): string; + + // Promisified methods + closeAsync(): Promise; + truncateAsync(tableName: string): Promise; + checkDBMSAsync(dbms: any): Promise; + createDatabaseAsync(...options: any[]): Promise; + switchDatabaseAsync(...options: any[]): Promise; + dropDatabaseAsync(...options: any[]): Promise; + recurseCallbackArrayAsync(foreignKeys: Array): Promise; + createMigrationsTableAsync(): Promise; + createSeedsTableAsync(): Promise; + createTableAsync(tableName: string, options: any | CreateTableOptions): Promise; + dropTableAsync(tableName: string, options?: DropTableOptions): Promise; + renameTableAsync(tableName: string, newTableName: string): Promise; + addColumnAsync(tableName: string, columnName: string, columnSpec: ColumnSpec): Promise; + removeColumnAsync(tableName: string, columnName: string): Promise; + renameColumnAsync(tableName: string, oldColumnName: string, newColumnName: string): Promise; + changeColumnAsync(tableName: string, columnName: string, columnSpec: ColumnSpec): Promise; + addIndexAsync(tableName: string, indexName: string, columns: string | Array, unique?: boolean): Promise; + insertAsync(tableName: string, columnNameOrValueArray: any, valueArrayOrCb?: any | CallbackFunction, callback?: CallbackFunction): Promise; + updateAsync(tableName: string, columnNameOrValueArray: any, valueArrayOrIds?: any, idsOrCb?: any | CallbackFunction, callback?: CallbackFunction): Promise; + lookupAsync(tableName: string, column: string, id?: any, callback?: CallbackFunction): Promise; + removeIndexAsync(tableNameOrIndexName: string, indexName?: string): Promise; + addForeignKeyAsync(tableName: string, referencedTableName: string, keyName: string, fieldMapping: any, rules: ForeignKeyRules): Promise; + removeForeignKeyAsync(tableName: string, keyName: string, options?: RemoveForeignKeyOptions): Promise; + addMigrationRecordAsync(name: string): Promise; + addSeedRecordAsync(name: string): Promise; + startMigrationAsync(): Promise; + endMigrationAsync(callback: CallbackFunction): Promise; + runSqlAsync(sql?: string, params?: Array): Promise; + allLoadedMigrationsAsync(): Promise; + allLoadedSeedsAsync(): Promise; + deleteMigrationAsync(migrationName: string): Promise; + removeAsync(table: string, ids: any): Promise; + deleteSeedAsync(seedName: string): Promise; + allAsync(sql: string, params?: Array): Promise; +} \ No newline at end of file diff --git a/db-migrate-base/tsconfig.json b/db-migrate-base/tsconfig.json new file mode 100644 index 0000000000..9ddd2792ec --- /dev/null +++ b/db-migrate-base/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "db-migrate-base-tests.ts" + ] +} \ No newline at end of file diff --git a/db-migrate-pg/db-migrate-pg-tests.ts b/db-migrate-pg/db-migrate-pg-tests.ts new file mode 100644 index 0000000000..adf2716074 --- /dev/null +++ b/db-migrate-pg/db-migrate-pg-tests.ts @@ -0,0 +1,410 @@ +// Test file for db-migrate-pg Definition file + +import * as DbMigratePg from "db-migrate-pg"; + +// Throw together a dummy driver +let db = {}; + +let callback = (err: any, response: any) => { + // Do nothing. +}; + +/// createTable(tableName, columnSpec, callback) +db.createTable('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}, callback); + +db.createTable('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}, callback); + +db.createTable('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}, callback); + +/// dropTable(tableName, [options,] callback) +db.dropTable('pets', callback); + +db.dropTable('pets', { ifExists: true }, callback); + +/// renameTable(tableName, newTableName, callback) +db.renameTable('pets', 'pets_OLD', callback); + +/// addColumn(tableName, columnName, columnSpec, callback) +db.addColumn('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}, callback); + +db.addColumn('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}, callback); + +/// renameColumn(tableName, oldColumnName, newColumnName, callback) +db.renameColumn('pets', 'id', 'pet_id', callback); + +/// changeColumn(tableName, columnName, columnSpec, callback) +db.changeColumn('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}, callback); + +/// addIndex(tableName, indexName, columns, [unique,] callback) +db.addIndex('pets', 'pets_eye_color_idx', ['eye_color'], callback); +db.addIndex('pets', 'pets_registration_code_idx', ['registration_code'], true, callback); + +/// addForeignKey(tableName, referencedTableName, keyName, fieldMapping, rules, callback) +db.addForeignKey('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}, callback); + +/// removeForeignKey(tableName, keyName, options, callback) +db.removeForeignKey('module_user', 'module_uer_module_id_foreign', callback); +db.removeForeignKey('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}, callback); + +/// insert(tableName, [columnNameArray,] valueArray, callback) +db.insert('module_user', ['first_name', 'last_name'], ['Test', 'Testerson'], callback); +db.insert('module_user', ['Test', 'Testerson'], callback); + +/// removeIndex([tableName,] indexName, callback) +db.removeIndex('pets', 'pets_eye_color_idx', callback); +db.removeIndex('pets_eye_color_idx', callback); + +/// runSql(sql, [params,] callback) +db.runSql('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +], callback); +db.runSql('DROP TABLE `pets`', callback); + +/// all(sql, [params,] callback) +db.all('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test'], callback); +db.all('SELECT * FROM `module_user`', callback); + +/// ========= +/// Async +/// ========= + +let onResolve = (result: any) => {}; + +/// createTableAsync(tableName, columnSpec) +db.createTableAsync('pets', { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' +}).then(onResolve); + +db.createTableAsync('pets', { + columns: { + id: { type: 'int', primaryKey: true, autoIncrement: true }, + name: 'string' + }, + ifNotExists: true +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: 'id' + } + } +}).then(onResolve); + +db.createTableAsync('product_variant', +{ + id: { + type: 'int', + unsigned: true, + notNull: true, + primaryKey: true, + autoIncrement: true, + length: 10 + }, + product_id: { + type: 'int', + unsigned: true, + length: 10, + notNull: true, + foreignKey: { + name: 'product_variant_product_id_fk', + table: 'product', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + product_id: 'id' + } + } + } +}).then(onResolve); + +/// dropTableAsync(tableName, [options]) +db.dropTableAsync('pets').then(onResolve); +db.dropTableAsync('pets', { ifExists: true }).then(onResolve); + +/// renameTableAsync(tableName, newTableName) +db.renameTableAsync('pets', 'pets_OLD').then(onResolve); + +/// addColumnAsync(tableName, columnName, columnSpec) +db.addColumnAsync('pets', 'eyeColor', { + type: 'string', + length: 25, + notNull: true, +}).then(onResolve); + +db.addColumnAsync('pets', 'id', { + type: 'int', + primaryKey: true, + autoIncrement: true, + notNull: true, + unique: true +}).then(onResolve); + +/// renameColumnAsync(tableName, oldColumnName, newColumnName) +db.renameColumnAsync('pets', 'id', 'pet_id').then(onResolve); + +/// changeColumnAsync(tableName, columnName, columnSpec) +db.changeColumnAsync('pets', 'eye_color', { + type: 'int', + unsigned: true, + notNull: true, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + eye_color: 'id' + } + } +}).then(onResolve); + +/// addIndexAsync(tableName, indexName, columns, [unique]) +db.addIndexAsync('pets', 'pets_eye_color_idx', ['eye_color']).then(onResolve); +db.addIndexAsync('pets', 'pets_registration_code_idx', ['registration_code'], true).then(onResolve); + +/// addForeignKeyAsync(tableName, referencedTableName, keyName, fieldMapping, rules) +db.addForeignKeyAsync('module_user', 'modules', 'module_user_module_id_fk', +{ + 'module_id': 'id' +}, +{ + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' +}).then(onResolve); + +/// removeForeignKeyAsync(tableName, keyName, options) +db.removeForeignKeyAsync('module_user', 'module_uer_module_id_foreign').then(onResolve); +db.removeForeignKeyAsync('module_user', 'module_user_module_id_foreign', { + dropIndex: true, +}).then(onResolve); + +/// insertAsync(tableName, [columnNameArray,] valueArray) +db.insertAsync('module_user', ['first_name', 'last_name'], ['Test', 'Testerson']).then(onResolve); +db.insertAsync('module_user', ['Test', 'Testerson']).then(onResolve); + +/// removeIndexAsync([tableName,] indexName) +db.removeIndexAsync('pets', 'pets_eye_color_idx').then(onResolve); +db.removeIndexAsync('pets_eye_color_idx').then(onResolve); + +/// runSqlAsync(sql, [params]) +db.runSqlAsync('INSERT INTO `module_user` (`?`,`?`) VALUES (\'?\',\'?\')', [ + 'first_name', 'last_name', + 'Test', 'Testerson' +]).then(onResolve); +db.runSqlAsync('DROP TABLE `pets`').then(onResolve); + +/// allAsync(sql, [params]) +db.allAsync('SELECT * FROM `module_user` WHERE `?` = \'?\'', ['first_name', 'Test']).then(onResolve); +db.allAsync('SELECT * FROM `module_user`').then(onResolve); + +/// ==================== +/// PG-specific tests +/// ==================== + +/// createColumnConstraint(spec, options, tableName, columnName) (INTERNAL USE ONLY) +let constraint: DbMigratePg.ColumnConstraint; + +constraint = db.createColumnConstraint({ + type: 'int', + length: 10, + unsigned: true, + primaryKey: false, + autoIncrement: false, + notNull: true, + unique: false, + defaultValue: 0, + foreignKey: { + name: 'pets_eye_color_id_fk', + table: 'eye_color', + rules: { + onDelete: 'CASCADE', + onUpdate: 'RESTRICT' + }, + mapping: { + 'eye_color': 'id' + } + } +}, { + emitPrimaryKey: false +}, 'pets', 'eye_color'); + +// Print the SQL constraints +console.log(constraint.constraints); + +// Invoke the foreign key builder +constraint.foreignKey(callback); + +/// Public Callback Methods: + +/// createDatabase(dbName, [options,] callback) +db.createDatabase('petstore', callback); +db.createDatabase('petstore', {}, callback); + +/// dropDatabase(dbName, [options,] callback) +db.dropDatabase('petstore', callback); +db.dropDatabase('petstore', { ifExists: true }, callback); + +/// createSequence(sqName, [options,] callback) +db.createSequence('pets_id_sq', callback); +db.createSequence('pets_id_sq', { temp: true }, callback); + +/// switchDatabase(options, callback) +db.switchDatabase('petstore', callback); +db.switchDatabase({ database: 'petstore' }, callback); + +/// dropSequence(sqName, [options,] callback) +db.dropSequence('pets_id_sq', callback); +db.dropSequence('pets_id_sq', { + ifExists: true, + cascade: true, + restrict: true, +}, callback); + +/// Public Promisified Methods: + +/// createDatabaseAsync(dbName, [options]) +db.createDatabaseAsync('petstore').then(onResolve); +db.createDatabaseAsync('petstore', {}).then(onResolve); + +/// dropDatabaseAsync(dbName, [options]) +db.dropDatabaseAsync('petstore').then(onResolve); +db.dropDatabaseAsync('petstore', { ifExists: true }).then(onResolve); + +/// createSequenceAsync(sqName, [options]) +db.createSequenceAsync('pets_id_sq').then(onResolve); +db.createSequenceAsync('pets_id_sq', { temp: true }).then(onResolve); + +/// switchDatabaseAsync(options) +db.switchDatabaseAsync('petstore').then(onResolve); +db.switchDatabaseAsync({ database: 'petstore' }).then(onResolve); + +/// dropSequenceAsync(sqName, [options]) +db.dropSequenceAsync('pets_id_sq').then(onResolve); +db.dropSequenceAsync('pets_id_sq', { + ifExists: true, + cascade: true, + restrict: true, +}).then(onResolve); diff --git a/db-migrate-pg/index.d.ts b/db-migrate-pg/index.d.ts new file mode 100644 index 0000000000..7804f4ddad --- /dev/null +++ b/db-migrate-pg/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for db-migrate-pg +// Project: https://github.com/db-migrate/pg +// Definitions by: nickiannone +// Definitions: https://github.com/nickiannone/DefinitelyTyped + +import * as pg from "pg"; +import * as DbMigrateBase from "db-migrate-base"; +import * as Promise from "bluebird"; + +// Yes, this is a dummy interface for now; the current implementation of the pg driver doesn't need any options. +export interface CreateDatabaseOptions {} + +export interface DropDatabaseOptions { + ifExists?: boolean; +} + +export interface CreateSequenceOptions { + temp?: boolean; +} + +export interface SwitchDatabaseOptions { + database?: string; +} + +export interface DropSequenceOptions { + ifExists?: boolean; + cascade?: boolean; + restrict?: boolean; +} + +export interface ColumnConstraint { + foreignKey: (callback: DbMigrateBase.CallbackFunction) => void; + constraints: string; +} + +export interface ColumnConstraintOptions { + emitPrimaryKey?: boolean; +} + +export class PgDriver extends DbMigrateBase.Base { + constructor(connection: pg.Client, schema: string, intern: DbMigrateBase.InternalOptions); + createDatabase(dbName: string, optionsOrCb: CreateDatabaseOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + dropDatabase(dbName: string, optionsOrCb: DropDatabaseOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + createSequence(sqName: string, optionsOrCb: CreateSequenceOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + switchDatabase(options: string | SwitchDatabaseOptions, callback: DbMigrateBase.CallbackFunction): void; + dropSequence(dbName: string, optionsOrCb: DropSequenceOptions | DbMigrateBase.CallbackFunction, callback?: DbMigrateBase.CallbackFunction): void; + createColumnConstraint(spec: DbMigrateBase.ColumnSpec, options: ColumnConstraintOptions, tableName: string, columnName: string): ColumnConstraint; + + createDatabaseAsync(dbName: string, options?: CreateDatabaseOptions): Promise; + dropDatabaseAsync(dbName: string, options?: DropDatabaseOptions): Promise; + createSequenceAsync(sqName: string, options?: CreateSequenceOptions): Promise; + switchDatabaseAsync(options: string | SwitchDatabaseOptions): Promise; + dropSequenceAsync(dbName: string, options?: DropSequenceOptions): Promise; +} diff --git a/db-migrate-pg/tsconfig.json b/db-migrate-pg/tsconfig.json new file mode 100644 index 0000000000..e31e52d255 --- /dev/null +++ b/db-migrate-pg/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "db-migrate-pg-tests.ts" + ] +} \ No newline at end of file diff --git a/electron-notify/electron-notify-tests.ts b/electron-notify/electron-notify-tests.ts new file mode 100644 index 0000000000..8c1597cf78 --- /dev/null +++ b/electron-notify/electron-notify-tests.ts @@ -0,0 +1,24 @@ +import * as eNotify from 'electron-notify'; + +eNotify.setConfig({ + appIcon: 'images/otherIcon.png', + displayTime: 6000, + defaultStyleText: { + color: '#FF0000', + fontWeight: 'bold' + } +}); + +eNotify.notify({ + title: 'Title', + text: 'Some text', + image: 'path/to/image.png', + url: 'http://google.de', + sound: 'notification.wav', + onClickFunc: (event) => { + console.log('onClick ' + event.id); + event.closeNotification('onClick'); + }, + onShowFunc: (event) => { console.log('onShow ' + event.id) }, + onCloseFunc: (event) => { console.log('onClose ' + event.id) } +}); \ No newline at end of file diff --git a/electron-notify/index.d.ts b/electron-notify/index.d.ts new file mode 100644 index 0000000000..225ab9de9e --- /dev/null +++ b/electron-notify/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for electron-notify v0.1.0 +// Project: https://github.com/hankbao/electron-notify +// Definitions by: Daniel Pereira +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** Nice and simple notifications for electron apps */ +export interface ICustomConfig { + width?: number, + height?: number, + padding?: number, + borderRadius?: number, + displayTime?: number, + animationSteps?: number, + animationStepMs?: number, + animateInParallel?: boolean, + appIcon?: string, + pathToModule?: string, + logging?: boolean, + defaultWindow?: Electron.BrowserWindowOptions, + defaultStyleContainer?: any, + defaultStyleAppIcon?: any, + defaultStyleImage?: any, + defaultStyleClose?: any, + defaultStyleText?: any +} + +export interface ICloseNotificationEvent { + event: 'close' | 'show' | 'click', + id: number +} + +export interface INotificationEvent extends ICloseNotificationEvent { + closeNotification: (reason: any) => void, +} + +export interface INotification { + title: string, + text?: string, + image?: string, + url?: string, + sound?: string, + onClickFunc?: (event: INotificationEvent) => void, + onShowFunc?: (event: INotificationEvent) => void, + onCloseFunc?: (event: ICloseNotificationEvent) => void +} + +/** Change some config options. Can be run multiple times, also between notify()-calls to change electron-notifys behaviour. */ +export function setConfig(customConfig: ICustomConfig): void; + +/** Displays new notification. */ +export function notify(notification: INotification): void; + +/** Clears the animation queue and closes all windows opened by electron-notify. Call this to clean up before quiting your app. */ +export function closeAll(): void; + +export function getTemplatePath(): string; + +export function setTemplatePath(path: string): void; \ No newline at end of file diff --git a/electron-notify/tsconfig.json b/electron-notify/tsconfig.json new file mode 100644 index 0000000000..3c0b906028 --- /dev/null +++ b/electron-notify/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "electron-notify-tests.ts" + ] +} \ No newline at end of file diff --git a/mock-require/index.d.ts b/mock-require/index.d.ts new file mode 100644 index 0000000000..da5db1c07c --- /dev/null +++ b/mock-require/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for mock-require v1.3.0 +// Project: https://github.com/boblauer/mock-require +// Definitions by: Daniel Pereira +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** Simple, intuitive mocking of Node.js modules. */ +interface Mock { + /** + * @param {string} path The module you that you want to mock. + * @param {any} mockExport The function or object you want to be returned from require, instead of the path module's exports, or the module you want to be returned from require, instead of the path module's export. + */ + (path: string, mockExport: any | Function | string): void; + + /** + * @param {string} path The module you that you want to stop mocking. + */ + stop(path: string): void; + + /** This function can be used to remove all registered mocks without the need to remove them individually using mock.stop(). */ + stopAll(): void; + + /** + * @param {string} path The file whose cache you want to refresh. + */ + reRequire(path: string): void; +} + +declare const myModule: Mock; +export = myModule; diff --git a/mock-require/mock-require-tests.ts b/mock-require/mock-require-tests.ts new file mode 100644 index 0000000000..41052e2afc --- /dev/null +++ b/mock-require/mock-require-tests.ts @@ -0,0 +1,45 @@ +import mock = require('mock-require'); + +function testMock() { + mock('http', { + request: function () { + console.log('http.request called'); + } + }); + + const http = require('http'); + http.request(); // 'http.request called' +} + +function testStop() { + mock('fs', { mockedFS: true }); + + const fs1 = require('fs'); + mock.stop('fs'); + + const fs2 = require('fs'); + fs1 === fs2; // false +} + +function testStopAll() { + mock('fs', {}); + mock('path', {}); + + const fs1 = require('fs'); + const path1 = require('path'); + + mock.stopAll(); + + const fs2 = require('fs'); + const path2 = require('path'); + + fs1 === fs2; // false + path1 === path2; // false +} + +function testReRequire() { + const fs = require('fs'); + let fileToTest = require('./fileToTest'); + mock('fs', {}); // fileToTest is still using the unmocked fs module + fileToTest = mock.reRequire('./fileToTest'); // fileToTest is now using your mock +} \ No newline at end of file diff --git a/mock-require/tsconfig.json b/mock-require/tsconfig.json new file mode 100644 index 0000000000..7d10b34ae8 --- /dev/null +++ b/mock-require/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mock-require-tests.ts" + ] +} \ No newline at end of file diff --git a/react/react-tests.ts b/react/react-tests.ts index 28f7c442e9..4351312ee7 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -120,7 +120,7 @@ class ModernComponent extends React.Component value: this.state.inputValue }), React.DOM.input({ - onChange: event => console.log(event.target.value) + onChange: event => console.log(event.target) })); } diff --git a/react/react-tsx-tests.tsx b/react/react-tsx-tests.tsx new file mode 100644 index 0000000000..3756659a53 --- /dev/null +++ b/react/react-tsx-tests.tsx @@ -0,0 +1,15 @@ +import React = require("react"); + +interface SCProps { + foo?: number; +} + +var StatelessComponent: React.SFC = ({ foo }: SCProps) => { + return

{ foo }
; +}; +StatelessComponent.displayName = "StatelessComponent3"; +StatelessComponent.defaultProps = { + foo: 42 +}; + +; diff --git a/react/tsconfig.json b/react/tsconfig.json index 31399914a4..55fd2537d4 100644 --- a/react/tsconfig.json +++ b/react/tsconfig.json @@ -1,7 +1,8 @@ { "files": [ "index.d.ts", - "react-tests.ts" + "react-tests.ts", + "react-tsx-tests.tsx" ], "compilerOptions": { "module": "commonjs", @@ -14,6 +15,7 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" } } \ No newline at end of file diff --git a/redis-rate-limiter/index.d.ts b/redis-rate-limiter/index.d.ts new file mode 100644 index 0000000000..f8482f77cb --- /dev/null +++ b/redis-rate-limiter/index.d.ts @@ -0,0 +1,33 @@ +// Type definitions for redis-rate-limiter 1.0.3 +// Project: https://github.com/TabDigital/redis-rate-limiter +// Definitions by: Seth Westphal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as express from 'express'; +import * as redis from 'redis'; + +declare class RedisRateLimiter { + public static create(options: RedisRateLimiter.Options): + (req: express.Request, callback: (err: Error, res: RedisRateLimiter.Response) => void) => void; + public static middleware(options: RedisRateLimiter.Options): express.RequestHandler; +} + +declare namespace RedisRateLimiter { + export interface Options { + redis: redis.RedisClient; + key: 'ip' | ((req: express.Request) => string); + window?: number; + limit?: number; + rate?: string; + } + + export interface Response { + key: string; + current: number; + limit: number; + window: number; + over: boolean; + } +} + +export = RedisRateLimiter; \ No newline at end of file diff --git a/redis-rate-limiter/redis-rate-limiter-tests.ts b/redis-rate-limiter/redis-rate-limiter-tests.ts new file mode 100644 index 0000000000..0ce00945ca --- /dev/null +++ b/redis-rate-limiter/redis-rate-limiter-tests.ts @@ -0,0 +1,37 @@ +import * as express from 'express'; +import * as redis from 'redis'; +import * as rateLimiter from 'redis-rate-limiter'; + +var num: number; +var str: string; +var options: redis.ClientOpts; +var redisClient = redis.createClient(num, str, options); + +var limit = rateLimiter.create({ + redis: redisClient, + key: function(x) { return x.ip }, + rate: '100/minute' +}); + +var request = {} as express.Request; +limit(request, function(err, rate) { + if (err) { + console.warn('Rate limiting not available'); + } else { + console.log('Rate window: ' + rate.window); // 60 + console.log('Rate limit: ' + rate.limit); // 100 + console.log('Rate current: ' + rate.current); // 74 + if (rate.over) { + console.error('Over the limit!'); + } + } +}); + +var middleware = rateLimiter.middleware({ + redis: redisClient, + key: 'ip', + rate: '100/minute' +}); + +var app = express(); +app.use(middleware); diff --git a/redis-rate-limiter/tsconfig.json b/redis-rate-limiter/tsconfig.json new file mode 100644 index 0000000000..11633c3ad6 --- /dev/null +++ b/redis-rate-limiter/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redis-rate-limiter-tests.ts" + ] +} \ No newline at end of file diff --git a/redis-scripto/index.d.ts b/redis-scripto/index.d.ts new file mode 100644 index 0000000000..e56e69a00b --- /dev/null +++ b/redis-scripto/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for redis-scripto 0.1.3 +// Project: https://github.com/arunoda/node-redis-scripto +// Definitions by: Seth Westphal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + + + import * as redis from 'redis'; + + declare class Scripto { + + constructor(redisClient: redis.RedisClient); + + eval(scriptName: string, keys: string[], args: any[], callback: (err: Error, result: any) => void): void; + evalSha(scriptName: string, keys: string[], args: any[], callback: (err: Error, result: any) => void): void; + + load(scripts: Scripto.Scripts): void; + loadFromDir(scriptsDir: string): void; + loadFromFile(name: string, filepath: string): void; + + run(scriptName: string, keys: string[], args: any[], callback: (err: Error, result: any) => void): void; + + } + + declare namespace Scripto { + + export type Script = string; + + export interface Scripts { + [scriptName: string]: Script; + } + + } + + export = Scripto; \ No newline at end of file diff --git a/redis-scripto/redis-scripto-tests.ts b/redis-scripto/redis-scripto-tests.ts new file mode 100644 index 0000000000..39e51ddd63 --- /dev/null +++ b/redis-scripto/redis-scripto-tests.ts @@ -0,0 +1,34 @@ +import * as redis from 'redis'; +import * as Scripto from 'redis-scripto'; + +var num: number; +var str: string; +var options: redis.ClientOpts; +var redisClient = redis.createClient(num, str, options); + +var scriptManager = new Scripto(redisClient); +scriptManager.loadFromDir('/path/to/lua/scripts'); + +var keys = ['keyOne', 'keyTwo']; +var values = [10, 20]; +scriptManager.run('your-script', keys, values, function(err, result) { + +}); + +scriptManager.eval('your-script', keys, values, function(err, result) { + +}); + +scriptManager.loadFromFile('script-one', '/path/to/the/file'); +scriptManager.run('script-one', [], [], function(err, result) { + +}); + +var scripts: Scripto.Scripts = { + 'script-two': 'return 1000' +}; + +scriptManager.load(scripts); +scriptManager.run('script-two', [], [], function(err, result) { + +}); diff --git a/redis-scripto/tsconfig.json b/redis-scripto/tsconfig.json new file mode 100644 index 0000000000..a9670ef617 --- /dev/null +++ b/redis-scripto/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "redis-scripto-tests.ts" + ] +} \ No newline at end of file diff --git a/simple-assign/index.d.ts b/simple-assign/index.d.ts new file mode 100644 index 0000000000..04f37a9223 --- /dev/null +++ b/simple-assign/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for simple-assign 0.1.0 +// Project: https://github.com/newoga/simple-assign +// Definitions by: Ivo Stratev +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function simpleAssign(target: T, source: U): T & U; +declare function simpleAssign(target: T, source1: U, source2: V): T & U & V; +declare function simpleAssign(target: T, source1: U, source2: V, source3: W): T & U & V & W; +declare function simpleAssign(target: T, source1: U, source2: V, source3: W, source4: Q): T & U & V & W & Q; +declare function simpleAssign(target: T, source1: U, source2: V, source3: W, source4: Q, source5: T): T & U & V & W & Q & R; +declare function simpleAssign(target: any, ...sources: any[]): any; + +export = simpleAssign; \ No newline at end of file diff --git a/simple-assign/simple-assign-tests.ts b/simple-assign/simple-assign-tests.ts new file mode 100644 index 0000000000..862fb013db --- /dev/null +++ b/simple-assign/simple-assign-tests.ts @@ -0,0 +1,14 @@ + +import assign = require('simple-assign'); + +function assign1() { + return assign({hello: "world"}); +} + +function assign2() { + return assign({hello: "world"}, {hello: "worlds", second: "extra"}); +} + +function assign3() { + return assign({hello: "world"}, {hello: "worlds", second: "extra"}, {hello: "stop", the: "spinning"}); +} diff --git a/simple-assign/tsconfig.json b/simple-assign/tsconfig.json new file mode 100644 index 0000000000..dea9d75e8f --- /dev/null +++ b/simple-assign/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "simple-assign-tests.ts" + ] +} \ No newline at end of file From 0d3a7694ecf0e9082dd794f290ddf54946b6d339 Mon Sep 17 00:00:00 2001 From: Hagai Cohen Date: Fri, 19 Aug 2016 00:12:54 +0300 Subject: [PATCH 092/105] Updated typings for fullcalendar --- fullCalendar/fullCalendar-tests.ts | 87 +++++++++++++++++++++++++++--- fullCalendar/index.d.ts | 43 +++++++++------ 2 files changed, 106 insertions(+), 24 deletions(-) diff --git a/fullCalendar/fullCalendar-tests.ts b/fullCalendar/fullCalendar-tests.ts index d82ca580c7..10331dfd78 100644 --- a/fullCalendar/fullCalendar-tests.ts +++ b/fullCalendar/fullCalendar-tests.ts @@ -781,16 +781,16 @@ $(document).ready(function () { /* initialize the external events -----------------------------------------------------------------*/ $('#external-events div.external-event').each(function () { - + // create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/) // it doesn't need to have a start or end var eventObject = { title: $.trim($(this).text()) // use the element's text as the event title }; - + // store the Event Object in the DOM element so we can get to it later $(this).data('eventObject', eventObject); - + // make the event draggable using jQuery UI $(this).draggable({ zIndex: 999, @@ -811,21 +811,21 @@ $(document).ready(function () { editable: true, droppable: true, // this allows things to be dropped onto the calendar !!! drop: function (date, allDay) { // this function is called when something is dropped - + // retrieve the dropped element's stored Event Object var originalEventObject = $(this).data('eventObject'); - + // we need to copy it, so that multiple events don't have a reference to the same object var copiedEventObject: any = $.extend({}, originalEventObject); - + // assign it the date that was reported copiedEventObject.start = date; copiedEventObject.allDay = allDay; - + // render the event on the calendar // the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/) $('#calendar').fullCalendar('renderEvent', copiedEventObject, true); - + // is the "remove after drop" checkbox checked? if ($('#drop-remove').is(':checked')) { // if so, remove the element from the "Draggable Events" list @@ -835,4 +835,75 @@ $(document).ready(function () { }); }); +$(document).ready(() => { + var date = new Date(); + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + + $('#calendar').fullCalendar({ + theme: true, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + editable: true, + events: [{ + id: 'test1', + title: 'event full of features', + start: new Date(y, m, 1), + startEditable: true, + allDay: false, + url: 'http://www.google.com', + className: 'gcal-event', + editable: false, + durationEditable: false, + rendering: 'background', + overlap: false, + constraint: { + start: '10:00', + end: '18:00', + dow: [ 1, 2 ], + // days of week. an array of zero-based day of week integers (0=Sunday) + // (Monday-Tuesday in this example) + }, + color: 'white', + backgroundColor: 'black', + borderColor: 'grey', + textColor: 'white', + }], + }); + + $('#calendar').fullCalendar({ + theme: true, + header: { + left: 'prev,next today', + center: 'title', + right: 'month,agendaWeek,agendaDay' + }, + editable: true, + events: [{ + id: 'test2', + title: 'just an event', + start: new Date(y, m, 1), + }], + eventConstraint: 'businessHours', + eventLimit: true, + businessHours: [{ + start: '10:00', + end: '18:00', + dow: [ 1, 2 ], + // days of week. an array of zero-based day of week integers (0=Sunday) + // (Monday-Tuesday in this example) + }, { + start: '09:00', + end: '19:00', + dow: [ 3, 4 ], + }], + }); + + $('#calendar').fullCalendar('refetchEventSources', 'http://www.google.com/your_feed_url1/'); +}); + $('#calendar').fullCalendar('refetchEvents'); diff --git a/fullCalendar/index.d.ts b/fullCalendar/index.d.ts index 004de43f75..3198fb392d 100644 --- a/fullCalendar/index.d.ts +++ b/fullCalendar/index.d.ts @@ -18,14 +18,14 @@ export interface Calendar { } export interface BusinessHours { - start: moment.Duration; - end: moment.Duration; + start: moment.Duration | string | Date; + end: moment.Duration | string | Date; dow: Array; } export interface Timespan { - start: moment.Moment; - end: moment.Moment; + start: moment.Moment | string | Date; + end?: moment.Moment | string | Date; } export interface Options extends AgendaOptions, EventDraggingResizingOptions, DroppingExternalElementsOptions, SelectionOptions { @@ -35,12 +35,12 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr left: string; center: string; right: string; - } - theme?: boolean + }; + theme?: boolean; buttonIcons?: { prev: string; next: string; - } + }; firstDay?: number; isRTL?: boolean; weekends?: boolean; @@ -48,7 +48,7 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr weekMode?: string; weekNumbers?: boolean; weekNumberCalculation?: any; // String/Function - businessHours?: boolean | BusinessHours; + businessHours?: boolean | BusinessHours | Array; height?: number; contentHeight?: number; aspectRatio?: number; @@ -61,7 +61,7 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr // Timezone timezone?: string | boolean; - now?: moment.Moment | Date | string | (() => moment.Moment) + now?: moment.Moment | Date | string | (() => moment.Moment); // Views - http://fullcalendar.io/docs/views/ @@ -117,10 +117,11 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr allDayDefault?: boolean; startParam?: string; - endParam?: string + endParam?: string; lazyFetching?: boolean; eventDataTransform?: (eventData: any) => EventObject; loading?: (isLoading: boolean, view: ViewObject) => void; + eventLimit?: boolean; // Event Rendering - http://fullcalendar.io/docs/event_rendering/ @@ -161,7 +162,7 @@ export interface EventDraggingResizingOptions { dragOpacity?: number; // float dragScroll?: boolean; eventOverlap?: boolean | ((stillEvent: EventObject, movingEvent: EventObject) => boolean); - eventConstraint?: BusinessHours | Timespan; + eventConstraint?: "businessHours" | BusinessHours | Timespan; eventDragStart?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; eventDragStop?: (event: EventObject, jsEvent: MouseEvent, ui: any, view: ViewObject) => void; eventDrop?: (event: EventObject, delta: moment.Duration, revertFunc: Function, jsEvent: Event, ui: any, view: ViewObject) => void; @@ -187,7 +188,7 @@ export interface DroppingExternalElementsOptions { droppable?: boolean; dropAccept?: string | ((draggable: any) => boolean); drop?: (date: moment.Moment, jsEvent: MouseEvent, ui: any) => void; - eventReceive?: (event: EventObject) => void + eventReceive?: (event: EventObject) => void; } export interface ButtonTextObject { @@ -201,19 +202,24 @@ export interface ButtonTextObject { day?: string; } +/* Refer to http://fullcalendar.io/docs/event_data/Event_Object/ */ export interface EventObject extends Timespan { - id?: any // String/number + id?: any; // String/number title: string; allDay?: boolean; url?: string; - className?: any; // string/Array + className?: string | Array; editable?: boolean; + startEditable?: boolean; + durationEditable?: boolean; + rendering?: string; + overlap?: boolean; + constraint?: Timespan | BusinessHours; source?: EventSource; color?: string; backgroundColor?: string; borderColor?: string; textColor?: string; - rendering?: string; } export interface ViewObject extends Timespan { @@ -243,7 +249,7 @@ export interface EventSource extends JQueryAjaxSettings { ignoreTimezone?: boolean; eventTransform?: any; startParam?: string; - endParam?: string + endParam?: string; } /* @@ -392,6 +398,11 @@ declare global { */ fullCalendar(method: 'rerenderEvents'): void; + /** + * Refetches one or more specific event sources. + */ + fullCalendar(method: 'refetchEventSources', source: any): void; + /** * Create calendar object */ From ec7c2394c2224dd95810190f26c6ff2bff0742df Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Fri, 19 Aug 2016 10:32:34 -0700 Subject: [PATCH 093/105] More new typings --- highcharts/highcharts-modules-exporting.d.ts | 12 ++ highcharts/highcharts-more.d.ts | 12 ++ mongoose-paginate/mongoose-paginate-tests.ts | 75 ++++++++++ mongoose-paginate/mongoose-paginate.d.ts | 45 ++++++ .../passport-local-mongoose-tests.ts | 136 ++++++++++++++++++ .../passport-local-mongoose.d.ts | 91 ++++++++++++ 6 files changed, 371 insertions(+) create mode 100644 highcharts/highcharts-modules-exporting.d.ts create mode 100644 highcharts/highcharts-more.d.ts create mode 100644 mongoose-paginate/mongoose-paginate-tests.ts create mode 100644 mongoose-paginate/mongoose-paginate.d.ts create mode 100644 passport-local-mongoose/passport-local-mongoose-tests.ts create mode 100644 passport-local-mongoose/passport-local-mongoose.d.ts diff --git a/highcharts/highcharts-modules-exporting.d.ts b/highcharts/highcharts-modules-exporting.d.ts new file mode 100644 index 0000000000..4d3bdaa648 --- /dev/null +++ b/highcharts/highcharts-modules-exporting.d.ts @@ -0,0 +1,12 @@ +// Type definitions for Highcharts 4.2.6 (exporting module) +// Project: http://www.highcharts.com/ +// Definitions by: Maciej Suchecki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var HighchartsExporting: (H: HighchartsStatic) => HighchartsStatic; + +declare module "highcharts/modules/exporting" { + export = HighchartsExporting; +} diff --git a/highcharts/highcharts-more.d.ts b/highcharts/highcharts-more.d.ts new file mode 100644 index 0000000000..1d42764b3c --- /dev/null +++ b/highcharts/highcharts-more.d.ts @@ -0,0 +1,12 @@ +// Type definitions for Highcharts 4.2.6 +// Project: http://www.highcharts.com/ +// Definitions by: Maciej Suchecki +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare var HighchartsMore: (H: HighchartsStatic) => HighchartsStatic; + +declare module "highcharts/highcharts-more" { + export = HighchartsMore; +} diff --git a/mongoose-paginate/mongoose-paginate-tests.ts b/mongoose-paginate/mongoose-paginate-tests.ts new file mode 100644 index 0000000000..7857ffda33 --- /dev/null +++ b/mongoose-paginate/mongoose-paginate-tests.ts @@ -0,0 +1,75 @@ +/// +/// +/// + +/** + * Created by Linus Brolin . + */ + +import { + Schema, + model, + PaginateModel, + PaginateOptions, + PaginateResult +} from 'mongoose'; +import * as mongoosePaginate from 'mongoose-paginate'; +import { Router, Request, Response } from 'express'; + + +//#region Test Models +interface User { + email: string; + username: string; + password: string; +} + +const UserSchema: Schema = new Schema({ + email: String, + username: String, + password: String +}); + +UserSchema.plugin(mongoosePaginate); + +type UserModel = _UserModel & PaginateModel; +interface _UserModel {} + +let UserModel: UserModel = model('User', UserSchema) as UserModel; +//#endregion + + +//#region Test Paginate +let router: Router = Router(); + +router.get('/users.json', function(req: Request, res: Response) { + let descending: boolean = true; + let options: PaginateOptions = {}; + options.select = 'email username'; + options.sort = { 'username': (descending ? -1 : 1) }; + options.populate = ''; + options.lean = true; + options.leanWithId = false; + options.offset = 0; + options.page = 1; + options.limit = 10; + + UserModel + .paginate({}, options, (err: any, value: PaginateResult) => { + if (err) { + console.log(err); + return res.status(500).send(err); + } + + console.log('total: ' + value.total); + console.log('limit: ' + value.limit); + console.log('page: ' + value.page); + console.log('pages: ' + value.pages); + console.log('offset: ' + value.offset); + console.log('docs: '); + console.dir(value.docs); + return res.json(value); + }); + +}); +//#endregion diff --git a/mongoose-paginate/mongoose-paginate.d.ts b/mongoose-paginate/mongoose-paginate.d.ts new file mode 100644 index 0000000000..5481c42775 --- /dev/null +++ b/mongoose-paginate/mongoose-paginate.d.ts @@ -0,0 +1,45 @@ +// Type definitions for mongoose-paginate 5.0.0 +// Project: https://github.com/edwardhotchkiss/mongoose-paginate +// Definitions by: Linus Brolin , simonxca +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'mongoose' { + export interface PaginateOptions { + select?: Object | string; + sort?: Object | string; + populate?: Array | Array | Object | string; + lean?: boolean; + leanWithId?: boolean; + offset?: number; + page?: number; + limit?: number; + } + + export interface PaginateResult { + docs: Array; + total: number; + limit: number; + page?: number; + pages?: number; + offset?: number; + } + + export type PaginateModel = _PaginateModel & Model; + interface _PaginateModel { + paginate(query?: Object, options?: PaginateOptions, callback?: (err: any, result: PaginateResult) => void): Promise>; + } + + export function model( + name: string, + schema?: Schema, + collection?: string, + skipInit?: boolean): Statics & PaginateModel; +} + +declare module 'mongoose-paginate' { + import mongoose = require('mongoose'); + var _: (schema: mongoose.Schema) => void; + export = _; +} diff --git a/passport-local-mongoose/passport-local-mongoose-tests.ts b/passport-local-mongoose/passport-local-mongoose-tests.ts new file mode 100644 index 0000000000..cf41176f08 --- /dev/null +++ b/passport-local-mongoose/passport-local-mongoose-tests.ts @@ -0,0 +1,136 @@ +/// +/// +/// +/// +/// + +/** + * Created by Linus Brolin . + */ + +import { + Schema, + model, + PassportLocalDocument, + PassportLocalSchema, + PassportLocalModel, + PassportLocalOptions, + PassportLocalErrorMessages +} from 'mongoose'; +import * as passportLocalMongoose from 'passport-local-mongoose'; + +import { Router, Request, Response } from 'express'; +import * as passport from 'passport'; +import { Strategy as LocalStrategy } from 'passport-local'; + + +//#region Test Models +interface User extends PassportLocalDocument { + _id: string; + username: string; + hash: string; + salt: string; + attempts: number; + last: Date; +} + +const UserSchema: PassportLocalSchema = new Schema({ + username: String, + hash: String, + salt: String, + attempts: Number, + last: Date +}); + +let options: PassportLocalOptions = {}; +options.iterations = 25000; +options.keylen = 512; +options.digestAlgorithm = 'sha256'; +options.interval = 100; +options.usernameField = 'username'; +options.usernameUnique = true; +options.usernameLowerCase = true; +options.hashField = 'hash'; +options.saltField = 'salt'; +options.saltlen = 32; +options.attemptsField = 'attempts'; +options.lastLoginField = 'last'; +options.selectFields = 'undefined'; +options.populateFields = 'undefined'; +options.encoding = 'hex'; +options.limitAttempts = false; +options.maxAttempts = Infinity; +options.passwordValidator = function(password: string, cb: (err: any) => void): void {}; +options.usernameQueryFields = []; + +let errorMessages: PassportLocalErrorMessages = {}; +errorMessages.MissingPasswordError = 'No password was given'; +errorMessages.AttemptTooSoonError = 'Account is currently locked. Try again later'; +errorMessages.TooManyAttemptsError = 'Account locked due to too many failed login attempts'; +errorMessages.NoSaltValueStoredError = 'Authentication not possible. No salt value stored'; +errorMessages.IncorrectPasswordError = 'Password or username are incorrect'; +errorMessages.IncorrectUsernameError = 'Password or username are incorrect'; +errorMessages.MissingUsernameError = 'No username was given'; +errorMessages.UserExistsError = 'A user with the given username is already registered'; + +options.errorMessages = errorMessages; + +UserSchema.plugin(passportLocalMongoose, options); + +type UserModel = _UserModel & PassportLocalModel; +interface _UserModel {} + +let UserModel: UserModel = model('User', UserSchema) as UserModel; +//#endregion + + +//#region Test Passport/Passport-Local +passport.use(UserModel.createStrategy()); + +passport.use('login', new LocalStrategy({ + passReqToCallback: true, + usernameField: 'username', + passwordField: 'password' + }, + (req: any, username: string, password: string, done: (err: any, res: any, msg?: any) => void) => { + process.nextTick(() => { + UserModel + .findOne({ 'username': username }) + .exec((err: any, user: model) => { + if (err) { + console.log(err); + return done(err, null); + } + + if (!user) { + console.log(errorMessages.IncorrectUsernameError); + return done(null, false, errorMessages.IncorrectUsernameError); + } + + user.authenticate(password, function(autherr: any, authuser: User, autherrmsg: any) { + if (autherr) { + console.log(autherr); + return done(autherr, null); + } + + if (!authuser) { + console.log(errorMessages.IncorrectPasswordError); + return done(null, false, errorMessages.IncorrectPasswordError); + } + + return done(null, authuser); + }); + }); + }); + }) +); + +passport.serializeUser(UserModel.serializeUser()); +passport.deserializeUser(UserModel.deserializeUser()); + +let router: Router = Router(); + +router.post('/login', passport.authenticate('local'), function(req: Request, res: Response) { + res.redirect('/'); +}); +//#endregion diff --git a/passport-local-mongoose/passport-local-mongoose.d.ts b/passport-local-mongoose/passport-local-mongoose.d.ts new file mode 100644 index 0000000000..8e4a6bb777 --- /dev/null +++ b/passport-local-mongoose/passport-local-mongoose.d.ts @@ -0,0 +1,91 @@ +// Type definitions for passport-local-mongoose 4.0.0 +// Project: https://github.com/saintedlama/passport-local-mongoose +// Definitions by: Linus Brolin , simonxca +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module 'mongoose' { + import passportLocal = require('passport-local'); + + // methods + export interface PassportLocalDocument { + setPassword(password: string, cb: (err: any, res: any) => void): void; + authenticate(password: string, cb: (err: any, res: any, error: any) => void): void; + } + + // statics + export type PassportLocalModel = _PassportLocalModel & Model; + interface _PassportLocalModel { + authenticate(): (username: string, password: string, cb: (err: any, res: T, error: any) => void) => void; + serializeUser(): (user: PassportLocalModel, cb: (err: any) => void) => void; + deserializeUser(): (username: string, cb: (err: any) => void) => void; + register(user: PassportLocalModel, password: string, cb: (err: any) => void): void; + findByUsername(username: string, selectHashSaltFields: boolean, cb: (err: any) => void): any; + createStrategy(): passportLocal.Strategy; + } + + // error messages + export interface PassportLocalErrorMessages { + MissingPasswordError?: string; + AttemptTooSoonError?: string; + TooManyAttemptsError?: string; + NoSaltValueStoredError?: string; + IncorrectPasswordError?: string; + IncorrectUsernameError?: string; + MissingUsernameError?: string; + UserExistsError?: string; + } + + // plugin options + export interface PassportLocalOptions { + saltlen?: number; + iterations?: number; + keylen?: number; + encoding?: string; + digestAlgorithm?: string; + passwordValidator?: (password: string, cb: (err: any) => void) => void; + + usernameField?: string; + usernameUnique?: boolean; + + usernameQueryFields: Array; + + selectFields?: string; + populateFields?: string; + + usernameLowerCase?: boolean; + + hashField?: string; + saltField?: string; + + limitAttempts?: boolean; + lastLoginField?: string; + attemptsField?: string; + interval?: number; + maxInterval?: number; + maxAttempts?: number; + + errorMessages?: PassportLocalErrorMessages; + } + + export interface PassportLocalSchema extends Schema { + plugin( + plugin: (schema: PassportLocalSchema, options?: PassportLocalOptions) => void, + options?: PassportLocalOptions + ): this; + } + + export function model( + name: string, + schema?: PassportLocalSchema, + collection?: string, + skipInit?: boolean): Statics & PassportLocalModel; +} + +declare module 'passport-local-mongoose' { + import mongoose = require('mongoose'); + var _: (schema: mongoose.Schema, options?: Object) => void; + export = _; +} From 5c77befaaa903efb260758f5ccc357e9ad34a3cc Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Fri, 19 Aug 2016 10:53:44 -0700 Subject: [PATCH 094/105] fix break --- react/react-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react-tests.ts b/react/react-tests.ts index 4351312ee7..28f7c442e9 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -120,7 +120,7 @@ class ModernComponent extends React.Component value: this.state.inputValue }), React.DOM.input({ - onChange: event => console.log(event.target) + onChange: event => console.log(event.target.value) })); } From 5ebd25423b2c3c7dc275602a40e721e994aad26d Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Fri, 19 Aug 2016 11:04:29 -0700 Subject: [PATCH 095/105] fix gulp-rename issue --- gulp-rename/index.d.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/gulp-rename/index.d.ts b/gulp-rename/index.d.ts index 15522d9870..fd90444952 100644 --- a/gulp-rename/index.d.ts +++ b/gulp-rename/index.d.ts @@ -5,19 +5,20 @@ /// +declare namespace rename { + interface ParsedPath { + dirname?: string; + basename?: string; + extname?: string; + } -interface ParsedPath { - dirname?: string; - basename?: string; - extname?: string; -} - -interface Options extends ParsedPath { - prefix?: string; - suffix?: string; + interface Options extends ParsedPath { + prefix?: string; + suffix?: string; + } } declare function rename(name: string): NodeJS.ReadWriteStream; -declare function rename(callback: (path: ParsedPath) => any): NodeJS.ReadWriteStream; -declare function rename(opts: Options): NodeJS.ReadWriteStream; +declare function rename(callback: (path: rename.ParsedPath) => any): NodeJS.ReadWriteStream; +declare function rename(opts: rename.Options): NodeJS.ReadWriteStream; export = rename; From 6ecf9777ff0f101b0576f5dc757387ed5e2305b2 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Fri, 19 Aug 2016 11:13:25 -0700 Subject: [PATCH 096/105] fix jasmine-node --- jasmine-node/index.d.ts | 55 +++++++++++++++--------------- jasmine-node/jasmine-node-tests.ts | 10 +++--- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/jasmine-node/index.d.ts b/jasmine-node/index.d.ts index 152c8eec4d..59a3b11d8a 100644 --- a/jasmine-node/index.d.ts +++ b/jasmine-node/index.d.ts @@ -5,37 +5,38 @@ /// -declare function it(expectation:string, assertion:(done:(err?:any) => void) => void, timeout?:number):void; +declare function it(expectation: string, assertion: (done: (err?: any) => void) => void, timeout?: number): void; declare namespace jasmine { interface Env { defaultTimeoutInterval: number; } + + interface ExecuteSpecsOptions { + specFolders: string[], + onComplete?: (runner: jasmine.Runner) => void, + isVerbose?: boolean, + showColors?: boolean, + teamcity?: string | boolean, + useRequireJs?: boolean, + regExpSpec: RegExp, + junitreport?: { + report: boolean, + savePath: string, + useDotNotation: boolean, + consolidate: boolean + }, + includeStackTrace?: boolean, + growl?: boolean + } + + interface JasmineNode { + executeSpecsInFolder(options: ExecuteSpecsOptions): void; + loadHelpersInFolder(path: string, pattern: RegExp): void; + } } -interface ExecuteSpecsOptions { - specFolders: string[], - onComplete?: (runner:jasmine.Runner) => void, - isVerbose?: boolean, - showColors?: boolean, - teamcity?: string | boolean, - useRequireJs?: boolean, - regExpSpec: RegExp, - junitreport?: { - report: boolean, - savePath: string, - useDotNotation: boolean, - consolidate: boolean - }, - includeStackTrace?: boolean, - growl?: boolean -} - -interface JasmineNode { - executeSpecsInFolder(options:ExecuteSpecsOptions): void; - loadHelpersInFolder(path:string, pattern:RegExp): void; -} - -declare var jasmine:JasmineNode; - -export = jasmine; \ No newline at end of file +declare module "jasmine-node" { + const jasmine: jasmine.JasmineNode; + export = jasmine; +} \ No newline at end of file diff --git a/jasmine-node/jasmine-node-tests.ts b/jasmine-node/jasmine-node-tests.ts index 9cf9540cfa..930cdb990d 100644 --- a/jasmine-node/jasmine-node-tests.ts +++ b/jasmine-node/jasmine-node-tests.ts @@ -3,10 +3,8 @@ // Definitions by: Sven Reglitzki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -it("should have a timeout parameter", () => {}, 1000); -it("should have an optional timeout parameter", () => {}); +it("should have a timeout parameter", () => { }, 1000); +it("should have an optional timeout parameter", () => { }); import jasmine = require("jasmine-node"); @@ -14,7 +12,7 @@ jasmine.loadHelpersInFolder("root", /\.helper\.ts/); jasmine.executeSpecsInFolder({ specFolders: [], - onComplete: (runner) => {console.log(runner.results().failedCount)}, + onComplete: (runner) => { console.log(runner.results().failedCount) }, isVerbose: true, showColors: true, teamcity: false, @@ -22,7 +20,7 @@ jasmine.executeSpecsInFolder({ regExpSpec: /\.spec\.ts/, junitreport: { report: false, - savePath : "./reports/", + savePath: "./reports/", useDotNotation: true, consolidate: true }, From e1d3f3cbb3675d0aaecec669d727918c4c138fd6 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Fri, 19 Aug 2016 11:20:42 -0700 Subject: [PATCH 097/105] fix auth0 --- auth0/index.d.ts | 170 +++++++++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 88 deletions(-) diff --git a/auth0/index.d.ts b/auth0/index.d.ts index e367d30411..019d9edc38 100644 --- a/auth0/index.d.ts +++ b/auth0/index.d.ts @@ -3,93 +3,87 @@ // Definitions by: Seth Westphal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - -declare module "auth0" { - - import * as Promise from 'bluebird'; - - export interface ManagementClientOptions { - token: string; - domain?: string; - } - - export interface UserData { - connection: string; - email?: string; - username?: string; - password?: string; - phone_number?: string; - user_metadata?: {}; - email_verified?: boolean; - app_metadata?: {}; - } - - export interface GetUsersData { - per_page?: number; - page?: number; - include_totals?: boolean; - sort?: string; - connection?: string; - fields?: string; - include_fields?: boolean; - q?: string; - search_engine?: string; - } - - export interface User { - email?: string; - email_verified?: boolean; - username?: string; - phone_number?: string; - phone_verified?: boolean; - user_id?: string; - created_at?: string; - updated_at?: string; - identities?: Identity[]; - app_metadata?: {}; - user_metadata?: {}; - picture?: string; - name?: string; - nickname?: string; - multifactor?: string[]; - last_ip?: string; - last_login?: string; - logins_count?: number; - blocked?: boolean; - } - - export interface Identity { - connection: string; - user_id: string; - provider: string; - isSocial: boolean; - } - - export class ManagementClient { - constructor(options: ManagementClientOptions); - - getUsers(params?: GetUsersData): Promise; - getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void; - createUser(data: UserData): Promise; - createUser(data: UserData, cb: (err: Error, data: User) => void): void; - } - - export interface AuthenticationClientOptions { - clientId?: string; - domain: string; - } - - export interface RequestChangePasswordEmailData { - connection: string; - email: string; - } - - export class AuthenticationClient { - constructor(options: AuthenticationClientOptions); - - requestChangePasswordEmail(data: RequestChangePasswordEmailData): Promise; - requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void; - } +import * as Promise from 'bluebird'; +export interface ManagementClientOptions { + token: string; + domain?: string; } + +export interface UserData { + connection: string; + email?: string; + username?: string; + password?: string; + phone_number?: string; + user_metadata?: {}; + email_verified?: boolean; + app_metadata?: {}; +} + +export interface GetUsersData { + per_page?: number; + page?: number; + include_totals?: boolean; + sort?: string; + connection?: string; + fields?: string; + include_fields?: boolean; + q?: string; + search_engine?: string; +} + +export interface User { + email?: string; + email_verified?: boolean; + username?: string; + phone_number?: string; + phone_verified?: boolean; + user_id?: string; + created_at?: string; + updated_at?: string; + identities?: Identity[]; + app_metadata?: {}; + user_metadata?: {}; + picture?: string; + name?: string; + nickname?: string; + multifactor?: string[]; + last_ip?: string; + last_login?: string; + logins_count?: number; + blocked?: boolean; +} + +export interface Identity { + connection: string; + user_id: string; + provider: string; + isSocial: boolean; +} + +export class ManagementClient { + constructor(options: ManagementClientOptions); + + getUsers(params?: GetUsersData): Promise; + getUsers(params?: GetUsersData, cb?: (err: Error, users: User[]) => void): void; + createUser(data: UserData): Promise; + createUser(data: UserData, cb: (err: Error, data: User) => void): void; +} + +export interface AuthenticationClientOptions { + clientId?: string; + domain: string; +} + +export interface RequestChangePasswordEmailData { + connection: string; + email: string; +} + +export class AuthenticationClient { + constructor(options: AuthenticationClientOptions); + + requestChangePasswordEmail(data: RequestChangePasswordEmailData): Promise; + requestChangePasswordEmail(data: RequestChangePasswordEmailData, cb: (err: Error, message: string) => void): void; +} \ No newline at end of file From 389c99a47f9b65dc735fb39ce5a48a40823270c1 Mon Sep 17 00:00:00 2001 From: Paul van Brenk Date: Fri, 19 Aug 2016 13:40:17 -0700 Subject: [PATCH 098/105] fix react --- react/react-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react-tests.ts b/react/react-tests.ts index 28f7c442e9..4351312ee7 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -120,7 +120,7 @@ class ModernComponent extends React.Component value: this.state.inputValue }), React.DOM.input({ - onChange: event => console.log(event.target.value) + onChange: event => console.log(event.target) })); } From 40ca653587df6df2db61bc5b3928e183fd1ccfdc Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Tue, 21 Jun 2016 14:32:06 -0700 Subject: [PATCH 099/105] Moved everything out of cordova/plugins --- .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 2 +- .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../StatusBar-tests.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 .../index.d.ts | 0 cordova/plugins/Push.d.ts | 70 ------------------- 21 files changed, 1 insertion(+), 71 deletions(-) rename cordova/plugins/BatteryStatus.d.ts => cordova-plugin-battery-status/index.d.ts (100%) rename cordova/plugins/Camera.d.ts => cordova-plugin-camera/index.d.ts (100%) rename cordova/plugins/Contacts.d.ts => cordova-plugin-contacts/index.d.ts (100%) rename cordova/plugins/DeviceMotion.d.ts => cordova-plugin-device-motion/index.d.ts (100%) rename cordova/plugins/DeviceOrientation.d.ts => cordova-plugin-device-orientation/index.d.ts (100%) rename cordova/plugins/Device.d.ts => cordova-plugin-device/index.d.ts (100%) rename cordova/plugins/Dialogs.d.ts => cordova-plugin-dialogs/index.d.ts (100%) rename cordova/plugins/FileTransfer.d.ts => cordova-plugin-file-transfer/index.d.ts (99%) rename cordova/plugins/FileSystem.d.ts => cordova-plugin-file/index.d.ts (100%) rename cordova/plugins/Globalization.d.ts => cordova-plugin-globalization/index.d.ts (100%) rename cordova/plugins/InAppBrowser.d.ts => cordova-plugin-inappbrowser/index.d.ts (100%) rename cordova/plugins/Keyboard.d.ts => cordova-plugin-keyboard/index.d.ts (100%) rename cordova/plugins/MediaCapture.d.ts => cordova-plugin-media-capture/index.d.ts (100%) rename cordova/plugins/Media.d.ts => cordova-plugin-media/index.d.ts (100%) rename cordova/plugins/NetworkInformation.d.ts => cordova-plugin-network-information/index.d.ts (100%) rename cordova/plugins/Splashscreen.d.ts => cordova-plugin-spashscreen/index.d.ts (100%) rename {cordova/plugins => cordova-plugin-statusbar}/StatusBar-tests.ts (100%) rename cordova/plugins/StatusBar.d.ts => cordova-plugin-statusbar/index.d.ts (100%) rename cordova/plugins/Vibration.d.ts => cordova-plugin-vibration/index.d.ts (100%) rename cordova/plugins/WebSQL.d.ts => cordova-plugin-websql/index.d.ts (100%) delete mode 100644 cordova/plugins/Push.d.ts diff --git a/cordova/plugins/BatteryStatus.d.ts b/cordova-plugin-battery-status/index.d.ts similarity index 100% rename from cordova/plugins/BatteryStatus.d.ts rename to cordova-plugin-battery-status/index.d.ts diff --git a/cordova/plugins/Camera.d.ts b/cordova-plugin-camera/index.d.ts similarity index 100% rename from cordova/plugins/Camera.d.ts rename to cordova-plugin-camera/index.d.ts diff --git a/cordova/plugins/Contacts.d.ts b/cordova-plugin-contacts/index.d.ts similarity index 100% rename from cordova/plugins/Contacts.d.ts rename to cordova-plugin-contacts/index.d.ts diff --git a/cordova/plugins/DeviceMotion.d.ts b/cordova-plugin-device-motion/index.d.ts similarity index 100% rename from cordova/plugins/DeviceMotion.d.ts rename to cordova-plugin-device-motion/index.d.ts diff --git a/cordova/plugins/DeviceOrientation.d.ts b/cordova-plugin-device-orientation/index.d.ts similarity index 100% rename from cordova/plugins/DeviceOrientation.d.ts rename to cordova-plugin-device-orientation/index.d.ts diff --git a/cordova/plugins/Device.d.ts b/cordova-plugin-device/index.d.ts similarity index 100% rename from cordova/plugins/Device.d.ts rename to cordova-plugin-device/index.d.ts diff --git a/cordova/plugins/Dialogs.d.ts b/cordova-plugin-dialogs/index.d.ts similarity index 100% rename from cordova/plugins/Dialogs.d.ts rename to cordova-plugin-dialogs/index.d.ts diff --git a/cordova/plugins/FileTransfer.d.ts b/cordova-plugin-file-transfer/index.d.ts similarity index 99% rename from cordova/plugins/FileTransfer.d.ts rename to cordova-plugin-file-transfer/index.d.ts index 40829668aa..8dad62a1e9 100644 --- a/cordova/plugins/FileTransfer.d.ts +++ b/cordova-plugin-file-transfer/index.d.ts @@ -6,7 +6,7 @@ // Copyright (c) Microsoft Open Technologies, Inc. // Licensed under the MIT license. -/// +/// /** * The FileTransfer object provides a way to upload files using an HTTP multi-part POST request, diff --git a/cordova/plugins/FileSystem.d.ts b/cordova-plugin-file/index.d.ts similarity index 100% rename from cordova/plugins/FileSystem.d.ts rename to cordova-plugin-file/index.d.ts diff --git a/cordova/plugins/Globalization.d.ts b/cordova-plugin-globalization/index.d.ts similarity index 100% rename from cordova/plugins/Globalization.d.ts rename to cordova-plugin-globalization/index.d.ts diff --git a/cordova/plugins/InAppBrowser.d.ts b/cordova-plugin-inappbrowser/index.d.ts similarity index 100% rename from cordova/plugins/InAppBrowser.d.ts rename to cordova-plugin-inappbrowser/index.d.ts diff --git a/cordova/plugins/Keyboard.d.ts b/cordova-plugin-keyboard/index.d.ts similarity index 100% rename from cordova/plugins/Keyboard.d.ts rename to cordova-plugin-keyboard/index.d.ts diff --git a/cordova/plugins/MediaCapture.d.ts b/cordova-plugin-media-capture/index.d.ts similarity index 100% rename from cordova/plugins/MediaCapture.d.ts rename to cordova-plugin-media-capture/index.d.ts diff --git a/cordova/plugins/Media.d.ts b/cordova-plugin-media/index.d.ts similarity index 100% rename from cordova/plugins/Media.d.ts rename to cordova-plugin-media/index.d.ts diff --git a/cordova/plugins/NetworkInformation.d.ts b/cordova-plugin-network-information/index.d.ts similarity index 100% rename from cordova/plugins/NetworkInformation.d.ts rename to cordova-plugin-network-information/index.d.ts diff --git a/cordova/plugins/Splashscreen.d.ts b/cordova-plugin-spashscreen/index.d.ts similarity index 100% rename from cordova/plugins/Splashscreen.d.ts rename to cordova-plugin-spashscreen/index.d.ts diff --git a/cordova/plugins/StatusBar-tests.ts b/cordova-plugin-statusbar/StatusBar-tests.ts similarity index 100% rename from cordova/plugins/StatusBar-tests.ts rename to cordova-plugin-statusbar/StatusBar-tests.ts diff --git a/cordova/plugins/StatusBar.d.ts b/cordova-plugin-statusbar/index.d.ts similarity index 100% rename from cordova/plugins/StatusBar.d.ts rename to cordova-plugin-statusbar/index.d.ts diff --git a/cordova/plugins/Vibration.d.ts b/cordova-plugin-vibration/index.d.ts similarity index 100% rename from cordova/plugins/Vibration.d.ts rename to cordova-plugin-vibration/index.d.ts diff --git a/cordova/plugins/WebSQL.d.ts b/cordova-plugin-websql/index.d.ts similarity index 100% rename from cordova/plugins/WebSQL.d.ts rename to cordova-plugin-websql/index.d.ts diff --git a/cordova/plugins/Push.d.ts b/cordova/plugins/Push.d.ts deleted file mode 100644 index 631cb7f008..0000000000 --- a/cordova/plugins/Push.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -// Type definitions for Apache Cordova Push plugin. -// Project: https://github.com/phonegap-build/PushPlugin -// Definitions by: Microsoft Open Technologies, Inc. -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. - -interface Window { - plugins: Plugins -} - -interface Plugins { - /** - * This plugin allows to receive push notifications. The Android implementation uses - * Google's GCM (Google Cloud Messaging) service, - * whereas the iOS version is based on Apple APNS Notifications - */ - pushNotification: PushNotification -} - -/** - * This plugin allows to receive push notifications. The Android implementation uses - * Google's GCM (Google Cloud Messaging) service, - * whereas the iOS version is based on Apple APNS Notifications - */ -interface PushNotification { - /** - * Registers as push notification receiver. - * @param successCallback Called when a plugin method returns without error. - * @param errorCallback Called when the plugin returns an error. - * @param registrationOptions Options for registration process. - */ - register( - successCallback: (registrationId: string) => void, - errorCallback: (error: any) => void, - registrationOptions: RegistrationOptions): void; - /** - * Unregisters as push notification receiver. - * @param successCallback Called when a plugin method returns without error. - * @param errorCallback Called when the plugin returns an error. - */ - unregister( - successCallback: (result: any) => void, - errorCallback: (error: any) => void): void; - /** - * Sets the badge count visible when the app is not running. iOS only. - * @param successCallback Called when a plugin method returns without error. - * @param errorCallback Called when the plugin returns an error. - * @param badgeCount An integer indicating what number should show up in the badge. Passing 0 will clear the badge. - */ - setApplicationIconBadgeNumber( - successCallback: (result: any) => void, - errorCallback: (error: any) => void, - badgeCount: number): void; -} - -/** Options for registration process. */ -interface RegistrationOptions { - /** This is the Google project ID you need to obtain by registering your application for GCM. Android only */ - senderID?: string; - /** WP8 only */ - channelName?: string; - /** Callback, that is fired when notification arrived */ - ecb?: string; - badge?: boolean; - sound?: boolean; - alert?: boolean -} - From 363098a560c264db529d64fb5b82052c8d88e6d1 Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Wed, 6 Jul 2016 14:42:20 -0700 Subject: [PATCH 100/105] Fixing failed tests --- .../index.d.ts | 0 cordova/cordova-tests.ts | 38 ++++++++++--------- cordova/index.d.ts | 21 +--------- cordova/tsconfig.json | 10 +---- 4 files changed, 24 insertions(+), 45 deletions(-) rename {cordova-plugin-spashscreen => cordova-plugin-splashscreen}/index.d.ts (100%) diff --git a/cordova-plugin-spashscreen/index.d.ts b/cordova-plugin-splashscreen/index.d.ts similarity index 100% rename from cordova-plugin-spashscreen/index.d.ts rename to cordova-plugin-splashscreen/index.d.ts diff --git a/cordova/cordova-tests.ts b/cordova/cordova-tests.ts index 6ab730af11..d3f790967c 100644 --- a/cordova/cordova-tests.ts +++ b/cordova/cordova-tests.ts @@ -4,6 +4,26 @@ // Apache Cordova core //---------------------------------------------------------------------- +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + console.log('cordova.version: ' + cordova.version + ', cordova.platformId: ' + cordova.platformId); console.log(typeof window.cordova); @@ -246,23 +266,6 @@ navigator.device.capture.captureAudio( duration: 10 }); -// Push Notifications -//---------------------------------------------------------------------- - -var pushNotification = window.plugins.pushNotification; -pushNotification.register( - (regId: string) => { console.log('Successfully registered'); }, - (err: any) => { alert('Error!'); }, - { - channelName: "your_channel_name", - ecb: "onNotification" - }); - -function onNotification(e: any) { - navigator.notification.alert(e.text2, () => { }, e.text1); -} - -window.plugins.pushNotification.unregister(() => { }, () => { }); // Network Plugin //---------------------------------------------------------------------- @@ -328,3 +331,4 @@ Keyboard.onshowing = function () { Keyboard.onhiding= function () { console.log('onhiding'); }; + diff --git a/cordova/index.d.ts b/cordova/index.d.ts index a830fa4881..91ea02bc26 100644 --- a/cordova/index.d.ts +++ b/cordova/index.d.ts @@ -6,26 +6,7 @@ // Copyright (c) Microsoft Open Technologies, Inc. // Licensed under the MIT license. -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// + interface Cordova { /** Invokes native functionality by specifying corresponding service name, action and optional parameters. diff --git a/cordova/tsconfig.json b/cordova/tsconfig.json index e70b5ee0a5..b09d75d7b1 100644 --- a/cordova/tsconfig.json +++ b/cordova/tsconfig.json @@ -2,15 +2,9 @@ "compilerOptions": { "module": "commonjs", "target": "es6", - "noImplicitAny": true, + "noImplicitAny": false, "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true + "noEmit": true }, "files": [ "index.d.ts", From 54dff5fea5c8ff600b810a78a6f05353ed38db83 Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Wed, 13 Jul 2016 18:08:11 -0700 Subject: [PATCH 101/105] Split tests into each folder --- cordova-plugin-battery-status/tests.ts | 7 + cordova-plugin-battery-status/tsconfig.json | 13 + cordova-plugin-camera/tests.ts | 13 + cordova-plugin-camera/tsconfig.json | 13 + cordova-plugin-contacts/tests.ts | 18 ++ cordova-plugin-contacts/tsconfig.json | 13 + cordova-plugin-device-motion/tests.ts | 12 + cordova-plugin-device-motion/tsconfig.json | 13 + cordova-plugin-device-orientation/tests.ts | 13 + .../tsconfig.json | 13 + cordova-plugin-device/tests.ts | 3 + cordova-plugin-device/tsconfig.json | 13 + cordova-plugin-dialogs/tests.ts | 4 + cordova-plugin-dialogs/tsconfig.json | 13 + cordova-plugin-file-transfer/tests.ts | 39 +++ cordova-plugin-file-transfer/tsconfig.json | 13 + cordova-plugin-file/tests.ts | 40 +++ cordova-plugin-file/tsconfig.json | 13 + cordova-plugin-globalization/tests.ts | 13 + cordova-plugin-globalization/tsconfig.json | 13 + cordova-plugin-inappbrowser/tests.ts | 15 + cordova-plugin-inappbrowser/tsconfig.json | 13 + cordova-plugin-keyboard/tests.ts | 25 ++ cordova-plugin-keyboard/tsconfig.json | 13 + cordova-plugin-media-capture/tests.ts | 13 + cordova-plugin-media-capture/tsconfig.json | 13 + cordova-plugin-media/tests.ts | 13 + cordova-plugin-media/tsconfig.json | 13 + cordova-plugin-network-information/tests.ts | 8 + .../tsconfig.json | 13 + cordova-plugin-splashscreen/tests.ts | 4 + cordova-plugin-splashscreen/tsconfig.json | 13 + .../{StatusBar-tests.ts => tests.ts} | 3 +- cordova-plugin-statusbar/tsconfig.json | 13 + cordova-plugin-vibration/tests.ts | 8 + cordova-plugin-vibration/tsconfig.json | 13 + cordova-plugin-websql/tests.ts | 16 + cordova-plugin-websql/tsconfig.json | 13 + cordova/cordova-tests.ts | 296 ------------------ 39 files changed, 512 insertions(+), 298 deletions(-) create mode 100644 cordova-plugin-battery-status/tests.ts create mode 100644 cordova-plugin-battery-status/tsconfig.json create mode 100644 cordova-plugin-camera/tests.ts create mode 100644 cordova-plugin-camera/tsconfig.json create mode 100644 cordova-plugin-contacts/tests.ts create mode 100644 cordova-plugin-contacts/tsconfig.json create mode 100644 cordova-plugin-device-motion/tests.ts create mode 100644 cordova-plugin-device-motion/tsconfig.json create mode 100644 cordova-plugin-device-orientation/tests.ts create mode 100644 cordova-plugin-device-orientation/tsconfig.json create mode 100644 cordova-plugin-device/tests.ts create mode 100644 cordova-plugin-device/tsconfig.json create mode 100644 cordova-plugin-dialogs/tests.ts create mode 100644 cordova-plugin-dialogs/tsconfig.json create mode 100644 cordova-plugin-file-transfer/tests.ts create mode 100644 cordova-plugin-file-transfer/tsconfig.json create mode 100644 cordova-plugin-file/tests.ts create mode 100644 cordova-plugin-file/tsconfig.json create mode 100644 cordova-plugin-globalization/tests.ts create mode 100644 cordova-plugin-globalization/tsconfig.json create mode 100644 cordova-plugin-inappbrowser/tests.ts create mode 100644 cordova-plugin-inappbrowser/tsconfig.json create mode 100644 cordova-plugin-keyboard/tests.ts create mode 100644 cordova-plugin-keyboard/tsconfig.json create mode 100644 cordova-plugin-media-capture/tests.ts create mode 100644 cordova-plugin-media-capture/tsconfig.json create mode 100644 cordova-plugin-media/tests.ts create mode 100644 cordova-plugin-media/tsconfig.json create mode 100644 cordova-plugin-network-information/tests.ts create mode 100644 cordova-plugin-network-information/tsconfig.json create mode 100644 cordova-plugin-splashscreen/tests.ts create mode 100644 cordova-plugin-splashscreen/tsconfig.json rename cordova-plugin-statusbar/{StatusBar-tests.ts => tests.ts} (91%) create mode 100644 cordova-plugin-statusbar/tsconfig.json create mode 100644 cordova-plugin-vibration/tests.ts create mode 100644 cordova-plugin-vibration/tsconfig.json create mode 100644 cordova-plugin-websql/tests.ts create mode 100644 cordova-plugin-websql/tsconfig.json diff --git a/cordova-plugin-battery-status/tests.ts b/cordova-plugin-battery-status/tests.ts new file mode 100644 index 0000000000..4dafa2e966 --- /dev/null +++ b/cordova-plugin-battery-status/tests.ts @@ -0,0 +1,7 @@ +/// + +window.addEventListener('batterystatus', + (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); + +window.addEventListener('batterycritical', + () => { alert('Battery is critical low!'); }); \ No newline at end of file diff --git a/cordova-plugin-battery-status/tsconfig.json b/cordova-plugin-battery-status/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-battery-status/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-camera/tests.ts b/cordova-plugin-camera/tests.ts new file mode 100644 index 0000000000..00edf02b0a --- /dev/null +++ b/cordova-plugin-camera/tests.ts @@ -0,0 +1,13 @@ +/// + +navigator.camera.getPicture( + (data: string) => { alert('Got photo!'); }, + (message: string)=> { alert('Failed!: ' + message); }, + { + allowEdit: true, + cameraDirection: Camera.Direction.BACK, + destinationType: Camera.DestinationType.FILE_URI, + encodingType: Camera.EncodingType.JPEG, + sourceType: Camera.PictureSourceType.PHOTOLIBRARY, + quality: 80 + }); diff --git a/cordova-plugin-camera/tsconfig.json b/cordova-plugin-camera/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-camera/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-contacts/tests.ts b/cordova-plugin-contacts/tests.ts new file mode 100644 index 0000000000..c50912c3ba --- /dev/null +++ b/cordova-plugin-contacts/tests.ts @@ -0,0 +1,18 @@ +/// + +var contact: Contact = navigator.contacts.create({ + nickname: 'John Smith', + displayName: 'John Smith', + phoneNumbers: [{ pref: true, type: "work", value: "+185642556856" }] +}); + +navigator.contacts.find(["phoneNumbers"], + (contacts: Contact[])=> { alert('Find ' + contacts.length + ' contacts'); }, + (error: ContactError) => { alert('Error: ' + error.message); }, + new ContactFindOptions("+1", true) +); + +navigator.contacts.pickContact( + (contact: Contact)=> { console.log(contact); }, + (err: ContactError)=> { console.log(err.message); } +); diff --git a/cordova-plugin-contacts/tsconfig.json b/cordova-plugin-contacts/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-contacts/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-device-motion/tests.ts b/cordova-plugin-device-motion/tests.ts new file mode 100644 index 0000000000..17b1e49930 --- /dev/null +++ b/cordova-plugin-device-motion/tests.ts @@ -0,0 +1,12 @@ +/// + +navigator.accelerometer.getCurrentAcceleration( + (acc: Acceleration) => { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, + () => { alert('Error!'); }); + +var acchandle: WatchHandle = navigator.accelerometer.watchAcceleration( + (acc: Acceleration)=> { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, + () => { alert('Error!'); }, + { frequency: 10 }); + +navigator.accelerometer.clearWatch(acchandle); diff --git a/cordova-plugin-device-motion/tsconfig.json b/cordova-plugin-device-motion/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-device-motion/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-device-orientation/tests.ts b/cordova-plugin-device-orientation/tests.ts new file mode 100644 index 0000000000..097a66e99e --- /dev/null +++ b/cordova-plugin-device-orientation/tests.ts @@ -0,0 +1,13 @@ +/// + +navigator.compass.getCurrentHeading( + (heading: CompassHeading)=> { console.log('Got heading to ' + heading.magneticHeading); }, + (error: CompassError)=> { alert('Error! ' + error.code); }, + { frequency: 10 }); + +var accelhandle = navigator.compass.watchHeading( + (heading: CompassHeading) => { console.log('Got heading to ' + heading.magneticHeading); }, + (error: CompassError) => { alert('Error! ' + error.code); }, + { frequency: 10 }); + +navigator.compass.clearWatch(accelhandle); diff --git a/cordova-plugin-device-orientation/tsconfig.json b/cordova-plugin-device-orientation/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-device-orientation/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-device/tests.ts b/cordova-plugin-device/tests.ts new file mode 100644 index 0000000000..450eadb1f0 --- /dev/null +++ b/cordova-plugin-device/tests.ts @@ -0,0 +1,3 @@ +/// + +console.log(JSON.stringify(device)); \ No newline at end of file diff --git a/cordova-plugin-device/tsconfig.json b/cordova-plugin-device/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-device/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-dialogs/tests.ts b/cordova-plugin-dialogs/tests.ts new file mode 100644 index 0000000000..dd9396f36f --- /dev/null +++ b/cordova-plugin-dialogs/tests.ts @@ -0,0 +1,4 @@ +/// + +navigator.notification.alert('Alert!', () => { alert('You\'re alerted'); }, 'Alert', 'Ok'); +navigator.notification.confirm('Are you ok?', (choice: number) => { alert('Your choice is ' + choice); }); diff --git a/cordova-plugin-dialogs/tsconfig.json b/cordova-plugin-dialogs/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-dialogs/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-file-transfer/tests.ts b/cordova-plugin-file-transfer/tests.ts new file mode 100644 index 0000000000..4050b2c4aa --- /dev/null +++ b/cordova-plugin-file-transfer/tests.ts @@ -0,0 +1,39 @@ +/// + +var file = new FileTransfer(); + +file.onprogress = (ev: ProgressEvent) => { + if (ev.lengthComputable) { + console.log(ev.loaded + '/' + ev.total); + } +}; + +file.download('http://some.server.com/download.php', + 'cdvfile://localhost/persistent/path/to/downloads/', + (file: FileEntry)=> { console.log('File Downloaded to ' + file.fullPath); }, + (err: FileTransferError) => { + console.error('Error ' + err.code); + if (err.exception) { + console.error('Failed with exception ' + err.exception); + } + }, + true, + { + headers: { + "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" + } + }); + +file.upload('cdvfile://localhost/persistent/path/to/downloads/', + 'http://some.server.com/download.php', + (result: FileUploadResult)=> { console.log('File uploaded. Bytes uploaded: ' + result.bytesSent); }, + (err: FileTransferError) => { + console.error('Error ' + err.code); + if (err.exception) { + console.error('Failed with exception ' + err.exception); + } + }, + { headers: {"X-Email": "user@mail.com", 'X-Token': "asdf3w234"}, httpMethod: "PUT" }, + true); + +file.abort(); diff --git a/cordova-plugin-file-transfer/tsconfig.json b/cordova-plugin-file-transfer/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-file-transfer/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-file/tests.ts b/cordova-plugin-file/tests.ts new file mode 100644 index 0000000000..a95872a229 --- /dev/null +++ b/cordova-plugin-file/tests.ts @@ -0,0 +1,40 @@ +/// +/// + +function fsaccessor(fs: FileSystem) { + console.log('FS root is: ' + fs.root.name); + var fsreader: DirectoryReader = fs.root.createReader(); + fsreader.readEntries( + (entries: Entry[]) => { console.log(fs.root.name + ' has ' + entries.length + ' child elements'); }, + (err: FileError)=> { alert('Error: ' + err.code); }); +} + +window.requestFileSystem( + window.TEMPORARY, + 1024 * 1024 * 5, + fsaccessor, + (err: FileError) => { alert('Error: ' + err.code); } +); + +window.resolveLocalFileSystemURI(cordova.file.applicationDirectory, + (entry: Entry)=> { + if (entry.isDirectory) { + console.log('successfully resolved ' + entry.fullPath + 'directory'); + console.log(entry.toURL()); + console.log(entry.toInternalURL()); + } else { + var fentry = entry; + fentry.file((f: File) => { console.log(f.slice(f.size - 10, f.size)); }); + fentry.createWriter((writer: FileWriter)=> { + if (writer.readyState == FileWriter.INIT) { + console.log('Init FileWriter'); + writer.write(new Blob(['sdfdsfsdf'])); + writer.onprogress = function(ev: ProgressEvent) { + console.log('Writing ' + ev.target); + }; + } + }); + } + }, + (error: FileError) => { console.log(error.code); } +); \ No newline at end of file diff --git a/cordova-plugin-file/tsconfig.json b/cordova-plugin-file/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-file/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-globalization/tests.ts b/cordova-plugin-globalization/tests.ts new file mode 100644 index 0000000000..0a58703a32 --- /dev/null +++ b/cordova-plugin-globalization/tests.ts @@ -0,0 +1,13 @@ +/// + +navigator.globalization.dateToString(new Date(), + (date) => { console.log(JSON.stringify(date)); }, + (error) => { alert(error.message); }, + { formatLength: "short", selector: "date" }); + +navigator.globalization.getDateNames( + (names) => { + names.value.forEach((name) => { console.log(name); }); + }, + (error) => { alert(error.message); }, + { item: "months", type: "wide" }); \ No newline at end of file diff --git a/cordova-plugin-globalization/tsconfig.json b/cordova-plugin-globalization/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-globalization/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-inappbrowser/tests.ts b/cordova-plugin-inappbrowser/tests.ts new file mode 100644 index 0000000000..43b0d28153 --- /dev/null +++ b/cordova-plugin-inappbrowser/tests.ts @@ -0,0 +1,15 @@ +/// + +// InAppBrowser plugin +//---------------------------------------------------------------------- + +// signature of window.open() added by InAppBrowser plugin +// is similar to native window.open signature, so the compiler can's +// select proper overload, but we cast result to InAppBrowser manually. +var iab = window.open('google.com', '_self'); +iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); }); +iab.show(); +iab.executeScript( + { code: "console.log('Injected script in action')" }, + ()=> { console.log('Script is executed'); } +); \ No newline at end of file diff --git a/cordova-plugin-inappbrowser/tsconfig.json b/cordova-plugin-inappbrowser/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-inappbrowser/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-keyboard/tests.ts b/cordova-plugin-keyboard/tests.ts new file mode 100644 index 0000000000..3dce2776bf --- /dev/null +++ b/cordova-plugin-keyboard/tests.ts @@ -0,0 +1,25 @@ +/// + +Keyboard.shrinkView(true); +Keyboard.shrinkView(false); +Keyboard.hideFormAccessoryBar(true); +Keyboard.hideFormAccessoryBar(false); +Keyboard.disableScrollingInShrinkView(true); +Keyboard.disableScrollingInShrinkView(false); +if (Keyboard.isVisible) { + console.log('Keyboard is visible'); +} +Keyboard.automaticScrollToTopOnHiding = true; +Keyboard.onshow = function () { + console.log('onshow'); +}; +Keyboard.onhide = function () { + console.log('onhide'); +}; +Keyboard.onshowing = function () { + console.log('onshowing'); +}; +Keyboard.onhiding= function () { + console.log('onhiding'); +}; + diff --git a/cordova-plugin-keyboard/tsconfig.json b/cordova-plugin-keyboard/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-keyboard/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-media-capture/tests.ts b/cordova-plugin-media-capture/tests.ts new file mode 100644 index 0000000000..8bd56c714f --- /dev/null +++ b/cordova-plugin-media-capture/tests.ts @@ -0,0 +1,13 @@ +/// + +console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); + +navigator.device.capture.captureAudio( + (captures: MediaFile[]) => { console.log(captures.length + ' captured'); }, + (err: CaptureError) => { alert('Error ' + err.message); }, + { + limit: 3, + duration: 10 + } +); + diff --git a/cordova-plugin-media-capture/tsconfig.json b/cordova-plugin-media-capture/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-media-capture/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-media/tests.ts b/cordova-plugin-media/tests.ts new file mode 100644 index 0000000000..a36df13cc3 --- /dev/null +++ b/cordova-plugin-media/tests.ts @@ -0,0 +1,13 @@ +/// + +// Media and Media Capture +//---------------------------------------------------------------------- + +var media = new Media('', + () => { console.log('Media opened'); }, + (err: MediaError) => { alert('Error: ' + err.code); }); +media.play(); +media.setVolume(10); + +console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); + diff --git a/cordova-plugin-media/tsconfig.json b/cordova-plugin-media/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-media/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-network-information/tests.ts b/cordova-plugin-network-information/tests.ts new file mode 100644 index 0000000000..702aeb5714 --- /dev/null +++ b/cordova-plugin-network-information/tests.ts @@ -0,0 +1,8 @@ +/// + +var connType = navigator.connection.type; +if (connType == Connection.WIFI) { + console.log('Congratulations, you\'re with fast Internet!'); +} + +document.addEventListener('offline', () => { alert('You\'re offline!'); }); diff --git a/cordova-plugin-network-information/tsconfig.json b/cordova-plugin-network-information/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-network-information/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-splashscreen/tests.ts b/cordova-plugin-splashscreen/tests.ts new file mode 100644 index 0000000000..d24720eb1d --- /dev/null +++ b/cordova-plugin-splashscreen/tests.ts @@ -0,0 +1,4 @@ +/// + +navigator.splashscreen.show(); +navigator.splashscreen.hide(); \ No newline at end of file diff --git a/cordova-plugin-splashscreen/tsconfig.json b/cordova-plugin-splashscreen/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-splashscreen/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-statusbar/StatusBar-tests.ts b/cordova-plugin-statusbar/tests.ts similarity index 91% rename from cordova-plugin-statusbar/StatusBar-tests.ts rename to cordova-plugin-statusbar/tests.ts index 01ab0bf945..9d22ca912c 100644 --- a/cordova-plugin-statusbar/StatusBar-tests.ts +++ b/cordova-plugin-statusbar/tests.ts @@ -1,5 +1,4 @@ -// Licensed under the MIT license. - +/// var statusBar: StatusBar = window.StatusBar; diff --git a/cordova-plugin-statusbar/tsconfig.json b/cordova-plugin-statusbar/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-statusbar/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-vibration/tests.ts b/cordova-plugin-vibration/tests.ts new file mode 100644 index 0000000000..b34cd23675 --- /dev/null +++ b/cordova-plugin-vibration/tests.ts @@ -0,0 +1,8 @@ +/// + +var notification: Notification; + +notification.vibrate(100); +notification.vibrateWithPattern([100, 200, 200, 150, 50], 3); +setTimeout(notification.cancelVibration, 1000); + diff --git a/cordova-plugin-vibration/tsconfig.json b/cordova-plugin-vibration/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-vibration/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova-plugin-websql/tests.ts b/cordova-plugin-websql/tests.ts new file mode 100644 index 0000000000..8679b3d5c3 --- /dev/null +++ b/cordova-plugin-websql/tests.ts @@ -0,0 +1,16 @@ +/// + + +var db = window.openDatabase('Test', '0.1', 'test', 1024 * 1024 * 5); +db.transaction( + (tx: SqlTransaction) => { + tx.executeSql('CREATE TABLE Sample IF NOT EXIST...'); + tx.executeSql('INSERT INTO Sample VALUES...'); + }, + (err: SqlError) => { + if (err.code = SqlError.SYNTAX_ERR) { + alert('Error ' + err.message); + } + }, + () => { console.log('Transaction completed successfully'); } +); \ No newline at end of file diff --git a/cordova-plugin-websql/tsconfig.json b/cordova-plugin-websql/tsconfig.json new file mode 100644 index 0000000000..b999e403b2 --- /dev/null +++ b/cordova-plugin-websql/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "strictNullChecks": false, + "noEmit": true + }, + "files": [ + "index.d.ts", + "tests.ts" + ] +} \ No newline at end of file diff --git a/cordova/cordova-tests.ts b/cordova/cordova-tests.ts index d3f790967c..8b578b8a15 100644 --- a/cordova/cordova-tests.ts +++ b/cordova/cordova-tests.ts @@ -4,23 +4,6 @@ // Apache Cordova core //---------------------------------------------------------------------- -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// /// /// @@ -50,285 +33,6 @@ declare var app: Application; document.addEventListener('deviceready', () => { app.start(); }); document.addEventListener('pause', ()=> { app.pause(); }); -// Battery status plugin -//---------------------------------------------------------------------- -window.addEventListener('batterystatus', - (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); - -window.addEventListener('batterycritical', - () => { alert('Battery is critical low!'); }); - -// Camera plugin -//---------------------------------------------------------------------- - -navigator.camera.getPicture( - (data: string) => { alert('Got photo!'); }, - (message: string)=> { alert('Failed!: ' + message); }, - { - allowEdit: true, - cameraDirection: Camera.Direction.BACK, - destinationType: Camera.DestinationType.FILE_URI, - encodingType: Camera.EncodingType.JPEG, - sourceType: Camera.PictureSourceType.PHOTOLIBRARY, - quality: 80 - }); - -// Contacts plugin -//---------------------------------------------------------------------- - -var contact: Contact = navigator.contacts.create({ - nickname: 'John Smith', - displayName: 'John Smith', - phoneNumbers: [{ pref: true, type: "work", value: "+185642556856" }] -}); - -navigator.contacts.find(["phoneNumbers"], - (contacts: Contact[])=> { alert('Find ' + contacts.length + ' contacts'); }, - (error: ContactError) => { alert('Error: ' + error.message); }, - new ContactFindOptions("+1", true) -); - -navigator.contacts.pickContact( - (contact: Contact)=> { console.log(contact); }, - (err: ContactError)=> { console.log(err.message); } -); - -// Device API -//---------------------------------------------------------------------- - -console.log(JSON.stringify(device)); - -// DeviceMotion plugin -//---------------------------------------------------------------------- - -navigator.accelerometer.getCurrentAcceleration( - (acc: Acceleration) => { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, - () => { alert('Error!'); }); - -var acchandle: WatchHandle = navigator.accelerometer.watchAcceleration( - (acc: Acceleration)=> { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, - () => { alert('Error!'); }, - { frequency: 10 }); - -navigator.accelerometer.clearWatch(acchandle); - -// DeviceOrientation plugin -//---------------------------------------------------------------------- - -navigator.compass.getCurrentHeading( - (heading: CompassHeading)=> { console.log('Got heading to ' + heading.magneticHeading); }, - (error: CompassError)=> { alert('Error! ' + error.code); }, - { frequency: 10 }); - -var accelhandle = navigator.compass.watchHeading( - (heading: CompassHeading) => { console.log('Got heading to ' + heading.magneticHeading); }, - (error: CompassError) => { alert('Error! ' + error.code); }, - { frequency: 10 }); - -navigator.compass.clearWatch(accelhandle); - -// Dialogs plugin -//---------------------------------------------------------------------- - -navigator.notification.alert('Alert!', () => { alert('You\'re alerted'); }, 'Alert', 'Ok'); -navigator.notification.confirm('Are you ok?', (choice: number) => { alert('Your choice is ' + choice); }); - -// FileSystem plugin -//---------------------------------------------------------------------- - -function fsaccessor(fs: FileSystem) { - console.log('FS root is: ' + fs.root.name); - var fsreader: DirectoryReader = fs.root.createReader(); - fsreader.readEntries( - (entries: Entry[]) => { console.log(fs.root.name + ' has ' + entries.length + ' child elements'); }, - (err: FileError)=> { alert('Error: ' + err.code); }); -} - -window.requestFileSystem( - window.TEMPORARY, - 1024 * 1024 * 5, - fsaccessor, - (err: FileError) => { alert('Error: ' + err.code); } -); - -window.resolveLocalFileSystemURI(cordova.file.applicationDirectory, - (entry: Entry)=> { - if (entry.isDirectory) { - console.log('successfully resolved ' + entry.fullPath + 'directory'); - console.log(entry.toURL()); - console.log(entry.toInternalURL()); - } else { - var fentry = entry; - fentry.file((f: File) => { console.log(f.slice(f.size - 10, f.size)); }); - fentry.createWriter((writer: FileWriter)=> { - if (writer.readyState == FileWriter.INIT) { - console.log('Init FileWriter'); - writer.write(new Blob(['sdfdsfsdf'])); - writer.onprogress = function(ev: ProgressEvent) { - console.log('Writing ' + ev.target); - }; - } - }); - } - }, - (error: FileError) => { console.log(error.code); } -); - -// FileTransfer plugin -//---------------------------------------------------------------------- - -var file = new FileTransfer(); - -file.onprogress = (ev: ProgressEvent) => { - if (ev.lengthComputable) { - console.log(ev.loaded + '/' + ev.total); - } -}; - -file.download('http://some.server.com/download.php', - 'cdvfile://localhost/persistent/path/to/downloads/', - (file: FileEntry)=> { console.log('File Downloaded to ' + file.fullPath); }, - (err: FileTransferError) => { - console.error('Error ' + err.code); - if (err.exception) { - console.error('Failed with exception ' + err.exception); - } - }, - true, - { - headers: { - "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==" - } - }); - -file.upload('cdvfile://localhost/persistent/path/to/downloads/', - 'http://some.server.com/download.php', - (result: FileUploadResult)=> { console.log('File uploaded. Bytes uploaded: ' + result.bytesSent); }, - (err: FileTransferError) => { - console.error('Error ' + err.code); - if (err.exception) { - console.error('Failed with exception ' + err.exception); - } - }, - { headers: {"X-Email": "user@mail.com", 'X-Token': "asdf3w234"}, httpMethod: "PUT" }, - true); - -file.abort(); - -file.abort(); -// InAppBrowser plugin -//---------------------------------------------------------------------- - -// signature of window.open() added by InAppBrowser plugin -// is similar to native window.open signature, so the compiler can's -// select proper overload, but we cast result to InAppBrowser manually. -var iab = window.open('google.com', '_self'); -iab.addEventListener('loadstart', (ev: InAppBrowserEvent) => { console.log('Start opening ' + ev.url); }); -iab.show(); -iab.executeScript( - { code: "console.log('Injected script in action')" }, - ()=> { console.log('Script is executed'); } -); - -// Globalization plugin -//---------------------------------------------------------------------- - -navigator.globalization.dateToString(new Date(), - (date) => { console.log(JSON.stringify(date)); }, - (error) => { alert(error.message); }, - { formatLength: "short", selector: "date" }); - -navigator.globalization.getDateNames( - (names) => { - names.value.forEach((name) => { console.log(name); }); - }, - (error) => { alert(error.message); }, - { item: "months", type: "wide" }); - -// Media and Media Capture -//---------------------------------------------------------------------- - -var media = new Media('', - () => { console.log('Media opened'); }, - (err: MediaError) => { alert('Error: ' + err.code); }); -media.play(); -media.setVolume(10); - -console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); - -navigator.device.capture.captureAudio( - (captures: MediaFile[])=> { console.log(captures.length + ' captured'); }, - (err: CaptureError)=> { alert('Error ' + err.message); }, - { - limit: 3, - duration: 10 - }); - - -// Network Plugin -//---------------------------------------------------------------------- - -var connType = navigator.connection.type; -if (connType == Connection.WIFI) { - console.log('Congratulations, you\'re with fast Internet!'); -} - -document.addEventListener('offline', () => { alert('You\'re offline!'); }); - -// SplashScreen plugin -//---------------------------------------------------------------------- - -navigator.splashscreen.show(); -navigator.splashscreen.hide(); - - -// WebSQL plugin -//---------------------------------------------------------------------- - -var db = window.openDatabase('Test', '0.1', 'test', 1024 * 1024 * 5); -db.transaction( - (tx: SqlTransaction) => { - tx.executeSql('CREATE TABLE Sample IF NOT EXIST...'); - tx.executeSql('INSERT INTO Sample VALUES...'); - }, - (err: SqlError) => { - if (err.code = SqlError.SYNTAX_ERR) { - alert('Error ' + err.message); - } - }, - () => { console.log('Transaction completed successfully'); } -); - -// Vibration plugin -//---------------------------------------------------------------------- -navigator.notification.vibrate(100); -navigator.notification.vibrateWithPattern([100, 200, 200, 150, 50], 3); -setTimeout(navigator.notification.cancelVibration, 1000); - -// Keyboard plugin -//---------------------------------------------------------------------- -Keyboard.shrinkView(true); -Keyboard.shrinkView(false); -Keyboard.hideFormAccessoryBar(true); -Keyboard.hideFormAccessoryBar(false); -Keyboard.disableScrollingInShrinkView(true); -Keyboard.disableScrollingInShrinkView(false); -if (Keyboard.isVisible) { - console.log('Keyboard is visible'); -} -Keyboard.automaticScrollToTopOnHiding = true; -Keyboard.onshow = function () { - console.log('onshow'); -}; -Keyboard.onhide = function () { - console.log('onhide'); -}; -Keyboard.onshowing = function () { - console.log('onshowing'); -}; -Keyboard.onhiding= function () { - console.log('onhiding'); -}; From bd7d645afe211160571d5d38f8c2c6b72fe9fb2f Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Mon, 18 Jul 2016 10:42:45 -0700 Subject: [PATCH 102/105] Renamed all the tests... --- .../{tests.ts => cordova-plugin-battery-status-tests.ts} | 0 cordova-plugin-battery-status/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-camera-tests.ts} | 0 cordova-plugin-camera/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-contacts-tests.ts} | 0 cordova-plugin-contacts/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-device-motion-tests.ts} | 0 cordova-plugin-device-motion/tsconfig.json | 2 +- ...ests.ts => cordova-plugin-media-device-orientation-tests.ts} | 0 cordova-plugin-device-orientation/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-device-tests.ts} | 0 cordova-plugin-device/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-dialogs-tests.ts} | 0 cordova-plugin-dialogs/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-file-transfer-tests.ts} | 0 cordova-plugin-file-transfer/index.d.ts | 2 +- cordova-plugin-file-transfer/tsconfig.json | 2 +- cordova-plugin-file/{tests.ts => cordova-plugin-file-tests.ts} | 0 cordova-plugin-file/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-globalization-tests.ts} | 0 cordova-plugin-globalization/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-inappbrowser-tests.ts} | 0 cordova-plugin-inappbrowser/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-keyboard-tests.ts} | 0 cordova-plugin-keyboard/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-capture-tests.ts} | 0 cordova-plugin-media-capture/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-media-tests.ts} | 2 -- cordova-plugin-media/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-device-motion-tests.ts} | 0 cordova-plugin-network-information/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-splashscreen-tests.ts} | 0 cordova-plugin-splashscreen/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-statusbar-tests.ts} | 0 cordova-plugin-statusbar/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-vibration-tests.ts} | 0 cordova-plugin-vibration/tsconfig.json | 2 +- .../{tests.ts => cordova-plugin-websql-tests.ts} | 0 cordova-plugin-websql/tsconfig.json | 2 +- 39 files changed, 20 insertions(+), 22 deletions(-) rename cordova-plugin-battery-status/{tests.ts => cordova-plugin-battery-status-tests.ts} (100%) rename cordova-plugin-camera/{tests.ts => cordova-plugin-camera-tests.ts} (100%) rename cordova-plugin-contacts/{tests.ts => cordova-plugin-contacts-tests.ts} (100%) rename cordova-plugin-device-motion/{tests.ts => cordova-plugin-device-motion-tests.ts} (100%) rename cordova-plugin-device-orientation/{tests.ts => cordova-plugin-media-device-orientation-tests.ts} (100%) rename cordova-plugin-device/{tests.ts => cordova-plugin-device-tests.ts} (100%) rename cordova-plugin-dialogs/{tests.ts => cordova-plugin-dialogs-tests.ts} (100%) rename cordova-plugin-file-transfer/{tests.ts => cordova-plugin-file-transfer-tests.ts} (100%) rename cordova-plugin-file/{tests.ts => cordova-plugin-file-tests.ts} (100%) rename cordova-plugin-globalization/{tests.ts => cordova-plugin-globalization-tests.ts} (100%) rename cordova-plugin-inappbrowser/{tests.ts => cordova-plugin-inappbrowser-tests.ts} (100%) rename cordova-plugin-keyboard/{tests.ts => cordova-plugin-keyboard-tests.ts} (100%) rename cordova-plugin-media-capture/{tests.ts => cordova-plugin-capture-tests.ts} (100%) rename cordova-plugin-media/{tests.ts => cordova-plugin-media-tests.ts} (73%) rename cordova-plugin-network-information/{tests.ts => cordova-plugin-device-motion-tests.ts} (100%) rename cordova-plugin-splashscreen/{tests.ts => cordova-plugin-splashscreen-tests.ts} (100%) rename cordova-plugin-statusbar/{tests.ts => cordova-plugin-statusbar-tests.ts} (100%) rename cordova-plugin-vibration/{tests.ts => cordova-plugin-vibration-tests.ts} (100%) rename cordova-plugin-websql/{tests.ts => cordova-plugin-websql-tests.ts} (100%) diff --git a/cordova-plugin-battery-status/tests.ts b/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts similarity index 100% rename from cordova-plugin-battery-status/tests.ts rename to cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts diff --git a/cordova-plugin-battery-status/tsconfig.json b/cordova-plugin-battery-status/tsconfig.json index b999e403b2..b781800488 100644 --- a/cordova-plugin-battery-status/tsconfig.json +++ b/cordova-plugin-battery-status/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-battery-status-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-camera/tests.ts b/cordova-plugin-camera/cordova-plugin-camera-tests.ts similarity index 100% rename from cordova-plugin-camera/tests.ts rename to cordova-plugin-camera/cordova-plugin-camera-tests.ts diff --git a/cordova-plugin-camera/tsconfig.json b/cordova-plugin-camera/tsconfig.json index b999e403b2..fd82d2283c 100644 --- a/cordova-plugin-camera/tsconfig.json +++ b/cordova-plugin-camera/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-camera-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-contacts/tests.ts b/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts similarity index 100% rename from cordova-plugin-contacts/tests.ts rename to cordova-plugin-contacts/cordova-plugin-contacts-tests.ts diff --git a/cordova-plugin-contacts/tsconfig.json b/cordova-plugin-contacts/tsconfig.json index b999e403b2..150cbbc01b 100644 --- a/cordova-plugin-contacts/tsconfig.json +++ b/cordova-plugin-contacts/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-contacts-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-device-motion/tests.ts b/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts similarity index 100% rename from cordova-plugin-device-motion/tests.ts rename to cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts diff --git a/cordova-plugin-device-motion/tsconfig.json b/cordova-plugin-device-motion/tsconfig.json index b999e403b2..38d054da74 100644 --- a/cordova-plugin-device-motion/tsconfig.json +++ b/cordova-plugin-device-motion/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-device-motion-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-device-orientation/tests.ts b/cordova-plugin-device-orientation/cordova-plugin-media-device-orientation-tests.ts similarity index 100% rename from cordova-plugin-device-orientation/tests.ts rename to cordova-plugin-device-orientation/cordova-plugin-media-device-orientation-tests.ts diff --git a/cordova-plugin-device-orientation/tsconfig.json b/cordova-plugin-device-orientation/tsconfig.json index b999e403b2..8af4fd1451 100644 --- a/cordova-plugin-device-orientation/tsconfig.json +++ b/cordova-plugin-device-orientation/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-device-orientation-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-device/tests.ts b/cordova-plugin-device/cordova-plugin-device-tests.ts similarity index 100% rename from cordova-plugin-device/tests.ts rename to cordova-plugin-device/cordova-plugin-device-tests.ts diff --git a/cordova-plugin-device/tsconfig.json b/cordova-plugin-device/tsconfig.json index b999e403b2..2382a3c48b 100644 --- a/cordova-plugin-device/tsconfig.json +++ b/cordova-plugin-device/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-device-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-dialogs/tests.ts b/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts similarity index 100% rename from cordova-plugin-dialogs/tests.ts rename to cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts diff --git a/cordova-plugin-dialogs/tsconfig.json b/cordova-plugin-dialogs/tsconfig.json index b999e403b2..8a06fc75a3 100644 --- a/cordova-plugin-dialogs/tsconfig.json +++ b/cordova-plugin-dialogs/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-dialogs-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-file-transfer/tests.ts b/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts similarity index 100% rename from cordova-plugin-file-transfer/tests.ts rename to cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts diff --git a/cordova-plugin-file-transfer/index.d.ts b/cordova-plugin-file-transfer/index.d.ts index 8dad62a1e9..e292847509 100644 --- a/cordova-plugin-file-transfer/index.d.ts +++ b/cordova-plugin-file-transfer/index.d.ts @@ -6,7 +6,7 @@ // Copyright (c) Microsoft Open Technologies, Inc. // Licensed under the MIT license. -/// +/// /** * The FileTransfer object provides a way to upload files using an HTTP multi-part POST request, diff --git a/cordova-plugin-file-transfer/tsconfig.json b/cordova-plugin-file-transfer/tsconfig.json index b999e403b2..0e88ebb590 100644 --- a/cordova-plugin-file-transfer/tsconfig.json +++ b/cordova-plugin-file-transfer/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-file-transfer-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-file/tests.ts b/cordova-plugin-file/cordova-plugin-file-tests.ts similarity index 100% rename from cordova-plugin-file/tests.ts rename to cordova-plugin-file/cordova-plugin-file-tests.ts diff --git a/cordova-plugin-file/tsconfig.json b/cordova-plugin-file/tsconfig.json index b999e403b2..ffc80437fa 100644 --- a/cordova-plugin-file/tsconfig.json +++ b/cordova-plugin-file/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-file-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-globalization/tests.ts b/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts similarity index 100% rename from cordova-plugin-globalization/tests.ts rename to cordova-plugin-globalization/cordova-plugin-globalization-tests.ts diff --git a/cordova-plugin-globalization/tsconfig.json b/cordova-plugin-globalization/tsconfig.json index b999e403b2..c743a2a3ee 100644 --- a/cordova-plugin-globalization/tsconfig.json +++ b/cordova-plugin-globalization/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-globalization-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-inappbrowser/tests.ts b/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts similarity index 100% rename from cordova-plugin-inappbrowser/tests.ts rename to cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts diff --git a/cordova-plugin-inappbrowser/tsconfig.json b/cordova-plugin-inappbrowser/tsconfig.json index b999e403b2..171d99407e 100644 --- a/cordova-plugin-inappbrowser/tsconfig.json +++ b/cordova-plugin-inappbrowser/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-inappbrowser-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-keyboard/tests.ts b/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts similarity index 100% rename from cordova-plugin-keyboard/tests.ts rename to cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts diff --git a/cordova-plugin-keyboard/tsconfig.json b/cordova-plugin-keyboard/tsconfig.json index b999e403b2..00a8c3f7c5 100644 --- a/cordova-plugin-keyboard/tsconfig.json +++ b/cordova-plugin-keyboard/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-keyboard-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-media-capture/tests.ts b/cordova-plugin-media-capture/cordova-plugin-capture-tests.ts similarity index 100% rename from cordova-plugin-media-capture/tests.ts rename to cordova-plugin-media-capture/cordova-plugin-capture-tests.ts diff --git a/cordova-plugin-media-capture/tsconfig.json b/cordova-plugin-media-capture/tsconfig.json index b999e403b2..807c41c402 100644 --- a/cordova-plugin-media-capture/tsconfig.json +++ b/cordova-plugin-media-capture/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-media-capture-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-media/tests.ts b/cordova-plugin-media/cordova-plugin-media-tests.ts similarity index 73% rename from cordova-plugin-media/tests.ts rename to cordova-plugin-media/cordova-plugin-media-tests.ts index a36df13cc3..76e39c8d7b 100644 --- a/cordova-plugin-media/tests.ts +++ b/cordova-plugin-media/cordova-plugin-media-tests.ts @@ -9,5 +9,3 @@ var media = new Media('', media.play(); media.setVolume(10); -console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); - diff --git a/cordova-plugin-media/tsconfig.json b/cordova-plugin-media/tsconfig.json index b999e403b2..7875dd04a0 100644 --- a/cordova-plugin-media/tsconfig.json +++ b/cordova-plugin-media/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-media-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-network-information/tests.ts b/cordova-plugin-network-information/cordova-plugin-device-motion-tests.ts similarity index 100% rename from cordova-plugin-network-information/tests.ts rename to cordova-plugin-network-information/cordova-plugin-device-motion-tests.ts diff --git a/cordova-plugin-network-information/tsconfig.json b/cordova-plugin-network-information/tsconfig.json index b999e403b2..3c31bfbd8e 100644 --- a/cordova-plugin-network-information/tsconfig.json +++ b/cordova-plugin-network-information/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-network-information-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-splashscreen/tests.ts b/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts similarity index 100% rename from cordova-plugin-splashscreen/tests.ts rename to cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts diff --git a/cordova-plugin-splashscreen/tsconfig.json b/cordova-plugin-splashscreen/tsconfig.json index b999e403b2..032aed70bc 100644 --- a/cordova-plugin-splashscreen/tsconfig.json +++ b/cordova-plugin-splashscreen/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-splashscreen-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-statusbar/tests.ts b/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts similarity index 100% rename from cordova-plugin-statusbar/tests.ts rename to cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts diff --git a/cordova-plugin-statusbar/tsconfig.json b/cordova-plugin-statusbar/tsconfig.json index b999e403b2..c464e89096 100644 --- a/cordova-plugin-statusbar/tsconfig.json +++ b/cordova-plugin-statusbar/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-statusbar-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-vibration/tests.ts b/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts similarity index 100% rename from cordova-plugin-vibration/tests.ts rename to cordova-plugin-vibration/cordova-plugin-vibration-tests.ts diff --git a/cordova-plugin-vibration/tsconfig.json b/cordova-plugin-vibration/tsconfig.json index b999e403b2..8835563a00 100644 --- a/cordova-plugin-vibration/tsconfig.json +++ b/cordova-plugin-vibration/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-vibration-tests.ts" ] } \ No newline at end of file diff --git a/cordova-plugin-websql/tests.ts b/cordova-plugin-websql/cordova-plugin-websql-tests.ts similarity index 100% rename from cordova-plugin-websql/tests.ts rename to cordova-plugin-websql/cordova-plugin-websql-tests.ts diff --git a/cordova-plugin-websql/tsconfig.json b/cordova-plugin-websql/tsconfig.json index b999e403b2..36e7e41481 100644 --- a/cordova-plugin-websql/tsconfig.json +++ b/cordova-plugin-websql/tsconfig.json @@ -8,6 +8,6 @@ }, "files": [ "index.d.ts", - "tests.ts" + "cordova-plugin-websql-tests.ts" ] } \ No newline at end of file From af481008cc26a1885ba8e337d80b010421646132 Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Tue, 19 Jul 2016 15:54:02 -0700 Subject: [PATCH 103/105] Fixed headers --- cordova-plugin-battery-status/index.d.ts | 6 +++--- cordova-plugin-camera/index.d.ts | 6 +++--- cordova-plugin-contacts/index.d.ts | 8 ++++---- cordova-plugin-device-motion/index.d.ts | 6 +++--- cordova-plugin-device-orientation/index.d.ts | 6 +++--- cordova-plugin-device/index.d.ts | 8 ++++---- cordova-plugin-dialogs/index.d.ts | 6 +++--- cordova-plugin-file-transfer/index.d.ts | 8 ++++---- cordova-plugin-file/index.d.ts | 6 +++--- cordova-plugin-globalization/index.d.ts | 6 +++--- cordova-plugin-inappbrowser/index.d.ts | 6 +++--- cordova-plugin-media-capture/index.d.ts | 8 ++++---- cordova-plugin-media/index.d.ts | 8 ++++---- cordova-plugin-network-information/index.d.ts | 8 ++++---- cordova-plugin-splashscreen/index.d.ts | 6 +++--- cordova-plugin-statusbar/index.d.ts | 2 +- cordova-plugin-vibration/index.d.ts | 6 +++--- cordova-plugin-websql/index.d.ts | 6 +++--- cordova/index.d.ts | 4 ++-- 19 files changed, 60 insertions(+), 60 deletions(-) diff --git a/cordova-plugin-battery-status/index.d.ts b/cordova-plugin-battery-status/index.d.ts index 11250e41b7..9baedc8cb0 100644 --- a/cordova-plugin-battery-status/index.d.ts +++ b/cordova-plugin-battery-status/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova BatteryStatus plugin. +// Type definitions for Apache Cordova BatteryStatus plugin // Project: https://github.com/apache/cordova-plugin-battery-status -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Window { diff --git a/cordova-plugin-camera/index.d.ts b/cordova-plugin-camera/index.d.ts index cf20d16ae8..48c8f8ae5c 100644 --- a/cordova-plugin-camera/index.d.ts +++ b/cordova-plugin-camera/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Camera plugin. +// Type definitions for Apache Cordova Camera plugin // Project: https://github.com/apache/cordova-plugin-camera -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-contacts/index.d.ts b/cordova-plugin-contacts/index.d.ts index d940fccd77..e1faa7a2cd 100644 --- a/cordova-plugin-contacts/index.d.ts +++ b/cordova-plugin-contacts/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for Apache Cordova Contacts plugin. +// Type definitions for Apache Cordova Contacts plugin // Project: https://github.com/apache/cordova-plugin-contacts -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. +// Copyright (c) Microsoft Open Technologies Inc +// Licensed under the MIT license interface Navigator { /** Provides access to the device contacts database. */ diff --git a/cordova-plugin-device-motion/index.d.ts b/cordova-plugin-device-motion/index.d.ts index 803579e66a..ae38803fd2 100644 --- a/cordova-plugin-device-motion/index.d.ts +++ b/cordova-plugin-device-motion/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Device Motion plugin. +// Type definitions for Apache Cordova Device Motion plugin // Project: https://github.com/apache/cordova-plugin-device-motion -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-device-orientation/index.d.ts b/cordova-plugin-device-orientation/index.d.ts index 322d25ca9c..dcd9654efa 100644 --- a/cordova-plugin-device-orientation/index.d.ts +++ b/cordova-plugin-device-orientation/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Device Orientation plugin. +// Type definitions for Apache Cordova Device Orientation plugin // Project: https://github.com/apache/cordova-plugin-device-orientation -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-device/index.d.ts b/cordova-plugin-device/index.d.ts index b9aebbefd2..494b04f1e2 100644 --- a/cordova-plugin-device/index.d.ts +++ b/cordova-plugin-device/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for Apache Cordova Device plugin. +// Type definitions for Apache Cordova Device plugin // Project: https://github.com/apache/cordova-plugin-device -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. +// Copyright (c) Microsoft Open Technologies Inc +// Licensed under the MIT license /** * This plugin defines a global device object, which describes the device's hardware and software. diff --git a/cordova-plugin-dialogs/index.d.ts b/cordova-plugin-dialogs/index.d.ts index c6753bbfeb..8a4035bf01 100644 --- a/cordova-plugin-dialogs/index.d.ts +++ b/cordova-plugin-dialogs/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Dialogs plugin. +// Type definitions for Apache Cordova Dialogs plugin // Project: https://github.com/apache/cordova-plugin-dialogs -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-file-transfer/index.d.ts b/cordova-plugin-file-transfer/index.d.ts index e292847509..4644dddd42 100644 --- a/cordova-plugin-file-transfer/index.d.ts +++ b/cordova-plugin-file-transfer/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for Apache Cordova FileTransfer plugin. +// Type definitions for Apache Cordova FileTransfer plugin // Project: https://github.com/apache/cordova-plugin-file-transfer -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. +// Copyright (c) Microsoft Open Technologies Inc +// Licensed under the MIT license /// diff --git a/cordova-plugin-file/index.d.ts b/cordova-plugin-file/index.d.ts index 66a6014dea..765426db50 100644 --- a/cordova-plugin-file/index.d.ts +++ b/cordova-plugin-file/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova File System plugin. +// Type definitions for Apache Cordova File System plugin // Project: https://github.com/apache/cordova-plugin-file -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Window { diff --git a/cordova-plugin-globalization/index.d.ts b/cordova-plugin-globalization/index.d.ts index 911127357f..5894bd27d0 100644 --- a/cordova-plugin-globalization/index.d.ts +++ b/cordova-plugin-globalization/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Globalization plugin. +// Type definitions for Apache Cordova Globalization plugin // Project: https://github.com/apache/cordova-plugin-globalization -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-inappbrowser/index.d.ts b/cordova-plugin-inappbrowser/index.d.ts index 2e52068e16..d5e221ba42 100644 --- a/cordova-plugin-inappbrowser/index.d.ts +++ b/cordova-plugin-inappbrowser/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova InAppBrowser plugin. +// Type definitions for Apache Cordova InAppBrowser plugin // Project: https://github.com/apache/cordova-plugin-inappbrowser -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Window { diff --git a/cordova-plugin-media-capture/index.d.ts b/cordova-plugin-media-capture/index.d.ts index b7c2c9abdf..726c5dac88 100644 --- a/cordova-plugin-media-capture/index.d.ts +++ b/cordova-plugin-media-capture/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for Apache Cordova MediaCapture plugin. +// Type definitions for Apache Cordova MediaCapture plugin // Project: https://github.com/apache/cordova-plugin-media-capture -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. +// Copyright (c) Microsoft Open Technologies Inc +// Licensed under the MIT license interface Navigator { device: Device; diff --git a/cordova-plugin-media/index.d.ts b/cordova-plugin-media/index.d.ts index e99db687c7..77f14d4e0b 100644 --- a/cordova-plugin-media/index.d.ts +++ b/cordova-plugin-media/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for Apache Cordova Media plugin. +// Type definitions for Apache Cordova Media plugin // Project: https://github.com/apache/cordova-plugin-media -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. +// Copyright (c) Microsoft Open Technologies Inc +// Licensed under the MIT license declare var Media: { new ( diff --git a/cordova-plugin-network-information/index.d.ts b/cordova-plugin-network-information/index.d.ts index 0d49597e3a..4e9457efbd 100644 --- a/cordova-plugin-network-information/index.d.ts +++ b/cordova-plugin-network-information/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for Apache Cordova Network Information plugin. +// Type definitions for Apache Cordova Network Information plugin // Project: https://github.com/apache/cordova-plugin-network-information -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. -// Licensed under the MIT license. +// Copyright (c) Microsoft Open Technologies Inc +// Licensed under the MIT license interface Navigator { /** diff --git a/cordova-plugin-splashscreen/index.d.ts b/cordova-plugin-splashscreen/index.d.ts index cf2f803762..968b340067 100644 --- a/cordova-plugin-splashscreen/index.d.ts +++ b/cordova-plugin-splashscreen/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Splashscreen plugin. +// Type definitions for Apache Cordova Splashscreen plugin // Project: https://github.com/apache/cordova-plugin-splashscreen -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-statusbar/index.d.ts b/cordova-plugin-statusbar/index.d.ts index d5feeaf0ea..8e211f3530 100644 --- a/cordova-plugin-statusbar/index.d.ts +++ b/cordova-plugin-statusbar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Apache Cordova StatusBar plugin. +// Type definitions for Apache Cordova StatusBar plugin // Project: https://github.com/apache/cordova-plugin-statusbar // Definitions by: Xinkai Chen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/cordova-plugin-vibration/index.d.ts b/cordova-plugin-vibration/index.d.ts index a9371841ea..192c4781f5 100644 --- a/cordova-plugin-vibration/index.d.ts +++ b/cordova-plugin-vibration/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova Vibration plugin. +// Type definitions for Apache Cordova Vibration plugin // Project: https://github.com/apache/cordova-plugin-vibration -// Definitions by: Microsoft Open Technologies, Inc. , Louis Lagrange +// Definitions by: Microsoft Open Technologies Inc , Louis Lagrange // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Navigator { diff --git a/cordova-plugin-websql/index.d.ts b/cordova-plugin-websql/index.d.ts index f51f30cb6b..cb2a0e00e4 100644 --- a/cordova-plugin-websql/index.d.ts +++ b/cordova-plugin-websql/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for Apache Cordova WebSQL plugin. +// Type definitions for Apache Cordova WebSQL plugin // Project: https://github.com/MSOpenTech/cordova-plugin-websql -// Definitions by: Microsoft Open Technologies, Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. interface Window { diff --git a/cordova/index.d.ts b/cordova/index.d.ts index 91ea02bc26..30a827ed93 100644 --- a/cordova/index.d.ts +++ b/cordova/index.d.ts @@ -1,9 +1,9 @@ // Type definitions for Apache Cordova // Project: http://cordova.apache.org -// Definitions by: Microsoft Open Technologies Inc. +// Definitions by: Microsoft Open Technologies Inc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // -// Copyright (c) Microsoft Open Technologies, Inc. +// Copyright (c) Microsoft Open Technologies Inc // Licensed under the MIT license. From 18845bd8367d26dc3c405d61fd9c09ec97bd63ef Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Wed, 3 Aug 2016 15:46:58 -0700 Subject: [PATCH 104/105] Updated cordova .d.ts dependency errors --- ng-cordova/actionSheet-tests.ts | 4 ++-- ng-cordova/app-version-tests.ts | 1 + ng-cordova/appAvailability-tests.ts | 7 +++++-- ng-cordova/badge-tests.ts | 4 ++-- ng-cordova/camera-tests.ts | 3 +++ ng-cordova/camera.d.ts | 3 +-- ng-cordova/datepicker-tests.ts | 4 ++-- ng-cordova/device-tests.ts | 7 ++++--- ng-cordova/deviceMotion-tests.ts | 6 ++++-- ng-cordova/deviceOrientation-tests.ts | 6 ++++-- ng-cordova/dialogs-tests.ts | 6 ++++-- ng-cordova/emailComposer-tests.ts | 6 +++--- ng-cordova/file-tests.ts | 6 +++--- ng-cordova/fileTransfer-tests.ts | 7 ++++--- ng-cordova/fileTransfer.d.ts | 1 + ng-cordova/geolocation-tests.ts | 6 +++--- ng-cordova/network-tests.ts | 6 +++--- ng-cordova/toast-tests.ts | 6 +++--- 18 files changed, 52 insertions(+), 37 deletions(-) diff --git a/ng-cordova/actionSheet-tests.ts b/ng-cordova/actionSheet-tests.ts index e7e2da2326..658da2026d 100644 --- a/ng-cordova/actionSheet-tests.ts +++ b/ng-cordova/actionSheet-tests.ts @@ -1,5 +1,5 @@ - -/// +/// +/// namespace ngCordova { 'use strict'; diff --git a/ng-cordova/app-version-tests.ts b/ng-cordova/app-version-tests.ts index 45c978a5a1..023ee9cd3c 100644 --- a/ng-cordova/app-version-tests.ts +++ b/ng-cordova/app-version-tests.ts @@ -1,3 +1,4 @@ +/// namespace ngCordova { diff --git a/ng-cordova/appAvailability-tests.ts b/ng-cordova/appAvailability-tests.ts index 01dd597306..a0fe1f2be1 100644 --- a/ng-cordova/appAvailability-tests.ts +++ b/ng-cordova/appAvailability-tests.ts @@ -1,6 +1,9 @@ -/// -/// +/// +/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/badge-tests.ts b/ng-cordova/badge-tests.ts index e5ee7df3d4..f3125b8253 100644 --- a/ng-cordova/badge-tests.ts +++ b/ng-cordova/badge-tests.ts @@ -1,5 +1,5 @@ - -/// +/// +/// namespace ngCordova { 'use strict'; diff --git a/ng-cordova/camera-tests.ts b/ng-cordova/camera-tests.ts index 0acf46b23d..a129ade66e 100644 --- a/ng-cordova/camera-tests.ts +++ b/ng-cordova/camera-tests.ts @@ -1,3 +1,6 @@ +/// +/// + namespace ngCordova { diff --git a/ng-cordova/camera.d.ts b/ng-cordova/camera.d.ts index 580483dbd5..daed795768 100644 --- a/ng-cordova/camera.d.ts +++ b/ng-cordova/camera.d.ts @@ -3,8 +3,7 @@ // Definitions by: Jacques Kang // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// -/// +/// declare namespace ngCordova { export interface ICameraService { diff --git a/ng-cordova/datepicker-tests.ts b/ng-cordova/datepicker-tests.ts index c2d4bb2c37..3dd1c79105 100644 --- a/ng-cordova/datepicker-tests.ts +++ b/ng-cordova/datepicker-tests.ts @@ -1,5 +1,5 @@ - -/// +/// +/// namespace ngCordova { function smoketest($cordovaDatePicker: IDatePickerService, isIos: boolean) { diff --git a/ng-cordova/device-tests.ts b/ng-cordova/device-tests.ts index 597073458a..a509c5f9e2 100644 --- a/ng-cordova/device-tests.ts +++ b/ng-cordova/device-tests.ts @@ -1,7 +1,8 @@ -/// -/// - +/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/deviceMotion-tests.ts b/ng-cordova/deviceMotion-tests.ts index ed2ae62a16..acca85976b 100644 --- a/ng-cordova/deviceMotion-tests.ts +++ b/ng-cordova/deviceMotion-tests.ts @@ -1,6 +1,8 @@ -/// -/// +/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/deviceOrientation-tests.ts b/ng-cordova/deviceOrientation-tests.ts index 96270c71c3..677922f425 100644 --- a/ng-cordova/deviceOrientation-tests.ts +++ b/ng-cordova/deviceOrientation-tests.ts @@ -1,6 +1,8 @@ -/// -/// +/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/dialogs-tests.ts b/ng-cordova/dialogs-tests.ts index 74ad19d2bf..a70abe6743 100644 --- a/ng-cordova/dialogs-tests.ts +++ b/ng-cordova/dialogs-tests.ts @@ -1,6 +1,8 @@ +/// +/// +/// +/// -/// -/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/emailComposer-tests.ts b/ng-cordova/emailComposer-tests.ts index 89c686775a..25744d91ef 100644 --- a/ng-cordova/emailComposer-tests.ts +++ b/ng-cordova/emailComposer-tests.ts @@ -1,6 +1,6 @@ - -/// -/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/file-tests.ts b/ng-cordova/file-tests.ts index aae6822a73..c4a6861022 100644 --- a/ng-cordova/file-tests.ts +++ b/ng-cordova/file-tests.ts @@ -1,6 +1,6 @@ - -/// -/// +/// +/// +/// namespace ngCordova { 'use strict'; diff --git a/ng-cordova/fileTransfer-tests.ts b/ng-cordova/fileTransfer-tests.ts index 5a89c614e1..166f4d09b3 100644 --- a/ng-cordova/fileTransfer-tests.ts +++ b/ng-cordova/fileTransfer-tests.ts @@ -1,6 +1,7 @@ - -/// -/// +/// +/// +/// +/// namespace ngCordova { 'use strict'; diff --git a/ng-cordova/fileTransfer.d.ts b/ng-cordova/fileTransfer.d.ts index 6fad06e14a..e4ef359c14 100644 --- a/ng-cordova/fileTransfer.d.ts +++ b/ng-cordova/fileTransfer.d.ts @@ -5,6 +5,7 @@ /// /// +/// declare namespace ngCordova { export interface IFileTransferService { diff --git a/ng-cordova/geolocation-tests.ts b/ng-cordova/geolocation-tests.ts index 0c60a993a7..45e64c2ad0 100644 --- a/ng-cordova/geolocation-tests.ts +++ b/ng-cordova/geolocation-tests.ts @@ -1,6 +1,6 @@ - -/// -/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/network-tests.ts b/ng-cordova/network-tests.ts index 822d42aed9..454bf7aa7f 100644 --- a/ng-cordova/network-tests.ts +++ b/ng-cordova/network-tests.ts @@ -1,6 +1,6 @@ - -/// -/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo diff --git a/ng-cordova/toast-tests.ts b/ng-cordova/toast-tests.ts index f5bb213e16..b4663bdba6 100644 --- a/ng-cordova/toast-tests.ts +++ b/ng-cordova/toast-tests.ts @@ -1,6 +1,6 @@ - -/// -/// +/// +/// +/// // For the full application demo please see following repo : // https://github.com/ksachdeva/ngCordova-typescript-demo From 780ad863ca1902e8e7515a1559e2289da22f594b Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Fri, 19 Aug 2016 14:00:19 -0700 Subject: [PATCH 105/105] Fixed random cordova plugin --- .../cordova-plugin-x-socialsharing-tests.ts | 1 - cordova-plugin-x-socialsharing/index.d.ts | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts b/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts index 1d52b13646..fa1589c04f 100755 --- a/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts +++ b/cordova-plugin-x-socialsharing/cordova-plugin-x-socialsharing-tests.ts @@ -1,6 +1,5 @@ /// - window.plugins.socialsharing.iPadPopupCoordinates = function () { return "100,100,200,300"; }; diff --git a/cordova-plugin-x-socialsharing/index.d.ts b/cordova-plugin-x-socialsharing/index.d.ts index d498a981be..e99aa3a44f 100644 --- a/cordova-plugin-x-socialsharing/index.d.ts +++ b/cordova-plugin-x-socialsharing/index.d.ts @@ -3,6 +3,10 @@ // Definitions by: Markus Wagner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +interface Window { + plugins: Plugins; +} + interface Plugins { socialsharing: SocialSharingPlugin.SocialSharing; }