From 47310a628aa6d2d7e58ac0463a6a2e0918954d9e Mon Sep 17 00:00:00 2001 From: Teruyoshi Kutsuna Date: Thu, 10 Nov 2016 14:36:20 +0900 Subject: [PATCH 01/22] fix(angular-ui-router): replace argument of url matcher.exec searchParams to search, hash, options (optionally all). --- angular-ui-router/angular-ui-router.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index 7e4f097c8c..7769a85105 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -112,7 +112,7 @@ declare namespace angular.ui { interface IUrlMatcher { concat(pattern: string): IUrlMatcher; - exec(path: string, searchParams: {}): {}; + exec(path: string, search?: any, hash?: string, options?: any): {}; parameters(): string[]; format(values: {}): string; } From e14af389ea787c5d57ba39f8c014c1cd115d06fd Mon Sep 17 00:00:00 2001 From: Izik Lisbon Date: Thu, 10 Nov 2016 17:13:47 -0800 Subject: [PATCH 02/22] [bluebird-retry] Add support the predicate option https://github.com/demmer/bluebird-retry/blob/master/lib/bluebird-retry.js#L60 --- bluebird-retry/bluebird-retry.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/bluebird-retry/bluebird-retry.d.ts b/bluebird-retry/bluebird-retry.d.ts index b63a3cf131..695c56cc7d 100644 --- a/bluebird-retry/bluebird-retry.d.ts +++ b/bluebird-retry/bluebird-retry.d.ts @@ -16,6 +16,7 @@ declare module "bluebird-retry" { max_interval?:number; timeout?:number; max_tries?:number; + predicate?:any; } } From 0d4cb73cc3c90f282f4fd8313b338f29f9e7527a Mon Sep 17 00:00:00 2001 From: Sayan751 Date: Fri, 11 Nov 2016 09:24:01 +0100 Subject: [PATCH 03/22] Adding type definitions for pikaday-time (https://github.com/owenmead/Pikaday, forked from https://github.com/dbushell/Pikaday) --- pikaday-time/pikaday-time-tests.ts | 84 +++++++ pikaday-time/pikaday-time.d.ts | 343 +++++++++++++++++++++++++++++ 2 files changed, 427 insertions(+) create mode 100644 pikaday-time/pikaday-time-tests.ts create mode 100644 pikaday-time/pikaday-time.d.ts diff --git a/pikaday-time/pikaday-time-tests.ts b/pikaday-time/pikaday-time-tests.ts new file mode 100644 index 0000000000..1f64de213d --- /dev/null +++ b/pikaday-time/pikaday-time-tests.ts @@ -0,0 +1,84 @@ +/// +/// +/// + +import * as Pikaday from "pikaday-time"; + +new Pikaday({field: document.getElementById('datepicker')}); +new Pikaday({field: $('#datepicker')[0]}); + +(() => { + var field:HTMLInputElement = document.getElementById('datepicker'); + var picker = new Pikaday({ + onSelect: function (date:Date) { + field.value = picker.toString(); + console.log(date.toISOString()); + } + }); + field.parentNode.insertBefore(picker.el, field.nextSibling); +})(); + +(() => { + var picker = new Pikaday({ + field: document.getElementById('datepicker'), + format: 'D MMM YYYY', + onSelect: function () { + console.log(this.getMoment().format('Do MMMM YYYY')); + } + }); + + picker.toString(); + picker.toString('YYYY-MM-DD'); + picker.getDate(); + picker.setDate('2015-01-01'); + picker.getMoment(); + picker.setMoment(moment('14th February 2014', 'DDo MMMM YYYY')); + picker.gotoDate(new Date(2014, 1)); + picker.gotoToday(); + picker.gotoMonth(2); + picker.nextMonth(); + picker.prevMonth(); + picker.gotoYear(2015); + picker.setMinDate(new Date); + picker.setMaxDate(new Date); + picker.setStartRange(new Date); + picker.setEndRange(new Date); + picker.isVisible(); + picker.show(); + picker.adjustPosition(); + picker.hide(); + picker.destroy(); +})(); + +(() => { + var i18n: Pikaday.PikadayI18nConfig = { + previousMonth: 'Previous Month', + nextMonth: 'Next Month', + months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] + }; + new Pikaday({i18n}); +})(); + +(() => { + new Pikaday( + { + field: document.getElementById('datepicker'), + firstDay: 1, + minDate: new Date('2000-01-01'), + maxDate: new Date('2020-12-31'), + yearRange: [2000, 2020] + }); +})(); + +(() => { + new Pikaday( + { + field: document.getElementById('datepicker'), + firstDay: 1, + minDate: new Date('2000-01-01'), + maxDate: new Date('2020-12-31'), + showDaysInNextAndPreviousMonths: true + }); +})(); diff --git a/pikaday-time/pikaday-time.d.ts b/pikaday-time/pikaday-time.d.ts new file mode 100644 index 0000000000..3571d5c671 --- /dev/null +++ b/pikaday-time/pikaday-time.d.ts @@ -0,0 +1,343 @@ +// Type definitions for pikaday +// Project: https://github.com/owenmead/Pikaday +// Definitions by: Sayan Pal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare class Pikaday { + el: HTMLElement; + + constructor(options: Pikaday.PikadayOptions); + + /** + * Extends the existing configuration options for Pikaday object with the options provided. + * Can be used to change/extend the configurations on runtime. + * @param options full/partial configuration options. + * @returns {} extended configurations. + */ + config(options: Pikaday.PikadayOptions): Pikaday.PikadayOptions; + + /** + * Returns the selected date in a string format. If Moment.js exists + * (recommended) then Pikaday can return any format that Moment + * understands, otherwise you're stuck with JavaScript's default. + */ + toString(format?: string): string; + + /** + * Returns a JavaScript Date object for the selected day, or null if + * no date is selected. + */ + getDate(): Date; + + /** + * Set the current selection. This will be restricted within the bounds + * of minDate and maxDate options if they're specified. A boolean (true) + * can optionally be passed as the second parameter to prevent triggering + * of the onSelect callback, allowing the date to be set silently. + */ + setDate(date: string | Date, triggerOnSelect?: boolean): void; + + /** + * Returns a Moment.js object for the selected date (Moment must be + * loaded before Pikaday). + */ + getMoment(): moment.Moment; + + /** + * Set the current selection with a Moment.js object (see setDate). + */ + setMoment(moment: any): void; + + /** + * Change the current view to see a specific date. + */ + gotoDate(date: Date): void; + + /** + * Shortcut for picker.gotoDate(new Date()) + */ + gotoToday(): void; + + /** + * Change the current view by month (0: January, 1: Februrary, etc). + */ + gotoMonth(monthIndex: number): void; + + /** + * Go to the next month (this will change year if necessary). + */ + nextMonth(): void; + + /** + * Go to the previous month (this will change year if necessary). + */ + prevMonth(): void; + + /** + * Change the year being viewed. + */ + gotoYear(year: number): void; + + /** + * Update the minimum/earliest date that can be selected. + */ + setMinDate(date: Date): void; + + /** + * Update the maximum/latest date that can be selected. + */ + setMaxDate(date: Date): void; + + /** + * Update the range start date. For using two Pikaday instances to + * select a date range. + */ + setStartRange(date: Date): void; + + /** + * Update the range end date. For using two Pikaday instances to select + * a date range. + */ + setEndRange(date: Date): void; + + /** + * Update the HTML. + */ + draw(force: boolean): void; + + /** + * Returns true if the picker is visible. + */ + isVisible(): boolean; + + /** + * Make the picker visible. + */ + show(): void; + + /** + * Hide the picker making it invisible. + */ + hide(): void; + + /** + * Recalculate and change the position of the picker. + */ + adjustPosition(): void; + + /** + * Hide the picker and remove all event listeners - no going back! + */ + destroy(): void; +} + +// merge the Pikaday class declaration with a module +declare namespace Pikaday { + interface PikadayI18nConfig { + previousMonth: string; + nextMonth: string; + months: string[]; + weekdays: string[]; + weekdaysShort: string[]; + } + + interface PikadayOptions { + /** + * Bind the datepicker to a form field. + */ + field?: HTMLElement; + + /** + * The default output format for toString() and field value. + * Requires Moment.js for custom formatting. + */ + format?: string; + + /** + * Use a different element to trigger opening the datepicker. + * Default: field element. + */ + trigger?: HTMLElement; + + /** + * Automatically show/hide the datepicker on field focus. + * Default: true if field is set. + */ + bound?: boolean; + + /** + * Preferred position of the datepicker relative to the form field + * (e.g. 'top right'). Automatic adjustment may occur to avoid + * displaying outside the viewport. Default: 'bottom left'. + */ + position?: string; + + /** + * Can be set to false to not reposition the datepicker within the + * viewport, forcing it to take the configured position. Default: true. + */ + reposition?: boolean; + + /** + * DOM node to render calendar into, see container example. + * Default: undefined. + */ + container?: HTMLElement; + + /** + * The initial date to view when first opened. + */ + defaultDate?: Date; + + /** + * Make the defaultDate the initial selected value. + */ + setDefaultDate?: boolean; + + /** + * First day of the week (0: Sunday, 1: Monday, etc). + */ + firstDay?: number; + + /** + * The earliest date that can be selected (this should be a native + * Date object - e.g. new Date() or moment().toDate()). + */ + minDate?: Date; + + /** + * The latest date that can be selected (this should be a native + * Date object - e.g. new Date() or moment().toDate()). + */ + maxDate?: Date; + + /** + * Disallow selection of Saturdays and Sundays. + */ + disableWeekends?: boolean; + + /** + * Callback function that gets passed a Date object for each day + * in view. Should return true to disable selection of that day. + */ + disableDayFn?: (date: Date) => boolean; + + /** + * Number of years either side (e.g. 10) or array of upper/lower range + * (e.g. [1900, 2015]). + */ + yearRange?: number | number[]; + + /** + * Show the ISO week number at the head of the row. Default: false. + */ + showWeekNumber?: boolean; + + /** + * Reverse the calendar for right-to-left languages. Default: false. + */ + isRTL?: boolean; + + /** + * Language defaults for month and weekday names. + */ + i18n?: PikadayI18nConfig; + + /** + * Additional text to append to the year in the title. + */ + yearSuffix?: string; + + /** + * Render the month after the year in the title. Default: false. + */ + showMonthAfterYear?: boolean; + + /** + * Render days of the calendar grid that fall in the next or previous months to the current month instead of rendering an empty table cell. Default: false. + */ + showDaysInNextAndPreviousMonths?: boolean; + + /** + * Number of visible calendars. + */ + numberOfMonths?: number; + + /** + * When numberOfMonths is used, this will help you to choose where the + * main calendar will be (default left, can be set to right). Only used + * for the first display or when a selected date is not already visible. + */ + mainCalendar?: string; + + /** + * Define a class name that can be used as a hook for styling different + * themes. Default: null. + */ + theme?: string; + + /** + * Callback function for when a date is selected. + */ + onSelect?: (date: Date) => void; + + /** + * Callback function for when the picker becomes visible. + */ + onOpen?: () => void; + + /** + * Callback function for when the picker is hidden. + */ + onClose?: () => void; + + /** + * Callback function for when the picker draws a new month. + */ + onDraw?: () => void; + + /*--pikaday-time specific addition--*/ + /** + * Optional boolean property to specify whether to show time controls with calendar or not. + */ + showTime?: boolean; + /** + * Optional boolean property to specify whether to show minute controls with calendar or not. + */ + showMinutes?: boolean; + /** + * Optional boolean property to specify whether to show second controls with calendar or not. + */ + showSeconds?: boolean; + /** + * Optional boolean property to specify whether to use 24 hours format or not. + */ + use24hour?: boolean; + /** + * Optional numeric property to specify the increment step for hour. + */ + incrementHourBy?: number; + /** + * Optional numeric property to specify the increment step for minute. + */ + incrementMinuteBy?: number; + /** + * Optional numeric property to specify the increment step for second. + */ + incrementSecondBy?: number; + /** + * Optional numeric property to prevent calendar from auto-closing after date is selected. + */ + autoClose?: boolean; + /** + * Optional string added to left of time select + */ + timeLabel?: string; + } +} + +declare module "pikaday-time" { + export = Pikaday; +} \ No newline at end of file From 5cd1e799c7994871b6d99f00588f078b4836c0aa Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Fri, 11 Nov 2016 11:33:51 +0100 Subject: [PATCH 04/22] Added build option to the options Also items is optional --- jquery.contextMenu/jquery.contextMenu.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jquery.contextMenu/jquery.contextMenu.d.ts b/jquery.contextMenu/jquery.contextMenu.d.ts index 4b52a0ed84..fbfa6b49cc 100644 --- a/jquery.contextMenu/jquery.contextMenu.d.ts +++ b/jquery.contextMenu/jquery.contextMenu.d.ts @@ -25,7 +25,8 @@ interface JQueryContextMenuOptions { hide?: () => void; }; callback?: (key: any, options: any) => any; - items: any; + items?: any; + build?: (triggerElement: JQuery, e: Event) => any; reposition?: boolean; className?: string; itemClickEvent?: string; From e27839594aaf058d6dc0852a2b7c443db2af2dd3 Mon Sep 17 00:00:00 2001 From: Ambrus Adrian-Zoltan Date: Fri, 11 Nov 2016 22:11:32 +0200 Subject: [PATCH 05/22] angular-bootstrap-calendar: Added event action interface Added event color interface Made Event type optional, as it is not obligatory according to the documentation Fixed IOnViewChangeClick, it must return a boolean, not void. --- .../angular-bootstrap-calendar.d.ts | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts index e32dcfca68..1ab82dfd7c 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts @@ -6,6 +6,34 @@ /// declare namespace angular.bootstrap.calendar { + interface IEventAction { + /** + * The label of the action + */ + label: string; + /** + * CSS class to be added to the action element + */ + cssClass?: string; + /** + * The action that occurs when it's clicked + * @param args - the IEvent whose action was clicked + */ + onClick: (args: IEvent) => void; + } + + interface IEventColor { + /** + * The primary color of the event, should be darker than secondary + */ + primary: string; + + /** + * The secondary color of the event, should be lighter than primary + */ + secondary: string; + } + interface IEvent { /** * The title of the event @@ -14,7 +42,7 @@ declare namespace angular.bootstrap.calendar { /** * The type of the event (determines its color). Can be important, warning, info, inverse, success or special */ - type: string; + type?: string; /** * A javascript date object for when the event starts */ @@ -23,6 +51,14 @@ declare namespace angular.bootstrap.calendar { * Optional - a javascript date object for when the event ends */ endsAt?: Date; + /** + * Color of the Event + */ + color?: IEventColor; + /** + * Actions of the Event + */ + actions?: Array; /** * If edit-event-html is set and this field is explicitly set to false then dont make it editable. */ @@ -51,6 +87,10 @@ declare namespace angular.bootstrap.calendar { * A CSS class (or more, just separate with spaces) that will be added to the event when it is displayed on each view. Useful for marking an event as selected / active etc */ cssClass?: string; + /** + * If set the event will display as all-day event + */ + allDay?: boolean; } interface ICalendarConfig { @@ -132,7 +172,7 @@ declare namespace angular.bootstrap.calendar { } interface IOnViewChangeClick { - (calendarDate: Date, calendarNextView: string): void; + (calendarDate: Date, calendarNextView: string): boolean; } } } From 1ccda2e1c00e1cc3105993ff44be951ffacdcdb1 Mon Sep 17 00:00:00 2001 From: elizabethkilson Date: Fri, 11 Nov 2016 17:12:02 -0500 Subject: [PATCH 06/22] Adding two constants that are defined in the node module --- hellosign-embedded/hellosign-embedded.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hellosign-embedded/hellosign-embedded.d.ts b/hellosign-embedded/hellosign-embedded.d.ts index 45b70774ff..c973cbddab 100644 --- a/hellosign-embedded/hellosign-embedded.d.ts +++ b/hellosign-embedded/hellosign-embedded.d.ts @@ -169,6 +169,20 @@ declare module HelloSign { */ EVENT_CANCELED: string; + /** + * The user sent a signature request + * + * @default signature_request_sent + */ + EVENT_SENT: string; + + /** + * The template was created or edited + * + * @default template_created + */ + EVENT_TEMPLATE_CREATED: string; + /** * An error occurred in the iFrame * From 1a8b117df1b3c742386f29df635010bb17fc0937 Mon Sep 17 00:00:00 2001 From: elizabethkilson Date: Fri, 11 Nov 2016 20:10:51 -0500 Subject: [PATCH 07/22] Expanding the MessageEvent type to include all properties of different types of events --- hellosign-embedded/hellosign-embedded.d.ts | 60 +++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/hellosign-embedded/hellosign-embedded.d.ts b/hellosign-embedded/hellosign-embedded.d.ts index c973cbddab..c1b0a7fd02 100644 --- a/hellosign-embedded/hellosign-embedded.d.ts +++ b/hellosign-embedded/hellosign-embedded.d.ts @@ -3,10 +3,66 @@ // Definitions by: Brian Surowiec // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare module HelloSign { - interface MessageEvent { - event: string; + interface SignedMessageEvent { + event: 'signature_request_signed'; + signature_id: string; } + interface DeclinedMessageEvent { + event: 'signature_request_declined'; + signature_id: string; + } + + interface CanceledMessageEvent { + event: 'signature_request_canceled'; + } + + interface SentMessageEvent { + event: 'signature_request_sent'; + signature_request_id: string; + signature_request_info: { + title: string; + message: string; + signatures: Array<{ + signature_id: string; + signer_email_address: string; + signer_name: string; + order: number; + status_code: string; + signed_at: number; + last_viewed_at: number; + last_reminded_at: number; + has_pin: boolean; + }>; + cc_email_addresses: Array; + }; + } + + interface TemplateCreatedMessageEvent { + event: 'template_created'; + template_id: string; + template_info: { + title: string; + message: string; + signer_roles: Array<{ + name: string; + order: number; + }>; + cc_roles: Array<{ + name: string; + }>; + }; + } + + interface ErrorMessageEvent { + event: 'error'; + description: string; + } + + type MessageEvent = SignedMessageEvent | DeclinedMessageEvent | + CanceledMessageEvent | SentMessageEvent | TemplateCreatedMessageEvent | + ErrorMessageEvent; + interface ClientCultures { /** * English (United States) From 25a3664371e1d526b7369316c93e2becac5e2b12 Mon Sep 17 00:00:00 2001 From: Jacob Windsor Date: Sun, 13 Nov 2016 13:34:07 +0100 Subject: [PATCH 08/22] Update Auth0DecodedHash The id_token should be in camelCase not snake case (idToken). See fourth code block in https://auth0.com/docs/quickstart/spa/angular2/02-custom-login --- auth0-js/auth0-js.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth0-js/auth0-js.d.ts b/auth0-js/auth0-js.d.ts index 250c7a850e..f1b24653b4 100644 --- a/auth0-js/auth0-js.d.ts +++ b/auth0-js/auth0-js.d.ts @@ -84,7 +84,7 @@ interface Auth0Identity { interface Auth0DecodedHash { access_token: string; - id_token: string; + idToken: string; profile: Auth0UserProfile; state: any; } From f3f097d1c9e88cbc5f18dafd0214ef01421d7d58 Mon Sep 17 00:00:00 2001 From: Dustin Wehr Date: Sun, 13 Nov 2016 15:15:25 -0400 Subject: [PATCH 09/22] add EventType, few minor fixes/additions fix CollaborativeMap.size loadAppDataDocument, loadFromJson missing handleErrors param to RealtimeLoader --- .../google-drive-realtime-api.d.ts | 119 ++++++++++++++---- 1 file changed, 93 insertions(+), 26 deletions(-) diff --git a/google-drive-realtime-api/google-drive-realtime-api.d.ts b/google-drive-realtime-api/google-drive-realtime-api.d.ts index 025ce08a86..6cfd9b1cc1 100644 --- a/google-drive-realtime-api/google-drive-realtime-api.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -16,8 +16,9 @@ // gapi is a global var introduced by https://apis.google.com/js/api.js declare namespace gapi.drive.realtime { + export type CollaborativeObjectType = 'EditableString' | 'Map' | 'List' - type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; + export type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Collaborator @@ -65,7 +66,7 @@ declare namespace gapi.drive.realtime { // see gapi.drive.realtime.CollaborrativeType for possible values; for custom collaborative objects, this value is // application-defined. // Addition: the possible values for standard objects are EditableString, List, and Map. - type:string; + type:CollaborativeObjectType; // Adds an event listener to the event target. The same handler can only be added once per the type. // Even if you add the same handler multiple times using the same type then it will only be called once @@ -107,9 +108,9 @@ declare namespace gapi.drive.realtime { // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeMap export class CollaborativeMap extends CollaborativeObject { - size:string; + size:number; - static type:string; // equals "Map" + static type:'Map'; // Removes all entries. clear():void; @@ -154,7 +155,7 @@ declare namespace gapi.drive.realtime { // The text of this collaborative string. Reading from this property is equivalent to calling getText(). Writing to this property is equivalent to calling setText(). text:string; - static type:string; // equals "EditableString" + static type:'EditableString'; // Appends a string to the end of this one. append(text:string):void; @@ -186,7 +187,7 @@ declare namespace gapi.drive.realtime { // The length of a list cannot be extended in this way. length:number; - static type:string; // equals "List" + static type:"List"; // Returns a copy of the contents of this collaborative list as an array. // Changes to the returned object will not affect the original collaborative list. @@ -344,9 +345,68 @@ declare namespace gapi.drive.realtime { undo():void; } + export type EventType = 'object_changed' | 'values_set' | 'values_added' | 'values_removed' | 'value_changed' | + 'text_inserted' | 'text_deleted' | 'collaborator_joined' | 'collaborator_left' | 'reference_shifted' | + 'document_save_state_changed' | 'undo_redo_state_changed' | 'attribute_changed'; + export const EventType:{ + // A collaborative object has changed. This event wraps a specific event, and bubbles to ancestors. + // Defaults to object_changed. + OBJECT_CHANGED:'object_changed' + + // Values in a list are changed in place. + // Defaults to values_set. + VALUES_SET:'values_set', + + // New values have been added to the list. + // values_added + VALUES_ADDED:'values_added' + + // Values have been removed from the list. + // values_removed + VALUES_REMOVED:'values_removed' + + // A map or custom object value has changed. Note this could be a new value or deleted value. + // value_changed + VALUE_CHANGED:'value_changed' + + // Text has been inserted into a string. + // text_inserted + TEXT_INSERTED:'text_inserted' + + // Text has been removed from a string. + // text_deleted + TEXT_DELETED:'text_deleted' + + // A new collaborator joined the document. Listen on the gapi.drive.realtime.Document for these changes. + // collaborator_joined + COLLABORATOR_JOINED:'collaborator_joined' + + // A collaborator left the document. Listen on the gapi.drive.realtime.Document for these changes. + // collaborator_left + COLLABORATOR_LEFT:'collaborator_left' + + // An index reference changed. + // reference_shifted + REFERENCE_SHIFTED:'reference_shifted' + + // The document save state changed. Listen on the gapi.drive.realtime.Document for these changes. + // document_save_state_changed + DOCUMENT_SAVE_STATE_CHANGED:'document_save_state_changed' + + // The model canUndo/canRedo state changed. Listen on the gapi.drive.realtime.Model for these changes. + // undo_redo_state_changed + UNDO_REDO_STATE_CHANGED:'undo_redo_state_changed' + + // A metadata attribute of the document changed. This is fired on changes to: + // gapi.drive.realtime.Attribute.IS_READ_ONLY + // Listen on the gapi.drive.realtime.Document for these changes. + // attribute_changed + ATTRIBUTE_CHANGED:'attribute_changed' + } + // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.BaseModelEvent - interface BaseModelEvent { + export interface BaseModelEvent { // Whether this event bubbles. bubbles : boolean; @@ -373,7 +433,7 @@ declare namespace gapi.drive.realtime { target : CollaborativeObject; // The type of the event. - type : string; + type : EventType; // The user id of the user that initiated this event. userId : string; @@ -399,6 +459,7 @@ declare namespace gapi.drive.realtime { Array of string The list of names from the hierarchy of compound operations that initiated the event. Value must not be null. + isLocal boolean True if the event originated in the local session. @@ -417,7 +478,7 @@ declare namespace gapi.drive.realtime { // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.ObjectChangedEvent - interface ObjectChangedEvent extends BaseModelEvent { + export interface ObjectChangedEvent extends BaseModelEvent { // parameters as in BaseModelEvent above except for addition of: // events: // Array of gapi.drive.realtime.BaseModelEvent @@ -435,7 +496,7 @@ declare namespace gapi.drive.realtime { new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[], isLocal:boolean, isUndo:boolean, isRedo:boolean, index:number, values:V[], movedFromList:CollaborativeList, movedFromIndex:number):ValuesAddedEvent; - + // The index of the first added value index:number; @@ -523,7 +584,7 @@ declare namespace gapi.drive.realtime { "missing_property" | "not_found" | "forbidden" | "server_error" | "client_error" | "token_refresh_required" | "invalid_element_type" | "no_write_permission" | "fatal_network_error" | "unexpected_element"; - export var ErrorType : { + export const ErrorType : { // Another user created the document's initial state after // gapi.drive.realtime.load was called but before the local // creation was saved. @@ -627,12 +688,12 @@ declare namespace gapi.drive.realtime { opt_initializerFn? : (m:Model) => void, opt_errorFn? : (e:gapi.drive.realtime.Error) => void ) : Document; - + /* Loads an existing file by id. https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime#.load - + @Param fileId {string} Id of the file to load. - + @Param onLoaded {function(non-null gapi.drive.realtime.Document)} A callback that will be called when the realtime document is ready. The created or opened realtime document object will be passed to this function. @@ -649,8 +710,22 @@ declare namespace gapi.drive.realtime { fileId:string, onLoaded? : (d:Document) => void, opt_initializerFn? : (m:Model) => void, - opt_errorFn? : (e:gapi.drive.realtime.Error) => void + opt_errorFn? : (e:Error) => void ):void; + + export function loadAppDataDocument( + onLoaded:(x:Document) => void, + opt_initializerFn?:(x:Model) => void, + opt_errorFn?:(e:Error) => void + ):void + + // Loads an in-memory document from a json string. + // This document does not talk to the server and will only exist in memory for as long as the browser session exists. + export function loadFromJson( + json:string, + opt_errorFn?:(e:Error) => void + ):Document + } @@ -674,29 +749,21 @@ declare namespace gapi.drive.realtime.databinding { } -declare namespace gapi.drive.realtime.EventType { - export var TEXT_INSERTED: string - export var TEXT_DELETED: string - export var OBJECT_CHANGED: string - // List - export var VALUES_ADDED:string; - export var VALUES_REMOVED:string; - export var VALUES_SET:string; -} - - // rtclient is a global var introduced by realtime-client-utils.js declare namespace rtclient { // INCOMPLETE export interface RealtimeLoader { start():void; load():void; + handleErrors(e:gapi.drive.realtime.Error):void; } interface RealtimeLoaderFactory { new (options:LoaderOptions) : RealtimeLoader; } // *********************************** + // NOTE THIS IS OUT OF DATE. realtime-client-utils.js has been rewritten, with the new version "Realtime Utils 1.0.0". + // Will add typings for the new version later. // The remainder of this file types some (not all) things in realtime-client-utils.js, found here: // https://developers.google.com/google-apps/realtime/realtime-quickstart // and From 19854af46f2bcd37cf416341ce74ef03ab1717b9 Mon Sep 17 00:00:00 2001 From: Marius Cristea Date: Mon, 14 Nov 2016 14:36:26 +0200 Subject: [PATCH 10/22] add $cancelRequest to IResourceArray --- angularjs/angular-resource.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index f7e803c1c8..bf983c9a69 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -52,7 +52,7 @@ declare namespace angular.resource { where deleteDescriptor : IActionDescriptor */ actions?: IActionHash, options?: IResourceOptions): IResourceClass; } - + // Hash of action descriptors allows custom action names interface IActionHash { [action: string]: IActionDescriptor @@ -165,6 +165,8 @@ declare namespace angular.resource { * Really just a regular Array object with $promise and $resolve attached to it */ interface IResourceArray extends Array> { + $cancelRequest(): void; + /** the promise of the original server interaction that created this collection. **/ $promise : angular.IPromise>; $resolved : boolean; @@ -191,7 +193,7 @@ declare namespace angular { /** creating a resource service factory */ factory(name: string, resourceServiceFactoryFunction: angular.resource.IResourceServiceFactoryFunction): IModule; } - + namespace auto { interface IInjectorService { get(name: '$resource'): ng.resource.IResourceService; From 5e2d11c1e701e2609980b3dce31dcfbb30296e42 Mon Sep 17 00:00:00 2001 From: Bryan Johnson Date: Mon, 14 Nov 2016 10:34:50 -0700 Subject: [PATCH 11/22] Update mapbox-gl to v0.27.0 --- mapbox-gl/mapbox-gl-0.26.0.d.ts | 948 ++++++++++++++++++++++++++++++++ mapbox-gl/mapbox-gl.d.ts | 50 +- 2 files changed, 980 insertions(+), 18 deletions(-) create mode 100644 mapbox-gl/mapbox-gl-0.26.0.d.ts diff --git a/mapbox-gl/mapbox-gl-0.26.0.d.ts b/mapbox-gl/mapbox-gl-0.26.0.d.ts new file mode 100644 index 0000000000..ddb6344cbd --- /dev/null +++ b/mapbox-gl/mapbox-gl-0.26.0.d.ts @@ -0,0 +1,948 @@ +// Type definitions for Mapbox GL JS v0.26.0 +// Project: https://github.com/mapbox/mapbox-gl-js +// Definitions by: Dominik Bruderer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace mapboxgl { + let accessToken: string; + let version: string; + export function supported(options?: {failIfMajorPerformanceCaveat?: boolean}): boolean; + + /** + * Map + */ + export class Map extends Evented { + constructor(options?: MapboxOptions); + + addControl(control: Control): this; + + addClass(klass: string, options?: mapboxgl.StyleOptions): this; + + removeClass(klass: string, options?: mapboxgl.StyleOptions): this; + + setClasses(klasses: string[], options?: mapboxgl.StyleOptions): this; + + hasClass(klass: string): boolean; + + getClasses(): string[]; + + resize(): this; + + getBounds(): mapboxgl.LngLatBounds; + + setMaxBounds(lnglatbounds?: mapboxgl.LngLatBounds | number[][]): this; + + setMinZoom(minZoom?: number): this; + + setMaxZoom(maxZoom?: number): this; + + project(lnglat: mapboxgl.LngLat | number[]): mapboxgl.Point; + + unproject(point: mapboxgl.Point | number[]): mapboxgl.LngLat; + + queryRenderedFeatures(pointOrBox?: mapboxgl.Point|number[]|mapboxgl.Point[]|number[][], parameters?: {layers?: string[], filter?: any[]}): GeoJSON.Feature[]; + + querySourceFeatures(sourceID: string, parameters: {sourceLayer?: string, filter?: any[]}): GeoJSON.Feature[]; + + setStyle(style: mapboxgl.Style | string): this; + + getStyle(): mapboxgl.Style; + + addSource(id: string, source: VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw): this; + + removeSource(id: string): this; + + getSource(id: string): VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource; + + addLayer(layer: mapboxgl.Layer, before?: string): this; + + removeLayer(id: string): this; + + getLayer(id: string): mapboxgl.Layer; + + setFilter(layer: string, filter: any[]): this; + + setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this; + + getFilter(layer: string): any[]; + + setPaintProperty(layer: string, name: string, value: any, klass?: string): this; + + getPaintProperty(layer: string, name: string, klass?: string): any; + + setLayoutProperty(layer: string, name: string, value: any): this; + + getLayoutProperty(layer: string, name: string, klass?: string): any; + + getContainer(): HTMLElement; + + getCanvasContainer(): HTMLElement; + + getCanvas(): HTMLCanvasElement; + + loaded(): boolean; + + remove(): void; + + onError(): void; + + showTileBoundaries: boolean; + + showCollisionBoxes: boolean; + + repaint: boolean; + + getCenter(): mapboxgl.LngLat; + + setCenter(center: LngLat|number[], eventData?: mapboxgl.EventData): this; + + panBy(offset: number[], options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + panTo(lnglat: mapboxgl.LngLat, options?: mapboxgl.AnimationOptions, eventdata?: mapboxgl.EventData): this; + + getZoom(): number; + + setZoom(zoom: number, eventData?: mapboxgl.EventData): this; + + zoomTo(zoom: number, options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + zoomIn(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + zoomOut(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + getBearing(): number; + + setBearing(bearing: number, eventData?: mapboxgl.EventData): this; + + rotateTo(bearing: number, options?: mapboxgl.AnimationOptions, eventData?: EventData): this; + + resetNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + snapToNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + getPitch(): number; + + setPitch(pitch: number, eventData?: EventData): this; + + fitBounds(bounds: mapboxgl.LngLatBounds | number[][], options?: { linear?: boolean, easing?: Function, padding?: number, offset?: Point|number[],maxZoom?: number }): this; + + jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this; + + easeTo(options: mapboxgl.CameraOptions | mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this; + + flyTo(options: mapboxgl.FlyToOptions, eventData?: mapboxgl.EventData): this; + + stop(): this; + + scrollZoom: ScrollZoomHandler; + + boxZoom: BoxZoomHandler; + + dragRotate: DragRotateHandler; + + dragPan: DragPanHandler; + + keyboard: KeyboardHandler; + + doublClickZoom: DoubleClickZoomHandler; + + touchZoomRotate: TouchZoomRotateHandler; + } + + export interface MapboxOptions { + /** If true, an attribution control will be added to the map. */ + attributionControl?: boolean; + + bearing?: number; + + /** Snap to north threshold in degrees. */ + bearingSnap?: number; + + /** If true, enable the "box zoom" interaction (see BoxZoomHandler) */ + boxZoom?: boolean; + + /** initial map center */ + center?: mapboxgl.LngLat | number[]; + + /** Style class names with which to initialize the map */ + classes?: string[]; + + /** ID of the container element */ + container?: string | Element; + + /** If true, enable the "drag to pan" interaction (see DragPanHandler). */ + dragPan?: boolean; + + /** If true, enable the "drag to rotate" interaction (see DragRotateHandler). */ + dragRotate?: boolean; + + /** If true, enable the "double click to zoom" interaction (see DoubleClickZoomHandler). */ + doubleClickZoom?: boolean; + + /** If true, the map will track and update the page URL according to map position */ + hash?: boolean; + + /** If true, map creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than expected. */ + failIfMayorPerformanceCaveat?: boolean; + + /** If false, no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input */ + interactive?: boolean; + + /** If true, enable keyboard shortcuts (see KeyboardHandler). */ + keyboard?: boolean; + + /** If set, the map is constrained to the given bounds. */ + maxBounds?: mapboxgl.LngLatBounds | number[][]; + + /** Maximum zoom of the map */ + maxZoom?: number; + + /** Minimum zoom of the map */ + minZoom?: number; + + /** If true, The maps canvas can be exported to a PNG using map.getCanvas().toDataURL();. This is false by default as a performance optimization. */ + preserveDrawingBuffer?: boolean; + + pitch?: number; + + /** If true, enable the "scroll to zoom" interaction */ + scrollZoom?: boolean; + + /** stylesheet location */ + style?: mapboxgl.Style | string; + + /** If true, the map will automatically resize when the browser window resizes */ + trackResize?: boolean; + + /** If true, enable the "pinch to rotate and zoom" interaction (see TouchZoomRotateHandler). */ + touchZoomRotate?: boolean; + + /** Initial zoom level */ + zoom?: number; + } + + /** + * BoxZoomHandler + */ + export class BoxZoomHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + isActive(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * ScrollZoomHandler + */ + export class ScrollZoomHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * DragPenHandler + */ + export class DragPanHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + isActive(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * DragRotateHandler + */ + export class DragRotateHandler { + constructor(map: mapboxgl.Map, options?: {bearingSnap?: number, pitchWithRotate?: boolean}); + + isEnabled(): boolean; + + isActive(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * KeyboardHandler + */ + export class KeyboardHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * DoubleClickZoomHandler + */ + export class DoubleClickZoomHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + } + + /** + * TouchZoomRotateHandler + */ + export class TouchZoomRotateHandler { + constructor(map: mapboxgl.Map); + + isEnabled(): boolean; + + enable(): void; + + disable(): void; + + disableRotation(): void; + + enableRotation(): void; + } + + /** + * Control + */ + export class Control extends Evented { + addTo(map: mapboxgl.Map): this; + + remove(): this; + } + + /** + * ControlOptions + */ + export interface ControlOptions { + position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; + } + + /** + * Navigation + */ + export class NavigationControl extends Control { + constructor(options?: mapboxgl.ControlOptions); + } + + /** + * Geolocate + */ + export class GeolocateControl extends Control { + constructor(options?: mapboxgl.ControlOptions); + } + + /** + * Attribution + */ + export class AttributionControl extends Control { + constructor(options?: mapboxgl.ControlOptions); + } + + /** + * Scale + */ + export class ScaleControl extends Control { + constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string}) + } + + /** + * Popup + */ + export class Popup extends Evented { + constructor(options?: mapboxgl.PopupOptions); + + addTo(map: mapboxgl.Map): this; + + isOpen(): boolean; + + remove(): this; + + getLngLat(): mapboxgl.LngLat; + + setLngLat(lnglat: mapboxgl.LngLat | number[]): this; + + setText(text: string): this; + + setHTML(html: string): this; + + setDOMContent(htmlNode: Node): this; + } + + export interface PopupOptions { + closeButton?: boolean; + + closeOnClick?: boolean; + + anchor?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; + + offset?: number | Point | number[] | { [key:string]: Point | number[];}; + } + + export interface Style { + bearing?: number; + center?: number[]; + glyphs?: string; + layers?: Layer[]; + metadata?: any; + name?: string; + pitch?: number; + sources?: any; + sprite?: string; + transition?: Transition; + version: number; + zoom?: number; + } + + export interface Transition { + delay?: number; + duration?: number; + } + + export interface Source { + type: "vector" | "raster" | "geojson" | "image" | "video"; + } + + /** + * GeoJSONSource + */ + + export interface GeoJSONSourceRaw extends Source, GeoJSONSourceOptions { + type: "geojson"; + } + + export class GeoJSONSource implements GeoJSONSourceRaw { + type: "geojson"; + + constructor(options?: mapboxgl.GeoJSONSourceOptions); + + setData(data: GeoJSON.Feature | GeoJSON.FeatureCollection | String): this; + } + + export interface GeoJSONSourceOptions { + data?: GeoJSON.Feature | GeoJSON.FeatureCollection | string; + + maxzoom?: number; + + buffer?: number; + + tolerance?: number; + + cluster?: number | boolean; + + clusterRadius?: number; + + clusterMaxZoom?: number; + } + + /** + * VideoSource + */ + export class VideoSource implements Source, VideoSourceOptions { + type: "video"; + + constructor(options?: mapboxgl.VideoSourceOptions); + + getVideo(): HTMLVideoElement; + + setCoordinates(coordinates: number[][]): this; + } + + export interface VideoSourceOptions { + urls?: string[]; + + coordinates?: number[][]; + } + + /** + * ImageSource + */ + export class ImageSource implements Source, ImageSourceOptions { + type: "image"; + + constructor(options?: mapboxgl.ImageSourceOptions); + + setCoordinates(coordinates: number[][]): this; + } + + export interface ImageSourceOptions { + url?: string; + + coordinates?: number[][]; + } + + interface VectorSource extends Source { + type: "vector"; + url?: string; + tiles?: string[]; + minzoom?: number; + maxzoom?: number; + } + + interface RasterSource extends Source { + type: "raster"; + url: string; + tiles?: string[]; + minzoom?: number; + maxzoom?: number; + tileSize?: number; + } + + /** + * LngLat + */ + export class LngLat { + lng: number; + lat: number; + + constructor(lng: number, lat: number); + + /** Return a new LngLat object whose longitude is wrapped to the range (-180, 180). */ + wrap(): mapboxgl.LngLat; + + /** Return a LngLat as an array */ + toArray(): number[]; + + /** Return a LngLat as a string */ + toString(): string; + + static convert(input: number[]|mapboxgl.LngLat): mapboxgl.LngLat; + } + + /** + * LngLatBounds + */ + export class LngLatBounds { + sw: LngLat | number[]; + ne: LngLat | number[]; + constructor(sw?: LngLat, ne?: LngLat); + + /** Extend the bounds to include a given LngLat or LngLatBounds. */ + extend(obj: mapboxgl.LngLat | mapboxgl.LngLatBounds): this; + + /** Get the point equidistant from this box's corners */ + getCenter(): mapboxgl.LngLat; + + /** Get southwest corner */ + getSouthWest(): mapboxgl.LngLat; + + /** Get northeast corner */ + getNorthEast(): mapboxgl.LngLat; + + /** Get northwest corner */ + getNorthWest(): mapboxgl.LngLat; + + /** Get southeast corner */ + getSouthEast(): mapboxgl.LngLat; + + /** Get west edge longitude */ + getWest(): number; + + /** Get south edge latitude */ + getSouth(): number; + + /** Get east edge longitude */ + getEast(): number; + + /** Get north edge latitude */ + getNorth(): number; + + /** Returns a LngLatBounds as an array */ + toArray(): number[][]; + + /** Return a LngLatBounds as a string */ + toString(): string; + + /** Convert an array to a LngLatBounds object, or return an existing LngLatBounds object unchanged. */ + static convert(input: mapboxgl.LngLatBounds | number[] | number[][]): mapboxgl.LngLatBounds; + } + + /** + * Point + */ + // Todo: Pull out class to seperate definition for Module "point-geometry" + export class Point { + constructor(options?: Object); + + clone(): Point; + + add(p: number): Point; + + sub(p: number): Point; + + mult(k: number): Point; + + div(k: number): Point; + + rotate(a: number): Point; + + matMult(m: number): Point; + + unit(): Point; + + perp(): Point; + + round(): Point; + + mag(): number; + + equals(): boolean; + + dist(): number; + + distSqr(): number; + + angle(): number; + + angleTo(): number; + + angleWidth(): number; + + angleWidthSep(): number; + } + + export class Marker { + constructor(element?: HTMLElement, options?: { offset?: Point | number[] }); + + addTo(map: Map): this; + + remove(): this; + + getLngLat(): LngLat; + + setLngLat(lngLat: LngLat | number[]): this; + + setPopup(popup?: Popup): this; + + getPopup(): Popup; + + togglePopup(): this; + } + + /** + * Evented + */ + export class Evented { + on(type: string, listener: Function): this; + + off(type?: string | any, listener?: Function): this; + + once(type: string, listener: Function): this; + + fire(type: string, data?: mapboxgl.EventData | Object): this; + + listens(type: string): boolean; + } + + /** + * StyleOptions + */ + export interface StyleOptions { + transition?: boolean; + } + + /** + * EventData + */ + export class EventData { + type: string; + target: Map; + originalEvent: Event; + point: mapboxgl.Point; + lngLat: mapboxgl.LngLat; + } + + export class MapMouseEvent { + type: string; + target: Map; + originalEvent: MouseEvent; + point: mapboxgl.Point; + lngLat: mapboxgl.LngLat; + } + + export class MapTouchEvent { + type: string; + target: Map; + originalEvent: TouchEvent; + point: mapboxgl.Point; + lngLat: mapboxgl.LngLat; + points: Point[]; + lngLats: LngLat[]; + } + + export class MapBoxZoomEvent { + originalEvent: MouseEvent; + boxZoomBounds: LngLatBounds; + } + + export class MapDataEvent { + type: string; + dataType: "source" | "style" | "tile"; + } + + /** + * AnimationOptions + */ + export interface AnimationOptions { + /** Number in milliseconds */ + duration?: number; + easing?: Function; + /** point, origin of movement relative to map center */ + offset?: Point | number[]; + /** When set to false, no animation happens */ + animate?: boolean; + } + + /** + * CameraOptions + */ + export interface CameraOptions { + /** Map center */ + center?: mapboxgl.LngLat | number[]; + /** Map zoom level */ + zoom?: number; + /** Map rotation bearing in degrees counter-clockwise from north */ + bearing?: number; + /** Map angle in degrees at which the camera is looking at the ground */ + pitch?: number; + /** If zooming, the zoom center (defaults to map center) */ + around?: mapboxgl.LngLat | number[]; + } + + /** + * FlyToOptions + */ + export interface FlyToOptions extends AnimationOptions, CameraOptions { + curve?: number; + minZoom?: number; + speed?: number; + screenSpeed?: number; + easing?: Function; + } + + /** + * MapEvent + */ + export interface MapEvent { + resize?: void; + webglcontextlost?: {originalEvent: WebGLContextEvent}; + webglcontextrestored?: {originalEvent: WebGLContextEvent}; + remove?: void; + dataloading?: {data: mapboxgl.MapDataEvent}; + data?: {data: mapboxgl.MapDataEvent}; + render?: void; + contextmenu?: {data: mapboxgl.MapMouseEvent}; + dblclick?: {data: mapboxgl.MapMouseEvent}; + click?: {data: mapboxgl.MapMouseEvent}; + touchcancel?: {data: mapboxgl.MapTouchEvent}; + touchmove?: {data: mapboxgl.MapTouchEvent}; + touchend?: {data: mapboxgl.MapTouchEvent}; + touchstart?: {data: mapboxgl.MapTouchEvent}; + mousemove?: {data: mapboxgl.MapMouseEvent}; + mouseup?: {data: mapboxgl.MapMouseEvent}; + mousedown?: {data: mapboxgl.MapMouseEvent}; + moveend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + move?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + movestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + mouseout?:{data: mapboxgl.MapMouseEvent}; + load?: void; + zoomend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + zoom?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + zoomstart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + boxzoomcancel?: {data: mapboxgl.MapBoxZoomEvent}; + boxzoomstart?: {data: mapboxgl.MapBoxZoomEvent}; + boxzoomend?: {data: mapboxgl.MapBoxZoomEvent}; + rotate?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + rotatestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + rotateend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + drag?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + dragend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent}; + pitch?: {data: mapboxgl.EventData}; + } + + export interface Layer { + id: string; + type?: "fill" | "line" | "symbol" | "circle" | "raster" | "background" | string; //TODO: Ideally we wouldn't accept string here, just these specific strings + + metadata?: any; + ref?: string; + + source?: string; + + "source-layer"?: string; + + minzoom?: number; + maxzoom?: number; + + interactive?: boolean; + + filter?: any[]; + layout?: BackgroundLayout | FillLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout; + paint?: BackgroundPaint | FillPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint; + } + + export interface StyleFunction { + stops: any[][]; + property?: string; + base?: number; + type?: "identity" | "exponential" | "interval" | "categorical"; + "colorSpace"?: "rgb" | "lab" | "interval"; + } + + export interface BackgroundLayout { + visibility?: "visible" | "none"; + } + export interface BackgroundPaint { + "background-color"?: string; + "background-pattern"?: string; + "background-opacity"?: number; + } + + export interface FillLayout { + visibility?: "visible" | "none"; + } + export interface FillPaint { + "fill-antialias"?: boolean; + "fill-opacity"?: number | StyleFunction; + "fill-color"?: string | StyleFunction; + "fill-outline-color": string | StyleFunction; + "fill-translate"?: number[]; + "fill-translate-anchor"?: "map" | "viewport"; + "fill-pattern"?: "string"; + "fill-extrude-height"?: number; + "fill-extrude-base"?: number; + } + + export interface LineLayout { + visibility?: "visible" | "none"; + + "line-cap"?: "butt" | "round" | "square"; + "line-join"?: "bevel" | "round" | "miter"; + "line-miter-limit"?: number; + "line-round-limit"?: number; + } + export interface LinePaint { + "line-opacity"?: number; + "line-color"?: string| StyleFunction; + "line-translate"?: number[]; + "line-translate-anchor"?: "map" | "viewport"; + "line-width"?: number; + "line-gap-width"?: number; + "line-offset"?: number; + "line-blur"?: number; + "line-dasharray"?: number[]; + "line-dasharray-transition"?: Transition; + "line-pattern"?: string; + } + + export interface SymbolLayout { + visibility?: "visible" | "none"; + + "symbol-placement"?: "point" | "line"; + "symbol-spacing"?: number; + "symbol-avoid-edges"?: boolean; + "icon-allow-overlap"?: boolean; + "icon-ignore-placement"?: boolean; + "icon-optional"?: boolean; + "icon-rotation-alignment"?: "map" | "viewport" | "auto"; + "icon-size"?: number; + "icon-text-fit"?: "none" | "both" | "width" | "height"; + "icon-text-fit-padding"?: number[]; + "icon-image"?: string; + "icon-rotate"?: number | StyleFunction; + "icon-padding"?: number; + "icon-keep-upright"?: boolean; + "icon-offset"?: number[]; + "text-pitch-alignment"?: "map" | "viewport" | "auto"; + "text-rotation-alignment"?: "map" | "viewport" | "auto"; + "text-field"?: string; + "text-font"?: string | string[]; + "text-size"?: number; + "text-max-width"?: number; + "text-line-height"?: number; + "text-letter-spacing"?: number; + "text-justify"?: "left" | "center" | "right"; + "text-anchor"?: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right"; + "text-max-angle"?: number; + "text-rotate"?: number; + "text-padding"?: number; + "text-keep-upright"?: boolean; + "text-transform"?: "none" | "uppercase" | "lowercase"; + "text-offset"?: number[]; + "text-allow-overlap"?: boolean; + "text-ignore-placement"?: boolean; + "text-optional"?: boolean; + + } + export interface SymbolPaint { + "icon-opacity"?: number; + "icon-color"?: string; + "icon-halo-color"?: string; + "icon-halo-width"?: number; + "icon-halo-blur"?: number; + "icon-translate"?: number[]; + "icon-translate-anchor"?: "map" | "viewport"; + "text-opacity"?: number; + "text-color"?: "string"; + "text-halo-color"?: "string"; + "text-halo-width"?: number; + "text-halo-blur"?: number; + "text-translate"?: number[]; + "text-translate-anchor"?: "map" | "viewport"; + } + + export interface RasterLayout { + visibility?: "visible" | "none"; + } + + export interface RasterPaint { + "raster-opacity"?: number; + "raster-hue-rotate"?: number; + "raster-brightness-min"?: number; + "raster-brightness-max"?: number; + "raster-saturation"?: number; + "raster-contrast"?: number; + "raster-fade-duration"?: number; + } + + export interface CircleLayout { + visibility?: "visible" | "none"; + } + + export interface CirclePaint { + "circle-radius"?: number | StyleFunction; + "circle-radius-transition"?: Transition; + "circle-color"?: number | StyleFunction; + "circle-blur"?: number | StyleFunction; + "circle-opacity"?: number | StyleFunction; + "circle-translate"?: number[]; + "circle-translate-anchor"?: "map" | "viewport"; + "circle-pitch-scale"?: "map" | "viewport"; + } +} + +declare module 'mapbox-gl' { + export = mapboxgl; +} diff --git a/mapbox-gl/mapbox-gl.d.ts b/mapbox-gl/mapbox-gl.d.ts index ddb6344cbd..d7474e0006 100644 --- a/mapbox-gl/mapbox-gl.d.ts +++ b/mapbox-gl/mapbox-gl.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mapbox GL JS v0.26.0 +// Type definitions for Mapbox GL JS v0.27.0 // Project: https://github.com/mapbox/mapbox-gl-js // Definitions by: Dominik Bruderer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -16,7 +16,9 @@ declare namespace mapboxgl { export class Map extends Evented { constructor(options?: MapboxOptions); - addControl(control: Control): this; + addControl(control: Control, position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'): this; + + removeControl(control: Control): this; addClass(klass: string, options?: mapboxgl.StyleOptions): this; @@ -36,8 +38,12 @@ declare namespace mapboxgl { setMinZoom(minZoom?: number): this; + getMinZoom(): number; + setMaxZoom(maxZoom?: number): this; + getMaxZoom(): number; + project(lnglat: mapboxgl.LngLat | number[]): mapboxgl.Point; unproject(point: mapboxgl.Point | number[]): mapboxgl.LngLat; @@ -328,44 +334,34 @@ declare namespace mapboxgl { * Control */ export class Control extends Evented { - addTo(map: mapboxgl.Map): this; - - remove(): this; - } - - /** - * ControlOptions - */ - export interface ControlOptions { - position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'; } /** * Navigation */ export class NavigationControl extends Control { - constructor(options?: mapboxgl.ControlOptions); + constructor(); } /** * Geolocate */ export class GeolocateControl extends Control { - constructor(options?: mapboxgl.ControlOptions); + constructor(); } /** * Attribution */ export class AttributionControl extends Control { - constructor(options?: mapboxgl.ControlOptions); + constructor(); } /** * Scale */ export class ScaleControl extends Control { - constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string}) + constructor(options?: {maxWidth?: number, unit?: string}) } /** @@ -409,6 +405,7 @@ declare namespace mapboxgl { metadata?: any; name?: string; pitch?: number; + light?: Light; sources?: any; sprite?: string; transition?: Transition; @@ -421,6 +418,13 @@ declare namespace mapboxgl { duration?: number; } + export interface Light { + "anchor"?: "map" | "viewport"; + "position"?: number[]; + "color"?: string; + "intensity"?: number; + } + export interface Source { type: "vector" | "raster" | "geojson" | "image" | "video"; } @@ -831,8 +835,18 @@ declare namespace mapboxgl { "fill-translate"?: number[]; "fill-translate-anchor"?: "map" | "viewport"; "fill-pattern"?: "string"; - "fill-extrude-height"?: number; - "fill-extrude-base"?: number; + } + + export interface FillExtrusionLayout { + visibility?: "visible" | "none"; + } + export interface FillExtrusionPaint { + "fill-extrusion-opacity"?: number; + "fill-extrusion-color"?: string | StyleFunction; + "fill-extrusion-translate"?: number[]; + "fill-extrusion-translate-anchor"?: "map" | "viewport"; + "fill-extrusion-height"?: number | StyleFunction; + "fill-extrusion-base"?: number; } export interface LineLayout { From 9ef0bc438facbc6a3b827af49dbafabc5a2cb612 Mon Sep 17 00:00:00 2001 From: Bryan Johnson Date: Mon, 14 Nov 2016 10:46:53 -0700 Subject: [PATCH 12/22] Make sure FillExtrusion layer is available --- mapbox-gl/mapbox-gl.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mapbox-gl/mapbox-gl.d.ts b/mapbox-gl/mapbox-gl.d.ts index d7474e0006..bfe5390504 100644 --- a/mapbox-gl/mapbox-gl.d.ts +++ b/mapbox-gl/mapbox-gl.d.ts @@ -803,8 +803,8 @@ declare namespace mapboxgl { interactive?: boolean; filter?: any[]; - layout?: BackgroundLayout | FillLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout; - paint?: BackgroundPaint | FillPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint; + layout?: BackgroundLayout | FillLayout | FillExtrusionLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout; + paint?: BackgroundPaint | FillPaint | FillExtrusionPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint; } export interface StyleFunction { From afd2957d82451dbfe589fb36470311915f98bee2 Mon Sep 17 00:00:00 2001 From: groetzi Date: Mon, 14 Nov 2016 17:50:08 -0600 Subject: [PATCH 13/22] Update xlsx.d.ts added signatures for decode_[cell|range] --- xlsx/xlsx.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xlsx/xlsx.d.ts b/xlsx/xlsx.d.ts index 68f89b545a..6f29ac2095 100644 --- a/xlsx/xlsx.d.ts +++ b/xlsx/xlsx.d.ts @@ -134,6 +134,11 @@ declare module 'xlsx' { r: number; } + export interface IRange { + s: ICell; + e: ICell; + } + export interface IUtils { sheet_to_json(worksheet:IWorkSheet, opts?: { raw?: boolean; @@ -144,6 +149,8 @@ declare module 'xlsx' { sheet_to_formulae(worksheet: IWorkSheet):any; encode_cell(cell: ICell): any; encode_range(s: ICell, e: ICell): any; + decode_cell(address: string): ICell; + decode_range(range: string): IRange; } } From db7a40ef1bf5c497e3f12019b983a9f66e9cf242 Mon Sep 17 00:00:00 2001 From: beginor Date: Tue, 15 Nov 2016 11:29:55 +0800 Subject: [PATCH 14/22] add gettype to ol.geom.Geometry --- openlayers/openlayers.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openlayers/openlayers.d.ts b/openlayers/openlayers.d.ts index e516793fb2..a48e26071b 100644 --- a/openlayers/openlayers.d.ts +++ b/openlayers/openlayers.d.ts @@ -3728,6 +3728,12 @@ declare module ol { */ transform(source: ol.ProjectionLike, destination: ol.ProjectionLike): ol.geom.Geometry; + /** + * Get the type of this geometry. + * @abstract + * @return {ol.geom.GeometryType} Geometry type. + */ + getType(): ol.geom.GeometryType; } /** From f04b4be809ab52d85e782c6a0d52b1f8cc7e6aa9 Mon Sep 17 00:00:00 2001 From: Ambrus Adrian-Zoltan Date: Wed, 16 Nov 2016 20:11:41 +0200 Subject: [PATCH 15/22] angular-bootstrap-calendar: Changed onClick function parameter type to any --- angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts index 1ab82dfd7c..34c7876897 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar.d.ts @@ -19,7 +19,7 @@ declare namespace angular.bootstrap.calendar { * The action that occurs when it's clicked * @param args - the IEvent whose action was clicked */ - onClick: (args: IEvent) => void; + onClick: (args: any) => void; } interface IEventColor { From 3cfaccc98d45cba363ba358722e0dcbe588b4de6 Mon Sep 17 00:00:00 2001 From: Rouffiat Vincent Date: Fri, 18 Nov 2016 14:14:39 +0100 Subject: [PATCH 16/22] Type react-redux-i18n: return valide callback function --- react-redux-i18n/react-redux-i18n.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/react-redux-i18n/react-redux-i18n.d.ts b/react-redux-i18n/react-redux-i18n.d.ts index 537955af37..ca02c5789a 100644 --- a/react-redux-i18n/react-redux-i18n.d.ts +++ b/react-redux-i18n/react-redux-i18n.d.ts @@ -23,6 +23,10 @@ declare module 'react-redux-i18n' { type TranslationObjects = { [lang: string]: SubTranslationObject }; + type DispatchCallback = { + (dispatch?: _Redux.Dispatch, getState?: () => S): any; + } + type I18nState = { translations: TranslationObjects; locale: string; @@ -58,8 +62,8 @@ declare module 'react-redux-i18n' { /** * Redux Actions */ - export function loadTranslations(translationsObject: TranslationObjects): void; + export function loadTranslations(translationsObject: TranslationObjects): DispatchCallback; - export function setLocale(locale: string): void; + export function setLocale(locale: string): DispatchCallback; } From d13e19cb6b063d78b89198efd1adce6f16d6c673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Pluci=C5=84ski?= Date: Sun, 20 Nov 2016 11:34:36 +0100 Subject: [PATCH 17/22] Updated to version 3.3.3 - fix in cascade from boolean to string --- jstree/jstree-tests.ts | 12 ++++++++++++ jstree/jstree.d.ts | 39 ++++++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts index 11c5bd9af4..39c1759828 100644 --- a/jstree/jstree-tests.ts +++ b/jstree/jstree-tests.ts @@ -114,3 +114,15 @@ tree.get_path('nodeId'); tree.get_path('nodeId', '/'); tree.get_path('nodeId', '/', true); + + +var coreThemes: JSTreeStaticDefaultsCoreThemes = { + ellipsis:true +}; + +// tree with new theme elipsis +var treeWithNewCoreProperties = $('#treeWithNewEllipsisProperties').jstree({ + core: { + themes: coreThemes + } +}); diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 2292da7f9c..e70016511d 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1,8 +1,8 @@ -// Type definitions for jsTree v3.3.2 +// Type definitions for jsTree v3.3.3 // Project: http://www.jstree.com/ // Definitions by: Adam Pluciński // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// 1 commit bb0473ae8cfc205585b6404ef86f650df2f6996e 2016-08-15 +// 1 commit 26e99ad5ec27c1a594ed57974cb16e0987482fd5 2016-11-19 /// @@ -374,6 +374,12 @@ interface JSTreeStaticDefaultsCoreThemes { */ icons?: boolean; + /** + * a boolean indicating if node ellipsis should be shown - this only works with a fixed with on the container + * @name $.jstree.defaults.core.themes.ellipsis + */ + ellipsis?: boolean; + /** * a boolean indicating if the tree background is striped * @name $.jstree.defaults.core.themes.stripes @@ -423,13 +429,13 @@ interface JSTreeStaticDefaultsCheckbox { keep_selected_style: boolean; /** - * This setting controls how cascading and undetermined nodes are applied. - * If 'up' is in the string - cascading up is enabled, if 'down' is in the string - cascading down is enabled, if 'undetermined' is in the string - undetermined nodes will be used. + * This setting controls how cascading and undetermined nodes are applied. + * If 'up' is in the string - cascading up is enabled, if 'down' is in the string - cascading down is enabled, if 'undetermined' is in the string - undetermined nodes will be used. * If `three_state` is set to `true` this setting is automatically set to 'up+down+undetermined'. Defaults to ''. * @name $.jstree.defaults.checkbox.cascade * @plugin checkbox */ - cascade: boolean; + cascade: string; /** * This setting controls if checkbox are bound to the general tree selection @@ -737,6 +743,11 @@ interface JSTree extends JQuery { */ teardown: () => void; + /** + * Create prototype node + */ + _create_prototype_node: () => HTMLElement; + /** * bind all events. Used internally. * @private @@ -1567,6 +1578,24 @@ interface JSTree extends JQuery { */ toggle_icons: () => void; + /** + * show the node ellipsis + * @name show_icons() + */ + show_ellipsis: () => void; + + /** + * hide the node ellipsis + * @name hide_ellipsis() + */ + hide_ellipsis: () => void; + + /** + * toggle the node ellipsis + * @name toggle_icons() + */ + toggle_ellipsis: () => void; + /** * set the node icon for a node * @name set_icon(obj, icon) From 1d62ee1441829ff4fa858c22bfc5b32dcab4fcc9 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 21 Nov 2016 08:35:34 -0800 Subject: [PATCH 18/22] Fix typoes in readme and improve link readability --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ab2080714b..0a7131bd99 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ DefinitelyTyped only works because of contributions by users like you! Before you share your improvement with the world, use it yourself. -#### Test editing an exiting package +#### Test editing an existing package To add new features you can use [module augmentation](http://www.typescriptlang.org/docs/handbook/declaration-merging.html). You can also directly edit the types in `node_modules/@types/foo/index.d.ts`, or copy them from there and follow the steps below. @@ -100,7 +100,7 @@ If it doesn't, you can do so yourself in the comment associated with the PR. #### Create a new package -If you are the library author, or can make a pull request to the library, [bundle](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) types instead of publishing to DefinitelyTyped. +If you are the library author, or can make a pull request to the library, [bundle types](http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html) instead of publishing to DefinitelyTyped. If you are adding typings for an NPM package, create a directory with the same name. If the package you are adding typings for is not on NPM, make sure the name you choose for it does not conflict with the name of a package on NPM. @@ -192,7 +192,7 @@ Changes to the `master` branch are also manually merged into the `types-2.0` bra #### I'm writing a definition that depends on another definition. Should I use `` or an import? If the module you're referencing is an external module (uses `export`), use an import. -If the module you're referenceing is an ambient module (uses `declare module`, or just declares globals), use ``. +If the module you're referencing is an ambient module (uses `declare module`, or just declares globals), use ``. #### What do I do about older versions of typings? From 9fd6eab69291b4760d6bd6f8a197220d827b0ecf Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 21 Nov 2016 08:52:14 -0800 Subject: [PATCH 19/22] Convert \r\n -> \n in a few files --- gapi.analytics/gapi.analytics-tests.ts | 132 ++++++------- gapi.analytics/gapi.analytics.d.ts | 252 ++++++++++++------------- matter-js/matter-js.d.ts | 2 +- 3 files changed, 193 insertions(+), 193 deletions(-) diff --git a/gapi.analytics/gapi.analytics-tests.ts b/gapi.analytics/gapi.analytics-tests.ts index a6aea00796..78b30e1745 100644 --- a/gapi.analytics/gapi.analytics-tests.ts +++ b/gapi.analytics/gapi.analytics-tests.ts @@ -1,66 +1,66 @@ -// Type definitions for Google Analytics API - -/// -/// - -function test_namespace() { - var analytics : boolean = gapi.client.analytics instanceof Object; - - var provisioning : boolean = gapi.client.analytics.provisioning.createAccountTicket instanceof Function; - analytics = analytics && provisioning; - - var data : boolean = gapi.client.analytics.data.ga.get instanceof Function; - data = data && gapi.client.analytics.data.mcf.get instanceof Function; - data = data && gapi.client.analytics.data.realtime.get instanceof Function; - analytics = analytics && data; - - interface AnalyticsParameter { - "type" ?: string; - "description" ?: string; - "default" ?: string; - "enum" ?: string[]; - "enumDescriptions" ?: string[]; - "location" ?: string; - } - var kBI : AnalyticsParameter = gapi.client.analytics.kB.parameters.alt; - var kB = !!kBI; - kBI = gapi.client.analytics.kB.parameters.fields; - kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.key; - kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.oauth_token; - kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.prettyPrint; - kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.quotaUser; - kB = kB && !!kBI; - kBI = gapi.client.analytics.kB.parameters.userIP; - kB = kB && !!kBI; - analytics = analytics && kB; - - var management : boolean = gapi.client.analytics.management.accountSummaries.list instanceof Function; - management = management && gapi.client.analytics.management.accountUserLinks.list instanceof Function; - management = management && gapi.client.analytics.management.accounts.list instanceof Function; - management = management && gapi.client.analytics.management.customDataSources.list instanceof Function; - management = management && gapi.client.analytics.management.customDimensions.list instanceof Function; - management = management && gapi.client.analytics.management.customMetrics.list instanceof Function; - management = management && gapi.client.analytics.management.experiments.list instanceof Function; - management = management && gapi.client.analytics.management.filters.list instanceof Function; - management = management && gapi.client.analytics.management.goals.list instanceof Function; - management = management && gapi.client.analytics.management.profileFilterLinks.list instanceof Function; - management = management && gapi.client.analytics.management.profileUserLinks.list instanceof Function; - management = management && gapi.client.analytics.management.profiles.list instanceof Function; - management = management && gapi.client.analytics.management.remarketingAudience.list instanceof Function; - management = management && gapi.client.analytics.management.segments.list instanceof Function; - management = management && gapi.client.analytics.management.unsampledReports.list instanceof Function; - management = management && gapi.client.analytics.management.uploads.list instanceof Function; - management = management && gapi.client.analytics.management.webPropertyAdWordsLinks.list instanceof Function; - management = management && gapi.client.analytics.management.webproperties.list instanceof Function; - management = management && gapi.client.analytics.management.webpropertyUserLinks.list instanceof Function; - analytics = analytics && management; - - var metadata : boolean = gapi.client.analytics.metadata.column.list instanceof Function; - analytics = analytics && metadata; - - return analytics; -} +// Type definitions for Google Analytics API + +/// +/// + +function test_namespace() { + var analytics : boolean = gapi.client.analytics instanceof Object; + + var provisioning : boolean = gapi.client.analytics.provisioning.createAccountTicket instanceof Function; + analytics = analytics && provisioning; + + var data : boolean = gapi.client.analytics.data.ga.get instanceof Function; + data = data && gapi.client.analytics.data.mcf.get instanceof Function; + data = data && gapi.client.analytics.data.realtime.get instanceof Function; + analytics = analytics && data; + + interface AnalyticsParameter { + "type" ?: string; + "description" ?: string; + "default" ?: string; + "enum" ?: string[]; + "enumDescriptions" ?: string[]; + "location" ?: string; + } + var kBI : AnalyticsParameter = gapi.client.analytics.kB.parameters.alt; + var kB = !!kBI; + kBI = gapi.client.analytics.kB.parameters.fields; + kB = kB && !!kBI; + kBI = gapi.client.analytics.kB.parameters.key; + kB = kB && !!kBI; + kBI = gapi.client.analytics.kB.parameters.oauth_token; + kB = kB && !!kBI; + kBI = gapi.client.analytics.kB.parameters.prettyPrint; + kB = kB && !!kBI; + kBI = gapi.client.analytics.kB.parameters.quotaUser; + kB = kB && !!kBI; + kBI = gapi.client.analytics.kB.parameters.userIP; + kB = kB && !!kBI; + analytics = analytics && kB; + + var management : boolean = gapi.client.analytics.management.accountSummaries.list instanceof Function; + management = management && gapi.client.analytics.management.accountUserLinks.list instanceof Function; + management = management && gapi.client.analytics.management.accounts.list instanceof Function; + management = management && gapi.client.analytics.management.customDataSources.list instanceof Function; + management = management && gapi.client.analytics.management.customDimensions.list instanceof Function; + management = management && gapi.client.analytics.management.customMetrics.list instanceof Function; + management = management && gapi.client.analytics.management.experiments.list instanceof Function; + management = management && gapi.client.analytics.management.filters.list instanceof Function; + management = management && gapi.client.analytics.management.goals.list instanceof Function; + management = management && gapi.client.analytics.management.profileFilterLinks.list instanceof Function; + management = management && gapi.client.analytics.management.profileUserLinks.list instanceof Function; + management = management && gapi.client.analytics.management.profiles.list instanceof Function; + management = management && gapi.client.analytics.management.remarketingAudience.list instanceof Function; + management = management && gapi.client.analytics.management.segments.list instanceof Function; + management = management && gapi.client.analytics.management.unsampledReports.list instanceof Function; + management = management && gapi.client.analytics.management.uploads.list instanceof Function; + management = management && gapi.client.analytics.management.webPropertyAdWordsLinks.list instanceof Function; + management = management && gapi.client.analytics.management.webproperties.list instanceof Function; + management = management && gapi.client.analytics.management.webpropertyUserLinks.list instanceof Function; + analytics = analytics && management; + + var metadata : boolean = gapi.client.analytics.metadata.column.list instanceof Function; + analytics = analytics && metadata; + + return analytics; +} diff --git a/gapi.analytics/gapi.analytics.d.ts b/gapi.analytics/gapi.analytics.d.ts index dc49ffd617..34027c9d47 100644 --- a/gapi.analytics/gapi.analytics.d.ts +++ b/gapi.analytics/gapi.analytics.d.ts @@ -1,126 +1,126 @@ -// Type definitions for Google Analytics API -// Project: https://developers.google.com/analytics/devguides/reporting/core/v4/ -// Definitions by: César Costas -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace gapi.client.analytics {} -declare namespace gapi.client.analytics.provisioning { - export function createAccountTicket() : Promise; -} - -interface DataQuery { - "ids" ?: string; - "start-date" ?: string; - "30daysAgo" ?: string; - "end-date" ?: string; - "yesterday" ?: string; - "metrics" ?: string; - "dimensions" ?: string; - "sort" ?: string; - "filters" ?: string; - "segment" ?: string; - "samplingLevel" ?: string; - "include-empty-rows" ?: string; - "start-index" ?: string; - "max-results" ?: string; -} -declare namespace gapi.client.analytics.data {} -declare namespace gapi.client.analytics.data.ga { - export function get(data ?: DataQuery) : Promise; -} -declare namespace gapi.client.analytics.data.mcf { - export function get(data ?: DataQuery) : Promise; -} -declare namespace gapi.client.analytics.data.realtime { - export function get(data ?: DataQuery) : Promise; -} - -declare namespace gapi.client.analytics.kB {} -declare namespace gapi.client.analytics.kB.parameters { - export interface AnalyticsParameter { - "type" ?: string; - "description" ?: string; - "default" ?: string; - "enum" ?: string[]; - "enumDescriptions" ?: string[]; - "location" ?: string; - } - export class alt implements AnalyticsParameter {} - export class fields implements AnalyticsParameter {} - export class key implements AnalyticsParameter {} - export class oauth_token implements AnalyticsParameter {} - export class prettyPrint implements AnalyticsParameter {} - export class quotaUser implements AnalyticsParameter {} - export class userIP implements AnalyticsParameter {} -} - -interface View { - accountId ?: string; - webPropertyId ?: string; - webViewId ?: string; -} -declare namespace gapi.client.analytics.management {} -declare namespace gapi.client.analytics.management.accountSummaries { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.accountUserLinks { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.accounts { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.customDataSources { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.customDimensions { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.customMetrics { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.experiments { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.filters { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.goals { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.profileFilterLinks { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.profileUserLinks { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.profiles { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.remarketingAudience { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.segments { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.unsampledReports { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.uploads { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.webPropertyAdWordsLinks { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.webproperties { - export function list(view ?: View) : Promise; -} -declare namespace gapi.client.analytics.management.webpropertyUserLinks { - export function list(view ?: View) : Promise; -} - -declare namespace gapi.client.analytics.metadata {} -declare namespace gapi.client.analytics.metadata.column { - export function list() : Promise; -} +// Type definitions for Google Analytics API +// Project: https://developers.google.com/analytics/devguides/reporting/core/v4/ +// Definitions by: César Costas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.analytics {} +declare namespace gapi.client.analytics.provisioning { + export function createAccountTicket() : Promise; +} + +interface DataQuery { + "ids" ?: string; + "start-date" ?: string; + "30daysAgo" ?: string; + "end-date" ?: string; + "yesterday" ?: string; + "metrics" ?: string; + "dimensions" ?: string; + "sort" ?: string; + "filters" ?: string; + "segment" ?: string; + "samplingLevel" ?: string; + "include-empty-rows" ?: string; + "start-index" ?: string; + "max-results" ?: string; +} +declare namespace gapi.client.analytics.data {} +declare namespace gapi.client.analytics.data.ga { + export function get(data ?: DataQuery) : Promise; +} +declare namespace gapi.client.analytics.data.mcf { + export function get(data ?: DataQuery) : Promise; +} +declare namespace gapi.client.analytics.data.realtime { + export function get(data ?: DataQuery) : Promise; +} + +declare namespace gapi.client.analytics.kB {} +declare namespace gapi.client.analytics.kB.parameters { + export interface AnalyticsParameter { + "type" ?: string; + "description" ?: string; + "default" ?: string; + "enum" ?: string[]; + "enumDescriptions" ?: string[]; + "location" ?: string; + } + export class alt implements AnalyticsParameter {} + export class fields implements AnalyticsParameter {} + export class key implements AnalyticsParameter {} + export class oauth_token implements AnalyticsParameter {} + export class prettyPrint implements AnalyticsParameter {} + export class quotaUser implements AnalyticsParameter {} + export class userIP implements AnalyticsParameter {} +} + +interface View { + accountId ?: string; + webPropertyId ?: string; + webViewId ?: string; +} +declare namespace gapi.client.analytics.management {} +declare namespace gapi.client.analytics.management.accountSummaries { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.accountUserLinks { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.accounts { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.customDataSources { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.customDimensions { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.customMetrics { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.experiments { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.filters { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.goals { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.profileFilterLinks { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.profileUserLinks { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.profiles { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.remarketingAudience { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.segments { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.unsampledReports { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.uploads { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.webPropertyAdWordsLinks { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.webproperties { + export function list(view ?: View) : Promise; +} +declare namespace gapi.client.analytics.management.webpropertyUserLinks { + export function list(view ?: View) : Promise; +} + +declare namespace gapi.client.analytics.metadata {} +declare namespace gapi.client.analytics.metadata.column { + export function list() : Promise; +} diff --git a/matter-js/matter-js.d.ts b/matter-js/matter-js.d.ts index cc887673ee..f21ad2ef7b 100644 --- a/matter-js/matter-js.d.ts +++ b/matter-js/matter-js.d.ts @@ -2129,7 +2129,7 @@ declare namespace Matter { * @param {engine} engine * @param {} options * @return {MouseConstraint} A new MouseConstraint - */ + */ static create(engine: Engine, options?: IMouseConstraintDefinition): MouseConstraint; /** From 49d3e9fafb3c4046b6814691aef9660a683445ef Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 21 Nov 2016 20:25:25 -0500 Subject: [PATCH 20/22] update to 4.6.8, clean up old issues fixes #12385 fixes #11729 --- mongoose/mongoose.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 38d0a5cab8..17f821e82c 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mongoose 4.5.9 +// Type definitions for Mongoose 4.6.8 // Project: http://mongoosejs.com/ // Definitions by: simonxca , horiuchi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -285,6 +285,9 @@ declare module "mongoose" { open(connection_string: string, database?: string, port?: number, options?: ConnectionOpenOptions, callback?: (err: any) => void): any; + /** Helper for dropDatabase() */ + dropDatabase(callback?: (err: any) => void): Promise; + /** * Opens the connection to a replica set. * @param uris comma-separated mongodb:// URIs @@ -659,6 +662,8 @@ declare module "mongoose" { methods: any; /** Object of currently defined statics on this schema. */ statics: any; + /** The original object passed to the schema constructor */ + obj: any; } interface SchemaOptions { From 947c9afb55a009a8e4f531d7f886cd504350a357 Mon Sep 17 00:00:00 2001 From: Brian Michalski Date: Mon, 21 Nov 2016 21:00:47 -0500 Subject: [PATCH 21/22] Move gapi.client.request options to an interface. (#12835) --- gapi/gapi.d.ts | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/gapi/gapi.d.ts b/gapi/gapi.d.ts index 6d7e18a12e..54806755e8 100644 --- a/gapi/gapi.d.ts +++ b/gapi/gapi.d.ts @@ -127,27 +127,7 @@ declare namespace gapi.auth { } declare namespace gapi.client { - /** - * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. - * @param name The name of the API to load. - * @param version The version of the API to load. - * @return promise The promise that get's resolved after the request is finished. - */ - export function load(name: string, version: string): Promise - - /** - * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. - * @param name The name of the API to load. - * @param version The version of the API to load - * @param callback the function that is called once the API interface is loaded - * @param url optional, the url of your app - if using Google's APIs, don't set it - */ - export function load(name: string, version: string, callback: () => any, url?: string): void; - /** - * Creates a HTTP request for making RESTful requests. - * An object encapsulating the various arguments for this method. - */ - export function request(args: { + interface RequestOptions { /** * The URL to handle the request */ @@ -172,7 +152,29 @@ declare namespace gapi.client { * If supplied, the request is executed immediately and no gapi.client.HttpRequest object is returned */ callback?: () => any; - }): HttpRequest; + } + + /** + * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. + * @param name The name of the API to load. + * @param version The version of the API to load. + * @return promise The promise that get's resolved after the request is finished. + */ + export function load(name: string, version: string): Promise + + /** + * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. + * @param name The name of the API to load. + * @param version The version of the API to load + * @param callback the function that is called once the API interface is loaded + * @param url optional, the url of your app - if using Google's APIs, don't set it + */ + export function load(name: string, version: string, callback: () => any, url?: string): void; + /** + * Creates a HTTP request for making RESTful requests. + * An object encapsulating the various arguments for this method. + */ + export function request(args: RequestOptions): HttpRequest; /** * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. * @param method The method to be executed. From 5fc9a83c880df7379dfe2300aa5b27641794c455 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 21 Nov 2016 21:07:49 -0500 Subject: [PATCH 22/22] update mongoose deep populate options fixes #11571 --- mongoose/mongoose.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mongoose/mongoose.d.ts b/mongoose/mongoose.d.ts index 17f821e82c..96c03c438a 100644 --- a/mongoose/mongoose.d.ts +++ b/mongoose/mongoose.d.ts @@ -813,7 +813,8 @@ declare module "mongoose" { */ populate(callback: (err: any, res: this) => void): this; populate(path: string, callback?: (err: any, res: this) => void): this; - populate(options: ModelPopulateOptions, callback?: (err: any, res: this) => void): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[], + callback?: (err: any, res: this) => void): this; /** Gets _id(s) used during population of the given path. If the path was not populated, undefined is returned. */ populated(path: string): any; @@ -1454,7 +1455,7 @@ declare module "mongoose" { */ populate(path: string | Object, select?: string | Object, model?: any, match?: Object, options?: Object): this; - populate(options: ModelPopulateOptions): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[]): this; /** * Determines the MongoDB nodes from which to read. @@ -2428,6 +2429,8 @@ declare module "mongoose" { model?: string; /** optional query options like sort, limit, etc */ options?: Object; + /** deep populate */ + populate?: ModelPopulateOptions | ModelPopulateOptions[] } interface ModelUpdateOptions {