From 65d386f2de01f5399bc3010002058b3e04a32fea Mon Sep 17 00:00:00 2001 From: Roland Zwaga Date: Thu, 31 Jul 2014 09:23:37 +0200 Subject: [PATCH 0001/2220] Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4c2fbc8e16..b91802e87f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -9,6 +9,7 @@ All definitions files include a header with the author and editors, so at some p * [Add To Home Screen](http://cubiq.org/add-to-home-screen) (by [James Wilkins](http://www.codeplex.com/site/users/view/jamesnw)) * [AmCharts](http://www.amcharts.com/) (by [Covobonomo](https://github.com/covobonomo/)) * [AngularAgility](https://github.com/AngularAgility/AngularAgility) (by [Roland Zwaga](https://github.com/rolandzwaga) +* [AngularBootstrapLightbox](https://github.com/compact/angular-bootstrap-lightbox) (by [Roland Zwaga](https://github.com/rolandzwaga) * [AngularFire](https://www.firebase.com/docs/angular/reference.html) (by [Dénes Harmath](https://github.com/thSoft)) * [AngularJS](http://angularjs.org) (by [Diego Vilar](https://github.com/diegovilar)) ([wiki](https://github.com/borisyankov/DefinitelyTyped/wiki/AngularJS-Definitions-Usage-Notes)) * [angularLocalStorage](https://github.com/agrublev/angularLocalStorage) (by [Hiroki Horiuchi](https://github.com/horiuchi/)) From ee872c633411d2524cafc68d339f016acbfa1fd6 Mon Sep 17 00:00:00 2001 From: mihhail-lapushkin Date: Sun, 14 Sep 2014 00:08:00 +0300 Subject: [PATCH 0002/2220] Added definitions for "cors" and "tea-merge" --- cors/cors-tests.ts | 11 +++++++++++ cors/cors.d.ts | 24 ++++++++++++++++++++++++ tea-merge/tea-merge-tests.ts | 6 ++++++ tea-merge/tea-merge.d.ts | 9 +++++++++ 4 files changed, 50 insertions(+) create mode 100644 cors/cors-tests.ts create mode 100644 cors/cors.d.ts create mode 100644 tea-merge/tea-merge-tests.ts create mode 100644 tea-merge/tea-merge.d.ts diff --git a/cors/cors-tests.ts b/cors/cors-tests.ts new file mode 100644 index 0000000000..a3f5ea10e1 --- /dev/null +++ b/cors/cors-tests.ts @@ -0,0 +1,11 @@ +/// + +import express = require('express'); +import cors = require('cors'); + +var app = express(); +app.use(cors()); +app.use(cors({ + maxAge: 100, + credentials: true +})); diff --git a/cors/cors.d.ts b/cors/cors.d.ts new file mode 100644 index 0000000000..92fdd9634e --- /dev/null +++ b/cors/cors.d.ts @@ -0,0 +1,24 @@ +// Type definitions for cors +// Project: https://github.com/troygoode/node-cors/ +// Definitions by: Mihhail Lapushkin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "cors" { + import express = require('express'); + + module e { + interface CorsOptions { + origin?: any; + methods?: any; + allowedHeaders?: any; + exposedHeaders?: any; + credentials?: boolean; + maxAge?: number; + } + } + + function e(options?: e.CorsOptions): express.RequestHandler; + export = e; +} \ No newline at end of file diff --git a/tea-merge/tea-merge-tests.ts b/tea-merge/tea-merge-tests.ts new file mode 100644 index 0000000000..9d59bd65e1 --- /dev/null +++ b/tea-merge/tea-merge-tests.ts @@ -0,0 +1,6 @@ +/// + +import merge = require('tea-merge'); + +merge({ a: 1 }, { b: 2 }, { c: 'hello' }); +merge({ a1: true, a2: { b: 'hello' } }, { bca: [], a2: { c: 'world' } }); diff --git a/tea-merge/tea-merge.d.ts b/tea-merge/tea-merge.d.ts new file mode 100644 index 0000000000..2000e9bcd2 --- /dev/null +++ b/tea-merge/tea-merge.d.ts @@ -0,0 +1,9 @@ +// Type definitions for tea-merge +// Project: https://github.com/qualiancy/tea-merge +// Definitions by: Mihhail Lapushkin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "tea-merge" { + function e(destination: Object, ...sources: Object[]): Object; + export = e; +} \ No newline at end of file From a63e25478678d2cf4e6f646717b06ac30392ace7 Mon Sep 17 00:00:00 2001 From: mihhail-lapushkin Date: Wed, 17 Sep 2014 20:34:25 +0300 Subject: [PATCH 0003/2220] Cordova Contacts plugin fix In find() method the onError callback should be optional. https://cordova.apache.org/docs/en/3.3.0/cordova_contacts_contacts.md.ht ml#contacts.find --- cordova/plugins/Contacts.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cordova/plugins/Contacts.d.ts b/cordova/plugins/Contacts.d.ts index f054c12d09..afc3aa9038 100644 --- a/cordova/plugins/Contacts.d.ts +++ b/cordova/plugins/Contacts.d.ts @@ -32,7 +32,7 @@ interface Contacts { */ find(fields: string[], onSuccess: (contacts: Contact[]) => void, - onError: (error: ContactError) => void, + onError?: (error: ContactError) => void, options?: ContactFindOptions): void; } From a4b7732937f1eebd5902a7d6fc2fd164d8574d67 Mon Sep 17 00:00:00 2001 From: flashandy Date: Sat, 17 Jan 2015 12:10:10 +0100 Subject: [PATCH 0004/2220] Update underscore.d.ts missing declaration for wrapped.pick --- underscore/underscore.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index 8cf92df12b..2b3818c3e6 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -3020,6 +3020,7 @@ interface _Chain { * @see _.pick **/ pick(...keys: string[]): _Chain; + pick(keys: string[]): _Chain; pick(fn: (value: any, key: any, object: any) => any): _Chain; /** From 1b718961940d46754115ef6015607fe29a30b521 Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Tue, 3 Mar 2015 16:35:24 -0500 Subject: [PATCH 0005/2220] Updated with new definitions for Foundation 5.2 -- patches from https://github.com/georgemarshall --- foundation/foundation.d.ts | 303 ++++++++++++++++++++++++++++--------- 1 file changed, 235 insertions(+), 68 deletions(-) diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index d74e954e6e..326574ff41 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Foundation 3.2 +// Type definitions for Foundation 5.2.1 // Project: http://foundation.zurb.com/ // Definitions by: Boris Yankov // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,83 +6,250 @@ /// -interface OrbitOptions { - animation?: string; - animationSpeed?: number; - timer?: boolean; - resetTimerOnClick?: boolean; - advanceSpeed?: number; - pauseOnHover?: boolean; - startClockOnMouseOut?: boolean; - startClockOnMouseOutAfter?: number; - directionalNav?: number; - captions?: number; - captionAnimation?: string; - captionAnimationSpeed?: number; - bullets?: boolean; - bulletThumbs?: boolean; - bulletThumbLocation?: string; - afterSlideChange?: () => void; - fluid?: boolean; +interface AbideOptions { + live_validate?: boolean; + focus_on_invalid?: boolean; + error_labels?: boolean; + timeout?: number; + patterns?: Object; + validators?: { + equalTo?: () => boolean; + }; } -interface RevealOptions { - animation?: string; - animationSpeed?: number; - closeOnBackgroundClick?: boolean; - dismissModalClass?: string; - /** - * The class of the modals background. - */ - bgClass?: string; - open?: () => void; +interface AccordionOptions { + active_class?: string; + multi_expand?: boolean; + toggleable?: boolean; +} + +interface AlertOptions { + callback?: () => void; +} + +interface ClearingOptions { + templates?: { + viewing?: string; + }; +} + +interface DropdownOptions { + active_class?: string; + align?: string; + is_hover?: boolean; opened?: () => void; - close?: () => void; closed?: () => void; - /** - * The modals background object. - */ - bg: JQuery; - /** - * The css property for when the modal is opened and closed. - */ - css: { - open: { - opacity?: number; - visibility?: string; - display: string; - }; - close: { - opacity: number; - visibility: string; - display: string; - }; +} + +interface EqualizerOptions { + use_tallest?: boolean; + before_height_change?: () => void; + after_height_change?: () => void; +} + +interface InterchangeOptions { + load_attr?: string; + named_queries?: Object; + directives?: { + replace?: (el: HTMLElement, path: string, trigger: (...args: any[]) => any) => any; }; } interface JoyrideOptions { - tipLocation?: string; - nubPosition?: string; - scrollSpeed?: number; + expose?: boolean; + modal?: boolean; + tip_location?: string; + nub_position?: string; + scroll_speed?: number; timer?: number; - startTimerOnClick?: boolean; - nextButton?: boolean; - tipAnimation?: string; - pauseAfter?: number[]; - tipAnimationFadeSpeed?: number; - cookieMonster?: boolean; - cookieName?: string; - cookieDomain?: boolean; - tipContainer?: string; - postRideCallback?: () => void; - postStepCallback?: () => void; + start_timer_on_click?: boolean; + start_offset?: number; + next_button?: boolean; + tip_animation?: string; + pause_after?: number[]; + exposed?: HTMLElement[]; + tip_animation_fade_speed?: number; + cookie_monster?: boolean; + cookie_name?: string; + cookie_domain?: boolean; + cookie_expires?: number; + tip_container?: string; + abort_on_close?: boolean; + tip_location_patterns?: { + top?: string[]; + bottom?: string[]; + left?: string[]; + right?: string[]; + }; + post_ride_callback?: () => void; + post_step_callback?: () => void; + pre_step_callback?: () => void; + pre_ride_callback?: () => void; + post_expose_callback?: () => void; + template?: { + link?: string; + timer?: string; + tip?: string; + wrapper?: string; + button?: string; + modal?: string; + expose?: string; + expose_cover?: string; + }; + expose_add_class?: string; +} + +interface MagellanOptions { + active_class?: string; + threshold?: number; + destination_threshold?: number; + throttle_delay?: number; +} + +interface OffCanvasOptions {} + +interface OrbitOptions { + animation?: string; + timer_speed?: number; + pause_on_hover?: boolean; + resume_on_mouseout?: boolean; + next_on_click?: boolean; + animation_speed?: number; + stack_on_small?: boolean; + navigation_arrows?: boolean; + slide_number?: boolean; + slide_number_text?: string; + container_class?: string; + stack_on_small_class?: string; + next_class?: string; + prev_class?: string; + timer_container_class?: string; + timer_paused_class?: string; + timer_progress_class?: string; + slides_container_class?: string; + preloader_class?: string; + slide_selector?: string; + bullets_container_class?: string; + bullets_active_class?: string; + slide_number_class?: string; + caption_class?: string; + active_slide_class?: string; + orbit_transition_class?: string; + bullets?: boolean; + circular?: boolean; + timer?: boolean; + variable_height?: boolean; + swipe?: boolean; + before_slide_change?: () => void; + after_slide_change?: () => void; +} + +interface RevealOptions { + animation?: string; + animation_speed?: number; + close_on_background_click?: boolean; + close_on_esc?: boolean; + dismiss_modal_class?: string; + bg_class?: string; + open?: () => void; + opened?: () => void; + close?: () => void; + closed?: () => void; + bg?: JQuery; + css?: { + open?: Object; + close?: Object; + }; +} + +interface SliderOptions { + start?: number; + end?: number; + step?: number; + initial?: number; + display_selector?: string; + on_change?: () => void; +} + +interface TabOptions { + active_class?: string; + callback?: () => void; + deep_linking?: boolean; + scroll_to_content?: boolean; +} + +interface TooltipOptions { + additional_inheritable_classes?: string[]; + tooltip_class?: string; + append_to?: string; + touch_close_text?: string; + disable_for_touch?: boolean; + hover_delay?: number; + tip_template?: (selector: string, content: string) => string; +} + +interface TopbarOptions{ + index?: number; + sticky_class?: string; + custom_back_text?: boolean; + back_text?: string; + is_hover?: boolean; + mobile_show_parent_link?: boolean; + scrolltop?: boolean; + sticky_on?: string; +} + +interface FoundationOptions { + abide?: AbideOptions; + accordion?: AccordionOptions; + alert?: AlertOptions; + clearing?: ClearingOptions; + dropdown?: DropdownOptions; + interchange?: InterchangeOptions; + joyride?: JoyrideOptions; + magellan?: MagellanOptions; + offcanvas: OffCanvasOptions; + orbit?: OrbitOptions; + reveal?: RevealOptions; + tab?: TabOptions; + tooltip?: TooltipOptions; + topbar?: TopbarOptions; +} + +interface FoundationStatic { + name: string; + version: string; + media_queries: Object; + stylesheet: CSSStyleSheet; + global: { + namespace: string; + }; + init(scope: JQuery): JQuery; + init(scope: JQuery, libraries: FoundationOptions): JQuery; + init(scope: JQuery, libraries: string, method: FoundationOptions): JQuery; + init(scope: JQuery, libraries: string, method: string, options: Object): JQuery; + init_lib(lib: any, args: any): (...args: any[]) => any; + patch(lib: any): void; + inherit(scope: JQuery, methods: string): void; + set_namespace(): void; + libs: Object; + utils: { + S(selector: any, context: any): JQuery; + throttle(func: (...args: any[]) => any, delay: number): (...args: any[]) => any; + debounce(func: (...args: any[]) => any, delay: number, immediate: boolean): (...args: any[]) => any; + data_options(el: JQuery): Object; + register_media(media: string, media_class: string): void; + add_custom_rule(rule: string, media: string): void; + image_loaded(images: JQuery, callback: (...args: any[]) => any): void; + random_str(length?: number): string; + }; } interface JQuery { - orbit(): JQuery; - orbit(OrbitOptions): JQuery; - reveal(): JQuery; - reveal(RevealOptions): JQuery; - joyride(): JQuery; - joyride(JoyrideOptions): JQuery; + foundation(): JQuery; + foundation(libraries: FoundationOptions): JQuery; + foundation(libraries: string, method: FoundationOptions): JQuery; + foundation(libraries: string, method: string, options: Object): JQuery; } + +declare var Foundation: FoundationStatic; From 1bcc72555ee6fa70353326ca3baf2d3b4b7be796 Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Wed, 4 Mar 2015 09:23:34 -0500 Subject: [PATCH 0006/2220] Updated definitions for Foundation 5.5.1. --- CONTRIBUTORS.md | 2 +- foundation/foundation-tests.ts | 379 ++++++++++++++++++++-- foundation/foundation.d.ts | 570 ++++++++++++++++++--------------- 3 files changed, 662 insertions(+), 289 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 88905c88a5..da416132c8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -220,7 +220,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli) * [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157) -* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov), [George Marshall](https://github.com/georgemarshall), [Boltmade](https://github.com/Boltmade) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index f64c83483a..c95b54a5bb 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -1,33 +1,346 @@ -/// -/// - -function test_orbit() { - $("#featured").orbit(); - $('#featured').orbit({ - animation: 'fade', - animationSpeed: 800, - timer: true, - resetTimerOnClick: false, - advanceSpeed: 4000, - pauseOnHover: false, - startClockOnMouseOut: false, - startClockOnMouseOutAfter: 1000, - directionalNav: true, - captions: true, - captionAnimation: 'fade', - captionAnimationSpeed: 800, - bullets: false, - bulletThumbs: false, - bulletThumbLocation: '', - afterSlideChange: function () { }, - fluid: true - }); -} - -function test_fluid() { - $("#myModal").reveal(); -} - -function test_joyride() { - $("#chooseID").joyride(); -} \ No newline at end of file +/// +/// + +function empty_callback() : void {} + +function plugin_list() { + return [ + "abide", + "accordion", + "alert", + "clearing", + "dropdown", + "interchange", + "joyride", + "magellan", + "offcanvas", + "orbit", + "reveal", + "slider", + "tab", + "tooltip", + "topbar" + ]; +} + +function abide_patterns() { + var patterns : AbidePatterns; + patterns.alpha = /^[a-zA-Z]+$/; + patterns.alpha_numeric = /^[a-zA-Z0-9]+$/; + patterns.integer = /^[-+]?\d+$/; + patterns.number = /^[-+]?[1-9]\d*$/; + patterns.card = /^[0-9]{8}$/; + patterns.cvv = /^([0-9]){3,4}$/; + patterns.email = /^test@example\.org$/; + patterns.url = /http:\/\/www\.google\.com\//; + patterns.domain = /definitelytyped\.org/; + patterns.datetime = /([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))/; + patterns.date = /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/; + patterns.time = /(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}/; + patterns.dateISO = /\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/; + patterns.month_day_year = /(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d/; + patterns.color = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/; + return patterns; +} + +function abide_options() { + var opts : AbideOptions = {}; + opts.live_validate = false; + opts.validate_on_blur = true; + opts.focus_on_invalid = true; + opts.error_labels = true; + opts.timeout = 500; + opts.patterns = abide_patterns(); + opts.validators = { + diceRoll: function(el : HTMLInputElement, required : boolean, parent : HTMLElement) { + var possibilities = [true, false]; + return possibilities[Math.round(Math.random())]; + }, + isAllowed: function(el : HTMLInputElement, required : boolean, parent : HTMLElement) { + var possibilities = ["a@zurb.com", "b.zurb.com"]; + return possibilities.indexOf(el.value) > -1; + } + } + return opts; +} + +function accordion_options() { + var opts : AccordionOptions = {}; + opts.content_class = "content"; + opts.active_class = "class-name"; + opts.multi_expand = false; + opts.toggleable = true; + opts.callback = empty_callback; + return opts; +} + +function alert_options() { + var opts : AlertOptions = {}; + opts.callback = empty_callback; + return opts; +} + +function clearing_options() { + var opts : ClearingOptions = {}; + opts.templates = { + viewing : '
Some HTML
' + }; + opts.close_selectors = "#id-value, .class-name"; + opts.open_selectors = "li#id-value"; + opts.skip_selector = ".skip-class"; + opts.touch_label = "Display string"; + opts.init = true; + opts.locked = false; + return opts; +} + +function dropdown_options() { + var opts : DropdownOptions = {}; + opts.active_class = "class-name"; + opts.disabled_class = "disabled-class"; + opts.mega_class = "big"; + opts.align = "top"; + opts.is_hover = false; + opts.hover_timeout = 250; + opts.opened = empty_callback; + opts.closed = empty_callback; + return opts; +} + +function equalizer_options() { + var opts : EqualizerOptions = {}; + opts.use_tallest = true; + opts.equalize_on_stack = false; + return opts; +} + +function interchange_options() { + var opts : InterchangeOptions = {}; + opts.load_attr = "interchange"; + opts.named_queries = { + my_custom_query: "only screen and (max-width: 200px)" + }; + opts.directives = { + replace: empty_callback + }; + return opts; +} + +function joyride_options() { + var opts : JoyrideOptions = {}; + opts.expose = false; + opts.modal = true; + opts.keyboard = true; + opts.tip_location = "bottom"; + opts.nub_position = "left"; + opts.scroll_speed = 2500; + opts.scroll_animation = "lineaer"; + opts.timer = 100; + opts.start_timer_on_click = true; + opts.start_offset = 3; + opts.next_button = false; + opts.prev_button = false; + opts.tip_animation = "pulse"; + opts.pause_after = [4, 7, 10, 14]; + opts.exposed = ["#elm-id-one", "#elm-id-two"]; + opts.tip_animation_fade_speed = 100; + opts.cookie_monster = true; + opts.cookie_name = "ts_joyride"; + opts.cookie_domain = false; + opts.cookie_expires = 7; + opts.tip_container = '#header'; + opts.tip_location_patterns = { + top: ['botom'], + bottom: [], + left: ['right', 'top', 'bottom'], + right: ['left', 'top', 'bottom'] + }; + opts.post_ride_callback = empty_callback; + opts.post_step_callback = empty_callback; + opts.pre_step_callback = empty_callback; + opts.pre_ride_callback = empty_callback; + opts.post_expose_callback = empty_callback; + opts.template = { + link: '×', + timer: '
', + tip: '
', + wrapper: '
', + button: '', + prev_button: '', + modal: '
', + expose: '
', + expose_cover: '
' + }; + opts.expose_add_class = ".expose .class-name"; + return opts; +} + +function magellan_options() { + var opts : MagellanOptions = {}; + opts.active_class = ".active-element"; + opts.threshold = 20; + opts.destination_threshold = 30; + opts.throttle_delay = 24; + opts.fixed_top = 0; + opts.offset_by_height = false; + opts.duration = 1000; + opts.easing = "linear"; + return opts; +} + +function offcanvas_options() { + var opts : OffCanvasOptions = {}; + opts.open_method = "overlap_single"; + opts.close_on_click = true; + return opts; +} + +function orbit_options() { + var opts : OrbitOptions = {}; + opts.animation = 'slide'; + opts.timer_speed = 10000; + opts.pause_on_hover = true; + opts.resume_on_mouseout = false; + opts.next_on_click = true; + opts.animation_speed = 500; + opts.stack_on_small = false; + opts.navigation_arrows = true; + opts.slide_number = true; + opts.slide_number_text = 'of'; + opts.container_class = 'orbit-container'; + opts.stack_on_small_class = 'orbit-stack-on-small'; + opts.next_class = 'orbit-next'; + opts.prev_class = 'orbit-prev'; + opts.timer_container_class = 'orbit-timer'; + opts.timer_paused_class = 'paused'; + opts.timer_progress_class = 'orbit-progress'; + opts.slides_container_class = 'orbit-slides-container'; + opts.preloader_class = 'preloader'; + opts.slide_selector = 'li'; + opts.bullets_container_class = 'orbit-bullets'; + opts.bullets_active_class = 'active'; + opts.slide_number_class = 'orbit-slide-number'; + opts.caption_class = 'orbit-caption'; + opts.active_slide_class = 'active'; + opts.orbit_transition_class = 'orbit-transitioning'; + opts.bullets = true; + opts.circular = true; + opts.timer = true; + opts.variable_height = false; + opts.swipe = true; + opts.before_slide_change = empty_callback; + opts.after_slide_change = empty_callback; + return opts; +} + +function reveal_css_options() { + var opts : RevealCSSOptions = {}; + opts.opacity = 0; + opts.visibility = 'hidden'; + opts.display = "inline-block"; + return opts; +} + +function reveal_options() { + var opts : RevealOptions = {}; + opts.animation = "linear"; + opts.animation_speed = 500; + opts.close_on_background_click = false; + opts.dismiss_modal_class = ".modal-bye-bye"; + opts.multiple_opened = true; + opts.bg_class = ".modal-background"; + opts.root_element = "#element-id.element-class"; + opts.on_ajax_error = empty_callback; + opts.open = empty_callback; + opts.opened = empty_callback; + opts.close = empty_callback; + opts.close = empty_callback; + opts.bg = $("#my-modal-id .background"); + opts.css = { + open: reveal_css_options(), + close: reveal_css_options() + }; + return opts; +} + +function slider_options() { + var opts : SliderOptions; + opts.start = -1000; + opts.end = 1000; + opts.step = 50; + opts.precision = 4; + opts.initial = 0; + opts.vertical = false; + opts.trigger_input_change = true; + opts.on_change = empty_callback; + return opts; +} + +function tab_options() { + var opts : TabOptions = {}; + opts.active_class = "class-name"; + opts.callback = empty_callback; + opts.deep_linking = false; + opts.scroll_to_content = true; + opts.is_hover = false; + return opts; +} + +function tooltip_options() { + var opts : TooltipOptions = {}; + opts.additional_inheritable_classes = ["class1", "class2"]; + opts.tooltip_class = "tooltip"; + opts.append_to = "append-class"; + opts.touch_close_text = "Close"; + opts.disable_for_touch = true; + opts.hover_delay = 100; + opts.show_on = "all"; + opts.tip_template = function (selector, content) { + return '' + content + ''; + }; + return opts; +} + +function topbar_options() { + var opts : TopbarOptions = {}; + opts.index = 1; + opts.sticky_class = "top-bar"; + opts.custom_back_text = true; + opts.back_text = "Return"; + opts.is_hover = false; + opts.mobile_show_parent_link = true; + opts.scrolltop = true; + opts.sticky_on = "all"; + return opts; +} + +function foundation_options() : FoundationOptions { + var opts : FoundationOptions = {}; + opts.abide = abide_options(); + opts.accordion = accordion_options(); + opts.alert = alert_options(); + opts.clearing = clearing_options(); + opts.dropdown = dropdown_options(); + opts.equalizer = equalizer_options(); + opts.joyride = joyride_options(); + opts.magellan = magellan_options(); + opts.offcanvas = offcanvas_options(); + opts.orbit = orbit_options(); + opts.reveal = reveal_options(); + opts.slider = slider_options(); + opts.tab = tab_options(); + opts.tooltip = tooltip_options(); + opts.topbar = topbar_options(); + return opts; +} + +$(document).foundation(); + +$(document).foundation(foundation_options()); + +$(document).foundation("reflow"); +plugin_list().forEach((plugin) => $(document).foundation(plugin, "reflow")); + +$(document).foundation("slider", "set_value", 100); diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index 326574ff41..a531a051e1 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -1,255 +1,315 @@ -// Type definitions for Foundation 5.2.1 -// Project: http://foundation.zurb.com/ -// Definitions by: Boris Yankov -// Definitions: https://github.com/borisyankov/DefinitelyTyped - - -/// - -interface AbideOptions { - live_validate?: boolean; - focus_on_invalid?: boolean; - error_labels?: boolean; - timeout?: number; - patterns?: Object; - validators?: { - equalTo?: () => boolean; - }; -} - -interface AccordionOptions { - active_class?: string; - multi_expand?: boolean; - toggleable?: boolean; -} - -interface AlertOptions { - callback?: () => void; -} - -interface ClearingOptions { - templates?: { - viewing?: string; - }; -} - -interface DropdownOptions { - active_class?: string; - align?: string; - is_hover?: boolean; - opened?: () => void; - closed?: () => void; -} - -interface EqualizerOptions { - use_tallest?: boolean; - before_height_change?: () => void; - after_height_change?: () => void; -} - -interface InterchangeOptions { - load_attr?: string; - named_queries?: Object; - directives?: { - replace?: (el: HTMLElement, path: string, trigger: (...args: any[]) => any) => any; - }; -} - -interface JoyrideOptions { - expose?: boolean; - modal?: boolean; - tip_location?: string; - nub_position?: string; - scroll_speed?: number; - timer?: number; - start_timer_on_click?: boolean; - start_offset?: number; - next_button?: boolean; - tip_animation?: string; - pause_after?: number[]; - exposed?: HTMLElement[]; - tip_animation_fade_speed?: number; - cookie_monster?: boolean; - cookie_name?: string; - cookie_domain?: boolean; - cookie_expires?: number; - tip_container?: string; - abort_on_close?: boolean; - tip_location_patterns?: { - top?: string[]; - bottom?: string[]; - left?: string[]; - right?: string[]; - }; - post_ride_callback?: () => void; - post_step_callback?: () => void; - pre_step_callback?: () => void; - pre_ride_callback?: () => void; - post_expose_callback?: () => void; - template?: { - link?: string; - timer?: string; - tip?: string; - wrapper?: string; - button?: string; - modal?: string; - expose?: string; - expose_cover?: string; - }; - expose_add_class?: string; -} - -interface MagellanOptions { - active_class?: string; - threshold?: number; - destination_threshold?: number; - throttle_delay?: number; -} - -interface OffCanvasOptions {} - -interface OrbitOptions { - animation?: string; - timer_speed?: number; - pause_on_hover?: boolean; - resume_on_mouseout?: boolean; - next_on_click?: boolean; - animation_speed?: number; - stack_on_small?: boolean; - navigation_arrows?: boolean; - slide_number?: boolean; - slide_number_text?: string; - container_class?: string; - stack_on_small_class?: string; - next_class?: string; - prev_class?: string; - timer_container_class?: string; - timer_paused_class?: string; - timer_progress_class?: string; - slides_container_class?: string; - preloader_class?: string; - slide_selector?: string; - bullets_container_class?: string; - bullets_active_class?: string; - slide_number_class?: string; - caption_class?: string; - active_slide_class?: string; - orbit_transition_class?: string; - bullets?: boolean; - circular?: boolean; - timer?: boolean; - variable_height?: boolean; - swipe?: boolean; - before_slide_change?: () => void; - after_slide_change?: () => void; -} - -interface RevealOptions { - animation?: string; - animation_speed?: number; - close_on_background_click?: boolean; - close_on_esc?: boolean; - dismiss_modal_class?: string; - bg_class?: string; - open?: () => void; - opened?: () => void; - close?: () => void; - closed?: () => void; - bg?: JQuery; - css?: { - open?: Object; - close?: Object; - }; -} - -interface SliderOptions { - start?: number; - end?: number; - step?: number; - initial?: number; - display_selector?: string; - on_change?: () => void; -} - -interface TabOptions { - active_class?: string; - callback?: () => void; - deep_linking?: boolean; - scroll_to_content?: boolean; -} - -interface TooltipOptions { - additional_inheritable_classes?: string[]; - tooltip_class?: string; - append_to?: string; - touch_close_text?: string; - disable_for_touch?: boolean; - hover_delay?: number; - tip_template?: (selector: string, content: string) => string; -} - -interface TopbarOptions{ - index?: number; - sticky_class?: string; - custom_back_text?: boolean; - back_text?: string; - is_hover?: boolean; - mobile_show_parent_link?: boolean; - scrolltop?: boolean; - sticky_on?: string; -} - -interface FoundationOptions { - abide?: AbideOptions; - accordion?: AccordionOptions; - alert?: AlertOptions; - clearing?: ClearingOptions; - dropdown?: DropdownOptions; - interchange?: InterchangeOptions; - joyride?: JoyrideOptions; - magellan?: MagellanOptions; - offcanvas: OffCanvasOptions; - orbit?: OrbitOptions; - reveal?: RevealOptions; - tab?: TabOptions; - tooltip?: TooltipOptions; - topbar?: TopbarOptions; -} - -interface FoundationStatic { - name: string; - version: string; - media_queries: Object; - stylesheet: CSSStyleSheet; - global: { - namespace: string; - }; - init(scope: JQuery): JQuery; - init(scope: JQuery, libraries: FoundationOptions): JQuery; - init(scope: JQuery, libraries: string, method: FoundationOptions): JQuery; - init(scope: JQuery, libraries: string, method: string, options: Object): JQuery; - init_lib(lib: any, args: any): (...args: any[]) => any; - patch(lib: any): void; - inherit(scope: JQuery, methods: string): void; - set_namespace(): void; - libs: Object; - utils: { - S(selector: any, context: any): JQuery; - throttle(func: (...args: any[]) => any, delay: number): (...args: any[]) => any; - debounce(func: (...args: any[]) => any, delay: number, immediate: boolean): (...args: any[]) => any; - data_options(el: JQuery): Object; - register_media(media: string, media_class: string): void; - add_custom_rule(rule: string, media: string): void; - image_loaded(images: JQuery, callback: (...args: any[]) => any): void; - random_str(length?: number): string; - }; -} - -interface JQuery { - foundation(): JQuery; - foundation(libraries: FoundationOptions): JQuery; - foundation(libraries: string, method: FoundationOptions): JQuery; - foundation(libraries: string, method: string, options: Object): JQuery; -} - -declare var Foundation: FoundationStatic; +// Type definitions for Foundation 5.5.1 +// Project : http://foundation.zurb.com/ +// Definitions by : Boris Yankov +// Definitions : https://github.com/borisyankov/DefinitelyTyped + + +/// + +// http://foundation.zurb.com/docs/components/abide.html#optional-javascript-configuration +interface AbidePatterns { + alpha? : RegExp; + alpha_numeric? : RegExp; + integer? : RegExp; + number? : RegExp; + card? : RegExp; + cvv? : RegExp; + email? : RegExp; + url? : RegExp; + domain? : RegExp; + datetime? : RegExp; + date? : RegExp; + time? : RegExp; + dateISO? : RegExp; + month_day_year? : RegExp; + color? : RegExp; +} + +interface AbideOptions { + live_validate? : boolean; + validate_on_blur? : boolean; + focus_on_invalid? : boolean; + error_labels? : boolean; + timeout? : number; + patterns? : AbidePatterns; + validators? : Object; +} + +// http://foundation.zurb.com/docs/components/accordion.html#optional-javascript-configuration +interface AccordionOptions { + content_class? : string; + active_class? : string; + multi_expand? : boolean; + toggleable? : boolean; + callback? : () => any; +} + +// http://foundation.zurb.com/docs/components/alert_boxes.html +interface AlertOptions { + callback? : () => any; +} + +// http://foundation.zurb.com/docs/components/clearing.html#optional-javascript-configuration +interface ClearingOptions { + templates? : Object; + close_selectors? : string; + open_selectors? : string; + skip_selector? : string; + touch_label? : string; + init? : boolean; + locked? : boolean; +} + +// http://foundation.zurb.com/docs/components/dropdown.html#optional-javascript-configuration +interface DropdownOptions { + active_class? : string; + disabled_class? : string; + mega_class? : string; + align? : string; + is_hover? : boolean; + hover_timeout? : number; + opened? : () => any; + closed? : () => any; +} + +// http://foundation.zurb.com/docs/components/equalizer.html#optional-javascript-configuration +interface EqualizerOptions { + use_tallest? : boolean; + equalize_on_stack? : boolean; +} + +// http://foundation.zurb.com/docs/components/interchange.html#custom-named-queries +interface InterchangeOptions { + load_attr? : string; + named_queries? : Object; + directives? : Object; +} + +// http://foundation.zurb.com/docs/components/joyride.html#optional-javascript-configuration +interface JoyrideOptions { + expose? : boolean; + modal? : boolean; + keyboard? : boolean; + tip_location? : string; + nub_position? : string; + scroll_speed? : number; + scroll_animation? : string; + timer? : number; + start_timer_on_click? : boolean; + start_offset? : number; + next_button? : boolean; + prev_button? : boolean; + tip_animation? : string; + pause_after? : number[]; + exposed? : string[]; + tip_animation_fade_speed? : number; + cookie_monster? : boolean; + cookie_name? : string; + cookie_domain? : boolean; + cookie_expires? : number; + tip_container? : string; + tip_location_patterns? : { + top? : string[]; + bottom? : string[]; + left? : string[]; + right? : string[]; + }; + post_ride_callback? : () => void; + post_step_callback? : () => void; + pre_step_callback? : () => void; + pre_ride_callback? : () => void; + post_expose_callback? : () => void; + template? : { + link? : string; + timer? : string; + tip? : string; + wrapper? : string; + button? : string; + modal? : string; + expose? : string; + expose_cover? : string; + }; + expose_add_class? : string; +} + +// http://foundation.zurb.com/docs/components/magellan.html#js +interface MagellanOptions { + active_class? : string; + threshold? : number; + destination_threshold? : number; + throttle_delay? : number; + fixed_top? : number; + offset_by_height? : boolean; + duration? : number; + easing? : string; +} + +// http://foundation.zurb.com/docs/components/offcanvas.html#optional-javascript-configuration +interface OffCanvasOptions { + open_method? : string; + close_on_click? : boolean; +} + +// http://foundation.zurb.com/docs/components/orbit.html#advanced +interface OrbitOptions { + animation? : string; + timer_speed? : number; + pause_on_hover? : boolean; + resume_on_mouseout? : boolean; + next_on_click? : boolean; + animation_speed? : number; + stack_on_small? : boolean; + navigation_arrows? : boolean; + slide_number? : boolean; + slide_number_text? : string; + container_class? : string; + stack_on_small_class? : string; + next_class? : string; + prev_class? : string; + timer_container_class? : string; + timer_paused_class? : string; + timer_progress_class? : string; + slides_container_class? : string; + preloader_class? : string; + slide_selector? : string; + bullets_container_class? : string; + bullets_active_class? : string; + slide_number_class? : string; + caption_class? : string; + active_slide_class? : string; + orbit_transition_class? : string; + bullets? : boolean; + circular? : boolean; + timer? : boolean; + variable_height? : boolean; + swipe? : boolean; + before_slide_change? : () => any; + after_slide_change? : () => any; +} + +// http://foundation.zurb.com/docs/components/reveal.html +interface RevealCSSOptions { + opacity? : number; + visibility? : string; + display? : string; +} + +interface RevealOptions { + animation? : string; + animation_speed? : number; + close_on_background_click? : boolean; + dismiss_modal_class? : string; + multiple_opened? : boolean; + bg_class? : string; + root_element? : string; + on_ajax_error? : () => any; + open? : () => any; + opened? : () => any; + close? : () => any; + closed? : () => any; + bg? : JQuery; + css? : { + open? : RevealCSSOptions; + close? : RevealCSSOptions; + }; +} + +// http://foundation.zurb.com/docs/components/range_slider.html +interface SliderOptions { + start? : number; + end? : number; + step? : number; + precision? : number; + initial? : number; + vertical? : boolean; + trigger_input_change? : boolean; + on_change? : () => any; +} + +// http://foundation.zurb.com/docs/components/tabs.html +interface TabOptions { + active_class? : string; + callback? : () => any; + deep_linking? : boolean; + scroll_to_content? : boolean; + is_hover? : boolean; +} + +interface TooltipOptions { + additional_inheritable_classes? : string[]; + tooltip_class? : string; + append_to? : string; + touch_close_text? : string; + disable_for_touch? : boolean; + hover_delay? : number; + show_on? : string; + tip_template? : (selector : string, content : string) => string; +} + +interface TopbarOptions { + index? : number; + sticky_class? : string; + custom_back_text? : boolean; + back_text? : string; + is_hover? : boolean; + mobile_show_parent_link? : boolean; + scrolltop? : boolean; + sticky_on? : string; +} + +interface FoundationOptions { + abide? : AbideOptions; + accordion? : AccordionOptions; + alert? : AlertOptions; + clearing? : ClearingOptions; + dropdown? : DropdownOptions; + equalizer? : EqualizerOptions; + interchange? : InterchangeOptions; + joyride? : JoyrideOptions; + magellan? : MagellanOptions; + offcanvas? : OffCanvasOptions; + orbit? : OrbitOptions; + reveal? : RevealOptions; + slider? : SliderOptions; + tab? : TabOptions; + tooltip? : TooltipOptions; + topbar? : TopbarOptions; +} + +interface FoundationStatic { + name : string; + version : string; + media_queries : Object; + stylesheet : CSSStyleSheet; + global : { + namespace : string; + }; + init(scope : JQuery) : JQuery; + init(scope : JQuery, libraries : FoundationOptions) : JQuery; + init(scope : JQuery, libraries : string, method : FoundationOptions) : JQuery; + init(scope : JQuery, libraries : string, method : string, options : Object) : JQuery; + init_lib(lib : any, args : any) : (...args : any[]) => any; + patch(lib : any) : void; + inherit(scope : JQuery, methods : string) : void; + set_namespace() : void; + libs : any; + utils : { + S(selector : any, context : any) : JQuery; + throttle(func : (...args : any[]) => any, delay : number) : (...args : any[]) => any; + debounce(func : (...args : any[]) => any, delay : number, immediate : boolean) : (...args : any[]) => any; + data_options(el : JQuery) : Object; + register_media(media : string, media_class : string) : void; + add_custom_rule(rule : string, media : string) : void; + image_loaded(images : JQuery, callback : (...args : any[]) => any) : void; + random_str(length? : number) : string; + }; +} + +interface JQuery { + foundation() : JQuery; + foundation(libraries : FoundationOptions | string) : JQuery; + foundation(libraries : string, method : FoundationOptions | string) : JQuery; + foundation(libraries : string, method : string, options : Object) : JQuery; +} + +declare var Foundation : FoundationStatic; From 25cad4036620470b17be460cdf823319b345634a Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Sun, 8 Mar 2015 13:47:14 -0400 Subject: [PATCH 0007/2220] Fixed up header to meet spec requirements. --- foundation/foundation.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index a531a051e1..0f4ef3be1f 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -1,7 +1,7 @@ -// Type definitions for Foundation 5.5.1 -// Project : http://foundation.zurb.com/ -// Definitions by : Boris Yankov -// Definitions : https://github.com/borisyankov/DefinitelyTyped +// Type definitions for Foundation v5.5.1 +// Project: http://foundation.zurb.com/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 9e24a051107337c96c1d47b15b540d5e6b75610e Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Sun, 8 Mar 2015 13:54:16 -0400 Subject: [PATCH 0008/2220] Namespace the various Foundation option interfaces to prevent conflicts. --- foundation/foundation-tests.ts | 38 ++++++++--------- foundation/foundation.d.ts | 74 +++++++++++++++++----------------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index c95b54a5bb..062fcc04ba 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -24,7 +24,7 @@ function plugin_list() { } function abide_patterns() { - var patterns : AbidePatterns; + var patterns : FoundationAbidePatterns; patterns.alpha = /^[a-zA-Z]+$/; patterns.alpha_numeric = /^[a-zA-Z0-9]+$/; patterns.integer = /^[-+]?\d+$/; @@ -44,7 +44,7 @@ function abide_patterns() { } function abide_options() { - var opts : AbideOptions = {}; + var opts : FoundationAbideOptions = {}; opts.live_validate = false; opts.validate_on_blur = true; opts.focus_on_invalid = true; @@ -65,7 +65,7 @@ function abide_options() { } function accordion_options() { - var opts : AccordionOptions = {}; + var opts : FoundationAccordionOptions = {}; opts.content_class = "content"; opts.active_class = "class-name"; opts.multi_expand = false; @@ -75,13 +75,13 @@ function accordion_options() { } function alert_options() { - var opts : AlertOptions = {}; + var opts : FoundationAlertOptions = {}; opts.callback = empty_callback; return opts; } function clearing_options() { - var opts : ClearingOptions = {}; + var opts : FoundationClearingOptions = {}; opts.templates = { viewing : '
Some HTML
' }; @@ -95,7 +95,7 @@ function clearing_options() { } function dropdown_options() { - var opts : DropdownOptions = {}; + var opts : FoundationDropdownOptions = {}; opts.active_class = "class-name"; opts.disabled_class = "disabled-class"; opts.mega_class = "big"; @@ -108,14 +108,14 @@ function dropdown_options() { } function equalizer_options() { - var opts : EqualizerOptions = {}; + var opts : FoundationEqualizerOptions = {}; opts.use_tallest = true; opts.equalize_on_stack = false; return opts; } function interchange_options() { - var opts : InterchangeOptions = {}; + var opts : FoundationInterchangeOptions = {}; opts.load_attr = "interchange"; opts.named_queries = { my_custom_query: "only screen and (max-width: 200px)" @@ -127,7 +127,7 @@ function interchange_options() { } function joyride_options() { - var opts : JoyrideOptions = {}; + var opts : FoundationJoyrideOptions = {}; opts.expose = false; opts.modal = true; opts.keyboard = true; @@ -176,7 +176,7 @@ function joyride_options() { } function magellan_options() { - var opts : MagellanOptions = {}; + var opts : FoundationMagellanOptions = {}; opts.active_class = ".active-element"; opts.threshold = 20; opts.destination_threshold = 30; @@ -189,14 +189,14 @@ function magellan_options() { } function offcanvas_options() { - var opts : OffCanvasOptions = {}; + var opts : FoundationOffCanvasOptions = {}; opts.open_method = "overlap_single"; opts.close_on_click = true; return opts; } function orbit_options() { - var opts : OrbitOptions = {}; + var opts : FoundationOrbitOptions = {}; opts.animation = 'slide'; opts.timer_speed = 10000; opts.pause_on_hover = true; @@ -234,7 +234,7 @@ function orbit_options() { } function reveal_css_options() { - var opts : RevealCSSOptions = {}; + var opts : FoundationRevealCSSOptions = {}; opts.opacity = 0; opts.visibility = 'hidden'; opts.display = "inline-block"; @@ -242,7 +242,7 @@ function reveal_css_options() { } function reveal_options() { - var opts : RevealOptions = {}; + var opts : FoundationRevealOptions = {}; opts.animation = "linear"; opts.animation_speed = 500; opts.close_on_background_click = false; @@ -264,7 +264,7 @@ function reveal_options() { } function slider_options() { - var opts : SliderOptions; + var opts : FoundationSliderOptions; opts.start = -1000; opts.end = 1000; opts.step = 50; @@ -277,7 +277,7 @@ function slider_options() { } function tab_options() { - var opts : TabOptions = {}; + var opts : FoundationTabOptions = {}; opts.active_class = "class-name"; opts.callback = empty_callback; opts.deep_linking = false; @@ -287,7 +287,7 @@ function tab_options() { } function tooltip_options() { - var opts : TooltipOptions = {}; + var opts : FoundationTooltipOptions = {}; opts.additional_inheritable_classes = ["class1", "class2"]; opts.tooltip_class = "tooltip"; opts.append_to = "append-class"; @@ -304,7 +304,7 @@ function tooltip_options() { } function topbar_options() { - var opts : TopbarOptions = {}; + var opts : FoundationTopbarOptions = {}; opts.index = 1; opts.sticky_class = "top-bar"; opts.custom_back_text = true; @@ -316,7 +316,7 @@ function topbar_options() { return opts; } -function foundation_options() : FoundationOptions { +function foundation_options() { var opts : FoundationOptions = {}; opts.abide = abide_options(); opts.accordion = accordion_options(); diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index 0f4ef3be1f..ad3696f019 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -7,7 +7,7 @@ /// // http://foundation.zurb.com/docs/components/abide.html#optional-javascript-configuration -interface AbidePatterns { +interface FoundationAbidePatterns { alpha? : RegExp; alpha_numeric? : RegExp; integer? : RegExp; @@ -25,18 +25,18 @@ interface AbidePatterns { color? : RegExp; } -interface AbideOptions { +interface FoundationAbideOptions { live_validate? : boolean; validate_on_blur? : boolean; focus_on_invalid? : boolean; error_labels? : boolean; timeout? : number; - patterns? : AbidePatterns; + patterns? : FoundationAbidePatterns; validators? : Object; } // http://foundation.zurb.com/docs/components/accordion.html#optional-javascript-configuration -interface AccordionOptions { +interface FoundationAccordionOptions { content_class? : string; active_class? : string; multi_expand? : boolean; @@ -45,12 +45,12 @@ interface AccordionOptions { } // http://foundation.zurb.com/docs/components/alert_boxes.html -interface AlertOptions { +interface FoundationAlertOptions { callback? : () => any; } // http://foundation.zurb.com/docs/components/clearing.html#optional-javascript-configuration -interface ClearingOptions { +interface FoundationClearingOptions { templates? : Object; close_selectors? : string; open_selectors? : string; @@ -61,7 +61,7 @@ interface ClearingOptions { } // http://foundation.zurb.com/docs/components/dropdown.html#optional-javascript-configuration -interface DropdownOptions { +interface FoundationDropdownOptions { active_class? : string; disabled_class? : string; mega_class? : string; @@ -73,20 +73,20 @@ interface DropdownOptions { } // http://foundation.zurb.com/docs/components/equalizer.html#optional-javascript-configuration -interface EqualizerOptions { +interface FoundationEqualizerOptions { use_tallest? : boolean; equalize_on_stack? : boolean; } // http://foundation.zurb.com/docs/components/interchange.html#custom-named-queries -interface InterchangeOptions { +interface FoundationInterchangeOptions { load_attr? : string; named_queries? : Object; directives? : Object; } // http://foundation.zurb.com/docs/components/joyride.html#optional-javascript-configuration -interface JoyrideOptions { +interface FoundationJoyrideOptions { expose? : boolean; modal? : boolean; keyboard? : boolean; @@ -133,7 +133,7 @@ interface JoyrideOptions { } // http://foundation.zurb.com/docs/components/magellan.html#js -interface MagellanOptions { +interface FoundationMagellanOptions { active_class? : string; threshold? : number; destination_threshold? : number; @@ -145,13 +145,13 @@ interface MagellanOptions { } // http://foundation.zurb.com/docs/components/offcanvas.html#optional-javascript-configuration -interface OffCanvasOptions { +interface FoundationOffCanvasOptions { open_method? : string; close_on_click? : boolean; } // http://foundation.zurb.com/docs/components/orbit.html#advanced -interface OrbitOptions { +interface FoundationOrbitOptions { animation? : string; timer_speed? : number; pause_on_hover? : boolean; @@ -188,13 +188,13 @@ interface OrbitOptions { } // http://foundation.zurb.com/docs/components/reveal.html -interface RevealCSSOptions { +interface FoundationRevealCSSOptions { opacity? : number; visibility? : string; display? : string; } -interface RevealOptions { +interface FoundationRevealOptions { animation? : string; animation_speed? : number; close_on_background_click? : boolean; @@ -209,13 +209,13 @@ interface RevealOptions { closed? : () => any; bg? : JQuery; css? : { - open? : RevealCSSOptions; - close? : RevealCSSOptions; + open? : FoundationRevealCSSOptions; + close? : FoundationRevealCSSOptions; }; } // http://foundation.zurb.com/docs/components/range_slider.html -interface SliderOptions { +interface FoundationSliderOptions { start? : number; end? : number; step? : number; @@ -227,7 +227,7 @@ interface SliderOptions { } // http://foundation.zurb.com/docs/components/tabs.html -interface TabOptions { +interface FoundationTabOptions { active_class? : string; callback? : () => any; deep_linking? : boolean; @@ -235,7 +235,7 @@ interface TabOptions { is_hover? : boolean; } -interface TooltipOptions { +interface FoundationTooltipOptions { additional_inheritable_classes? : string[]; tooltip_class? : string; append_to? : string; @@ -246,7 +246,7 @@ interface TooltipOptions { tip_template? : (selector : string, content : string) => string; } -interface TopbarOptions { +interface FoundationTopbarOptions { index? : number; sticky_class? : string; custom_back_text? : boolean; @@ -258,22 +258,22 @@ interface TopbarOptions { } interface FoundationOptions { - abide? : AbideOptions; - accordion? : AccordionOptions; - alert? : AlertOptions; - clearing? : ClearingOptions; - dropdown? : DropdownOptions; - equalizer? : EqualizerOptions; - interchange? : InterchangeOptions; - joyride? : JoyrideOptions; - magellan? : MagellanOptions; - offcanvas? : OffCanvasOptions; - orbit? : OrbitOptions; - reveal? : RevealOptions; - slider? : SliderOptions; - tab? : TabOptions; - tooltip? : TooltipOptions; - topbar? : TopbarOptions; + abide? : FoundationAbideOptions; + accordion? : FoundationAccordionOptions; + alert? : FoundationAlertOptions; + clearing? : FoundationClearingOptions; + dropdown? : FoundationDropdownOptions; + equalizer? : FoundationEqualizerOptions; + interchange? : FoundationInterchangeOptions; + joyride? : FoundationJoyrideOptions; + magellan? : FoundationMagellanOptions; + offcanvas? : FoundationOffCanvasOptions; + orbit? : FoundationOrbitOptions; + reveal? : FoundationRevealOptions; + slider? : FoundationSliderOptions; + tab? : FoundationTabOptions; + tooltip? : FoundationTooltipOptions; + topbar? : FoundationTopbarOptions; } interface FoundationStatic { From 7dd9a59ab0c37c19178735dfa02b2ad69dde7d82 Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Sun, 15 Mar 2015 14:16:25 -0400 Subject: [PATCH 0009/2220] Don't pollute the global namespace with interfaces used for Foundation. --- foundation/foundation-tests.ts | 38 +-- foundation/foundation.d.ts | 564 +++++++++++++++++---------------- 2 files changed, 302 insertions(+), 300 deletions(-) diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index 062fcc04ba..9706fbf97c 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -24,7 +24,7 @@ function plugin_list() { } function abide_patterns() { - var patterns : FoundationAbidePatterns; + var patterns : Foundation.AbidePatterns = {}; patterns.alpha = /^[a-zA-Z]+$/; patterns.alpha_numeric = /^[a-zA-Z0-9]+$/; patterns.integer = /^[-+]?\d+$/; @@ -44,7 +44,7 @@ function abide_patterns() { } function abide_options() { - var opts : FoundationAbideOptions = {}; + var opts : Foundation.AbideOptions = {}; opts.live_validate = false; opts.validate_on_blur = true; opts.focus_on_invalid = true; @@ -65,7 +65,7 @@ function abide_options() { } function accordion_options() { - var opts : FoundationAccordionOptions = {}; + var opts : Foundation.AccordionOptions = {}; opts.content_class = "content"; opts.active_class = "class-name"; opts.multi_expand = false; @@ -75,13 +75,13 @@ function accordion_options() { } function alert_options() { - var opts : FoundationAlertOptions = {}; + var opts : Foundation.AlertOptions = {}; opts.callback = empty_callback; return opts; } function clearing_options() { - var opts : FoundationClearingOptions = {}; + var opts : Foundation.ClearingOptions = {}; opts.templates = { viewing : '
Some HTML
' }; @@ -95,7 +95,7 @@ function clearing_options() { } function dropdown_options() { - var opts : FoundationDropdownOptions = {}; + var opts : Foundation.DropdownOptions = {}; opts.active_class = "class-name"; opts.disabled_class = "disabled-class"; opts.mega_class = "big"; @@ -108,14 +108,14 @@ function dropdown_options() { } function equalizer_options() { - var opts : FoundationEqualizerOptions = {}; + var opts : Foundation.EqualizerOptions = {}; opts.use_tallest = true; opts.equalize_on_stack = false; return opts; } function interchange_options() { - var opts : FoundationInterchangeOptions = {}; + var opts : Foundation.InterchangeOptions = {}; opts.load_attr = "interchange"; opts.named_queries = { my_custom_query: "only screen and (max-width: 200px)" @@ -127,7 +127,7 @@ function interchange_options() { } function joyride_options() { - var opts : FoundationJoyrideOptions = {}; + var opts : Foundation.JoyrideOptions = {}; opts.expose = false; opts.modal = true; opts.keyboard = true; @@ -176,7 +176,7 @@ function joyride_options() { } function magellan_options() { - var opts : FoundationMagellanOptions = {}; + var opts : Foundation.MagellanOptions = {}; opts.active_class = ".active-element"; opts.threshold = 20; opts.destination_threshold = 30; @@ -189,14 +189,14 @@ function magellan_options() { } function offcanvas_options() { - var opts : FoundationOffCanvasOptions = {}; + var opts : Foundation.OffCanvasOptions = {}; opts.open_method = "overlap_single"; opts.close_on_click = true; return opts; } function orbit_options() { - var opts : FoundationOrbitOptions = {}; + var opts : Foundation.OrbitOptions = {}; opts.animation = 'slide'; opts.timer_speed = 10000; opts.pause_on_hover = true; @@ -234,7 +234,7 @@ function orbit_options() { } function reveal_css_options() { - var opts : FoundationRevealCSSOptions = {}; + var opts : Foundation.RevealCSSOptions = {}; opts.opacity = 0; opts.visibility = 'hidden'; opts.display = "inline-block"; @@ -242,7 +242,7 @@ function reveal_css_options() { } function reveal_options() { - var opts : FoundationRevealOptions = {}; + var opts : Foundation.RevealOptions = {}; opts.animation = "linear"; opts.animation_speed = 500; opts.close_on_background_click = false; @@ -264,7 +264,7 @@ function reveal_options() { } function slider_options() { - var opts : FoundationSliderOptions; + var opts : Foundation.SliderOptions = {}; opts.start = -1000; opts.end = 1000; opts.step = 50; @@ -277,7 +277,7 @@ function slider_options() { } function tab_options() { - var opts : FoundationTabOptions = {}; + var opts : Foundation.TabOptions = {}; opts.active_class = "class-name"; opts.callback = empty_callback; opts.deep_linking = false; @@ -287,7 +287,7 @@ function tab_options() { } function tooltip_options() { - var opts : FoundationTooltipOptions = {}; + var opts : Foundation.TooltipOptions = {}; opts.additional_inheritable_classes = ["class1", "class2"]; opts.tooltip_class = "tooltip"; opts.append_to = "append-class"; @@ -304,7 +304,7 @@ function tooltip_options() { } function topbar_options() { - var opts : FoundationTopbarOptions = {}; + var opts : Foundation.TopbarOptions = {}; opts.index = 1; opts.sticky_class = "top-bar"; opts.custom_back_text = true; @@ -317,7 +317,7 @@ function topbar_options() { } function foundation_options() { - var opts : FoundationOptions = {}; + var opts : Foundation.Options = {}; opts.abide = abide_options(); opts.accordion = accordion_options(); opts.alert = alert_options(); diff --git a/foundation/foundation.d.ts b/foundation/foundation.d.ts index ad3696f019..c2dc4fc244 100644 --- a/foundation/foundation.d.ts +++ b/foundation/foundation.d.ts @@ -6,310 +6,312 @@ /// -// http://foundation.zurb.com/docs/components/abide.html#optional-javascript-configuration -interface FoundationAbidePatterns { - alpha? : RegExp; - alpha_numeric? : RegExp; - integer? : RegExp; - number? : RegExp; - card? : RegExp; - cvv? : RegExp; - email? : RegExp; - url? : RegExp; - domain? : RegExp; - datetime? : RegExp; - date? : RegExp; - time? : RegExp; - dateISO? : RegExp; - month_day_year? : RegExp; - color? : RegExp; -} +declare module Foundation { + // http://foundation.zurb.com/docs/components/abide.html#optional-javascript-configuration + interface AbidePatterns { + alpha? : RegExp; + alpha_numeric? : RegExp; + integer? : RegExp; + number? : RegExp; + card? : RegExp; + cvv? : RegExp; + email? : RegExp; + url? : RegExp; + domain? : RegExp; + datetime? : RegExp; + date? : RegExp; + time? : RegExp; + dateISO? : RegExp; + month_day_year? : RegExp; + color? : RegExp; + } -interface FoundationAbideOptions { - live_validate? : boolean; - validate_on_blur? : boolean; - focus_on_invalid? : boolean; - error_labels? : boolean; - timeout? : number; - patterns? : FoundationAbidePatterns; - validators? : Object; -} + interface AbideOptions { + live_validate? : boolean; + validate_on_blur? : boolean; + focus_on_invalid? : boolean; + error_labels? : boolean; + timeout? : number; + patterns? : AbidePatterns; + validators? : Object; + } -// http://foundation.zurb.com/docs/components/accordion.html#optional-javascript-configuration -interface FoundationAccordionOptions { - content_class? : string; - active_class? : string; - multi_expand? : boolean; - toggleable? : boolean; - callback? : () => any; -} + // http://foundation.zurb.com/docs/components/accordion.html#optional-javascript-configuration + interface AccordionOptions { + content_class? : string; + active_class? : string; + multi_expand? : boolean; + toggleable? : boolean; + callback? : () => any; + } -// http://foundation.zurb.com/docs/components/alert_boxes.html -interface FoundationAlertOptions { - callback? : () => any; -} + // http://foundation.zurb.com/docs/components/alert_boxes.html + interface AlertOptions { + callback? : () => any; + } -// http://foundation.zurb.com/docs/components/clearing.html#optional-javascript-configuration -interface FoundationClearingOptions { - templates? : Object; - close_selectors? : string; - open_selectors? : string; - skip_selector? : string; - touch_label? : string; - init? : boolean; - locked? : boolean; -} + // http://foundation.zurb.com/docs/components/clearing.html#optional-javascript-configuration + interface ClearingOptions { + templates? : Object; + close_selectors? : string; + open_selectors? : string; + skip_selector? : string; + touch_label? : string; + init? : boolean; + locked? : boolean; + } -// http://foundation.zurb.com/docs/components/dropdown.html#optional-javascript-configuration -interface FoundationDropdownOptions { - active_class? : string; - disabled_class? : string; - mega_class? : string; - align? : string; - is_hover? : boolean; - hover_timeout? : number; - opened? : () => any; - closed? : () => any; -} + // http://foundation.zurb.com/docs/components/dropdown.html#optional-javascript-configuration + interface DropdownOptions { + active_class? : string; + disabled_class? : string; + mega_class? : string; + align? : string; + is_hover? : boolean; + hover_timeout? : number; + opened? : () => any; + closed? : () => any; + } -// http://foundation.zurb.com/docs/components/equalizer.html#optional-javascript-configuration -interface FoundationEqualizerOptions { - use_tallest? : boolean; - equalize_on_stack? : boolean; -} + // http://foundation.zurb.com/docs/components/equalizer.html#optional-javascript-configuration + interface EqualizerOptions { + use_tallest? : boolean; + equalize_on_stack? : boolean; + } -// http://foundation.zurb.com/docs/components/interchange.html#custom-named-queries -interface FoundationInterchangeOptions { - load_attr? : string; - named_queries? : Object; - directives? : Object; -} + // http://foundation.zurb.com/docs/components/interchange.html#custom-named-queries + interface InterchangeOptions { + load_attr? : string; + named_queries? : Object; + directives? : Object; + } -// http://foundation.zurb.com/docs/components/joyride.html#optional-javascript-configuration -interface FoundationJoyrideOptions { - expose? : boolean; - modal? : boolean; - keyboard? : boolean; - tip_location? : string; - nub_position? : string; - scroll_speed? : number; - scroll_animation? : string; - timer? : number; - start_timer_on_click? : boolean; - start_offset? : number; - next_button? : boolean; - prev_button? : boolean; - tip_animation? : string; - pause_after? : number[]; - exposed? : string[]; - tip_animation_fade_speed? : number; - cookie_monster? : boolean; - cookie_name? : string; - cookie_domain? : boolean; - cookie_expires? : number; - tip_container? : string; - tip_location_patterns? : { - top? : string[]; - bottom? : string[]; - left? : string[]; - right? : string[]; - }; - post_ride_callback? : () => void; - post_step_callback? : () => void; - pre_step_callback? : () => void; - pre_ride_callback? : () => void; - post_expose_callback? : () => void; - template? : { - link? : string; - timer? : string; - tip? : string; - wrapper? : string; - button? : string; - modal? : string; - expose? : string; - expose_cover? : string; - }; - expose_add_class? : string; -} + // http://foundation.zurb.com/docs/components/joyride.html#optional-javascript-configuration + interface JoyrideOptions { + expose? : boolean; + modal? : boolean; + keyboard? : boolean; + tip_location? : string; + nub_position? : string; + scroll_speed? : number; + scroll_animation? : string; + timer? : number; + start_timer_on_click? : boolean; + start_offset? : number; + next_button? : boolean; + prev_button? : boolean; + tip_animation? : string; + pause_after? : number[]; + exposed? : string[]; + tip_animation_fade_speed? : number; + cookie_monster? : boolean; + cookie_name? : string; + cookie_domain? : boolean; + cookie_expires? : number; + tip_container? : string; + tip_location_patterns? : { + top? : string[]; + bottom? : string[]; + left? : string[]; + right? : string[]; + }; + post_ride_callback? : () => void; + post_step_callback? : () => void; + pre_step_callback? : () => void; + pre_ride_callback? : () => void; + post_expose_callback? : () => void; + template? : { + link? : string; + timer? : string; + tip? : string; + wrapper? : string; + button? : string; + modal? : string; + expose? : string; + expose_cover? : string; + }; + expose_add_class? : string; + } -// http://foundation.zurb.com/docs/components/magellan.html#js -interface FoundationMagellanOptions { - active_class? : string; - threshold? : number; - destination_threshold? : number; - throttle_delay? : number; - fixed_top? : number; - offset_by_height? : boolean; - duration? : number; - easing? : string; -} + // http://foundation.zurb.com/docs/components/magellan.html#js + interface MagellanOptions { + active_class? : string; + threshold? : number; + destination_threshold? : number; + throttle_delay? : number; + fixed_top? : number; + offset_by_height? : boolean; + duration? : number; + easing? : string; + } -// http://foundation.zurb.com/docs/components/offcanvas.html#optional-javascript-configuration -interface FoundationOffCanvasOptions { - open_method? : string; - close_on_click? : boolean; -} + // http://foundation.zurb.com/docs/components/offcanvas.html#optional-javascript-configuration + interface OffCanvasOptions { + open_method? : string; + close_on_click? : boolean; + } -// http://foundation.zurb.com/docs/components/orbit.html#advanced -interface FoundationOrbitOptions { - animation? : string; - timer_speed? : number; - pause_on_hover? : boolean; - resume_on_mouseout? : boolean; - next_on_click? : boolean; - animation_speed? : number; - stack_on_small? : boolean; - navigation_arrows? : boolean; - slide_number? : boolean; - slide_number_text? : string; - container_class? : string; - stack_on_small_class? : string; - next_class? : string; - prev_class? : string; - timer_container_class? : string; - timer_paused_class? : string; - timer_progress_class? : string; - slides_container_class? : string; - preloader_class? : string; - slide_selector? : string; - bullets_container_class? : string; - bullets_active_class? : string; - slide_number_class? : string; - caption_class? : string; - active_slide_class? : string; - orbit_transition_class? : string; - bullets? : boolean; - circular? : boolean; - timer? : boolean; - variable_height? : boolean; - swipe? : boolean; - before_slide_change? : () => any; - after_slide_change? : () => any; -} + // http://foundation.zurb.com/docs/components/orbit.html#advanced + interface OrbitOptions { + animation? : string; + timer_speed? : number; + pause_on_hover? : boolean; + resume_on_mouseout? : boolean; + next_on_click? : boolean; + animation_speed? : number; + stack_on_small? : boolean; + navigation_arrows? : boolean; + slide_number? : boolean; + slide_number_text? : string; + container_class? : string; + stack_on_small_class? : string; + next_class? : string; + prev_class? : string; + timer_container_class? : string; + timer_paused_class? : string; + timer_progress_class? : string; + slides_container_class? : string; + preloader_class? : string; + slide_selector? : string; + bullets_container_class? : string; + bullets_active_class? : string; + slide_number_class? : string; + caption_class? : string; + active_slide_class? : string; + orbit_transition_class? : string; + bullets? : boolean; + circular? : boolean; + timer? : boolean; + variable_height? : boolean; + swipe? : boolean; + before_slide_change? : () => any; + after_slide_change? : () => any; + } -// http://foundation.zurb.com/docs/components/reveal.html -interface FoundationRevealCSSOptions { - opacity? : number; - visibility? : string; - display? : string; -} + // http://foundation.zurb.com/docs/components/reveal.html + interface RevealCSSOptions { + opacity? : number; + visibility? : string; + display? : string; + } -interface FoundationRevealOptions { - animation? : string; - animation_speed? : number; - close_on_background_click? : boolean; - dismiss_modal_class? : string; - multiple_opened? : boolean; - bg_class? : string; - root_element? : string; - on_ajax_error? : () => any; - open? : () => any; - opened? : () => any; - close? : () => any; - closed? : () => any; - bg? : JQuery; - css? : { - open? : FoundationRevealCSSOptions; - close? : FoundationRevealCSSOptions; - }; -} + interface RevealOptions { + animation? : string; + animation_speed? : number; + close_on_background_click? : boolean; + dismiss_modal_class? : string; + multiple_opened? : boolean; + bg_class? : string; + root_element? : string; + on_ajax_error? : () => any; + open? : () => any; + opened? : () => any; + close? : () => any; + closed? : () => any; + bg? : JQuery; + css? : { + open? : RevealCSSOptions; + close? : RevealCSSOptions; + }; + } -// http://foundation.zurb.com/docs/components/range_slider.html -interface FoundationSliderOptions { - start? : number; - end? : number; - step? : number; - precision? : number; - initial? : number; - vertical? : boolean; - trigger_input_change? : boolean; - on_change? : () => any; -} + // http://foundation.zurb.com/docs/components/range_slider.html + interface SliderOptions { + start? : number; + end? : number; + step? : number; + precision? : number; + initial? : number; + vertical? : boolean; + trigger_input_change? : boolean; + on_change? : () => any; + } -// http://foundation.zurb.com/docs/components/tabs.html -interface FoundationTabOptions { - active_class? : string; - callback? : () => any; - deep_linking? : boolean; - scroll_to_content? : boolean; - is_hover? : boolean; -} + // http://foundation.zurb.com/docs/components/tabs.html + interface TabOptions { + active_class? : string; + callback? : () => any; + deep_linking? : boolean; + scroll_to_content? : boolean; + is_hover? : boolean; + } -interface FoundationTooltipOptions { - additional_inheritable_classes? : string[]; - tooltip_class? : string; - append_to? : string; - touch_close_text? : string; - disable_for_touch? : boolean; - hover_delay? : number; - show_on? : string; - tip_template? : (selector : string, content : string) => string; -} + interface TooltipOptions { + additional_inheritable_classes? : string[]; + tooltip_class? : string; + append_to? : string; + touch_close_text? : string; + disable_for_touch? : boolean; + hover_delay? : number; + show_on? : string; + tip_template? : (selector : string, content : string) => string; + } -interface FoundationTopbarOptions { - index? : number; - sticky_class? : string; - custom_back_text? : boolean; - back_text? : string; - is_hover? : boolean; - mobile_show_parent_link? : boolean; - scrolltop? : boolean; - sticky_on? : string; -} + interface TopbarOptions { + index? : number; + sticky_class? : string; + custom_back_text? : boolean; + back_text? : string; + is_hover? : boolean; + mobile_show_parent_link? : boolean; + scrolltop? : boolean; + sticky_on? : string; + } -interface FoundationOptions { - abide? : FoundationAbideOptions; - accordion? : FoundationAccordionOptions; - alert? : FoundationAlertOptions; - clearing? : FoundationClearingOptions; - dropdown? : FoundationDropdownOptions; - equalizer? : FoundationEqualizerOptions; - interchange? : FoundationInterchangeOptions; - joyride? : FoundationJoyrideOptions; - magellan? : FoundationMagellanOptions; - offcanvas? : FoundationOffCanvasOptions; - orbit? : FoundationOrbitOptions; - reveal? : FoundationRevealOptions; - slider? : FoundationSliderOptions; - tab? : FoundationTabOptions; - tooltip? : FoundationTooltipOptions; - topbar? : FoundationTopbarOptions; -} + interface Options { + abide? : AbideOptions; + accordion? : AccordionOptions; + alert? : AlertOptions; + clearing? : ClearingOptions; + dropdown? : DropdownOptions; + equalizer? : EqualizerOptions; + interchange? : InterchangeOptions; + joyride? : JoyrideOptions; + magellan? : MagellanOptions; + offcanvas? : OffCanvasOptions; + orbit? : OrbitOptions; + reveal? : RevealOptions; + slider? : SliderOptions; + tab? : TabOptions; + tooltip? : TooltipOptions; + topbar? : TopbarOptions; + } -interface FoundationStatic { - name : string; - version : string; - media_queries : Object; - stylesheet : CSSStyleSheet; - global : { - namespace : string; - }; - init(scope : JQuery) : JQuery; - init(scope : JQuery, libraries : FoundationOptions) : JQuery; - init(scope : JQuery, libraries : string, method : FoundationOptions) : JQuery; - init(scope : JQuery, libraries : string, method : string, options : Object) : JQuery; - init_lib(lib : any, args : any) : (...args : any[]) => any; - patch(lib : any) : void; - inherit(scope : JQuery, methods : string) : void; - set_namespace() : void; - libs : any; - utils : { - S(selector : any, context : any) : JQuery; - throttle(func : (...args : any[]) => any, delay : number) : (...args : any[]) => any; - debounce(func : (...args : any[]) => any, delay : number, immediate : boolean) : (...args : any[]) => any; - data_options(el : JQuery) : Object; - register_media(media : string, media_class : string) : void; - add_custom_rule(rule : string, media : string) : void; - image_loaded(images : JQuery, callback : (...args : any[]) => any) : void; - random_str(length? : number) : string; - }; + interface FoundationStatic { + name : string; + version : string; + media_queries : Object; + stylesheet : CSSStyleSheet; + global : { + namespace : string; + }; + init(scope : JQuery) : JQuery; + init(scope : JQuery, libraries : Options) : JQuery; + init(scope : JQuery, libraries : string, method : Options) : JQuery; + init(scope : JQuery, libraries : string, method : string, options : Object) : JQuery; + init_lib(lib : any, args : any) : (...args : any[]) => any; + patch(lib : any) : void; + inherit(scope : JQuery, methods : string) : void; + set_namespace() : void; + libs : any; + utils : { + S(selector : any, context : any) : JQuery; + throttle(func : (...args : any[]) => any, delay : number) : (...args : any[]) => any; + debounce(func : (...args : any[]) => any, delay : number, immediate : boolean) : (...args : any[]) => any; + data_options(el : JQuery) : Object; + register_media(media : string, media_class : string) : void; + add_custom_rule(rule : string, media : string) : void; + image_loaded(images : JQuery, callback : (...args : any[]) => any) : void; + random_str(length? : number) : string; + }; + } } interface JQuery { foundation() : JQuery; - foundation(libraries : FoundationOptions | string) : JQuery; - foundation(libraries : string, method : FoundationOptions | string) : JQuery; + foundation(libraries : Foundation.Options | string) : JQuery; + foundation(libraries : string, method : Foundation.Options | string) : JQuery; foundation(libraries : string, method : string, options : Object) : JQuery; } -declare var Foundation : FoundationStatic; +declare var Foundation : Foundation.FoundationStatic; From d2ed7b747941ff02d923a97119cd24caac4516eb Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 14 Apr 2015 08:51:08 +0900 Subject: [PATCH 0010/2220] bump tsc version 1.4.1 to 1.5.0-alpha --- npm-shrinkwrap.json | 172 ++++++++++++++++++++++++++++++-------------- package.json | 2 +- 2 files changed, 118 insertions(+), 56 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 738ac2834f..04fa1a9570 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -8,39 +8,39 @@ "resolved": "https://registry.npmjs.org/definition-tester/-/definition-tester-0.2.0.tgz", "dependencies": { "bluebird": { - "version": "2.7.1", - "from": "bluebird@^2.5.3", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.7.1.tgz" + "version": "2.9.24", + "from": "bluebird@>=2.5.3 <3.0.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.24.tgz" }, "definition-header": { "version": "0.1.0", - "from": "definition-header@^0.1.0", + "from": "definition-header@>=0.1.0 <0.2.0", "resolved": "https://registry.npmjs.org/definition-header/-/definition-header-0.1.0.tgz", "dependencies": { "joi": { "version": "4.9.0", - "from": "joi@^4.0.0", + "from": "joi@>=4.0.0 <5.0.0", "resolved": "https://registry.npmjs.org/joi/-/joi-4.9.0.tgz", "dependencies": { "hoek": { - "version": "2.11.0", - "from": "hoek@^2.2.x", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.11.0.tgz" + "version": "2.12.0", + "from": "hoek@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.12.0.tgz" }, "topo": { "version": "1.0.2", - "from": "topo@1.x.x", + "from": "topo@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/topo/-/topo-1.0.2.tgz" }, "isemail": { "version": "1.1.1", - "from": "isemail@1.x.x", + "from": "isemail@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/isemail/-/isemail-1.1.1.tgz" }, "moment": { - "version": "2.9.0", - "from": "moment@2.x.x", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.9.0.tgz" + "version": "2.10.2", + "from": "moment@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.10.2.tgz" } } }, @@ -50,76 +50,138 @@ "resolved": "https://registry.npmjs.org/joi-assert/-/joi-assert-0.0.3.tgz", "dependencies": { "assertion-error": { - "version": "1.0.0", - "from": "assertion-error@^1.0.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.0.tgz" + "version": "1.0.1", + "from": "assertion-error@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.1.tgz" } } }, "parsimmon": { "version": "0.5.1", - "from": "parsimmon@^0.5.0", + "from": "parsimmon@>=0.5.0 <0.6.0", "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-0.5.1.tgz", "dependencies": { "pjs": { "version": "5.1.1", - "from": "pjs@5.x", + "from": "pjs@>=5.0.0 <6.0.0", "resolved": "https://registry.npmjs.org/pjs/-/pjs-5.1.1.tgz" } } }, "xregexp": { "version": "2.0.0", - "from": "xregexp@~2.0.0", + "from": "xregexp@>=2.0.0 <2.1.0", "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz" } } }, "findup-sync": { "version": "0.2.1", - "from": "findup-sync@~0.2.1", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.2.1.tgz" + "from": "findup-sync@>=0.2.1 <0.3.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.2.1.tgz", + "dependencies": { + "glob": { + "version": "4.3.5", + "from": "glob@>=4.3.0 <4.4.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", + "dependencies": { + "inflight": { + "version": "1.0.4", + "from": "inflight@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", + "dependencies": { + "wrappy": { + "version": "1.0.1", + "from": "wrappy@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + } + } + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "minimatch": { + "version": "2.0.4", + "from": "minimatch@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.4.tgz", + "dependencies": { + "brace-expansion": { + "version": "1.1.0", + "from": "brace-expansion@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", + "dependencies": { + "balanced-match": { + "version": "0.2.0", + "from": "balanced-match@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" + }, + "concat-map": { + "version": "0.0.1", + "from": "concat-map@0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + } + } + } + } + }, + "once": { + "version": "1.3.1", + "from": "once@>=1.3.0 <2.0.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz", + "dependencies": { + "wrappy": { + "version": "1.0.1", + "from": "wrappy@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" + } + } + } + } + } + } }, "git-wrapper": { "version": "0.1.1", - "from": "git-wrapper@~0.1.1", + "from": "git-wrapper@>=0.1.1 <0.2.0", "resolved": "https://registry.npmjs.org/git-wrapper/-/git-wrapper-0.1.1.tgz" }, "glob": { - "version": "4.3.5", - "from": "glob@^4.3.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", + "version": "4.5.3", + "from": "glob@>=4.3.2 <5.0.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", "dependencies": { "inflight": { "version": "1.0.4", - "from": "inflight@^1.0.4", + "from": "inflight@>=1.0.4 <2.0.0", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", "dependencies": { "wrappy": { "version": "1.0.1", - "from": "wrappy@1", + "from": "wrappy@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" } } }, "inherits": { "version": "2.0.1", - "from": "inherits@2", + "from": "inherits@>=2.0.0 <3.0.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "minimatch": { - "version": "2.0.1", - "from": "minimatch@^2.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz", + "version": "2.0.4", + "from": "minimatch@>=2.0.1 <3.0.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.4.tgz", "dependencies": { "brace-expansion": { "version": "1.1.0", - "from": "brace-expansion@^1.0.0", + "from": "brace-expansion@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", "dependencies": { "balanced-match": { "version": "0.2.0", - "from": "balanced-match@^0.2.0", + "from": "balanced-match@>=0.2.0 <0.3.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" }, "concat-map": { @@ -133,12 +195,12 @@ }, "once": { "version": "1.3.1", - "from": "once@^1.3.0", + "from": "once@>=1.3.0 <2.0.0", "resolved": "https://registry.npmjs.org/once/-/once-1.3.1.tgz", "dependencies": { "wrappy": { "version": "1.0.1", - "from": "wrappy@1", + "from": "wrappy@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz" } } @@ -147,17 +209,17 @@ }, "lazy.js": { "version": "0.4.0", - "from": "lazy.js@~0.4.0", + "from": "lazy.js@>=0.4.0 <0.5.0", "resolved": "https://registry.npmjs.org/lazy.js/-/lazy.js-0.4.0.tgz" }, "manticore": { "version": "0.2.4", - "from": "manticore@^0.2.4", + "from": "manticore@>=0.2.4 <0.3.0", "resolved": "https://registry.npmjs.org/manticore/-/manticore-0.2.4.tgz", "dependencies": { "JSONStream": { "version": "0.8.4", - "from": "JSONStream@^0.8.4", + "from": "JSONStream@>=0.8.4 <0.9.0", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-0.8.4.tgz", "dependencies": { "jsonparse": { @@ -166,30 +228,30 @@ "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-0.0.5.tgz" }, "through": { - "version": "2.3.6", - "from": "through@>=2.2.7 <3", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.6.tgz" + "version": "2.3.7", + "from": "through@>=2.2.7 <3.0.0", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.7.tgz" } } }, "bluebird": { "version": "1.2.4", - "from": "bluebird@^1.2.4", + "from": "bluebird@>=1.2.4 <2.0.0", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-1.2.4.tgz" }, "through2": { "version": "0.5.1", - "from": "through2@^0.5.1", + "from": "through2@>=0.5.1 <0.6.0", "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", "dependencies": { "readable-stream": { "version": "1.0.33", - "from": "readable-stream@~1.0.17", + "from": "readable-stream@>=1.0.17 <1.1.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.33.tgz", "dependencies": { "core-util-is": { "version": "1.0.1", - "from": "core-util-is@~1.0.0", + "from": "core-util-is@>=1.0.0 <1.1.0", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" }, "isarray": { @@ -199,43 +261,43 @@ }, "string_decoder": { "version": "0.10.31", - "from": "string_decoder@~0.10.x", + "from": "string_decoder@>=0.10.0 <0.11.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, "inherits": { "version": "2.0.1", - "from": "inherits@~2.0.1", + "from": "inherits@>=2.0.1 <2.1.0", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" } } }, "xtend": { "version": "3.0.0", - "from": "xtend@~3.0.0", + "from": "xtend@>=3.0.0 <3.1.0", "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz" } } }, "type-detect": { "version": "0.1.2", - "from": "type-detect@^0.1.2", + "from": "type-detect@>=0.1.2 <0.2.0", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.2.tgz" } } }, "optimist": { "version": "0.6.1", - "from": "optimist@~0.6.1", + "from": "optimist@>=0.6.1 <0.7.0", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "dependencies": { "wordwrap": { "version": "0.0.2", - "from": "wordwrap@~0.0.2", + "from": "wordwrap@>=0.0.2 <0.1.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz" }, "minimist": { "version": "0.0.10", - "from": "minimist@~0.0.1", + "from": "minimist@>=0.0.1 <0.1.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz" } } @@ -243,9 +305,9 @@ } }, "typescript": { - "version": "1.4.1", - "from": "typescript@1.4.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.4.1.tgz" + "version": "1.5.0-alpha", + "from": "typescript@1.5.0-alpha", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.5.0-alpha.tgz" } } } diff --git a/package.json b/package.json index 10d5c872a8..2630763e69 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,6 @@ }, "devDependencies": { "definition-tester": "0.2.0", - "typescript": "1.4.1" + "typescript": "1.5.0-alpha" } } From 523dc9d4831c6ce242127e4a7c1380ecc906a659 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 15 Apr 2015 23:23:21 +0900 Subject: [PATCH 0011/2220] fix react/react-tests.ts and react/react-addons-tests.ts compile error --- react/react-addons-tests.ts | 2 +- react/react-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/react/react-addons-tests.ts b/react/react-addons-tests.ts index 72d6db4865..f2ebdef37c 100644 --- a/react/react-addons-tests.ts +++ b/react/react-addons-tests.ts @@ -201,7 +201,7 @@ myComponent.reset(); // Attributes // -------------------------------------------------------------------------- -var children = ["Hello world", [null], React.DOM.span(null)]; +var children: any[] = ["Hello world", [null], React.DOM.span(null)]; var divStyle = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" diff --git a/react/react-tests.ts b/react/react-tests.ts index 2802a34cdf..1fd2670dec 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -201,7 +201,7 @@ myComponent.reset(); // Attributes // -------------------------------------------------------------------------- -var children = ["Hello world", [null], React.DOM.span(null)]; +var children: any[] = ["Hello world", [null], React.DOM.span(null)]; var divStyle = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" From 25407fa708d034e5c420dc2e9a994810501a7512 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 15 Apr 2015 23:25:52 +0900 Subject: [PATCH 0012/2220] fix react/legacy/react-0.12-tests.ts compile error --- react/legacy/react-0.12-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/legacy/react-0.12-tests.ts b/react/legacy/react-0.12-tests.ts index 27eae4c64e..98faad6466 100644 --- a/react/legacy/react-0.12-tests.ts +++ b/react/legacy/react-0.12-tests.ts @@ -121,7 +121,7 @@ myComponent.reset(); // Attributes // -------------------------------------------------------------------------- -var children = ["Hello world", [null], React.DOM.span(null)]; +var children: any[] = ["Hello world", [null], React.DOM.span(null)]; var divStyle = { // CSSProperties flex: "1 1 main-size", backgroundImage: "url('hello.png')" From ffa4719d92d613669e9afbe792527d0b21e39b03 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 15 Apr 2015 23:29:38 +0900 Subject: [PATCH 0013/2220] fix passport-local/passport-local-tests.ts compile error --- passport-local/passport-local-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passport-local/passport-local-tests.ts b/passport-local/passport-local-tests.ts index de799a4d82..c58772eaaa 100644 --- a/passport-local/passport-local-tests.ts +++ b/passport-local/passport-local-tests.ts @@ -26,7 +26,7 @@ class User implements IUser { //#endregion // Sample from https://github.com/jaredhanson/passport-local#configure-strategy -passport.use(new local.Strategy(function (username, password, done) { +passport.use(new local.Strategy((username: any, password: any, done: any) => { User.findOne({ username: username }, function (err, user) { if (err) { return done(err); From 8d7f10e0304131e1526801977f69e836c5f1b305 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 15 Apr 2015 23:32:15 +0900 Subject: [PATCH 0014/2220] fix microsoft-ajax/microsoft.ajax-tests.ts compile error --- microsoft-ajax/microsoft.ajax-tests.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/microsoft-ajax/microsoft.ajax-tests.ts b/microsoft-ajax/microsoft.ajax-tests.ts index 7544b1c9f3..397fcc92c6 100644 --- a/microsoft-ajax/microsoft.ajax-tests.ts +++ b/microsoft-ajax/microsoft.ajax-tests.ts @@ -54,14 +54,14 @@ function BaseClassExtensions_Error_Tests() { } else if (isNaN(input)) { var msg = "A number was not entered. "; - msg += (String).format("Please enter a number between {0} and {1}.", min, max); + msg += (String).format("Please enter a number between {0} and {1}.", min, max); var err = (Error).create(msg); throw err; } else if (input < min || input > max) { msg = "The number entered was outside the acceptable range. "; - msg += (String).format("Please enter a number between {0} and {1}.", min, max); + msg += (String).format("Please enter a number between {0} and {1}.", min, max); var err = (Error).create(msg); @@ -82,12 +82,12 @@ function BaseClassExtensions_Error_Tests() { function BaseClassExtensions_String_Tests() { - (String).format("Please enter a number between {0} and {1}.", 1, 2); - (String).endsWith("test"); - (String).localeFormat("Please enter a number between {0} and {1}", 1, 2); - (String).trim(); - (String).trimEnd(); - (String).trimStart(); + (String).format("Please enter a number between {0} and {1}.", 1, 2); + (String).endsWith("test"); + (String).localeFormat("Please enter a number between {0} and {1}", 1, 2); + (String).trim(); + (String).trimEnd(); + (String).trimStart(); } function BaseClassExtensions_Function_Tests() { @@ -150,7 +150,7 @@ function BaseClassExtensions_Date_Tests() { function BaseClassExtensions_Boolean_Tests() { - (Boolean).parse("false"); + (Boolean).parse("false"); } function BaseClassExtensions_Number_Tests() { From b79d800626c9e98914c82aa095e76857fd8b4c68 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 15 Apr 2015 23:35:12 +0900 Subject: [PATCH 0015/2220] fix jqueryui/jqueryui-tests.ts compile error --- jqueryui/jqueryui-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 79263027fe..ef02b40d61 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1618,7 +1618,7 @@ function test_spinner() { }, _parse: function (value) { if (typeof value === "string") { - if (Number(value) == value) { + if (Number(value) == value) { return Number(value); } return 123; @@ -1822,4 +1822,4 @@ function test_widget() { var isDisabled = $(".selector").jQuery.Widget("option", "disabled"); $(".selector").jQuery.Widget("option", "disabled", true); $(".selector").jQuery.Widget("option", { disabled: true }); -} \ No newline at end of file +} From 23d8d30144ccd79f5e8625db65ecffe5a25d9af8 Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 15 Apr 2015 23:36:46 +0900 Subject: [PATCH 0016/2220] fix hooker/hooker-tests.ts compile error --- hooker/hooker-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooker/hooker-tests.ts b/hooker/hooker-tests.ts index d9aea606c2..edd2c25e97 100644 --- a/hooker/hooker-tests.ts +++ b/hooker/hooker-tests.ts @@ -11,11 +11,11 @@ function tests() { hello: 'world' }; hooker.hook(objectToHook, 'hello', () => { }); - hooker.hook(objectToHook, 'hello', () => { + hooker.hook(objectToHook, 'hello', (): any => { return null; }); hooker.hook(objectToHook, ['hello', 'foo'], () => { }); - hooker.hook(objectToHook, ['hello', 'bar'], () => { + hooker.hook(objectToHook, ['hello', 'bar'], (): any => { return null; }); hooker.hook(objectToHook, 'bar', () => { From ad1887a3d3352ce5fefb81b1da2a0074b6bdf126 Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Thu, 16 Apr 2015 09:25:35 +1000 Subject: [PATCH 0017/2220] fix acl/acl-mongodbBackend.d.ts compile error --- acl/acl.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acl/acl.d.ts b/acl/acl.d.ts index 5d0498fed9..121541cada 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -14,7 +14,7 @@ declare module "acl" { type Value = string|number; type Values = Value|Value[]; type Action = () => any; - type Callback = (err: Error) => any; + export type Callback = (err: Error) => any; type AnyCallback = (err: Error, obj: any) => any; type AllowedCallback = (err: Error, allowed: boolean) => any; type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value; @@ -84,7 +84,7 @@ declare module "acl" { // // For internal use // - interface Backend { + export interface Backend { begin: () => T; end: (transaction: T, cb?: Action) => void; clean: (cb?: Action) => void; From c9d2949f7e20b5e6532b89b3f65df23c598a24e4 Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Thu, 16 Apr 2015 09:27:56 +1000 Subject: [PATCH 0018/2220] fix acl/acl-redisBackend compile error --- acl/acl-redisBackend.d.ts | 2 +- acl/acl.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/acl/acl-redisBackend.d.ts b/acl/acl-redisBackend.d.ts index e199f8b81c..2f222e2525 100644 --- a/acl/acl-redisBackend.d.ts +++ b/acl/acl-redisBackend.d.ts @@ -9,7 +9,7 @@ declare module "acl" { import redis = require('redis'); - interface AclStatic { + export interface AclStatic { redisBackend: RedisBackendStatic; } diff --git a/acl/acl.d.ts b/acl/acl.d.ts index 121541cada..ded8be22b4 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -19,7 +19,7 @@ declare module "acl" { type AllowedCallback = (err: Error, allowed: boolean) => any; type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value; - interface AclStatic { + export interface AclStatic { new (backend: Backend, logger: Logger, options: Option): Acl; new (backend: Backend, logger: Logger): Acl; new (backend: Backend): Acl; From 316a02d99ee5445daeabd51e883d646c5979437f Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Thu, 16 Apr 2015 10:00:42 +1000 Subject: [PATCH 0019/2220] tests: revert my ugly hacks. See https://github.com/Microsoft/TypeScript/issues/2784 --- acl/acl-redisBackend.d.ts | 2 +- acl/acl.d.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acl/acl-redisBackend.d.ts b/acl/acl-redisBackend.d.ts index 2f222e2525..e199f8b81c 100644 --- a/acl/acl-redisBackend.d.ts +++ b/acl/acl-redisBackend.d.ts @@ -9,7 +9,7 @@ declare module "acl" { import redis = require('redis'); - export interface AclStatic { + interface AclStatic { redisBackend: RedisBackendStatic; } diff --git a/acl/acl.d.ts b/acl/acl.d.ts index ded8be22b4..5d0498fed9 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -14,12 +14,12 @@ declare module "acl" { type Value = string|number; type Values = Value|Value[]; type Action = () => any; - export type Callback = (err: Error) => any; + type Callback = (err: Error) => any; type AnyCallback = (err: Error, obj: any) => any; type AllowedCallback = (err: Error, allowed: boolean) => any; type GetUserId = (req: http.ServerRequest, res: http.ServerResponse) => Value; - export interface AclStatic { + interface AclStatic { new (backend: Backend, logger: Logger, options: Option): Acl; new (backend: Backend, logger: Logger): Acl; new (backend: Backend): Acl; @@ -84,7 +84,7 @@ declare module "acl" { // // For internal use // - export interface Backend { + interface Backend { begin: () => T; end: (transaction: T, cb?: Action) => void; clean: (cb?: Action) => void; From 7faade2b2301cea8758b3bb2a488f771748c584d Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 29 Apr 2015 11:15:25 +0900 Subject: [PATCH 0020/2220] suppress `Octal literals are not available when targeting ECMAScript 5 and higher.` --- emscripten/emscripten-tests.ts | 2 +- gulp-concat/gulp-concat-tests.ts | 2 +- jquery.pickadate/jquery.pickadate-tests.ts | 4 ++-- mock-fs/mock-fs-tests.ts | 2 +- vinyl-fs/vinyl-fs-tests.ts | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/emscripten/emscripten-tests.ts b/emscripten/emscripten-tests.ts index 2f3a2b09ca..0a614a5405 100644 --- a/emscripten/emscripten-tests.ts +++ b/emscripten/emscripten-tests.ts @@ -50,7 +50,7 @@ function FSTest(): void { FS.symlink('file', 'link'); FS.writeFile('forbidden', 'can\'t touch this'); - FS.chmod('forbidden', 0000); + FS.chmod('forbidden', parseInt("0000", 8)); FS.writeFile('file', 'foobar'); FS.truncate('file', 3); diff --git a/gulp-concat/gulp-concat-tests.ts b/gulp-concat/gulp-concat-tests.ts index a2a475b978..68f6e529d8 100644 --- a/gulp-concat/gulp-concat-tests.ts +++ b/gulp-concat/gulp-concat-tests.ts @@ -18,6 +18,6 @@ gulp.task("concat:newLine", () => { gulp.task("concat:vinyl", () => { gulp.src(["file*.txt"]) - .pipe(concat({ path: "file.txt", stat: { mode: 0666 } })) + .pipe(concat({ path: "file.txt", stat: { mode: parseInt("0666", 8) } })) .pipe(gulp.dest("build")); }); diff --git a/jquery.pickadate/jquery.pickadate-tests.ts b/jquery.pickadate/jquery.pickadate-tests.ts index fde52f3e3e..89c250cf8b 100644 --- a/jquery.pickadate/jquery.pickadate-tests.ts +++ b/jquery.pickadate/jquery.pickadate-tests.ts @@ -282,7 +282,7 @@ picker.set('disable', undefined); picker.set('select', [2013, 3, 20]); // Using JavaScript Date objects. -picker.set('select', new Date(2013,03,20)); +picker.set('select', new Date(2013, 3, 20)); // Using positive integers as UNIX timestamps. picker.set('select', 1365961912346); @@ -417,4 +417,4 @@ picker.on('open', function () { picker.trigger('open'); picker.$node; -picker.$root; \ No newline at end of file +picker.$root; diff --git a/mock-fs/mock-fs-tests.ts b/mock-fs/mock-fs-tests.ts index 3dd9f01210..d4c5eae4f7 100644 --- a/mock-fs/mock-fs-tests.ts +++ b/mock-fs/mock-fs-tests.ts @@ -50,7 +50,7 @@ function d() { function e() { mock({ 'some/dir': mock.directory({ - mode: 0755, + mode: parseInt("0755", 8), items: { file1: 'file one content', file2: new Buffer([8, 6, 7, 5, 3, 0, 9]) diff --git a/vinyl-fs/vinyl-fs-tests.ts b/vinyl-fs/vinyl-fs-tests.ts index 016da5e8b3..335254f793 100644 --- a/vinyl-fs/vinyl-fs-tests.ts +++ b/vinyl-fs/vinyl-fs-tests.ts @@ -227,7 +227,7 @@ var dataWrap = function(fn:any) { }; var realMode = function(n:any) { - return n & 07777; + return n & parseInt("07777", 8); }; describe('dest stream', function() { @@ -370,7 +370,7 @@ describe('dest stream', function() { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, @@ -410,7 +410,7 @@ describe('dest stream', function() { var expectedContents = fs.readFileSync(inputPath); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var contentStream = through.obj(); var expectedFile = new File({ @@ -454,7 +454,7 @@ describe('dest stream', function() { var expectedPath = path.join(__dirname, "./out-fixtures/test"); var expectedCwd = __dirname; var expectedBase = path.join(__dirname, "./out-fixtures"); - var expectedMode = 0655; + var expectedMode = parseInt("0655", 8); var expectedFile = new File({ base: inputBase, From 6d64be2b2844adc0f4ea0f128b41faad98a1c96d Mon Sep 17 00:00:00 2001 From: vvakame Date: Wed, 29 Apr 2015 12:03:44 +0900 Subject: [PATCH 0021/2220] merge acl-mongodbBackend.d.ts and acl-redisBackend.d.ts into acl.d.ts --- acl/acl-mongodbBackend-tests.ts | 3 +-- acl/acl-mongodbBackend.d.ts | 22 ---------------------- acl/acl-redisBackend-test.ts | 2 +- acl/acl-redisBackend.d.ts | 21 --------------------- acl/acl.d.ts | 30 ++++++++++++++++++++++++++++++ 5 files changed, 32 insertions(+), 46 deletions(-) delete mode 100644 acl/acl-mongodbBackend.d.ts delete mode 100644 acl/acl-redisBackend.d.ts diff --git a/acl/acl-mongodbBackend-tests.ts b/acl/acl-mongodbBackend-tests.ts index 31411b65c7..01c9af9082 100644 --- a/acl/acl-mongodbBackend-tests.ts +++ b/acl/acl-mongodbBackend-tests.ts @@ -1,4 +1,4 @@ -/// +/// // https://github.com/OptimalBits/node_acl/blob/master/Readme.md import Acl = require('acl'); @@ -14,4 +14,3 @@ acl.allow('guest', 'blogs', 'view'); // allow function accepts arrays as any parameter acl.allow('member', 'blogs', ['edit','view', 'delete']); - diff --git a/acl/acl-mongodbBackend.d.ts b/acl/acl-mongodbBackend.d.ts deleted file mode 100644 index 8dbfb7e905..0000000000 --- a/acl/acl-mongodbBackend.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Type definitions for node_acl 0.4.7 -// Project: https://github.com/optimalbits/node_acl -// Definitions by: Qubo -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "acl" { - import mongo = require('mongodb'); - - interface AclStatic { - mongodbBackend: MongodbBackendStatic; - } - - interface MongodbBackend extends Backend { } - interface MongodbBackendStatic { - new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend; - new(db: mongo.Db, prefix: string): MongodbBackend; - new(db: mongo.Db): MongodbBackend; - } -} diff --git a/acl/acl-redisBackend-test.ts b/acl/acl-redisBackend-test.ts index e1bf29af49..273aeab3b7 100644 --- a/acl/acl-redisBackend-test.ts +++ b/acl/acl-redisBackend-test.ts @@ -1,4 +1,4 @@ -/// +/// // https://github.com/OptimalBits/node_acl/blob/master/Readme.md import Acl = require('acl'); diff --git a/acl/acl-redisBackend.d.ts b/acl/acl-redisBackend.d.ts deleted file mode 100644 index e199f8b81c..0000000000 --- a/acl/acl-redisBackend.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for node_acl 0.4.7 -// Project: https://github.com/optimalbits/node_acl -// Definitions by: Qubo -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// -/// - -declare module "acl" { - import redis = require('redis'); - - interface AclStatic { - redisBackend: RedisBackendStatic; - } - - interface RedisBackend extends Backend { } - interface RedisBackendStatic { - new(redis: redis.RedisClient, prefix: string): RedisBackend; - new(redis: redis.RedisClient): RedisBackend; - } -} diff --git a/acl/acl.d.ts b/acl/acl.d.ts index 5d0498fed9..57e85d9d58 100644 --- a/acl/acl.d.ts +++ b/acl/acl.d.ts @@ -6,6 +6,9 @@ /// /// +/// +/// + declare module "acl" { import http = require('http'); import Promise = require("bluebird"); @@ -115,6 +118,33 @@ declare module "acl" { end: () => void; } + // for redis backend + import redis = require('redis'); + + interface AclStatic { + redisBackend: RedisBackendStatic; + } + + interface RedisBackend extends Backend { } + interface RedisBackendStatic { + new(redis: redis.RedisClient, prefix: string): RedisBackend; + new(redis: redis.RedisClient): RedisBackend; + } + + // for mongodb backend + import mongo = require('mongodb'); + + interface AclStatic { + mongodbBackend: MongodbBackendStatic; + } + + interface MongodbBackend extends Backend { } + interface MongodbBackendStatic { + new(db: mongo.Db, prefix: string, useSingle: boolean): MongodbBackend; + new(db: mongo.Db, prefix: string): MongodbBackend; + new(db: mongo.Db): MongodbBackend; + } + var _: AclStatic; export = _; } From 609e8e45ca5017c0db5c2513ed9ad52798c4ed1c Mon Sep 17 00:00:00 2001 From: vvakame Date: Fri, 1 May 2015 12:22:00 +0900 Subject: [PATCH 0022/2220] update typescript version 1.5.0-alpha to 1.5.0-beta --- npm-shrinkwrap.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 04fa1a9570..d3f7dc16ec 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -8,9 +8,9 @@ "resolved": "https://registry.npmjs.org/definition-tester/-/definition-tester-0.2.0.tgz", "dependencies": { "bluebird": { - "version": "2.9.24", + "version": "2.9.25", "from": "bluebird@>=2.5.3 <3.0.0", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.24.tgz" + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.25.tgz" }, "definition-header": { "version": "0.1.0", @@ -103,9 +103,9 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "minimatch": { - "version": "2.0.4", + "version": "2.0.7", "from": "minimatch@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.7.tgz", "dependencies": { "brace-expansion": { "version": "1.1.0", @@ -170,9 +170,9 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" }, "minimatch": { - "version": "2.0.4", + "version": "2.0.7", "from": "minimatch@>=2.0.1 <3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.4.tgz", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.7.tgz", "dependencies": { "brace-expansion": { "version": "1.1.0", @@ -305,9 +305,9 @@ } }, "typescript": { - "version": "1.5.0-alpha", - "from": "typescript@1.5.0-alpha", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.5.0-alpha.tgz" + "version": "1.5.0-beta", + "from": "typescript@1.5.0-beta", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.5.0-beta.tgz" } } } diff --git a/package.json b/package.json index 2630763e69..d2826fc15f 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,6 @@ }, "devDependencies": { "definition-tester": "0.2.0", - "typescript": "1.5.0-alpha" + "typescript": "1.5.0-beta" } } From c3fce999444a0af7376a1317da93eb15ddd07ee2 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 8 May 2015 14:19:01 -0700 Subject: [PATCH 0023/2220] Added typings and tests for core-js --- core-js/core-js-tests.ts | Bin 0 -> 45732 bytes core-js/core-js-tests.ts.tscparams | Bin 0 -> 94 bytes core-js/core-js.d.ts | 3037 ++++++++++++++++++++++++++++ 3 files changed, 3037 insertions(+) create mode 100644 core-js/core-js-tests.ts create mode 100644 core-js/core-js-tests.ts.tscparams create mode 100644 core-js/core-js.d.ts diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts new file mode 100644 index 0000000000000000000000000000000000000000..4b9f6f9d7c63ced3b95e8f3b50ae2ea81e9fae29 GIT binary patch literal 45732 zcmd^Idv6=Z5x>6+^g9SiQOH23v<;8|jblKFlvYV?3s%|`FpNfTGt~>E5=Sob)!WYR zhQpcJ+ZV|bB{C2!i@e==@67D%y!|8O}cSwoeomk7qTl{f0rit+hx(rqTwuN;+Q#%b#QHu1AJkt^-&^W;*tR<) zICstGEp~Y_Zl8>))u`p?Ja|5gV6c#n+UG|kjq4U0aCi)7ZHvw33DNNdNp++7sg>PH z(C)fz_mZUd15tfU6nQwK_W3J%cHZogTyBErW8&?yZNqY5RPacpcHxQSkJn zwGD2wGx^)o@NdG-I^Ay}+|cI{QF_;W(?0R7Z(2TKJFpGaU8>b5q-Ea{R^VG7621}9 zcGtWl+g6yq-|Oa0Wj|o>eeq4H|3NEjmN0r-iI@7uCC4;CE1^tF@U~m4Mt`>NQu_mA z>)Q7<@t|YiqbamESy}vz#tdu%x=>i#Qyt0krxV(q1zH&rPFT<(Sv^K%SEqYHi>F5C zHP9@#-dehlyE4!oZ)oItOU%=*J;lOe__P%yuAk7Sj8P%pwxhW$y|BkD(hU0o+Y96G zm3r8swr0)hXQuTj*_DkJp8xrHx75_pU@0i+H{<~PTkERBXh+#R7*)#pR~_cp#=iQI z_BHuyjutALl(t`xg`)L5JX(Wm$3lfckUb8*Gm{tCB!Vy7_Ws^rsQ|z0U^n5 z+>s}imJqYF@x3Kl%2Nv=M*j`rzb4JWLQWgWH#|&m#aa#9S?D2sHIRkcGW0U-C7SDL z^^oE;T4;5&X;$aqccp7#BOA?27SR4dIvl#OE1G&boh^k>PN)ZFNnL7oCQmFKb-hJa zF$gg!SsFAhXm9WTF>mC#`G?J_{wNQ-&6nhZwkZcvzq-+U+Ind_i`{5`Pvh?^$`nz9 zxFy|O(_aebIek8%r^x?#Hje*4rCP+bnG0``&l}UvkY>ME4g6ZX75qT@DSX6jGa%m$ zuYov#xhrN|1N!@{?WvS)5ElOv#|bzC!t3Wx()KLie2eHmB#(t^4D92?@X~Gjw&i<3 zd|$N~&;u2iEhE8IwWSYR9w6@o*RY@TqpX+WKdYnDZtY zd6eh0*U$>l7RjEo1M3m&a~bn8R_!xXM{meG44QXjo2Z$>LQ{~==;;OhT4hOK3`$M)i0Z36x`vZ+SMHB-#&V29 zNI|P-47A)isBn=O}I(5F3}*?`yI(jYJ6k*V7he7r=E+|FD**{I9mXf)B|6u%<0q-=A90 zHc1ANP)4d`<7ge~X_I6Kt;So61xSqTww5^nU|Y?m@LS!Lp&k$?vTCj4=F5qlE5{o5 zg=eA5L*NngJz38Y$?f||J|%5O#KRfc@FCgEc=BvrtfuVc?Aj80In-Z~S*Z-t9?q^a zu}$)9encJtH4#)%t@rTl*(y*uIiA>KIFc_rw5-o4wvykXoe%poXWpYq?@L+>@bhWk z5;Oj<+7ZpULTt=+dtgq0yb*qJ6!jC`J}*f6FDly}P+RQDN#hak_Rr>D#QQdJ zwM&2P5zcSvufNd0SHavT?2ESZ^+kq1B1xVS)(f&z*gX84c#=4^+Kc&|uZQ=%f=R|5 z#?eLdzWJp2laqb7-H@tns4sT?V7IMQ7_GH*TR{@%%^#aT6fkqU5`6;grT~p2^(EoW zQ-_#0CeM^_1x~Mut&mHUTVYpN4Ng?IYOun}YVf{otGB4)*60?|lB>{p$#B&OEl&zE zJf=vAOv}R4c(B?&xEvF0?Q&cd2kkzob&(VJkQ|Bm3+p9_?>5u=mTdccS}*Z^u>;e$ z#?C>Ga}1qlq*nGdE!1PDpdh}^_>^m&cn5u2(IYUN1rgbK) z7#+8<=YZxa$fOTxY)b8^3_~hGoN1NXb2fEMzOmGjb9&^&Sd%HWMifOft${plXMxAW zKW3k0$Tt+(1GLi&y>>{vN^KCA`?TY^#Miy!9}Y2463<RK5S?KL6!KP+2L>{+`|VYb~#;9^@eAD$U|U1CvA+i`rjhEg;zOf$1{AuDOrTbBi3?6 zZDCvN5w)%2UiYj8(FChAyvLq*Bh+OthzmDvo(|b_{ZMLzvY%=|{zO`bvvqC5{nthI z;Dfp5xfw@0wJ~{y5f1so25q(>&p8j-CHWyzZqmG>S0e> zPl&Y_oKE>=IwrJ|%$`zkvd6X5NTiV#9Hndve&XS!p1_db_35S4#6Ug6t&`>k-$FLJ8I7DhzPizxqJqbIy;%FnD^tv$ym zjzcI((aMc$59^+Z>`nbK&r9pF5F6z%KNg?PFkthNi|Cvq-;Se>?Ky6J7`}mik7(X> zLRr%#{jc~qhQP|#L0jM>X->@Nf<`D~5VLH2<3wM?Ak_e%S68laht+q4pyaq47Q?(6_CsUiB}Q z4f~bFB%XrVkGzG#`Q;s_uWuR4IVhIv6?tdmfO0Bo7Hsf*a@wXGqp>R=`=8Qtvee8g ze2K&?}v3C-@F)fkLeBZj@7GMT65H@lfd@%|caNPm`pt(yN2hYVT&&hsm=nhpQF{!1FU~oG)MA~W4_e4u(;!6-M60&V$9p!FBYpQPxh zoW8)g#W!;Ax2~A@cD8=-BvHNdF?(55r8W6@>5S|9q3IPH*d%+%(Xvez!}sXKH16#W zH>mM_M5$HsvS(=+7}y8Sc9504VR4ctxWS zw}J2}8s$5E2L@tUtjB8a@&)IIZ9cp~w=h@^;dO85=Yq~JZW8B+@_c$teV4WNZQ5CM zH?^b`Oq{d#cZVo!@rYfhj9aW!_KAn|Vh36Iz=<`1R9@LoP|C)g~V}2 zPlY1B0FIuT&e2tZGMs945h(sNW*DRPCOgM)a{|tAB95>{v9Awxjh(@I=9N!k=}FR* z^~o6#k&d^kx?ZgF*>T|%u*at-QbX=?=Vy1w%EPm% zq1JZ^4}RUAz~&arc}YgdhfdpB-4)T~DPzxVDNAw1yO7b6CCzs4t-r3XjJA3Dsy~&u zRpOrMPFt9#LbHa|&H-}S(r3kcQ9h$nHEN+aVS~Fax_1Sloj>~nUk{1GpLL&Jkd5Q4 zSh~f?v`}5d?>_|mYZ_aUO=JBCx1KBI7LRYq-grRmai4+QzOEy1(C%FieX`z?2;3M| zfP=dVaee@;kzb*DQbW6(qhPA>zB`OYwnv<=w^GFUP2o>kDvs5*Rq!F6Lv`n8on0HW zl_$tdeYxD1fEy0^Zm{?>u|}LQ00hmfECjL0ZYxi#&20Rw5B}VS#x&pGp4v&n3Qtcd zG(_-A;-Y)c{H&RWk18Sy1|I=FWPcQg2LrBxJ+aji@FPm)FGa~??^19G%9e1Va|--XCCXI=?N!v&=& zn1WMAsipS^vN%NUJY@BHDI8t8C7dJhS@J(Aa+|DD(dgv-q)i}P>Pl7)- zg86Q)vNd>!{!e942hr%?d07Atb2wq}>I zPf(dY|HwQD_pnEgvPyK9MhlSIlR&Vp-yGBdc1jBxcp zTnET=rems0Gq2m>4zm=^?1RwL-zpHxvILrDS+m1U(GjOTzdyzMPkfTPc3fgxG$VoC z%9ekGsMNZ(Kk4b$L$t?g%USt&K@v&bK`egF>I16=W18)&6ye##4y9&hpYxrfn9pM# z>(`*w?{U2F{p?PaaBV_y=3!tShe)69ud-Neo$}cEvehT=I>rwEen$^R1=ioOr};En zJJ<2U?>$);DJvhjk;6P=WN>8T-!e-0DY6&5U#8Rw8IHUILDzc(2Hs6RjyzX7*TJgg zUF&_@v%J||rIm{W-PWruTje@u%b|Z2DfoHWYqG*Oll`%^J%%&);Jqq>Cr$}R60Gsz zUhN$kA9(lLCe>c}FHg6ON&D2U6?fq%cd@?vG^UaJ%RF#V{Mx^ZSK_m@;n*ynY+SCH zEvG2oGP45AUr(}ftizPvn z-QCy4p_&d?Z_@I}uQG8>jcW(7F%DS@Y_t*z{8g*)_|XDBxw5owoQC6eeL0PJka})IkL%YW<5mwF zTCU}WtCHQQs%!A8L$lrG@K~uE$qg{&bZz%TTOxR$?0==)xNovRfOEi&i!!= zjy%`+MmUe_E|h?-t8u&ShUbFS|7vSW`N&m5<&4Fdk$_h3*VB4;S{ubm64wYYr^b6l5#7&ww_3ab z6=ysLQEaNEoV5xJZT)MoO<8#r?&Uq-tS@;}rB)sD?f>3qoXu)`oJi!IJlgZuV81E>U)SSoF!fZWg?E$K9B_ZS4pXy_rzYD`8vNcU zzn@?89BuD8k~ooiu9;t|MGe=0^4K_E-yF~Ga_u{lv*$|GC*-_|?SVBx|L#bIvHE^R zd8>P;B72iz=Z)ws`|v8tqV*6nXcP{_y{ahBkcW?2ep^=(`-HJnAZ-2RnvwCD6LK($oc5;L}Z>vfS4 t+cowI;?yASce5t8axkfurxuLq_B8JQ3`EgC3JbW*0F;b@k_drFg1{6k51bH%3%`HQZ5WltKw)ELChDACdeNzx aN+WTqW=YgnKC3Jo|Hc{FnY3_8mIq$Ba}rDd literal 0 HcmV?d00001 diff --git a/core-js/core-js.d.ts b/core-js/core-js.d.ts new file mode 100644 index 0000000000..476ab99162 --- /dev/null +++ b/core-js/core-js.d.ts @@ -0,0 +1,3037 @@ +// Type definitions for core-js v0.9.7 +// Project: https://github.com/zloirock/core-js/ +// Definitions by: Ron Buckton +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +declare type PropertyKey = string | number | symbol; + +// ############################################################################################# +// ECMAScript 6: Object & Function +// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, +// es6.object.to-string, es6.function.name and es6.function.has-instance. +// ############################################################################################# + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects to copy properties from. + */ + assign(target: any, ...sources: any[]): any; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + * @remarks Requires `__proto__` support. + */ + setPrototypeOf(o: any, proto: any): any; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + name: string; + + /** + * Determines if a constructor object recognizes an object as one of the + * constructor’s instances. + * @param value The object to test. + */ + [Symbol.hasInstance](value: any): boolean; +} + +// ############################################################################################# +// ECMAScript 6: Array +// Modules: es6.array.from, es6.array.of, es6.array.copy-within, es6.array.fill, es6.array.find, +// and es6.array.find-index +// ############################################################################################# + +interface ArrayLike { + length: number; + [n: number]: T; +} + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: T) => boolean, thisArg?: any): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): T[]; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): T[]; + + [Symbol.unscopables]: any; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: Iterable): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +// ############################################################################################# +// ECMAScript 6: String & RegExp +// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, +// es6.string.ends-with, es6.string.includes, es6.string.repeat, +// es6.string.starts-with, and es6.regexp +// ############################################################################################# + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; +} + +// ############################################################################################# +// ECMAScript 6: Number & Math +// Modules: es6.number.constructor, es6.number.statics, and es6.math +// ############################################################################################# + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. + */ + EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[]): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +// ############################################################################################# +// ECMAScript 6: Symbols +// Modules: es6.symbol +// ############################################################################################# + +interface Symbol { + /** Returns a string representation of an object. */ + toString(): string; + + [Symbol.toStringTag]: string; +} + +interface SymbolConstructor { + /** + * A reference to the prototype. + */ + prototype: Symbol; + + /** + * Returns a new unique Symbol value. + * @param description Description of the new Symbol object. + */ + (description?: string|number): symbol; + + /** + * Returns a Symbol object from the global symbol registry matching the given key if found. + * Otherwise, returns a new symbol with this key. + * @param key key to search for. + */ + for(key: string): symbol; + + /** + * Returns a key from the global symbol registry matching the given Symbol if found. + * Otherwise, returns a undefined. + * @param sym Symbol to find the key for. + */ + keyFor(sym: symbol): string; + + // Well-known Symbols + + /** + * A method that determines if a constructor object recognizes an object as one of the + * constructor’s instances. Called by the semantics of the instanceof operator. + */ + hasInstance: symbol; + + /** + * A Boolean value that if true indicates that an object should flatten to its array elements + * by Array.prototype.concat. + */ + isConcatSpreadable: symbol; + + /** + * A method that returns the default iterator for an object. Called by the semantics of the + * for-of statement. + */ + iterator: symbol; + + /** + * A regular expression method that matches the regular expression against a string. Called + * by the String.prototype.match method. + */ + match: symbol; + + /** + * A regular expression method that replaces matched substrings of a string. Called by the + * String.prototype.replace method. + */ + replace: symbol; + + /** + * A regular expression method that returns the index within a string that matches the + * regular expression. Called by the String.prototype.search method. + */ + search: symbol; + + /** + * A function valued property that is the constructor function that is used to create + * derived objects. + */ + species: symbol; + + /** + * A regular expression method that splits a string at the indices that match the regular + * expression. Called by the String.prototype.split method. + */ + split: symbol; + + /** + * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive + * abstract operation. + */ + toPrimitive: symbol; + + /** + * A String value that is used in the creation of the default string description of an object. + * Called by the built-in method Object.prototype.toString. + */ + toStringTag: symbol; + + /** + * An Object whose own property names are property names that are excluded from the with + * environment bindings of the associated objects. + */ + unscopables: symbol; + + /** + * Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill + */ + useSimple(): void; + + /** + * Non-standard. Use setter mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill + */ + userSetter(): void; +} + +declare var Symbol: SymbolConstructor; + +interface Object { + /** + * Determines whether an object has a property with the specified name. + * @param v A property name. + */ + hasOwnProperty(v: PropertyKey): boolean; + + /** + * Determines whether a specified property is enumerable. + * @param v A property name. + */ + propertyIsEnumerable(v: PropertyKey): boolean; +} + +interface ObjectConstructor { + /** + * Returns an array of all symbol properties found directly on object o. + * @param o Object to retrieve the symbols from. + */ + getOwnPropertySymbols(o: any): symbol[]; + + /** + * Gets the own property descriptor of the specified object. + * An own property descriptor is one that is defined directly on the object and is not + * inherited from the object's prototype. + * @param o Object that contains the property. + * @param p Name of the property. + */ + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + + /** + * Adds a property to an object, or modifies attributes of an existing property. + * @param o Object on which to add or modify the property. This can be a native JavaScript + * object (that is, a user-defined object or a built in object) or a DOM object. + * @param p The property name. + * @param attributes Descriptor for the property. It can be for a data property or an accessor + * property. + */ + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; +} + +interface Math { + [Symbol.toStringTag]: string; +} + +interface JSON { + [Symbol.toStringTag]: string; +} + +// ############################################################################################# +// ECMAScript 6: Collections +// Modules: es6.map, es6.set, es6.weak-map, and es6.weak-set +// ############################################################################################# + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): Map; + size: number; +} + +interface MapConstructor { + new (): Map; + new (iterable: Iterable<[K, V]>): Map; + prototype: Map; +} + +declare var Map: MapConstructor; + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + size: number; +} + +interface SetConstructor { + new (): Set; + new (iterable: Iterable): Set; + prototype: Set; +} + +declare var Set: SetConstructor; + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): WeakMap; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (iterable: Iterable<[K, V]>): WeakMap; + prototype: WeakMap; +} + +declare var WeakMap: WeakMapConstructor; + +interface WeakSet { + add(value: T): WeakSet; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (iterable: Iterable): WeakSet; + prototype: WeakSet; +} + +declare var WeakSet: WeakSetConstructor; + +// ############################################################################################# +// ECMAScript 6: Iterators +// Modules: es6.string.iterator, es6.array.iterator, es6.map, es6.set, web.dom.iterable +// ############################################################################################# + +interface IteratorResult { + done: boolean; + value?: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface Iterable { + [Symbol.iterator](): Iterator; +} + +interface IterableIterator extends Iterator { + [Symbol.iterator](): IterableIterator; +} + +interface String { + /** Iterator */ + [Symbol.iterator](): IterableIterator; +} + +interface Array { + /** Iterator */ + [Symbol.iterator](): IterableIterator; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(): IterableIterator; +} + +interface Map { + entries(): IterableIterator<[K, V]>; + keys(): IterableIterator; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[K, V]>; +} + +interface Set { + entries(): IterableIterator<[T, T]>; + keys(): IterableIterator; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator; +} + +interface NodeList { + [Symbol.iterator](): IterableIterator; +} + +interface $for extends IterableIterator { + of(callbackfn: (value: T, key: any) => void, thisArg?: any): void; + array(): T[]; + array(callbackfn: (value: T, key: any) => U, thisArg?: any): U[]; + filter(callbackfn: (value: T, key: any) => boolean, thisArg?: any): $for; + map(callbackfn: (value: T, key: any) => U, thisArg?: any): $for; +} + +declare function $for(iterable: Iterable): $for; + +// ############################################################################################# +// ECMAScript 6: Promises +// Modules: es6.promise +// ############################################################################################# + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; + catch(onrejected?: (reason: any) => void): Promise; +} + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: Iterable>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: Iterable>): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; + +// ############################################################################################# +// ECMAScript 6: Reflect +// Modules: es6.reflect +// ############################################################################################# + +declare module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): IterableIterator; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: PropertyKey): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; +} + +// ############################################################################################# +// ECMAScript 7 +// Modules: es7.array.includes, es7.string.at, es7.string.lpad, es7.string.rpad, +// es7.object.to-array, es7.object.get-own-property-descriptors, es7.regexp.escape, +// es7.map.to-json, and es7.set.to-json +// ############################################################################################# + +interface Array { + includes(value: T, fromIndex?: number): boolean; +} + +interface String { + at(index: number): string; + lpad(length: number, fillStr?: string): string; + rpad(length: number, fillStr?: string): string; +} + +interface ObjectConstructor { + values(object: any): any[]; + entries(object: any): [string, any][]; + getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; +} + +interface RegExpConstructor { + escape(str: string): string; +} + +interface Map { + toJSON(): any; +} + +interface Set { + toJSON(): any; +} + +// ############################################################################################# +// Mozilla JavaScript: Array generics +// Modules: js.array.statics +// ############################################################################################# + +interface ArrayConstructor { + /** + * Appends new elements to an array, and returns the new length of the array. + * @param items New elements of the Array. + */ + push(array: ArrayLike, ...items: T[]): number; + /** + * Removes the last element from an array and returns it. + */ + pop(array: ArrayLike): T; + /** + * Combines two or more arrays. + * @param items Additional items to add to the end of array1. + */ + concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + /** + * Adds all the elements of an array separated by the specified separator string. + * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. + */ + join(array: ArrayLike, separator?: string): string; + /** + * Reverses the elements in an Array. + */ + reverse(array: ArrayLike): T[]; + /** + * Removes the first element from an array and returns it. + */ + shift(array: ArrayLike): T; + /** + * Returns a section of an array. + * @param start The beginning of the specified portion of the array. + * @param end The end of the specified portion of the array. + */ + slice(array: ArrayLike, start?: number, end?: number): T[]; + + /** + * Sorts an array. + * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. + */ + sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + */ + splice(array: ArrayLike, start: number): T[]; + + /** + * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. + * @param start The zero-based location in the array from which to start removing elements. + * @param deleteCount The number of elements to remove. + * @param items Elements to insert into the array in place of the deleted elements. + */ + splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; + + /** + * Inserts new elements at the start of an array. + * @param items Elements to insert at the start of the Array. + */ + unshift(array: ArrayLike, ...items: T[]): number; + + /** + * Returns the index of the first occurrence of a value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. + */ + indexOf(array: ArrayLike, searchElement: T, fromIndex?: number): number; + + /** + * Returns the index of the last occurrence of a specified value in an array. + * @param searchElement The value to locate in the array. + * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. + */ + lastIndexOf(array: ArrayLike, earchElement: T, fromIndex?: number): number; + + /** + * Determines whether all the members of an array satisfy the specified test. + * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + every(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Determines whether the specified callback function returns true for any element of an array. + * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + some(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + + /** + * Performs the specified action for each element in an array. + * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + forEach(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + + /** + * Calls a defined callback function on each element of an array, and returns an array that contains the results. + * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + map(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + + /** + * Returns the elements of an array that meet the condition specified in a callback function. + * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. + * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. + */ + filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + + /** + * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + */ + reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(array: ArrayLike): IterableIterator<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(array: ArrayLike): IterableIterator; + + /** + * Returns an list of values in the array + */ + values(array: ArrayLike): IterableIterator; + + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; + + includes(array: ArrayLike, value: T, fromIndex?: number): boolean; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; +} + +// ############################################################################################# +// Object - https://github.com/zloirock/core-js/#object +// Modules: core.object +// ############################################################################################# + +interface ObjectConstructor { + /** + * Non-standard. + */ + isObject(value: any): boolean; + + /** + * Non-standard. + */ + classof(value: any): string; + + /** + * Non-standard. + */ + define(target: T, mixin: any): T; + + /** + * Non-standard. + */ + make(proto: T, mixin?: any): T; +} + +// ############################################################################################# +// Console - https://github.com/zloirock/core-js/#console +// Modules: core.log +// ############################################################################################# + +interface Log extends Console { + (message?: any, ...optionalParams: any[]): void; + enable(): void; + disable(): void; +} + +/** + * Non-standard. + */ +declare var log: Log; + +// ############################################################################################# +// Dict - https://github.com/zloirock/core-js/#dict +// Modules: core.dict +// ############################################################################################# + +interface Dict { + [key: string]: T; + [key: number]: T; + //[key: symbol]: T; +} + +interface DictConstructor { + prototype: Dict; + + new (value?: Dict): Dict; + new (value?: any): Dict; + (value?: Dict): Dict; + (value?: any): Dict; + + isDict(value: any): boolean; + values(object: Dict): IterableIterator; + keys(object: Dict): IterableIterator; + entries(object: Dict): IterableIterator<[PropertyKey, T]>; + has(object: Dict, key: PropertyKey): boolean; + get(object: Dict, key: PropertyKey): T; + set(object: Dict, key: PropertyKey, value: T): Dict; + forEach(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => void, thisArg?: any): void; + map(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => U, thisArg?: any): Dict; + mapPairs(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => [PropertyKey, U], thisArg?: any): Dict; + filter(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): Dict; + some(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): boolean; + every(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): boolean; + find(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): T; + findKey(object: Dict, callbackfn: (value: T, key: PropertyKey, dict: Dict) => boolean, thisArg?: any): PropertyKey; + keyOf(object: Dict, value: T): PropertyKey; + includes(object: Dict, value: T): boolean; + reduce(object: Dict, callbackfn: (previousValue: U, value: T, key: PropertyKey, dict: Dict) => U, initialValue: U): U; + reduce(object: Dict, callbackfn: (previousValue: T, value: T, key: PropertyKey, dict: Dict) => T, initialValue?: T): T; + turn(object: Dict, callbackfn: (memo: Dict, value: T, key: PropertyKey, dict: Dict) => void, memo: Dict): Dict; + turn(object: Dict, callbackfn: (memo: Dict, value: T, key: PropertyKey, dict: Dict) => void, memo?: Dict): Dict; +} + +/** + * Non-standard. + */ +declare var Dict: DictConstructor; + +// ############################################################################################# +// Partial application - https://github.com/zloirock/core-js/#partial-application +// Modules: core.function.part +// ############################################################################################# + +interface Function { + /** + * Non-standard. + */ + part(...args: any[]): any; +} + +// ############################################################################################# +// Date formatting - https://github.com/zloirock/core-js/#date-formatting +// Modules: core.date +// ############################################################################################# + +interface Date { + /** + * Non-standard. + */ + format(template: string, locale?: string): string; + + /** + * Non-standard. + */ + formatUTC(template: string, locale?: string): string; +} + +// ############################################################################################# +// Array - https://github.com/zloirock/core-js/#array +// Modules: core.array.turn +// ############################################################################################# + +interface Array { + /** + * Non-standard. + */ + turn(callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + + /** + * Non-standard. + */ + turn(callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; +} + +// ############################################################################################# +// Number - https://github.com/zloirock/core-js/#number +// Modules: core.number.iterator +// ############################################################################################# + +interface Number { + /** + * Non-standard. + */ + [Symbol.iterator](): IterableIterator; +} + +// ############################################################################################# +// Escaping characters - https://github.com/zloirock/core-js/#escaping-characters +// Modules: core.string.escape-html +// ############################################################################################# + +interface String { + /** + * Non-standard. + */ + escapeHTML(): string; + + /** + * Non-standard. + */ + unescapeHTML(): string; +} + +// ############################################################################################# +// delay - https://github.com/zloirock/core-js/#delay +// Modules: core.delay +// ############################################################################################# + +declare function delay(msec: number): Promise; + +declare module core { + module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): IterableIterator; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: string): boolean; + function has(target: any, propertyKey: symbol): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; + } + + var Object: { + getPrototypeOf(o: any): any; + getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; + getOwnPropertyNames(o: any): string[]; + create(o: any, properties?: PropertyDescriptorMap): any; + defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; + defineProperties(o: any, properties: PropertyDescriptorMap): any; + seal(o: T): T; + freeze(o: T): T; + preventExtensions(o: T): T; + isSealed(o: any): boolean; + isFrozen(o: any): boolean; + isExtensible(o: any): boolean; + keys(o: any): string[]; + assign(target: any, ...sources: any[]): any; + is(value1: any, value2: any): boolean; + setPrototypeOf(o: any, proto: any): any; + getOwnPropertySymbols(o: any): symbol[]; + getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; + defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; + values(object: any): any[]; + entries(object: any): any[]; + getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; + isObject(value: any): boolean; + classof(value: any): string; + define(target: T, mixin: any): T; + make(proto: T, mixin?: any): T; + }; + + var Function: { + bind(target: Function, thisArg: any, ...argArray: any[]): any; + part(target: Function, ...args: any[]): any; + }; + + var Array: { + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + from(arrayLike: ArrayLike): Array; + from(iterable: Iterable): Array; + of(...items: T[]): Array; + push(array: ArrayLike, ...items: T[]): number; + pop(array: ArrayLike): T; + concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + join(array: ArrayLike, separator?: string): string; + reverse(array: ArrayLike): T[]; + shift(array: ArrayLike): T; + slice(array: ArrayLike, start?: number, end?: number): T[]; + sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; + splice(array: ArrayLike, start: number): T[]; + splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; + unshift(array: ArrayLike, ...items: T[]): number; + indexOf(array: ArrayLike, searchElement: T, fromIndex?: number): number; + lastIndexOf(array: ArrayLike, earchElement: T, fromIndex?: number): number; + every(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + some(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; + forEach(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; + map(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; + filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; + reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; + entries(array: ArrayLike): IterableIterator<[number, T]>; + keys(array: ArrayLike): IterableIterator; + values(array: ArrayLike): IterableIterator; + find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; + fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; + copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; + includes(array: ArrayLike, value: T, fromIndex?: number): boolean; + turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + }; + + var String: { + codePointAt(text: string, pos: number): number; + includes(text: string, searchString: string, position?: number): boolean; + endsWith(text: string, searchString: string, endPosition?: number): boolean; + repeat(text: string, count: number): string; + fromCodePoint(...codePoints: number[]): string; + raw(template: TemplateStringsArray, ...substitutions: any[]): string; + startsWith(text: string, searchString: string, position?: number): boolean; + at(text: string, index: number): string; + lpad(text: string, length: number, fillStr?: string): string; + rpad(text: string, length: number, fillStr?: string): string; + escapeHTML(text: string): string; + unescapeHTML(text: string): string; + }; + + var Date: { + now(): number; + toISOString(date: Date): string; + format(date: Date, template: string, locale?: string): string; + formatUTC(date: Date, template: string, locale?: string): string; + }; + + var Number: { + EPSILON: number; + isFinite(number: number): boolean; + isInteger(number: number): boolean; + isNaN(number: number): boolean; + isSafeInteger(number: number): boolean; + MAX_SAFE_INTEGER: number; + MIN_SAFE_INTEGER: number; + parseFloat(string: string): number; + parseInt(string: string, radix?: number): number; + clz32(x: number): number; + imul(x: number, y: number): number; + sign(x: number): number; + log10(x: number): number; + log2(x: number): number; + log1p(x: number): number; + expm1(x: number): number; + cosh(x: number): number; + sinh(x: number): number; + tanh(x: number): number; + acosh(x: number): number; + asinh(x: number): number; + atanh(x: number): number; + hypot(...values: number[]): number; + trunc(x: number): number; + fround(x: number): number; + cbrt(x: number): number; + random(lim?: number): number; + }; + + var Math: { + clz32(x: number): number; + imul(x: number, y: number): number; + sign(x: number): number; + log10(x: number): number; + log2(x: number): number; + log1p(x: number): number; + expm1(x: number): number; + cosh(x: number): number; + sinh(x: number): number; + tanh(x: number): number; + acosh(x: number): number; + asinh(x: number): number; + atanh(x: number): number; + hypot(...values: number[]): number; + trunc(x: number): number; + fround(x: number): number; + cbrt(x: number): number; + }; + + var RegExp: { + escape(str: string): string; + }; + + var Map: MapConstructor; + var Set: SetConstructor; + var WeakMap: WeakMapConstructor; + var WeakSet: WeakSetConstructor; + var Promise: PromiseConstructor; + var Symbol: SymbolConstructor; + var Dict: DictConstructor; + var global: any; + var log: Log; + var _: boolean; + + function setTimeout(handler: any, timeout?: any, ...args: any[]): number; + + function setInterval(handler: any, timeout?: any, ...args: any[]): number; + + function setImmediate(expression: any, ...args: any[]): number; + + function clearImmediate(handle: number): void; + + function $for(iterable: Iterable): $for; + + function isIterable(value: any): boolean; + + function getIterator(iterable: Iterable): Iterator; + + interface Locale { + weekdays: string; + months: string; + } + + function addLocale(lang: string, locale: Locale): typeof core; + + function locale(lang?: string): string; + + function delay(msec: number): Promise; +} + +declare module "core-js" { + export = core; +} +declare module "core-js/shim" { + export = core; +} +declare module "core-js/core" { + export = core; +} +declare module "core-js/core/$for" { + import $for = core.$for; + export = $for; +} +declare module "core-js/core/_" { + var _: typeof core._; + export = _; +} +declare module "core-js/core/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/core/date" { + var Date: typeof core.Date; + export = Date; +} +declare module "core-js/core/delay" { + var delay: typeof core.delay; + export = delay; +} +declare module "core-js/core/dict" { + var Dict: typeof core.Dict; + export = Dict; +} +declare module "core-js/core/function" { + var Function: typeof core.Function; + export = Function; +} +declare module "core-js/core/global" { + var global: typeof core.global; + export = global; +} +declare module "core-js/core/log" { + var log: typeof core.log; + export = log; +} +declare module "core-js/core/number" { + var Number: typeof core.Number; + export = Number; +} +declare module "core-js/core/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/core/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/fn/$for" { + import $for = core.$for; + export = $for; +} +declare module "core-js/fn/_" { + var _: typeof core._; + export = _; +} +declare module "core-js/fn/clear-immediate" { + var clearImmediate: typeof core.clearImmediate; + export = clearImmediate; +} +declare module "core-js/fn/delay" { + var delay: typeof core.delay; + export = delay; +} +declare module "core-js/fn/dict" { + var Dict: typeof core.Dict; + export = Dict; +} +declare module "core-js/fn/get-iterator" { + var getIterator: typeof core.getIterator; + export = getIterator; +} +declare module "core-js/fn/global" { + var global: typeof core.global; + export = global; +} +declare module "core-js/fn/is-iterable" { + var isIterable: typeof core.isIterable; + export = isIterable; +} +declare module "core-js/fn/log" { + var log: typeof core.log; + export = log; +} +declare module "core-js/fn/map" { + var Map: typeof core.Map; + export = Map; +} +declare module "core-js/fn/promise" { + var Promise: typeof core.Promise; + export = Promise; +} +declare module "core-js/fn/set" { + var Set: typeof core.Set; + export = Set; +} +declare module "core-js/fn/set-immediate" { + var setImmediate: typeof core.setImmediate; + export = setImmediate; +} +declare module "core-js/fn/set-interval" { + var setInterval: typeof core.setInterval; + export = setInterval; +} +declare module "core-js/fn/set-timeout" { + var setTimeout: typeof core.setTimeout; + export = setTimeout; +} +declare module "core-js/fn/weak-map" { + var WeakMap: typeof core.WeakMap; + export = WeakMap; +} +declare module "core-js/fn/weak-set" { + var WeakSet: typeof core.WeakSet; + export = WeakSet; +} +declare module "core-js/fn/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/fn/array/concat" { + var concat: typeof core.Array.concat; + export = concat; +} +declare module "core-js/fn/array/copy-within" { + var copyWithin: typeof core.Array.copyWithin; + export = copyWithin; +} +declare module "core-js/fn/array/entries" { + var entries: typeof core.Array.entries; + export = entries; +} +declare module "core-js/fn/array/every" { + var every: typeof core.Array.every; + export = every; +} +declare module "core-js/fn/array/fill" { + var fill: typeof core.Array.fill; + export = fill; +} +declare module "core-js/fn/array/filter" { + var filter: typeof core.Array.filter; + export = filter; +} +declare module "core-js/fn/array/find" { + var find: typeof core.Array.find; + export = find; +} +declare module "core-js/fn/array/find-index" { + var findIndex: typeof core.Array.findIndex; + export = findIndex; +} +declare module "core-js/fn/array/for-each" { + var forEach: typeof core.Array.forEach; + export = forEach; +} +declare module "core-js/fn/array/from" { + var from: typeof core.Array.from; + export = from; +} +declare module "core-js/fn/array/includes" { + var includes: typeof core.Array.includes; + export = includes; +} +declare module "core-js/fn/array/index-of" { + var indexOf: typeof core.Array.indexOf; + export = indexOf; +} +declare module "core-js/fn/array/join" { + var join: typeof core.Array.join; + export = join; +} +declare module "core-js/fn/array/keys" { + var keys: typeof core.Array.keys; + export = keys; +} +declare module "core-js/fn/array/last-index-of" { + var lastIndexOf: typeof core.Array.lastIndexOf; + export = lastIndexOf; +} +declare module "core-js/fn/array/map" { + var map: typeof core.Array.map; + export = map; +} +declare module "core-js/fn/array/of" { + var of: typeof core.Array.of; + export = of; +} +declare module "core-js/fn/array/pop" { + var pop: typeof core.Array.pop; + export = pop; +} +declare module "core-js/fn/array/push" { + var push: typeof core.Array.push; + export = push; +} +declare module "core-js/fn/array/reduce" { + var reduce: typeof core.Array.reduce; + export = reduce; +} +declare module "core-js/fn/array/reduce-right" { + var reduceRight: typeof core.Array.reduceRight; + export = reduceRight; +} +declare module "core-js/fn/array/reverse" { + var reverse: typeof core.Array.reverse; + export = reverse; +} +declare module "core-js/fn/array/shift" { + var shift: typeof core.Array.shift; + export = shift; +} +declare module "core-js/fn/array/slice" { + var slice: typeof core.Array.slice; + export = slice; +} +declare module "core-js/fn/array/some" { + var some: typeof core.Array.some; + export = some; +} +declare module "core-js/fn/array/sort" { + var sort: typeof core.Array.sort; + export = sort; +} +declare module "core-js/fn/array/splice" { + var splice: typeof core.Array.splice; + export = splice; +} +declare module "core-js/fn/array/turn" { + var turn: typeof core.Array.turn; + export = turn; +} +declare module "core-js/fn/array/unshift" { + var unshift: typeof core.Array.unshift; + export = unshift; +} +declare module "core-js/fn/array/values" { + var values: typeof core.Array.values; + export = values; +} +declare module "core-js/fn/date" { + var Date: typeof core.Date; + export = Date; +} +declare module "core-js/fn/date/add-locale" { + var addLocale: typeof core.addLocale; + export = addLocale; +} +declare module "core-js/fn/date/format" { + var format: typeof core.Date.format; + export = format; +} +declare module "core-js/fn/date/formatUTC" { + var formatUTC: typeof core.Date.formatUTC; + export = formatUTC; +} +declare module "core-js/fn/function" { + var Function: typeof core.Function; + export = Function; +} +declare module "core-js/fn/function/has-instance" { + var hasInstance: (value: any) => boolean; + export = hasInstance; +} +declare module "core-js/fn/function/name" +{ +} +declare module "core-js/fn/function/part" { + var part: typeof core.Function.part; + export = part; +} +declare module "core-js/fn/math" { + var Math: typeof core.Math; + export = Math; +} +declare module "core-js/fn/math/acosh" { + var acosh: typeof core.Math.acosh; + export = acosh; +} +declare module "core-js/fn/math/asinh" { + var asinh: typeof core.Math.asinh; + export = asinh; +} +declare module "core-js/fn/math/atanh" { + var atanh: typeof core.Math.atanh; + export = atanh; +} +declare module "core-js/fn/math/cbrt" { + var cbrt: typeof core.Math.cbrt; + export = cbrt; +} +declare module "core-js/fn/math/clz32" { + var clz32: typeof core.Math.clz32; + export = clz32; +} +declare module "core-js/fn/math/cosh" { + var cosh: typeof core.Math.cosh; + export = cosh; +} +declare module "core-js/fn/math/expm1" { + var expm1: typeof core.Math.expm1; + export = expm1; +} +declare module "core-js/fn/math/fround" { + var fround: typeof core.Math.fround; + export = fround; +} +declare module "core-js/fn/math/hypot" { + var hypot: typeof core.Math.hypot; + export = hypot; +} +declare module "core-js/fn/math/imul" { + var imul: typeof core.Math.imul; + export = imul; +} +declare module "core-js/fn/math/log10" { + var log10: typeof core.Math.log10; + export = log10; +} +declare module "core-js/fn/math/log1p" { + var log1p: typeof core.Math.log1p; + export = log1p; +} +declare module "core-js/fn/math/log2" { + var log2: typeof core.Math.log2; + export = log2; +} +declare module "core-js/fn/math/sign" { + var sign: typeof core.Math.sign; + export = sign; +} +declare module "core-js/fn/math/sinh" { + var sinh: typeof core.Math.sinh; + export = sinh; +} +declare module "core-js/fn/math/tanh" { + var tanh: typeof core.Math.tanh; + export = tanh; +} +declare module "core-js/fn/math/trunc" { + var trunc: typeof core.Math.trunc; + export = trunc; +} +declare module "core-js/fn/number" { + var Number: typeof core.Number; + export = Number; +} +declare module "core-js/fn/number/epsilon" { + var EPSILON: typeof core.Number.EPSILON; + export = EPSILON; +} +declare module "core-js/fn/number/is-finite" { + var isFinite: typeof core.Number.isFinite; + export = isFinite; +} +declare module "core-js/fn/number/is-integer" { + var isInteger: typeof core.Number.isInteger; + export = isInteger; +} +declare module "core-js/fn/number/is-nan" { + var isNaN: typeof core.Number.isNaN; + export = isNaN; +} +declare module "core-js/fn/number/is-safe-integer" { + var isSafeInteger: typeof core.Number.isSafeInteger; + export = isSafeInteger; +} +declare module "core-js/fn/number/max-safe-integer" { + var MAX_SAFE_INTEGER: typeof core.Number.MAX_SAFE_INTEGER; + export = MAX_SAFE_INTEGER; +} +declare module "core-js/fn/number/min-safe-interger" { + var MIN_SAFE_INTEGER: typeof core.Number.MIN_SAFE_INTEGER; + export = MIN_SAFE_INTEGER; +} +declare module "core-js/fn/number/parse-float" { + var parseFloat: typeof core.Number.parseFloat; + export = parseFloat; +} +declare module "core-js/fn/number/parse-int" { + var parseInt: typeof core.Number.parseInt; + export = parseInt; +} +declare module "core-js/fn/number/random" { + var random: typeof core.Number.random; + export = random; +} +declare module "core-js/fn/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/fn/object/assign" { + var assign: typeof core.Object.assign; + export = assign; +} +declare module "core-js/fn/object/classof" { + var classof: typeof core.Object.classof; + export = classof; +} +declare module "core-js/fn/object/create" { + var create: typeof core.Object.create; + export = create; +} +declare module "core-js/fn/object/define" { + var define: typeof core.Object.define; + export = define; +} +declare module "core-js/fn/object/define-properties" { + var defineProperties: typeof core.Object.defineProperties; + export = defineProperties; +} +declare module "core-js/fn/object/define-property" { + var defineProperty: typeof core.Object.defineProperty; + export = defineProperty; +} +declare module "core-js/fn/object/entries" { + var entries: typeof core.Object.entries; + export = entries; +} +declare module "core-js/fn/object/freeze" { + var freeze: typeof core.Object.freeze; + export = freeze; +} +declare module "core-js/fn/object/get-own-property-descriptor" { + var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; + export = getOwnPropertyDescriptor; +} +declare module "core-js/fn/object/get-own-property-descriptors" { + var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; + export = getOwnPropertyDescriptors; +} +declare module "core-js/fn/object/get-own-property-names" { + var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; + export = getOwnPropertyNames; +} +declare module "core-js/fn/object/get-own-property-symbols" { + var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; + export = getOwnPropertySymbols; +} +declare module "core-js/fn/object/get-prototype-of" { + var getPrototypeOf: typeof core.Object.getPrototypeOf; + export = getPrototypeOf; +} +declare module "core-js/fn/object/is" { + var is: typeof core.Object.is; + export = is; +} +declare module "core-js/fn/object/is-extensible" { + var isExtensible: typeof core.Object.isExtensible; + export = isExtensible; +} +declare module "core-js/fn/object/is-frozen" { + var isFrozen: typeof core.Object.isFrozen; + export = isFrozen; +} +declare module "core-js/fn/object/is-object" { + var isObject: typeof core.Object.isObject; + export = isObject; +} +declare module "core-js/fn/object/is-sealed" { + var isSealed: typeof core.Object.isSealed; + export = isSealed; +} +declare module "core-js/fn/object/keys" { + var keys: typeof core.Object.keys; + export = keys; +} +declare module "core-js/fn/object/make" { + var make: typeof core.Object.make; + export = make; +} +declare module "core-js/fn/object/prevent-extensions" { + var preventExtensions: typeof core.Object.preventExtensions; + export = preventExtensions; +} +declare module "core-js/fn/object/seal" { + var seal: typeof core.Object.seal; + export = seal; +} +declare module "core-js/fn/object/set-prototype-of" { + var setPrototypeOf: typeof core.Object.setPrototypeOf; + export = setPrototypeOf; +} +declare module "core-js/fn/object/values" { + var values: typeof core.Object.values; + export = values; +} +declare module "core-js/fn/reflect" { + var Reflect: typeof core.Reflect; + export = Reflect; +} +declare module "core-js/fn/reflect/apply" { + var apply: typeof core.Reflect.apply; + export = apply; +} +declare module "core-js/fn/reflect/construct" { + var construct: typeof core.Reflect.construct; + export = construct; +} +declare module "core-js/fn/reflect/define-property" { + var defineProperty: typeof core.Reflect.defineProperty; + export = defineProperty; +} +declare module "core-js/fn/reflect/delete-property" { + var deleteProperty: typeof core.Reflect.deleteProperty; + export = deleteProperty; +} +declare module "core-js/fn/reflect/enumerate" { + var enumerate: typeof core.Reflect.enumerate; + export = enumerate; +} +declare module "core-js/fn/reflect/get" { + var get: typeof core.Reflect.get; + export = get; +} +declare module "core-js/fn/reflect/get-own-property-descriptor" { + var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; + export = getOwnPropertyDescriptor; +} +declare module "core-js/fn/reflect/get-prototype-of" { + var getPrototypeOf: typeof core.Reflect.getPrototypeOf; + export = getPrototypeOf; +} +declare module "core-js/fn/reflect/has" { + var has: typeof core.Reflect.has; + export = has; +} +declare module "core-js/fn/reflect/is-extensible" { + var isExtensible: typeof core.Reflect.isExtensible; + export = isExtensible; +} +declare module "core-js/fn/reflect/own-keys" { + var ownKeys: typeof core.Reflect.ownKeys; + export = ownKeys; +} +declare module "core-js/fn/reflect/prevent-extensions" { + var preventExtensions: typeof core.Reflect.preventExtensions; + export = preventExtensions; +} +declare module "core-js/fn/reflect/set" { + var set: typeof core.Reflect.set; + export = set; +} +declare module "core-js/fn/reflect/set-prototype-of" { + var setPrototypeOf: typeof core.Reflect.setPrototypeOf; + export = setPrototypeOf; +} +declare module "core-js/fn/regexp" { + var RegExp: typeof core.RegExp; + export = RegExp; +} +declare module "core-js/fn/regexp/escape" { + var escape: typeof core.RegExp.escape; + export = escape; +} +declare module "core-js/fn/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/fn/string/at" { + var at: typeof core.String.at; + export = at; +} +declare module "core-js/fn/string/code-point-at" { + var codePointAt: typeof core.String.codePointAt; + export = codePointAt; +} +declare module "core-js/fn/string/ends-with" { + var endsWith: typeof core.String.endsWith; + export = endsWith; +} +declare module "core-js/fn/string/escape-html" { + var escapeHTML: typeof core.String.escapeHTML; + export = escapeHTML; +} +declare module "core-js/fn/string/from-code-point" { + var fromCodePoint: typeof core.String.fromCodePoint; + export = fromCodePoint; +} +declare module "core-js/fn/string/includes" { + var includes: typeof core.String.includes; + export = includes; +} +declare module "core-js/fn/string/lpad" { + var lpad: typeof core.String.lpad; + export = lpad; +} +declare module "core-js/fn/string/raw" { + var raw: typeof core.String.raw; + export = raw; +} +declare module "core-js/fn/string/repeat" { + var repeat: typeof core.String.repeat; + export = repeat; +} +declare module "core-js/fn/string/rpad" { + var rpad: typeof core.String.rpad; + export = rpad; +} +declare module "core-js/fn/string/starts-with" { + var startsWith: typeof core.String.startsWith; + export = startsWith; +} +declare module "core-js/fn/string/unescape-html" { + var unescapeHTML: typeof core.String.unescapeHTML; + export = unescapeHTML; +} +declare module "core-js/fn/symbol" { + var Symbol: typeof core.Symbol; + export = Symbol; +} +declare module "core-js/fn/symbol/for" { + var _for: typeof core.Symbol.for; + export = _for; +} +declare module "core-js/fn/symbol/has-instance" { + var hasInstance: typeof core.Symbol.hasInstance; + export = hasInstance; +} +declare module "core-js/fn/symbol/is-concat-spreadable" { + var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; + export = isConcatSpreadable; +} +declare module "core-js/fn/symbol/iterator" { + var iterator: typeof core.Symbol.iterator; + export = iterator; +} +declare module "core-js/fn/symbol/key-for" { + var keyFor: typeof core.Symbol.keyFor; + export = keyFor; +} +declare module "core-js/fn/symbol/match" { + var match: typeof core.Symbol.match; + export = match; +} +declare module "core-js/fn/symbol/replace" { + var replace: typeof core.Symbol.replace; + export = replace; +} +declare module "core-js/fn/symbol/search" { + var search: typeof core.Symbol.search; + export = search; +} +declare module "core-js/fn/symbol/species" { + var species: typeof core.Symbol.species; + export = species; +} +declare module "core-js/fn/symbol/split" { + var split: typeof core.Symbol.split; + export = split; +} +declare module "core-js/fn/symbol/to-primitive" { + var toPrimitive: typeof core.Symbol.toPrimitive; + export = toPrimitive; +} +declare module "core-js/fn/symbol/to-string-tag" { + var toStringTag: typeof core.Symbol.toStringTag; + export = toStringTag; +} +declare module "core-js/fn/symbol/unscopables" { + var unscopables: typeof core.Symbol.unscopables; + export = unscopables; +} +declare module "core-js/es5" { + export = core; +} +declare module "core-js/es6" { + export = core; +} +declare module "core-js/es6/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/es6/function" { + var Function: typeof core.Function; + export = Function; +} +declare module "core-js/es6/map" { + var Map: typeof core.Map; + export = Map; +} +declare module "core-js/es6/math" { + var Math: typeof core.Math; + export = Math; +} +declare module "core-js/es6/number" { + var Number: typeof core.Number; + export = Number; +} +declare module "core-js/es6/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/es6/promise" { + var Promise: typeof core.Promise; + export = Promise; +} +declare module "core-js/es6/reflect" { + var Reflect: typeof core.Reflect; + export = Reflect; +} +declare module "core-js/es6/regexp" { + var RegExp: typeof core.RegExp; + export = RegExp; +} +declare module "core-js/es6/set" { + var Set: typeof core.Set; + export = Set; +} +declare module "core-js/es6/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/es6/symbol" { + var Symbol: typeof core.Symbol; + export = Symbol; +} +declare module "core-js/es6/weak-map" { + var WeakMap: typeof core.WeakMap; + export = WeakMap; +} +declare module "core-js/es6/weak-set" { + var WeakSet: typeof core.WeakSet; + export = WeakSet; +} +declare module "core-js/es7" { + export = core; +} +declare module "core-js/es7/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/es7/map" { + var Map: typeof core.Map; + export = Map; +} +declare module "core-js/es7/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/es7/regexp" { + var RegExp: typeof core.RegExp; + export = RegExp; +} +declare module "core-js/es7/set" { + var Set: typeof core.Set; + export = Set; +} +declare module "core-js/es7/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/js" { + export = core; +} +declare module "core-js/js/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/web" { + export = core; +} +declare module "core-js/web/dom" { + export = core; +} +declare module "core-js/web/immediate" { + export = core; +} +declare module "core-js/web/timers" { + export = core; +} +declare module "core-js/libary" { + export = core; +} +declare module "core-js/libary/shim" { + export = core; +} +declare module "core-js/libary/core" { + export = core; +} +declare module "core-js/libary/core/$for" { + import $for = core.$for; + export = $for; +} +declare module "core-js/libary/core/_" { + var _: typeof core._; + export = _; +} +declare module "core-js/libary/core/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/libary/core/date" { + var Date: typeof core.Date; + export = Date; +} +declare module "core-js/libary/core/delay" { + var delay: typeof core.delay; + export = delay; +} +declare module "core-js/libary/core/dict" { + var Dict: typeof core.Dict; + export = Dict; +} +declare module "core-js/libary/core/function" { + var Function: typeof core.Function; + export = Function; +} +declare module "core-js/libary/core/global" { + var global: typeof core.global; + export = global; +} +declare module "core-js/libary/core/log" { + var log: typeof core.log; + export = log; +} +declare module "core-js/libary/core/number" { + var Number: typeof core.Number; + export = Number; +} +declare module "core-js/libary/core/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/libary/core/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/libary/fn/$for" { + import $for = core.$for; + export = $for; +} +declare module "core-js/libary/fn/_" { + var _: typeof core._; + export = _; +} +declare module "core-js/libary/fn/clear-immediate" { + var clearImmediate: typeof core.clearImmediate; + export = clearImmediate; +} +declare module "core-js/libary/fn/delay" { + var delay: typeof core.delay; + export = delay; +} +declare module "core-js/libary/fn/dict" { + var Dict: typeof core.Dict; + export = Dict; +} +declare module "core-js/libary/fn/get-iterator" { + var getIterator: typeof core.getIterator; + export = getIterator; +} +declare module "core-js/libary/fn/global" { + var global: typeof core.global; + export = global; +} +declare module "core-js/libary/fn/is-iterable" { + var isIterable: typeof core.isIterable; + export = isIterable; +} +declare module "core-js/libary/fn/log" { + var log: typeof core.log; + export = log; +} +declare module "core-js/libary/fn/map" { + var Map: typeof core.Map; + export = Map; +} +declare module "core-js/libary/fn/promise" { + var Promise: typeof core.Promise; + export = Promise; +} +declare module "core-js/libary/fn/set" { + var Set: typeof core.Set; + export = Set; +} +declare module "core-js/libary/fn/set-immediate" { + var setImmediate: typeof core.setImmediate; + export = setImmediate; +} +declare module "core-js/libary/fn/set-interval" { + var setInterval: typeof core.setInterval; + export = setInterval; +} +declare module "core-js/libary/fn/set-timeout" { + var setTimeout: typeof core.setTimeout; + export = setTimeout; +} +declare module "core-js/libary/fn/weak-map" { + var WeakMap: typeof core.WeakMap; + export = WeakMap; +} +declare module "core-js/libary/fn/weak-set" { + var WeakSet: typeof core.WeakSet; + export = WeakSet; +} +declare module "core-js/libary/fn/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/libary/fn/array/concat" { + var concat: typeof core.Array.concat; + export = concat; +} +declare module "core-js/libary/fn/array/copy-within" { + var copyWithin: typeof core.Array.copyWithin; + export = copyWithin; +} +declare module "core-js/libary/fn/array/entries" { + var entries: typeof core.Array.entries; + export = entries; +} +declare module "core-js/libary/fn/array/every" { + var every: typeof core.Array.every; + export = every; +} +declare module "core-js/libary/fn/array/fill" { + var fill: typeof core.Array.fill; + export = fill; +} +declare module "core-js/libary/fn/array/filter" { + var filter: typeof core.Array.filter; + export = filter; +} +declare module "core-js/libary/fn/array/find" { + var find: typeof core.Array.find; + export = find; +} +declare module "core-js/libary/fn/array/find-index" { + var findIndex: typeof core.Array.findIndex; + export = findIndex; +} +declare module "core-js/libary/fn/array/for-each" { + var forEach: typeof core.Array.forEach; + export = forEach; +} +declare module "core-js/libary/fn/array/from" { + var from: typeof core.Array.from; + export = from; +} +declare module "core-js/libary/fn/array/includes" { + var includes: typeof core.Array.includes; + export = includes; +} +declare module "core-js/libary/fn/array/index-of" { + var indexOf: typeof core.Array.indexOf; + export = indexOf; +} +declare module "core-js/libary/fn/array/join" { + var join: typeof core.Array.join; + export = join; +} +declare module "core-js/libary/fn/array/keys" { + var keys: typeof core.Array.keys; + export = keys; +} +declare module "core-js/libary/fn/array/last-index-of" { + var lastIndexOf: typeof core.Array.lastIndexOf; + export = lastIndexOf; +} +declare module "core-js/libary/fn/array/map" { + var map: typeof core.Array.map; + export = map; +} +declare module "core-js/libary/fn/array/of" { + var of: typeof core.Array.of; + export = of; +} +declare module "core-js/libary/fn/array/pop" { + var pop: typeof core.Array.pop; + export = pop; +} +declare module "core-js/libary/fn/array/push" { + var push: typeof core.Array.push; + export = push; +} +declare module "core-js/libary/fn/array/reduce" { + var reduce: typeof core.Array.reduce; + export = reduce; +} +declare module "core-js/libary/fn/array/reduce-right" { + var reduceRight: typeof core.Array.reduceRight; + export = reduceRight; +} +declare module "core-js/libary/fn/array/reverse" { + var reverse: typeof core.Array.reverse; + export = reverse; +} +declare module "core-js/libary/fn/array/shift" { + var shift: typeof core.Array.shift; + export = shift; +} +declare module "core-js/libary/fn/array/slice" { + var slice: typeof core.Array.slice; + export = slice; +} +declare module "core-js/libary/fn/array/some" { + var some: typeof core.Array.some; + export = some; +} +declare module "core-js/libary/fn/array/sort" { + var sort: typeof core.Array.sort; + export = sort; +} +declare module "core-js/libary/fn/array/splice" { + var splice: typeof core.Array.splice; + export = splice; +} +declare module "core-js/libary/fn/array/turn" { + var turn: typeof core.Array.turn; + export = turn; +} +declare module "core-js/libary/fn/array/unshift" { + var unshift: typeof core.Array.unshift; + export = unshift; +} +declare module "core-js/libary/fn/array/values" { + var values: typeof core.Array.values; + export = values; +} +declare module "core-js/libary/fn/date" { + var Date: typeof core.Date; + export = Date; +} +declare module "core-js/libary/fn/date/add-locale" { + var addLocale: typeof core.addLocale; + export = addLocale; +} +declare module "core-js/libary/fn/date/format" { + var format: typeof core.Date.format; + export = format; +} +declare module "core-js/libary/fn/date/formatUTC" { + var formatUTC: typeof core.Date.formatUTC; + export = formatUTC; +} +declare module "core-js/libary/fn/function" { + var Function: typeof core.Function; + export = Function; +} +declare module "core-js/libary/fn/function/has-instance" { + var hasInstance: (value: any) => boolean; + export = hasInstance; +} +declare module "core-js/libary/fn/function/name" { +} +declare module "core-js/libary/fn/function/part" { + var part: typeof core.Function.part; + export = part; +} +declare module "core-js/libary/fn/math" { + var Math: typeof core.Math; + export = Math; +} +declare module "core-js/libary/fn/math/acosh" { + var acosh: typeof core.Math.acosh; + export = acosh; +} +declare module "core-js/libary/fn/math/asinh" { + var asinh: typeof core.Math.asinh; + export = asinh; +} +declare module "core-js/libary/fn/math/atanh" { + var atanh: typeof core.Math.atanh; + export = atanh; +} +declare module "core-js/libary/fn/math/cbrt" { + var cbrt: typeof core.Math.cbrt; + export = cbrt; +} +declare module "core-js/libary/fn/math/clz32" { + var clz32: typeof core.Math.clz32; + export = clz32; +} +declare module "core-js/libary/fn/math/cosh" { + var cosh: typeof core.Math.cosh; + export = cosh; +} +declare module "core-js/libary/fn/math/expm1" { + var expm1: typeof core.Math.expm1; + export = expm1; +} +declare module "core-js/libary/fn/math/fround" { + var fround: typeof core.Math.fround; + export = fround; +} +declare module "core-js/libary/fn/math/hypot" { + var hypot: typeof core.Math.hypot; + export = hypot; +} +declare module "core-js/libary/fn/math/imul" { + var imul: typeof core.Math.imul; + export = imul; +} +declare module "core-js/libary/fn/math/log10" { + var log10: typeof core.Math.log10; + export = log10; +} +declare module "core-js/libary/fn/math/log1p" { + var log1p: typeof core.Math.log1p; + export = log1p; +} +declare module "core-js/libary/fn/math/log2" { + var log2: typeof core.Math.log2; + export = log2; +} +declare module "core-js/libary/fn/math/sign" { + var sign: typeof core.Math.sign; + export = sign; +} +declare module "core-js/libary/fn/math/sinh" { + var sinh: typeof core.Math.sinh; + export = sinh; +} +declare module "core-js/libary/fn/math/tanh" { + var tanh: typeof core.Math.tanh; + export = tanh; +} +declare module "core-js/libary/fn/math/trunc" { + var trunc: typeof core.Math.trunc; + export = trunc; +} +declare module "core-js/libary/fn/number" { + var Number: typeof core.Number; + export = Number; +} +declare module "core-js/libary/fn/number/epsilon" { + var EPSILON: typeof core.Number.EPSILON; + export = EPSILON; +} +declare module "core-js/libary/fn/number/is-finite" { + var isFinite: typeof core.Number.isFinite; + export = isFinite; +} +declare module "core-js/libary/fn/number/is-integer" { + var isInteger: typeof core.Number.isInteger; + export = isInteger; +} +declare module "core-js/libary/fn/number/is-nan" { + var isNaN: typeof core.Number.isNaN; + export = isNaN; +} +declare module "core-js/libary/fn/number/is-safe-integer" { + var isSafeInteger: typeof core.Number.isSafeInteger; + export = isSafeInteger; +} +declare module "core-js/libary/fn/number/max-safe-integer" { + var MAX_SAFE_INTEGER: typeof core.Number.MAX_SAFE_INTEGER; + export = MAX_SAFE_INTEGER; +} +declare module "core-js/libary/fn/number/min-safe-interger" { + var MIN_SAFE_INTEGER: typeof core.Number.MIN_SAFE_INTEGER; + export = MIN_SAFE_INTEGER; +} +declare module "core-js/libary/fn/number/parse-float" { + var parseFloat: typeof core.Number.parseFloat; + export = parseFloat; +} +declare module "core-js/libary/fn/number/parse-int" { + var parseInt: typeof core.Number.parseInt; + export = parseInt; +} +declare module "core-js/libary/fn/number/random" { + var random: typeof core.Number.random; + export = random; +} +declare module "core-js/libary/fn/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/libary/fn/object/assign" { + var assign: typeof core.Object.assign; + export = assign; +} +declare module "core-js/libary/fn/object/classof" { + var classof: typeof core.Object.classof; + export = classof; +} +declare module "core-js/libary/fn/object/create" { + var create: typeof core.Object.create; + export = create; +} +declare module "core-js/libary/fn/object/define" { + var define: typeof core.Object.define; + export = define; +} +declare module "core-js/libary/fn/object/define-properties" { + var defineProperties: typeof core.Object.defineProperties; + export = defineProperties; +} +declare module "core-js/libary/fn/object/define-property" { + var defineProperty: typeof core.Object.defineProperty; + export = defineProperty; +} +declare module "core-js/libary/fn/object/entries" { + var entries: typeof core.Object.entries; + export = entries; +} +declare module "core-js/libary/fn/object/freeze" { + var freeze: typeof core.Object.freeze; + export = freeze; +} +declare module "core-js/libary/fn/object/get-own-property-descriptor" { + var getOwnPropertyDescriptor: typeof core.Object.getOwnPropertyDescriptor; + export = getOwnPropertyDescriptor; +} +declare module "core-js/libary/fn/object/get-own-property-descriptors" { + var getOwnPropertyDescriptors: typeof core.Object.getOwnPropertyDescriptors; + export = getOwnPropertyDescriptors; +} +declare module "core-js/libary/fn/object/get-own-property-names" { + var getOwnPropertyNames: typeof core.Object.getOwnPropertyNames; + export = getOwnPropertyNames; +} +declare module "core-js/libary/fn/object/get-own-property-symbols" { + var getOwnPropertySymbols: typeof core.Object.getOwnPropertySymbols; + export = getOwnPropertySymbols; +} +declare module "core-js/libary/fn/object/get-prototype-of" { + var getPrototypeOf: typeof core.Object.getPrototypeOf; + export = getPrototypeOf; +} +declare module "core-js/libary/fn/object/is" { + var is: typeof core.Object.is; + export = is; +} +declare module "core-js/libary/fn/object/is-extensible" { + var isExtensible: typeof core.Object.isExtensible; + export = isExtensible; +} +declare module "core-js/libary/fn/object/is-frozen" { + var isFrozen: typeof core.Object.isFrozen; + export = isFrozen; +} +declare module "core-js/libary/fn/object/is-object" { + var isObject: typeof core.Object.isObject; + export = isObject; +} +declare module "core-js/libary/fn/object/is-sealed" { + var isSealed: typeof core.Object.isSealed; + export = isSealed; +} +declare module "core-js/libary/fn/object/keys" { + var keys: typeof core.Object.keys; + export = keys; +} +declare module "core-js/libary/fn/object/make" { + var make: typeof core.Object.make; + export = make; +} +declare module "core-js/libary/fn/object/prevent-extensions" { + var preventExtensions: typeof core.Object.preventExtensions; + export = preventExtensions; +} +declare module "core-js/libary/fn/object/seal" { + var seal: typeof core.Object.seal; + export = seal; +} +declare module "core-js/libary/fn/object/set-prototype-of" { + var setPrototypeOf: typeof core.Object.setPrototypeOf; + export = setPrototypeOf; +} +declare module "core-js/libary/fn/object/values" { + var values: typeof core.Object.values; + export = values; +} +declare module "core-js/libary/fn/reflect" { + var Reflect: typeof core.Reflect; + export = Reflect; +} +declare module "core-js/libary/fn/reflect/apply" { + var apply: typeof core.Reflect.apply; + export = apply; +} +declare module "core-js/libary/fn/reflect/construct" { + var construct: typeof core.Reflect.construct; + export = construct; +} +declare module "core-js/libary/fn/reflect/define-property" { + var defineProperty: typeof core.Reflect.defineProperty; + export = defineProperty; +} +declare module "core-js/libary/fn/reflect/delete-property" { + var deleteProperty: typeof core.Reflect.deleteProperty; + export = deleteProperty; +} +declare module "core-js/libary/fn/reflect/enumerate" { + var enumerate: typeof core.Reflect.enumerate; + export = enumerate; +} +declare module "core-js/libary/fn/reflect/get" { + var get: typeof core.Reflect.get; + export = get; +} +declare module "core-js/libary/fn/reflect/get-own-property-descriptor" { + var getOwnPropertyDescriptor: typeof core.Reflect.getOwnPropertyDescriptor; + export = getOwnPropertyDescriptor; +} +declare module "core-js/libary/fn/reflect/get-prototype-of" { + var getPrototypeOf: typeof core.Reflect.getPrototypeOf; + export = getPrototypeOf; +} +declare module "core-js/libary/fn/reflect/has" { + var has: typeof core.Reflect.has; + export = has; +} +declare module "core-js/libary/fn/reflect/is-extensible" { + var isExtensible: typeof core.Reflect.isExtensible; + export = isExtensible; +} +declare module "core-js/libary/fn/reflect/own-keys" { + var ownKeys: typeof core.Reflect.ownKeys; + export = ownKeys; +} +declare module "core-js/libary/fn/reflect/prevent-extensions" { + var preventExtensions: typeof core.Reflect.preventExtensions; + export = preventExtensions; +} +declare module "core-js/libary/fn/reflect/set" { + var set: typeof core.Reflect.set; + export = set; +} +declare module "core-js/libary/fn/reflect/set-prototype-of" { + var setPrototypeOf: typeof core.Reflect.setPrototypeOf; + export = setPrototypeOf; +} +declare module "core-js/libary/fn/regexp" { + var RegExp: typeof core.RegExp; + export = RegExp; +} +declare module "core-js/libary/fn/regexp/escape" { + var escape: typeof core.RegExp.escape; + export = escape; +} +declare module "core-js/libary/fn/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/libary/fn/string/at" { + var at: typeof core.String.at; + export = at; +} +declare module "core-js/libary/fn/string/code-point-at" { + var codePointAt: typeof core.String.codePointAt; + export = codePointAt; +} +declare module "core-js/libary/fn/string/ends-with" { + var endsWith: typeof core.String.endsWith; + export = endsWith; +} +declare module "core-js/libary/fn/string/escape-html" { + var escapeHTML: typeof core.String.escapeHTML; + export = escapeHTML; +} +declare module "core-js/libary/fn/string/from-code-point" { + var fromCodePoint: typeof core.String.fromCodePoint; + export = fromCodePoint; +} +declare module "core-js/libary/fn/string/includes" { + var includes: typeof core.String.includes; + export = includes; +} +declare module "core-js/libary/fn/string/lpad" { + var lpad: typeof core.String.lpad; + export = lpad; +} +declare module "core-js/libary/fn/string/raw" { + var raw: typeof core.String.raw; + export = raw; +} +declare module "core-js/libary/fn/string/repeat" { + var repeat: typeof core.String.repeat; + export = repeat; +} +declare module "core-js/libary/fn/string/rpad" { + var rpad: typeof core.String.rpad; + export = rpad; +} +declare module "core-js/libary/fn/string/starts-with" { + var startsWith: typeof core.String.startsWith; + export = startsWith; +} +declare module "core-js/libary/fn/string/unescape-html" { + var unescapeHTML: typeof core.String.unescapeHTML; + export = unescapeHTML; +} +declare module "core-js/libary/fn/symbol" { + var Symbol: typeof core.Symbol; + export = Symbol; +} +declare module "core-js/libary/fn/symbol/for" { + var _for: typeof core.Symbol.for; + export = _for; +} +declare module "core-js/libary/fn/symbol/has-instance" { + var hasInstance: typeof core.Symbol.hasInstance; + export = hasInstance; +} +declare module "core-js/libary/fn/symbol/is-concat-spreadable" { + var isConcatSpreadable: typeof core.Symbol.isConcatSpreadable; + export = isConcatSpreadable; +} +declare module "core-js/libary/fn/symbol/iterator" { + var iterator: typeof core.Symbol.iterator; + export = iterator; +} +declare module "core-js/libary/fn/symbol/key-for" { + var keyFor: typeof core.Symbol.keyFor; + export = keyFor; +} +declare module "core-js/libary/fn/symbol/match" { + var match: typeof core.Symbol.match; + export = match; +} +declare module "core-js/libary/fn/symbol/replace" { + var replace: typeof core.Symbol.replace; + export = replace; +} +declare module "core-js/libary/fn/symbol/search" { + var search: typeof core.Symbol.search; + export = search; +} +declare module "core-js/libary/fn/symbol/species" { + var species: typeof core.Symbol.species; + export = species; +} +declare module "core-js/libary/fn/symbol/split" { + var split: typeof core.Symbol.split; + export = split; +} +declare module "core-js/libary/fn/symbol/to-primitive" { + var toPrimitive: typeof core.Symbol.toPrimitive; + export = toPrimitive; +} +declare module "core-js/libary/fn/symbol/to-string-tag" { + var toStringTag: typeof core.Symbol.toStringTag; + export = toStringTag; +} +declare module "core-js/libary/fn/symbol/unscopables" { + var unscopables: typeof core.Symbol.unscopables; + export = unscopables; +} +declare module "core-js/libary/es5" { + export = core; +} +declare module "core-js/libary/es6" { + export = core; +} +declare module "core-js/libary/es6/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/libary/es6/function" { + var Function: typeof core.Function; + export = Function; +} +declare module "core-js/libary/es6/map" { + var Map: typeof core.Map; + export = Map; +} +declare module "core-js/libary/es6/math" { + var Math: typeof core.Math; + export = Math; +} +declare module "core-js/libary/es6/number" { + var Number: typeof core.Number; + export = Number; +} +declare module "core-js/libary/es6/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/libary/es6/promise" { + var Promise: typeof core.Promise; + export = Promise; +} +declare module "core-js/libary/es6/reflect" { + var Reflect: typeof core.Reflect; + export = Reflect; +} +declare module "core-js/libary/es6/regexp" { + var RegExp: typeof core.RegExp; + export = RegExp; +} +declare module "core-js/libary/es6/set" { + var Set: typeof core.Set; + export = Set; +} +declare module "core-js/libary/es6/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/libary/es6/symbol" { + var Symbol: typeof core.Symbol; + export = Symbol; +} +declare module "core-js/libary/es6/weak-map" { + var WeakMap: typeof core.WeakMap; + export = WeakMap; +} +declare module "core-js/libary/es6/weak-set" { + var WeakSet: typeof core.WeakSet; + export = WeakSet; +} +declare module "core-js/libary/es7" { + export = core; +} +declare module "core-js/libary/es7/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/libary/es7/map" { + var Map: typeof core.Map; + export = Map; +} +declare module "core-js/libary/es7/object" { + var Object: typeof core.Object; + export = Object; +} +declare module "core-js/libary/es7/regexp" { + var RegExp: typeof core.RegExp; + export = RegExp; +} +declare module "core-js/libary/es7/set" { + var Set: typeof core.Set; + export = Set; +} +declare module "core-js/libary/es7/string" { + var String: typeof core.String; + export = String; +} +declare module "core-js/libary/js" { + export = core; +} +declare module "core-js/libary/js/array" { + var Array: typeof core.Array; + export = Array; +} +declare module "core-js/libary/web" { + export = core; +} +declare module "core-js/libary/web/dom" { + export = core; +} +declare module "core-js/libary/web/immediate" { + export = core; +} +declare module "core-js/libary/web/timers" { + export = core; +} From 5ea1c5b513fee483cd2ee02e3c93d4d1b62cad2d Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 4 May 2015 15:11:12 -0500 Subject: [PATCH 0024/2220] Add type declarations for unorm: both importable module and ambient var --- unorm/unorm.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 unorm/unorm.d.ts diff --git a/unorm/unorm.d.ts b/unorm/unorm.d.ts new file mode 100644 index 0000000000..9f96fcef05 --- /dev/null +++ b/unorm/unorm.d.ts @@ -0,0 +1,14 @@ +declare module unorm { + interface Static { + nfd(str: string): string; + nfkd(str: string): string; + nfc(str: string): string; + nfkc(str: string): string; + } +} + +declare var unorm: unorm.Static; + +declare module "unorm" { + export = unorm; +} From dde696d52e8a992a060db9e7fca64652984aa803 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 4 May 2015 13:55:19 -0500 Subject: [PATCH 0025/2220] Add virtual-dom type declarations, based on virtual-dom's docs.jsig --- virtual-dom/virtual-dom.d.ts | 121 +++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 virtual-dom/virtual-dom.d.ts diff --git a/virtual-dom/virtual-dom.d.ts b/virtual-dom/virtual-dom.d.ts new file mode 100644 index 0000000000..70166515f8 --- /dev/null +++ b/virtual-dom/virtual-dom.d.ts @@ -0,0 +1,121 @@ +declare module VirtualDOM { + interface VHook { + hook(node: Element, propertyName: string): void; + unhook(node: Element, propertyName: string): void; + } + + type EventHandler = (...args: any[]) => void; + + interface VProperties { + attributes?: {[index: string]: string}; + /** + I would like to use {[index: string]: string}, but then we couldn't use an + object literal when setting the styles, since TypeScript doesn't seem to + infer that {'fontSize': string; 'fontWeight': string;} is actually quite + assignable to the type { [index: string]: string; } + */ + style?: any; + /** + The relaxation on `style` above is the reason why we need `any` as an option + on the indexer type. + */ + [index: string]: any | string | boolean | number | VHook | EventHandler | {[index: string]: string | boolean | number}; + } + + interface VNode { + tagName: string; + properties: VProperties; + children: VTree[]; + key?: string; + namespace?: string; + count: number; + hasWidgets: boolean; + hasThunks: boolean; + hooks: any[]; + descendantHooks: any[]; + version: string; + type: string; // 'VirtualNode' + } + + interface VText { + text: string; + new (text: any); + version: string; + type: string; // 'VirtualText' + } + + interface Widget { + type: string; // 'Widget' + init(): Element; + update(previous: Widget, domNode: Element): void; + destroy(node: Element): void; + } + + interface Thunk { + type: string; // 'Thunk' + vnode: VTree; + render(previous: VTree): VTree; + } + + type VTree = VText | VNode | Widget | Thunk; + + // enum VPatch { + // NONE = 0, + // VTEXT = 1, + // VNODE = 2, + // WIDGET = 3, + // PROPS = 4, + // ORDER = 5, + // INSERT = 6, + // REMOVE = 7, + // THUNK = 8 + // } + interface VPatch { + vNode: VNode, + patch: any; + new(type: number, vNode: VNode, patch: any): VPatch; + version: string; + /** + type is set to 'VirtualPatch' on the prototype, but overridden in the + constructor with a number. + */ + type: number; + } + + interface createProperties extends VProperties { + key?: string; + namespace?: string; + } + type createChildren = Array; + + /** + create() calls either document.createElement() or document.createElementNS(), + for which the common denominator is Element (not HTMLElement). + */ + function create(vnode: VText, opts?: {document?: Document, warn?: boolean}): Text; + function create(vnode: VNode | Widget | Thunk, opts?: {document?: Document, warn?: boolean}): Element; + function h(tagName: string, properties: createProperties, ...children: createChildren): VNode; + function h(tagName: string, ...children: createChildren): VNode; + function diff(left: VTree, right: VTree): VPatch[]; + /** + patch() usually just returns rootNode after doing stuff to it, so we want + to preserve that type (though it will usually be just Element). + */ + function patch(rootNode: T, patches: VPatch[], renderOptions?: any): T; +} + +declare module "virtual-dom/h" { + export = VirtualDOM.h; +} +declare module "virtual-dom/create-element" { + export = VirtualDOM.create; +} +declare module "virtual-dom/diff" { + export = VirtualDOM.diff; +} +declare module "virtual-dom/patch" { + export = VirtualDOM.patch; +} +declare module "virtual-dom" { + export = VirtualDOM; +} From 52444b5afa70f89d846fa4e0d8671bc90fc169b7 Mon Sep 17 00:00:00 2001 From: Ralf Kruse Date: Sun, 10 May 2015 02:23:43 +0200 Subject: [PATCH 0026/2220] getElementByPoint returns Snap.Element --- snapsvg/snapsvg.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapsvg/snapsvg.d.ts b/snapsvg/snapsvg.d.ts index a900680bc6..cce6e67503 100644 --- a/snapsvg/snapsvg.d.ts +++ b/snapsvg/snapsvg.d.ts @@ -43,7 +43,7 @@ declare module Snap { export function ajax(url:string,callback:Function,scope?:Object):XMLHttpRequest; export function format(token:string,json:Object):string; export function fragment(varargs:any):Fragment; - export function getElementByPoint(x:number,y:number):Object; + export function getElementByPoint(x:number,y:number):Snap.Element; export function is(o:any,type:string):boolean; export function load(url:string,callback:Function,scope?:Object):void; export function plugin(f:Function):void; From bfcc6ddbc0c3d3761d7935f60cf46bf99a24ff1f Mon Sep 17 00:00:00 2001 From: Ralf Kruse Date: Sun, 10 May 2015 02:24:05 +0200 Subject: [PATCH 0027/2220] Snap.Element has an id property --- snapsvg/snapsvg.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/snapsvg/snapsvg.d.ts b/snapsvg/snapsvg.d.ts index cce6e67503..c7add11655 100644 --- a/snapsvg/snapsvg.d.ts +++ b/snapsvg/snapsvg.d.ts @@ -131,6 +131,7 @@ declare module Snap { getSubpath(from:number,to:number):string; getTotalLength():number; hasClass(value:string):boolean; + id:string; inAnim():Object; innerSVG():string; insertAfter(el:Snap.Element):Snap.Element; From b29697846d7c2469b63a5ae4e2ba5cb968aa8d4c Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Mon, 11 May 2015 09:19:22 -0400 Subject: [PATCH 0028/2220] Adding missing property & other minor changes * the `permissionLevel` property was missing * `needsPermission` and `isSupported` are properties, not functions * Spelling fixes in comments --- notifyjs/notifyjs.d.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/notifyjs/notifyjs.d.ts b/notifyjs/notifyjs.d.ts index 0cff4e0c52..5fe321efaf 100644 --- a/notifyjs/notifyjs.d.ts +++ b/notifyjs/notifyjs.d.ts @@ -10,20 +10,25 @@ declare var Notify: { * Check is permission is needed for the user to receive notifications. * @return true : needs permission, false : does not need */ - needsPermission() : boolean; + needsPermission : boolean; /** * Asks the user for permission to display notifications - * @param onPermissionGrantedCallback A callback for permmision is granted. - * @param onPermissionDeniedCallback A callback for permmision is denied. + * @param onPermissionGrantedCallback A callback for permission is granted. + * @param onPermissionDeniedCallback A callback for permission is denied. */ requestPermission(onPermissionGrantedCallback?: ()=> any, onPermissionDeniedCallback? : ()=> any) : void; /** * return true if the browser supports HTML5 Notification - * @param true : the browser supports HTML5 Notification, false ; the browswer does not supports HTML5 Notification. + * @param true : the browser supports HTML5 Notification, false ; the browser does not supports HTML5 Notification. */ - isSupported() : boolean; + isSupported: boolean; + + /** + * shows the user's current permission level (granted, denied or default), returns null if notifications are not supported. + */ + permissionLevel: string; } declare module notifyjs { From 139d9e9386d4501cb9768ad8c8942079a1a0861e Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 11 May 2015 08:18:16 -0700 Subject: [PATCH 0029/2220] Update core-js-tests.ts --- core-js/core-js-tests.ts | Bin 45732 -> 22819 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts index 4b9f6f9d7c63ced3b95e8f3b50ae2ea81e9fae29..8a4ec2c0b83c0c1c1299584a6cdeb8fa9eecc456 100644 GIT binary patch literal 22819 zcmc&+{camK693-7DO0hC?p7q-4n-dqvTD$(iBIaAr6hlKStz|FgThn>?@7L{+L7sbrotH!r>! zm6aNPsMB%U)ZZk#FSob0xALM<)g%MVd5OQ1-;*!V@{p9TGgBmsRUF|1t)%DSrxqR2RGYoS(yDF#BqV|)cswyk_9A^z$4)I@U_^2T1 zc~#C;)!hE947YRA2s-G00?AE#V`LrUM}`$*s3p~dX>UogXl@oulf z94NG$cHs^RNCJI#+b>w_+5lpQ3sB z$k7?LxOdF7ffJhxhK`tCi{f}eglngFIr9$C(n)tHOuDv2|l0eS(j0b6t%*57pn1X`LoJC0%bq>MgO6Dt*aPh z0t2oF3yAz_;`k1I_+vQTYMJ=d>&t;m7%?v1AVM;WOrR6IU%j%aR7+_{-g5 z|Jz$w&A)xhe|UtWS0@J-Y^%xlW{FMyoV;EXqb4s4hB+z6i>bmguIlg8l2_q0tLyx_ z*m0Zk+WUmf4xzxNY;NajSWb2lCYG3g9AZs5G-gk&6B#@$vYEn)HRe%l>rGY<^P+At zBspmxYTDkKbDH!*QVrkST%)nB7>emne}H#fN$k09mK zsS7sAi}8+cFUAfGLNSIFjMbMuG|*ZAk1h_M5|@KHWvW*+7dhrG=szYN9UvDVgr820 zMdZlUoCGtSs^Yr2p<&$SE(KEWFRa}G2++Tb(E&3iwJ2&JP;ysO;@Tm6K*RHN4&0sy z3l3!NXNz56>>pkv4!BELJc-oFF10s)7&a7m7l979n{#j{fd~^;17+y`eHe4#&N`h# z)Ym(z(6M!JW>XlBko62D@{wChUzL5<{wv=t*f48ipb*;Y4`_QWn0Ch^DpVNYI&ttUD?puA zEUb&Kr3*kWc$3F-^U4g&zE8GKv;+VX^jmf{`b}D^bTZAZYkc*gn!x1rZV4uLf+9s| zaC*-KO=7{T79-@*+B~Eks%Y{N^k^n|W~e-6zVt1ZPM}fEe0p?#as1}&6e^?%md3n( zofn7-?abMZV^m$PRTb$u%}yh&7uiI4IJCY9wUdK?{d#fm`sml=(|1RIJ9-Ny+}`8U z6}|JUs@3ahnKgr&jKo3YE{wUNLyVV@XztR{^y}VVHTSkHpDm`=25l=Pj2*yfdHvmA z!nQ6w0-JZh;MBA4I&Gt}zUeg8dC_e`;@EAaz!!NBV5m?ITaPW#-=>4@>$;Gp911dsYCp`j4G@imXqM2i^5b%$~gO6U=PBD zPouABpIxTP6gxSFKdz68#Y|TOecUJnQ;;O@g69c5$WG{5H4Y=Xw;piLHXknoYbz^* zY=;WIG}-HdGdD8&SRs2?Rt=gM5P93Df>u}`JgR>-LASX~!mwz5>k0OGBpb4-X5Vxko<5(JvoS%@fPR~VLP?@-SUVL%gsOwumA5rn5zBNKH5GNBQ8hF5$^$Gz?bnexi%NCroj)?JYWk2|PMQG09uW+{Mc^ zN(>Muz(8zhE;twLRv~ctb56^FuGbN4>ke_uNj{}qrmdVhNGk?}t!Nx)xIX+n2xG_^ z=^!W)#gGJ3Paj+%?QKuZOhvl6QN=*7agx!vb`T=K8p6husn8-3_N_o@E#aQ1fjIZ1 zL&k_D!WNS6NhV5KMn0e+fHi=Iw*v2YoG@# z>7?pjv~+xOC-89@dnC#}n@^^IhfHdOsi>)J6p`8mLuS{*cKl*BU~6_8qG+Ln_`PtQ z+YcM!JMPQt+J@*J>#iBzi;g4418BJ-dHik2Q%J|*@BXxW^IylLJRw$@dmCpx3)Y6I zsW>96qT~k12rV5cLLJA=Hwy$~As?#t z7&VXEjSa!07_Zt#eTVq`* z*L4~f&y#dr*9{3c(#D8DVN{(u*Q1&0)SyyzIsK$|l1kAdvAsK+coSkfp19hel7Z-)&vp)8+1JR&*MVjg@FDFw z(4viw4A8p0G|RlYDy1`$*lb99Fa-u)A0NAv^7@G0H`O`L5=6}sm1Wj{R=1AS<>vwo za%%0;!F7U9C^!o-9GYrkE(l7Xvc#xM=BCL=n{|MFAE;x2gI1Z zZ7OQl=jY_}THADaLLWw;N$c7+^`UPpt|#SJ+)B@qpR!Mxej>52uP!Ios!$a!Ao{kA zN0zKf7&Bi_?1N2xvEYCvD4j2G`^~iwxqjf>LSRdQLIt6md+@v_OSGf?p#{X^j7@+C z3rBDu36rK&)BOPC4ltXZi(!E&PU1eI2hWR($3cCQPkaWJGFwmcPA&`A5bua`P?xxX z=l1L*13X~mEN>^l>s0=Ww=3*aE~piQE^URwE@v_d&WwsT^Zy7xw`1ToSD=P)j$3$s z9)UL|F2fd{MQLHDS>5ncg_ZEMd>yc{(X8EeD0}CRkfp%O2lLif>_wD$`JUBzCCgGv zwk~JBDPS%*6xsP$pQ>im+{P~loU*sKe^K5J8!Mrf%Ix43r-u^ zOupM?mXKzVllDp*NkBnMub8>wJx?LONlW6ifPaQN>)4j6uw@kIL)sLsHBRuIQt5 ztk#_#swDwDGCz1o(g(|t$-&69**AN2e5R2mRZ#HceGfs5^V)v*!8cS*Pte!ZGre4o zDA_hYd8rZn`YvGB5n@52_$5DWjdkR7Q9ss!stR>EMBqSl3~>mu1E-n7rT)~rVhh7m z+un0=w7c-R-{O)#Q%joH+`%3hF3T=)b0u-y%D-e)_NrMt3a{szAbJCvG@?Vm%0Lx2 zr_ZUJ^58+YE!oAprAElQGHRkiXE?-a5FTbVhz#XWHUmO9M+6ptV{C_V{eRPiM^9PoDcTkEpG(bb{dStQ!vw+0jV z^`OUMqt|WLIewra&!!2T3+E^)<2B*B$tIqr6Y9`GjpUy8M}i2vkCd6m@RLwF#F(VS z0B8I(&wX%0$vb}CFhNFur^yZ8FRrUv`f0>rixyEULG&R*M4PmErQzubBjln-mG&IV zY5&K&SGKDUPND4sDq^jxW3FsOG|TNNxqKg7NA&BKT%c3)Ov8u4_=bzLjL1rPiNYs5@+hkXgzkFA7zO_AnBk}rFl2ETaX zZ9hghqLX?GaHE?HH`h>euGiHtAMyir*rG<%Ess(4jey}zGn@9KaSC>|oQVJZ-N_rS p1nI^_p}DcmeQ*R_<2CmBQI3Hl`fS^u*f{KyHG7kfht{_t{s$y5#1H@g literal 45732 zcmd^Idv6=Z5x>6+^g9SiQOH23v<;8|jblKFlvYV?3s%|`FpNfTGt~>E5=Sob)!WYR zhQpcJ+ZV|bB{C2!i@e==@67D%y!|8O}cSwoeomk7qTl{f0rit+hx(rqTwuN;+Q#%b#QHu1AJkt^-&^W;*tR<) zICstGEp~Y_Zl8>))u`p?Ja|5gV6c#n+UG|kjq4U0aCi)7ZHvw33DNNdNp++7sg>PH z(C)fz_mZUd15tfU6nQwK_W3J%cHZogTyBErW8&?yZNqY5RPacpcHxQSkJn zwGD2wGx^)o@NdG-I^Ay}+|cI{QF_;W(?0R7Z(2TKJFpGaU8>b5q-Ea{R^VG7621}9 zcGtWl+g6yq-|Oa0Wj|o>eeq4H|3NEjmN0r-iI@7uCC4;CE1^tF@U~m4Mt`>NQu_mA z>)Q7<@t|YiqbamESy}vz#tdu%x=>i#Qyt0krxV(q1zH&rPFT<(Sv^K%SEqYHi>F5C zHP9@#-dehlyE4!oZ)oItOU%=*J;lOe__P%yuAk7Sj8P%pwxhW$y|BkD(hU0o+Y96G zm3r8swr0)hXQuTj*_DkJp8xrHx75_pU@0i+H{<~PTkERBXh+#R7*)#pR~_cp#=iQI z_BHuyjutALl(t`xg`)L5JX(Wm$3lfckUb8*Gm{tCB!Vy7_Ws^rsQ|z0U^n5 z+>s}imJqYF@x3Kl%2Nv=M*j`rzb4JWLQWgWH#|&m#aa#9S?D2sHIRkcGW0U-C7SDL z^^oE;T4;5&X;$aqccp7#BOA?27SR4dIvl#OE1G&boh^k>PN)ZFNnL7oCQmFKb-hJa zF$gg!SsFAhXm9WTF>mC#`G?J_{wNQ-&6nhZwkZcvzq-+U+Ind_i`{5`Pvh?^$`nz9 zxFy|O(_aebIek8%r^x?#Hje*4rCP+bnG0``&l}UvkY>ME4g6ZX75qT@DSX6jGa%m$ zuYov#xhrN|1N!@{?WvS)5ElOv#|bzC!t3Wx()KLie2eHmB#(t^4D92?@X~Gjw&i<3 zd|$N~&;u2iEhE8IwWSYR9w6@o*RY@TqpX+WKdYnDZtY zd6eh0*U$>l7RjEo1M3m&a~bn8R_!xXM{meG44QXjo2Z$>LQ{~==;;OhT4hOK3`$M)i0Z36x`vZ+SMHB-#&V29 zNI|P-47A)isBn=O}I(5F3}*?`yI(jYJ6k*V7he7r=E+|FD**{I9mXf)B|6u%<0q-=A90 zHc1ANP)4d`<7ge~X_I6Kt;So61xSqTww5^nU|Y?m@LS!Lp&k$?vTCj4=F5qlE5{o5 zg=eA5L*NngJz38Y$?f||J|%5O#KRfc@FCgEc=BvrtfuVc?Aj80In-Z~S*Z-t9?q^a zu}$)9encJtH4#)%t@rTl*(y*uIiA>KIFc_rw5-o4wvykXoe%poXWpYq?@L+>@bhWk z5;Oj<+7ZpULTt=+dtgq0yb*qJ6!jC`J}*f6FDly}P+RQDN#hak_Rr>D#QQdJ zwM&2P5zcSvufNd0SHavT?2ESZ^+kq1B1xVS)(f&z*gX84c#=4^+Kc&|uZQ=%f=R|5 z#?eLdzWJp2laqb7-H@tns4sT?V7IMQ7_GH*TR{@%%^#aT6fkqU5`6;grT~p2^(EoW zQ-_#0CeM^_1x~Mut&mHUTVYpN4Ng?IYOun}YVf{otGB4)*60?|lB>{p$#B&OEl&zE zJf=vAOv}R4c(B?&xEvF0?Q&cd2kkzob&(VJkQ|Bm3+p9_?>5u=mTdccS}*Z^u>;e$ z#?C>Ga}1qlq*nGdE!1PDpdh}^_>^m&cn5u2(IYUN1rgbK) z7#+8<=YZxa$fOTxY)b8^3_~hGoN1NXb2fEMzOmGjb9&^&Sd%HWMifOft${plXMxAW zKW3k0$Tt+(1GLi&y>>{vN^KCA`?TY^#Miy!9}Y2463<RK5S?KL6!KP+2L>{+`|VYb~#;9^@eAD$U|U1CvA+i`rjhEg;zOf$1{AuDOrTbBi3?6 zZDCvN5w)%2UiYj8(FChAyvLq*Bh+OthzmDvo(|b_{ZMLzvY%=|{zO`bvvqC5{nthI z;Dfp5xfw@0wJ~{y5f1so25q(>&p8j-CHWyzZqmG>S0e> zPl&Y_oKE>=IwrJ|%$`zkvd6X5NTiV#9Hndve&XS!p1_db_35S4#6Ug6t&`>k-$FLJ8I7DhzPizxqJqbIy;%FnD^tv$ym zjzcI((aMc$59^+Z>`nbK&r9pF5F6z%KNg?PFkthNi|Cvq-;Se>?Ky6J7`}mik7(X> zLRr%#{jc~qhQP|#L0jM>X->@Nf<`D~5VLH2<3wM?Ak_e%S68laht+q4pyaq47Q?(6_CsUiB}Q z4f~bFB%XrVkGzG#`Q;s_uWuR4IVhIv6?tdmfO0Bo7Hsf*a@wXGqp>R=`=8Qtvee8g ze2K&?}v3C-@F)fkLeBZj@7GMT65H@lfd@%|caNPm`pt(yN2hYVT&&hsm=nhpQF{!1FU~oG)MA~W4_e4u(;!6-M60&V$9p!FBYpQPxh zoW8)g#W!;Ax2~A@cD8=-BvHNdF?(55r8W6@>5S|9q3IPH*d%+%(Xvez!}sXKH16#W zH>mM_M5$HsvS(=+7}y8Sc9504VR4ctxWS zw}J2}8s$5E2L@tUtjB8a@&)IIZ9cp~w=h@^;dO85=Yq~JZW8B+@_c$teV4WNZQ5CM zH?^b`Oq{d#cZVo!@rYfhj9aW!_KAn|Vh36Iz=<`1R9@LoP|C)g~V}2 zPlY1B0FIuT&e2tZGMs945h(sNW*DRPCOgM)a{|tAB95>{v9Awxjh(@I=9N!k=}FR* z^~o6#k&d^kx?ZgF*>T|%u*at-QbX=?=Vy1w%EPm% zq1JZ^4}RUAz~&arc}YgdhfdpB-4)T~DPzxVDNAw1yO7b6CCzs4t-r3XjJA3Dsy~&u zRpOrMPFt9#LbHa|&H-}S(r3kcQ9h$nHEN+aVS~Fax_1Sloj>~nUk{1GpLL&Jkd5Q4 zSh~f?v`}5d?>_|mYZ_aUO=JBCx1KBI7LRYq-grRmai4+QzOEy1(C%FieX`z?2;3M| zfP=dVaee@;kzb*DQbW6(qhPA>zB`OYwnv<=w^GFUP2o>kDvs5*Rq!F6Lv`n8on0HW zl_$tdeYxD1fEy0^Zm{?>u|}LQ00hmfECjL0ZYxi#&20Rw5B}VS#x&pGp4v&n3Qtcd zG(_-A;-Y)c{H&RWk18Sy1|I=FWPcQg2LrBxJ+aji@FPm)FGa~??^19G%9e1Va|--XCCXI=?N!v&=& zn1WMAsipS^vN%NUJY@BHDI8t8C7dJhS@J(Aa+|DD(dgv-q)i}P>Pl7)- zg86Q)vNd>!{!e942hr%?d07Atb2wq}>I zPf(dY|HwQD_pnEgvPyK9MhlSIlR&Vp-yGBdc1jBxcp zTnET=rems0Gq2m>4zm=^?1RwL-zpHxvILrDS+m1U(GjOTzdyzMPkfTPc3fgxG$VoC z%9ekGsMNZ(Kk4b$L$t?g%USt&K@v&bK`egF>I16=W18)&6ye##4y9&hpYxrfn9pM# z>(`*w?{U2F{p?PaaBV_y=3!tShe)69ud-Neo$}cEvehT=I>rwEen$^R1=ioOr};En zJJ<2U?>$);DJvhjk;6P=WN>8T-!e-0DY6&5U#8Rw8IHUILDzc(2Hs6RjyzX7*TJgg zUF&_@v%J||rIm{W-PWruTje@u%b|Z2DfoHWYqG*Oll`%^J%%&);Jqq>Cr$}R60Gsz zUhN$kA9(lLCe>c}FHg6ON&D2U6?fq%cd@?vG^UaJ%RF#V{Mx^ZSK_m@;n*ynY+SCH zEvG2oGP45AUr(}ftizPvn z-QCy4p_&d?Z_@I}uQG8>jcW(7F%DS@Y_t*z{8g*)_|XDBxw5owoQC6eeL0PJka})IkL%YW<5mwF zTCU}WtCHQQs%!A8L$lrG@K~uE$qg{&bZz%TTOxR$?0==)xNovRfOEi&i!!= zjy%`+MmUe_E|h?-t8u&ShUbFS|7vSW`N&m5<&4Fdk$_h3*VB4;S{ubm64wYYr^b6l5#7&ww_3ab z6=ysLQEaNEoV5xJZT)MoO<8#r?&Uq-tS@;}rB)sD?f>3qoXu)`oJi!IJlgZuV81E>U)SSoF!fZWg?E$K9B_ZS4pXy_rzYD`8vNcU zzn@?89BuD8k~ooiu9;t|MGe=0^4K_E-yF~Ga_u{lv*$|GC*-_|?SVBx|L#bIvHE^R zd8>P;B72iz=Z)ws`|v8tqV*6nXcP{_y{ahBkcW?2ep^=(`-HJnAZ-2RnvwCD6LK($oc5;L}Z>vfS4 t+cowI;?yASce5t8axkfurxuLq_B8 Date: Mon, 11 May 2015 10:37:10 -0700 Subject: [PATCH 0030/2220] Added typings for es6-collections --- es6-collections/es6-collections-tests.ts | 59 +++++++++ .../es6-collections-tests.ts.tscparams | 1 + es6-collections/es6-collections.d.ts | 113 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 es6-collections/es6-collections-tests.ts create mode 100644 es6-collections/es6-collections-tests.ts.tscparams create mode 100644 es6-collections/es6-collections.d.ts diff --git a/es6-collections/es6-collections-tests.ts b/es6-collections/es6-collections-tests.ts new file mode 100644 index 0000000000..2569942722 --- /dev/null +++ b/es6-collections/es6-collections-tests.ts @@ -0,0 +1,59 @@ +/// + +interface Point { x: number; y: number; } +let a: any; +let s: string; +let b: boolean; +let i: number; +let pt: Point; +let arrayOfPoint: Point[]; +let arrayOfStringPoint: [string, Point][]; +let arrayOfPointString: [Point, string][]; +let map: Map; +let set: Set; +let weakMap: WeakMap; +let weakSet: WeakSet; +let iteratorOfString: Iterator; +let iteratorOfStringPoint: Iterator<[String, Point]>; +let iteratorOfPoint: Iterator; +let iteratorOfPointPoint: Iterator<[Point, Point]>; + +map = new Map(); +map = new Map(arrayOfStringPoint); +map.clear(); +b = map.delete(s); +map.forEach((value: Point, key: string, map: Map) => { }, a); +pt = map.get(s); +b = map.has(s); +map = map.set(s, pt); +iteratorOfStringPoint = map.entries(); +iteratorOfString = map.keys(); +iteratorOfPoint = map.values(); +i = map.size; + +set = new Set(); +set = new Set(arrayOfPoint); +set.clear(); +b = set.delete(pt); +set.forEach((value: Point, key: Point, set: Set) => { }, a); +b = set.has(pt); +set = set.add(pt); +iteratorOfPointPoint = set.entries(); +iteratorOfPoint = set.keys(); +iteratorOfPoint = set.values(); +i = set.size; + +weakMap = new WeakMap(); +weakMap = new WeakMap(arrayOfPointString); +weakMap.clear(); +b = weakMap.delete(pt); +s = weakMap.get(pt); +b = weakMap.has(pt); +weakMap = weakMap.set(pt, s); + +weakSet = new WeakSet(); +weakSet = new WeakSet(arrayOfPoint); +weakSet.clear(); +b = weakSet.delete(pt); +b = weakSet.has(pt); +weakSet = weakSet.add(pt); \ No newline at end of file diff --git a/es6-collections/es6-collections-tests.ts.tscparams b/es6-collections/es6-collections-tests.ts.tscparams new file mode 100644 index 0000000000..4169d3605f --- /dev/null +++ b/es6-collections/es6-collections-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 \ No newline at end of file diff --git a/es6-collections/es6-collections.d.ts b/es6-collections/es6-collections.d.ts new file mode 100644 index 0000000000..54bcbca01d --- /dev/null +++ b/es6-collections/es6-collections.d.ts @@ -0,0 +1,113 @@ +// Type definitions for es6-collections v0.5.1 +// Project: https://github.com/WebReflection/es6-collections/ +// Definitions by: Ron Buckton +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + +interface IteratorResult { + done: boolean; + value?: T; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface ForEachable { + forEach(callbackfn: (value: T) => void): void; +} + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): Map; + entries(): Iterator<[K, V]>; + keys(): Iterator; + values(): Iterator; + size: number; +} + +interface MapConstructor { + new (): Map; + new (iterable: ForEachable<[K, V]>): Map; + prototype: Map; +} + +declare var Map: MapConstructor; + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + entries(): Iterator<[T, T]>; + keys(): Iterator; + values(): Iterator; + size: number; +} + +interface SetConstructor { + new (): Set; + new (iterable: ForEachable): Set; + prototype: Set; +} + +declare var Set: SetConstructor; + +interface WeakMap { + delete(key: K): boolean; + clear(): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): WeakMap; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (iterable: ForEachable<[K, V]>): WeakMap; + prototype: WeakMap; +} + +declare var WeakMap: WeakMapConstructor; + +interface WeakSet { + delete(value: T): boolean; + clear(): void; + add(value: T): WeakSet; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (iterable: ForEachable): WeakSet; + prototype: WeakSet; +} + +declare var WeakSet: WeakSetConstructor; + +declare module "es6-collections" { + var Map: MapConstructor; + var Set: SetConstructor; + var WeakMap: WeakMapConstructor; + var WeakSet: WeakSetConstructor; +} \ No newline at end of file From 9b14d38a1ac99f5e6374c2f94bc251350cb2b52a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 11 May 2015 11:34:57 -0700 Subject: [PATCH 0031/2220] Added typings for es6-shim --- es6-shim/es6-shim-tests.ts | 222 +++++++++ es6-shim/es6-shim-tests.ts.tscparams | 1 + es6-shim/es6-shim.d.ts | 673 +++++++++++++++++++++++++++ 3 files changed, 896 insertions(+) create mode 100644 es6-shim/es6-shim-tests.ts create mode 100644 es6-shim/es6-shim-tests.ts.tscparams create mode 100644 es6-shim/es6-shim.d.ts diff --git a/es6-shim/es6-shim-tests.ts b/es6-shim/es6-shim-tests.ts new file mode 100644 index 0000000000..3bcb0ba7de --- /dev/null +++ b/es6-shim/es6-shim-tests.ts @@ -0,0 +1,222 @@ +/// + +interface Point { x: number; y: number; } +interface Point3D extends Point { z: number; } + +let a: any; +let s: string; +let i: number; +let b: boolean; +let f: () => void; +let o: Object; +let r: RegExp; +let sym: symbol; +let e: Error; +let date: Date; +let key: PropertyKey; +let point: Point; +let point3d: Point3D; +let arrayOfPoint: Point[]; +let arrayOfPoint3D: Point3D[]; +let arrayOfSymbol: symbol[]; +let arrayOfPropertyKey: PropertyKey[]; +let arrayOfAny: any[]; +let arrayOfStringAny: [string, any][]; +let arrayLikeOfAny: ArrayLike; +let iterableOfPoint: IterableShim; +let iterableOfStringPoint: IterableShim<[string, Point]>; +let iterableOfPointPoint3D: IterableShim<[Point, Point3D]>; +let iterableIteratorOfPoint: IterableIteratorShim; +let iterableIteratorOfNumberPoint: IterableIteratorShim<[number, Point]>; +let iterableIteratorOfNumber: IterableIteratorShim; +let iterableIteratorOfString: IterableIteratorShim; +let iterableIteratorOfPointPoint: IterableIteratorShim<[Point, Point]>; +let iterableIteratorOfNode: IterableIteratorShim; +let iterableIteratorOfStringPoint: IterableIteratorShim<[string, Point]>; +let iterableIteratorOfAny: IterableIteratorShim; +let iterableIteratorOfPropertyKey: IterableIteratorShim; +let iterableIteratorOfPropertyKeyPoint: IterableIteratorShim<[PropertyKey, Point]>; +let nodeList: NodeList; +let pd: PropertyDescriptor; +let pdm: PropertyDescriptorMap; +let map: Map; +let set: Set; +let weakMap: WeakMap; +let weakSet: WeakSet; +let promiseLikeOfPoint: PromiseLike; +let promiseLikeOfPoint3D: PromiseLike; +let promiseOfPoint: Promise; +let promiseOfPoint3D: Promise; +let promiseOfArrayOfPoint: Promise; +let promiseOfVoid: Promise; + +point = Object.assign(point, point); +b = Object.is(point, point); +Object.setPrototypeOf(point, point); +point = arrayOfPoint.find(p => b); +i = arrayOfPoint.findIndex(p => b); +arrayOfPoint = arrayOfPoint.fill(point, i, arrayOfPoint.length); +arrayOfPoint = arrayOfPoint.copyWithin(i, i, i); +arrayOfPoint = Array.from(arrayOfPoint); +arrayOfPoint = Array.from(iterableOfPoint); +arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d); +arrayOfPoint3D = Array.from(arrayOfPoint, point => point3d, a); +arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d); +arrayOfPoint3D = Array.from(iterableOfPoint, point => point3d, a); +arrayOfPoint = Array.of(point, point); +i = s.codePointAt(i); +b = s.includes(s, i); +b = s.endsWith(s, i); +s = s.repeat(i); +b = s.startsWith(s, i); +s = String.fromCodePoint(i, i); +s = String.raw`abc`; +s = r.flags; +i = Number.EPSILON; +b = Number.isFinite(i); +b = Number.isInteger(i); +b = Number.isNaN(i); +b = Number.isSafeInteger(i); +i = Number.MAX_SAFE_INTEGER; +i = Number.MIN_SAFE_INTEGER; +i = Number.parseFloat(s); +i = Number.parseInt(s); +i = Number.parseInt(s, i); +i = Math.clz32(i); +i = Math.imul(i, i); +i = Math.sign(i); +i = Math.log10(i); +i = Math.log2(i); +i = Math.log1p(i); +i = Math.expm1(i); +i = Math.cosh(i); +i = Math.sinh(i); +i = Math.tanh(i); +i = Math.acosh(i); +i = Math.asinh(i); +i = Math.atanh(i); +i = Math.hypot(i, i); +i = Math.trunc(i); +i = Math.fround(i); +i = Math.cbrt(i); +map.clear(); +map.delete(s); +map.forEach((value: Point, key: string) => { }); +point = map.get(s); +b = map.has(s); +map = map.set(s, point); +i = map.size; +map = new Map(); +map = new Map(iterableOfStringPoint); +set.clear(); +set.delete(point); +set.forEach((value: Point, key: Point) => { }); +b = set.has(point); +set = set.add(point); +i = set.size; +set = new Set(); +set = new Set(iterableOfPoint); +weakMap.delete(point); +point3d = weakMap.get(point); +b = weakMap.has(point); +weakMap = weakMap.set(point, point3d); +weakMap = new WeakMap(); +weakMap = new WeakMap(iterableOfPointPoint3D); +weakSet.delete(point); +weakSet = weakSet.add(point); +b = weakSet.has(point); +weakSet = new WeakSet(); +weakSet = new WeakSet(iterableOfPoint); +iterableIteratorOfNumberPoint = arrayOfPoint.entries(); +iterableIteratorOfNumber = arrayOfPoint.keys(); +iterableIteratorOfPoint = arrayOfPoint.values(); +iterableIteratorOfPointPoint = set.entries(); +iterableIteratorOfPoint = set.keys(); +iterableIteratorOfPoint = set.values(); +promiseLikeOfPoint.then((point: Point) => { }); +promiseLikeOfPoint = promiseLikeOfPoint.then(); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => point); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => point); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => point); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => promiseLikeOfPoint); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => point, e => { }); +promiseLikeOfPoint = promiseLikeOfPoint.then(p => promiseLikeOfPoint, e => { }); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => point3d); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => point3d); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => promiseLikeOfPoint3D); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => point3d, e => { }); +promiseLikeOfPoint3D = promiseLikeOfPoint.then(p => promiseLikeOfPoint3D, e => { }); +promiseOfPoint.then((point: Point) => { }); +promiseOfPoint = promiseOfPoint.then(); +promiseOfPoint = promiseOfPoint.then(p => point); +promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint); +promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint); +promiseOfPoint = promiseOfPoint.then(p => point, e => point); +promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => point); +promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => point); +promiseOfPoint = promiseOfPoint.then(p => point, e => promiseOfPoint); +promiseOfPoint = promiseOfPoint.then(p => point, e => promiseLikeOfPoint); +promiseOfPoint = promiseOfPoint.then(p => point, e => { }); +promiseOfPoint = promiseOfPoint.then(p => promiseOfPoint, e => { }); +promiseOfPoint = promiseOfPoint.then(p => promiseLikeOfPoint, e => { }); +promiseOfPoint3D = promiseOfPoint.then(p => point3d); +promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D); +promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D); +promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => point3d); +promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => point3d); +promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => point3d); +promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseOfPoint3D); +promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => promiseLikeOfPoint3D); +promiseOfPoint3D = promiseOfPoint.then(p => point3d, e => { }); +promiseOfPoint3D = promiseOfPoint.then(p => promiseOfPoint3D, e => { }); +promiseOfPoint3D = promiseOfPoint.then(p => promiseLikeOfPoint3D, e => { }); +promiseOfPoint = promiseOfPoint.catch(e => point); +promiseOfPoint = promiseOfPoint.catch(e => promiseOfPoint); +promiseOfPoint = promiseOfPoint.catch(e => promiseLikeOfPoint); +promiseOfPoint = promiseOfPoint.catch(e => { }); +promiseOfPoint3D = promiseOfPoint.catch(e => point3d); +promiseOfPoint3D = promiseOfPoint.catch(e => promiseOfPoint3D); +promiseOfPoint3D = promiseOfPoint.catch(e => promiseLikeOfPoint3D); +promiseOfPoint = new Promise((resolve, reject) => resolve(point)); +promiseOfPoint = new Promise((resolve, reject) => resolve(promiseOfPoint)); +promiseOfPoint = new Promise((resolve, reject) => resolve(promiseLikeOfPoint)); +promiseOfPoint = new Promise((resolve, reject) => reject(e)); +promiseOfArrayOfPoint = Promise.all(arrayOfPoint); +promiseOfArrayOfPoint = Promise.all(iterableOfPoint); +promiseOfPoint = Promise.race(arrayOfPoint); +promiseOfPoint = Promise.race(iterableOfPoint); +promiseOfVoid = Promise.resolve(); +promiseOfPoint = Promise.resolve(point3d); +promiseOfPoint = Promise.resolve(promiseOfPoint); +promiseOfPoint = Promise.resolve(promiseLikeOfPoint); +promiseOfVoid = Promise.reject(e); +promiseOfPoint = Promise.reject(e); +a = Reflect.apply(f, a, arrayLikeOfAny); +a = Reflect.construct(f, arrayLikeOfAny); +b = Reflect.defineProperty(a, s, pd); +b = Reflect.defineProperty(a, i, pd); +b = Reflect.defineProperty(a, sym, pd); +b = Reflect.deleteProperty(a, s); +b = Reflect.deleteProperty(a, i); +b = Reflect.deleteProperty(a, sym); +iterableIteratorOfAny = Reflect.enumerate(a); +a = Reflect.get(a, s, a); +a = Reflect.get(a, i, a); +a = Reflect.get(a, sym, a); +pd = Reflect.getOwnPropertyDescriptor(a, s); +pd = Reflect.getOwnPropertyDescriptor(a, i); +pd = Reflect.getOwnPropertyDescriptor(a, sym); +a = Reflect.getPrototypeOf(a); +b = Reflect.has(a, s); +b = Reflect.has(a, i); +b = Reflect.has(a, sym); +b = Reflect.isExtensible(a); +arrayOfPropertyKey = Reflect.ownKeys(a); +b = Reflect.preventExtensions(a); +b = Reflect.set(a, s, a, a); +b = Reflect.set(a, i, a, a); +b = Reflect.set(a, sym, a, a); +b = Reflect.setPrototypeOf(a, a); \ No newline at end of file diff --git a/es6-shim/es6-shim-tests.ts.tscparams b/es6-shim/es6-shim-tests.ts.tscparams new file mode 100644 index 0000000000..4169d3605f --- /dev/null +++ b/es6-shim/es6-shim-tests.ts.tscparams @@ -0,0 +1 @@ +--noImplicitAny --module commonjs --target es5 \ No newline at end of file diff --git a/es6-shim/es6-shim.d.ts b/es6-shim/es6-shim.d.ts new file mode 100644 index 0000000000..cff5a9b7e4 --- /dev/null +++ b/es6-shim/es6-shim.d.ts @@ -0,0 +1,673 @@ +// Type definitions for es6-shim v0.31.2 +// Project: https://github.com/paulmillr/es6-shim +// Definitions by: Ron Buckton +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare type PropertyKey = string | number | symbol; + +interface IteratorResult { + done: boolean; + value?: T; +} + +interface IterableShim { + /** + * Shim for an ES6 iterable. Not intended for direct use by user code. + */ + "_es6-shim iterator_"(): Iterator; +} + +interface Iterator { + next(value?: any): IteratorResult; + return?(value?: any): IteratorResult; + throw?(e?: any): IteratorResult; +} + +interface IterableIteratorShim extends IterableShim, Iterator { + /** + * Shim for an ES6 iterable iterator. Not intended for direct use by user code. + */ + "_es6-shim iterator_"(): IterableIteratorShim; +} + +interface StringConstructor { + /** + * Return the String value whose elements are, in order, the elements in the List elements. + * If length is 0, the empty string is returned. + */ + fromCodePoint(...codePoints: number[]): string; + + /** + * String.raw is intended for use as a tag function of a Tagged Template String. When called + * as such the first argument will be a well formed template call site object and the rest + * parameter will contain the substitution values. + * @param template A well-formed template string call site representation. + * @param substitutions A set of substitution values. + */ + raw(template: TemplateStringsArray, ...substitutions: any[]): string; +} + +interface String { + /** + * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point + * value of the UTF-16 encoded code point starting at the string element at position pos in + * the String resulting from converting this object to a String. + * If there is no element at that position, the result is undefined. + * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. + */ + codePointAt(pos: number): number; + + /** + * Returns true if searchString appears as a substring of the result of converting this + * object to a String, at one or more positions that are + * greater than or equal to position; otherwise, returns false. + * @param searchString search string + * @param position If position is undefined, 0 is assumed, so as to search all of the String. + */ + includes(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; + + /** + * Returns a String value that is made from count copies appended together. If count is 0, + * T is the empty String is returned. + * @param count number of copies to append + */ + repeat(count: number): string; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns an HTML anchor element and sets the name attribute to the text value + * @param name + */ + anchor(name: string): string; + + /** Returns a HTML element */ + big(): string; + + /** Returns a HTML element */ + blink(): string; + + /** Returns a HTML element */ + bold(): string; + + /** Returns a HTML element */ + fixed(): string + + /** Returns a HTML element and sets the color attribute value */ + fontcolor(color: string): string + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: number): string; + + /** Returns a HTML element and sets the size attribute value */ + fontsize(size: string): string; + + /** Returns an HTML element */ + italics(): string; + + /** Returns an HTML element and sets the href attribute value */ + link(url: string): string; + + /** Returns a HTML element */ + small(): string; + + /** Returns a HTML element */ + strike(): string; + + /** Returns a HTML element */ + sub(): string; + + /** Returns a HTML element */ + sup(): string; + + /** + * Shim for an ES6 iterable. Not intended for direct use by user code. + */ + "_es6-shim iterator_"(): IterableIteratorShim; +} + +interface ArrayLike { + length: number; + [n: number]: T; +} + +interface ArrayConstructor { + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + * @param mapfn A mapping function to call on every element of the array. + * @param thisArg Value of 'this' used to invoke the mapfn. + */ + from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + + /** + * Creates an array from an array-like object. + * @param arrayLike An array-like object to convert to an array. + */ + from(arrayLike: ArrayLike): Array; + + /** + * Creates an array from an iterable object. + * @param iterable An iterable object to convert to an array. + */ + from(iterable: IterableShim): Array; + + /** + * Returns a new array from a set of elements. + * @param items A set of elements to include in the new array object. + */ + of(...items: T[]): Array; +} + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + + /** + * Returns the index of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + findIndex(predicate: (value: T) => boolean, thisArg?: any): number; + + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): T[]; + + /** + * Returns the this object after copying a section of the array identified by start and end + * to the same array starting at position target + * @param target If target is negative, it is treated as length+target where length is the + * length of the array. + * @param start If start is negative, it is treated as length+start. If end is negative, it + * is treated as length+end. + * @param end If not specified, length of the this object is used as its default value. + */ + copyWithin(target: number, start: number, end?: number): T[]; + + /** + * Returns an array of key, value pairs for every entry in the array + */ + entries(): IterableIteratorShim<[number, T]>; + + /** + * Returns an list of keys in the array + */ + keys(): IterableIteratorShim; + + /** + * Returns an list of values in the array + */ + values(): IterableIteratorShim; + + /** + * Shim for an ES6 iterable. Not intended for direct use by user code. + */ + "_es6-shim iterator_"(): IterableIteratorShim; +} + +interface NumberConstructor { + /** + * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 + * that is representable as a Number value, which is approximately: + * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. + */ + EPSILON: number; + + /** + * Returns true if passed value is finite. + * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a + * number. Only finite values of the type number, result in true. + * @param number A numeric value. + */ + isFinite(number: number): boolean; + + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; + + /** + * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a + * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter + * to a number. Only values of the type number, that are also NaN, result in true. + * @param number A numeric value. + */ + isNaN(number: number): boolean; + + /** + * Returns true if the value passed is a safe integer. + * @param number A numeric value. + */ + isSafeInteger(number: number): boolean; + + /** + * The value of the largest integer n such that n and n + 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. + */ + MAX_SAFE_INTEGER: number; + + /** + * The value of the smallest integer n such that n and n − 1 are both exactly representable as + * a Number value. + * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). + */ + MIN_SAFE_INTEGER: number; + + /** + * Converts a string to a floating-point number. + * @param string A string that contains a floating-point number. + */ + parseFloat(string: string): number; + + /** + * Converts A string to an integer. + * @param s A string to convert into a number. + * @param radix A value between 2 and 36 that specifies the base of the number in numString. + * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. + * All other strings are considered decimal. + */ + parseInt(string: string, radix?: number): number; +} + +interface ObjectConstructor { + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects to copy properties from. + */ + assign(target: any, ...sources: any[]): any; + + /** + * Returns true if the values are the same value, false otherwise. + * @param value1 The first value. + * @param value2 The second value. + */ + is(value1: any, value2: any): boolean; + + /** + * Sets the prototype of a specified object o to object proto or null. Returns the object o. + * @param o The object to change its prototype. + * @param proto The value of the new prototype or null. + * @remarks Requires `__proto__` support. + */ + setPrototypeOf(o: any, proto: any): any; +} + +interface RegExp { + /** + * Returns a string indicating the flags of the regular expression in question. This field is read-only. + * The characters in this string are sequenced and concatenated in the following order: + * + * - "g" for global + * - "i" for ignoreCase + * - "m" for multiline + * - "u" for unicode + * - "y" for sticky + * + * If no flags are set, the value is the empty string. + */ + flags: string; +} + +interface Math { + /** + * Returns the number of leading zero bits in the 32-bit binary representation of a number. + * @param x A numeric expression. + */ + clz32(x: number): number; + + /** + * Returns the result of 32-bit multiplication of two numbers. + * @param x First number + * @param y Second number + */ + imul(x: number, y: number): number; + + /** + * Returns the sign of the x, indicating whether x is positive, negative or zero. + * @param x The numeric expression to test + */ + sign(x: number): number; + + /** + * Returns the base 10 logarithm of a number. + * @param x A numeric expression. + */ + log10(x: number): number; + + /** + * Returns the base 2 logarithm of a number. + * @param x A numeric expression. + */ + log2(x: number): number; + + /** + * Returns the natural logarithm of 1 + x. + * @param x A numeric expression. + */ + log1p(x: number): number; + + /** + * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of + * the natural logarithms). + * @param x A numeric expression. + */ + expm1(x: number): number; + + /** + * Returns the hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + cosh(x: number): number; + + /** + * Returns the hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + sinh(x: number): number; + + /** + * Returns the hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + tanh(x: number): number; + + /** + * Returns the inverse hyperbolic cosine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + acosh(x: number): number; + + /** + * Returns the inverse hyperbolic sine of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + asinh(x: number): number; + + /** + * Returns the inverse hyperbolic tangent of a number. + * @param x A numeric expression that contains an angle measured in radians. + */ + atanh(x: number): number; + + /** + * Returns the square root of the sum of squares of its arguments. + * @param values Values to compute the square root for. + * If no arguments are passed, the result is +0. + * If there is only one argument, the result is the absolute value. + * If any argument is +Infinity or -Infinity, the result is +Infinity. + * If any argument is NaN, the result is NaN. + * If all arguments are either +0 or −0, the result is +0. + */ + hypot(...values: number[]): number; + + /** + * Returns the integral part of the a numeric expression, x, removing any fractional digits. + * If x is already an integer, the result is x. + * @param x A numeric expression. + */ + trunc(x: number): number; + + /** + * Returns the nearest single precision float representation of a number. + * @param x A numeric expression. + */ + fround(x: number): number; + + /** + * Returns an implementation-dependent approximation to the cube root of number. + * @param x A numeric expression. + */ + cbrt(x: number): number; +} + +interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: (reason: any) => T | PromiseLike): Promise; + catch(onrejected?: (reason: any) => void): Promise; +} + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + prototype: Promise; + + /** + * Creates a new Promise. + * @param executor A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all(values: IterableShim>): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race(values: IterableShim>): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve(value: T | PromiseLike): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; + +interface Map { + clear(): void; + delete(key: K): boolean; + forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): Map; + size: number; + entries(): IterableIteratorShim<[K, V]>; + keys(): IterableIteratorShim; + values(): IterableIteratorShim; +} + +interface MapConstructor { + new (): Map; + new (iterable: IterableShim<[K, V]>): Map; + prototype: Map; +} + +declare var Map: MapConstructor; + +interface Set { + add(value: T): Set; + clear(): void; + delete(value: T): boolean; + forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; + has(value: T): boolean; + size: number; + entries(): IterableIteratorShim<[T, T]>; + keys(): IterableIteratorShim; + values(): IterableIteratorShim; +} + +interface SetConstructor { + new (): Set; + new (iterable: IterableShim): Set; + prototype: Set; +} + +declare var Set: SetConstructor; + +interface WeakMap { + delete(key: K): boolean; + get(key: K): V; + has(key: K): boolean; + set(key: K, value?: V): WeakMap; +} + +interface WeakMapConstructor { + new (): WeakMap; + new (iterable: IterableShim<[K, V]>): WeakMap; + prototype: WeakMap; +} + +declare var WeakMap: WeakMapConstructor; + +interface WeakSet { + add(value: T): WeakSet; + delete(value: T): boolean; + has(value: T): boolean; +} + +interface WeakSetConstructor { + new (): WeakSet; + new (iterable: IterableShim): WeakSet; + prototype: WeakSet; +} + +declare var WeakSet: WeakSetConstructor; + +declare module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): IterableIteratorShim; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: PropertyKey): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; +} + +declare module "es6-shim" { + var String: StringConstructor; + var Array: ArrayConstructor; + var Number: NumberConstructor; + var Math: Math; + var Object: ObjectConstructor; + var Map: MapConstructor; + var Set: SetConstructor; + var WeakMap: WeakMapConstructor; + var WeakSet: WeakSetConstructor; + var Promise: PromiseConstructor; + module Reflect { + function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; + function construct(target: Function, argumentsList: ArrayLike): any; + function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; + function deleteProperty(target: any, propertyKey: PropertyKey): boolean; + function enumerate(target: any): Iterator; + function get(target: any, propertyKey: PropertyKey, receiver?: any): any; + function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; + function getPrototypeOf(target: any): any; + function has(target: any, propertyKey: PropertyKey): boolean; + function isExtensible(target: any): boolean; + function ownKeys(target: any): Array; + function preventExtensions(target: any): boolean; + function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; + function setPrototypeOf(target: any, proto: any): boolean; + } +} \ No newline at end of file From 75f03d73ce8a8a10f4594bd6500d6f207b2e8191 Mon Sep 17 00:00:00 2001 From: Chris Barr Date: Tue, 12 May 2015 08:13:37 -0400 Subject: [PATCH 0032/2220] Adding missing `timeout` property, changing others to be properties instead of functions, spelling fixes --- notifyjs/notifyjs-tests.ts | 6 ++++-- notifyjs/notifyjs.d.ts | 25 ++++++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/notifyjs/notifyjs-tests.ts b/notifyjs/notifyjs-tests.ts index 8771224c8e..3289791dee 100644 --- a/notifyjs/notifyjs-tests.ts +++ b/notifyjs/notifyjs-tests.ts @@ -14,6 +14,7 @@ function test_Notify_constructor() { body : "fuga", icon : "./logo.png", tag : "user", + timeout: 2, notifyShow : (e:Event)=> console.log("notifyShow", e), notifyClose : ()=> console.log("notifyClose"), notifyClick : ()=> console.log("notifyClick"), @@ -26,9 +27,10 @@ function test_Notify_constructor() { } function test_Notify_static_methods() { - Notify.needsPermission(); + Notify.needsPermission; Notify.requestPermission(); Notify.requestPermission(()=> console.log("onPermissionGrantedCallback")); Notify.requestPermission(()=> console.log("onPermissionGrantedCallback"), ()=> console.log("onPermissionDeniedCallback")); - Notify.isSupported(); + Notify.isSupported; + Notify.permissionLevel; } diff --git a/notifyjs/notifyjs.d.ts b/notifyjs/notifyjs.d.ts index f36b8fbcd0..dc7bc57fe0 100644 --- a/notifyjs/notifyjs.d.ts +++ b/notifyjs/notifyjs.d.ts @@ -1,4 +1,4 @@ -// Type definitions for notify.js 1.2.0 +// Type definitions for notify.js 1.2.3 // Project: https://github.com/alexgibson/notify.js // Definitions by: soundTricker // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -10,20 +10,26 @@ declare var Notify: { * Check is permission is needed for the user to receive notifications. * @return true : needs permission, false : does not need */ - needsPermission() : boolean; + needsPermission : boolean; /** * Asks the user for permission to display notifications - * @param onPermissionGrantedCallback A callback for permmision is granted. - * @param onPermissionDeniedCallback A callback for permmision is denied. + * @param onPermissionGrantedCallback A callback for permission is granted. + * @param onPermissionDeniedCallback A callback for permission is denied. */ requestPermission(onPermissionGrantedCallback?: ()=> any, onPermissionDeniedCallback? : ()=> any) : void; /** * return true if the browser supports HTML5 Notification - * @param true : the browser supports HTML5 Notification, false ; the browswer does not supports HTML5 Notification. + * @param true : the browser supports HTML5 Notification, false ; the browser does not supports HTML5 Notification. */ - isSupported() : boolean; + isSupported: boolean; + + /** + * shows the user's current permission level (granted, denied or default), returns null if notifications are not supported. + * @return 'granted' : permission has been given, 'denied' : permission has been denied, 'default' : permission has not yet been set, null : notifications are not supported + */ + permissionLevel: string; } declare module notifyjs { @@ -72,6 +78,11 @@ declare module notifyjs { * unique identifier to stop duplicate notifications */ tag? : string; + + /** + * number of seconds to close the notification automatically + */ + timeout? : number; /** * callback when notification is shown @@ -98,4 +109,4 @@ declare module notifyjs { */ permissionDenied? : Function; } -} +} \ No newline at end of file From 3f15066480dd9a016203bc258858ab16eb50ea13 Mon Sep 17 00:00:00 2001 From: Aaron Dandy Date: Tue, 12 May 2015 11:48:26 -0700 Subject: [PATCH 0033/2220] Update auth0.d.ts for typescript 1.5.0-beta --- auth0/auth0.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/auth0/auth0.d.ts b/auth0/auth0.d.ts index 5d3149ead4..3562e50d5a 100644 --- a/auth0/auth0.d.ts +++ b/auth0/auth0.d.ts @@ -9,10 +9,6 @@ interface Window { token: string; } -interface Location { - origin: string; -} - /** This is the interface for the main Auth0 client. */ interface Auth0Static { From 0faae8ebf7f8e4c3cab38ef35ffd4a814b811c7b Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Fri, 15 May 2015 13:00:47 -0500 Subject: [PATCH 0034/2220] Collapse createChildren and rename as 'VChild' --- virtual-dom/virtual-dom.d.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/virtual-dom/virtual-dom.d.ts b/virtual-dom/virtual-dom.d.ts index 70166515f8..7023d38fdc 100644 --- a/virtual-dom/virtual-dom.d.ts +++ b/virtual-dom/virtual-dom.d.ts @@ -86,7 +86,8 @@ declare module VirtualDOM { key?: string; namespace?: string; } - type createChildren = Array; + + type VChild = VTree[] | VTree | string[] | string; /** create() calls either document.createElement() or document.createElementNS(), @@ -94,8 +95,8 @@ declare module VirtualDOM { */ function create(vnode: VText, opts?: {document?: Document, warn?: boolean}): Text; function create(vnode: VNode | Widget | Thunk, opts?: {document?: Document, warn?: boolean}): Element; - function h(tagName: string, properties: createProperties, ...children: createChildren): VNode; - function h(tagName: string, ...children: createChildren): VNode; + function h(tagName: string, properties: createProperties, ...children: VChild[]): VNode; + function h(tagName: string, ...children: VChild[]): VNode; function diff(left: VTree, right: VTree): VPatch[]; /** patch() usually just returns rootNode after doing stuff to it, so we want From 1e2a1e22e5c44adb10667dc5bd91a2367f3af288 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Fri, 15 May 2015 13:07:19 -0500 Subject: [PATCH 0035/2220] Fix h() signatures to reflect virtual-hyperscript readme (I must have misread the jsig file) --- virtual-dom/virtual-dom.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtual-dom/virtual-dom.d.ts b/virtual-dom/virtual-dom.d.ts index 7023d38fdc..10575e8ca8 100644 --- a/virtual-dom/virtual-dom.d.ts +++ b/virtual-dom/virtual-dom.d.ts @@ -95,8 +95,8 @@ declare module VirtualDOM { */ function create(vnode: VText, opts?: {document?: Document, warn?: boolean}): Text; function create(vnode: VNode | Widget | Thunk, opts?: {document?: Document, warn?: boolean}): Element; - function h(tagName: string, properties: createProperties, ...children: VChild[]): VNode; - function h(tagName: string, ...children: VChild[]): VNode; + function h(tagName: string, properties: createProperties, children: string | VChild[]): VNode; + function h(tagName: string, children: string | VChild[]): VNode; function diff(left: VTree, right: VTree): VPatch[]; /** patch() usually just returns rootNode after doing stuff to it, so we want From 5bf40c59d1cc2c29a79dbfa9e09892d43d2f21d7 Mon Sep 17 00:00:00 2001 From: Nick Lee Date: Sat, 16 May 2015 15:25:33 -0400 Subject: [PATCH 0036/2220] Added an interface for the object returned during synchronous validations. --- joi/joi.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/joi/joi.d.ts b/joi/joi.d.ts index 951fc40457..ad9eb174d5 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -61,6 +61,11 @@ declare module 'joi' { options?: ValidationOptions; } + export interface ValidationResult { + error: ValidationError; + value: T; + } + export interface SchemaMap { [key: string]: Schema; } @@ -461,8 +466,7 @@ declare module 'joi' { */ export function validate(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void; export function validate(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void; - export function validate(value: T, schema: Schema, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void; - export function validate(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void; + export function validate(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): ValidationResult; /** * Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object). From c068c64bce9a2cfe7826e46dfe69a922978f9952 Mon Sep 17 00:00:00 2001 From: gandjustas Date: Sun, 17 May 2015 00:47:08 +0300 Subject: [PATCH 0037/2220] Refactored sharepoint.d.ts to use microsoft.ajax.d.ts, added\fixed some definitions --- README.md | 0 angularjs/angular.d.ts | 0 chrome/chrome.d.ts | 0 microsoft-ajax/microsoft.ajax.d.ts | 992 ++++++----------- sharepoint/SharePoint.d.ts | 1642 ++++++++++++++++++++++++---- 5 files changed, 1768 insertions(+), 866 deletions(-) mode change 100644 => 100755 README.md mode change 100755 => 100644 angularjs/angular.d.ts mode change 100755 => 100644 chrome/chrome.d.ts diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts old mode 100755 new mode 100644 diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts old mode 100755 new mode 100644 diff --git a/microsoft-ajax/microsoft.ajax.d.ts b/microsoft-ajax/microsoft.ajax.d.ts index 1c8968f440..7100b8c515 100644 --- a/microsoft-ajax/microsoft.ajax.d.ts +++ b/microsoft-ajax/microsoft.ajax.d.ts @@ -18,7 +18,7 @@ * Object Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb397554(v=vs.100).aspx} */ -interface Object { +interface ObjectConstructor { /** * Formats a number by using the invariant culture. */ @@ -34,173 +34,9 @@ interface Object { * Array Type Extensions * @see {@link http://msdn.microsoft.com/en-us/library/bb383786(v=vs.100).aspx} */ -interface Array { - - //#region lib.d.ts - - new (arrayLength?: number): any[]; - new (arrayLength: number): T[]; - new (...items: T[]): T[]; - (arrayLength?: number): any[]; - (arrayLength: number): T[]; - (...items: T[]): T[]; - isArray(arg: any): boolean; - prototype: Array; - - ///** - // * Returns a string representation of an array. - // */ - //toString(): string; - //toLocaleString(): string; - ///** - // * Combines two or more arrays. - // * @param items Additional items to add to the end of array1. - // */ - //concat(...items: U[]): T[]; - ///** - // * Combines two or more arrays. - // * @param items Additional items to add to the end of array1. - // */ - //concat(...items: T[]): T[]; - ///** - // * Adds all the elements of an array separated by the specified separator string. - // * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. - // */ - //join(separator?: string): string; - ///** - // * Removes the last element from an array and returns it. - // */ - //pop(): T; - ///** - // * Appends new elements to an array, and returns the new length of the array. - // * @param items New elements of the Array. - // */ - //push(...items: T[]): number; - ///** - // * Reverses the elements in an Array. - // */ - //reverse(): T[]; - ///** - // * Removes the first element from an array and returns it. - // */ - //shift(): T; - ///** - // * Returns a section of an array. - // * @param start The beginning of the specified portion of the array. - // * @param end The end of the specified portion of the array. - // */ - //slice(start?: number, end?: number): T[]; - - ///** - // * Sorts an array. - // * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order. - // */ - //sort(compareFn?: (a: T, b: T) => number): T[]; - - ///** - // * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - // * @param start The zero-based location in the array from which to start removing elements. - // */ - //splice(start: number): T[]; - - ///** - // * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - // * @param start The zero-based location in the array from which to start removing elements. - // * @param deleteCount The number of elements to remove. - // * @param items Elements to insert into the array in place of the deleted elements. - // */ - //splice(start: number, deleteCount: number, ...items: T[]): T[]; - - ///** - // * Inserts new elements at the start of an array. - // * @param items Elements to insert at the start of the Array. - // */ - //unshift(...items: T[]): number; - - ///** - // * Returns the index of the first occurrence of a value in an array. - // * @param searchElement The value to locate in the array. - // * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. - // */ - //indexOf(searchElement: T, fromIndex?: number): number; - - ///** - // * Returns the index of the last occurrence of a specified value in an array. - // * @param searchElement The value to locate in the array. - // * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array. - // */ - //lastIndexOf(searchElement: T, fromIndex?: number): number; - - ///** - // * Determines whether all the members of an array satisfy the specified test. - // * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. - // * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - // */ - //every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - ///** - // * Determines whether the specified callback function returns true for any element of an array. - // * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. - // * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - // */ - //some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; - - ///** - // * Performs the specified action for each element in an array. - // * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. - // * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - // */ - //forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; - - ///** - // * Calls a defined callback function on each element of an array, and returns an array that contains the results. - // * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. - // * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - // */ - //map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; - - ///** - // * Returns the elements of an array that meet the condition specified in a callback function. - // * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array. - // * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. - // */ - //filter(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; - - ///** - // * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - // * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - // * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - // */ - //reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - ///** - // * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - // * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - // * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - // */ - //reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - ///** - // * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - // * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - // * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - // */ - //reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; - ///** - // * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. - // * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - // * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. - // */ - //reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; - - ///** - // * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array. - // */ - //length: number; - - //[n: number]: T; - - //#endregion +interface ArrayConstructor { + //#region Extensions /** @@ -210,55 +46,55 @@ interface Array { * @param item * */ - add(array: any[], element: any): void; + add(array: T[], element: T): void; /** * Copies all the elements of the specified array to the end of an Array object. */ - addRange(array: any, items: any): void; + addRange(array: T[], items: T[]): void; /** * Removes all elements from an Array object. */ - clear(): void; + clear(array: T[]): void; /** * Creates a shallow copy of an Array object. */ - clone(): any[]; + clone(array: T[]): T[]; /** * Determines whether an element is in an Array object. */ - contains(element: any): boolean; + contains(array: T[], element: T): boolean; /** * Removes the first element from an Array object. */ - dequeue(): any; + dequeue(array: T[]): T; /** * Adds an element to the end of an Array object. Use the add function instead of the Array.enqueue function. */ - enqueue(element: any): void; + enqueue(array: T[], element: T): void; /** * Performs a specified action on each element of an Array object. */ - forEach(array: any[], method: Function, instance: any[]): void; + forEach(array: T[], method: (element: T, index: number, array: T[]) => void, instance: any): void; /** * Searches for the specified element of an Array object and returns its index. */ - indexOf(array: any[], item: any, startIndex?: number): number; + indexOf(array: T[], item: T, startIndex?: number): number; /** * Inserts a value at the specified location in an Array object. */ - insert(array: any[], index: number, item: any); + insert(array: T[], index: number, item: T): void; /** * Creates an Array object from a string representation. */ - parse(value: string): any[]; + parse(value: string): T[]; /** * Removes the first occurrence of an element in an Array object. */ - remove(array: any[], item: any): boolean; + remove(array: T[], item: T): boolean; /** * Removes an element at the specified location in an Array object. */ - removeAt(array: any[], index: number): void; + removeAt(array: T[], index: number): void; //#endregion } @@ -277,6 +113,10 @@ interface Number { * Formats a number by using the current culture. */ localeFormat(format: string): string; +} + +interface NumberConstructor { + /** * Returns a numeric value from a string representation of a number. This function is static and can be called without creating an instance of the object. */ @@ -297,11 +137,14 @@ interface Date { /** * Formats a date by using the invariant (culture-independent) culture. */ - format(value: string): string; + format(format: string): string; /** * Formats a date by using the current culture. This function is static and can be invoked without creating an instance of the object. */ - localeFormat(value: string): string; + localeFormat(format: string): string; +} + +interface DateConstructor { /** * Creates a date from a locale-specific string by using the current culture. This function is static and can be invoked without creating an instance of the object. * @exception (Debug) formats contains an invalid format. @@ -310,9 +153,8 @@ interface Date { * @param formats * (Optional) An array of custom formats. */ - parseLocale(value: string): string; - parseLocale(value: string, formats?: string[]): string; - parseLocale(value: string, ...formats: string[]): string; + parseLocale(value: string, formats?: string[]): Date; + parseLocale(value: string, ...formats: string[]): Date; /** * Creates a date from a string by using the invariant culture. This function is static and can be invoked without creating an instance of the object. * @return If value is a valid string representation of a date in the invariant format, an object of type Date; otherwise, null. @@ -321,352 +163,172 @@ interface Date { * @param formats * (Optional) An array of custom formats. */ - parseInvariant(value: string): string; parseInvariant(value: string, formats?: string[]): string; parseInvariant(value: string, ...formats: string[]): string; } -declare module MicrosoftAjaxBaseTypeExtensions { + +/** +* Provides static functions that extend the built-in ECMAScript (JavaScript) Function type by including exception +* details and support for application-compilation modes (debug or release). +* @see {@link http://msdn.microsoft.com/en-us/library/dd409270(v=vs.100).aspx} +*/ +interface FunctionConstructor { + + //#region Extensions /** - * Provides static functions that extend the built-in ECMAScript (JavaScript) Function type by including exception - * details and support for application-compilation modes (debug or release). - * @see {@link http://msdn.microsoft.com/en-us/library/dd409270(v=vs.100).aspx} - */ - interface Function { - - //#region lib.d.ts - - /** - * Creates a new function. - * @param args A list of arguments the function accepts. - */ - new (...args: string[]): Function; - (...args: string[]): Function; - prototype: Function; - - //#endregion - - //#region Extensions - - /** - * Creates a delegate function that retains the context first used during an objects creation. - * @see {@link http://msdn.microsoft.com/en-us/library/dd393582(v=vs.100).aspx } - */ - createCallback(method: Function, ...context: any[]): Function; - /** - * Creates a callback function that retains the parameter initially used during an object's creation. - * @see {@link http://msdn.microsoft.com/en-us/library/dd409287(v=vs.100).aspx } - */ - createDelegate(instance: any, method: Function): Function; - - /** - * A function that does nothing. - * @see {@link http://msdn.microsoft.com/en-us/library/dd393667(v=vs.100).aspx } - */ - emptyMethod(): Function; - - /** - * Validates the parameters to a method are as expected. - * @see {@link http://msdn.microsoft.com/en-us/library/dd393712(v=vs.100).aspx } - */ - validateParameters(parameters: any, expectedParameters: Object[], validateParameterCount?: boolean): any; - - //#endregion - } + * Creates a delegate function that retains the context first used during an objects creation. + * @see {@link http://msdn.microsoft.com/en-us/library/dd393582(v=vs.100).aspx } + */ + createCallback(method: Function, ...context: any[]): Function; + /** + * Creates a callback function that retains the parameter initially used during an object's creation. + * @see {@link http://msdn.microsoft.com/en-us/library/dd409287(v=vs.100).aspx } + */ + createDelegate(instance: any, method: Function): Function; /** - * Provides static functions that extend the built-in ECMAScript (JavaScript) Error type by including exception details and support for application-compilation modes (debug or release). - * Error Type Extensions - * @see {@link http://msdn.microsoft.com/en-us/library/bb310947(v=vs.100).aspx} - */ - interface Error { - - //#region lib.d.ts - - name: string; - message: string; - - new (message?: string): Error; - (message?: string): Error; - prototype: Error; - - //#endregion - - //#region Extensions - - /** - * Creates an Error object that represents the Sys.ParameterCountException exception. - */ - parameterCount(message?: string): Error; - /** - * Creates an Error object that represents the Sys.NotImplementedException exception. - */ - notImplemented(message?: string): Error; - /** - * Creates an Error object that represents the Sys.ArgumentException exception. - */ - argument(paramName?: any, message?: string): Error; - /** - * Creates an Error object that represents the Sys.ArgumentNullException exception. - */ - argumentNull(paramName?: any, message?: string): Error; - /** - * Creates an Error object that represents the Sys.ArgumentOutOfRangeException exception. - */ - argumentOutOfRange(paramName?: string, actualValue?: any, message?: string): Error; - /** - * Creates an Error object that represents the Sys.ArgumentTypeException exception. - */ - argumentType(paramName?: string, actualType?: any, expectedType?: any, message?: string): Error; - /** - * Creates an Error object that represents the Sys.ArgumentUndefinedException exception. - */ - argumentUndefined(paramName?: string, message?: string): Error; - /** - * Creates an Error object that can contain additional error information. - */ - create(message?: string, errorInfo?: Object): Error; - /** - * Creates an Error object that represents the Sys.FormatException exception. - */ - format(message?: string): Error; - /** - * Creates an Error object that represents the Sys.InvalidOperationException exception. - */ - invalidOperation(message?: string): Error; - /** - * Updates the fileName and lineNumber properties of an Error instance to indicate where the error was thrown instead of where the error was created. Use this function if you are creating custom error types. - */ - popStackFrame(): void; - - //#endregion - } + * A function that does nothing. + * @see {@link http://msdn.microsoft.com/en-us/library/dd393667(v=vs.100).aspx } + */ + emptyMethod(): Function; /** - * Provides extensions to the base ECMAScript (JavaScript) String object by including static and instance methods. - * String Type Extensions - * @see {@link http://msdn.microsoft.com/en-us/library/bb397472(v=vs.100).aspx} - */ - interface String { + * Validates the parameters to a method are as expected. + * @see {@link http://msdn.microsoft.com/en-us/library/dd393712(v=vs.100).aspx } + */ + validateParameters(parameters: any, expectedParameters: Object[], validateParameterCount?: boolean): any; - //#region lib.d.ts + //#endregion +} - new (value?: any): String; - (value?: any): string; - prototype: String; - fromCharCode(...codes: number[]): string; +/** +* Provides static functions that extend the built-in ECMAScript (JavaScript) Error type by including exception details and support for application-compilation modes (debug or release). +* Error Type Extensions +* @see {@link http://msdn.microsoft.com/en-us/library/bb310947(v=vs.100).aspx} +*/ +interface ErrorConstructor { - /** Returns a string representation of a string. */ - toString(): string; - - /** - * Returns the character at the specified index. - * @param pos The zero-based index of the desired character. - */ - charAt(pos: number): string; - - /** - * Returns the Unicode value of the character at the specified location. - * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned. - */ - charCodeAt(index: number): number; - - /** - * Returns a string that contains the concatenation of two or more strings. - * @param strings The strings to append to the end of the string. - */ - concat(...strings: string[]): string; - - /** - * Returns the position of the first occurrence of a substring. - * @param searchString The substring to search for in the string - * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string. - */ - indexOf(searchString: string, position?: number): number; - - /** - * Returns the last occurrence of a substring in the string. - * @param searchString The substring to search for. - * @param position The index at which to begin searching. If omitted, the search begins at the end of the string. - */ - lastIndexOf(searchString: string, position?: number): number; - - /** - * Determines whether two strings are equivalent in the current locale. - * @param that String to compare to target string - */ - localeCompare(that: string): number; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A variable name or string literal containing the regular expression pattern and flags. - */ - match(regexp: string): string[]; - - /** - * Matches a string with a regular expression, and returns an array containing the results of that search. - * @param regexp A regular expression object that contains the regular expression pattern and applicable flags. - */ - match(regexp: RegExp): string[]; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: string, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A String object or string literal that represents the regular expression - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: string, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A String object or string literal containing the text to replace for every successful match of rgExp in stringObj. - */ - replace(searchValue: RegExp, replaceValue: string): string; - - /** - * Replaces text in a string, using a regular expression or search string. - * @param searchValue A Regular Expression object containing the regular expression pattern and applicable flags - * @param replaceValue A function that returns the replacement text. - */ - replace(searchValue: RegExp, replaceValue: (substring: string, ...args: any[]) => string): string; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: string): number; - - /** - * Finds the first substring match in a regular expression search. - * @param regexp The regular expression pattern and applicable flags. - */ - search(regexp: RegExp): number; - - /** - * Returns a section of a string. - * @param start The index to the beginning of the specified portion of stringObj. - * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end. - * If this value is not specified, the substring continues to the end of stringObj. - */ - slice(start?: number, end?: number): string; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: string, limit?: number): string[]; - - /** - * Split a string into substrings using the specified separator and return them as an array. - * @param separator A Regular Express that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned. - * @param limit A value used to limit the number of elements returned in the array. - */ - split(separator: RegExp, limit?: number): string[]; - - /** - * Returns the substring at the specified location within a String object. - * @param start The zero-based index number indicating the beginning of the substring. - * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end. - * If end is omitted, the characters from start through the end of the original string are returned. - */ - substring(start: number, end?: number): string; - - /** Converts all the alphabetic characters in a string to lowercase. */ - toLowerCase(): string; - - /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */ - toLocaleLowerCase(): string; - - /** Converts all the alphabetic characters in a string to uppercase. */ - toUpperCase(): string; - - /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */ - toLocaleUpperCase(): string; - - /** Returns the length of a String object. */ - length: number; - - // IE extensions - /** - * Gets a substring beginning at the specified location and having the specified length. - * @param from The starting position of the desired substring. The index of the first character in the string is zero. - * @param length The number of characters to include in the returned substring. - */ - substr(from: number, length?: number): string; - - [index: number]: string; - - //#endregion - - //#region Extensions - - /** - * Formats a number by using the invariant culture. - * @returns true if the end of the String object matches suffix; otherwise, false. - */ - endsWith(suffix: string): boolean; - /** - * Replaces each format item in a String object with the text equivalent of a corresponding object's value. - * @returns A copy of the string with the formatting applied. - */ - format(format: string, ...args: any[]): string; - /** - * Replaces the format items in a String object with the text equivalent of a corresponding object's value. The current culture is used to format dates and numbers. - * @returns A copy of the string with the formatting applied. - */ - localeFormat(format: string, ...args: any[]): string; - /** - * Removes leading and trailing white-space characters from a String object. - * @returns A copy of the string with all white-space characters removed from the start and end of the string. - */ - trim(): string; - /** - * Removes trailing white-space characters from a String object. - * @returns A copy of the string with all white-space characters removed from the end of the string. - */ - trimEnd(): string; - /** - * Removes leading white-space characters from a String object. - * @returns A copy of the string with all white-space characters removed from the start of the string. - */ - trimStart(): string; - - //#endregion - } + //#region Extensions /** - * Provides extensions to the base ECMAScript (JavaScript) Boolean object. - * Boolean Type Extensions - * @see {@link http://msdn.microsoft.com/en-us/library/bb397557(v=vs.100).aspx} + * Creates an Error object that represents the Sys.ParameterCountException exception. */ - interface Boolean { + parameterCount(message?: string): Error; + /** + * Creates an Error object that represents the Sys.NotImplementedException exception. + */ + notImplemented(message?: string): Error; + /** + * Creates an Error object that represents the Sys.ArgumentException exception. + */ + argument(paramName?: any, message?: string): Error; + /** + * Creates an Error object that represents the Sys.ArgumentNullException exception. + */ + argumentNull(paramName?: any, message?: string): Error; + /** + * Creates an Error object that represents the Sys.ArgumentOutOfRangeException exception. + */ + argumentOutOfRange(paramName?: string, actualValue?: any, message?: string): Error; + /** + * Creates an Error object that represents the Sys.ArgumentTypeException exception. + */ + argumentType(paramName?: string, actualType?: any, expectedType?: any, message?: string): Error; + /** + * Creates an Error object that represents the Sys.ArgumentUndefinedException exception. + */ + argumentUndefined(paramName?: string, message?: string): Error; + /** + * Creates an Error object that can contain additional error information. + */ + create(message?: string, errorInfo?: Object): Error; + /** + * Creates an Error object that represents the Sys.FormatException exception. + */ + format(message?: string): Error; + /** + * Creates an Error object that represents the Sys.InvalidOperationException exception. + */ + invalidOperation(message?: string): Error; - //#region lib.d.ts - new (value?: any): Boolean; - (value?: any): boolean; - prototype: Boolean; + //#endregion +} - //#endregion +interface Error { + /** + * Updates the fileName and lineNumber properties of an Error instance to indicate where the error was thrown instead of where the error was created. Use this function if you are creating custom error types. + */ + popStackFrame(): void; +} - //#region Extensions - /** - * Converts a string representation of a logical value to its Boolean object equivalent. - */ - parse(value: string): Boolean; - //#endregion - } +interface String { + + //#region Extensions + + /** + * Formats a number by using the invariant culture. + * @returns true if the end of the String object matches suffix; otherwise, false. + */ + endsWith(suffix: string): boolean; + + /** + * Removes leading and trailing white-space characters from a String object. + * @returns A copy of the string with all white-space characters removed from the start and end of the string. + */ + trim(): string; + /** + * Removes trailing white-space characters from a String object. + * @returns A copy of the string with all white-space characters removed from the end of the string. + */ + trimEnd(): string; + /** + * Removes leading white-space characters from a String object. + * @returns A copy of the string with all white-space characters removed from the start of the string. + */ + trimStart(): string; + + //#endregion +} + +/** +* Provides extensions to the base ECMAScript (JavaScript) String object by including static and instance methods. +* String Type Extensions +* @see {@link http://msdn.microsoft.com/en-us/library/bb397472(v=vs.100).aspx} +*/ +interface StringConstructor { + /** +* Replaces each format item in a String object with the text equivalent of a corresponding object's value. +* @returns A copy of the string with the formatting applied. +*/ + format(format: string, ...args: any[]): string; + /** + * Replaces the format items in a String object with the text equivalent of a corresponding object's value. The current culture is used to format dates and numbers. + * @returns A copy of the string with the formatting applied. + */ + localeFormat(format: string, ...args: any[]): string; +} + + +/** +* Provides extensions to the base ECMAScript (JavaScript) Boolean object. +* Boolean Type Extensions +* @see {@link http://msdn.microsoft.com/en-us/library/bb397557(v=vs.100).aspx} +*/ +interface BooleanConstructor { + + //#region Extensions + + /** + * Converts a string representation of a logical value to its Boolean object equivalent. + */ + parse(value: string): Boolean; + + //#endregion } //#endregion @@ -908,7 +570,7 @@ declare function $find(id: string, parent?: HTMLElement): Sys.Component; * @param handler The event handler to add. * @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ -declare function $addHandler(element: Sys.UI.DomElement, eventName: string, handler: Function, autoRemove?: boolean): void; +declare function $addHandler(element: HTMLElement, eventName: string, handler: (e: Sys.UI.DomEvent) => void, autoRemove?: boolean): void; /** * Provides a shortcut to the addHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. @@ -918,7 +580,7 @@ declare function $addHandler(element: Sys.UI.DomElement, eventName: string, hand * @param handlerOwner (Optional) The object instance that is the context for the delegates that should be created from the handlers. * @param autoRemove (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ -declare function $addHandlers(element: Sys.UI.DomElement, events: any, handlerOwner?: any, autoRemove?: boolean): void; +declare function $addHandlers(element: HTMLElement, events: { [event: string]: (e: Sys.UI.DomEvent) => void }, handlerOwner?: any, autoRemove?: boolean): void; /** * Provides a shortcut to the clearHandlers method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. @@ -926,21 +588,19 @@ declare function $addHandlers(element: Sys.UI.DomElement, events: any, handlerOw * @see {@link http://msdn.microsoft.com/en-us/library/bb310959(v=vs.100).aspx} * @param The DOM element that exposes the events. */ -declare function $clearHandlers(element: Sys.UI.DomElement): void; +declare function $clearHandlers(element: HTMLElement): void; /** -* Provides a shortcut to the getElementById method of the Sys.UI.DomElement class. This member is static and can be invoked without creating an instance of the class. +* Provides a shortcut to the getElementById method of the HTMLElement class. This member is static and can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb397717(v=vs.100).aspx} * @param id * The ID of the DOM element to find. * @param element * The parent element to search. The default is the document element. * @return -* The Sys.UI.DomElement +* The HTMLElement */ -declare function $get(id: string): any; // Examples use HTMLElement and DomElement declare function $get(id: string, element?: HTMLElement): HTMLElement; -declare function $get(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement; /** * Provides a shortcut to the removeHandler method of the Sys.UI.DomEvent class. This member is static and can be invoked without creating an instance of the class. @@ -949,9 +609,7 @@ declare function $get(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElemen * @param eventName The name of the DOM event. * @param handler The event handler to remove. */ -declare function $removeHandler(element: any, eventName: string, handler: Function): void; -declare function $removeHandler(element: HTMLElement, eventName: string, handler: Function): void; -declare function $removeHandler(element: Sys.UI.DomElement, eventName: string, handler: Function): void; +declare function $removeHandler(element: HTMLElement, eventName: string, handler: (e: Sys.UI.DomEvent) => void): void; //#endregion @@ -973,7 +631,7 @@ declare module Sys { * The members can be invoked without creating an instance of the class. * @see {@link http://msdn.microsoft.com/en-us/library/bb384161(v=vs.100).aspx} */ - interface Application { + interface Application extends Component, IContainer { //#region Constructors @@ -986,27 +644,27 @@ declare module Sys { /** * Raised after all scripts have been loaded but before objects are created. */ - add_init(handler: Function): void; + add_init(handler: (sender: Application, eventArgs: EventArgs) => void): void; /** * Raised after all scripts have been loaded but before objects are created. */ - remove_init(handler: Function): void; + remove_init(handler: (sender: Application, eventArgs: EventArgs) => void): void; /** * Raised after all scripts have been loaded and after the objects in the application have been created and initialized. */ - add_load(handler: Function): void; + add_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void): void; /** * Raised after all scripts have been loaded and after the objects in the application have been created and initialized. */ - remove_load(handler: Function): void; + remove_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void): void; /** * Occurs when the user clicks the browser's Back or Forward button. */ - add_navigate(handler: Function): void; + add_navigate(handler: (sender: Application, eventArgs: HistoryEventArgs) => void): void; /** * Occurs when the user clicks the browser's Back or Forward button. */ - remove_navigate(handler: Function): void; + remove_navigate(handler: (sender: Application, eventArgs: HistoryEventArgs) => void): void; /** * Raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised. @@ -2175,67 +1833,67 @@ declare module Sys { //#endregion //#region Exception Types + // Really not a types + ///** + //* Raised when a function or method is invoked and at least one of the passed arguments does not meet the parameter specification of the called function or method. + //*/ + //class ArgumentException { - /** - * Raised when a function or method is invoked and at least one of the passed arguments does not meet the parameter specification of the called function or method. - */ - class ArgumentException { + //} + ///** + //* Raised when an argument has an invalid value of null. + //*/ + //class ArgumentNullException { - } - /** - * Raised when an argument has an invalid value of null. - */ - class ArgumentNullException { + //} + ///** + //* Raised when an argument value is outside an acceptable range. + //*/ + //class ArgumentOutOfRangeException { - } - /** - * Raised when an argument value is outside an acceptable range. - */ - class ArgumentOutOfRangeException { + //} + ///** + //* Raised when a parameter is not an allowed type. + //*/ + //class ArgumentTypeException { - } - /** - * Raised when a parameter is not an allowed type. - */ - class ArgumentTypeException { + //} + ///** + //* Raised when an argument for a required method parameter is undefined. + //*/ + //class ArgumentUndefinedException { - } - /** - * Raised when an argument for a required method parameter is undefined. - */ - class ArgumentUndefinedException { + //} + ///** + //* + //*/ + //class FormatException { - } - /** - * - */ - class FormatException { + //} + ///** + //* Raised when a call to a method has failed, but the reason was not invalid arguments. + //*/ + //class InvalidOperationException { - } - /** - * Raised when a call to a method has failed, but the reason was not invalid arguments. - */ - class InvalidOperationException { + //} + ///** + //* Raised when a requested method is not supported by an object. + //*/ + //class NotImplementedException { - } - /** - * Raised when a requested method is not supported by an object. - */ - class NotImplementedException { + //} + ///** + //* Raised when an invalid number of arguments have been passed to a function. + //*/ + //class ParameterCountException { - } - /** - * Raised when an invalid number of arguments have been passed to a function. - */ - class ParameterCountException { + //} + ///** + //* Raised by the Microsoft Ajax Library framework when a script does not load successfully. This exception should not be thrown by the developer. + //*/ + //class ScriptLoadFailedException { - } - /** - * Raised by the Microsoft Ajax Library framework when a script does not load successfully. This exception should not be thrown by the developer. - */ - class ScriptLoadFailedException { - - } + //} //#endregion @@ -2252,7 +1910,28 @@ declare module Sys { * Enables your application to call Web services asynchronously by using ECMAScript (JavaScript). * @see {@link http://msdn.microsoft.com/en-us/library/bb310823(v=vs.100).aspx} */ - // Cannot create definitions for generated proxy classes. + class WebServiceProxy { + static invoke( + servicePath: string, + methodName: string, + useGet?: boolean, + params?: any, + onSuccess?: (result: string, eventArgs: EventArgs) => void, + onFailure?: (error: WebServiceError) => void, + userContext?: any, + timeout?: number, + enableJsonp?: boolean, + jsonpCallbackParameter?: string): WebRequest; + } + + class WebServiceError { + get_errorObject(): any; + get_exceptionType(): any; + get_message(): string; + get_stackTrace(): string; + get_statusCode(): number; + get_timedOut(): boolean; + } /** * Contains information about a Web request that is ready to be sent to the current Sys.Net.WebRequestExecutor instance. @@ -2261,7 +1940,7 @@ declare module Sys { * * @see {@link http://msdn.microsoft.com/en-us/library/bb397488(v=vs.100).aspx} */ - class NetWorkRequestEventArgs { + class NetworkRequestEventArgs { //#region Constructors @@ -2310,6 +1989,19 @@ declare module Sys { //#endregion //#region Members + get_url(): string; + set_url(value: string): void; + get_httpVerb(): string; + set_httpVerb(value: string): void; + get_timeout(): number; + set_timeout(value: number): void; + get_body(): string; + set_body(value: string): void; + get_headers(): { [key: string]: string; }; + get_userContext(): any; + set_userContext(value: any): void; + get_executor(): WebRequestExecutor; + set_executor(value: WebRequestExecutor): void; /** * Registers a handler for the completed request event of the Web request. @@ -2387,7 +2079,7 @@ declare module Sys { * Gets the value of the specified response header. * @return The specified response header. */ - getResponseHeader(): string; + getResponseHeader(key: string): string; //#endregion @@ -2478,13 +2170,13 @@ declare module Sys { * @param handler * The function registered to handle the completed request event. */ - add_completedRequest(handler: (sender: any, eventArgs: any) => void): void; + add_completedRequest(handler: (sender: WebRequestExecutor, eventArgs: EventArgs) => void): void; /** * Registers a handler for processing the invoking request event of the WebRequestManager. * @param handler * The function registered to handle the invoking request event. */ - add_invokingRequest(handler: (sender: any, networkRequestEventArgs: any) => void): void; + add_invokingRequest(handler: (sender: WebRequestExecutor, networkRequestEventArgs: NetworkRequestEventArgs) => void): void; /** * Sends Web requests to the default network executor. * This member supports the client-script infrastructure and is not intended to be used directly from your code. @@ -2498,14 +2190,14 @@ declare module Sys { * @param handler * The function that handles the completed request event. */ - remove_completedRequest(handler: Function): void; + remove_completedRequest(handler: (sender: WebRequestExecutor, eventArgs: EventArgs) => void): void; /** * Removes the event handler set by the add_invokingRequest method. * Use the remove_invokingRequest method to remove the event handler you set using the add_invokingRequest method. * @param handler * The function that handles the invoking request event. */ - remove_invokingRequest(handler: Function): void; + remove_invokingRequest(handler: (sender: WebRequestExecutor, networkRequestEventArgs: NetworkRequestEventArgs) => void): void; //#endregion @@ -2943,16 +2635,16 @@ declare module Sys { * Gets a Sys.UI.Behavior instance with the specified name property from the specified HTML Document Object Model (DOM) element. This member a static member and can be invoked without creating an instance of the class. * @return The specified Behavior object, if found; otherwise, null. */ - static getBehaviorByName(element: Sys.UI.DomElement, name: string): Behavior; + static getBehaviorByName(element: HTMLElement, name: string): Behavior; /** * Gets an array of Sys.UI.Behavior objects that are of the specified type from the specified HTML Document Object Model (DOM) element. This method is static and can be invoked without creating an instance of the class. * @return An array of all Behavior objects of the specified type that are associated with the specified DOM element, if found; otherwise, an empty array. */ - static getBehaviorsByType(element: Sys.UI.DomElement, type: Sys.UI.Behavior): Behavior[]; + static getBehaviorsByType(element: HTMLElement, type: Sys.UI.Behavior): Behavior[]; /** * Gets the Sys.UI.Behavior objects that are associated with the specified HTML Document Object Model (DOM) element. This member is static and can be invoked without creating an instance of the class. * @param element - * The Sys.UI.DomElement object to search. + * The HTMLElement object to search. * @return An array of references to Behavior objects, or null if no references exist. */ static getBehaviors(element: DomElement): Behavior[]; @@ -2971,10 +2663,10 @@ declare module Sys { * Gets the HTML Document Object Model (DOM) element that the current Sys.UI.Behavior object is associated with. * @return The DOM element that the current Behavior object is associated with. */ - get_element(): Sys.UI.DomElement; + get_element(): HTMLElement; /** * Gets or sets the identifier for the Sys.UI.Behavior object. - * A generated identifier that consists of the ID of the associated Sys.UI.DomElement, the "$" character, and the name value of the Behavior object. + * A generated identifier that consists of the ID of the associated HTMLElement, the "$" character, and the name value of the Behavior object. */ get_id(): string; /** @@ -3050,11 +2742,11 @@ declare module Sys { * When called from a derived class, initializes a new instance of that class. * The Control constructor is a complete constructor function. However, because the Control class is an abstract base class, the constructor should be called only from derived classes. * @param element - * The Sys.UI.DomElement object that the control will be associated with. + * The HTMLElement object that the control will be associated with. * * @throws Error.invalidOperation Function */ - constructor(element: Sys.UI.DomElement); + constructor(element: HTMLElement); //#endregion @@ -3122,6 +2814,33 @@ declare module Sys { toggleCssClass(className: string): void; //#endregion + + //#region Properties + + /** + * Gets the HTML Document Object Model (DOM) element that the current Sys.UI.Control object is associated with. + * @return The DOM element that the current Control object is associated with. + */ + get_element(): HTMLElement; + /** + * Gets or sets the identifier for the Sys.UI.Control object. + * A generated identifier that consists of the ID of the associated HTMLElement, the "$" character, and the name value of the Control object. + */ + get_id(): string; + /** + * Gets or sets the identifier for the Sys.UI.Control object. + * @param value + * The string value to use as the identifier. + */ + set_id(value: string): void; + /* + * Gets or sets the name of the Sys.UI.Control object. + * If you do not explicitly set the name property, getting the property value sets it to its default value, which is equal to the type of the Control object. The name property remains null until it is accessed. + * @param value + * A string value to use as the name. + */ + + //#endregion } /** * Defines static methods and properties that provide helper APIs for manipulating and inspecting DOM elements. @@ -3131,11 +2850,7 @@ declare module Sys { //#region Constructors - /** - * Initializes a new instance of the Sys.UI.DomElement class. - */ - constructor(): void; - + //#endregion //#region Methods @@ -3144,38 +2859,38 @@ declare module Sys { * Adds a CSS class to a DOM element if the class is not already part of the DOM element. This member is static and can be invoked without creating an instance of the class. * If the element does not support a CSS class, no change is made to the element. * @param element - * The Sys.UI.DomElement object to add the CSS class to. + * The HTMLElement object to add the CSS class to. * @param className * The name of the CSS class to add. */ - addCssClass(element: Sys.UI.DomElement, className: string): void; + addCssClass(element: HTMLElement, className: string): void; /** * Gets a value that indicates whether the DOM element contains the specified CSS class. This member is static and can be invoked without creating an instance of the class. * @param element - * The Sys.UI.DomElement object to test for the CSS class. + * The HTMLElement object to test for the CSS class. * @param className * The name of the CSS class to test for. * @return * true if the element contains the specified CSS class; otherwise, false. */ - containsCssClass(element: Sys.UI.DomElement, className: string): boolean; + containsCssClass(element: HTMLElement, className: string): boolean; /** * Gets a set of integer coordinates that represent the position, width, and height of a DOM element. This member is static and can be invoked without creating an instance of the class. * * @param element - * The Sys.UI.DomElement instance to get the coordinates of. + * The HTMLElement instance to get the coordinates of. * @return * An object of the JavaScript type Object that contains the x-coordinate and y-coordinate of the upper-left corner, the width, and the height of the element in pixels. */ - getBounds(element: Sys.UI.DomElement): Object; + getBounds(element: HTMLElement): { x: number; y: number; width: number; height: number; }; /** * @param id * The ID of the element to find. * @param element * (optional) The parent element to search in. The default is the document element. */ - getElementById(id: string): Sys.UI.DomElement; - getElementById(id: string, element?: Sys.UI.DomElement): Sys.UI.DomElement; + getElementById(id: string): HTMLElement; + getElementById(id: string, element?: HTMLElement): HTMLElement; getElementById(id: string, element?: HTMLElement): HTMLElement; getElementById(id: string, element: any): any; /** @@ -3185,17 +2900,15 @@ declare module Sys { * @return * An object of the JavaScript type Object that contains the x-coordinate and y-coordinate of the element in pixels. */ - getLocation(element: Sys.UI.DomElement): Sys.UI.Point; - getLocation(element: any): Object; + getLocation(element: HTMLElement): Sys.UI.Point; /* - * Returns a value that represents the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. This member is static and can be invoked without creating an instance of the class. + * Returns a value that represents the layout characteristics of a DOM element when it is hidden by invoking the HTMLElement.setVisible method. This member is static and can be invoked without creating an instance of the class. * @param element * The target DOM element. * @return * A Sys.UI.VisibilityMode enumeration value that indicates the layout characteristics of element when it is hidden by invoking the setVisible method. */ - getVisibilityMode(element: Sys.UI.DomElement): Sys.UI.VisibilityMode; - getVisibilityMode(element: any): Sys.UI.VisibilityMode; + getVisibilityMode(element: HTMLElement): Sys.UI.VisibilityMode; /** * Gets a value that indicates whether a DOM element is currently visible on the Web page. This member is static and can be invoked without creating an instance of the class. * @param element @@ -3219,16 +2932,15 @@ declare module Sys { * @param args * The event arguments */ - raiseBubbleEvent(source: Sys.UI.DomElement, args: EventArgs): void; - raiseBubbleEvent(source: any, args: any): void; + raiseBubbleEvent(source: HTMLElement, args: EventArgs): void; /** * Removes a CSS class from a DOM element. This member is static and can be invoked without creating an instance of the class. If the element does not include a CSS class, no change is made to the element. * @param element - * The Sys.UI.DomElement object to remove the CSS class from. + * The HTMLElement object to remove the CSS class from. * @param className * The name of the CSS class to remove. */ - removeCssClass(element: Sys.UI.DomElement, className: string): void; + removeCssClass(element: HTMLElement, className: string): void; removeCssClass(element: HTMLElement, className: string): void; removeCssClass(element: any, className: string): void; /** @@ -3241,9 +2953,7 @@ declare module Sys { * @return * A DOM element. */ - resolveElement(elementOrElementId: Sys.UI.DomElement, containerElement?: Sys.UI.DomElement): Sys.UI.DomElement; - resolveElement(elementOrElementId: HTMLElement, containerElement?: HTMLElement): HTMLElement; - resolveElement(elementOrElementId: string): any; + resolveElement(elementOrElementId: string|HTMLElement, containerElement?: HTMLElement): HTMLElement; /** * Sets the position of a DOM element. This member is static and can be invoked without creating an instance of the class. * he left and top style attributes (upper-left corner) of an element specify the relative position of an element. @@ -3252,14 +2962,12 @@ declare module Sys { * @param x The x-coordinate in pixels. * @param y The y-coordinate in pixels. */ - setLocation(element: Sys.UI.DomElement, x: number, y: number): void; setLocation(element: HTMLElement, x: number, y: number): void; - setLocation(element: any, x: number, y: number): void; /** - * Sets the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. + * Sets the layout characteristics of a DOM element when it is hidden by invoking the HTMLElement.setVisible method. * This member is static and can be invoked without creating an instance of the class. * - * Use the setVisibilityMode method to set the layout characteristics of a DOM element when it is hidden by invoking the Sys.UI.DomElement.setVisible method. + * Use the setVisibilityMode method to set the layout characteristics of a DOM element when it is hidden by invoking the HTMLElement.setVisible method. * For example, if value is set to Sys.UI.VisibilityMode.collapse, the element uses no space on the page when the setVisible method is called to hide the element. * * @param element @@ -3267,41 +2975,37 @@ declare module Sys { * @param value * A Sys.UI.VisibilityMode enumeration value. */ - setVisibilityMode(element: Sys.UI.DomElement, value: Sys.UI.VisibilityMode): void; + setVisibilityMode(element: HTMLElement, value: Sys.UI.VisibilityMode): void; /** * Sets a DOM element to be visible or hidden. This member is static and can be invoked without creating an instance of the class. * * Use the setVisible method to set a DOM element as visible or hidden on the Web page. * If you invoke this method with value set to false for an element whose visibility mode is set to "hide," the element will not be visible. * However, it will occupy space on the page. If the element's visibility mode is set to "collapse," the element will occupy no space in the page. - * For more information about how to set the layout characteristics of hidden DOM elements, see Sys.UI.DomElement setVisibilityMode Method. + * For more information about how to set the layout characteristics of hidden DOM elements, see HTMLElement setVisibilityMode Method. * * @param element * The target DOM element. * @param value * true to make element visible on the Web page; false to hide element. */ - setVisible(element: Sys.UI.DomElement, value: boolean): void; setVisible(element: HTMLElement, value: boolean): void; - setVisible(element: any, value: boolean): void; /** * Toggles a CSS class in a DOM element. This member is static and can be invoked without creating an instance of the class. * Use the toggleCssClass method to hide a CSS class of an element if it is shown, or to show a CSS class of an element if it is hidden. * * @param element - * The Sys.UI.DomElement object to toggle. + * The HTMLElement object to toggle. * @param className * The name of the CSS class to toggle. */ - toggleCssClass(element: Sys.UI.DomElement, className: string): void; toggleCssClass(element: HTMLElement, className: string): void; - toggleCssClass(element: any, className: string): void; //#endregion } - var DomElement: Sys.UI.DomElement; + var DomElement: DomElement; /** * Provides cross-browser access to DOM event properties and helper APIs that are used to attach handlers to DOM element events. @@ -3312,12 +3016,11 @@ declare module Sys { //#region Constructors /** - * Initializes a new instance of the Sys.UI.DomEvent class and associates it with the specified DomElement object. + * Initializes a new instance of the Sys.UI.DomEvent class and associates it with the specified HTMLElement object. * @param domElement - * The DomElement object to associate with the event. + * The HTMLElement object to associate with the event. */ - constructor(domElement: DomElement); - constructor(domElement: any); + constructor(domElement: HTMLElement); //#endregion @@ -3337,7 +3040,7 @@ declare module Sys { * @param autoRemove * (Optional) A boolean value that determines whether the handler should be removed automatically when the element is disposed. */ - static addHandler(element: any, eventName: string, handler: Function, autoRemove?: boolean): void; + static addHandler(element: HTMLElement, eventName: string, handler: (e: DomEvent) => void, autoRemove?: boolean); /** * Adds a list of DOM event handlers to the DOM element that exposes the events. This member is static and can be invoked without creating an instance of the class. * Use the addHandlers method to add a list of DOM event handlers to the element that exposes the event. @@ -3359,7 +3062,7 @@ declare module Sys { * @throws Error.invalidOperation - (Debug) One of the handlers specified in events is not a function. * */ - static addHandlers(element: any, events: any, handlerOwner?: any, autoRemove?: boolean): void; + static addHandlers(element: HTMLElement, events: { [event: string]: (e: DomEvent) => void }, handlerOwner?: any, autoRemove?: boolean): void; /** * Removes all DOM event handlers from a DOM element that were added through the Sys.UI.DomEvent addHandler or the Sys.UI.DomEvent addHandlers methods. * This member is static and can be invoked without creating an instance of the class. @@ -3368,7 +3071,7 @@ declare module Sys { * @param element * The element that exposes the events. */ - static clearHandlers(element: any): void; + static clearHandlers(element: HTMLElement): void; /** * Removes a DOM event handler from the DOM element that exposes the event. This member is static and can be invoked without creating an instance of the class. * @@ -3379,7 +3082,7 @@ declare module Sys { * @param handler * The event handler to remove. */ - static removeHandler(element: any, eventName: string, handler: Function): void; + static removeHandler(element: HTMLElement, eventName: string, handler: (e: DomEvent) => void): void; /** * Prevents the default DOM event action from happening. * Use the preventDefault method to prevent the default event action for the browser from occurring. @@ -3544,10 +3247,21 @@ declare module Sys { * Describes mouse button locations. */ enum MouseButton { - // todo + /** + * Represents the left mouse button. + */ + leftButton, + /** + * Represents the middle mouse button. + */ + middleButton, + /** + * Represents the right mouse button. + */ + rightButton } /** - * Creates an object that contains a set of integer coordinates that represent a position. The getLocation method of the Sys.UI.DomElement class returns a Point object. + * Creates an object that contains a set of integer coordinates that represent a position. The getLocation method of the HTMLElement class returns a Point object. * @see {@link http://msdn.microsoft.com/en-us/library/bb383992(v=vs.100).aspx} * */ class Point { @@ -3829,7 +3543,7 @@ declare module Sys { * The pageLoading event of the Sys.WebForms.PageRequestManager class uses a PageLoadingEventArgs object to return its event data. * @return An array of
elements that will be deleted from the DOM. If no elements will be deleted, the property returns null. */ - get_panelsDeleted(): HTMLDivElement[]; + get_panelsDeleting(): HTMLDivElement[]; /** * Gets an array of HTML
elements that represent UpdatePanel controls that will be updated in the DOM as a result of the current asynchronous postback. * If the contents of any UpdatePanel controls will be updated as the result of a partial-page update, the panelsUpdating property contains an array that references the corresponding
elements. diff --git a/sharepoint/SharePoint.d.ts b/sharepoint/SharePoint.d.ts index 1f7a2feaf4..026658ef8d 100644 --- a/sharepoint/SharePoint.d.ts +++ b/sharepoint/SharePoint.d.ts @@ -1,157 +1,13 @@ -// Type definitions for sptypescript +// Type definitions for sptypescript // Project: http://sptypescript.codeplex.com -// Definitions by: Stanislav Vyshchepan , Andrey Markeev +// Definitions by: Stanislav Vyshchepan and Andrey Markeev // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module Sys { - export class EventArgs { - static Empty: Sys.EventArgs; - } - export class StringBuilder { - /** Appends a string to the string builder */ - append(s: string): void; - /** Appends a line to the string builder */ - appendLine(s: string): void; - /** Clears the contents of the string builder */ - clear(): void; - /** Indicates wherever the string builder is empty */ - isEmpty(): boolean; - /** Gets the contents of the string builder as a string */ - toString(): string; - } - export class Component { - get_id(): string; - static create(type: Component, properties?: any, events?: any, references?: any, element?: Node); - initialize(): void; - updated(): void; - } - - export interface IContainer { - addComponent(component: Component): void; - findComponent(id: string): Component; - getComponents(): Component[]; - removeComponent(component: Component); - } - - export class Application extends Component implements IContainer { - addComponent(component: Component): void; - findComponent(id: string): Component; - getComponents(): Component[]; - removeComponent(component: Component); - - static add_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void); - static remove_load(handler: (sender: Application, eventArgs: ApplicationLoadEventArgs) => void); - } - - export class ApplicationLoadEventArgs { - constructor(components: Component[], isPartialLoad: boolean); - public components: Component[]; - public isPartialLoad: boolean; - } - - module UI { - export class Control extends Component { } - export class DomEvent { - static addHandler(element: HTMLElement, eventName: string, handler: (e: Event) => void); - static removeHandler(element: HTMLElement, eventName: string, handler: (e: Event) => void); - } - - export class DomElement { - static getBounds(element: HTMLElement): { x: number; y: number; width: number; height: number; }; - } - } - module Net { - export class WebRequest { - get_url(): string; - set_url(value: string): void; - get_httpVerb(): string; - set_httpVerb(value: string): void; - get_timeout(): number; - set_timeout(value: number): void; - get_body(): string; - set_body(value: string): void; - get_headers(): { [key: string]: string; }; - get_userContext(): any; - set_userContext(value: any): void; - get_executor(): WebRequestExecutor; - set_executor(value: WebRequestExecutor): void; - - getResolvedUrl(); string; - invoke(): void; - completed(args: Sys.EventArgs): void; - - add_completed(handler: (executor: WebRequestExecutor, args: Sys.EventArgs) => void): void; - remove_completed(handler: (executor: WebRequestExecutor, args: Sys.EventArgs) => void): void; - } - - export class WebRequestExecutor { - get_aborted(): boolean; - get_responseAvailable(): boolean; - get_responseData(): string; - get_object(): any; - get_started(): boolean; - get_statusCode(): number; - get_statusText(): string; - get_timedOut(): boolean; - get_xml(): Document; - get_webRequest(): WebRequest; - abort(): void; - executeRequest(): void; - getAllResponseHeaders(): string; - getResponseHeader(key: string): string; - } - - export class NetworkRequestEventArgs extends EventArgs { - get_webRequest(): WebRequest; - } - - - export class WebRequestManager { - static get_defaultExecutorType(): string; - static set_defaultExecutorType(value: string): void; - static get_defaultTimeout(): number; - static set_defaultTimeout(value: number): void; - - static executeRequest(request: WebRequest): void; - static add_completedRequest(handler: (executor: WebRequestExecutor, args: Sys.EventArgs) => void): void; - static remove_completedRequest(handler: (executor: WebRequestExecutor, args: Sys.EventArgs) => void): void; - static add_invokingRequest(handler: (executor: WebRequestExecutor, args: NetworkRequestEventArgs) => void): void; - static remove_invokingRequest(handler: (executor: WebRequestExecutor, args: NetworkRequestEventArgs) => void): void; - } - - export class WebServiceProxy { - static invoke( - servicePath: string, - methodName: string, - useGet?: boolean, - params?: any, - onSuccess?: (result: string, eventArgs: EventArgs) => void, - onFailure?: (error: WebServiceError) => void, - userContext?: any, - timeout?: number, - enableJsonp?: boolean, - jsonpCallbackParameter?: string): WebRequest; - } - - export class WebServiceError { - get_errorObject(): any; - get_exceptionType(): any; - get_message(): string; - get_stackTrace(): string; - get_statusCode(): number; - get_timedOut(): boolean; - } - } - interface IDisposable { - dispose(): void; - } - -} - -declare var $get: { (id: string): HTMLElement; }; -declare var $addHandler: { (element: HTMLElement, eventName: string, handler: (e: Event) => void): void; }; -declare var $removeHandler: { (element: HTMLElement, eventName: string, handler: (e: Event) => void): void; }; +/// +declare var _spBodyOnLoadFunctions: Function[]; +declare var _spBodyOnLoadFunctionNames: string[]; +declare var _spBodyOnLoadCalled: boolean; declare module SP { export class SOD { @@ -463,7 +319,8 @@ interface ContextInfo extends SPClientTemplates.RenderContext { } -declare function GetCurrentCtx():ContextInfo; +declare function GetCurrentCtx(): ContextInfo; +declare function SetFullScreenMode(fullscreen: boolean); declare module SP { export enum RequestExecutorErrors { requestAbortedOrTimedout, @@ -490,7 +347,7 @@ declare module SP { method?: string; headers?: { [key: string]: string; }; /** Can be string or bytearray depending on binaryStringRequestBody field */ - body?: any; + body?: string|Uint8Array; binaryStringRequestBody?: boolean; /** Currently need fix to get ginary response. Details: http://techmikael.blogspot.ru/2013/07/how-to-copy-files-between-sites-using.html */ @@ -509,7 +366,7 @@ declare module SP { headers?: { [key: string]: string; }; contentType?: string; /** Can be string or bytearray depending on request.binaryStringResponseBody field */ - body?: any; + body?: string|Uint8Array; state?: any; } @@ -1116,8 +973,8 @@ declare module SPClientTemplates { Type: string; } -/** Represents field schema in Grid mode and on list forms. - Consider casting objects of this type to more specific field types, e.g. FieldSchemaInForm_Lookup */ + /** Represents field schema in Grid mode and on list forms. + Consider casting objects of this type to more specific field types, e.g. FieldSchemaInForm_Lookup */ export interface FieldSchema_InForm extends FieldSchema { /** Description for this field. */ Description: string; @@ -1166,6 +1023,7 @@ declare module SPClientTemplates { FormUniqueId: string; ListData: ListData_InForm; ListSchema: ListSchema_InForm; + CSRCustomLayout?: boolean; } @@ -1389,7 +1247,7 @@ declare module SPClientTemplates { StateInitDone: boolean; TableCbxFocusHandler: any; TableMouseOverHandler: any; - TotalListItems: any; + TotalListItems: number; verEnabled: number; /** Guid of the view. */ view: string; @@ -1404,10 +1262,10 @@ declare module SPClientTemplates { } export interface RenderContext_FieldInView extends RenderContext_ItemInView { /** If in grid mode (context.inGridMode == true), cast to FieldSchema_InForm, otherwise cast to FieldSchema_InView */ - CurrentFieldSchema: any; + CurrentFieldSchema: FieldSchema_InForm | FieldSchema_InView; CurrentFieldValue: any; FieldControlsModes: { [fieldInternalName: string]: ClientControlMode; }; - FormContext: any; + FormContext: ClientFormContext; FormUniqueId: string; } @@ -1417,6 +1275,7 @@ declare module SPClientTemplates { export interface Group { Items: Item[]; } + type RenderCallback = (ctx: RenderContext) => void; export interface RenderContext { BaseViewID?: number; @@ -1426,8 +1285,8 @@ declare module SPClientTemplates { CurrentSelectedItems?: any; CurrentUICultureName?: string; ListTemplateType?: number; - OnPostRender?: any; - OnPreRender?: any; + OnPostRender?: RenderCallback | RenderCallback[]; + OnPreRender?: RenderCallback | RenderCallback[]; onRefreshFailed?: any; RenderBody?: (renderContext: RenderContext) => string; RenderFieldByName?: (renderContext: RenderContext, fieldName: string) => string; @@ -1484,18 +1343,18 @@ declare module SPClientTemplates { } export interface Templates { - View?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template - Body?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template + View?: RenderCallback | string; // TODO: determine appropriate context type and purpose of this template + Body?: RenderCallback | string; // TODO: determine appropriate context type and purpose of this template /** Defines templates for rendering groups (aggregations). */ - Group?: GroupCallback; + Group?: GroupCallback| string; /** Defines templates for list items rendering. */ - Item?: ItemCallback; + Item?: ItemCallback| string; /** Defines template for rendering list view header. Can be either string or SingleTemplateCallback */ - Header?: SingleTemplateCallback; + Header?: SingleTemplateCallback| string; /** Defines template for rendering list view footer. Can be either string or SingleTemplateCallback */ - Footer?: SingleTemplateCallback; + Footer?: SingleTemplateCallback| string; /** Defines templates for fields rendering. The field is specified by it's internal name. */ Fields?: FieldTemplates; } @@ -1505,18 +1364,18 @@ declare module SPClientTemplates { } export interface TemplateOverrides { - View?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template - Body?: (renderContext: any) => string; // TODO: determine appropriate context type and purpose of this template + View?: RenderCallback | string; // TODO: determine appropriate context type and purpose of this template + Body?: RenderCallback | string; // TODO: determine appropriate context type and purpose of this template /** Defines templates for rendering groups (aggregations). */ - Group?: GroupCallback; + Group?: GroupCallback| string; /** Defines templates for list items rendering. */ - Item?: ItemCallback; + Item?: ItemCallback| string; /** Defines template for rendering list view header. Can be either string or SingleTemplateCallback */ - Header?: SingleTemplateCallback; + Header?: SingleTemplateCallback| string; /** Defines template for rendering list view footer. Can be either string or SingleTemplateCallback */ - Footer?: SingleTemplateCallback; + Footer?: SingleTemplateCallback| string; /** Defines templates for fields rendering. The field is specified by it's internal name. */ Fields?: FieldTemplateMap; } @@ -1525,10 +1384,10 @@ declare module SPClientTemplates { Templates?: TemplateOverrides; /** �allbacks called before rendering starts. Can be function (ctx: RenderContext) => void or array of functions.*/ - OnPreRender?: any; + OnPreRender?: RenderCallback | RenderCallback[]; /** �allbacks called after rendered html inserted into DOM. Can be function (ctx: RenderContext) => void or array of functions.*/ - OnPostRender?: any; + OnPostRender?: RenderCallback | RenderCallback[]; /** View style (SPView.StyleID) for which the templates should be applied. If not defined, the templates will be applied only to default view style. */ @@ -1538,11 +1397,11 @@ declare module SPClientTemplates { ListTemplateType?: number; /** Base view ID (SPView.BaseViewID) for which the template should be applied. If not defined, the templates will be applied to all views. */ - BaseViewID?: any; + BaseViewID?: number|string; } export class TemplateManager { static RegisterTemplateOverrides(renderCtx: TemplateOverridesOptions): void; - static GetTemplates(renderCtx: any): Templates; + static GetTemplates(renderCtx: RenderContext): Templates; } export interface ClientUserValue { @@ -1616,13 +1475,13 @@ declare module SPClientTemplates { EnableVesioning: boolean; Id: string; }; - registerInitCallback(fieldname: string, callback: () => void ): void; - registerFocusCallback(fieldname: string, callback: () => void ): void; - registerValidationErrorCallback(fieldname: string, callback: (error: any) => void ): void; + registerInitCallback(fieldname: string, callback: () => void): void; + registerFocusCallback(fieldname: string, callback: () => void): void; + registerValidationErrorCallback(fieldname: string, callback: (error: any) => void): void; registerGetValueCallback(fieldname: string, callback: () => any): void; updateControlValue(fieldname: string, value: any): void; registerClientValidator(fieldname: string, validator: SPClientForms.ClientValidation.ValidatorSet): void; - registerHasValueChangedCallback(fieldname: string, callback: (eventArg?: any) => void ); + registerHasValueChangedCallback(fieldname: string, callback: (eventArg?: any) => void); } } @@ -1653,6 +1512,14 @@ declare module SPClientForms { } } +declare class SPMgr { + NewGroup(listItem: Object, fieldName: string): boolean; + RenderHeader(renderCtx: SPClientTemplates.RenderContext, field: SPClientTemplates.FieldSchema): string; + RenderField(renderCtx: SPClientTemplates.RenderContext, field: SPClientTemplates.FieldSchema, listItem: Object, listSchema: SPClientTemplates.ListSchema): string; + RenderFieldByName(renderCtx: SPClientTemplates.RenderContext, fieldName: string, listItem: Object, listSchema: SPClientTemplates.ListSchema): string; +} + +declare var spMgr: SPMgr; declare module SPAnimation { export enum Attribute { @@ -7241,7 +7108,7 @@ declare module SP { } export class Status { - static addStatus(strTitle: string, strHtml: string, atBegining: boolean): string; + static addStatus(strTitle: string, strHtml?: string, atBegining?: boolean): string; static appendStatus(sid: string, strTitle: string, strHtml: string): string; static updateStatus(sid: string, strHtml: string): void; static setStatusPriColor(sid: string, strColor: string): void; @@ -7378,19 +7245,19 @@ declare module SP { @param url overrides options.url @param callback overrides options.dialogResultValueCallback @param args overrides options.args */ - static commonModalDialogOpen(url: string, options: SP.UI.IDialogOptions, callback: SP.UI.DialogReturnValueCallback, args: any): void; + static commonModalDialogOpen(url: string, options: SP.UI.IDialogOptions, callback?: SP.UI.DialogReturnValueCallback, args?: any): void; /** Refresh the page if specified dialogResult equals to SP.UI.DialogResult.OK */ static RefreshPage(dialogResult: SP.UI.DialogResult): void; /** Show page specified by the url in a modal dialog. If the dialog returns SP.UI.DialogResult.OK, the page is refreshed. */ static ShowPopupDialog(url: string): void; /** Show modal dialog specified by url, callback, height and width. */ - static OpenPopUpPage(url: string, callback: SP.UI.DialogReturnValueCallback, width: number, height: number): void; + static OpenPopUpPage(url: string, callback: SP.UI.DialogReturnValueCallback, width?: number, height?: number): void; /** Displays a wait/loading modal dialog with the specified title, message, height and width. Height and width are defined in pixels. Cancel/close button is not shown. */ - static showWaitScreenWithNoClose(title: string, message: string, height: number, width: number): SP.UI.ModalDialog; + static showWaitScreenWithNoClose(title: string, message?: string, height?: number, width?: number): SP.UI.ModalDialog; /** Displays a wait/loading modal dialog with the specified title, message, height and width. Height and width are defined in pixels. Cancel button is shown. If user clicks it, the callbackFunc is called. */ - static showWaitScreenSize(title: string, message: string, callbackFunc: SP.UI.DialogReturnValueCallback, height: number, width: number): SP.UI.ModalDialog; + static showWaitScreenSize(title: string, message?: string, callbackFunc?: SP.UI.DialogReturnValueCallback, height?: number, width?: number): SP.UI.ModalDialog; static showPlatformFirstRunDialog(url: string, callbackFunc: SP.UI.DialogReturnValueCallback): SP.UI.ModalDialog; - static get_childDialog: any; + static get_childDialog: ModalDialog; /** Closes the dialog using the specified dialog result. */ close(dialogResult: SP.UI.DialogResult): void; } @@ -7469,6 +7336,11 @@ declare module SP { } } + export module Workplace { + export function add_resized(handler: Function); + export function remove_resized(handler:Function); + } + export module UIUtility { export function generateRandomElementId(): string; export function cancelEvent(evt: Event): void; @@ -8410,11 +8282,11 @@ declare module SP.WorkflowServices { /** RestrictToScope is a GUID value, used in conjunction with the RestrictToType property to further restrict the scope of the definition. For example, if the RestrictToType is "List", then setting the RestrictToScope to a particular list identifier limits the definition to be associable only to the specified list. If the RestrictToType is "List" but the RestrictToScope is null or the empty string, then the definition is associable to any list. */ - get_restrictScope(): string; + get_restrictToScope(): string; /** RestrictToScope is a GUID value, used in conjunction with the RestrictToType property to further restrict the scope of the definition. For example, if the RestrictToType is "List", then setting the RestrictToScope to a particular list identifier limits the definition to be associable only to the specified list. If the RestrictToType is "List" but the RestrictToScope is null or the empty string, then the definition is associable to any list. */ - set_restrictScope(value: string): string; + set_restrictToScope(value: string): string; /** RestrictToType determines the possible event source type for a workflow subscription that uses this definition. Possible values include "List", "Site", the empty string, or null. */ get_restrictToType(): string; @@ -9441,6 +9313,7 @@ interface ISPClientAutoFillData { AutoFillMenuOptionType?: number; } + declare class SPClientPeoplePicker { static ValueName: string; // = 'Key'; static DisplayTextName: string; // = 'DisplayText'; @@ -9460,54 +9333,112 @@ declare class SPClientPeoplePicker { }; static InitializeStandalonePeoplePicker(clientId: string, value: ISPClientPeoplePickerEntity[], schema: ISPClientPeoplePickerSchema): void; + static ParseUserKeyPaste(userKey: string): string; + static GetTopLevelControl(elmChild: HTMLElement): HTMLElement; + static AugmentEntity(entity: ISPClientPeoplePickerEntity): ISPClientPeoplePickerEntity; + static AugmentEntitySuggestions(pickerObj: SPClientPeoplePicker, allEntities: ISPClientPeoplePickerEntity[], mergeLocal?: boolean): ISPClientPeoplePickerEntity[]; + static PickerObjectFromSubElement(elmSubElement: HTMLElement): SPClientPeoplePicker; + static TestLocalMatch(strSearchLower: string, dataEntity: ISPClientPeoplePickerEntity): boolean; + static BuildUnresolvedEntity(key: string, dispText: string): ISPClientPeoplePickerEntity; + static AddAutoFillMetaData(pickerObj: SPClientPeoplePicker, options: ISPClientPeoplePickerEntity[], numOpts: number): ISPClientPeoplePickerEntity[]; + static BuildAutoFillMenuItems(pickerObj: SPClientPeoplePicker, options: ISPClientPeoplePickerEntity[]): ISPClientPeoplePickerEntity[]; + static IsUserEntity(entity: ISPClientPeoplePickerEntity): boolean; + static CreateSPPrincipalType(acctStr: string): number; - public TopLevelElementId: string;// '', - public EditorElementId: string;//'', - public AutoFillElementId: string;//'', - public ResolvedListElementId: string;//'', - public InitialHelpTextElementId: string;//'', - public WaitImageId: string;//'', - public HiddenInputId: string;//'', - public AllowEmpty: boolean;//true, - public ForceClaims: boolean;//false, - public AutoFillEnabled: boolean;//true, - public AllowMultipleUsers: boolean;//false, + + public TopLevelElementId: string; // '', + public EditorElementId: string; //'', + public AutoFillElementId: string; //'', + public ResolvedListElementId: string; //'', + public InitialHelpTextElementId: string; //'', + public WaitImageId: string; //'', + public HiddenInputId: string; //'', + public AllowEmpty: boolean; //true, + public ForceClaims: boolean; //false, + public AutoFillEnabled: boolean; //true, + public AllowMultipleUsers: boolean; //false, public OnValueChangedClientScript: (pickerElementId: string, users: ISPClientPeoplePickerEntity[]) => void; public OnUserResolvedClientScript: (pickerElementId: string, users: ISPClientPeoplePickerEntity[]) => void; public OnControlValidateClientScript: (pickerElementId: string, users: ISPClientPeoplePickerEntity[]) => void; - public UrlZone: string;//null, - public AllUrlZones: boolean;//false, - public SharePointGroupID: number;//0, - public AllowEmailAddresses: boolean;//false, + public UrlZone: SP.UrlZone; //null, + public AllUrlZones: boolean; //false, + public SharePointGroupID: number; //0, + public AllowEmailAddresses: boolean; //false, public PPMRU: SPClientPeoplePickerMRU; - public UseLocalSuggestionCache: boolean;//true, - public CurrentQueryStr: string;//'', - public LatestSearchQueryStr: string;// '', + public UseLocalSuggestionCache: boolean; //true, + public CurrentQueryStr: string; //'', + public LatestSearchQueryStr: string; // '', public InitialSuggestions: ISPClientPeoplePickerEntity[]; public CurrentLocalSuggestions: ISPClientPeoplePickerEntity[]; public CurrentLocalSuggestionsDict: ISPClientPeoplePickerEntity; - public VisibleSuggestions: number;//5, - public PrincipalAccountType: string;//'', + public VisibleSuggestions: number; //5, + public PrincipalAccountType: string; //'', public PrincipalAccountTypeEnum: SP.Utilities.PrincipalType; - public EnabledClaimProviders: string;//'', - public SearchPrincipalSource: SP.Utilities.PrincipalSource;//null, - public ResolvePrincipalSource: SP.Utilities.PrincipalSource;//null, - public MaximumEntitySuggestions: number;//30, - public EditorWidthSet: boolean;//false, - public QueryScriptInit: boolean;//false, - public AutoFillControl: string;//null, - public TotalUserCount: number;//0, - public UnresolvedUserCount: number;//0, - public UserQueryDict: ISPClientPeoplePickerEntity; - public ProcessedUserList: ISPClientPeoplePickerEntity; - public HasInputError: boolean;//false, - public HasServerError: boolean;//false, - public ShowUserPresence: boolean;//true, - public TerminatingCharacter: string;//';', - public UnresolvedUserElmIdToReplace: string;//'', - public WebApplicationID: SP.Guid;//'{00000000-0000-0000-0000-000000000000}', - + public EnabledClaimProviders: string; //'', + public SearchPrincipalSource: SP.Utilities.PrincipalSource; //null, + public ResolvePrincipalSource: SP.Utilities.PrincipalSource; //null, + public MaximumEntitySuggestions: number; //30, + public EditorWidthSet: boolean; //false, + public QueryScriptInit: boolean; //false, + public AutoFillControl: SPClientAutoFill; //null, + public TotalUserCount: number; //0, + public UnresolvedUserCount: number; //0, + public UserQueryDict: { [index: string]: SP.StringResult }; + public ProcessedUserList: { [index: string]: SPClientPeoplePickerProcessedUser }; + public HasInputError: boolean; //false, + public HasServerError: boolean; //false, + public ShowUserPresence: boolean; //true, + public TerminatingCharacter: string; //';', + public UnresolvedUserElmIdToReplace: string; //'', + public WebApplicationID: SP.Guid; //'{00000000-0000-0000-0000-000000000000}', public GetAllUserInfo(): ISPClientPeoplePickerEntity[]; + + public SetInitialValue(entities: ISPClientPeoplePickerEntity[], initialErrorMsg?: string): void + public AddUserKeys(userKeys: string, bSearch: boolean): void; + public BatchAddUserKeysOperation(allKeys: string[], numProcessed: number); + public ResolveAllUsers(fnContinuation: () => void): void; + public ExecutePickerQuery(queryIds: string, onSuccess: (queryId: string, result: SP.StringResult) => void, onFailure: (queryId: string, result: SP.StringResult) => void, fnContinuation: () => void): void; + public AddUnresolvedUserFromEditor(bRunQuery?: boolean): void; + public AddUnresolvedUser(unresolvedUserObj: ISPClientPeoplePickerEntity, bRunQuery?: boolean): void; + public UpdateUnresolvedUser(results: SP.StringResult, user: ISPClientPeoplePickerEntity): void; + public AddPickerSearchQuery(queryStr: string): string; + public AddPickerResolveQuery(queryStr: string): string; + public GetPeoplePickerQueryParameters(): SP.UI.ApplicationPages.ClientPeoplePickerQueryParameters; + public AddProcessedUser(userObject: ISPClientPeoplePickerEntity, fResolved?: boolean): string; + public DeleteProcessedUser(elmToRemove: HTMLElement): void; + public OnControlValueChanged(): void; + public OnControlResolvedUserChanged(): void; + public EnsureAutoFillControl(): void; + public ShowAutoFill(resultsTable: ISPClientAutoFillData[]): void; + public FocusAutoFill(): void; + public BlurAutoFill(): void; + public IsAutoFillOpen(): boolean; + public EnsureEditorWidth(): void; + public SetFocusOnEditorEnd(): void; + public ToggleWaitImageDisplay(bShowImage?: boolean): void; + public SaveAllUserKeysToHiddenInput(): void; + public GetCurrentEditorValue(): string; + public GetControlValueAsJSObject(): ISPClientPeoplePickerEntity[]; + public GetAllUserKeys(): string; + public GetControlValueAsText(): string; + public IsEmpty(): boolean; + public IterateEachProcessedUser(fnCallback: (index: number, user: SPClientPeoplePickerProcessedUser) => void): void; + public HasResolvedUsers(): boolean; + public Validate(): void; + public ValidateCurrentState(): void + public GetUnresolvedEntityErrorMessage(): string; + public ShowErrorMessage(msg: string): void; + public ClearServerError(): void; + public SetServerError(): void; + public OnControlValidate(): void; + public SetEnabledState(bEnabled: boolean): void; + public DisplayLocalSuggestions(): void; + public CompileLocalSuggestions(input: string): void; + public PlanningGlobalSearch(): boolean; + public AddLoadingSuggestionMenuOption(): void; + public ShowingLocalSuggestions(): boolean; + public ShouldUsePPMRU(): boolean; + public AddResolvedUserToLocalCache(resolvedEntity: ISPClientPeoplePickerEntity, resolveText: string); } interface ISPClientPeoplePickerSchema { @@ -9583,11 +9514,38 @@ interface ISPClientPeoplePickerEntity { Department: string; Email: string; }; - MultipleMatches: Object[]; + MultipleMatches: ISPClientPeoplePickerEntity[]; DomainText?: string; [key: string]: any; } +declare class SPClientPeoplePickerProcessedUser { + UserContainerElementId: string;// '', + DisplayElementId: string;// '', + PresenceElementId: string;// '', + DeleteUserElementId: string;// '', + SID: string;// '', + DisplayName: string;// '', + SIPAddress: string;// '', + UserInfo: ISPClientPeoplePickerEntity;// null, + ResolvedUser: boolean;// true, + Suggestions: ISPClientAutoFillData[];// null, + ErrorDescription: string;// '', + ResolveText: string;// '', + public UpdateResolvedUser(newUserInfo: ISPClientPeoplePickerEntity, strNewElementId: string): void; + public UpdateSuggestions(entity: ISPClientPeoplePickerEntity); + public BuildUserHTML(): string; + public UpdateUserMaxWidth(): void; + public ResolvedAsUnverifiedEmail(): string; + + static BuildUserPresenceHtml(elmId: string, strSip: string, bResolved?: boolean): string; + static GetUserContainerElement(elmChild: HTMLElement): HTMLElement; + static HandleProcessedUserClick(ndClicked: HTMLElement): void; + static DeleteProcessedUser(elmToRemove: HTMLElement): void; + static HandleDeleteProcessedUserKey(e: Event): void; + static HandleResolveProcessedUserKey(e: Event): void; +} + declare module Microsoft { export module Office { export module Server { @@ -9757,4 +9715,1234 @@ declare module SPThemeUtils { export function Suspend(): void; } +declare module SP { + export module JsGrid { + export enum TextDirection { + Default, //0, + RightToLeft, //1, + LeftToRight //2 + } + + export enum PaneId { + MainGrid, //0, + PivotedGrid, //1, + Gantt //2 + } + + export enum PaneLayout { + GridOnly, //0, + GridAndGantt, //1, + GridAndPivotedGrid //2 + + } + export enum EditMode { + ReadOnly, //0, + ReadWrite, //1, + ReadOnlyDefer, //2, + ReadWriteDefer, //3, + Defer //4 + } + + export enum GanttDrawBarFlags { + LeftLink, //0x01, + RightLink //0x02 + + } + export enum GanttBarDateType { + Start, //0, + End //1 + } + + export enum ValidationState { + Valid, //0, + Pending, //1, + Invalid //2 + } + + export enum HierarchyMode { + None, //0, + Standard, //1, + Grouping //2 + } + + export enum EditActorWriteType { + Both, //1, + LocalizedOnly, //2, + DataOnly, //3, + Either //4 + } + + export enum EditActorReadType { + Both, //1, + LocalizedOnly, //2, + DataOnly //3 + } + + export enum EditActorUpdateType { + Committed, //0, + Uncommitted, //1 + } + + export enum SortMode { + Ascending, //1, + Descending, //-1, + None //0 + } + + export module RowHeaderStyleId { + export var Transfer: string; //'Transfer', + export var Conflict: string; //'Conflict' + + } + + export module RowHeaderAutoStyleId { + export var Dirty:string; //'Dirty', + export var Error: string; //'Error', + export var NewRow: string; //'NewRow' + } + + export enum RowHeaderStatePriorities { + Dirty, //10, + Transfer, //30, + CellError, //40, + Conflict, //50, + RowError, //60, + NewRow //90 + } + + export enum UpdateSerializeMode { + Cancel, //0, + Default, //1, + PropDataOnly, //2, + PropLocalizedOnly, //3, + PropBoth //4 + } + + export enum UpdateTrackingMode { + PropData, //2, + PropLocalized, //3, + PropBoth //4 + } + + export module UserAction { + export var UserEdit:string; //'User Edit':string; + export var DeleteRecord:string; //'Delete Record':string; + export var InsertRecord:string; //'Insert Record':string; + export var Indent:string; //'Indent':string; + export var Outdent:string; //'Outdent':string; + export var Fill:string; //'Fill':string; + export var Paste:string; //'Paste':string; + export var CutPaste: string; //'Cut/Paste' + } + + export enum ReadOnlyActiveState { + ReadOnlyActive, //0, + ReadOnlyDisabled, //1 + } + + export interface IValue { + data?: any; + localized?:string; + } + + + export class JsGridControl { + constructor(parentNode: HTMLElement, bShowLoadingBanner: boolean); + /** Returns true if Init method has been executed successfully */ + IsInitialized(): boolean; + /** Replaces the control TableCache object with the provided one */ + ResetData(cache: SP.JsGrid.TableCache): void; + /** Initialize the control */ + Init(parameters: SP.JsGrid.JsGridControl.Parameters): void; + Cleanup(): void; + /** Removes all event handlers and markup associated with the control */ + Dispose(): void; + + // todo + NotifyDataAvailable(): void; + NotifySave(): void; + NotifyHide(): void; + NotifyResize(): void; + ClearTableView(): void; + HideInitialLoadingBanner(): void; + ShowInitialGridErrorMsg(errorMsg: string): void; + ShowGridErrorMsg(errorMsg: string): void; + LaunchPrintView(additionalScriptFiles, beforeInitFnName, beforeInitFnArgsObj, title, bEnableGantt, optGanttDelegateNames, optInitTableViewParamsFnName, optInitTableViewParamsFnArgsObj, optInitGanttStylesFnName, optInitGanttStylesFnArgsObj): void; + GetAllDataJson(fnOnFinished, optFnGetCellStyleID?): void; + SetTableView(tableViewParams): void; + SetRowView(rowViewParams): void; + + /** Enable grid after Disable. */ + Enable(): void; + /** Covers the grid with the semi-transparent panel, preventing any operations with it. + Additionally, displays loading animated gif and optMsg as the message next to it. + If optMsg is not specified, displays "Loading..." text. */ + Disable(optMsg?: string): void; + /** Enables grid editing */ + EnableEditing(): void; + /** Disables grid editing: all the records become readonly */ + DisableEditing(): void; + /** Switches the currently selected cell into edit mode: displays edit control and sets focus into it. + Returns true if success. */ + TryBeginEdit(): boolean; + FinalizeEditing(fnContinue, fnError): void; + /** Get diff tracker object that tracks changes to the grid data. */ + GetDiffTracker(): SP.JsGrid.Internal.DiffTracker; + /** Moves focus to the JsGrid control */ + Focus(): void; + + /** Try saving the new record row (aka entry row) if it was edited. */ + TryCommitFirstEntryRecords(fnCommitComplete: { (): void }): void; + /** Removes all new record rows (aka entry rows), including unsaved and even empty ones. + The latter seems to be a bug, as I haven't found any easy way to restore the empty entry row. */ + ClearUncommitedEntryRecords(): void; + /** Returns true if there are any unsaved new record rows (aka entry rows). */ + AnyUncommitedEntryRecords(): boolean; + + + // todo + AnyUncomittedProvisionalRecords(): boolean; + + /** Gets record based on the recordKey + @recordKey internal unique id of a row. You can get recordKey from view index via GetRecordKeyByViewIndex method. */ + GetRecord(recordKey: number): IRecord; + /** Get entry record with the specified key. + Entry record is a special type of record because it represents a new record that doesn't exist yet. */ + GetEntryRecord(key): any; + /** Determine if the specified record key identifies valid entry row. */ + IsEntryRecord(recordKey: number): boolean; + /** Determine whether the specified cell is editable. */ + IsCellEditable(record: IRecord, fieldKey: string, optPaneId?): boolean; + /** Adds one of builtin row state indicator icons into the row header. + Please pass one of the values of SP.JsGrid.RowHeaderStyleId + Row header is the leftmost gray column of the table. */ + AddBuiltInRowHeaderState(recordKey: number, rowHeaderStateId: string): void; + /** Adds the specified state into the row header. + There can be several row header states for one row. Only one is shown (according to the Priority). + Row header is the leftmost gray column of the table. */ + AddRowHeaderState(recordKey: number, rowHeaderState: SP.JsGrid.RowHeaderState): void; + /** Removes header state with specified id from the row. */ + RemoveRowHeaderState(recordKey: number, rowHeaderStateId: string): void; + + GetCheckSelectionManager(): any; + UpdateProperties(propertyUpdates, changeName, optChangeKey?): any; + GetLastRecordKey(): string; + InsertProvisionalRecordBefore(beforeRecordKey: number, newRecord, initialValues): any; + InsertProvisionalRecordAfter(afterRecordKey: number, newRecord, initialValues): any; + IsProvisionalRecordKey(recordKey: number): boolean; + InsertRecordBefore(beforeRecordKey: number, newRecord, optChangeKey?): any; + InsertRecordAfter(afterRecordKey: number, newRecord, optChangeKey?): any; + InsertHiddenRecord(recordKey: number, changeKey, optAfterRecordKey?): any; + DeleteRecords(recordKeys, optChangeKey?): any; + IndentRecords(recordKeys, optChangeKey?): any; + OutdentRecords(recordKeys, optChangeKey?): any; + ReorderRecords(beginRecordKey: number, endRecordKey: number, afterRecordKey: number, bSelectAfterwards: boolean): any; + GetContiguousRowSelectionWithoutEntryRecords(): { begin; end; keys }; + CanMoveRecordsUpByOne(recordKeys): boolean; + CanMoveRecordsDownByOne(recordKeys): boolean; + MoveRecordsUpByOne(recordKeys): any; + MoveRecordsDownByOne(recordKeys): any; + GetReorderRange(recordKeys): any; + GetNodeExpandCollapseState(recordKey): any; + ToggleExpandCollapse(recordKey: number): void; + + /** Attach event handler to a particular event type */ + AttachEvent(eventType: JsGrid.EventType, fnOnEvent: { (args: IEventArgs): void }): void; + /** Detach a previously set event handler */ + DetachEvent(eventType: JsGrid.EventType, fnOnEvent): void; + + /** Set a delegate. Delegates are way to replace default functionality with custom one. */ + SetDelegate(delegateKey: JsGrid.DelegateType, fn): void; + /** Get current delegate. */ + GetDelegate(delegateKey: JsGrid.DelegateType): any; + + /** Re-render the specified row in the view. */ + RefreshRow(recordKey: number): void; + /** Re-render all rows in the view. + It can be used e.g. if you have some custom display controls and they are rendered differently depending on some external settings. + In this case, if you update the external settings, obviously you have to then update the view for these settings to take effect. */ + RefreshAllRows(): void; + /** Clears undo queue, and also differencies tracker state and versions manager state. */ + ClearChanges(): void; + + GetGanttZoomLevel(): any; + SetGanttZoomLevel(level: any): void; + ScrollGanttToDate(date): void; + + /** Get top record view index. + You can then use GetRecordKeyByViewIndex to convert this value into the recordKey. */ + GetTopRecordIndex(): number; + /** Get number of rows displayed in the current view. */ + GetViewRecordCount(): number; + /** Get record key for a row that is specified by the viewIdx. + viewIdx - index of the row in the view, use GetTopRecordIndex to get the first one. + Returns recordKey, which is a unique numeric identifier of a row within a dataset. + Main difference between viewIdx and recordKey is that viewIdx is only unique within a view, + e.g. if you do paging, it can be same for different records. + */ + GetRecordKeyByViewIndex(viewIdx: number): number; + /** Opposite to GetRecordKeyByViewIndex, resolves the view index of the record based on record key. + recordKey - unique numeric identifier of a row in the current dataset. + Returns viewIdx - index of the row in the current view */ + GetViewIndexOfRecord(recordKey: number): number; + /** Get top row index. Usually returns 0. + You can then use GetRecordKeyByViewIndex to convert this value into the recordKey. */ + GetTopRowIndex(): number; + + GetOutlineLevel(record): any; + GetSplitterPosition(): any; + SetSplitterPosition(pos): void; + GetLeftColumnIndex(optPaneId?): any; + EnsurePaneWidth(): void; + + /** Show a previously hidden column at a specified position. + If atIdx is not defined, column will be shown at it's previous position. */ + ShowColumn(columnKey: string, atIdx?: number): void; + /** Hide the specified column from grid */ + HideColumn(columnKey: string): void; + /** Update column descriptions */ + UpdateColumns(columnInfoCollection: ColumnInfoCollection): void; + GetColumns(optPaneId?): ColumnInfo[]; + /** Get ColumnInfo object by fieldKey + @fieldKey when working with SharePoint data sources, fieldKey corresponds to field internal name */ + GetColumnByFieldKey(fieldKey: string, optPaneId?): ColumnInfo; + /** Adds a column, based on the specified grid field */ + AddColumn(columnInfo: ColumnInfo, gridField: GridField): void; + + /** Switches column header in rename mode, showing textbox and thus giving the user possibility to rename this column. */ + RenameColumn(columnKey: string): void; + /** Shows a dialog where user can reorder columns and change their widths. */ + ShowColumnConfigurationDialog(): void; + + + /** Returns true, if there are any errors in the JsGrid */ + AnyErrors(): boolean; + /** Returns true, if there are any errors in a specified row */ + AnyErrorsInRecord(recordKey: number): boolean; + /** Set error for the specified by recordKey and fieldKey cell. + Returns id of the error, so that later you can clear the error using this id. */ + SetCellError(recordKey: number, fieldKey: string, errorMessage: string): number; + /** Set error for the specified by recordKey row. + In the leftmost column of this row, exclamation mark error indicator will appear. + Clicking on this indicator will cause the specified error message appear in form of a reddish tooltip. + Returns id of the error, so that later you can clear the error using this id. */ + SetRowError(recordKey: number, errorMessage: string): number; + /** Clear specified by id error that was previously set on the specified by recordKey and fieldKey cell. */ + ClearCellError(recordKey: number, fieldKey: string, id: number): void; + /** Clear all errors in the specified cell. */ + ClearAllErrorsOnCell(recordKey: number, fieldKey: string): void; + /** Clear specified by id error that was previously set on the specified by recordKey row. */ + ClearRowError(recordKey: number, id: number): void; + /** Clear all errors in the specified row. */ + ClearAllErrorsOnRow(recordKey: number): void; + /** Get error message for the specified cell. + If many errors are set on the cell, only first is returned. + If there are no errors in the cell, returns null. */ + GetCellErrorMessage(recordKey: number, fieldKey: string): string; + /** Get error message for the specified row. + If many errors are set on the row, only first is returned. + If there are no errors in the row, returns null. */ + GetRowErrorMessage(recordKey: number): string; + /** This method is used mostly when you have a rather tall JSGrid and you want to ensure that user sees + that some error has occured. + You can specify the minId or/and filter function. + If minId is specified, method searches for an error with first id which is greater than minId. + Scrolls to the Returns the id of the found record. + If there aren't any errors, that satisfy the conditions, method does nothing and returns null. */ + ScrollToAndExpandNextError(minId?: number, fnFilter?: { (recordKey: number, fieldKey: string, id: number): boolean }): any; + /** Same as ScrollToAndExpandNextError, but searches within the specified record. + recordKey should be not null, otherwise you'll get an exception. + bDontExpand controls whether the error tooltip will be shown (if bDontExpand=true, tooltip will not be shown). */ + ScrollToAndExpandNextErrorOnRecord(minId?: number, recordKey?: number, fnFilter?: { (recordKey: number, fieldKey: string, id: number): boolean }, bDontExpand?: boolean): any; + + GetFocusedItem(): any; + SendKeyDownEvent(eventInfo:Sys.UI.DomEvent): any; + /** Moves cursor to entry record (the row that is used to add new records) */ + JumpToEntryRecord(): void; + + SelectRowRange(rowIdx1, rowIdx2, bAppend, optPaneId?): void; + SelectColumnRange(colIdx1, colIdx2, bAppend, optPaneId?): void; + SelectCellRange(rowIdx1, rowIdx2, colIdx1, colIdx2, bAppend, optPaneId): void; + SelectRowRangeByKey(rowKey1, rowKey2, bAppend, optPaneId?): void; + SelectColumnRangeByKey(colKey1, colKey2, bAppend, optPaneId?): void; + SelectCellRangeByKey(recordKey1: string, recordKey2: string, colKey1, colKey2, bAppend, optPaneId?): void; + + ChangeKeys(oldKey, newKey): void; + GetSelectedRowRanges(optPaneId?): any; + GetSelectedColumnRanges(optPaneId?): any; + GetSelectedRanges(optPaneId?): any; + MarkPropUpdateInvalid(recordKey: number, fieldKey, changeKey, optErrorMsg?): any; + GetCurrentChangeKey(): any; + CreateAndSynchronizeToNewChangeKey(): any; + CreateDataUpdateCmd(bUseCustomInitialUpdate: boolean): any; + IsChangeKeyApplied(changeKey): any; + GetChangeKeyForVersion(version): any; + TryReadPropForChangeKey(recordKey: number, fieldKey, changeKey): any; + GetUnfilteredHierarchyMap(): any; + GetHierarchyState(bDecompressGuidKeys: boolean): any; + IsGroupingRecordKey(recordKey: number): boolean; + IsGroupingColumnKey(recordKey: number): boolean; + GetSelectedRecordKeys(bDuplicatesAllowed: boolean): any; + /** Cut data from currently selected cells into the clipboard. + Will not work if current selection contains entry row or readonly cells. */ + CutToClipboard(): void; + /** Copy data from currently selected cells into the clipboard. */ + CopyToClipboard(): void; + /** Paste data from clipboard into currently selected cells. */ + PasteFromClipboard(): void; + TryRestoreFocusAfterInsertOrDeleteColumns(origFocus): void; + /** Get undo manager for performing undo/redo operations programmatically. */ + GetUndoManager(): SP.JsGrid.CommandManager; + /** Gets number of records visible in the current view, including the entry row. */ + GetVisibleRecordCount(): number; + /** Returns index of the system RecordIndicatorCheckBoxColumn. If not present in the view, returns null. */ + GetRecordIndicatorCheckBoxColumnIndex(): number; + /** Determines if the specified record is visible in the current view. */ + IsRecordVisibleInView(recordKey: number): boolean; + GetHierarchyQueryObject(): any; + GetSpCsrRenderCtx(): any; + } + + export interface IChangeKey { + Reserve(): void; + Release(): void; + GetVersionNumber(): number; + CompareTo(changeKey: IChangeKey): number; + } + + export enum EventType { + OnCellFocusChanged, + OnRowFocusChanged, + OnCellEditBegin, + OnCellEditCompleted, + OnRightClick, + OnPropertyChanged, + OnRecordInserted, + OnRecordDeleted, + OnRecordChecked, + OnCellErrorStateChanged, + OnEntryRecordAdded, + OnEntryRecordCommitted, + OnEntryRecordPropertyChanged, + OnRowErrorStateChanged, + OnDoubleClick, + OnBeforeGridDispose, + OnSingleCellClick, + OnInitialChangesForChangeKeyComplete, + OnVacateChange, + OnGridErrorStateChanged, + OnSingleCellKeyDown, + OnRecordsReordered, + OnBeforePropertyChanged, + OnRowEscape, + OnBeginRenameColumn, + OnEndRenameColumn, + OnPasteBegin, + OnPasteEnd, + OnBeginRedoDataUpdateChange, + OnBeginUndoDataUpdateChange + } + + export enum DelegateType { + ExpandColumnMenu, + AddColumnMenuItems, + Sort, + Filter, + InsertRecord, + DeleteRecords, + IndentRecords, + OutdentRecords, + IsRecordInsertInView, + ExpandDelayLoadedHierarchyNode, + AutoFilter, + ExpandConflictResolution, + GetAutoFilterEntries, + LaunchFilterDialog, + ShowColumnConfigurationDialog, + GetRecordEditMode, + GetGridRowStyleId, + CreateEntryRecord, + TryInsertEntryRecord, + WillAddColumnMenuItems, + NextPage, + AddNewColumn, + RemoveColumnFromView, + ReorderColumnPositionInView, + TryCreateProvisionalRecord, + CanReorderRecords, + AddNewColumnMenuItems, + TryBeginPaste, + AllowSelectionChange, + GetFieldEditMode, + GetFieldReadOnlyActiveState, + OnBeforeRecordReordered + } + + export enum ClickContext { + SelectAllSquare, + RowHeader, + ColumnHeader, + Cell, + Gantt, + Other + } + + export class RowHeaderState { + constructor(id: string, img: SP.JsGrid.Image, priority: SP.JsGrid.RowHeaderStatePriorities, tooltip: string, fnOnClick: { (eventInfo:Sys.UI.DomEvent, recordKey: number): void }); + GetId(): string; + GetImg(): SP.JsGrid.Image; + GetPriority(): SP.JsGrid.RowHeaderStatePriorities; + GetOnClick(): { (eventInfo:Sys.UI.DomEvent, recordKey: number): void }; + GetTooltip(): string; + toString(): string; + } + + export class Image { + /** optOuterCssNames and optImgCssNames are strings that contain css class names separated by spaces. + optImgCssNames are applied to the img tag. + if bIsClustered, image is rendered inside div, and optOuterCssNames are applied to the div. */ + constructor(imgSrc: string, bIsClustered: boolean, optOuterCssNames: string, optImgCssNames: string, bIsAnimated: boolean); + imgSrc: string; + bIsClustered: boolean; + optOuterCssNames: string; + imgCssNames: string; + bIsAnimated: boolean; + /** Renders the image with specified alternative text and on-click handler. + If bHideTooltip == false, then alternative text is also shown as the tooltip (title attribute). */ + Render(altText: string, clickFn: { (eventInfo:Sys.UI.DomEvent): void }, bHideTooltip: boolean): HTMLElement; + } + + export interface IEventArgs { } + export module EventArgs { + export class OnEntryRecordAdded implements IEventArgs { + constructor(recordKey: number); + recordKey: number; + } + + export class CellFocusChanged implements IEventArgs { + constructor(newRecordKey: number, newFieldKey: string, oldRecordKey: number, oldFieldKey: string); + newRecordKey: number; + newFieldKey: string; + oldRecordKey: number; + oldFieldKey: string; + } + export class RowFocusChanged implements IEventArgs { + constructor(newRecordKey: number, oldRecordKey: number); + newRecordKey: number; + oldRecordKey: number; + } + export class CellEditBegin implements IEventArgs { + constructor(recordKey: number, fieldKey: string); + recordKey: number; + fieldKey: string; + } + export class CellEditCompleted implements IEventArgs { + constructor(recordKey: number, fieldKey: string, changeKey: JsGrid.IChangeKey, bCancelled: boolean); + recordKey: number; + fieldKey: string; + changeKey: JsGrid.IChangeKey; + bCancelled: boolean; + } + export class Click implements IEventArgs { + constructor(eventInfo:Sys.UI.DomEvent, context: JsGrid.ClickContext, recordKey: number, fieldKey: string); + eventInfo:Sys.UI.DomEvent; + context: JsGrid.ClickContext; + recordKey: number; + fieldKey: string; + } + export class PropertyChanged implements IEventArgs { + constructor(recordKey: number, fieldKey: string, oldProp: SP.JsGrid.Internal.PropertyUpdate, newProp: SP.JsGrid.Internal.PropertyUpdate, propType: SP.JsGrid.IPropertyType, changeKey: SP.JsGrid.IChangeKey, validationState: SP.JsGrid.ValidationState); + recordKey: number; + fieldKey: string; + oldProp: SP.JsGrid.Internal.PropertyUpdate; + newProp: SP.JsGrid.Internal.PropertyUpdate; + propType: SP.JsGrid.IPropertyType; + changeKey: SP.JsGrid.IChangeKey; + validationState: SP.JsGrid.ValidationState; + } + export class RecordInserted implements IEventArgs { + constructor(recordKey, recordIdx, afterRecordKey, changeKey); + recordKey: number; + recordIdx: number; + afterRecordKey: number; + changeKey: JsGrid.IChangeKey; + } + export class RecordDeleted implements IEventArgs { + constructor(recordKey, recordIdx, changeKey); + recordKey: number; + recordIdx: number; + changeKey: JsGrid.IChangeKey; + } + export class RecordChecked implements IEventArgs { + constructor(recordKeySet: SP.Utilities.Set, bChecked: boolean); + recordKeySet: SP.Utilities.Set; + bChecked: boolean; + } + export class OnCellErrorStateChanged implements IEventArgs { + constructor(recordKey, fieldKey, bAddingError, bCellCurrentlyHasError, bCellHadError, errorId); + recordKey: number; + fieldKey: string; + bAddingError: boolean; + bCellCurrentlyHasError: boolean; + bCellHadError: boolean; + errorId: number; + } + export class OnRowErrorStateChanged implements IEventArgs { + constructor(recordKey, bAddingError, bErrorCurrentlyInRow, bRowHadError, errorId, message); + recordKey: number; + bAddingError: boolean; + bErrorCurrentlyInRow: boolean; + bRowHadError: boolean; + errorId: number; + message: string; + } + export class OnEntryRecordCommitted implements IEventArgs { + constructor(origRecKey: string, recordKey: number, changeKey: JsGrid.IChangeKey); + originalRecordKey: number; + recordKey: number; + changeKey: JsGrid.IChangeKey + } + export class SingleCellClick implements IEventArgs { + constructor(eventInfo:Sys.UI.DomEvent, recordKey: number, fieldKey: string); + eventInfo:Sys.UI.DomEvent; + recordKey: number; + fieldKey: string; + } + export class PendingChangeKeyInitiallyComplete implements IEventArgs { + constructor(changeKey: JsGrid.IChangeKey); + changeKey: JsGrid.IChangeKey + } + export class VacateChange implements IEventArgs { + constructor(changeKey: JsGrid.IChangeKey); + changeKey: JsGrid.IChangeKey + } + export class GridErrorStateChanged implements IEventArgs { + constructor(bAnyErrors: boolean); + bAnyErrors: boolean; + } + export class SingleCellKeyDown implements IEventArgs { + constructor(eventInfo:Sys.UI.DomEvent, recordKey: number, fieldKey: string); + eventInfo:Sys.UI.DomEvent; + recordKey: number; + fieldKey: string; + } + export class OnRecordsReordered implements IEventArgs { + constructor(recordKeys: string[], changeKey: JsGrid.IChangeKey); + reorderedKeys: string[]; + changeKey: JsGrid.IChangeKey; + } + export class OnRowEscape implements IEventArgs { + constructor(recordKey: number); + recordKey: number; + } + export class OnEndRenameColumn implements IEventArgs { + constructor(columnKey: string, originalColumnTitle: string, newColumnTitle: string); + columnKey: string; + originalColumnTitle: string; + newColumnTitle: string; + } + export class OnBeginRedoDataUpdateChange implements IEventArgs { + constructor(changeKey: JsGrid.IChangeKey); + changeKey: JsGrid.IChangeKey + } + export class OnBeginUndoDataUpdateChange implements IEventArgs { + constructor(changeKey: JsGrid.IChangeKey); + changeKey: JsGrid.IChangeKey + } + + } + + export module JsGridControl { + export class Parameters { + tableCache: SP.JsGrid.TableCache; + name: any; // TODO + bNotificationsEnabled: boolean; + styleManager: IStyleManager; + minHeaderHeight: number; + minRowHeight: number; + commandMgr: SP.JsGrid.CommandManager; + enabledRowHeaderAutoStates: SP.Utilities.Set; + } + } + + export class CommandManager { + // todo + } + + export class TableCache { + // todo + } + + export interface IStyleManager { + gridPaneStyle: IStyleType.GridPane; + columnHeaderStyleCollection: { + normal: IStyleType.Header; + normalHover: IStyleType.Header; + partSelected: IStyleType.Header; + partSelectedHover: IStyleType.Header; + allSelected: IStyleType.Header; + allSelectedHover: IStyleType.Header; + }; + rowHeaderStyleCollection: { + normal: IStyleType.Header; + normalHover: IStyleType.Header; + partSelected: IStyleType.Header; + partSelectedHover: IStyleType.Header; + allSelected: IStyleType.Header; + allSelectedHover: IStyleType.Header; + }; + splitterStyleCollection: { + normal: IStyleType.Splitter; + normalHandle: IStyleType.SplitterHandle; + hover: IStyleType.Splitter; + hoverHandle: IStyleType.SplitterHandle; + dra: IStyleType.Splitter; + dragHandle: IStyleType.SplitterHandle; + }; + defaultCellStyle: IStyleType.Cell; + readOnlyCellStyle: IStyleType.Cell; + readOnlyFocusedCellStyle: IStyleType.Cell; + timescaleTierStyle: IStyleType.TimescaleTier; + groupingStyles: any[]; + widgetDockStyle: IStyleType.Widget; + widgetDockHoverStyle: IStyleType.Widget; + widgetDockPressedStyle: IStyleType.Widget; + RegisterCellStyle(styleId: string, cellStyle: IStyleType.Cell): void; + GetCellStyle(styleId: string): IStyleType.Cell; + UpdateSplitterStyleFromCss(styleObject: IStyleType.Splitter, splitterStyleNameCollection): void; + UpdateHeaderStyleFromCss(styleObject: IStyleType.Header, headerStyleNameCol): void; + UpdateGridPaneStyleFromCss(styleObject: IStyleType.GridPane, gridStyleNameCollection): void; + UpdateDefaultCellStyleFromCss(styleObject: IStyleType.Cell, cssClass): void; + UpdateGroupStylesFromCss(styleObject, prefix): void; + } + + export interface IStyleType { } + export module IStyleType { + export interface Splitter extends IStyleType { + outerBorderColor: any; + leftInnerBorderColor: any; + innerBorderColor: any; + backgroundColor: any; + } + export interface SplitterHandle extends IStyleType{ + outerBorderColor: any; + leftInnerBorderColor: any; + innerBorderColor: any; + backgroundColor: any; + gripUpperColor: any; + gripLowerColor: any; + } + export interface GridPane { + verticalBorderColor: any; + verticalBorderStyle: any; + horizontalBorderColor: any; + horizontalBorderStyle: any; + backgroundColor: any; + columnDropIndicatorColor: any; + rowDropIndicatorColor: any; + linkColor: any; + visitedLinkColor: any; + copyRectForeBorderColor: any; + copyRectBackBorderColor: any; + focusRectBorderColor: any; + selectionRectBorderColor: any; + selectedCellBgColor: any; + readonlySelectionRectBorderColor: any; + changeHighlightCellBgColor: any; + fillRectBorderColor: any; + errorRectBorderColor: any; + } + export interface Header { + font: any; + fontSize: any; + fontWeight: any; + textColor: any; + backgroundColor: any; + outerBorderColor: any; + innerBorderColor: any; + eyeBrowBorderColor: any; + eyeBrowColor: any; + menuColor: any; + menuBorderColor: any; + resizeColor: any; + resizeBorderColor: any; + menuHoverColor: any; + menuHoverBorderColor: any; + resizeHoverColor: any; + resizeHoverBorderColor: any; + eyeBrowHoverColor: any; + eyeBrowHoverBorderColor: any; + elementClickColor: any; + elementClickBorderColor: any; + } + export interface Cell extends IStyleType { + /** -> CSS font-family */ + font: any; + /** -> CSS font-size */ + fontSize: any; + /** -> CSS font-weight */ + fontWeight: any; + /** -> CSS font-style */ + fontStyle: any; + /** -> CSS color */ + textColor: any; + /** -> CSS background-color */ + backgroundColor: any; + /** -> CSS text-align */ + textAlign: any; + } + export interface Widget { + backgroundColor: any; + borderColor: any; + } + export interface RowHeaderStyle { + backgroundColor: any; + outerBorderColor: any; + innerBorderColor: any; + } + export interface TimescaleTier { + font: any; + fontSize: any; + fontWeight: any; + textColor: any; + backgroundColor: any; + verticalBorderColor: any; + verticalBorderStyle: any; + horizontalBorderColor: any; + horizontalBorderStyle: any; + outerBorderColor: any; + todayLineColor: any; + } + } + + export class Style { + + static Type: { + Splitter: IStyleType.Splitter; + SplitterHandle: IStyleType.SplitterHandle; + GridPane: IStyleType.GridPane; + Header: IStyleType.Header; + RowHeaderStyle: IStyleType.RowHeaderStyle; + TimescaleTier: IStyleType.TimescaleTier; + Cell: IStyleType.Cell; + Widget: IStyleType.Widget; + }; + + static SetRTL: { (rtlObject): void; }; + static MakeJsGridStyleManager: { (): IStyleManager }; + static CreateStyleFromCss: { (styleType: IStyleType, cssStyleName: string, optExistingStyle, optClassId): any; }; + static CreateStyle: { (styleType: IStyleType, styleProps: any): any; }; + static MergeCellStyles: { (majorStyle, minorStyle): any; }; + static ApplyCellStyle: { (td, style): void; }; + static ApplyRowHeaderStyle: { (domObj, style, fnGetHeaderSibling): void; }; + static ApplyCornerHeaderBorderStyle: { (domObj, colStyle, rowStyle): void; }; + static ApplyHeaderInnerBorderStyle: { (domObj, bIsRowHeader, headerObject): void }; + static ApplyColumnContextMenuStyle: { (domObj, style): void }; + static ApplySplitterStyle: { (domObj, style): void }; + static MakeBorderString: { (width: number, style: string, color: string): string }; + static GetCellStyleDefaultBackgroundColor: { (): string }; + + } + + export class ColumnInfoCollection { + constructor(colInfoArray: any[]); + GetColumnByKey(key: string): any; + GetColumnArray(bVisibleOnly?: boolean): any[]; + GetColumnMap(): { [key: string]: any; }; + AppendColumn(colInfo: any): void; + InsertColumnAt(idx: number, colInfo: any): void; + RemoveColumn(key: string): void; + /** Returns null if the specified column is not found or hidden. */ + GetColumnPosition(key: string): number; + } + + export class ColumnInfo { + constructor(name: string, imgSrc: string, key: string, width: number); + /** Column title */ + name: string; + /** Column image URL. + If not null, the column header cell will show the image instead of title text. + If the title is defined at the same time as the imgSrc, the title will be shown as a tooltip. */ + imgSrc: string; + /** Custom image HTML. + If you define this in addition to the imgSrc attribute, then instead of standard img tag + the custom HTML defined by this field will be used. */ + imgRawSrc: string; + /** Column identifier */ + columnKey: string; + /** Field keys of the fields, that are displayed in this column */ + fieldKeys: string[]; + /** Width of the column */ + width: number; + bOpenMenuOnContentClick: boolean; + /** always returns 'column' */ + ColumnType(): string; + /** true by default */ + isVisible: boolean; + /** true by default */ + isHidable: boolean; + /** true by default */ + isResizable: boolean; + /** true by default */ + isSortable: boolean; + /** true by default */ + isAutoFilterable: boolean; + /** false by default */ + isFooter: boolean; + /** determine whether the cells in this column should be clickable */ + fnShouldLinkSingleValue: { (record: IRecord, fieldKey: string, dataValue: any, localizedValue: any): boolean }; + /** if a particular cell is determined as clickable by fnShouldLinkSingleValue, this function will be called when the cell is clicked */ + fnSingleValueClicked: { (record: IRecord, fieldKey: string, dataValue: any, localizedValue: any): void }; + /** this is used when you need to make some of the cells in the column readonly, but at the same time keep others editable */ + fnGetCellEditMode: { (record: IRecord, fieldKey: string): JsGrid.EditMode }; + /** this function should return name of the display control for the given cell in the column + the name should be previously associated with the display control via SP.JsGrid.PropertyType.Utils.RegisterDisplayControl method */ + fnGetDisplayControlName: { (record: IRecord, fieldKey: string): string }; + /** this function should return name of the edit control for the given cell in the column + the name should be previously associated with the edit control via SP.JsGrid.PropertyType.Utils.RegisterEditControl method */ + fnGetEditControlName: { (record: IRecord, fieldKey: string): string }; + /** set widget control names for a particular cell + widgets are basically in-cell buttons with associated popup controls, e.g. date selector or address book button + standard widget ids are defined in the SP.JsGrid.WidgetControl.Type enumeration + it is also possible to create your own widgets + usually this function is not used, and instead, widget control names are determined via PropertyType + */ + fnGetWidgetControlNames: { (record: IRecord, fieldKey: string): string[] }; + /** this function should return id of the style for the given cell in the column + styles and their ids are registered for a JsGridControl via jsGridParams.styleManager.RegisterCellStyle method */ + fnGetCellStyleId: { (record: IRecord, fieldKey: string, dataValue: any): string }; + /** set custom tooltip for the given cell in the column. by default, localized value is displayed as the tooltip */ + fnGetSingleValueTooltip: { (record: IRecord, fieldKey: string, dataValue: any, localizedValue: any): string }; + } + + + export interface IRecord { + /** True if this is an entry row */ + bIsNewRow: boolean; + + /** Please use SetProp and GetProp */ + properties: { [fieldKey: string]: IPropertyBase }; + + /** returns recordKey */ + key(): number; + /** returns raw data value for the specified field */ + GetDataValue(fieldKey: string): any; + /** returns localized text value for the specified field */ + GetLocalizedValue(fieldKey: string): string; + /** returns true if data value for the specified field is available */ + HasDataValue(fieldKey: string): boolean; + /** returns true if localized text value for the specified field is available */ + HasLocalizedValue(fieldKey: string): boolean; + + GetProp(fieldKey: string): IPropertyBase; + SetProp(fieldKey: string, prop: IPropertyBase): void; + + /** Update the specified field with the specified value */ + AddFieldValue(fieldKey: string, value: any): void; + /** Removes value of the specified field. + Does not refresh the view. */ + RemoveFieldValue(fieldKey: string): void; + } + + + export class RecordFactory { + constructor(gridFieldMap: any, keyColumnName: string, fnGetPropType: any); + gridFieldMap: any; + /** Create a new record */ + MakeRecord(dataPropMap, localizedPropMap, bKeepRawData): IRecord; + } + + export interface IPropertyBase { + HasLocalizedValue(): boolean; + HasDataValue(): boolean; + Clone(): IPropertyBase; + /** dataValue actually is cloned */ + Update(dataValue: any, localizedValue: string): void; + GetLocalized(): string; + GetData(): any; + } + + export class Property { + static MakeProperty(dataValue: any, localizedValue: string, bHasDataValue: boolean, bHasLocalizedValue: boolean, propType): IPropertyBase; + static MakePropertyFromGridField(gridField: any, dataValue: any, localizedVal: string, optPropType?): IPropertyBase; + } + + export class GridField { + constructor(key: string, hasDataValue: boolean, hasLocalizedValue: boolean, textDirection, defaultCellStyleId, editMode, dateOnly, csrInfo); + key: string; + hasDataValue: boolean; + hasLocalizedValue: boolean; + textDirection: any; + dateOnly: boolean; + csrInfo: any; + GetEditMode(): any; + SetEditMode(mode: any): void; + GetDefaultCellStyleId(): any; + CompareSingleDataEqual(dataValue1, dataValue2): boolean; + GetPropType(): any; + GetSingleValuePropType(): any; + GetMultiValuePropType(): any; + SetSingleValuePropType(svPropType: any): void; + SetIsMultiValue(listSeparator: any): void; + GetIsMultiValue(): boolean; + } + + export interface IEditActorGridContext { + jsGridObj: JsGridControl; + parentNode: HTMLElement; + styleManager: IStyleManager; + RTL: any; + emptyValue: any; + bLightFocus: boolean; + OnKeyDown: { (domEvent: Sys.UI.DomEvent): void; }; + } + + export interface IEditControlGridContext extends IEditActorGridContext { + OnActivateActor(): void; + OnDeactivateActor():void; + } + + export interface IPropertyType { + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + } + + export interface ILookupPropertyType extends IPropertyType { + GetItems(fnCallback: any): void; + DataToLocalized(dataValue: any): string; + LocalizedToData(localized: string): any; + GetImageSource(record: IRecord, dataValue: any): string; + GetStyleId(dataValue: any): string; + GetIsLimitedToList(): boolean; + GetSerializableLookupPropType(): { items: any[]; id: string; bLimitToList: boolean }; + } + + export interface IMultiValuePropertyType extends IPropertyType { + bMultiValue: boolean; + separator: string; + singleValuePropType: string; + GetSerializableMultiValuePropType(): { singleValuePropTypeID: string; separatorChar: string; bDelayInit: boolean; }; + InitSingleValuePropType(): void; + LocStrToLocStrArray(locStr: string): string[]; + LocStrArrayToLocStr(locStrArray: string[]): string; + } + + export class PropertyType { + /** Lookup property type factory, based on SP.JsGrid.PropertyType.LookupTable class. + displayCtrlName should be one of the following: SP.JsGrid.DisplayControl.Type.Image, SP.JsGrid.DisplayControl.Type.ImageText or SP.JsGrid.DisplayControl.Type.Text + */ + static RegisterNewLookupPropType(id: string, items: any[], displayCtrlName: string, bLimitToList: boolean): void; + + /** Register a custom property type. */ + static RegisterNewCustomPropType(propType: IPropertyType, displayCtrlName: string, editControlName: string, widgetControlNames: string[]): void; + + /** Register a custom property type, where display and edit controls, and also widgets, are derived from the specified parent property type. */ + static RegisterNewDerivedCustomPropType(propType: IPropertyType, baseTypeName: string): void; + } + + export module PropertyType { + export class String implements IPropertyType { + constructor(); + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + toString(): string; + } + export class LookupTable implements ILookupPropertyType { + constructor(items: any[], id: string, bLimitToList: boolean); + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + GetItems(fnCallback: any): void; + DataToLocalized(dataValue: any): string; + LocalizedToData(localized: string): any; + GetImageSource(record: IRecord, dataValue: any): string; + GetStyleId(dataValue: any): string; + GetIsLimitedToList(): boolean; + GetSerializableLookupPropType(): { items: any[]; id: string; bLimitToList: boolean }; + + } + export class CheckBoxBoolean implements IPropertyType { + constructor(); + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + DataToLocalized(dataValue: any): string; + GetBool(dataValue: any): boolean; + toString(): string; + } + export class DropDownBoolean implements IPropertyType { + constructor(); + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + DataToLocalized(dataValue: any): string; + GetBool(dataValue: any): boolean; + toString(): string; + } + export class MultiValuePropType implements IMultiValuePropertyType { + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + bMultiValue: boolean; + separator: string; + singleValuePropType: string; + GetSerializableMultiValuePropType(): { singleValuePropTypeID: string; separatorChar: string; bDelayInit: boolean; }; + InitSingleValuePropType(): void; + LocStrToLocStrArray(locStr: string): string[]; + LocStrArrayToLocStr(locStrArray: string[]): string; + } + export class HyperLink implements IPropertyType { + ID: string; + BeginValidateNormalizeConvert(recordKey: number, fieldKey: string, newValue: any, bIsLocalized: boolean, fnCallback: { (args: { isValid: boolean; dataValue: any; normalizedLocValue: string }): void; }, fnError: any): void; + bHyperlink: boolean; + DataToLocalized(dataValue: any): string; + GetAddress(dataValue: any): string; + /** Returns string like this: '"http://site.com, Site title"' */ + GetCopyValue(record: IRecord, dataValue: any, locValue: string): string; + toString(): string; + } + + + export class Utils { + static RegisterDisplayControl(name: string, singleton, requiredFunctionNames: string[]); + static RegisterEditControl(name: string, factory: (gridContext: IEditControlGridContext, gridTextInputElement:HTMLElement) => IEditControl, requiredFunctionNames: string[]); + static RegisterWidgetControl(name: string, factory: { (ddContext): IPropertyType; }, requiredFunctionNames: string[]); + + static UpdateDisplayControlForPropType(propTypeName: string, displayControlType: string); + } + } + + export module WidgetControl { + export class Type { + static Demo: string; + static Date: string; + static AddressBook: string; + static Hyperlink: string; + } + } + + export module Internal { + export class DiffTracker { + constructor(objBag, fnGetChange); + ExternalAPI: { + AnyChanges(): boolean; + ChangeKeySliceInfo(): any; + ChangeQuery(): any; + EventSliceInfo(): any; + GetChanges(optStartEvent, optEndEvent, optRecordKeys, bFirstStartEvent: boolean, bStartInclusive: boolean, bEndInclusive: boolean, bIncludeInvalidPropUpdates: boolean, bLastEndEvent: boolean): any; + GetChangesAsJson(changeQuery, optfnPreProcessUpdateForSerialize?): string; + GetUniquePropertyChanges(changeQuery, optfnFilter): any; + RegisterEvent(changeKey: IChangeKey, eventObject): void; + UnregisterEvent(changeKey: IChangeKey, eventObject): void; + }; + Clear(): void; + NotifySynchronizeToChange(changeKey: IChangeKey): void; + NotifyRollbackChange(changeKey: IChangeKey): void; + NotifyVacateChange(changeKey: IChangeKey): void; + } + + export class PropertyUpdate implements IValue { + constructor(data: any, localized: string); + data: any; + localized: string; + } + } + + export interface IEditActorCellContext { + propType:IPropertyType; + originalValue:IValue; + record:IRecord; + column:ColumnInfo; + field:GridField; + fieldKey:string; + cellExpandSpace:{ left:number; top:number; fight:number; bottom:number; }; + SetCurrentValue(value): void; + } + + export interface IEditControlCellContext extends IEditActorCellContext{ + cellWidth: number; + cellHeight: number; + cellStyle: any; //TODO: Determine correct type + cellRect:any; + NotifyExpandControl(): void; + NotifyEditComplete(): void; + Show(element: HTMLElement): void; + Hide(element: HTMLElement): void; + } + + + export module EditControl { + + } + + export interface IEditControl { + SupportedWriteMode?: SP.JsGrid.EditActorWriteType; + SupportedReadMode?: SP.JsGrid.EditActorReadType; + GetCellContext? (): IEditControlCellContext; + GetOriginalValue?():IValue; + SetValue?(value:IValue):void; + Dispose():void; + GetInputElement?():HTMLElement; + Focus?(eventInfo:Sys.UI.DomEvent):void; + BindToCell (cellContext: IEditControlCellContext):void; + OnBeginEdit (eventInfo: Sys.UI.DomEvent):void; + Unbind():void; + OnEndEdit():void; + OnCellMove?():void; + OnValueChanged?(newValue: IValue):void; + IsCurrentlyUsingGridTextInputElement?(): boolean; + SetSize?(width:number, height:number):void; + } + + } + + export module Utilities { + export class Set { + constructor(items?: { [item: string]: number }); + constructor(items?: { [item: number]: number }); + /** Returns true if the set is empty */ + IsEmpty(): boolean; + /** Returns first item in the set */ + First(): any; + /** Returns the underlying collection of items as dictionary. + Items are the keys, and values are always 1. + So the return value may be either { [item: string]: number } or { [item: number]: number } */ + GetCollection(): any; + /** Returns all items from the set as an array */ + ToArray(): any[]; + /** Adds all items from array to the set, and returns the set */ + AddArray(array: any[]): SP.Utilities.Set; + /** Adds an item to the set */ + Add(item: any): any; + /** Removes the specified item from the set and returns the removed item */ + Remove(item: any): any; + /** Clears all the items from set */ + Clear(): SP.Utilities.Set; + /** Returns true if item exists in this set */ + Contains(item: any): boolean; + /** Returns a copy of this set */ + Clone(): SP.Utilities.Set; + /** Returns a set that contains all the items that exist only in one of the sets (this and other), but not in both */ + SymmetricDifference(otherSet: SP.Utilities.Set): SP.Utilities.Set; + /** Returns a set that contains all the items that are in this set but not in the otherSet */ + Difference(otherSet: SP.Utilities.Set): SP.Utilities.Set; + /** Returns a new set, that contains items from this set and otherSet */ + Union(otherSet: SP.Utilities.Set): SP.Utilities.Set; + /** Adds all items from otherSet to this set, and returns this set */ + UnionWith(otherSet: SP.Utilities.Set): SP.Utilities.Set; + /** Returns a new set, that contains only items that exist both in this set and the otherSet */ + Intersection(otherSet: SP.Utilities.Set): SP.Utilities.Set; + } + } +} + + + + + +declare module SP { + export class GanttControl { + static WaitForGanttCreation(callack: (control: GanttControl) => void): void; + static Instances: GanttControl[]; + static FnGanttCreationCallback: { (control: GanttControl): void }[]; + + get_Columns():SP.JsGrid.ColumnInfo[]; + } +} From e1210e53158790023ab52a15207762f2e7b2e917 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 May 2015 19:26:58 +0200 Subject: [PATCH 0038/2220] jasmine ajax defs --- jasmine-ajax/jasmine-ajax-tests.ts | 1818 ++++++++++++++++++ jasmine-ajax/jasmine-ajax-tests.ts.tscparams | 1 + jasmine-ajax/jasmine-ajax.d.ts | 77 + 3 files changed, 1896 insertions(+) create mode 100644 jasmine-ajax/jasmine-ajax-tests.ts create mode 100644 jasmine-ajax/jasmine-ajax-tests.ts.tscparams create mode 100644 jasmine-ajax/jasmine-ajax.d.ts diff --git a/jasmine-ajax/jasmine-ajax-tests.ts b/jasmine-ajax/jasmine-ajax-tests.ts new file mode 100644 index 0000000000..b5134d2cf7 --- /dev/null +++ b/jasmine-ajax/jasmine-ajax-tests.ts @@ -0,0 +1,1818 @@ +/** + * Tests adapted from: https://github.com/jasmine/jasmine-ajax + * By Louis Grignon + */ + +/// +/// + +describe('StubTracker', function() { + beforeEach(function() { + var Constructor = getJasmineRequireObj().AjaxStubTracker(); + this.tracker = new Constructor(); + }); + + it('finds nothing if no stubs are added', function() { + expect(this.tracker.findStub()).toBeUndefined(); + }); + + it('finds an added stub', function() { + var stub = { matches: function() { return true; } }; + this.tracker.addStub(stub); + + expect(this.tracker.findStub()).toBe(stub); + }); + + it('skips an added stub that does not match', function() { + var stub = { matches: function() { return false; } }; + this.tracker.addStub(stub); + + expect(this.tracker.findStub()).toBeUndefined(); + }); + + it('passes url, data, and method to the stub', function() { + var stub = { matches: jasmine.createSpy('matches') }; + this.tracker.addStub(stub); + + this.tracker.findStub('url', 'data', 'method'); + + expect(stub.matches).toHaveBeenCalledWith('url', 'data', 'method'); + }); + + it('can clear out all stubs', function() { + var stub = { matches: jasmine.createSpy('matches') }; + this.tracker.addStub(stub); + + this.tracker.findStub(); + + expect(stub.matches).toHaveBeenCalled(); + + this.tracker.reset(); + stub.matches.calls.reset(); + + this.tracker.findStub(); + + expect(stub.matches).not.toHaveBeenCalled(); + }); + + it('uses the most recently added stub that matches', function() { + var stub1 = { matches: function() { return true; } }; + var stub2 = { matches: function() { return true; } }; + var stub3 = { matches: function() { return false; } }; + + this.tracker.addStub(stub1); + this.tracker.addStub(stub2); + this.tracker.addStub(stub3); + + expect(this.tracker.findStub()).toBe(stub2); + }); +}); + +describe('FakeRequest', function() { + beforeEach(function() { + this.requestTracker = { track: jasmine.createSpy('trackRequest') }; + this.stubTracker = { findStub: function() {} }; + var parserInstance = this.parserInstance = jasmine.createSpy('parse'); + this.paramParser = { findParser: function() { return { parse: parserInstance }; } }; + var eventBus = this.fakeEventBus = { + addEventListener: jasmine.createSpy('addEventListener'), + trigger: jasmine.createSpy('trigger'), + removeEventListener: jasmine.createSpy('removeEventListener') + }; + this.eventBusFactory = function() { + return eventBus; + }; + this.fakeGlobal = { + XMLHttpRequest: function() { + this.extraAttribute = 'my cool attribute'; + }, + DOMParser: window['DOMParser'], + ActiveXObject: window['ActiveXObject'] + }; + this.FakeRequest = getJasmineRequireObj().AjaxFakeRequest(this.eventBusFactory)(this.fakeGlobal, this.requestTracker, this.stubTracker, this.paramParser); + }); + + it('extends from the global XMLHttpRequest', function() { + var request = new this.FakeRequest(); + + expect(request.extraAttribute).toEqual('my cool attribute'); + }); + + it('skips XMLHttpRequest attributes that IE does not want copied', function() { + // use real window here so it will correctly go red on IE if it breaks + var FakeRequest = getJasmineRequireObj().AjaxFakeRequest(this.eventBusFactory)(window, this.requestTracker, this.stubTracker, this.paramParser); + var request = new FakeRequest(); + + expect(request.responseBody).toBeUndefined(); + expect(request.responseXML).toBeUndefined(); + expect(request.statusText).toBeUndefined(); + }); + + it('tracks the request', function() { + var request = new this.FakeRequest(); + + expect(this.requestTracker.track).toHaveBeenCalledWith(request); + }); + + it('has default request headers and override mime type', function() { + var request = new this.FakeRequest(); + + expect(request.requestHeaders).toEqual({}); + expect(request.overriddenMimeType).toBeNull(); + }); + + it('saves request information when opened', function() { + var request = new this.FakeRequest(); + request.open('METHOD', 'URL', 'ignore_async', 'USERNAME', 'PASSWORD'); + + expect(request.method).toEqual('METHOD'); + expect(request.url).toEqual('URL'); + expect(request.username).toEqual('USERNAME'); + expect(request.password).toEqual('PASSWORD'); + }); + + it('saves an override mime type', function() { + var request = new this.FakeRequest(); + + request.overrideMimeType('application/text; charset: utf-8'); + + expect(request.overriddenMimeType).toBe('application/text; charset: utf-8'); + }); + + it('saves request headers', function() { + var request = new this.FakeRequest(); + + request.setRequestHeader('X-Header-1', 'value1'); + request.setRequestHeader('X-Header-2', 'value2'); + + expect(request.requestHeaders).toEqual({ + 'X-Header-1': 'value1', + 'X-Header-2': 'value2' + }); + }); + + it('combines request headers with the same header name', function() { + var request = new this.FakeRequest(); + + request.setRequestHeader('X-Header', 'value1'); + request.setRequestHeader('X-Header', 'value2'); + + expect(request.requestHeaders['X-Header']).toEqual('value1, value2'); + }); + + it('finds the content-type request header', function() { + var request = new this.FakeRequest(); + + request.setRequestHeader('ContEnt-tYPe', 'application/text+xml'); + + expect(request.contentType()).toEqual('application/text+xml'); + }); + + describe('managing readyState', function() { + beforeEach(function() { + this.request = new this.FakeRequest(); + }); + + it('has an initial ready state of 0 (uninitialized)', function() { + expect(this.request.readyState).toBe(0); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalled(); + }); + + it('has a ready state of 1 (open) when opened', function() { + this.request.open(); + + expect(this.request.readyState).toBe(1); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 0 (uninitialized) when aborted', function() { + this.request.open(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.abort(); + + expect(this.request.readyState).toBe(0); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 1 (sent) when sent', function() { + this.request.open(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.send(); + + expect(this.request.readyState).toBe(1); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 4 (loaded) when timed out', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + jasmine.clock().install(); + this.request.responseTimeout(); + jasmine.clock().uninstall(); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange', 'timeout'); + }); + + it('has a ready state of 4 (loaded) when network erroring', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.responseError(); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 4 (loaded) when responding', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.respondWith({}); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 2, then 4 (loaded) when responding', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + var request = this.request; + var events = []; + var headers = [ + { name: 'X-Header', value: 'foo' } + ]; + + this.fakeEventBus.trigger.and.callFake(function(event) { + if (event === 'readystatechange') { + events.push({ + readyState: request.readyState, + status: request.status, + statusText: request.statusText, + responseHeaders: request.responseHeaders + }); + } + }); + + this.request.respondWith({ + status: 200, + statusText: 'OK', + responseHeaders: headers + }); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(events.length).toBe(2); + expect(events).toEqual([ + { readyState: 2, status: 200, statusText: 'OK', responseHeaders: headers }, + { readyState: 4, status: 200, statusText: 'OK', responseHeaders: headers } + ]); + }); + + it('throws an error when timing out a request that has completed', function() { + this.request.open(); + this.request.send(); + this.request.respondWith({}); + var request = this.request; + + expect(function() { + request.responseTimeout(); + }).toThrowError('FakeXMLHttpRequest already completed'); + }); + + it('throws an error when responding to a request that has completed', function() { + this.request.open(); + this.request.send(); + this.request.respondWith({}); + var request = this.request; + + expect(function() { + request.respondWith({}); + }).toThrowError('FakeXMLHttpRequest already completed'); + }); + + it('throws an error when erroring a request that has completed', function() { + this.request.open(); + this.request.send(); + this.request.respondWith({}); + var request = this.request; + + expect(function() { + request.responseError({}); + }).toThrowError('FakeXMLHttpRequest already completed'); + }); + }); + + it('registers on-style callback with the event bus', function() { + this.request = new this.FakeRequest(); + + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('readystatechange', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('loadstart', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('progress', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('abort', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('error', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('load', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('timeout', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('loadend', jasmine.any(Function)); + + this.request.onreadystatechange = jasmine.createSpy('readystatechange'); + this.request.onloadstart = jasmine.createSpy('loadstart'); + this.request.onprogress = jasmine.createSpy('progress'); + this.request.onabort = jasmine.createSpy('abort'); + this.request.onerror = jasmine.createSpy('error'); + this.request.onload = jasmine.createSpy('load'); + this.request.ontimeout = jasmine.createSpy('timeout'); + this.request.onloadend = jasmine.createSpy('loadend'); + + var args = this.fakeEventBus.addEventListener.calls.allArgs(); + for (var i = 0; i < args.length; i++) { + var eventName = args[i][0], + busCallback = args[i][1]; + + busCallback(); + expect(this.request['on' + eventName]).toHaveBeenCalled(); + } + }); + + it('delegates addEventListener to the eventBus', function() { + this.request = new this.FakeRequest(); + + this.request.addEventListener('foo', 'bar'); + + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('foo', 'bar'); + }); + + it('delegates removeEventListener to the eventBus', function() { + this.request = new this.FakeRequest(); + + this.request.removeEventListener('foo', 'bar'); + + expect(this.fakeEventBus.removeEventListener).toHaveBeenCalledWith('foo', 'bar'); + }); + + describe('triggering progress events', function() { + beforeEach(function() { + this.request = new this.FakeRequest(); + }); + + it('should not trigger any events to start', function() { + this.request.open(); + + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('should trigger loadstart when sent', function() { + this.request.open(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.send(); + + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadend'); + }); + + it('should trigger abort, progress, loadend when aborted', function() { + this.request.open(); + this.request.send(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.abort(); + + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); + + it('should trigger error, progress, loadend when network error', function() { + this.request.open(); + this.request.send(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.responseError(); + + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); + + it('should trigger timeout, progress, loadend when timing out', function() { + this.request.open(); + this.request.send(); + + this.fakeEventBus.trigger.calls.reset(); + + jasmine.clock().install(); + this.request.responseTimeout(); + jasmine.clock().uninstall(); + + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange', 'timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); + + it('should trigger load, progress, loadend when responding', function() { + this.request.open(); + this.request.send(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.respondWith({ status: 200 }); + + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); + }); + + it('ticks the jasmine clock on timeout', function() { + var clock = { tick: jasmine.createSpy('tick') }; + spyOn(jasmine, 'clock').and.returnValue(clock); + + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.responseTimeout(); + + expect(clock.tick).toHaveBeenCalledWith(30000); + }); + + it('has an initial status of null', function() { + var request = new this.FakeRequest(); + + expect(request.status).toBeNull(); + }); + + it('has an aborted status', function() { + var request = new this.FakeRequest(); + + request.abort(); + + expect(request.status).toBe(0); + expect(request.statusText).toBe('abort'); + }); + + it('has a status from the response', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.status).toBe(200); + expect(request.statusText).toBe(''); + }); + + it('has a statusText from the response', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, statusText: 'OK' }); + + expect(request.status).toBe(200); + expect(request.statusText).toBe('OK'); + }); + + it('saves off any data sent to the server', function() { + var request = new this.FakeRequest(); + request.open(); + request.send('foo=bar&baz=quux'); + + expect(request.params).toBe('foo=bar&baz=quux'); + }); + + it('parses data sent to the server', function() { + var request = new this.FakeRequest(); + request.open(); + request.send('foo=bar&baz=quux'); + + this.parserInstance.and.returnValue('parsed'); + + expect(request.data()).toBe('parsed'); + }); + + it('skips parsing if no data was sent', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + expect(request.data()).toEqual({}); + expect(this.parserInstance).not.toHaveBeenCalled(); + }); + + it('saves responseText', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foobar' }); + + expect(request.responseText).toBe('foobar'); + }); + + it('defaults responseText if none is given', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.responseText).toBe(''); + }); + + it('retrieves individual response headers', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ + status: 200, + responseHeaders: { + 'X-Header': 'foo' + } + }); + + expect(request.getResponseHeader('X-Header')).toBe('foo'); + }); + + it('retrieves individual response headers case-insensitively', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ + status: 200, + responseHeaders: { + 'X-Header': 'foo' + } + }); + + expect(request.getResponseHeader('x-header')).toBe('foo'); + }); + + it('retrieves a combined response header', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ + status: 200, + responseHeaders: [ + { name: 'X-Header', value: 'foo' }, + { name: 'X-Header', value: 'bar' } + ] + }); + + expect(request.getResponseHeader('x-header')).toBe('foo, bar'); + }); + + it("doesn't pollute the response headers of other XHRs", function() { + var request1 = new this.FakeRequest(); + request1.open(); + request1.send(); + + var request2 = new this.FakeRequest(); + request2.open(); + request2.send(); + + request1.respondWith({ status: 200, responseHeaders: { 'X-Foo': 'bar' } }); + request2.respondWith({ status: 200, responseHeaders: { 'X-Baz': 'quux' } }); + + expect(request1.getAllResponseHeaders()).toBe("X-Foo: bar\r\n"); + expect(request2.getAllResponseHeaders()).toBe("X-Baz: quux\r\n"); + }); + + it('retrieves all response headers', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ + status: 200, + responseHeaders: [ + { name: 'X-Header-1', value: 'foo' }, + { name: 'X-Header-2', value: 'bar' }, + { name: 'X-Header-1', value: 'baz' } + ] + }); + + expect(request.getAllResponseHeaders()).toBe("X-Header-1: foo\r\nX-Header-2: bar\r\nX-Header-1: baz\r\n"); + }); + + it('sets the content-type header to the specified contentType when no other headers are supplied', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'text/plain' }); + + expect(request.getResponseHeader('content-type')).toBe('text/plain'); + expect(request.getAllResponseHeaders()).toBe("Content-Type: text/plain\r\n"); + }); + + it('sets a default content-type header if no contentType and headers are supplied', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.getResponseHeader('content-type')).toBe('application/json'); + expect(request.getAllResponseHeaders()).toBe("Content-Type: application/json\r\n"); + }); + + it('has no responseXML by default', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.responseXML).toBeNull(); + }); + + it('parses a text/xml document into responseXML', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'text/xml', responseText: '' }); + + if (typeof window['Document'] !== 'undefined') { + expect(request.responseXML instanceof window['Document']).toBe(true); + expect(request.response instanceof window['Document']).toBe(true); + } else { + // IE 8 + expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); + expect(request.response instanceof window['ActiveXObject']).toBe(true); + } + }); + + it('parses an application/xml document into responseXML', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'application/xml', responseText: '' }); + + if (typeof window['Document'] !== 'undefined') { + expect(request.responseXML instanceof window['Document']).toBe(true); + expect(request.response instanceof window['Document']).toBe(true); + } else { + // IE 8 + expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); + expect(request.response instanceof window['ActiveXObject']).toBe(true); + } + }); + + it('parses a custom blah+xml document into responseXML', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'application/text+xml', responseText: '' }); + + if (typeof window['Document'] !== 'undefined') { + expect(request.responseXML instanceof window['Document']).toBe(true); + expect(request.response instanceof window['Document']).toBe(true); + } else { + // IE 8 + expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); + expect(request.response instanceof window['ActiveXObject']).toBe(true); + } + }); + + it('defaults the response attribute to the responseText', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foo' }); + + expect(request.response).toEqual('foo'); + }); + + it('has a text response when the responseType is blank', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foo', responseType: '' }); + + expect(request.response).toEqual('foo'); + }); + + it('has a text response when the responseType is text', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foo', responseType: 'text' }); + + expect(request.response).toEqual('foo'); + }); +}); + + +describe("Jasmine Mock Ajax (for toplevel)", function() { + var request, anotherRequest, response; + var success, error, complete; + var client, onreadystatechange; + var sharedContext: any = {}; + var fakeGlobal, mockAjax; + + beforeEach(function() { + var fakeXMLHttpRequest = jasmine.createSpy('realFakeXMLHttpRequest'); + fakeGlobal = { + XMLHttpRequest: fakeXMLHttpRequest, + DOMParser: window['DOMParser'], + ActiveXObject: window['ActiveXObject'] + }; + mockAjax = new MockAjax(fakeGlobal); + mockAjax.install(); + + success = jasmine.createSpy("onSuccess"); + error = jasmine.createSpy("onFailure"); + complete = jasmine.createSpy("onComplete"); + + onreadystatechange = function() { + if (this.readyState === (this.DONE || 4)) { // IE 8 doesn't support DONE + if (this.status === 200) { + success(this.responseText, this.textStatus, this); + } else { + error(this, this.textStatus, ''); + } + + complete(this, this.textStatus); + } + }; + }); + + describe("when making a request", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.send(); + request = mockAjax.requests.mostRecent(); + }); + + it("should store URL and transport", function() { + expect(request.url).toEqual("example.com/someApi"); + }); + + it("should queue the request", function() { + expect(mockAjax.requests.count()).toEqual(1); + }); + + it("should allow access to the queued request", function() { + expect(mockAjax.requests.first()).toEqual(request); + }); + + it("should allow access to the queued request via index", function() { + expect(mockAjax.requests.at(0)).toEqual(request); + }); + + describe("and then another request", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.send(); + + anotherRequest = mockAjax.requests.mostRecent(); + }); + + it("should queue the next request", function() { + expect(mockAjax.requests.count()).toEqual(2); + }); + + it("should allow access to the other queued request", function() { + expect(mockAjax.requests.first()).toEqual(request); + expect(mockAjax.requests.mostRecent()).toEqual(anotherRequest); + }); + }); + + describe("mockAjax.requests.mostRecent()", function () { + + describe("when there is one request queued", function () { + it("should return the request", function() { + expect(mockAjax.requests.mostRecent()).toEqual(request); + }); + }); + + describe("when there is more than one request", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.send(); + anotherRequest = mockAjax.requests.mostRecent(); + }); + + it("should return the most recent request", function() { + expect(mockAjax.requests.mostRecent()).toEqual(anotherRequest); + }); + }); + + describe("when there are no requests", function () { + beforeEach(function() { + mockAjax.requests.reset(); + }); + + it("should return null", function() { + expect(mockAjax.requests.mostRecent()).toBeUndefined(); + }); + }); + }); + + describe("clearAjaxRequests()", function () { + beforeEach(function() { + mockAjax.requests.reset(); + }); + + it("should remove all requests", function() { + expect(mockAjax.requests.count()).toEqual(0); + expect(mockAjax.requests.mostRecent()).toBeUndefined(); + }); + }); + }); + + describe("when simulating a response with request.response", function () { + describe("and the response is Success", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = {status: 200, statusText: "OK", contentType: "text/html", responseText: "OK!"}; + request.respondWith(response); + + sharedContext.responseCallback = success; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = response.contentType; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + it("should call the success handler", function() { + expect(success).toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).not.toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("and the response is Success, but with JSON", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "application/json"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = {status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}', responseType: "json"}; + + request.respondWith(responseObject); + + sharedContext.responseCallback = success; + sharedContext.status = responseObject.status; + sharedContext.statusText = responseObject.statusText; + sharedContext.contentType = responseObject.contentType; + sharedContext.responseText = responseObject.responseText; + sharedContext.responseType = responseObject.responseType; + + response = success.calls.mostRecent().args[2]; + }); + + it("should call the success handler", function() { + expect(success).toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).not.toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + it("should return a JavaScript object for XHR2 response", function() { + var responseText = sharedContext.responseText; + expect(success.calls.mostRecent().args[0]).toEqual(responseText); + + expect(response.responseText).toEqual(responseText); + expect(response.response).toEqual({foo: "bar"}); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("and the response is Success, and response is overriden", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "application/json"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = {status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}', responseType: 'json'}; + + request.respondWith(responseObject); + + sharedContext.responseCallback = success; + sharedContext.status = responseObject.status; + sharedContext.statusText = responseObject.statusText; + sharedContext.contentType = responseObject.contentType; + sharedContext.responseText = responseObject.responseText; + sharedContext.responseType = responseObject.responseType; + + response = success.calls.mostRecent().args[2]; + }); + + it("should return the provided override for the XHR2 response", function() { + var responseText = sharedContext.responseText; + + expect(response.responseText).toEqual(responseText); + expect(response.response).toEqual({foo: "bar"}); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("response with unique header names using an object", function () { + beforeEach(function () { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = {status: 200, statusText: "OK", responseText: '["foo"]', responseHeaders: { + 'X-Header1': 'header 1 value', + 'X-Header2': 'header 2 value', + 'X-Header3': 'header 3 value' + }}; + request.respondWith(responseObject); + response = success.calls.mostRecent().args[2]; + }); + + it("getResponseHeader should return the each value", function () { + expect(response.getResponseHeader('X-Header1')).toBe('header 1 value'); + expect(response.getResponseHeader('X-Header2')).toBe('header 2 value'); + expect(response.getResponseHeader('X-Header3')).toBe('header 3 value'); + }); + + it("getAllResponseHeaders should return all values", function () { + expect(response.getAllResponseHeaders()).toBe([ + "X-Header1: header 1 value", + "X-Header2: header 2 value", + "X-Header3: header 3 value" + ].join("\r\n") + "\r\n"); + }); + }); + + describe("response with multiple headers of the same name using an array of objects", function () { + beforeEach(function () { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = {status: 200, statusText: "OK", responseText: '["foo"]', responseHeaders: [ + { name: 'X-Header', value: 'header value 1' }, + { name: 'X-Header', value: 'header value 2' } + ]}; + request.respondWith(responseObject); + response = success.calls.mostRecent().args[2]; + }); + + it("getResponseHeader should return all values comma separated", function () { + expect(response.getResponseHeader('X-Header')).toBe('header value 1, header value 2'); + }); + + it("getAllResponseHeaders should return all values", function () { + expect(response.getAllResponseHeaders()).toBe([ + "X-Header: header value 1", + "X-Header: header value 2" + ].join("\r\n") + "\r\n"); + }); + }); + + describe("the content type defaults to application/json", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "application/json"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = {status: 200, statusText: "OK", responseText: '{"foo": "valid JSON, dammit."}', responseType: 'json'}; + request.respondWith(response); + + sharedContext.responseCallback = success; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = "application/json"; + sharedContext.responseType = response.responseType; + sharedContext.responseText = response.responseText; + }); + + it("should call the success handler", function() { + expect(success).toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).not.toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("and the status/response code is 0", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = {status: 0, statusText: "ABORT", responseText: '{"foo": "whoops!"}'}; + request.respondWith(response); + + sharedContext.responseCallback = error; + sharedContext.status = 0; + sharedContext.statusText = response.statusText; + sharedContext.contentType = 'application/json'; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + it("should call the success handler", function() { + expect(success).not.toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Failure(sharedContext); + }); + }); + + describe("and the response is error", function () { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = {status: 500, statusText: "SERVER ERROR", contentType: "text/html", responseText: "(._){"}; + request.respondWith(response); + + sharedContext.responseCallback = error; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = response.contentType; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + it("should not call the success handler", function() { + expect(success).not.toHaveBeenCalled(); + }); + + it("should call the failure handler", function() { + expect(error).toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Failure(sharedContext); + }); + + describe('when simulating a response with request.responseTimeout', function() { + beforeEach(function() { + jasmine.clock().install(); + + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = {contentType: "text/html", response: "(._){response", responseText: "(._){", responseType: "text"}; + request.responseTimeout(response); + + sharedContext.responseCallback = error; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = response.contentType; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + afterEach(function() { + jasmine.clock().uninstall(); + }); + + it("should not call the success handler", function() { + expect(success).not.toHaveBeenCalled(); + }); + + it("should call the failure handler", function() { + expect(error).toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + }); +}); + + +function sharedAjaxResponseBehaviorForZepto_Success(context) { + describe("the success response", function () { + var xhr; + beforeEach(function() { + xhr = context.responseCallback.calls.mostRecent().args[2]; + }); + + it("should have the expected status code", function() { + expect(xhr.status).toEqual(context.status); + }); + + it("should have the expected content type", function() { + expect(xhr.getResponseHeader('Content-Type')).toEqual(context.contentType); + }); + + it("should have the expected xhr2 response", function() { + var expected = context.response || context.responseType === 'json' ? JSON.parse(context.responseText) : context.responseText; + expect(xhr.response).toEqual(expected); + }); + + it("should have the expected response text", function() { + expect(xhr.responseText).toEqual(context.responseText); + }); + + it("should have the expected status text", function() { + expect(xhr.statusText).toEqual(context.statusText); + }); + }); +} + +function sharedAjaxResponseBehaviorForZepto_Failure(context) { + describe("the failure response", function () { + var xhr; + beforeEach(function() { + xhr = context.responseCallback.calls.mostRecent().args[0]; + }); + + it("should have the expected status code", function() { + expect(xhr.status).toEqual(context.status); + }); + + it("should have the expected content type", function() { + expect(xhr.getResponseHeader('Content-Type')).toEqual(context.contentType); + }); + + it("should have the expected xhr2 response", function() { + var expected = context.response || xhr.responseType === 'json' ? JSON.parse(xhr.responseText) : xhr.responseText; + expect(xhr.response).toEqual(expected); + }); + + it("should have the expected response text", function() { + expect(xhr.responseText).toEqual(context.responseText); + }); + + it("should have the expected status text", function() { + expect(xhr.statusText).toEqual(context.statusText); + }); + }); +} + +describe('ParamParser', function() { + beforeEach(function() { + var Constructor = getJasmineRequireObj().AjaxParamParser(); + expect(Constructor).toEqual(jasmine.any(Function)); + this.parser = new Constructor(); + }); + + it('has a default parser', function() { + var parser = this.parser.findParser({ contentType: function() {} }), + parsed = parser.parse('3+stooges=shemp&3+stooges=larry%20%26%20moe%20%26%20curly&some%3Dthing=else+entirely'); + + expect(parsed).toEqual({ + '3 stooges': ['shemp', 'larry & moe & curly'], + 'some=thing': ['else entirely'] + }); + }); + + it('should detect and parse json', function() { + var data = { + foo: 'bar', + baz: ['q', 'u', 'u', 'x'], + nested: { + object: { + containing: 'stuff' + } + } + }, + parser = this.parser.findParser({ contentType: function() { return 'application/json'; } }), + parsed = parser.parse(JSON.stringify(data)); + + expect(parsed).toEqual(data); + }); + + it('should parse json with further qualifiers on content-type', function() { + var data = { + foo: 'bar', + baz: ['q', 'u', 'u', 'x'], + nested: { + object: { + containing: 'stuff' + } + } + }, + parser = this.parser.findParser({ contentType: function() { return 'application/json; charset=utf-8'; } }), + parsed = parser.parse(JSON.stringify(data)); + + expect(parsed).toEqual(data); + }); + + it('should have custom parsers take precedence', function() { + var custom = { + test: jasmine.createSpy('test').and.returnValue(true), + parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') + }; + + this.parser.add(custom); + + var parser = this.parser.findParser({ contentType: function() {} }), + parsed = parser.parse('custom_format'); + + expect(parsed).toEqual('parsedFormat'); + expect(custom.test).toHaveBeenCalled(); + expect(custom.parse).toHaveBeenCalledWith('custom_format'); + }); + + it('should skip custom parsers that do not match', function() { + var custom = { + test: jasmine.createSpy('test').and.returnValue(false), + parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') + }; + + this.parser.add(custom); + + var parser = this.parser.findParser({ contentType: function() {} }), + parsed = parser.parse('custom_format'); + + expect(parsed).toEqual({ custom_format: [ 'undefined' ] }); + expect(custom.test).toHaveBeenCalled(); + expect(custom.parse).not.toHaveBeenCalled(); + }); + + it('removes custom parsers when reset', function() { + var custom = { + test: jasmine.createSpy('test').and.returnValue(true), + parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') + }; + + this.parser.add(custom); + + var parser = this.parser.findParser({ contentType: function() {} }), + parsed = parser.parse('custom_format'); + + expect(parsed).toEqual('parsedFormat'); + + custom.test['calls'].reset(); + custom.parse['calls'].reset(); + + this.parser.reset(); + + parser = this.parser.findParser({ contentType: function() {} }); + parsed = parser.parse('custom_format'); + + expect(parsed).toEqual({ custom_format: [ 'undefined' ] }); + expect(custom.test).not.toHaveBeenCalled(); + expect(custom.parse).not.toHaveBeenCalled(); + }); +}); + +describe('RequestStub', function() { + beforeEach(function() { + this.RequestStub = getJasmineRequireObj().AjaxRequestStub(); + + jasmine.addMatchers({ + toMatchRequest: function() { + return { + compare: function(actual) { + return { + pass: actual.matches.apply(actual, Array.prototype.slice.call(arguments, 1)) + }; + } + }; + } + }); + }); + + it('matches just by exact url', function() { + var stub = new this.RequestStub('www.example.com/foo'); + + expect(stub)['toMatchRequest']('www.example.com/foo'); + }); + + it('does not match if the url differs', function() { + var stub = new this.RequestStub('www.example.com/foo'); + + expect(stub).not['toMatchRequest']('www.example.com/bar'); + }); + + it('matches unordered query params', function() { + var stub = new this.RequestStub('www.example.com?foo=bar&baz=quux'); + + expect(stub)['toMatchRequest']('www.example.com?baz=quux&foo=bar'); + }); + + it('requires all specified query params to be there', function() { + var stub = new this.RequestStub('www.example.com?foo=bar&baz=quux'); + + expect(stub).not['toMatchRequest']('www.example.com?foo=bar'); + }); + + it('can match the url with a RegExp', function() { + var stub = new this.RequestStub(/ba[rz]/); + + expect(stub)['toMatchRequest']('bar'); + expect(stub)['toMatchRequest']('baz'); + expect(stub).not['toMatchRequest']('foo'); + }); + + it('requires the method to match if supplied', function() { + var stub = new this.RequestStub('www.example.com/foo', null, 'POST'); + + expect(stub).not['toMatchRequest']('www.example.com/foo'); + expect(stub).not['toMatchRequest']('www.example.com/foo', null, 'GET'); + expect(stub)['toMatchRequest']('www.example.com/foo', null, 'POST'); + }); + + it('requires the data submitted to match if supplied', function() { + var stub = new this.RequestStub('/foo', 'foo=bar&baz=quux'); + + expect(stub)['toMatchRequest']('/foo', 'baz=quux&foo=bar'); + expect(stub).not['toMatchRequest']('/foo', 'foo=bar'); + }); +}); + +describe('RequestTracker', function() { + beforeEach(function() { + var Constructor = getJasmineRequireObj().AjaxRequestTracker(); + this.tracker = new Constructor(); + }); + + it('tracks the number of times ajax requests are made', function() { + expect(this.tracker.count()).toBe(0); + + this.tracker.track(); + + expect(this.tracker.count()).toBe(1); + }); + + it('simplifies access to the last (most recent) request', function() { + this.tracker.track(); + this.tracker.track('request'); + + expect(this.tracker.mostRecent()).toEqual('request'); + }); + + it('returns a useful falsy value when there is no last (most recent) request', function() { + expect(this.tracker.mostRecent()).toBeFalsy(); + }); + + it('simplifies access to the first (oldest) request', function() { + this.tracker.track('request'); + this.tracker.track(); + + expect(this.tracker.first()).toEqual('request'); + }); + + it('returns a useful falsy value when there is no first (oldest) request', function() { + expect(this.tracker.first()).toBeFalsy(); + }); + + it('allows the requests list to be reset', function() { + this.tracker.track(); + this.tracker.track(); + + expect(this.tracker.count()).toBe(2); + + this.tracker.reset(); + + expect(this.tracker.count()).toBe(0); + }); + + it('allows retrieval of an arbitrary request by index', function() { + this.tracker.track('1'); + this.tracker.track('2'); + this.tracker.track('3'); + + expect(this.tracker.at(1)).toEqual('2'); + }); + + it('allows retrieval of all requests that are for a given url', function() { + this.tracker.track({ url: 'foo' }); + this.tracker.track({ url: 'bar' }); + + expect(this.tracker.filter('bar')).toEqual([{ url: 'bar' }]); + }); + + it('allows retrieval of all requests that match a given RegExp', function() { + this.tracker.track({ url: 'foo' }); + this.tracker.track({ url: 'bar' }); + this.tracker.track({ url: 'baz' }); + + expect(this.tracker.filter(/ba[rz]/)).toEqual([{ url: 'bar' }, { url: 'baz' }]); + }); + + it('allows retrieval of all requests that match based on a function', function() { + this.tracker.track({ url: 'foo' }); + this.tracker.track({ url: 'bar' }); + this.tracker.track({ url: 'baz' }); + + var func = function(request) { + return request.url === 'bar'; + }; + + expect(this.tracker.filter(func)).toEqual([{ url: 'bar' }]); + }); + + it('filters to nothing if no requests have been tracked', function() { + expect(this.tracker.filter('foo')).toEqual([]); + }); +}); + +describe('EventBus', function() { + beforeEach(function() { + this.bus = getJasmineRequireObj().AjaxEventBus()(); + }); + + it('calls an event listener', function() { + var callback = jasmine.createSpy('callback'); + + this.bus.addEventListener('foo', callback); + this.bus.trigger('foo'); + + expect(callback).toHaveBeenCalled(); + }); + + it('calls an event listener with additional arguments', function() { + var callback = jasmine.createSpy('callback'); + + this.bus.addEventListener('foo', callback); + this.bus.trigger('foo', 'bar'); + + expect(callback).toHaveBeenCalledWith('bar'); + }); + + it('only triggers callbacks for the specified event', function() { + var fooCallback = jasmine.createSpy('foo'), + barCallback = jasmine.createSpy('bar'); + + this.bus.addEventListener('foo', fooCallback); + this.bus.addEventListener('bar', barCallback); + + this.bus.trigger('foo'); + + expect(fooCallback).toHaveBeenCalled(); + expect(barCallback).not.toHaveBeenCalled(); + }); + + it('calls all the callbacks for the specified event', function() { + var callback1 = jasmine.createSpy('callback'); + var callback2 = jasmine.createSpy('otherCallback'); + + this.bus.addEventListener('foo', callback1); + this.bus.addEventListener('foo', callback2); + + this.bus.trigger('foo'); + + expect(callback1).toHaveBeenCalled(); + expect(callback2).toHaveBeenCalled(); + }); + + it('works if there are no callbacks for the event', function() { + var bus = this.bus; + expect(function() { + bus.trigger('notActuallyThere'); + }).not.toThrow(); + }); + + it('does not call listeners that have been removed', function() { + var callback = jasmine.createSpy('callback'); + + this.bus.addEventListener('foo', callback); + this.bus.removeEventListener('foo', callback); + this.bus.trigger('foo'); + + expect(callback).not.toHaveBeenCalled(); + }); + + it('only removes the specified callback', function() { + var callback1 = jasmine.createSpy('callback'); + var callback2 = jasmine.createSpy('otherCallback'); + + this.bus.addEventListener('foo', callback1); + this.bus.addEventListener('foo', callback2); + this.bus.removeEventListener('foo', callback2); + + this.bus.trigger('foo'); + + expect(callback1).toHaveBeenCalled(); + expect(callback2).not.toHaveBeenCalled(); + }); +}); + +describe("Webmock style mocking", function() { + var successSpy, errorSpy, response, fakeGlobal, mockAjax; + + var sendRequest = function(fakeGlobal, url?, method?) { + url = url || "http://example.com/someApi"; + method = method || 'GET'; + var xhr = new fakeGlobal.XMLHttpRequest(); + xhr.onreadystatechange = function(args) { + if (this.readyState === (this.DONE || 4)) { // IE 8 doesn't support DONE + response = this; + successSpy(); + } + }; + + xhr.open(method, url); + xhr.send(); + }; + + beforeEach(function() { + successSpy = jasmine.createSpy('success'); + fakeGlobal = {XMLHttpRequest: jasmine.createSpy('realXMLHttpRequest')}; + mockAjax = new MockAjax(fakeGlobal); + mockAjax.install(); + + mockAjax.stubRequest("http://example.com/someApi").andReturn({responseText: "hi!"}); + }); + + it("allows a url to be setup as a stub", function() { + sendRequest(fakeGlobal); + expect(successSpy).toHaveBeenCalled(); + }); + + it("should allow you to clear all the ajax stubs", function() { + mockAjax.stubs.reset(); + sendRequest(fakeGlobal); + expect(successSpy).not.toHaveBeenCalled(); + }); + + it("should set the contentType", function() { + sendRequest(fakeGlobal); + expect(response.getResponseHeader('Content-Type')).toEqual('application/json'); + }); + + it("should set the responseText", function() { + sendRequest(fakeGlobal); + expect(response.responseText).toEqual('hi!'); + }); + + it("should default the status to 200", function() { + sendRequest(fakeGlobal); + expect(response.status).toEqual(200); + }); + + it("should set the responseHeaders", function() { + mockAjax.stubRequest("http://example.com/someApi").andReturn({ + responseText: "hi!", + responseHeaders: [{name: "X-Custom", value: "header value"}] + }); + sendRequest(fakeGlobal); + expect(response.getResponseHeader('X-Custom')).toEqual('header value'); + }); + + describe("with another stub for the same url", function() { + beforeEach(function() { + mockAjax.stubRequest("http://example.com/someApi").andReturn({responseText: "no", status: 403}); + sendRequest(fakeGlobal); + }); + + it("should set the status", function() { + expect(response.status).toEqual(403); + }); + + it("should allow the latest stub to win", function() { + expect(response.responseText).toEqual('no'); + }); + }); +}); + +describe("withMock", function() { + var sendRequest = function(fakeGlobal) { + var xhr = new fakeGlobal.XMLHttpRequest(); + + xhr.open("GET", "http://example.com/someApi"); + xhr.send(); + }; + + it("installs the mock for passed in function, and uninstalls when complete", function() { + var xmlHttpRequest = jasmine.createSpyObj('XMLHttpRequest', ['open', 'send']), + xmlHttpRequestCtor = spyOn(window, 'XMLHttpRequest').and.returnValue(xmlHttpRequest), + fakeGlobal = {XMLHttpRequest: xmlHttpRequestCtor}, + mockAjax = new MockAjax(fakeGlobal); + + mockAjax.withMock(function() { + sendRequest(fakeGlobal); + expect(xmlHttpRequest.open).not.toHaveBeenCalled(); + }); + + sendRequest(fakeGlobal); + expect(xmlHttpRequest.open).toHaveBeenCalled(); + }); + + it("properly uninstalls when the passed in function throws", function() { + var xmlHttpRequest = jasmine.createSpyObj('XMLHttpRequest', ['open', 'send']), + xmlHttpRequestCtor = spyOn(window, 'XMLHttpRequest').and.returnValue(xmlHttpRequest), + fakeGlobal = {XMLHttpRequest: xmlHttpRequestCtor}, + mockAjax = new MockAjax(fakeGlobal); + + expect(function() { + mockAjax.withMock(function() { + throw "error"; + }); + }).toThrow("error"); + + sendRequest(fakeGlobal); + expect(xmlHttpRequest.open).toHaveBeenCalled(); + }); +}); + +describe("mockAjax", function() { + it("throws an error if installed multiple times", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + function doubleInstall() { + mockAjax.install(); + mockAjax.install(); + } + + expect(doubleInstall).toThrow(); + }); + + it("does not throw an error if uninstalled between installs", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + function sequentialInstalls() { + mockAjax.install(); + mockAjax.uninstall(); + mockAjax.install(); + } + + expect(sequentialInstalls).not.toThrow(); + }); + + it("does not replace XMLHttpRequest until it is installed", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + fakeGlobal.XMLHttpRequest('foo'); + expect(fakeXmlHttpRequest).toHaveBeenCalledWith('foo'); + fakeXmlHttpRequest.calls.reset(); + + mockAjax.install(); + fakeGlobal.XMLHttpRequest('foo'); + expect(fakeXmlHttpRequest).not.toHaveBeenCalled(); + }); + + it("replaces the global XMLHttpRequest on uninstall", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + mockAjax.install(); + mockAjax.uninstall(); + + fakeGlobal.XMLHttpRequest('foo'); + expect(fakeXmlHttpRequest).toHaveBeenCalledWith('foo'); + }); + + it("clears requests and stubs upon uninstall", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + mockAjax.install(); + + mockAjax.requests.track({url: '/testurl'}); + mockAjax.stubRequest('/bobcat'); + + expect(mockAjax.requests.count()).toEqual(1); + expect(mockAjax.stubs.findStub('/bobcat')).toBeDefined(); + + mockAjax.uninstall(); + + expect(mockAjax.requests.count()).toEqual(0); + expect(mockAjax.stubs.findStub('/bobcat')).not.toBeDefined(); + }); + + it("allows the httpRequest to be retrieved", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + mockAjax.install(); + var request = new (fakeGlobal.XMLHttpRequest)(); + + expect(mockAjax.requests.count()).toBe(1); + expect(mockAjax.requests.mostRecent()).toBe(request); + }); + + it("allows the httpRequests to be cleared", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); + + mockAjax.install(); + var request = new (fakeGlobal.XMLHttpRequest)(); + + expect(mockAjax.requests.mostRecent()).toBe(request); + mockAjax.requests.reset(); + expect(mockAjax.requests.count()).toBe(0); + }); +}); diff --git a/jasmine-ajax/jasmine-ajax-tests.ts.tscparams b/jasmine-ajax/jasmine-ajax-tests.ts.tscparams new file mode 100644 index 0000000000..d3f5a12faa --- /dev/null +++ b/jasmine-ajax/jasmine-ajax-tests.ts.tscparams @@ -0,0 +1 @@ + diff --git a/jasmine-ajax/jasmine-ajax.d.ts b/jasmine-ajax/jasmine-ajax.d.ts new file mode 100644 index 0000000000..70ca2f57c1 --- /dev/null +++ b/jasmine-ajax/jasmine-ajax.d.ts @@ -0,0 +1,77 @@ +// Type definitions for jasmine-ajax 3.1.1 +// Project: https://github.com/jasmine/jasmine-ajax +// Definitions by: Louis Grignon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface JasmineAjaxResponse { + status?: string; + statusText?: string; + responseText?: string; + response?: string; + responseType?: string; + contentType?: string; + responseHeaders?: { [key: string]: string }; +} + +interface JasmineAjaxRequest { + url: string; + respondWith(response: JasmineAjaxResponse): void; +} + +interface JasmineAjaxRequestTracker { + track(request: JasmineAjaxRequest): void; + first(): JasmineAjaxRequest; + count(): number; + reset(): void; + mostRecent(): JasmineAjaxRequest; + at(index: number): JasmineAjaxRequest; + filter(urlToMatch: RegExp): JasmineAjaxRequest[]; + filter(urlToMatch: Function): JasmineAjaxRequest[]; + filter(urlToMatch: string): JasmineAjaxRequest[]; +} + +interface JasmineAjaxRequestStubReturnOptions { + status?: number; + contentType?: string; + response?: string; + responseText?: string; + responseHeaders?: { [key: string]: string }; +} + +interface JasmineAjaxRequestStub { + data?: string; + method?: string; + andReturn(options: JasmineAjaxRequestStubReturnOptions): void; + matches(fullUrl: string, data: string, method: string): boolean; +} + +interface JasmineAjaxStubTracker { + addStub(stub: JasmineAjaxRequestStub): void; + reset(): void; + findStub(url: string, data?: string, method?: string): JasmineAjaxRequestStub; +} + +interface JasmineAjaxParamParser { + test(xhr: XMLHttpRequest): boolean; + parse(paramString: string): any; +} + +declare class MockAjax { + constructor(globals); + + install(): void; + uninstall(): void; + + withMock(closure: () => void): void; + addCustomParamParser(parser: JasmineAjaxParamParser): void; + + stubRequest(url: RegExp, data?: string, method?: string): JasmineAjaxRequestStub; + stubRequest(url: string, data?: string, method?: string): JasmineAjaxRequestStub; + + requests: JasmineAjaxRequestTracker; + stubs: JasmineAjaxStubTracker; +} + +declare module jasmine { + export var Ajax: MockAjax; +} From c0bb2b179811977f9a4d71285071989acf5a75b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 May 2015 21:15:47 +0200 Subject: [PATCH 0039/2220] fixed dependencies and errors --- jasmine-ajax/jasmine-ajax-tests.ts | 3197 ++++++++++++++-------------- jasmine-ajax/jasmine-ajax.d.ts | 11 +- 2 files changed, 1610 insertions(+), 1598 deletions(-) diff --git a/jasmine-ajax/jasmine-ajax-tests.ts b/jasmine-ajax/jasmine-ajax-tests.ts index b5134d2cf7..6b5c50b1b9 100644 --- a/jasmine-ajax/jasmine-ajax-tests.ts +++ b/jasmine-ajax/jasmine-ajax-tests.ts @@ -6,1813 +6,1820 @@ /// /// +declare function getJasmineRequireObj(); + describe('StubTracker', function() { - beforeEach(function() { - var Constructor = getJasmineRequireObj().AjaxStubTracker(); - this.tracker = new Constructor(); - }); + beforeEach(function() { + var Constructor = getJasmineRequireObj().AjaxStubTracker(); + this.tracker = new Constructor(); + }); - it('finds nothing if no stubs are added', function() { - expect(this.tracker.findStub()).toBeUndefined(); - }); + it('finds nothing if no stubs are added', function() { + expect(this.tracker.findStub()).toBeUndefined(); + }); - it('finds an added stub', function() { - var stub = { matches: function() { return true; } }; - this.tracker.addStub(stub); + it('finds an added stub', function() { + var stub = { matches: function() { return true; } }; + this.tracker.addStub(stub); - expect(this.tracker.findStub()).toBe(stub); - }); + expect(this.tracker.findStub()).toBe(stub); + }); - it('skips an added stub that does not match', function() { - var stub = { matches: function() { return false; } }; - this.tracker.addStub(stub); + it('skips an added stub that does not match', function() { + var stub = { matches: function() { return false; } }; + this.tracker.addStub(stub); - expect(this.tracker.findStub()).toBeUndefined(); - }); + expect(this.tracker.findStub()).toBeUndefined(); + }); - it('passes url, data, and method to the stub', function() { - var stub = { matches: jasmine.createSpy('matches') }; - this.tracker.addStub(stub); + it('passes url, data, and method to the stub', function() { + var stub = { matches: jasmine.createSpy('matches') }; + this.tracker.addStub(stub); - this.tracker.findStub('url', 'data', 'method'); + this.tracker.findStub('url', 'data', 'method'); - expect(stub.matches).toHaveBeenCalledWith('url', 'data', 'method'); - }); + expect(stub.matches).toHaveBeenCalledWith('url', 'data', 'method'); + }); - it('can clear out all stubs', function() { - var stub = { matches: jasmine.createSpy('matches') }; - this.tracker.addStub(stub); + it('can clear out all stubs', function() { + var stub = { matches: jasmine.createSpy('matches') }; + this.tracker.addStub(stub); - this.tracker.findStub(); + this.tracker.findStub(); - expect(stub.matches).toHaveBeenCalled(); + expect(stub.matches).toHaveBeenCalled(); - this.tracker.reset(); - stub.matches.calls.reset(); + this.tracker.reset(); + stub.matches.calls.reset(); - this.tracker.findStub(); + this.tracker.findStub(); - expect(stub.matches).not.toHaveBeenCalled(); - }); + expect(stub.matches).not.toHaveBeenCalled(); + }); - it('uses the most recently added stub that matches', function() { - var stub1 = { matches: function() { return true; } }; - var stub2 = { matches: function() { return true; } }; - var stub3 = { matches: function() { return false; } }; + it('uses the most recently added stub that matches', function() { + var stub1 = { matches: function() { return true; } }; + var stub2 = { matches: function() { return true; } }; + var stub3 = { matches: function() { return false; } }; - this.tracker.addStub(stub1); - this.tracker.addStub(stub2); - this.tracker.addStub(stub3); + this.tracker.addStub(stub1); + this.tracker.addStub(stub2); + this.tracker.addStub(stub3); - expect(this.tracker.findStub()).toBe(stub2); - }); + expect(this.tracker.findStub()).toBe(stub2); + }); }); describe('FakeRequest', function() { - beforeEach(function() { - this.requestTracker = { track: jasmine.createSpy('trackRequest') }; - this.stubTracker = { findStub: function() {} }; - var parserInstance = this.parserInstance = jasmine.createSpy('parse'); - this.paramParser = { findParser: function() { return { parse: parserInstance }; } }; - var eventBus = this.fakeEventBus = { - addEventListener: jasmine.createSpy('addEventListener'), - trigger: jasmine.createSpy('trigger'), - removeEventListener: jasmine.createSpy('removeEventListener') - }; - this.eventBusFactory = function() { - return eventBus; - }; - this.fakeGlobal = { - XMLHttpRequest: function() { - this.extraAttribute = 'my cool attribute'; - }, - DOMParser: window['DOMParser'], - ActiveXObject: window['ActiveXObject'] - }; - this.FakeRequest = getJasmineRequireObj().AjaxFakeRequest(this.eventBusFactory)(this.fakeGlobal, this.requestTracker, this.stubTracker, this.paramParser); - }); - - it('extends from the global XMLHttpRequest', function() { - var request = new this.FakeRequest(); - - expect(request.extraAttribute).toEqual('my cool attribute'); - }); - - it('skips XMLHttpRequest attributes that IE does not want copied', function() { - // use real window here so it will correctly go red on IE if it breaks - var FakeRequest = getJasmineRequireObj().AjaxFakeRequest(this.eventBusFactory)(window, this.requestTracker, this.stubTracker, this.paramParser); - var request = new FakeRequest(); - - expect(request.responseBody).toBeUndefined(); - expect(request.responseXML).toBeUndefined(); - expect(request.statusText).toBeUndefined(); - }); - - it('tracks the request', function() { - var request = new this.FakeRequest(); - - expect(this.requestTracker.track).toHaveBeenCalledWith(request); - }); - - it('has default request headers and override mime type', function() { - var request = new this.FakeRequest(); - - expect(request.requestHeaders).toEqual({}); - expect(request.overriddenMimeType).toBeNull(); - }); - - it('saves request information when opened', function() { - var request = new this.FakeRequest(); - request.open('METHOD', 'URL', 'ignore_async', 'USERNAME', 'PASSWORD'); - - expect(request.method).toEqual('METHOD'); - expect(request.url).toEqual('URL'); - expect(request.username).toEqual('USERNAME'); - expect(request.password).toEqual('PASSWORD'); - }); - - it('saves an override mime type', function() { - var request = new this.FakeRequest(); - - request.overrideMimeType('application/text; charset: utf-8'); - - expect(request.overriddenMimeType).toBe('application/text; charset: utf-8'); - }); - - it('saves request headers', function() { - var request = new this.FakeRequest(); - - request.setRequestHeader('X-Header-1', 'value1'); - request.setRequestHeader('X-Header-2', 'value2'); - - expect(request.requestHeaders).toEqual({ - 'X-Header-1': 'value1', - 'X-Header-2': 'value2' - }); - }); - - it('combines request headers with the same header name', function() { - var request = new this.FakeRequest(); - - request.setRequestHeader('X-Header', 'value1'); - request.setRequestHeader('X-Header', 'value2'); - - expect(request.requestHeaders['X-Header']).toEqual('value1, value2'); - }); - - it('finds the content-type request header', function() { - var request = new this.FakeRequest(); - - request.setRequestHeader('ContEnt-tYPe', 'application/text+xml'); - - expect(request.contentType()).toEqual('application/text+xml'); - }); - - describe('managing readyState', function() { - beforeEach(function() { - this.request = new this.FakeRequest(); - }); - - it('has an initial ready state of 0 (uninitialized)', function() { - expect(this.request.readyState).toBe(0); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalled(); - }); - - it('has a ready state of 1 (open) when opened', function() { - this.request.open(); - - expect(this.request.readyState).toBe(1); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - }); - - it('has a ready state of 0 (uninitialized) when aborted', function() { - this.request.open(); - this.fakeEventBus.trigger.calls.reset(); - - this.request.abort(); - - expect(this.request.readyState).toBe(0); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - }); - - it('has a ready state of 1 (sent) when sent', function() { - this.request.open(); - this.fakeEventBus.trigger.calls.reset(); - - this.request.send(); - - expect(this.request.readyState).toBe(1); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadstart'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('readystatechange'); - }); - - it('has a ready state of 4 (loaded) when timed out', function() { - this.request.open(); - this.request.send(); - this.fakeEventBus.trigger.calls.reset(); - - jasmine.clock().install(); - this.request.responseTimeout(); - jasmine.clock().uninstall(); - - expect(this.request.readyState).toBe(4); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange', 'timeout'); - }); - - it('has a ready state of 4 (loaded) when network erroring', function() { - this.request.open(); - this.request.send(); - this.fakeEventBus.trigger.calls.reset(); - - this.request.responseError(); - - expect(this.request.readyState).toBe(4); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - }); - - it('has a ready state of 4 (loaded) when responding', function() { - this.request.open(); - this.request.send(); - this.fakeEventBus.trigger.calls.reset(); - - this.request.respondWith({}); - - expect(this.request.readyState).toBe(4); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - }); - - it('has a ready state of 2, then 4 (loaded) when responding', function() { - this.request.open(); - this.request.send(); - this.fakeEventBus.trigger.calls.reset(); - - var request = this.request; - var events = []; - var headers = [ - { name: 'X-Header', value: 'foo' } - ]; - - this.fakeEventBus.trigger.and.callFake(function(event) { - if (event === 'readystatechange') { - events.push({ - readyState: request.readyState, - status: request.status, - statusText: request.statusText, - responseHeaders: request.responseHeaders - }); - } - }); - - this.request.respondWith({ - status: 200, - statusText: 'OK', - responseHeaders: headers - }); - - expect(this.request.readyState).toBe(4); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - expect(events.length).toBe(2); - expect(events).toEqual([ - { readyState: 2, status: 200, statusText: 'OK', responseHeaders: headers }, - { readyState: 4, status: 200, statusText: 'OK', responseHeaders: headers } - ]); - }); - - it('throws an error when timing out a request that has completed', function() { - this.request.open(); - this.request.send(); - this.request.respondWith({}); - var request = this.request; - - expect(function() { - request.responseTimeout(); - }).toThrowError('FakeXMLHttpRequest already completed'); - }); - - it('throws an error when responding to a request that has completed', function() { - this.request.open(); - this.request.send(); - this.request.respondWith({}); - var request = this.request; - - expect(function() { - request.respondWith({}); - }).toThrowError('FakeXMLHttpRequest already completed'); - }); - - it('throws an error when erroring a request that has completed', function() { - this.request.open(); - this.request.send(); - this.request.respondWith({}); - var request = this.request; - - expect(function() { - request.responseError({}); - }).toThrowError('FakeXMLHttpRequest already completed'); - }); - }); - - it('registers on-style callback with the event bus', function() { - this.request = new this.FakeRequest(); - - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('readystatechange', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('loadstart', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('progress', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('abort', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('error', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('load', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('timeout', jasmine.any(Function)); - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('loadend', jasmine.any(Function)); - - this.request.onreadystatechange = jasmine.createSpy('readystatechange'); - this.request.onloadstart = jasmine.createSpy('loadstart'); - this.request.onprogress = jasmine.createSpy('progress'); - this.request.onabort = jasmine.createSpy('abort'); - this.request.onerror = jasmine.createSpy('error'); - this.request.onload = jasmine.createSpy('load'); - this.request.ontimeout = jasmine.createSpy('timeout'); - this.request.onloadend = jasmine.createSpy('loadend'); - - var args = this.fakeEventBus.addEventListener.calls.allArgs(); - for (var i = 0; i < args.length; i++) { - var eventName = args[i][0], - busCallback = args[i][1]; - - busCallback(); - expect(this.request['on' + eventName]).toHaveBeenCalled(); - } - }); - - it('delegates addEventListener to the eventBus', function() { - this.request = new this.FakeRequest(); - - this.request.addEventListener('foo', 'bar'); - - expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('foo', 'bar'); - }); - - it('delegates removeEventListener to the eventBus', function() { - this.request = new this.FakeRequest(); - - this.request.removeEventListener('foo', 'bar'); - - expect(this.fakeEventBus.removeEventListener).toHaveBeenCalledWith('foo', 'bar'); - }); - - describe('triggering progress events', function() { - beforeEach(function() { - this.request = new this.FakeRequest(); - }); - - it('should not trigger any events to start', function() { - this.request.open(); - - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - }); - - it('should trigger loadstart when sent', function() { - this.request.open(); - - this.fakeEventBus.trigger.calls.reset(); - - this.request.send(); - - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadstart'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('readystatechange'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('progress'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadend'); - }); - - it('should trigger abort, progress, loadend when aborted', function() { - this.request.open(); - this.request.send(); - - this.fakeEventBus.trigger.calls.reset(); - - this.request.abort(); - - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('abort'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); - }); - - it('should trigger error, progress, loadend when network error', function() { - this.request.open(); - this.request.send(); - - this.fakeEventBus.trigger.calls.reset(); - - this.request.responseError(); - - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('error'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); - }); + beforeEach(function() { + this.requestTracker = { track: jasmine.createSpy('trackRequest') }; + this.stubTracker = { findStub: function() { } }; + var parserInstance = this.parserInstance = jasmine.createSpy('parse'); + this.paramParser = { findParser: function() { return { parse: parserInstance }; } }; + var eventBus = this.fakeEventBus = { + addEventListener: jasmine.createSpy('addEventListener'), + trigger: jasmine.createSpy('trigger'), + removeEventListener: jasmine.createSpy('removeEventListener') + }; + this.eventBusFactory = function() { + return eventBus; + }; + this.fakeGlobal = { + XMLHttpRequest: function() { + this.extraAttribute = 'my cool attribute'; + }, + DOMParser: window['DOMParser'], + ActiveXObject: window['ActiveXObject'] + }; + this.FakeRequest = getJasmineRequireObj().AjaxFakeRequest(this.eventBusFactory)(this.fakeGlobal, this.requestTracker, this.stubTracker, this.paramParser); + }); + + it('extends from the global XMLHttpRequest', function() { + var request = new this.FakeRequest(); + + expect(request.extraAttribute).toEqual('my cool attribute'); + }); + + it('skips XMLHttpRequest attributes that IE does not want copied', function() { + // use real window here so it will correctly go red on IE if it breaks + var FakeRequest = getJasmineRequireObj().AjaxFakeRequest(this.eventBusFactory)(window, this.requestTracker, this.stubTracker, this.paramParser); + var request = new FakeRequest(); + + expect(request.responseBody).toBeUndefined(); + expect(request.responseXML).toBeUndefined(); + expect(request.statusText).toBeUndefined(); + }); + + it('tracks the request', function() { + var request = new this.FakeRequest(); + + expect(this.requestTracker.track).toHaveBeenCalledWith(request); + }); + + it('has default request headers and override mime type', function() { + var request = new this.FakeRequest(); + + expect(request.requestHeaders).toEqual({}); + expect(request.overriddenMimeType).toBeNull(); + }); + + it('saves request information when opened', function() { + var request = new this.FakeRequest(); + request.open('METHOD', 'URL', 'ignore_async', 'USERNAME', 'PASSWORD'); + + expect(request.method).toEqual('METHOD'); + expect(request.url).toEqual('URL'); + expect(request.username).toEqual('USERNAME'); + expect(request.password).toEqual('PASSWORD'); + }); + + it('saves an override mime type', function() { + var request = new this.FakeRequest(); + + request.overrideMimeType('application/text; charset: utf-8'); + + expect(request.overriddenMimeType).toBe('application/text; charset: utf-8'); + }); + + it('saves request headers', function() { + var request = new this.FakeRequest(); + + request.setRequestHeader('X-Header-1', 'value1'); + request.setRequestHeader('X-Header-2', 'value2'); + + expect(request.requestHeaders).toEqual({ + 'X-Header-1': 'value1', + 'X-Header-2': 'value2' + }); + }); + + it('combines request headers with the same header name', function() { + var request = new this.FakeRequest(); + + request.setRequestHeader('X-Header', 'value1'); + request.setRequestHeader('X-Header', 'value2'); + + expect(request.requestHeaders['X-Header']).toEqual('value1, value2'); + }); + + it('finds the content-type request header', function() { + var request = new this.FakeRequest(); + + request.setRequestHeader('ContEnt-tYPe', 'application/text+xml'); + + expect(request.contentType()).toEqual('application/text+xml'); + }); + + describe('managing readyState', function() { + beforeEach(function() { + this.request = new this.FakeRequest(); + }); + + it('has an initial ready state of 0 (uninitialized)', function() { + expect(this.request.readyState).toBe(0); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalled(); + }); + + it('has a ready state of 1 (open) when opened', function() { + this.request.open(); + + expect(this.request.readyState).toBe(1); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 0 (uninitialized) when aborted', function() { + this.request.open(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.abort(); + + expect(this.request.readyState).toBe(0); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 1 (sent) when sent', function() { + this.request.open(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.send(); + + expect(this.request.readyState).toBe(1); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 4 (loaded) when timed out', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + jasmine.clock().install(); + this.request.responseTimeout(); + jasmine.clock().uninstall(); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange', 'timeout'); + }); + + it('has a ready state of 4 (loaded) when network erroring', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.responseError(); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 4 (loaded) when responding', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + this.request.respondWith({}); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('has a ready state of 2, then 4 (loaded) when responding', function() { + this.request.open(); + this.request.send(); + this.fakeEventBus.trigger.calls.reset(); + + var request = this.request; + var events = []; + var headers = [ + { name: 'X-Header', value: 'foo' } + ]; + + this.fakeEventBus.trigger.and.callFake(function(event) { + if (event === 'readystatechange') { + events.push({ + readyState: request.readyState, + status: request.status, + statusText: request.statusText, + responseHeaders: request.responseHeaders + }); + } + }); + + this.request.respondWith({ + status: 200, + statusText: 'OK', + responseHeaders: headers + }); + + expect(this.request.readyState).toBe(4); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(events.length).toBe(2); + expect(events).toEqual([ + { readyState: 2, status: 200, statusText: 'OK', responseHeaders: headers }, + { readyState: 4, status: 200, statusText: 'OK', responseHeaders: headers } + ]); + }); + + it('throws an error when timing out a request that has completed', function() { + this.request.open(); + this.request.send(); + this.request.respondWith({}); + var request = this.request; + + expect(function() { + request.responseTimeout(); + }).toThrowError('FakeXMLHttpRequest already completed'); + }); + + it('throws an error when responding to a request that has completed', function() { + this.request.open(); + this.request.send(); + this.request.respondWith({}); + var request = this.request; + + expect(function() { + request.respondWith({}); + }).toThrowError('FakeXMLHttpRequest already completed'); + }); + + it('throws an error when erroring a request that has completed', function() { + this.request.open(); + this.request.send(); + this.request.respondWith({}); + var request = this.request; + + expect(function() { + request.responseError({}); + }).toThrowError('FakeXMLHttpRequest already completed'); + }); + }); + + it('registers on-style callback with the event bus', function() { + this.request = new this.FakeRequest(); + + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('readystatechange', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('loadstart', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('progress', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('abort', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('error', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('load', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('timeout', jasmine.any(Function)); + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('loadend', jasmine.any(Function)); + + this.request.onreadystatechange = jasmine.createSpy('readystatechange'); + this.request.onloadstart = jasmine.createSpy('loadstart'); + this.request.onprogress = jasmine.createSpy('progress'); + this.request.onabort = jasmine.createSpy('abort'); + this.request.onerror = jasmine.createSpy('error'); + this.request.onload = jasmine.createSpy('load'); + this.request.ontimeout = jasmine.createSpy('timeout'); + this.request.onloadend = jasmine.createSpy('loadend'); + + var args = this.fakeEventBus.addEventListener.calls.allArgs(); + for (var i = 0; i < args.length; i++) { + var eventName = args[i][0], + busCallback = args[i][1]; + + busCallback(); + expect(this.request['on' + eventName]).toHaveBeenCalled(); + } + }); + + it('delegates addEventListener to the eventBus', function() { + this.request = new this.FakeRequest(); + + this.request.addEventListener('foo', 'bar'); + + expect(this.fakeEventBus.addEventListener).toHaveBeenCalledWith('foo', 'bar'); + }); + + it('delegates removeEventListener to the eventBus', function() { + this.request = new this.FakeRequest(); + + this.request.removeEventListener('foo', 'bar'); + + expect(this.fakeEventBus.removeEventListener).toHaveBeenCalledWith('foo', 'bar'); + }); + + describe('triggering progress events', function() { + beforeEach(function() { + this.request = new this.FakeRequest(); + }); + + it('should not trigger any events to start', function() { + this.request.open(); + + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + }); + + it('should trigger loadstart when sent', function() { + this.request.open(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.send(); + + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadend'); + }); + + it('should trigger abort, progress, loadend when aborted', function() { + this.request.open(); + this.request.send(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.abort(); + + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); + + it('should trigger error, progress, loadend when network error', function() { + this.request.open(); + this.request.send(); + + this.fakeEventBus.trigger.calls.reset(); + + this.request.responseError(); + + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); - it('should trigger timeout, progress, loadend when timing out', function() { - this.request.open(); - this.request.send(); + it('should trigger timeout, progress, loadend when timing out', function() { + this.request.open(); + this.request.send(); - this.fakeEventBus.trigger.calls.reset(); + this.fakeEventBus.trigger.calls.reset(); - jasmine.clock().install(); - this.request.responseTimeout(); - jasmine.clock().uninstall(); + jasmine.clock().install(); + this.request.responseTimeout(); + jasmine.clock().uninstall(); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange', 'timeout'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('timeout'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); - }); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange', 'timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); - it('should trigger load, progress, loadend when responding', function() { - this.request.open(); - this.request.send(); + it('should trigger load, progress, loadend when responding', function() { + this.request.open(); + this.request.send(); - this.fakeEventBus.trigger.calls.reset(); + this.fakeEventBus.trigger.calls.reset(); - this.request.respondWith({ status: 200 }); + this.request.respondWith({ status: 200 }); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('load'); - expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); - expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); - }); - }); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('loadstart'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('readystatechange'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('progress'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('abort'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('error'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('load'); + expect(this.fakeEventBus.trigger).not.toHaveBeenCalledWith('timeout'); + expect(this.fakeEventBus.trigger).toHaveBeenCalledWith('loadend'); + }); + }); - it('ticks the jasmine clock on timeout', function() { - var clock = { tick: jasmine.createSpy('tick') }; - spyOn(jasmine, 'clock').and.returnValue(clock); + it('ticks the jasmine clock on timeout', function() { + var clock = { tick: jasmine.createSpy('tick') }; + spyOn(jasmine, 'clock').and.returnValue(clock); - var request = new this.FakeRequest(); - request.open(); - request.send(); + var request = new this.FakeRequest(); + request.open(); + request.send(); - request.responseTimeout(); + request.responseTimeout(); - expect(clock.tick).toHaveBeenCalledWith(30000); - }); + expect(clock.tick).toHaveBeenCalledWith(30000); + }); - it('has an initial status of null', function() { - var request = new this.FakeRequest(); - - expect(request.status).toBeNull(); - }); - - it('has an aborted status', function() { - var request = new this.FakeRequest(); - - request.abort(); + it('has an initial status of null', function() { + var request = new this.FakeRequest(); + + expect(request.status).toBeNull(); + }); + + it('has an aborted status', function() { + var request = new this.FakeRequest(); + + request.abort(); - expect(request.status).toBe(0); - expect(request.statusText).toBe('abort'); - }); + expect(request.status).toBe(0); + expect(request.statusText).toBe('abort'); + }); - it('has a status from the response', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200 }); - - expect(request.status).toBe(200); - expect(request.statusText).toBe(''); - }); - - it('has a statusText from the response', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, statusText: 'OK' }); - - expect(request.status).toBe(200); - expect(request.statusText).toBe('OK'); - }); - - it('saves off any data sent to the server', function() { - var request = new this.FakeRequest(); - request.open(); - request.send('foo=bar&baz=quux'); - - expect(request.params).toBe('foo=bar&baz=quux'); - }); - - it('parses data sent to the server', function() { - var request = new this.FakeRequest(); - request.open(); - request.send('foo=bar&baz=quux'); - - this.parserInstance.and.returnValue('parsed'); + it('has a status from the response', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.status).toBe(200); + expect(request.statusText).toBe(''); + }); + + it('has a statusText from the response', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, statusText: 'OK' }); + + expect(request.status).toBe(200); + expect(request.statusText).toBe('OK'); + }); + + it('saves off any data sent to the server', function() { + var request = new this.FakeRequest(); + request.open(); + request.send('foo=bar&baz=quux'); + + expect(request.params).toBe('foo=bar&baz=quux'); + }); + + it('parses data sent to the server', function() { + var request = new this.FakeRequest(); + request.open(); + request.send('foo=bar&baz=quux'); + + this.parserInstance.and.returnValue('parsed'); - expect(request.data()).toBe('parsed'); - }); - - it('skips parsing if no data was sent', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - expect(request.data()).toEqual({}); - expect(this.parserInstance).not.toHaveBeenCalled(); - }); - - it('saves responseText', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, responseText: 'foobar' }); + expect(request.data()).toBe('parsed'); + }); + + it('skips parsing if no data was sent', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + expect(request.data()).toEqual({}); + expect(this.parserInstance).not.toHaveBeenCalled(); + }); + + it('saves responseText', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foobar' }); - expect(request.responseText).toBe('foobar'); - }); + expect(request.responseText).toBe('foobar'); + }); - it('defaults responseText if none is given', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200 }); + it('defaults responseText if none is given', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); - expect(request.responseText).toBe(''); - }); + expect(request.responseText).toBe(''); + }); - it('retrieves individual response headers', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); + it('retrieves individual response headers', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); - request.respondWith({ - status: 200, - responseHeaders: { - 'X-Header': 'foo' - } - }); + request.respondWith({ + status: 200, + responseHeaders: { + 'X-Header': 'foo' + } + }); - expect(request.getResponseHeader('X-Header')).toBe('foo'); - }); + expect(request.getResponseHeader('X-Header')).toBe('foo'); + }); - it('retrieves individual response headers case-insensitively', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); + it('retrieves individual response headers case-insensitively', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); - request.respondWith({ - status: 200, - responseHeaders: { - 'X-Header': 'foo' - } - }); - - expect(request.getResponseHeader('x-header')).toBe('foo'); - }); - - it('retrieves a combined response header', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ - status: 200, - responseHeaders: [ - { name: 'X-Header', value: 'foo' }, - { name: 'X-Header', value: 'bar' } - ] - }); - - expect(request.getResponseHeader('x-header')).toBe('foo, bar'); - }); - - it("doesn't pollute the response headers of other XHRs", function() { - var request1 = new this.FakeRequest(); - request1.open(); - request1.send(); - - var request2 = new this.FakeRequest(); - request2.open(); - request2.send(); - - request1.respondWith({ status: 200, responseHeaders: { 'X-Foo': 'bar' } }); - request2.respondWith({ status: 200, responseHeaders: { 'X-Baz': 'quux' } }); - - expect(request1.getAllResponseHeaders()).toBe("X-Foo: bar\r\n"); - expect(request2.getAllResponseHeaders()).toBe("X-Baz: quux\r\n"); - }); - - it('retrieves all response headers', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ - status: 200, - responseHeaders: [ - { name: 'X-Header-1', value: 'foo' }, - { name: 'X-Header-2', value: 'bar' }, - { name: 'X-Header-1', value: 'baz' } - ] - }); - - expect(request.getAllResponseHeaders()).toBe("X-Header-1: foo\r\nX-Header-2: bar\r\nX-Header-1: baz\r\n"); - }); - - it('sets the content-type header to the specified contentType when no other headers are supplied', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, contentType: 'text/plain' }); - - expect(request.getResponseHeader('content-type')).toBe('text/plain'); - expect(request.getAllResponseHeaders()).toBe("Content-Type: text/plain\r\n"); - }); - - it('sets a default content-type header if no contentType and headers are supplied', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200 }); - - expect(request.getResponseHeader('content-type')).toBe('application/json'); - expect(request.getAllResponseHeaders()).toBe("Content-Type: application/json\r\n"); - }); - - it('has no responseXML by default', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200 }); - - expect(request.responseXML).toBeNull(); - }); - - it('parses a text/xml document into responseXML', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, contentType: 'text/xml', responseText: '' }); - - if (typeof window['Document'] !== 'undefined') { - expect(request.responseXML instanceof window['Document']).toBe(true); - expect(request.response instanceof window['Document']).toBe(true); - } else { - // IE 8 - expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); - expect(request.response instanceof window['ActiveXObject']).toBe(true); - } - }); - - it('parses an application/xml document into responseXML', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, contentType: 'application/xml', responseText: '' }); - - if (typeof window['Document'] !== 'undefined') { - expect(request.responseXML instanceof window['Document']).toBe(true); - expect(request.response instanceof window['Document']).toBe(true); - } else { - // IE 8 - expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); - expect(request.response instanceof window['ActiveXObject']).toBe(true); - } - }); - - it('parses a custom blah+xml document into responseXML', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, contentType: 'application/text+xml', responseText: '' }); - - if (typeof window['Document'] !== 'undefined') { - expect(request.responseXML instanceof window['Document']).toBe(true); - expect(request.response instanceof window['Document']).toBe(true); - } else { - // IE 8 - expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); - expect(request.response instanceof window['ActiveXObject']).toBe(true); - } - }); - - it('defaults the response attribute to the responseText', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, responseText: 'foo' }); - - expect(request.response).toEqual('foo'); - }); - - it('has a text response when the responseType is blank', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, responseText: 'foo', responseType: '' }); - - expect(request.response).toEqual('foo'); - }); - - it('has a text response when the responseType is text', function() { - var request = new this.FakeRequest(); - request.open(); - request.send(); - - request.respondWith({ status: 200, responseText: 'foo', responseType: 'text' }); - - expect(request.response).toEqual('foo'); - }); + request.respondWith({ + status: 200, + responseHeaders: { + 'X-Header': 'foo' + } + }); + + expect(request.getResponseHeader('x-header')).toBe('foo'); + }); + + it('retrieves a combined response header', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ + status: 200, + responseHeaders: [ + { name: 'X-Header', value: 'foo' }, + { name: 'X-Header', value: 'bar' } + ] + }); + + expect(request.getResponseHeader('x-header')).toBe('foo, bar'); + }); + + it("doesn't pollute the response headers of other XHRs", function() { + var request1 = new this.FakeRequest(); + request1.open(); + request1.send(); + + var request2 = new this.FakeRequest(); + request2.open(); + request2.send(); + + request1.respondWith({ status: 200, responseHeaders: { 'X-Foo': 'bar' } }); + request2.respondWith({ status: 200, responseHeaders: { 'X-Baz': 'quux' } }); + + expect(request1.getAllResponseHeaders()).toBe("X-Foo: bar\r\n"); + expect(request2.getAllResponseHeaders()).toBe("X-Baz: quux\r\n"); + }); + + it('retrieves all response headers', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ + status: 200, + responseHeaders: [ + { name: 'X-Header-1', value: 'foo' }, + { name: 'X-Header-2', value: 'bar' }, + { name: 'X-Header-1', value: 'baz' } + ] + }); + + expect(request.getAllResponseHeaders()).toBe("X-Header-1: foo\r\nX-Header-2: bar\r\nX-Header-1: baz\r\n"); + }); + + it('sets the content-type header to the specified contentType when no other headers are supplied', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'text/plain' }); + + expect(request.getResponseHeader('content-type')).toBe('text/plain'); + expect(request.getAllResponseHeaders()).toBe("Content-Type: text/plain\r\n"); + }); + + it('sets a default content-type header if no contentType and headers are supplied', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.getResponseHeader('content-type')).toBe('application/json'); + expect(request.getAllResponseHeaders()).toBe("Content-Type: application/json\r\n"); + }); + + it('has no responseXML by default', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200 }); + + expect(request.responseXML).toBeNull(); + }); + + it('parses a text/xml document into responseXML', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'text/xml', responseText: '' }); + + if (typeof window['Document'] !== 'undefined') { + expect(request.responseXML instanceof window['Document']).toBe(true); + expect(request.response instanceof window['Document']).toBe(true); + } else { + // IE 8 + expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); + expect(request.response instanceof window['ActiveXObject']).toBe(true); + } + }); + + it('parses an application/xml document into responseXML', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'application/xml', responseText: '' }); + + if (typeof window['Document'] !== 'undefined') { + expect(request.responseXML instanceof window['Document']).toBe(true); + expect(request.response instanceof window['Document']).toBe(true); + } else { + // IE 8 + expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); + expect(request.response instanceof window['ActiveXObject']).toBe(true); + } + }); + + it('parses a custom blah+xml document into responseXML', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, contentType: 'application/text+xml', responseText: '' }); + + if (typeof window['Document'] !== 'undefined') { + expect(request.responseXML instanceof window['Document']).toBe(true); + expect(request.response instanceof window['Document']).toBe(true); + } else { + // IE 8 + expect(request.responseXML instanceof window['ActiveXObject']).toBe(true); + expect(request.response instanceof window['ActiveXObject']).toBe(true); + } + }); + + it('defaults the response attribute to the responseText', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foo' }); + + expect(request.response).toEqual('foo'); + }); + + it('has a text response when the responseType is blank', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foo', responseType: '' }); + + expect(request.response).toEqual('foo'); + }); + + it('has a text response when the responseType is text', function() { + var request = new this.FakeRequest(); + request.open(); + request.send(); + + request.respondWith({ status: 200, responseText: 'foo', responseType: 'text' }); + + expect(request.response).toEqual('foo'); + }); }); describe("Jasmine Mock Ajax (for toplevel)", function() { - var request, anotherRequest, response; - var success, error, complete; - var client, onreadystatechange; - var sharedContext: any = {}; - var fakeGlobal, mockAjax; - - beforeEach(function() { - var fakeXMLHttpRequest = jasmine.createSpy('realFakeXMLHttpRequest'); - fakeGlobal = { - XMLHttpRequest: fakeXMLHttpRequest, - DOMParser: window['DOMParser'], - ActiveXObject: window['ActiveXObject'] - }; - mockAjax = new MockAjax(fakeGlobal); - mockAjax.install(); - - success = jasmine.createSpy("onSuccess"); - error = jasmine.createSpy("onFailure"); - complete = jasmine.createSpy("onComplete"); - - onreadystatechange = function() { - if (this.readyState === (this.DONE || 4)) { // IE 8 doesn't support DONE - if (this.status === 200) { - success(this.responseText, this.textStatus, this); - } else { - error(this, this.textStatus, ''); - } - - complete(this, this.textStatus); - } - }; - }); - - describe("when making a request", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.send(); - request = mockAjax.requests.mostRecent(); - }); - - it("should store URL and transport", function() { - expect(request.url).toEqual("example.com/someApi"); - }); - - it("should queue the request", function() { - expect(mockAjax.requests.count()).toEqual(1); - }); - - it("should allow access to the queued request", function() { - expect(mockAjax.requests.first()).toEqual(request); - }); - - it("should allow access to the queued request via index", function() { - expect(mockAjax.requests.at(0)).toEqual(request); - }); - - describe("and then another request", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.send(); - - anotherRequest = mockAjax.requests.mostRecent(); - }); - - it("should queue the next request", function() { - expect(mockAjax.requests.count()).toEqual(2); - }); - - it("should allow access to the other queued request", function() { - expect(mockAjax.requests.first()).toEqual(request); - expect(mockAjax.requests.mostRecent()).toEqual(anotherRequest); - }); - }); - - describe("mockAjax.requests.mostRecent()", function () { - - describe("when there is one request queued", function () { - it("should return the request", function() { - expect(mockAjax.requests.mostRecent()).toEqual(request); - }); - }); - - describe("when there is more than one request", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.send(); - anotherRequest = mockAjax.requests.mostRecent(); - }); - - it("should return the most recent request", function() { - expect(mockAjax.requests.mostRecent()).toEqual(anotherRequest); - }); - }); - - describe("when there are no requests", function () { - beforeEach(function() { - mockAjax.requests.reset(); - }); - - it("should return null", function() { - expect(mockAjax.requests.mostRecent()).toBeUndefined(); - }); - }); - }); - - describe("clearAjaxRequests()", function () { - beforeEach(function() { - mockAjax.requests.reset(); - }); - - it("should remove all requests", function() { - expect(mockAjax.requests.count()).toEqual(0); - expect(mockAjax.requests.mostRecent()).toBeUndefined(); - }); - }); - }); - - describe("when simulating a response with request.response", function () { - describe("and the response is Success", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "text/plain"); - client.send(); - - request = mockAjax.requests.mostRecent(); - response = {status: 200, statusText: "OK", contentType: "text/html", responseText: "OK!"}; - request.respondWith(response); - - sharedContext.responseCallback = success; - sharedContext.status = response.status; - sharedContext.statusText = response.statusText; - sharedContext.contentType = response.contentType; - sharedContext.responseText = response.responseText; - sharedContext.responseType = response.responseType; - }); - - it("should call the success handler", function() { - expect(success).toHaveBeenCalled(); - }); - - it("should not call the failure handler", function() { - expect(error).not.toHaveBeenCalled(); - }); - - it("should call the complete handler", function() { - expect(complete).toHaveBeenCalled(); - }); - - sharedAjaxResponseBehaviorForZepto_Success(sharedContext); - }); - - describe("and the response is Success, but with JSON", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "application/json"); - client.send(); - - request = mockAjax.requests.mostRecent(); - var responseObject = {status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}', responseType: "json"}; - - request.respondWith(responseObject); - - sharedContext.responseCallback = success; - sharedContext.status = responseObject.status; - sharedContext.statusText = responseObject.statusText; - sharedContext.contentType = responseObject.contentType; - sharedContext.responseText = responseObject.responseText; - sharedContext.responseType = responseObject.responseType; - - response = success.calls.mostRecent().args[2]; - }); - - it("should call the success handler", function() { - expect(success).toHaveBeenCalled(); - }); - - it("should not call the failure handler", function() { - expect(error).not.toHaveBeenCalled(); - }); - - it("should call the complete handler", function() { - expect(complete).toHaveBeenCalled(); - }); - - it("should return a JavaScript object for XHR2 response", function() { - var responseText = sharedContext.responseText; - expect(success.calls.mostRecent().args[0]).toEqual(responseText); - - expect(response.responseText).toEqual(responseText); - expect(response.response).toEqual({foo: "bar"}); - }); - - sharedAjaxResponseBehaviorForZepto_Success(sharedContext); - }); - - describe("and the response is Success, and response is overriden", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "application/json"); - client.send(); - - request = mockAjax.requests.mostRecent(); - var responseObject = {status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}', responseType: 'json'}; - - request.respondWith(responseObject); - - sharedContext.responseCallback = success; - sharedContext.status = responseObject.status; - sharedContext.statusText = responseObject.statusText; - sharedContext.contentType = responseObject.contentType; - sharedContext.responseText = responseObject.responseText; - sharedContext.responseType = responseObject.responseType; - - response = success.calls.mostRecent().args[2]; - }); - - it("should return the provided override for the XHR2 response", function() { - var responseText = sharedContext.responseText; - - expect(response.responseText).toEqual(responseText); - expect(response.response).toEqual({foo: "bar"}); - }); - - sharedAjaxResponseBehaviorForZepto_Success(sharedContext); - }); - - describe("response with unique header names using an object", function () { - beforeEach(function () { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com"); - client.send(); - - request = mockAjax.requests.mostRecent(); - var responseObject = {status: 200, statusText: "OK", responseText: '["foo"]', responseHeaders: { - 'X-Header1': 'header 1 value', - 'X-Header2': 'header 2 value', - 'X-Header3': 'header 3 value' - }}; - request.respondWith(responseObject); - response = success.calls.mostRecent().args[2]; - }); - - it("getResponseHeader should return the each value", function () { - expect(response.getResponseHeader('X-Header1')).toBe('header 1 value'); - expect(response.getResponseHeader('X-Header2')).toBe('header 2 value'); - expect(response.getResponseHeader('X-Header3')).toBe('header 3 value'); - }); - - it("getAllResponseHeaders should return all values", function () { - expect(response.getAllResponseHeaders()).toBe([ - "X-Header1: header 1 value", - "X-Header2: header 2 value", - "X-Header3: header 3 value" - ].join("\r\n") + "\r\n"); - }); - }); - - describe("response with multiple headers of the same name using an array of objects", function () { - beforeEach(function () { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com"); - client.send(); - - request = mockAjax.requests.mostRecent(); - var responseObject = {status: 200, statusText: "OK", responseText: '["foo"]', responseHeaders: [ - { name: 'X-Header', value: 'header value 1' }, - { name: 'X-Header', value: 'header value 2' } - ]}; - request.respondWith(responseObject); - response = success.calls.mostRecent().args[2]; - }); - - it("getResponseHeader should return all values comma separated", function () { - expect(response.getResponseHeader('X-Header')).toBe('header value 1, header value 2'); - }); - - it("getAllResponseHeaders should return all values", function () { - expect(response.getAllResponseHeaders()).toBe([ - "X-Header: header value 1", - "X-Header: header value 2" - ].join("\r\n") + "\r\n"); - }); - }); - - describe("the content type defaults to application/json", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "application/json"); - client.send(); - - request = mockAjax.requests.mostRecent(); - response = {status: 200, statusText: "OK", responseText: '{"foo": "valid JSON, dammit."}', responseType: 'json'}; - request.respondWith(response); - - sharedContext.responseCallback = success; - sharedContext.status = response.status; - sharedContext.statusText = response.statusText; - sharedContext.contentType = "application/json"; - sharedContext.responseType = response.responseType; - sharedContext.responseText = response.responseText; - }); - - it("should call the success handler", function() { - expect(success).toHaveBeenCalled(); - }); - - it("should not call the failure handler", function() { - expect(error).not.toHaveBeenCalled(); - }); - - it("should call the complete handler", function() { - expect(complete).toHaveBeenCalled(); - }); - - sharedAjaxResponseBehaviorForZepto_Success(sharedContext); - }); - - describe("and the status/response code is 0", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "text/plain"); - client.send(); - - request = mockAjax.requests.mostRecent(); - response = {status: 0, statusText: "ABORT", responseText: '{"foo": "whoops!"}'}; - request.respondWith(response); - - sharedContext.responseCallback = error; - sharedContext.status = 0; - sharedContext.statusText = response.statusText; - sharedContext.contentType = 'application/json'; - sharedContext.responseText = response.responseText; - sharedContext.responseType = response.responseType; - }); - - it("should call the success handler", function() { - expect(success).not.toHaveBeenCalled(); - }); - - it("should not call the failure handler", function() { - expect(error).toHaveBeenCalled(); - }); - - it("should call the complete handler", function() { - expect(complete).toHaveBeenCalled(); - }); - - sharedAjaxResponseBehaviorForZepto_Failure(sharedContext); - }); - }); - - describe("and the response is error", function () { - beforeEach(function() { - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "text/plain"); - client.send(); - - request = mockAjax.requests.mostRecent(); - response = {status: 500, statusText: "SERVER ERROR", contentType: "text/html", responseText: "(._){"}; - request.respondWith(response); - - sharedContext.responseCallback = error; - sharedContext.status = response.status; - sharedContext.statusText = response.statusText; - sharedContext.contentType = response.contentType; - sharedContext.responseText = response.responseText; - sharedContext.responseType = response.responseType; - }); - - it("should not call the success handler", function() { - expect(success).not.toHaveBeenCalled(); - }); - - it("should call the failure handler", function() { - expect(error).toHaveBeenCalled(); - }); - - it("should call the complete handler", function() { - expect(complete).toHaveBeenCalled(); - }); - - sharedAjaxResponseBehaviorForZepto_Failure(sharedContext); - }); - - describe('when simulating a response with request.responseTimeout', function() { - beforeEach(function() { - jasmine.clock().install(); - - client = new fakeGlobal.XMLHttpRequest(); - client.onreadystatechange = onreadystatechange; - client.open("GET", "example.com/someApi"); - client.setRequestHeader("Content-Type", "text/plain"); - client.send(); - - request = mockAjax.requests.mostRecent(); - response = {contentType: "text/html", response: "(._){response", responseText: "(._){", responseType: "text"}; - request.responseTimeout(response); - - sharedContext.responseCallback = error; - sharedContext.status = response.status; - sharedContext.statusText = response.statusText; - sharedContext.contentType = response.contentType; - sharedContext.responseText = response.responseText; - sharedContext.responseType = response.responseType; - }); - - afterEach(function() { - jasmine.clock().uninstall(); - }); - - it("should not call the success handler", function() { - expect(success).not.toHaveBeenCalled(); - }); - - it("should call the failure handler", function() { - expect(error).toHaveBeenCalled(); - }); - - it("should call the complete handler", function() { - expect(complete).toHaveBeenCalled(); - }); - }); + var request, anotherRequest, response; + var success, error, complete; + var client, onreadystatechange; + var sharedContext: any = {}; + var fakeGlobal, mockAjax; + + beforeEach(function() { + var fakeXMLHttpRequest = jasmine.createSpy('realFakeXMLHttpRequest'); + fakeGlobal = { + XMLHttpRequest: fakeXMLHttpRequest, + DOMParser: window['DOMParser'], + ActiveXObject: window['ActiveXObject'] + }; + mockAjax = new MockAjax(fakeGlobal); + mockAjax.install(); + + success = jasmine.createSpy("onSuccess"); + error = jasmine.createSpy("onFailure"); + complete = jasmine.createSpy("onComplete"); + + onreadystatechange = function() { + if (this.readyState === (this.DONE || 4)) { // IE 8 doesn't support DONE + if (this.status === 200) { + success(this.responseText, this.textStatus, this); + } else { + error(this, this.textStatus, ''); + } + + complete(this, this.textStatus); + } + }; + }); + + describe("when making a request", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.send(); + request = mockAjax.requests.mostRecent(); + }); + + it("should store URL and transport", function() { + expect(request.url).toEqual("example.com/someApi"); + }); + + it("should queue the request", function() { + expect(mockAjax.requests.count()).toEqual(1); + }); + + it("should allow access to the queued request", function() { + expect(mockAjax.requests.first()).toEqual(request); + }); + + it("should allow access to the queued request via index", function() { + expect(mockAjax.requests.at(0)).toEqual(request); + }); + + describe("and then another request", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.send(); + + anotherRequest = mockAjax.requests.mostRecent(); + }); + + it("should queue the next request", function() { + expect(mockAjax.requests.count()).toEqual(2); + }); + + it("should allow access to the other queued request", function() { + expect(mockAjax.requests.first()).toEqual(request); + expect(mockAjax.requests.mostRecent()).toEqual(anotherRequest); + }); + }); + + describe("mockAjax.requests.mostRecent()", function() { + + describe("when there is one request queued", function() { + it("should return the request", function() { + expect(mockAjax.requests.mostRecent()).toEqual(request); + }); + }); + + describe("when there is more than one request", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.send(); + anotherRequest = mockAjax.requests.mostRecent(); + }); + + it("should return the most recent request", function() { + expect(mockAjax.requests.mostRecent()).toEqual(anotherRequest); + }); + }); + + describe("when there are no requests", function() { + beforeEach(function() { + mockAjax.requests.reset(); + }); + + it("should return null", function() { + expect(mockAjax.requests.mostRecent()).toBeUndefined(); + }); + }); + }); + + describe("clearAjaxRequests()", function() { + beforeEach(function() { + mockAjax.requests.reset(); + }); + + it("should remove all requests", function() { + expect(mockAjax.requests.count()).toEqual(0); + expect(mockAjax.requests.mostRecent()).toBeUndefined(); + }); + }); + }); + + describe("when simulating a response with request.response", function() { + describe("and the response is Success", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = { status: 200, statusText: "OK", contentType: "text/html", responseText: "OK!" }; + request.respondWith(response); + + sharedContext.responseCallback = success; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = response.contentType; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + it("should call the success handler", function() { + expect(success).toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).not.toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("and the response is Success, but with JSON", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "application/json"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = { status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}', responseType: "json" }; + + request.respondWith(responseObject); + + sharedContext.responseCallback = success; + sharedContext.status = responseObject.status; + sharedContext.statusText = responseObject.statusText; + sharedContext.contentType = responseObject.contentType; + sharedContext.responseText = responseObject.responseText; + sharedContext.responseType = responseObject.responseType; + + response = success.calls.mostRecent().args[2]; + }); + + it("should call the success handler", function() { + expect(success).toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).not.toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + it("should return a JavaScript object for XHR2 response", function() { + var responseText = sharedContext.responseText; + expect(success.calls.mostRecent().args[0]).toEqual(responseText); + + expect(response.responseText).toEqual(responseText); + expect(response.response).toEqual({ foo: "bar" }); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("and the response is Success, and response is overriden", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "application/json"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = { status: 200, statusText: "OK", contentType: "application/json", responseText: '{"foo":"bar"}', responseType: 'json' }; + + request.respondWith(responseObject); + + sharedContext.responseCallback = success; + sharedContext.status = responseObject.status; + sharedContext.statusText = responseObject.statusText; + sharedContext.contentType = responseObject.contentType; + sharedContext.responseText = responseObject.responseText; + sharedContext.responseType = responseObject.responseType; + + response = success.calls.mostRecent().args[2]; + }); + + it("should return the provided override for the XHR2 response", function() { + var responseText = sharedContext.responseText; + + expect(response.responseText).toEqual(responseText); + expect(response.response).toEqual({ foo: "bar" }); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("response with unique header names using an object", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = { + status: 200, statusText: "OK", responseText: '["foo"]', responseHeaders: { + 'X-Header1': 'header 1 value', + 'X-Header2': 'header 2 value', + 'X-Header3': 'header 3 value' + } + }; + request.respondWith(responseObject); + response = success.calls.mostRecent().args[2]; + }); + + it("getResponseHeader should return the each value", function() { + expect(response.getResponseHeader('X-Header1')).toBe('header 1 value'); + expect(response.getResponseHeader('X-Header2')).toBe('header 2 value'); + expect(response.getResponseHeader('X-Header3')).toBe('header 3 value'); + }); + + it("getAllResponseHeaders should return all values", function() { + expect(response.getAllResponseHeaders()).toBe([ + "X-Header1: header 1 value", + "X-Header2: header 2 value", + "X-Header3: header 3 value" + ].join("\r\n") + "\r\n"); + }); + }); + + describe("response with multiple headers of the same name using an array of objects", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com"); + client.send(); + + request = mockAjax.requests.mostRecent(); + var responseObject = { + status: 200, statusText: "OK", responseText: '["foo"]', responseHeaders: [ + { name: 'X-Header', value: 'header value 1' }, + { name: 'X-Header', value: 'header value 2' } + ] + }; + request.respondWith(responseObject); + response = success.calls.mostRecent().args[2]; + }); + + it("getResponseHeader should return all values comma separated", function() { + expect(response.getResponseHeader('X-Header')).toBe('header value 1, header value 2'); + }); + + it("getAllResponseHeaders should return all values", function() { + expect(response.getAllResponseHeaders()).toBe([ + "X-Header: header value 1", + "X-Header: header value 2" + ].join("\r\n") + "\r\n"); + }); + }); + + describe("the content type defaults to application/json", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "application/json"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = { status: 200, statusText: "OK", responseText: '{"foo": "valid JSON, dammit."}', responseType: 'json' }; + request.respondWith(response); + + sharedContext.responseCallback = success; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = "application/json"; + sharedContext.responseType = response.responseType; + sharedContext.responseText = response.responseText; + }); + + it("should call the success handler", function() { + expect(success).toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).not.toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Success(sharedContext); + }); + + describe("and the status/response code is 0", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = { status: 0, statusText: "ABORT", responseText: '{"foo": "whoops!"}' }; + request.respondWith(response); + + sharedContext.responseCallback = error; + sharedContext.status = 0; + sharedContext.statusText = response.statusText; + sharedContext.contentType = 'application/json'; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + it("should call the success handler", function() { + expect(success).not.toHaveBeenCalled(); + }); + + it("should not call the failure handler", function() { + expect(error).toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Failure(sharedContext); + }); + }); + + describe("and the response is error", function() { + beforeEach(function() { + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = { status: 500, statusText: "SERVER ERROR", contentType: "text/html", responseText: "(._){" }; + request.respondWith(response); + + sharedContext.responseCallback = error; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = response.contentType; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + it("should not call the success handler", function() { + expect(success).not.toHaveBeenCalled(); + }); + + it("should call the failure handler", function() { + expect(error).toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + + sharedAjaxResponseBehaviorForZepto_Failure(sharedContext); + }); + + describe('when simulating a response with request.responseTimeout', function() { + beforeEach(function() { + jasmine.clock().install(); + + client = new fakeGlobal.XMLHttpRequest(); + client.onreadystatechange = onreadystatechange; + client.open("GET", "example.com/someApi"); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + + request = mockAjax.requests.mostRecent(); + response = { contentType: "text/html", response: "(._){response", responseText: "(._){", responseType: "text" }; + request.responseTimeout(response); + + sharedContext.responseCallback = error; + sharedContext.status = response.status; + sharedContext.statusText = response.statusText; + sharedContext.contentType = response.contentType; + sharedContext.responseText = response.responseText; + sharedContext.responseType = response.responseType; + }); + + afterEach(function() { + jasmine.clock().uninstall(); + }); + + it("should not call the success handler", function() { + expect(success).not.toHaveBeenCalled(); + }); + + it("should call the failure handler", function() { + expect(error).toHaveBeenCalled(); + }); + + it("should call the complete handler", function() { + expect(complete).toHaveBeenCalled(); + }); + }); }); function sharedAjaxResponseBehaviorForZepto_Success(context) { - describe("the success response", function () { - var xhr; - beforeEach(function() { - xhr = context.responseCallback.calls.mostRecent().args[2]; - }); + describe("the success response", function() { + var xhr; + beforeEach(function() { + xhr = context.responseCallback.calls.mostRecent().args[2]; + }); - it("should have the expected status code", function() { - expect(xhr.status).toEqual(context.status); - }); + it("should have the expected status code", function() { + expect(xhr.status).toEqual(context.status); + }); - it("should have the expected content type", function() { - expect(xhr.getResponseHeader('Content-Type')).toEqual(context.contentType); - }); + it("should have the expected content type", function() { + expect(xhr.getResponseHeader('Content-Type')).toEqual(context.contentType); + }); - it("should have the expected xhr2 response", function() { - var expected = context.response || context.responseType === 'json' ? JSON.parse(context.responseText) : context.responseText; - expect(xhr.response).toEqual(expected); - }); + it("should have the expected xhr2 response", function() { + var expected = context.response || context.responseType === 'json' ? JSON.parse(context.responseText) : context.responseText; + expect(xhr.response).toEqual(expected); + }); - it("should have the expected response text", function() { - expect(xhr.responseText).toEqual(context.responseText); - }); + it("should have the expected response text", function() { + expect(xhr.responseText).toEqual(context.responseText); + }); - it("should have the expected status text", function() { - expect(xhr.statusText).toEqual(context.statusText); - }); - }); + it("should have the expected status text", function() { + expect(xhr.statusText).toEqual(context.statusText); + }); + }); } function sharedAjaxResponseBehaviorForZepto_Failure(context) { - describe("the failure response", function () { - var xhr; - beforeEach(function() { - xhr = context.responseCallback.calls.mostRecent().args[0]; - }); + describe("the failure response", function() { + var xhr; + beforeEach(function() { + xhr = context.responseCallback.calls.mostRecent().args[0]; + }); - it("should have the expected status code", function() { - expect(xhr.status).toEqual(context.status); - }); + it("should have the expected status code", function() { + expect(xhr.status).toEqual(context.status); + }); - it("should have the expected content type", function() { - expect(xhr.getResponseHeader('Content-Type')).toEqual(context.contentType); - }); + it("should have the expected content type", function() { + expect(xhr.getResponseHeader('Content-Type')).toEqual(context.contentType); + }); - it("should have the expected xhr2 response", function() { - var expected = context.response || xhr.responseType === 'json' ? JSON.parse(xhr.responseText) : xhr.responseText; - expect(xhr.response).toEqual(expected); - }); + it("should have the expected xhr2 response", function() { + var expected = context.response || xhr.responseType === 'json' ? JSON.parse(xhr.responseText) : xhr.responseText; + expect(xhr.response).toEqual(expected); + }); - it("should have the expected response text", function() { - expect(xhr.responseText).toEqual(context.responseText); - }); + it("should have the expected response text", function() { + expect(xhr.responseText).toEqual(context.responseText); + }); - it("should have the expected status text", function() { - expect(xhr.statusText).toEqual(context.statusText); - }); - }); + it("should have the expected status text", function() { + expect(xhr.statusText).toEqual(context.statusText); + }); + }); } describe('ParamParser', function() { - beforeEach(function() { - var Constructor = getJasmineRequireObj().AjaxParamParser(); - expect(Constructor).toEqual(jasmine.any(Function)); - this.parser = new Constructor(); - }); + beforeEach(function() { + var Constructor = getJasmineRequireObj().AjaxParamParser(); + expect(Constructor).toEqual(jasmine.any(Function)); + this.parser = new Constructor(); + }); - it('has a default parser', function() { - var parser = this.parser.findParser({ contentType: function() {} }), - parsed = parser.parse('3+stooges=shemp&3+stooges=larry%20%26%20moe%20%26%20curly&some%3Dthing=else+entirely'); + it('has a default parser', function() { + var parser = this.parser.findParser({ contentType: function() { } }), + parsed = parser.parse('3+stooges=shemp&3+stooges=larry%20%26%20moe%20%26%20curly&some%3Dthing=else+entirely'); - expect(parsed).toEqual({ - '3 stooges': ['shemp', 'larry & moe & curly'], - 'some=thing': ['else entirely'] - }); - }); + expect(parsed).toEqual({ + '3 stooges': ['shemp', 'larry & moe & curly'], + 'some=thing': ['else entirely'] + }); + }); - it('should detect and parse json', function() { - var data = { - foo: 'bar', - baz: ['q', 'u', 'u', 'x'], - nested: { - object: { - containing: 'stuff' - } - } + it('should detect and parse json', function() { + var data = { + foo: 'bar', + baz: ['q', 'u', 'u', 'x'], + nested: { + object: { + containing: 'stuff' + } + } }, - parser = this.parser.findParser({ contentType: function() { return 'application/json'; } }), - parsed = parser.parse(JSON.stringify(data)); + parser = this.parser.findParser({ contentType: function() { return 'application/json'; } }), + parsed = parser.parse(JSON.stringify(data)); - expect(parsed).toEqual(data); - }); + expect(parsed).toEqual(data); + }); - it('should parse json with further qualifiers on content-type', function() { - var data = { - foo: 'bar', - baz: ['q', 'u', 'u', 'x'], - nested: { - object: { - containing: 'stuff' - } - } + it('should parse json with further qualifiers on content-type', function() { + var data = { + foo: 'bar', + baz: ['q', 'u', 'u', 'x'], + nested: { + object: { + containing: 'stuff' + } + } }, - parser = this.parser.findParser({ contentType: function() { return 'application/json; charset=utf-8'; } }), - parsed = parser.parse(JSON.stringify(data)); + parser = this.parser.findParser({ contentType: function() { return 'application/json; charset=utf-8'; } }), + parsed = parser.parse(JSON.stringify(data)); - expect(parsed).toEqual(data); - }); + expect(parsed).toEqual(data); + }); - it('should have custom parsers take precedence', function() { - var custom = { - test: jasmine.createSpy('test').and.returnValue(true), - parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') - }; + it('should have custom parsers take precedence', function() { + var custom = { + test: jasmine.createSpy('test').and.returnValue(true), + parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') + }; - this.parser.add(custom); + this.parser.add(custom); - var parser = this.parser.findParser({ contentType: function() {} }), - parsed = parser.parse('custom_format'); + var parser = this.parser.findParser({ contentType: function() { } }), + parsed = parser.parse('custom_format'); - expect(parsed).toEqual('parsedFormat'); - expect(custom.test).toHaveBeenCalled(); - expect(custom.parse).toHaveBeenCalledWith('custom_format'); - }); + expect(parsed).toEqual('parsedFormat'); + expect(custom.test).toHaveBeenCalled(); + expect(custom.parse).toHaveBeenCalledWith('custom_format'); + }); - it('should skip custom parsers that do not match', function() { - var custom = { - test: jasmine.createSpy('test').and.returnValue(false), - parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') - }; + it('should skip custom parsers that do not match', function() { + var custom = { + test: jasmine.createSpy('test').and.returnValue(false), + parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') + }; - this.parser.add(custom); + this.parser.add(custom); - var parser = this.parser.findParser({ contentType: function() {} }), - parsed = parser.parse('custom_format'); + var parser = this.parser.findParser({ contentType: function() { } }), + parsed = parser.parse('custom_format'); - expect(parsed).toEqual({ custom_format: [ 'undefined' ] }); - expect(custom.test).toHaveBeenCalled(); - expect(custom.parse).not.toHaveBeenCalled(); - }); + expect(parsed).toEqual({ custom_format: ['undefined'] }); + expect(custom.test).toHaveBeenCalled(); + expect(custom.parse).not.toHaveBeenCalled(); + }); - it('removes custom parsers when reset', function() { - var custom = { - test: jasmine.createSpy('test').and.returnValue(true), - parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') - }; + it('removes custom parsers when reset', function() { + var custom = { + test: jasmine.createSpy('test').and.returnValue(true), + parse: jasmine.createSpy('parse').and.returnValue('parsedFormat') + }; - this.parser.add(custom); + this.parser.add(custom); - var parser = this.parser.findParser({ contentType: function() {} }), - parsed = parser.parse('custom_format'); + var parser = this.parser.findParser({ contentType: function() { } }), + parsed = parser.parse('custom_format'); - expect(parsed).toEqual('parsedFormat'); + expect(parsed).toEqual('parsedFormat'); - custom.test['calls'].reset(); - custom.parse['calls'].reset(); + custom.test['calls'].reset(); + custom.parse['calls'].reset(); - this.parser.reset(); + this.parser.reset(); - parser = this.parser.findParser({ contentType: function() {} }); - parsed = parser.parse('custom_format'); + parser = this.parser.findParser({ contentType: function() { } }); + parsed = parser.parse('custom_format'); - expect(parsed).toEqual({ custom_format: [ 'undefined' ] }); - expect(custom.test).not.toHaveBeenCalled(); - expect(custom.parse).not.toHaveBeenCalled(); - }); + expect(parsed).toEqual({ custom_format: ['undefined'] }); + expect(custom.test).not.toHaveBeenCalled(); + expect(custom.parse).not.toHaveBeenCalled(); + }); }); describe('RequestStub', function() { - beforeEach(function() { - this.RequestStub = getJasmineRequireObj().AjaxRequestStub(); + beforeEach(function() { + this.RequestStub = getJasmineRequireObj().AjaxRequestStub(); - jasmine.addMatchers({ - toMatchRequest: function() { - return { - compare: function(actual) { - return { - pass: actual.matches.apply(actual, Array.prototype.slice.call(arguments, 1)) - }; - } - }; - } - }); - }); + jasmine.addMatchers({ + toMatchRequest: function(a, b) { + return { + compare: function(actual): jasmine.CustomMatcherResult { + return { + message: '', + pass: actual.matches.apply(actual, Array.prototype.slice.call(arguments, 1)) + }; + } + }; + } + }); + }); - it('matches just by exact url', function() { - var stub = new this.RequestStub('www.example.com/foo'); + it('matches just by exact url', function() { + var stub = new this.RequestStub('www.example.com/foo'); - expect(stub)['toMatchRequest']('www.example.com/foo'); - }); + expect(stub)['toMatchRequest']('www.example.com/foo'); + }); - it('does not match if the url differs', function() { - var stub = new this.RequestStub('www.example.com/foo'); + it('does not match if the url differs', function() { + var stub = new this.RequestStub('www.example.com/foo'); - expect(stub).not['toMatchRequest']('www.example.com/bar'); - }); + expect(stub).not['toMatchRequest']('www.example.com/bar'); + }); - it('matches unordered query params', function() { - var stub = new this.RequestStub('www.example.com?foo=bar&baz=quux'); + it('matches unordered query params', function() { + var stub = new this.RequestStub('www.example.com?foo=bar&baz=quux'); - expect(stub)['toMatchRequest']('www.example.com?baz=quux&foo=bar'); - }); + expect(stub)['toMatchRequest']('www.example.com?baz=quux&foo=bar'); + }); - it('requires all specified query params to be there', function() { - var stub = new this.RequestStub('www.example.com?foo=bar&baz=quux'); + it('requires all specified query params to be there', function() { + var stub = new this.RequestStub('www.example.com?foo=bar&baz=quux'); - expect(stub).not['toMatchRequest']('www.example.com?foo=bar'); - }); + expect(stub).not['toMatchRequest']('www.example.com?foo=bar'); + }); - it('can match the url with a RegExp', function() { - var stub = new this.RequestStub(/ba[rz]/); + it('can match the url with a RegExp', function() { + var stub = new this.RequestStub(/ba[rz]/); - expect(stub)['toMatchRequest']('bar'); - expect(stub)['toMatchRequest']('baz'); - expect(stub).not['toMatchRequest']('foo'); - }); + expect(stub)['toMatchRequest']('bar'); + expect(stub)['toMatchRequest']('baz'); + expect(stub).not['toMatchRequest']('foo'); + }); - it('requires the method to match if supplied', function() { - var stub = new this.RequestStub('www.example.com/foo', null, 'POST'); + it('requires the method to match if supplied', function() { + var stub = new this.RequestStub('www.example.com/foo', null, 'POST'); - expect(stub).not['toMatchRequest']('www.example.com/foo'); - expect(stub).not['toMatchRequest']('www.example.com/foo', null, 'GET'); - expect(stub)['toMatchRequest']('www.example.com/foo', null, 'POST'); - }); + expect(stub).not['toMatchRequest']('www.example.com/foo'); + expect(stub).not['toMatchRequest']('www.example.com/foo', null, 'GET'); + expect(stub)['toMatchRequest']('www.example.com/foo', null, 'POST'); + }); - it('requires the data submitted to match if supplied', function() { - var stub = new this.RequestStub('/foo', 'foo=bar&baz=quux'); + it('requires the data submitted to match if supplied', function() { + var stub = new this.RequestStub('/foo', 'foo=bar&baz=quux'); - expect(stub)['toMatchRequest']('/foo', 'baz=quux&foo=bar'); - expect(stub).not['toMatchRequest']('/foo', 'foo=bar'); - }); + expect(stub)['toMatchRequest']('/foo', 'baz=quux&foo=bar'); + expect(stub).not['toMatchRequest']('/foo', 'foo=bar'); + }); }); describe('RequestTracker', function() { - beforeEach(function() { - var Constructor = getJasmineRequireObj().AjaxRequestTracker(); - this.tracker = new Constructor(); - }); + beforeEach(function() { + var Constructor = getJasmineRequireObj().AjaxRequestTracker(); + this.tracker = new Constructor(); + }); - it('tracks the number of times ajax requests are made', function() { - expect(this.tracker.count()).toBe(0); + it('tracks the number of times ajax requests are made', function() { + expect(this.tracker.count()).toBe(0); - this.tracker.track(); + this.tracker.track(); - expect(this.tracker.count()).toBe(1); - }); + expect(this.tracker.count()).toBe(1); + }); - it('simplifies access to the last (most recent) request', function() { - this.tracker.track(); - this.tracker.track('request'); + it('simplifies access to the last (most recent) request', function() { + this.tracker.track(); + this.tracker.track('request'); - expect(this.tracker.mostRecent()).toEqual('request'); - }); + expect(this.tracker.mostRecent()).toEqual('request'); + }); - it('returns a useful falsy value when there is no last (most recent) request', function() { - expect(this.tracker.mostRecent()).toBeFalsy(); - }); + it('returns a useful falsy value when there is no last (most recent) request', function() { + expect(this.tracker.mostRecent()).toBeFalsy(); + }); - it('simplifies access to the first (oldest) request', function() { - this.tracker.track('request'); - this.tracker.track(); + it('simplifies access to the first (oldest) request', function() { + this.tracker.track('request'); + this.tracker.track(); - expect(this.tracker.first()).toEqual('request'); - }); + expect(this.tracker.first()).toEqual('request'); + }); - it('returns a useful falsy value when there is no first (oldest) request', function() { - expect(this.tracker.first()).toBeFalsy(); - }); + it('returns a useful falsy value when there is no first (oldest) request', function() { + expect(this.tracker.first()).toBeFalsy(); + }); - it('allows the requests list to be reset', function() { - this.tracker.track(); - this.tracker.track(); + it('allows the requests list to be reset', function() { + this.tracker.track(); + this.tracker.track(); - expect(this.tracker.count()).toBe(2); + expect(this.tracker.count()).toBe(2); - this.tracker.reset(); + this.tracker.reset(); - expect(this.tracker.count()).toBe(0); - }); + expect(this.tracker.count()).toBe(0); + }); - it('allows retrieval of an arbitrary request by index', function() { - this.tracker.track('1'); - this.tracker.track('2'); - this.tracker.track('3'); + it('allows retrieval of an arbitrary request by index', function() { + this.tracker.track('1'); + this.tracker.track('2'); + this.tracker.track('3'); - expect(this.tracker.at(1)).toEqual('2'); - }); + expect(this.tracker.at(1)).toEqual('2'); + }); - it('allows retrieval of all requests that are for a given url', function() { - this.tracker.track({ url: 'foo' }); - this.tracker.track({ url: 'bar' }); + it('allows retrieval of all requests that are for a given url', function() { + this.tracker.track({ url: 'foo' }); + this.tracker.track({ url: 'bar' }); - expect(this.tracker.filter('bar')).toEqual([{ url: 'bar' }]); - }); + expect(this.tracker.filter('bar')).toEqual([{ url: 'bar' }]); + }); - it('allows retrieval of all requests that match a given RegExp', function() { - this.tracker.track({ url: 'foo' }); - this.tracker.track({ url: 'bar' }); - this.tracker.track({ url: 'baz' }); + it('allows retrieval of all requests that match a given RegExp', function() { + this.tracker.track({ url: 'foo' }); + this.tracker.track({ url: 'bar' }); + this.tracker.track({ url: 'baz' }); - expect(this.tracker.filter(/ba[rz]/)).toEqual([{ url: 'bar' }, { url: 'baz' }]); - }); + expect(this.tracker.filter(/ba[rz]/)).toEqual([{ url: 'bar' }, { url: 'baz' }]); + }); - it('allows retrieval of all requests that match based on a function', function() { - this.tracker.track({ url: 'foo' }); - this.tracker.track({ url: 'bar' }); - this.tracker.track({ url: 'baz' }); + it('allows retrieval of all requests that match based on a function', function() { + this.tracker.track({ url: 'foo' }); + this.tracker.track({ url: 'bar' }); + this.tracker.track({ url: 'baz' }); - var func = function(request) { - return request.url === 'bar'; - }; + var func = function(request) { + return request.url === 'bar'; + }; - expect(this.tracker.filter(func)).toEqual([{ url: 'bar' }]); - }); + expect(this.tracker.filter(func)).toEqual([{ url: 'bar' }]); + }); - it('filters to nothing if no requests have been tracked', function() { - expect(this.tracker.filter('foo')).toEqual([]); - }); + it('filters to nothing if no requests have been tracked', function() { + expect(this.tracker.filter('foo')).toEqual([]); + }); }); describe('EventBus', function() { - beforeEach(function() { - this.bus = getJasmineRequireObj().AjaxEventBus()(); - }); + beforeEach(function() { + this.bus = getJasmineRequireObj().AjaxEventBus()(); + }); - it('calls an event listener', function() { - var callback = jasmine.createSpy('callback'); + it('calls an event listener', function() { + var callback = jasmine.createSpy('callback'); - this.bus.addEventListener('foo', callback); - this.bus.trigger('foo'); + this.bus.addEventListener('foo', callback); + this.bus.trigger('foo'); - expect(callback).toHaveBeenCalled(); - }); + expect(callback).toHaveBeenCalled(); + }); - it('calls an event listener with additional arguments', function() { - var callback = jasmine.createSpy('callback'); + it('calls an event listener with additional arguments', function() { + var callback = jasmine.createSpy('callback'); - this.bus.addEventListener('foo', callback); - this.bus.trigger('foo', 'bar'); + this.bus.addEventListener('foo', callback); + this.bus.trigger('foo', 'bar'); - expect(callback).toHaveBeenCalledWith('bar'); - }); + expect(callback).toHaveBeenCalledWith('bar'); + }); - it('only triggers callbacks for the specified event', function() { - var fooCallback = jasmine.createSpy('foo'), - barCallback = jasmine.createSpy('bar'); + it('only triggers callbacks for the specified event', function() { + var fooCallback = jasmine.createSpy('foo'), + barCallback = jasmine.createSpy('bar'); - this.bus.addEventListener('foo', fooCallback); - this.bus.addEventListener('bar', barCallback); + this.bus.addEventListener('foo', fooCallback); + this.bus.addEventListener('bar', barCallback); - this.bus.trigger('foo'); + this.bus.trigger('foo'); - expect(fooCallback).toHaveBeenCalled(); - expect(barCallback).not.toHaveBeenCalled(); - }); + expect(fooCallback).toHaveBeenCalled(); + expect(barCallback).not.toHaveBeenCalled(); + }); - it('calls all the callbacks for the specified event', function() { - var callback1 = jasmine.createSpy('callback'); - var callback2 = jasmine.createSpy('otherCallback'); + it('calls all the callbacks for the specified event', function() { + var callback1 = jasmine.createSpy('callback'); + var callback2 = jasmine.createSpy('otherCallback'); - this.bus.addEventListener('foo', callback1); - this.bus.addEventListener('foo', callback2); + this.bus.addEventListener('foo', callback1); + this.bus.addEventListener('foo', callback2); - this.bus.trigger('foo'); + this.bus.trigger('foo'); - expect(callback1).toHaveBeenCalled(); - expect(callback2).toHaveBeenCalled(); - }); + expect(callback1).toHaveBeenCalled(); + expect(callback2).toHaveBeenCalled(); + }); - it('works if there are no callbacks for the event', function() { - var bus = this.bus; - expect(function() { - bus.trigger('notActuallyThere'); - }).not.toThrow(); - }); + it('works if there are no callbacks for the event', function() { + var bus = this.bus; + expect(function() { + bus.trigger('notActuallyThere'); + }).not.toThrow(); + }); - it('does not call listeners that have been removed', function() { - var callback = jasmine.createSpy('callback'); + it('does not call listeners that have been removed', function() { + var callback = jasmine.createSpy('callback'); - this.bus.addEventListener('foo', callback); - this.bus.removeEventListener('foo', callback); - this.bus.trigger('foo'); + this.bus.addEventListener('foo', callback); + this.bus.removeEventListener('foo', callback); + this.bus.trigger('foo'); - expect(callback).not.toHaveBeenCalled(); - }); + expect(callback).not.toHaveBeenCalled(); + }); - it('only removes the specified callback', function() { - var callback1 = jasmine.createSpy('callback'); - var callback2 = jasmine.createSpy('otherCallback'); + it('only removes the specified callback', function() { + var callback1 = jasmine.createSpy('callback'); + var callback2 = jasmine.createSpy('otherCallback'); - this.bus.addEventListener('foo', callback1); - this.bus.addEventListener('foo', callback2); - this.bus.removeEventListener('foo', callback2); + this.bus.addEventListener('foo', callback1); + this.bus.addEventListener('foo', callback2); + this.bus.removeEventListener('foo', callback2); - this.bus.trigger('foo'); + this.bus.trigger('foo'); - expect(callback1).toHaveBeenCalled(); - expect(callback2).not.toHaveBeenCalled(); - }); + expect(callback1).toHaveBeenCalled(); + expect(callback2).not.toHaveBeenCalled(); + }); }); describe("Webmock style mocking", function() { - var successSpy, errorSpy, response, fakeGlobal, mockAjax; + var successSpy, errorSpy, response, fakeGlobal, mockAjax; - var sendRequest = function(fakeGlobal, url?, method?) { - url = url || "http://example.com/someApi"; - method = method || 'GET'; - var xhr = new fakeGlobal.XMLHttpRequest(); - xhr.onreadystatechange = function(args) { - if (this.readyState === (this.DONE || 4)) { // IE 8 doesn't support DONE - response = this; - successSpy(); - } - }; + var sendRequest = function(fakeGlobal, url?, method?) { + url = url || "http://example.com/someApi"; + method = method || 'GET'; + var xhr = new fakeGlobal.XMLHttpRequest(); + xhr.onreadystatechange = function(args) { + if (this.readyState === (this.DONE || 4)) { // IE 8 doesn't support DONE + response = this; + successSpy(); + } + }; - xhr.open(method, url); - xhr.send(); - }; + xhr.open(method, url); + xhr.send(); + }; - beforeEach(function() { - successSpy = jasmine.createSpy('success'); - fakeGlobal = {XMLHttpRequest: jasmine.createSpy('realXMLHttpRequest')}; - mockAjax = new MockAjax(fakeGlobal); - mockAjax.install(); + beforeEach(function() { + successSpy = jasmine.createSpy('success'); + fakeGlobal = { XMLHttpRequest: jasmine.createSpy('realXMLHttpRequest') }; + mockAjax = new MockAjax(fakeGlobal); + mockAjax.install(); - mockAjax.stubRequest("http://example.com/someApi").andReturn({responseText: "hi!"}); - }); + mockAjax.stubRequest("http://example.com/someApi").andReturn({ responseText: "hi!" }); + }); - it("allows a url to be setup as a stub", function() { - sendRequest(fakeGlobal); - expect(successSpy).toHaveBeenCalled(); - }); + it("allows a url to be setup as a stub", function() { + sendRequest(fakeGlobal); + expect(successSpy).toHaveBeenCalled(); + }); - it("should allow you to clear all the ajax stubs", function() { - mockAjax.stubs.reset(); - sendRequest(fakeGlobal); - expect(successSpy).not.toHaveBeenCalled(); - }); + it("should allow you to clear all the ajax stubs", function() { + mockAjax.stubs.reset(); + sendRequest(fakeGlobal); + expect(successSpy).not.toHaveBeenCalled(); + }); - it("should set the contentType", function() { - sendRequest(fakeGlobal); - expect(response.getResponseHeader('Content-Type')).toEqual('application/json'); - }); + it("should set the contentType", function() { + sendRequest(fakeGlobal); + expect(response.getResponseHeader('Content-Type')).toEqual('application/json'); + }); - it("should set the responseText", function() { - sendRequest(fakeGlobal); - expect(response.responseText).toEqual('hi!'); - }); + it("should set the responseText", function() { + sendRequest(fakeGlobal); + expect(response.responseText).toEqual('hi!'); + }); - it("should default the status to 200", function() { - sendRequest(fakeGlobal); - expect(response.status).toEqual(200); - }); + it("should default the status to 200", function() { + sendRequest(fakeGlobal); + expect(response.status).toEqual(200); + }); - it("should set the responseHeaders", function() { - mockAjax.stubRequest("http://example.com/someApi").andReturn({ - responseText: "hi!", - responseHeaders: [{name: "X-Custom", value: "header value"}] - }); - sendRequest(fakeGlobal); - expect(response.getResponseHeader('X-Custom')).toEqual('header value'); - }); + it("should set the responseHeaders", function() { + mockAjax.stubRequest("http://example.com/someApi").andReturn({ + responseText: "hi!", + responseHeaders: [{ name: "X-Custom", value: "header value" }] + }); + sendRequest(fakeGlobal); + expect(response.getResponseHeader('X-Custom')).toEqual('header value'); + }); - describe("with another stub for the same url", function() { - beforeEach(function() { - mockAjax.stubRequest("http://example.com/someApi").andReturn({responseText: "no", status: 403}); - sendRequest(fakeGlobal); - }); + describe("with another stub for the same url", function() { + beforeEach(function() { + mockAjax.stubRequest("http://example.com/someApi").andReturn({ responseText: "no", status: 403 }); + sendRequest(fakeGlobal); + }); - it("should set the status", function() { - expect(response.status).toEqual(403); - }); + it("should set the status", function() { + expect(response.status).toEqual(403); + }); - it("should allow the latest stub to win", function() { - expect(response.responseText).toEqual('no'); - }); - }); + it("should allow the latest stub to win", function() { + expect(response.responseText).toEqual('no'); + }); + }); }); describe("withMock", function() { - var sendRequest = function(fakeGlobal) { - var xhr = new fakeGlobal.XMLHttpRequest(); + var sendRequest = function(fakeGlobal) { + var xhr = new fakeGlobal.XMLHttpRequest(); - xhr.open("GET", "http://example.com/someApi"); - xhr.send(); - }; + xhr.open("GET", "http://example.com/someApi"); + xhr.send(); + }; - it("installs the mock for passed in function, and uninstalls when complete", function() { - var xmlHttpRequest = jasmine.createSpyObj('XMLHttpRequest', ['open', 'send']), - xmlHttpRequestCtor = spyOn(window, 'XMLHttpRequest').and.returnValue(xmlHttpRequest), - fakeGlobal = {XMLHttpRequest: xmlHttpRequestCtor}, - mockAjax = new MockAjax(fakeGlobal); + it("installs the mock for passed in function, and uninstalls when complete", function() { + var xmlHttpRequest = jasmine.createSpyObj('XMLHttpRequest', ['open', 'send']), + xmlHttpRequestCtor = spyOn(window, 'XMLHttpRequest').and.returnValue(xmlHttpRequest), + fakeGlobal = { XMLHttpRequest: xmlHttpRequestCtor }, + mockAjax = new MockAjax(fakeGlobal); - mockAjax.withMock(function() { - sendRequest(fakeGlobal); - expect(xmlHttpRequest.open).not.toHaveBeenCalled(); - }); + mockAjax.withMock(function() { + sendRequest(fakeGlobal); + expect(xmlHttpRequest.open).not.toHaveBeenCalled(); + }); - sendRequest(fakeGlobal); - expect(xmlHttpRequest.open).toHaveBeenCalled(); - }); + sendRequest(fakeGlobal); + expect(xmlHttpRequest.open).toHaveBeenCalled(); + }); - it("properly uninstalls when the passed in function throws", function() { - var xmlHttpRequest = jasmine.createSpyObj('XMLHttpRequest', ['open', 'send']), - xmlHttpRequestCtor = spyOn(window, 'XMLHttpRequest').and.returnValue(xmlHttpRequest), - fakeGlobal = {XMLHttpRequest: xmlHttpRequestCtor}, - mockAjax = new MockAjax(fakeGlobal); + it("properly uninstalls when the passed in function throws", function() { + var xmlHttpRequest = jasmine.createSpyObj('XMLHttpRequest', ['open', 'send']), + xmlHttpRequestCtor = spyOn(window, 'XMLHttpRequest').and.returnValue(xmlHttpRequest), + fakeGlobal = { XMLHttpRequest: xmlHttpRequestCtor }, + mockAjax = new MockAjax(fakeGlobal); - expect(function() { - mockAjax.withMock(function() { - throw "error"; - }); - }).toThrow("error"); + expect(function() { + mockAjax.withMock(function() { + throw "error"; + }); + }).toThrow("error"); - sendRequest(fakeGlobal); - expect(xmlHttpRequest.open).toHaveBeenCalled(); - }); + sendRequest(fakeGlobal); + expect(xmlHttpRequest.open).toHaveBeenCalled(); + }); }); describe("mockAjax", function() { - it("throws an error if installed multiple times", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("throws an error if installed multiple times", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - function doubleInstall() { - mockAjax.install(); - mockAjax.install(); - } + function doubleInstall() { + mockAjax.install(); + mockAjax.install(); + } - expect(doubleInstall).toThrow(); - }); + expect(doubleInstall).toThrow(); + }); - it("does not throw an error if uninstalled between installs", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("does not throw an error if uninstalled between installs", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - function sequentialInstalls() { - mockAjax.install(); - mockAjax.uninstall(); - mockAjax.install(); - } + function sequentialInstalls() { + mockAjax.install(); + mockAjax.uninstall(); + mockAjax.install(); + } - expect(sequentialInstalls).not.toThrow(); - }); + expect(sequentialInstalls).not.toThrow(); + }); - it("does not replace XMLHttpRequest until it is installed", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("does not replace XMLHttpRequest until it is installed", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - fakeGlobal.XMLHttpRequest('foo'); - expect(fakeXmlHttpRequest).toHaveBeenCalledWith('foo'); - fakeXmlHttpRequest.calls.reset(); + fakeGlobal.XMLHttpRequest('foo'); + expect(fakeXmlHttpRequest).toHaveBeenCalledWith('foo'); + fakeXmlHttpRequest.calls.reset(); - mockAjax.install(); - fakeGlobal.XMLHttpRequest('foo'); - expect(fakeXmlHttpRequest).not.toHaveBeenCalled(); - }); + mockAjax.install(); + fakeGlobal.XMLHttpRequest('foo'); + expect(fakeXmlHttpRequest).not.toHaveBeenCalled(); + }); - it("replaces the global XMLHttpRequest on uninstall", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("replaces the global XMLHttpRequest on uninstall", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - mockAjax.install(); - mockAjax.uninstall(); + mockAjax.install(); + mockAjax.uninstall(); - fakeGlobal.XMLHttpRequest('foo'); - expect(fakeXmlHttpRequest).toHaveBeenCalledWith('foo'); - }); + fakeGlobal.XMLHttpRequest('foo'); + expect(fakeXmlHttpRequest).toHaveBeenCalledWith('foo'); + }); - it("clears requests and stubs upon uninstall", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("clears requests and stubs upon uninstall", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - mockAjax.install(); + mockAjax.install(); - mockAjax.requests.track({url: '/testurl'}); - mockAjax.stubRequest('/bobcat'); + mockAjax.requests.track({ url: '/testurl' }); + mockAjax.stubRequest('/bobcat'); - expect(mockAjax.requests.count()).toEqual(1); - expect(mockAjax.stubs.findStub('/bobcat')).toBeDefined(); + expect(mockAjax.requests.count()).toEqual(1); + expect(mockAjax.stubs.findStub('/bobcat')).toBeDefined(); - mockAjax.uninstall(); + mockAjax.uninstall(); - expect(mockAjax.requests.count()).toEqual(0); - expect(mockAjax.stubs.findStub('/bobcat')).not.toBeDefined(); - }); + expect(mockAjax.requests.count()).toEqual(0); + expect(mockAjax.stubs.findStub('/bobcat')).not.toBeDefined(); + }); - it("allows the httpRequest to be retrieved", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("allows the httpRequest to be retrieved", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - mockAjax.install(); - var request = new (fakeGlobal.XMLHttpRequest)(); + mockAjax.install(); + var request = new (fakeGlobal.XMLHttpRequest)(); - expect(mockAjax.requests.count()).toBe(1); - expect(mockAjax.requests.mostRecent()).toBe(request); - }); + expect(mockAjax.requests.count()).toBe(1); + expect(mockAjax.requests.mostRecent()).toBe(request); + }); - it("allows the httpRequests to be cleared", function() { - var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), - fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, - mockAjax = new MockAjax(fakeGlobal); + it("allows the httpRequests to be cleared", function() { + var fakeXmlHttpRequest = jasmine.createSpy('fakeXmlHttpRequest'), + fakeGlobal = { XMLHttpRequest: fakeXmlHttpRequest }, + mockAjax = new MockAjax(fakeGlobal); - mockAjax.install(); - var request = new (fakeGlobal.XMLHttpRequest)(); + mockAjax.install(); + var request = new (fakeGlobal.XMLHttpRequest)(); - expect(mockAjax.requests.mostRecent()).toBe(request); - mockAjax.requests.reset(); - expect(mockAjax.requests.count()).toBe(0); - }); + expect(mockAjax.requests.mostRecent()).toBe(request); + mockAjax.requests.reset(); + expect(mockAjax.requests.count()).toBe(0); + }); }); diff --git a/jasmine-ajax/jasmine-ajax.d.ts b/jasmine-ajax/jasmine-ajax.d.ts index 70ca2f57c1..657ec33747 100644 --- a/jasmine-ajax/jasmine-ajax.d.ts +++ b/jasmine-ajax/jasmine-ajax.d.ts @@ -4,17 +4,22 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped interface JasmineAjaxResponse { - status?: string; + status?: number; statusText?: string; responseText?: string; response?: string; - responseType?: string; contentType?: string; responseHeaders?: { [key: string]: string }; } -interface JasmineAjaxRequest { +interface JasmineAjaxRequest extends XMLHttpRequest { url: string; + method: string; + username: string; + password: string; + requestHeaders: { [key: string]: string }; + overriddenMimeType: string; + respondWith(response: JasmineAjaxResponse): void; } From 403894c47328ead23d90b576d564558fda447dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Ostroz=CC=8Cli=CC=81k?= Date: Wed, 20 May 2015 21:54:16 +0200 Subject: [PATCH 0040/2220] React-router 0.13 support --- react-router/react-router-test.ts | 86 ++--- react-router/react-router.d.ts | 559 +++++++++++++++--------------- 2 files changed, 324 insertions(+), 321 deletions(-) diff --git a/react-router/react-router-test.ts b/react-router/react-router-test.ts index 41b352af36..fa335e9346 100644 --- a/react-router/react-router-test.ts +++ b/react-router/react-router-test.ts @@ -7,7 +7,7 @@ import Router = require('react-router'); // Mixin class NavigationTest { v: T; - + makePath() { var v1: string = this.v.makePath('to'); var v2: string = this.v.makePath('to', {id: 1}); @@ -35,27 +35,27 @@ class NavigationTest { class StateTest { v: T; - + getPath() { var v1: string = this.v.getPath(); } - + getRoutes() { var v1: Router.Route[] = this.v.getRoutes(); } - + getPathname() { var v1: string = this.v.getPathname(); } - + getParams() { var v1: {} = this.v.getParams(); } - + getQuery() { var v1: {} = this.v.getQuery(); } - + isActive() { var v1: boolean = this.v.isActive('to'); var v2: boolean = this.v.isActive('to', {id: 1}); @@ -63,35 +63,23 @@ class StateTest { } } -class RouteHandlerMixinTest { - v: T; - - getRouteDepth() { - var v1: number = this.v.getRouteDepth(); - } - - createChildRouteHandler() { - var v1: Router.RouteHandler = this.v.createChildRouteHandler({ref: 'hoge'}); - } -} - // Location -class LocationTest { +class LocationTest { v: T; - + push() { var v1: void = this.v.push('path/to/hoge'); } - + replace() { var v1: void = this.v.replace('path/to/hoge'); } - + pop() { var v1: void = this.v.pop(); } - + getCurrentPath() { var v1: void = this.v.getCurrentPath(); } @@ -102,11 +90,11 @@ new LocationTest(); class LocationListenerTest { v: T; - + addChangeListener() { var v1: void = this.v.addChangeListener(() => console.log(1)); } - + removeChangeListener() { var v1: void = this.v.removeChangeListener(() => console.log(1)); } @@ -118,7 +106,7 @@ new LocationListenerTest(); // Behavior class ScrollBehaviorTest { v: T; - + updateScrollPosition() { var v1: void = this.v.updateScrollPosition({x: 33, y: 102}, 'scrollTop'); } @@ -130,12 +118,12 @@ new ScrollBehaviorTest(); // Component class DefaultRouteTest { v: Router.DefaultRoute; - + props() { var name: string = this.v.props.name; var handler: React.ComponentClass = this.v.props.handler; } - + createElement() { var Handler: React.ComponentClass; React.createElement(Router.DefaultRoute, null); @@ -145,12 +133,12 @@ class DefaultRouteTest { class LinkTest { v: Router.Link; - + constructor() { new NavigationTest(); new StateTest(); } - + props() { var activeClassName: string = this.v.props.activeClassName; var to: string = this.v.props.to; @@ -158,15 +146,15 @@ class LinkTest { var query: {} = this.v.props.query; var onClick: Function = this.v.props.onClick; } - + getHref() { var v1: string = this.v.getHref(); } - + getClassName() { var v1: string = this.v.getClassName(); } - + createElement() { React.createElement(Router.Link, null); React.createElement(Router.Link, {to: 'home'}); @@ -182,12 +170,12 @@ class LinkTest { class NotFoundRouteTest { v: Router.NotFoundRoute; - + props() { var name: string = this.v.props.name; var handler: React.ComponentClass = this.v.props.handler; } - + createElement() { var Handler: React.ComponentClass; React.createElement(Router.NotFoundRoute, null); @@ -198,13 +186,13 @@ class NotFoundRouteTest { class RedirectTest { v: Router.Redirect; - + props() { var path: string = this.v.props.path; var from: string = this.v.props.from; var to: string = this.v.props.to; } - + createElement() { React.createElement(Router.Redirect, null); React.createElement(Router.Redirect, {}); @@ -214,14 +202,14 @@ class RedirectTest { class RouteTest { v: Router.Route; - + props() { var name: string = this.v.props.name; var path: string = this.v.props.path; var handler: React.ComponentClass = this.v.props.handler; var ignoreScrollBehavior: boolean = this.v.props.ignoreScrollBehavior; } - + createElement() { var Handler: React.ComponentClass; React.createElement(Router.Route, null); @@ -232,11 +220,7 @@ class RouteTest { class RouteHandlerTest { v: Router.RouteHandler; - - constructor() { - new RouteHandlerMixinTest(); - } - + createElement() { React.createElement(Router.RouteHandler, null); React.createElement(Router.RouteHandler, {}); @@ -247,11 +231,11 @@ class RouteHandlerTest { // History class HistoryTest { v: Router.History; - + length() { var v1: number = this.v.length; } - + back() { var v1: void = this.v.back(); } @@ -261,7 +245,7 @@ class HistoryTest { // Router class CreateTest { v: Router.Router; - + constructor() { // React.createElement() version this.v = Router.create({ @@ -272,7 +256,7 @@ class CreateTest { location: Router.HistoryLocation, scrollBehavior: Router.ImitateBrowserBehavior }); - + // React.createFactory() version this.v = Router.create({ routes: React.createFactory(Router.Route)() @@ -283,7 +267,7 @@ class CreateTest { scrollBehavior: Router.ImitateBrowserBehavior }); } - + run() { this.v.run((Handler) => console.log(Handler)); this.v.run((Handler, state) => console.log(Handler, state)); @@ -299,7 +283,7 @@ class RunTest { var v2: Router.Router = Router.run(React.createElement(Router.Route, null), Router.HistoryLocation, (Handler, state) => { React.render(React.createElement(Handler, null), document.body); }); - + // React.createFactory() version var v3: Router.Router = Router.run(React.createFactory(Router.Route)(), (Handler) => { React.render(React.createElement(Handler, null), document.body); diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 58ec9069a4..c02892ffe1 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -1,278 +1,297 @@ -// Type definitions for React Router 0.12.0 +// Type definitions for React Router 0.13.3 // Project: https://github.com/rackt/react-router -// Definitions by: Yuichi Murata +// Definitions by: Yuichi Murata , Václav Ostrožlík // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// -declare module ReactRouter { - // - // Mixin - // ---------------------------------------------------------------------- - interface Navigation { - makePath(to: string, params?: {}, query?: {}): string; - makeHref(to: string, params?: {}, query?: {}): string; - transitionTo(to: string, params?: {}, query?: {}): void; - replaceWith(to: string, params?: {}, query?: {}): void; - goBack(): void; - } - - interface RouteHandlerMixin { - getRouteDepth(): number; - createChildRouteHandler(props: {}): RouteHandler; - } - - interface State { - getPath(): string; - getRoutes(): Route[]; - getPathname(): string; - getParams(): {}; - getQuery(): {}; - isActive(to: string, params?: {}, query?: {}): boolean; - } - - var Navigation: Navigation; - var State: State; - var RouteHandlerMixin: RouteHandlerMixin; - - - // - // Component - // ---------------------------------------------------------------------- - // DefaultRoute - interface DefaultRouteProp { - name?: string; - handler: React.ComponentClass; - } - interface DefaultRoute extends React.ReactElement { - __react_router_default_route__: any; // dummy - } - interface DefaultRouteClass extends React.ComponentClass { - __react_router_default_route__: any; // dummy - } - - // Link - interface LinkProp { - activeClassName?: string; - to: string; - params?: {}; - query?: {}; - onClick?: Function; - } - interface Link extends React.ReactElement, Navigation, State { - __react_router_link__: any; // dummy - - getHref(): string; - getClassName(): string; - } - interface LinkClass extends React.ComponentClass { - __react_router_link__: any; // dummy - } - - // NotFoundRoute - interface NotFoundRouteProp { - name?: string; - handler: React.ComponentClass; - } - interface NotFoundRoute extends React.ReactElement { - __react_router_not_found_route__: any; // dummy - } - interface NotFoundRouteClass extends React.ComponentClass { - __react_router_not_found_route__: any; // dummy - } - - // Redirect - interface RedirectProp { - path?: string; - from?: string; - to?: string; - } - interface Redirect extends React.ReactElement { - __react_router_redirect__: any; // dummy - } - interface RedirectClass extends React.ComponentClass { - __react_router_redirect__: any; // dummy - } - - // Route - interface RouteProp { - name?: string; - path?: string; - handler?: React.ComponentClass; - ignoreScrollBehavior?: boolean; - } - interface Route extends React.ReactElement { - __react_router_route__: any; // dummy - } - interface RouteClass extends React.ComponentClass { - __react_router_route__: any; // dummy - } - - // RouteHandler - interface RouteHandlerProp {} - interface RouteHandler extends React.ReactElement, RouteHandlerMixin { - __react_router_route_handler__: any; // dummy - } - interface RouteHandlerClass extends React.ReactElement { - __react_router_route_handler__: any; // dummy - } - - var DefaultRoute: DefaultRouteClass; - var Link: LinkClass; - var NotFoundRoute: NotFoundRouteClass; - var Redirect: RedirectClass; - var Route: RouteClass; - var RouteHandler: RouteHandlerClass; - - - // - // Location - // ---------------------------------------------------------------------- - interface LocationBase { - push(path: string): void; - replace(path: string): void; - pop(): void; - getCurrentPath(): void; - } - - interface LocationListener { - addChangeListener(listener: Function): void; - removeChangeListener(listener: Function): void; - } - - interface HashLocation extends LocationBase, LocationListener {} - interface HistoryLocation extends LocationBase, LocationListener {} - interface RefreshLocation extends LocationBase {} - - var HashLocation: HashLocation; - var HistoryLocation: HistoryLocation; - var RefreshLocation: RefreshLocation; - - - // - // Behavior - // ---------------------------------------------------------------------- - interface ScrollBehaviorBase { - updateScrollPosition(position: {x: number; y: number;}, actionType: string): void; - } - interface ImitateBrowserBehavior extends ScrollBehaviorBase {} - interface ScrollToTopBehavior extends ScrollBehaviorBase {} - - var ImitateBrowserBehavior: ImitateBrowserBehavior; - var ScrollToTopBehavior: ScrollToTopBehavior; - - - // - // Router - // ---------------------------------------------------------------------- - interface Router extends React.ReactElement { - run(callback: RouterRunCallback): void; - } - - interface RouterState { - path: string; - action: string; - pathname: string; - params: {}; - query: {}; - routes : Route[]; - } - - interface RouterCreateOption { - routes: React.ReactElement; - location?: LocationBase; - scrollBehavior?: ScrollBehaviorBase; - } - - type RouterRunCallback = (Handler: Router, state: RouterState) => void; - - function create(options: RouterCreateOption): Router; - function run(routes: React.ReactElement, callback: RouterRunCallback): Router; - function run(routes: React.ReactElement, location: LocationBase, callback: RouterRunCallback): Router; - - - // - // History - // ---------------------------------------------------------------------- - interface History { - back(): void; - length: number; - } - var History: History; - - - // - // Transition - // ---------------------------------------------------------------------- - interface Transition { - abort(): void; - redirect(to: string, params?: {}, query?: {}): void; - retry(): void; - } - - interface TransitionStaticLifecycle { - willTransitionTo?( - transition: Transition, - params: {}, - query: {}, - callback: Function - ): void; - - willTransitionFrom?( - transition: Transition, - component: React.ReactElement, - callback: Function - ): void; - } +declare module "react-router" { + + import React = require("react"); + + // + // Transition + // ---------------------------------------------------------------------- + interface Transition { + path: string; + abortReason: any; + retry(): void; + abort(reason?: any): void; + redirect(to: string, params?: {}, query?: {}): void; + cancel(): void; + from: (transition: Transition, routes: Route[], components?: React.ReactElement[], callback?: (error?: any) => void) => void; + to: (transition: Transition, routes: Route[], params?: {}, query?: {}, callback?: (error?: any) => void) => void; + } + + interface TransitionStaticLifecycle { + willTransitionTo?( + transition: Transition, + params: {}, + query: {}, + callback: Function + ): void; + + willTransitionFrom?( + transition: Transition, + component: React.ReactElement, + callback: Function + ): void; + } + + // + // Route Configuration + // ---------------------------------------------------------------------- + // DefaultRoute + interface DefaultRouteProp { + name?: string; + handler: React.ComponentClass; + } + interface DefaultRoute extends React.ReactElement {} + interface DefaultRouteClass extends React.ComponentClass {} + + // NotFoundRoute + interface NotFoundRouteProp { + name?: string; + handler: React.ComponentClass; + } + interface NotFoundRoute extends React.ReactElement {} + interface NotFoundRouteClass extends React.ComponentClass {} + + // Redirect + interface RedirectProp { + path?: string; + from?: string; + to?: string; + } + interface Redirect extends React.ReactElement {} + interface RedirectClass extends React.ComponentClass {} + + // Route + interface RouteProp { + name?: string; + path?: string; + handler?: React.ComponentClass; + ignoreScrollBehavior?: boolean; + } + interface Route extends React.ReactElement {} + interface RouteClass extends React.ComponentClass {} + + var DefaultRoute: DefaultRouteClass; + var NotFoundRoute: NotFoundRouteClass; + var Redirect: RedirectClass; + var Route: RouteClass; + + interface CreateRouteOptions { + name?: string; + path?: string; + ignoreScrollBehavior?: boolean; + isDefault?: boolean; + isNotFound?: boolean; + onEnter?: (transition: Transition, params: {}, query: {}, callback: Function) => void; + onLeave?: (transition: Transition, wtf: any, callback: Function) => void; + handler?: Function; + parentRoute?: Route; + } + + type CreateRouteCallback = (route: Route) => void; + + function createRoute(callback: CreateRouteCallback): Route; + function createRoute(options: CreateRouteOptions | string, callback: CreateRouteCallback): Route; + function createDefaultRoute(options?: CreateRouteOptions | string): Route; + function createNotFoundRoute(options?: CreateRouteOptions | string): Route; + + interface CreateRedirectOptions extends CreateRouteOptions { + path?: string; + from?: string; + to: string; + params?: {}; + query?: {}; + } + function createRedirect(options: CreateRedirectOptions): Redirect; + function createRoutesFromReactChildren(children: Route): Route[]; + + // + // Components + // ---------------------------------------------------------------------- + // Link + interface LinkProp { + activeClassName?: string; + activeStyle?: {}; + to: string; + params?: {}; + query?: {}; + onClick?: Function; + } + interface Link extends React.ReactElement, Navigation, State { + handleClick(event: any): void; + getHref(): string; + getClassName(): string; + getActiveState(): boolean; + } + interface LinkClass extends React.ComponentClass {} + + // RouteHandler + interface RouteHandlerProp { } + interface RouteHandlerChildContext { + routeDepth: number; + } + interface RouteHandler extends React.ReactElement { + getChildContext(): RouteHandlerChildContext; + getRouteDepth(): number; + createChildRouteHandler(props: {}): RouteHandler; + } + interface RouteHandlerClass extends React.ReactElement {} + + var Link: LinkClass; + var RouteHandler: RouteHandlerClass; + + + // + // Top-Level + // ---------------------------------------------------------------------- + interface Router extends React.ReactElement { + run(callback: RouterRunCallback): void; + } + + interface RouterState { + path: string; + action: string; + pathname: string; + params: {}; + query: {}; + routes: Route[]; + } + + interface RouterCreateOption { + routes: Route; + location?: LocationBase; + scrollBehavior?: ScrollBehaviorBase; + onError?: (error: any) => void; + onAbort?: (error: any) => void; + } + + type RouterRunCallback = (Handler: RouteClass, state: RouterState) => void; + + function create(options: RouterCreateOption): Router; + function run(routes: Route, callback: RouterRunCallback): Router; + function run(routes: Route, location: LocationBase, callback: RouterRunCallback): Router; + + + // + // Location + // ---------------------------------------------------------------------- + interface LocationBase { + getCurrentPath(): void; + toString(): string; + } + interface Location extends LocationBase { + push(path: string): void; + replace(path: string): void; + pop(): void; + } + + interface LocationListener { + addChangeListener(listener: Function): void; + removeChangeListener(listener: Function): void; + } + + interface HashLocation extends Location, LocationListener { } + interface HistoryLocation extends Location, LocationListener { } + interface RefreshLocation extends Location { } + interface StaticLocation extends LocationBase { } + interface TestLocation extends Location, LocationListener { } + + var HashLocation: HashLocation; + var HistoryLocation: HistoryLocation; + var RefreshLocation: RefreshLocation; + var StaticLocation: StaticLocation; + var TestLocation: TestLocation; + + + // + // Behavior + // ---------------------------------------------------------------------- + interface ScrollBehaviorBase { + updateScrollPosition(position: { x: number; y: number; }, actionType: string): void; + } + interface ImitateBrowserBehavior extends ScrollBehaviorBase { } + interface ScrollToTopBehavior extends ScrollBehaviorBase { } + + var ImitateBrowserBehavior: ImitateBrowserBehavior; + var ScrollToTopBehavior: ScrollToTopBehavior; + + + // + // Mixin + // ---------------------------------------------------------------------- + interface Navigation { + makePath(to: string, params?: {}, query?: {}): string; + makeHref(to: string, params?: {}, query?: {}): string; + transitionTo(to: string, params?: {}, query?: {}): void; + replaceWith(to: string, params?: {}, query?: {}): void; + goBack(): void; + } + + interface State { + getPath(): string; + getRoutes(): Route[]; + getPathname(): string; + getParams(): {}; + getQuery(): {}; + isActive(to: string, params?: {}, query?: {}): boolean; + } + + var Navigation: Navigation; + var State: State; + + + // + // History + // ---------------------------------------------------------------------- + interface History { + back(): void; + length: number; + } + var History: History; } -declare module 'react-router' { - import Export = ReactRouter; - export = Export; -} -declare module React { - interface TopLevelAPI { - // for DefaultRoute - createElement( - type: ReactRouter.DefaultRouteClass, - props: ReactRouter.DefaultRouteProp, - ...children: ReactNode[] - ): ReactRouter.DefaultRoute; - - // for Link - createElement( - type: ReactRouter.LinkClass, - props: ReactRouter.LinkProp, - ...children: ReactNode[] - ): ReactRouter.Link; - - // for NotFoundRoute - createElement( - type: ReactRouter.NotFoundRouteClass, - props: ReactRouter.NotFoundRouteProp, - ...children: ReactNode[] - ): ReactRouter.NotFoundRoute; - - // for Redirect - createElement( - type: ReactRouter.RedirectClass, - props: ReactRouter.RedirectProp, - ...children: ReactNode[] - ): ReactRouter.Redirect; - - // for Route - createElement( - type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, - ...children: ReactNode[] - ): ReactRouter.Route; - - // for RouteHandler - createElement( - type: ReactRouter.RouteHandlerClass, - props: ReactRouter.RouteHandlerProp, - ...children: ReactNode[] - ): ReactRouter.RouteHandler; - } +declare module "react" { + import ReactRouter = require("react-router"); + + // for DefaultRoute + function createElement( + type: ReactRouter.DefaultRouteClass, + props: ReactRouter.DefaultRouteProp, + ...children: ReactNode[]): ReactRouter.DefaultRoute; + + // for Link + function createElement( + type: ReactRouter.LinkClass, + props: ReactRouter.LinkProp, + ...children: ReactNode[]): ReactRouter.Link; + + // for NotFoundRoute + function createElement( + type: ReactRouter.NotFoundRouteClass, + props: ReactRouter.NotFoundRouteProp, + ...children: ReactNode[]): ReactRouter.NotFoundRoute; + + // for Redirect + function createElement( + type: ReactRouter.RedirectClass, + props: ReactRouter.RedirectProp, + ...children: ReactNode[]): ReactRouter.Redirect; + + // for Route + function createElement( + type: ReactRouter.RouteClass, + props: ReactRouter.RouteProp, + ...children: ReactNode[]): ReactRouter.Route; + + // for RouteHandler + function createElement( + type: ReactRouter.RouteHandlerClass, + props: ReactRouter.RouteHandlerProp, + ...children: ReactNode[]): ReactRouter.RouteHandler; } From 16c5267ec4c4611949ce77e381a9b416cb5a3f36 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 May 2015 11:18:08 +0200 Subject: [PATCH 0041/2220] fixed implicit any --- jasmine-ajax/jasmine-ajax.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jasmine-ajax/jasmine-ajax.d.ts b/jasmine-ajax/jasmine-ajax.d.ts index 657ec33747..d10f67ad40 100644 --- a/jasmine-ajax/jasmine-ajax.d.ts +++ b/jasmine-ajax/jasmine-ajax.d.ts @@ -62,7 +62,7 @@ interface JasmineAjaxParamParser { } declare class MockAjax { - constructor(globals); + constructor(globals: any); install(): void; uninstall(): void; From 1ec7dac4f93c825f3a90372de6abfe2198343358 Mon Sep 17 00:00:00 2001 From: Sam Albert Date: Tue, 26 May 2015 16:01:50 -0400 Subject: [PATCH 0042/2220] Updated callback buffer with rest parameters. --- node_zeromq/zmq-tests.ts | 2 +- node_zeromq/zmq.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node_zeromq/zmq-tests.ts b/node_zeromq/zmq-tests.ts index 696a98c13b..a62d97a6ca 100644 --- a/node_zeromq/zmq-tests.ts +++ b/node_zeromq/zmq-tests.ts @@ -19,7 +19,7 @@ function test3() { var sock = zmq.socket('push'); sock.bindSync('tcp://127.0.0.1:3000'); sock.send(['hello', 'world']); - sock.on('message', function (buffer: Buffer) { + sock.on('message', function (buffer1: Buffer, buffer2: Buffer) { // }); } diff --git a/node_zeromq/zmq.d.ts b/node_zeromq/zmq.d.ts index 8d29e05691..3ab2d1f255 100644 --- a/node_zeromq/zmq.d.ts +++ b/node_zeromq/zmq.d.ts @@ -182,7 +182,7 @@ declare module 'zmq' { * @param eventName {string} * @param callback {Function} */ - on(eventName: string, callback: (buffer: Buffer) => void): void; + on(eventName: string, callback: (...buffer: Buffer[]) => void): void; // Socket Options _fd: any; From 3e467db265658e0dbc80de8c1be71e4531a52530 Mon Sep 17 00:00:00 2001 From: Chris Wrench Date: Wed, 27 May 2015 17:24:46 +0100 Subject: [PATCH 0043/2220] Begin update of Google Maps definitions to v3.20 As part of #4364, update some of the Google Maps API to the latest version, v3.20. Changes include: - Addition of `LatLngLiteral` type; - Remove `MarkerImage` type; - Update `Marker` class. The following areas of the API have been updated and checked for consistency with the latest API reference: - Map; - Controls; - Data; - Overlays; - Services; - Save to Google Maps; - Base; - MVC. All other areas of the API still need to be updated. --- googlemaps/google.maps.d.ts | 328 ++++++++++++++++++++++-------------- 1 file changed, 202 insertions(+), 126 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index fe4e7459cd..f5d197773f 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Maps JavaScript API 3.19 +// Type definitions for Google Maps JavaScript API 3.20 // Project: https://developers.google.com/maps/ // Definitions by: Folia A/S , Chris Wrench // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -29,34 +29,6 @@ THE SOFTWARE. declare module google.maps { - /***** MVC *****/ - export class MVCObject { - constructor (); - addListener(eventName: string, handler: (...args: any[]) => void): MapsEventListener; - bindTo(key: string, target: MVCObject, targetKey?: string, noNotify?: boolean): void; - changed(key: string): void; - get(key: string): any; - notify(key: string): void; - set(key: string, value: any): void; - setValues(values: any): void; - unbind(key: string): void; - unbindAll(): void; - } - - export class MVCArray extends MVCObject { - constructor (array?: any[]); - clear(): void; - forEach(callback: (elem: any, index: number) => void ): void; - getArray(): any[]; - getAt(i: number): any; - getLength(): number; - insertAt(i: number, elem: any): void; - pop(): void; - push(elem: any): number; - removeAt(i: number): any; - setAt(i: number, elem: any): void; - } - /***** Map *****/ export class Map extends MVCObject { constructor (mapDiv: Element, opts?: MapOptions); @@ -65,17 +37,17 @@ declare module google.maps { getCenter(): LatLng; getDiv(): Element; getHeading(): number; - getMapTypeId(): MapTypeId; + getMapTypeId(): MapTypeId|string; getProjection(): Projection; getStreetView(): StreetViewPanorama; getTilt(): number; getZoom(): number; panBy(x: number, y: number): void; - panTo(latLng: LatLng): void; + panTo(latLng: LatLng|LatLngLiteral): void; panToBounds(latLngBounds: LatLngBounds): void; - setCenter(latlng: LatLng): void; + setCenter(latlng: LatLng|LatLngLiteral): void; setHeading(heading: number): void; - setMapTypeId(mapTypeId: MapTypeId): void; + setMapTypeId(mapTypeId: MapTypeId|string): void; setOptions(options: MapOptions): void; setStreetView(panorama: StreetViewPanorama): void; setTilt(tilt: number): void; @@ -99,8 +71,6 @@ declare module google.maps { mapMaker?: boolean; mapTypeControl?: boolean; mapTypeControlOptions?: MapTypeControlOptions; - navigationControl?: boolean; - navigationControlOptions?: NavigationControlOptions; mapTypeId?: MapTypeId; maxZoom?: number; minZoom?: number; @@ -133,7 +103,7 @@ declare module google.maps { /***** Controls *****/ export interface MapTypeControlOptions { - mapTypeIds?: MapTypeId[]; + mapTypeIds?: MapTypeId[]|string[]; position?: ControlPosition; style?: MapTypeControlStyle; } @@ -157,7 +127,6 @@ declare module google.maps { } export interface ScaleControlOptions { - position?: ControlPosition; style?: ScaleControlStyle; } @@ -195,18 +164,6 @@ declare module google.maps { TOP_RIGHT } - export interface NavigationControlOptions { - position?: ControlPosition; - style?: NavigationControlStyle; - } - - export enum NavigationControlStyle { - DEFAULT, - SMALL, - ANDROID, - ZOOM_PAN - } - /***** Data *****/ export class Data extends MVCObject { constructor(options?: Data.DataOptions); @@ -214,6 +171,9 @@ declare module google.maps { addGeoJson(geoJson: Object, options?: Data.GeoJsonOptions): Data.Feature[]; contains(feature: Data.Feature): boolean; forEach(callback: (feature: Data.Feature) => void): void; + getControlPosition(): ControlPosition; + getControls(): string[]; + getDrawingMode(): string; getFeatureById(id: number|string): Data.Feature; getMap(): Map; getStyle(): Data.StylingFunction|Data.StyleOptions; @@ -221,6 +181,9 @@ declare module google.maps { overrideStyle(feature: Data.Feature, style: Data.StyleOptions): void; remove(feature: Data.Feature): void; revertStyle(feature?: Data.Feature): void; + setControlPosition(controlPosition: ControlPosition): void; + setControls(controls: string[]): void; + setDrawingMode(drawingMode: string): void; setMap(map: Map): void; setStyle(style: Data.StylingFunction|Data.StyleOptions): void; toGeoJson(callback: (feature: Object) => void): void; @@ -228,6 +191,10 @@ declare module google.maps { export module Data { export interface DataOptions { + controlPosition?: ControlPosition; + controls?: string[]; + drawingMode?: string; + featureFactory?: (geometry: Data.Geometry) => Data.Feature; map?: Map; style?: Data.StylingFunction|Data.StyleOptions; } @@ -239,9 +206,11 @@ declare module google.maps { export interface StyleOptions { clickable?: boolean; cursor?: string; + draggable?: boolean; + editable?: boolean; fillColor?: string; fillOpacity?: number; - icon?: any; // TODO string|Icon|Symbol; + icon?: string|Icon|Symbol; shape?: MarkerShape; strokeColor?: string; strokeOpacity?: number; @@ -260,13 +229,13 @@ declare module google.maps { getId(): number|string; getProperty(name: string): any; removeProperty(name: string): void; - setGeometry(newGeometry: Data.Geometry|LatLng): void; // TODO LatLngLiteral + setGeometry(newGeometry: Data.Geometry|LatLng|LatLngLiteral): void; setProperty(name: string, newValue: any): void toGeoJson(callback: (feature: Object) => void): void } export interface FeatureOptions { - geometry?: Data.Geometry|LatLng; // TODO LatLngLiteral + geometry?: Data.Geometry|LatLng|LatLngLiteral; id?: number|string; properties?: Object; } @@ -276,53 +245,54 @@ declare module google.maps { } export class Point extends Data.Geometry { - constructor(latLng: LatLng); // TODO LatLngLiteral + constructor(latLng: LatLng|LatLngLiteral); get(): LatLng; } export class MultiPoint extends Data.Geometry { - constructor(elements: LatLng[]); // TODO LatLngLiteral + constructor(elements: LatLng[]|LatLngLiteral[]); + getArray(): LatLng[]; getAt(n: number): LatLng; getLength(): number; } export class LineString extends Data.Geometry { - constructor(elements: LatLng[]); // TODO LatLngLiteral + constructor(elements: LatLng[]|LatLngLiteral[]); getArray(): LatLng[]; getAt(n: number): LatLng; getLength(): number; } export class MultiLineString extends Data.Geometry { - constructor(elements: Data.LineString[]|LatLng[]); // TODO LatLngLiteral + constructor(elements: Data.LineString[]|LatLng[]|LatLngLiteral[]); getArray(): Data.LineString[]; getAt(n: number): Data.LineString; getLength(): number; } export class LinearRing extends Data.Geometry { - constructor(elements: LatLng[]); // TODO LatLngLiteral + constructor(elements: LatLng[]|LatLngLiteral[]); getArray(): LatLng[]; getAt(n: number): LatLng; getLength(): number; } export class Polygon extends Data.Geometry { - constructor(elements: LinearRing[]|LatLng[][]); // TODO LatLngLiteral - getArray(): LinearRing[]; - getAt(n: number): LinearRing; + constructor(elements: Data.LinearRing[]|LatLng[][]|LatLngLiteral[][]); + getArray(): Data.LinearRing[]; + getAt(n: number): Data.LinearRing; getLength(): number; } export class MultiPolygon extends Data.Geometry { - constructor(elements: Data.Polygon[]|LinearRing[][]|LatLng[][][]); // TODO LatLngLiteral + constructor(elements: Data.Polygon[]|LinearRing[][]|LatLng[][][]|LatLngLiteral[][][]); getArray(): Data.Polygon[]; getAt(n: number): Data.Polygon; getLength(): number; } export class GeometryCollection extends Data.Geometry { - constructor(elements: Data.Geometry[]|LatLng[]); // TODO LatLngLiteral + constructor(elements: Data.Geometry[]|LatLng[]|LatLngLiteral[]); getArray(): Data.Geometry[]; getAt(n: number): Data.Geometry; getLength(): number; @@ -365,31 +335,30 @@ declare module google.maps { static MAX_ZINDEX: number; constructor (opts?: MarkerOptions); getAnimation(): Animation; + getAttribution(): Attribution; getClickable(): boolean; getCursor(): string; getDraggable(): boolean; - getFlat(): boolean; - getIcon(): MarkerImage; - getMap(): any; // Map or StreetViewPanorama + getIcon(): string|Icon|Symbol; + getMap(): Map|StreetViewPanorama; + getOpacity(): number; + getPlace(): Place; getPosition(): LatLng; - getShadow(): MarkerImage; getShape(): MarkerShape; getTitle(): string; getVisible(): boolean; getZIndex(): number; setAnimation(animation: Animation): void; + setAttribution(attribution: Attribution): void; setClickable(flag: boolean): void; setCursor(cursor: string): void; setDraggable(flag: boolean): void; - setFlat(flag: boolean): void; - setIcon(icon: MarkerImage): void; - setIcon(icon: string): void; - setMap(map: Map): void; - setMap(map: StreetViewPanorama): void; + setIcon(icon: string|Icon|Symbol): void; + setMap(map: Map|StreetViewPanorama): void; + getOpacity(opacity: number): void; setOptions(options: MarkerOptions): void; - setPosition(latlng: LatLng): void; - setShadow(shadow: MarkerImage): void; - setShadow(shadow: string): void; + setPlace(place: Place): void; + setPosition(latlng: LatLng|LatLngLiteral): void; setShape(shape: MarkerShape): void; setTitle(title: string): void; setVisible(visible: boolean): void; @@ -397,30 +366,31 @@ declare module google.maps { } export interface MarkerOptions { + anchorPoint?:Point; animation?: Animation; + attribution?: Attribution; clickable?: boolean; + crossOnDrag?: boolean; cursor?: string; draggable?: boolean; - flat?: boolean; - icon?: any; - map?: any; + icon?: string|Icon|Symbol; + map?: Map|StreetViewPanorama; + opacity?: number; optimized?: boolean; + place?: Place; position?: LatLng; - raiseOnDrag?: boolean; - shadow?: any; shape?: MarkerShape; title?: string; visible?: boolean; zIndex?: number; } - export class MarkerImage { - constructor (url: string, size?: Size, origin?: Point, anchor?: Point, scaledSize?: Size); - anchor: Point; - origin: Point; - scaledSize: Size; - size: Size; - url: string; + export interface Icon { + anchor?: Point; + origin?: Point; + scaledSize?: Size; + size?: Size; + url?: string; } export interface MarkerShape { @@ -432,7 +402,7 @@ declare module google.maps { anchor?: Point; fillColor?: string; fillOpacity?: number; - path?: any; + path?: SymbolPath|string; rotation?: number; scale?: number; strokeColor?: string; @@ -456,24 +426,22 @@ declare module google.maps { export class InfoWindow extends MVCObject { constructor (opts?: InfoWindowOptions); close(): void; - getContent(): any; // string or Element + getContent(): string|Element; getPosition(): LatLng; getZIndex(): number; - open(map?: Map, anchor?: MVCObject): void; - open(map?: StreetViewPanorama, anchor?: MVCObject): void; - setContent(content: Node): void; - setContent(content: string): void; + open(map?: Map|StreetViewPanorama, anchor?: MVCObject): void; + setContent(content: string|Node): void; setOptions(options: InfoWindowOptions): void; setPosition(position: LatLng): void; setZIndex(zIndex: number): void; } export interface InfoWindowOptions { - content?: any; + content?: string|Node; disableAutoPan?: boolean; maxWidth?: number; pixelOffset?: Size; - position?: LatLng; + position?: LatLng|LatLngLiteral; zIndex?: number; } @@ -482,14 +450,13 @@ declare module google.maps { getDraggable(): boolean; getEditable(): boolean; getMap(): Map; - getPath(): MVCArray; + getPath(): MVCArray; // MVCArray getVisible(): boolean; setDraggable(draggable: boolean): void; setEditable(editable: boolean): void; setMap(map: Map): void; setOptions(options: PolylineOptions): void; - setPath(path: MVCArray): void; - setPath(path: LatLng[]): void; + setPath(path: MVCArray|LatLng[]|LatLngLiteral[]): void; // MVCArray|Array setVisible(visible: boolean): void; } @@ -500,7 +467,7 @@ declare module google.maps { geodesic?: boolean; icons?: IconSequence[]; map?: Map; - path?: any[]; + path?: MVCArray|LatLng[]|LatLngLiteral[]; // MVCArray|Array strokeColor?: string; strokeOpacity?: number; strokeWeight?: number; @@ -520,19 +487,20 @@ declare module google.maps { getDraggable(): boolean; getEditable(): boolean; getMap(): Map; - getPath(): MVCArray; - getPaths(): MVCArray; + getPath(): MVCArray; // MVCArray + getPaths(): MVCArray; // MVCArray> getVisible(): boolean; setDraggable(draggable: boolean): void; setEditable(editable: boolean): void; setMap(map: Map): void; setOptions(options: PolygonOptions): void; - setPath(path: MVCArray): void; - setPath(path: LatLng[]): void; + setPath(path: MVCArray|LatLng[]|LatLngLiteral[]): void; setPaths(paths: MVCArray): void; setPaths(paths: MVCArray[]): void; setPaths(path: LatLng[]): void; setPaths(path: LatLng[][]): void; + setPaths(path: LatLngLiteral[]): void; + setPaths(path: LatLngLiteral[][]): void; setVisible(visible: boolean): void; } @@ -544,7 +512,7 @@ declare module google.maps { fillOpacity?: number; geodesic?: boolean; map?: Map; - paths?: any[]; + paths?: any[]; // MVCArray>|MVCArray|Array>|Array strokeColor?: string; strokeOpacity?: number; strokePosition?: StrokePosition; @@ -599,7 +567,7 @@ declare module google.maps { getMap(): Map; getRadius(): number; getVisible(): boolean; - setCenter(center: LatLng): void; + setCenter(center: LatLng|LatLngLiteral): void; setDraggable(draggable: boolean): void; setEditable(editable: boolean): void; setMap(map: Map): void; @@ -649,23 +617,20 @@ declare module google.maps { export class OverlayView extends MVCObject { draw(): void; - getMap(): Map; + getMap(): Map|StreetViewPanorama; getPanes(): MapPanes; getProjection(): MapCanvasProjection; onAdd(): void; onRemove(): void; - setMap(map: Map): void; - setMap(map: StreetViewPanorama): void; + setMap(map: Map|StreetViewPanorama): void; } export interface MapPanes { floatPane: Element; - floatShadow: Element; mapPane: Element; - overlayImage: Element; + markerLayer: Element; overlayLayer: Element; overlayMouseTarget: Element; - overlayShadow: Element; } export class MapCanvasProjection extends MVCObject { @@ -678,17 +643,25 @@ declare module google.maps { /***** Services *****/ export class Geocoder { - constructor (); geocode(request: GeocoderRequest, callback: (results: GeocoderResult[], status: GeocoderStatus) => void ): void; } export interface GeocoderRequest { address?: string; bounds?: LatLngBounds; - location?: LatLng; + componentRestrictions: GeocoderComponentRestrictions; + location?: LatLng|LatLngLiteral; region?: string; } + export interface GeocoderComponentRestrictions { + administrativeArea: string; + country: string; + locality: string; + postalCode: string; + route: string; + } + export enum GeocoderStatus { ERROR, INVALID_REQUEST, @@ -703,6 +676,8 @@ declare module google.maps { address_components: GeocoderAddressComponent[]; formatted_address: string; geometry: GeocoderGeometry; + partial_match: boolean; + postcode_localities: string[] types: string[]; } @@ -757,16 +732,17 @@ declare module google.maps { } export class DirectionsService { - constructor (); route(request: DirectionsRequest, callback: (result: DirectionsResult, status: DirectionsStatus) => void ): void; } export interface DirectionsRequest { + avoidFerries?: boolean; avoidHighways?: boolean; avoidTolls?: boolean; - destination?: any; + destination?: LatLng|string; + durationInTraffic?: boolean; optimizeWaypoints?: boolean; - origin?: any; + origin?: LatLng|string; provideRouteAlternatives?: boolean; region?: string; transitOptions?: TransitOptions; @@ -790,10 +766,28 @@ declare module google.maps { export interface TransitOptions { arrivalTime?: Date; departureTime?: Date; + modes: TransitMode[]; + routingPreference: TransitRoutePreference; } + export enum TransitMode { + BUS, + RAIL, + SUBWAY, + TRAIN, + TRAM + } + + export enum TransitRoutePreference + { + FEWER_TRANSFERS, + LESS_WALKING + } + + export interface TransitFare { } + export interface DirectionsWaypoint { - location: any; + location: LatLng|string; stopover: boolean; } @@ -815,17 +809,20 @@ declare module google.maps { export interface DirectionsRoute { bounds: LatLngBounds; copyrights: string; + fare: TransitFare; legs: DirectionsLeg[]; overview_path: LatLng[]; + overview_polyline: string; warnings: string[]; waypoint_order: number[]; } export interface DirectionsLeg { - arrival_time: Distance; - departure_time: Duration; + arrival_time: Time; + departure_time: Time; distance: Distance; duration: Duration; + duration_in_traffic: Duration; end_address: string; end_location: LatLng; start_address: string; @@ -899,11 +896,31 @@ declare module google.maps { icon: string; local_icon: string; name: string; - type: string; + type: VehicleType; + } + + export enum VehicleType + { + BUS, + CABLE_CAR, + COMMUTER_TRAIN, + FERRY, + FUNICULAR, + GONDOLA_LIFT, + HEAVY_RAIL, + HIGH_SPEED_TRAIN, + INTERCITY_BUS, + METRO_RAIL, + MONORAIL, + OTHER, + RAIL, + SHARE_TAXI, + SUBWAY, + TRAM, + TROLLEYBUS } export class ElevationService { - constructor (); getElevationAlongPath(request: PathElevationRequest, callback: (results: ElevationResult[], status: ElevationStatus) => void ): void; getElevationForLocations(request: LocationElevationRequest, callback: (results: ElevationResult[], status: ElevationStatus) => void ): void; } @@ -932,8 +949,7 @@ declare module google.maps { } export class MaxZoomService { - constructor (); - getMaxZoomAtLatLng(latlng: LatLng, callback: (result: MaxZoomResult) => void ): void; + getMaxZoomAtLatLng(latlng: LatLng|LatLngLiteral, callback: (result: MaxZoomResult) => void ): void; } export interface MaxZoomResult { @@ -947,16 +963,18 @@ declare module google.maps { } export class DistanceMatrixService { - constructor (); getDistanceMatrix(request: DistanceMatrixRequest, callback: (response: DistanceMatrixResponse, status: DistanceMatrixStatus) => void ): void; } export interface DistanceMatrixRequest { + avoidFerries?: boolean; avoidHighways?: boolean; avoidTolls?: boolean; - destinations?: any[]; - origins?: any[]; + destinations?: LatLng[]|string[]; + durationInTraffic?: boolean; + origins?: LatLng[]|string[]; region?: string; + transitOptions?: TransitOptions; travelMode?: TravelMode; unitSystem?: UnitSystem; } @@ -974,6 +992,7 @@ declare module google.maps { export interface DistanceMatrixResponseElement { distance: Distance; duration: Duration; + fare: TransitFare; status: DistanceMatrixElementStatus; } @@ -992,6 +1011,33 @@ declare module google.maps { OK, ZERO_RESULTS } + + /***** Save to Google Maps *****/ + export interface Attribution { + iosDeepLinkId?: string; + source?: string; + webUrl?: string; + } + + export interface Place { + location?: LatLng|LatLngLiteral; + placeId?: string; + query?: string; + } + + export class SaveWidget { + constructor(container: Node, opts?: SaveWidgetOptions); + getAttribution(): Attribution; + getPlace(): Place; + setAttribution(attribution: Attribution): void; + setOptions(opts: SaveWidgetOptions): void; + setPlace(place: Place): void; + } + + export interface SaveWidgetOptions{ + attribution?: Attribution; + place?: Place; + } /***** Map Types *****/ export interface MapType { @@ -1333,7 +1379,7 @@ declare module google.maps { ZERO_RESULTS } - /***** Event *****/ + /***** Events *****/ export interface MapsEventListener { } export class event { @@ -1367,6 +1413,8 @@ declare module google.maps { } + export type LatLngLiteral = { lat: number; lng: number } + export class LatLngBounds { constructor (sw?: LatLng, ne?: LatLng); contains(latLng: LatLng): boolean; @@ -1399,6 +1447,34 @@ declare module google.maps { toString(): string; } + /***** MVC *****/ + export class MVCObject { + constructor (); + addListener(eventName: string, handler: (...args: any[]) => void): MapsEventListener; + bindTo(key: string, target: MVCObject, targetKey?: string, noNotify?: boolean): void; + changed(key: string): void; + get(key: string): any; + notify(key: string): void; + set(key: string, value: any): void; + setValues(values: any): void; + unbind(key: string): void; + unbindAll(): void; + } + + export class MVCArray extends MVCObject { + constructor (array?: any[]); + clear(): void; + forEach(callback: (elem: any, i: number) => void): void; + getArray(): any[]; + getAt(i: number): any; + getLength(): number; + insertAt(i: number, elem: any): void; + pop(): any; + push(elem: any): number; + removeAt(i: number): any; + setAt(i: number, elem: any): void; + } + /***** Geometry Library *****/ export module geometry { export class encoding { From e6057412964979bebb5ca85665b2b39a37b0ccdb Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Sun, 31 May 2015 10:30:59 +0300 Subject: [PATCH 0044/2220] ICurrent route can sometimes have a 5108route param --- angularjs/angular-route.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 4ddf87cab9..3ac22c096e 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -108,6 +108,8 @@ declare module angular.route { // see http://docs.angularjs.org/api/ng.$route#current interface ICurrentRoute extends IRoute { + $$route?: IRoute; + locals: { $scope: IScope; $template: string; From c32e1df7c5ed02a36a7e911db68440d3daf1e649 Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Sun, 31 May 2015 10:32:28 +0300 Subject: [PATCH 0045/2220] IActionDescriptor can have a url override also --- angularjs/angular-resource.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 057cc1b564..ec8430cb83 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -45,6 +45,7 @@ declare module angular.resource { // Just a reference to facilitate describing new actions interface IActionDescriptor { + url?: string; method: string; isArray?: boolean; params?: any; From d9b2f58d6864a8a7e1792a54307a2d5c6dbec9ab Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Mon, 1 Jun 2015 09:27:43 +0300 Subject: [PATCH 0046/2220] IResourceServiceProvider --- angularjs/angular-resource.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index ec8430cb83..7f02a533ea 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -21,6 +21,7 @@ declare module angular.resource { stripTrailingSlashes?: boolean; } + /////////////////////////////////////////////////////////////////////////// // ResourceService // see http://docs.angularjs.org/api/ngResource.$resource @@ -144,6 +145,13 @@ declare module angular.resource { ($resource: angular.resource.IResourceService): IResourceClass; >($resource: angular.resource.IResourceService): U; } + + // IResourceServiceProvider used to configure global settings + interface IResourceServiceProvider extends ng.IServiceProvider { + + defaults: IResourceOptions; + } + } /** extensions to base ng based on using angular-resource */ From adab66e6a9f99b9f55c33dd0e4a96fd065dafe0e Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Mon, 1 Jun 2015 17:08:15 +0300 Subject: [PATCH 0047/2220] Remove incorrect ICurrentRoute api --- angularjs/angular-route.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 3ac22c096e..4ddf87cab9 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -108,8 +108,6 @@ declare module angular.route { // see http://docs.angularjs.org/api/ng.$route#current interface ICurrentRoute extends IRoute { - $$route?: IRoute; - locals: { $scope: IScope; $template: string; From e6360b8507bb68489c17e0a4eeee79276b955612 Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Mon, 1 Jun 2015 17:08:46 +0300 Subject: [PATCH 0048/2220] Add IResourceServiceProvider interface --- angularjs/angular-resource-tests.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index 148d409010..189eec3c5f 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -135,4 +135,11 @@ mod = mod.factory('factory name', resourceServiceFactoryFunction); /////////////////////////////////////// // IResource -/////////////////////////////////////// \ No newline at end of file +/////////////////////////////////////// + + +/////////////////////////////////////// +// IResourceServiceProvider +/////////////////////////////////////// +var resourceServiceProvider: angular.resource.IResourceServiceProvider; +resourceServiceProvider.defaults.stripTrailingSlashes = false; From 64d5b5286f6c15426ce4d4e0e535b85ddfc33629 Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Mon, 1 Jun 2015 17:14:39 +0300 Subject: [PATCH 0049/2220] AngularJS: IActionDescriptor test new url parameter --- angularjs/angular-resource-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts index 189eec3c5f..f7f248ea8a 100644 --- a/angularjs/angular-resource-tests.ts +++ b/angularjs/angular-resource-tests.ts @@ -8,6 +8,7 @@ interface IMyResourceClass extends angular.resource.IResourceClass /////////////////////////////////////// var actionDescriptor: angular.resource.IActionDescriptor; +actionDescriptor.url = '/api/test-url/' actionDescriptor.headers = { header: 'value' }; actionDescriptor.isArray = true; actionDescriptor.method = 'method action'; From 0af334e2c9e088838c33ee3b09172c986fe8d54a Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Mon, 1 Jun 2015 17:28:16 +0300 Subject: [PATCH 0050/2220] ICurrentRoute.locals will also contain any resolved values --- angularjs/angular-route.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts index 4ddf87cab9..662b2c11d3 100644 --- a/angularjs/angular-route.d.ts +++ b/angularjs/angular-route.d.ts @@ -109,6 +109,7 @@ declare module angular.route { // see http://docs.angularjs.org/api/ng.$route#current interface ICurrentRoute extends IRoute { locals: { + [index: string]: any; $scope: IScope; $template: string; }; From ab71290650b4077c498503315396bece131ae488 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 28 May 2015 10:50:54 +0800 Subject: [PATCH 0051/2220] moment: Include some methods which were added in 2.9.0 --- moment/moment-node.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 13f1b9362e..0a89b7066c 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -69,6 +69,7 @@ declare module moment { subtract(d: Duration): Duration; toISOString(): string; + toJSON(): string; } @@ -276,6 +277,12 @@ declare module moment { isSame(b: Date, granularity: string): boolean; isSame(b: number[], granularity: string): boolean; + isBetween(a: Moment, b: Moment, granularity?: string): boolean; + isBetween(a: string, b: string, granularity?: string): boolean; + isBetween(a: number, b: number, granularity?: string): boolean; + isBetween(a: Date, b: Date, granularity?: string): boolean; + isBetween(a: number[], b: number[], granularity?: string): boolean; + // Deprecated as of 2.8.0. lang(language: string): Moment; lang(reset: boolean): Moment; @@ -412,6 +419,7 @@ declare module moment { invalid(parsingFlags?: Object): Moment; isMoment(): boolean; isMoment(m: any): boolean; + isDate(m: any): boolean; isDuration(): boolean; isDuration(d: any): boolean; From dbbc90296b72294f8099c19e724c37447dca43f3 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Thu, 28 May 2015 10:51:22 +0800 Subject: [PATCH 0052/2220] moment: Tests for 2.9.0 methods --- moment/moment-external-tests.ts | 7 +++++++ moment/moment-tests.ts | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/moment/moment-external-tests.ts b/moment/moment-external-tests.ts index c5855c12c7..b76752b118 100644 --- a/moment/moment-external-tests.ts +++ b/moment/moment-external-tests.ts @@ -196,10 +196,17 @@ moment.isMoment(); moment.isMoment(new Date()); moment.isMoment(moment()); +moment.isDate(new Date()); +moment.isDate(/regexp/); + moment.isDuration(); moment.isDuration(new Date()); moment.isDuration(moment.duration()); +moment().isBetween(moment(), moment()); +moment().isBetween(new Date(), new Date()); +moment().isBetween([1,1,2000], [1,1,2001], "year"); + moment.localeData('fr'); moment(1316116057189).fromNow(); diff --git a/moment/moment-tests.ts b/moment/moment-tests.ts index 16490d2e19..04c0753529 100644 --- a/moment/moment-tests.ts +++ b/moment/moment-tests.ts @@ -196,10 +196,17 @@ moment.isMoment(); moment.isMoment(new Date()); moment.isMoment(moment()); +moment.isDate(new Date()); +moment.isDate(/regexp/); + moment.isDuration(); moment.isDuration(new Date()); moment.isDuration(moment.duration()); +moment().isBetween(moment(), moment()); +moment().isBetween(new Date(), new Date()); +moment().isBetween([1,1,2000], [1,1,2001], "year"); + moment.localeData('fr'); moment(1316116057189).fromNow(); @@ -228,6 +235,8 @@ moment.duration(500).seconds(); moment.duration(500).asSeconds(); moment.duration().minutes(); moment.duration().asMinutes(); +moment.duration().toISOString(); +moment.duration().toJSON(); var adur = moment.duration(3, 'd'); var bdur = moment.duration(2, 'd'); From 8064aa89b0ccf592a507ccd8f5e0389818abb64b Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 2 Jun 2015 11:30:14 +0800 Subject: [PATCH 0053/2220] moment: Use type union for methods with moment-like parameters --- moment/moment-node.d.ts | 59 ++++++----------------------------------- 1 file changed, 8 insertions(+), 51 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 0a89b7066c..eaacb8855f 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -216,11 +216,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: Moment): string; - from(f: Moment, suffix: boolean): string; - from(d: Date): string; - from(s: string): string; - from(date: number[]): string; + from(f: Moment|string|number|Date|number[], suffix?: boolean): string; + to(f: Moment|string|number|Date|number[], suffix?: boolean): string; diff(b: Moment): number; diff(b: Moment, unitOfTime: string): number; @@ -243,45 +240,13 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: Moment): boolean; - isBefore(b: string): boolean; - isBefore(b: Number): boolean; - isBefore(b: Date): boolean; - isBefore(b: number[]): boolean; - isBefore(b: Moment, granularity: string): boolean; - isBefore(b: String, granularity: string): boolean; - isBefore(b: Number, granularity: string): boolean; - isBefore(b: Date, granularity: string): boolean; - isBefore(b: number[], granularity: string): boolean; + isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; isAfter(): boolean; - isAfter(b: Moment): boolean; - isAfter(b: string): boolean; - isAfter(b: Number): boolean; - isAfter(b: Date): boolean; - isAfter(b: number[]): boolean; - isAfter(b: Moment, granularity: string): boolean; - isAfter(b: String, granularity: string): boolean; - isAfter(b: Number, granularity: string): boolean; - isAfter(b: Date, granularity: string): boolean; - isAfter(b: number[], granularity: string): boolean; + isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; - isSame(b: Moment): boolean; - isSame(b: string): boolean; - isSame(b: Number): boolean; - isSame(b: Date): boolean; - isSame(b: number[]): boolean; - isSame(b: Moment, granularity: string): boolean; - isSame(b: String, granularity: string): boolean; - isSame(b: Number, granularity: string): boolean; - isSame(b: Date, granularity: string): boolean; - isSame(b: number[], granularity: string): boolean; - - isBetween(a: Moment, b: Moment, granularity?: string): boolean; - isBetween(a: string, b: string, granularity?: string): boolean; - isBetween(a: number, b: number, granularity?: string): boolean; - isBetween(a: Date, b: Date, granularity?: string): boolean; - isBetween(a: number[], b: number[], granularity?: string): boolean; + isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; // Deprecated as of 2.8.0. lang(language: string): Moment; @@ -297,20 +262,12 @@ declare module moment { localeData(): MomentLanguage; // Deprecated as of 2.7.0. - max(date: Date): Moment; - max(date: number): Moment; - max(date: any[]): Moment; - max(date: string): Moment; + max(date: Moment|string|number|Date|any[]): Moment; max(date: string, format: string): Moment; - max(clone: Moment): Moment; // Deprecated as of 2.7.0. - min(date: Date): Moment; - min(date: number): Moment; - min(date: any[]): Moment; - min(date: string): Moment; + min(date: Moment|string|number|Date|any[]): Moment; min(date: string, format: string): Moment; - min(clone: Moment): Moment; get(unit: string): number; set(unit: string, value: number): Moment; From 2f1df1f63590f9b97134414eab0ea53eea206c94 Mon Sep 17 00:00:00 2001 From: Nick Lee Date: Tue, 2 Jun 2015 12:21:16 -0400 Subject: [PATCH 0054/2220] Added IP and Hostname validators to Joi.d.ts --- joi/joi.d.ts | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/joi/joi.d.ts b/joi/joi.d.ts index 5e4bfc37bf..3df8ada9e0 100644 --- a/joi/joi.d.ts +++ b/joi/joi.d.ts @@ -47,11 +47,16 @@ declare module 'joi' { contextPrefix?: string; } + export interface IPOptions { + version?: Array; + cidr?: string + } + export interface ValidationError { message: string; details: ValidationErrorItem[]; - simple (): string; - annotated (): string; + simple(): string; + annotated(): string; } export interface ValidationErrorItem { @@ -82,19 +87,19 @@ declare module 'joi' { /** * Whitelists a value */ - allow(value: any, ...values : any[]): T; + allow(value: any, ...values: any[]): T; allow(values: any[]): T; /** * Adds the provided values into the allowed whitelist and marks them as the only valid values allowed. */ - valid(value: any, ...values : any[]): T; + valid(value: any, ...values: any[]): T; valid(values: any[]): T; /** * Blacklists a value */ - invalid(value: any, ...values : any[]): T; + invalid(value: any, ...values: any[]): T; invalid(values: any[]): T; /** @@ -257,6 +262,16 @@ declare module 'joi' { * Requires the string value to contain no whitespace before or after. If the validation convert option is on (enabled by default), the string will be trimmed. */ trim(): StringSchema; + + /** + * Requires the string value be a valid hostname. + */ + hostname(): StringSchema; + + /** + * Requires the string value to be a valid IP address. + */ + ip(options: IPOptions): StringSchema; /** * Requires the string value to be a valid uri with the passed scheme. @@ -364,7 +379,7 @@ declare module 'joi' { /** * Overrides the handling of unknown keys for the scope of the current object only (does not apply to children). */ - unknown(allow?:boolean): ObjectSchema; + unknown(allow?: boolean): ObjectSchema; } export interface BinarySchema extends AnySchema { @@ -486,5 +501,5 @@ declare module 'joi' { /** * Generates a reference to the value of the named key. */ - export function ref(key:string, options?: ReferenceOptions): Reference; + export function ref(key: string, options?: ReferenceOptions): Reference; } From cde81f5458364ef1dc43a85e1be6a9e132c94e11 Mon Sep 17 00:00:00 2001 From: Nick Lee Date: Wed, 3 Jun 2015 11:18:34 -0400 Subject: [PATCH 0055/2220] exported BoomError interface on Boom.d.ts --- boom/boom.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boom/boom.d.ts b/boom/boom.d.ts index d0f05065cf..e1539d21b3 100644 --- a/boom/boom.d.ts +++ b/boom/boom.d.ts @@ -6,7 +6,8 @@ /// declare module Boom { - interface BoomError { + + export interface BoomError { data: any; reformat: () => void; isBoom: boolean; From 265b807686458b8a3adeab00ecba82b99927ca53 Mon Sep 17 00:00:00 2001 From: Josh Heyse Date: Wed, 3 Jun 2015 11:56:52 -0500 Subject: [PATCH 0056/2220] added username to facebook profile --- passport-facebook/passport-facebook.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/passport-facebook/passport-facebook.d.ts b/passport-facebook/passport-facebook.d.ts index 855b033f58..26479cc296 100644 --- a/passport-facebook/passport-facebook.d.ts +++ b/passport-facebook/passport-facebook.d.ts @@ -13,6 +13,7 @@ declare module 'passport-facebook' { interface Profile extends passport.Profile { gender: string; profileUrl: string; + username: string; } interface IStrategyOption { From 3bf10e44d143f27b549986d617f37def4c7530ba Mon Sep 17 00:00:00 2001 From: Josh Heyse Date: Wed, 3 Jun 2015 11:57:24 -0500 Subject: [PATCH 0057/2220] added passport-google-oauth definitions --- .../passport-google-oauth-tests.ts | 38 ++++++++++++ .../passport-google-oauth.d.ts | 60 +++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 passport-google-oauth/passport-google-oauth-tests.ts create mode 100644 passport-google-oauth/passport-google-oauth.d.ts diff --git a/passport-google-oauth/passport-google-oauth-tests.ts b/passport-google-oauth/passport-google-oauth-tests.ts new file mode 100644 index 0000000000..60fad97b41 --- /dev/null +++ b/passport-google-oauth/passport-google-oauth-tests.ts @@ -0,0 +1,38 @@ +/** + * Created by jcabresos on 4/19/2014. + */ +import passport = require('passport'); +import google = require('passport-google-oauth'); + +// just some test model +var User = { + findOrCreate(id:string, provider:string, callback:(err:any, user:any) => void): void { + callback(null, {username:'james'}); + } +} + +passport.use(new google.OAuthStrategy({ + consumerKey: process.env.GOOGLE_CONSUMER_KEY, + consumerSecret: process.env.GOOGLE_CONSUMER_SECRET, + callbackURL: process.env.PASSPORT_GOOGLE_CALLBACK_URL + }, + function(accessToken:string, refreshToken:string, profile:google.Profile, done:(error:any, user?:any) => void) { + User.findOrCreate(profile.id, profile.provider, function(err, user) { + if (err) { return done(err); } + done(null, user); + }); + }) +); + +passport.use(new google.OAuth2Strategy({ + clientID: process.env.GOOGLE_CLIENT_ID, + clientSecret: process.env.GOOGLE_CLIENT_SECRET, + callbackURL: process.env.PASSPORT_GOOGLE_CALLBACK_URL + }, + function(accessToken:string, refreshToken:string, profile:google.Profile, done:(error:any, user?:any) => void) { + User.findOrCreate(profile.id, profile.provider, function(err, user) { + if (err) { return done(err); } + done(null, user); + }); + }) +); diff --git a/passport-google-oauth/passport-google-oauth.d.ts b/passport-google-oauth/passport-google-oauth.d.ts new file mode 100644 index 0000000000..ea6c1e91a3 --- /dev/null +++ b/passport-google-oauth/passport-google-oauth.d.ts @@ -0,0 +1,60 @@ +// Type definitions for passport-facebook 1.0.3 +// Project: https://github.com/jaredhanson/passport-facebook +// Definitions by: James Roland Cabresos +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'passport-google-oauth' { + + import passport = require('passport'); + import express = require('express'); + + interface Profile extends passport.Profile { + gender: string; + } + + interface IOAuthStrategyOption { + consumerKey: string; + consumerSecret: string; + callbackURL: string; + + reguestTokenURL?: string; + accessTokenURL?: string; + userAuthorizationURL?: string; + sessionKey?: string; + } + + class OAuthStrategy implements passport.Strategy { + constructor(options: IOAuthStrategyOption, + verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); + name: string; + authenticate: (req: express.Request, options?: Object) => void; + } + + interface IOAuth2StrategyOption { + clientID: string; + clientSecret: string; + callbackURL: string; + + authorizationURL?: string; + tokenURL?: string; + + accessType?: string; + approval_prompt?: string; + prompt?: string; + loginHint?: string; + userID?: string; + hostedDomain?: string; + display?: string; + requestVisibleActions?: string; + openIDRealm?: string; + } + + class OAuth2Strategy implements passport.Strategy { + constructor(options: IOAuth2StrategyOption, + verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); + name: string; + authenticate: (req: express.Request, options?: Object) => void; + } +} From ca327372d6e390c5406cbab28b90934eaf883093 Mon Sep 17 00:00:00 2001 From: Josh Heyse Date: Wed, 3 Jun 2015 11:58:03 -0500 Subject: [PATCH 0058/2220] added passport-twitter definitions --- passport-twitter/passport-twitter-tests.ts | 25 +++++++++++++++ passport-twitter/passport-twitter.d.ts | 37 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 passport-twitter/passport-twitter-tests.ts create mode 100644 passport-twitter/passport-twitter.d.ts diff --git a/passport-twitter/passport-twitter-tests.ts b/passport-twitter/passport-twitter-tests.ts new file mode 100644 index 0000000000..3abead1b2a --- /dev/null +++ b/passport-twitter/passport-twitter-tests.ts @@ -0,0 +1,25 @@ +/** + * Created by jcabresos on 4/19/2014. + */ +import passport = require('passport'); +import twitter = require('passport-twitter'); + +// just some test model +var User = { + findOrCreate(id:string, provider:string, callback:(err:any, user:any) => void): void { + callback(null, {username:'james'}); + } +} + +passport.use(new twitter.Strategy({ + clientID: process.env.PASSPORT_FACEBOOK_CLIENT_ID, + clientSecret: process.env.PASSPORT_FACEBOOK_CLIENT_SECRET, + callbackURL: process.env.PASSPORT_FACEBOOK_CALLBACK_URL + }, + function(accessToken:string, refreshToken:string, profile:twitter.Profile, done:(error:any, user?:any) => void) { + User.findOrCreate(profile.id, profile.provider, function(err, user) { + if (err) { return done(err); } + done(null, user); + }); + }) +); diff --git a/passport-twitter/passport-twitter.d.ts b/passport-twitter/passport-twitter.d.ts new file mode 100644 index 0000000000..22e292acf0 --- /dev/null +++ b/passport-twitter/passport-twitter.d.ts @@ -0,0 +1,37 @@ +// Type definitions for passport-facebook 1.0.3 +// Project: https://github.com/jaredhanson/passport-facebook +// Definitions by: James Roland Cabresos +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module 'passport-twitter' { + + import passport = require('passport'); + import express = require('express'); + + interface Profile extends passport.Profile { + gender: string; + } + + interface IStrategyOption { + consumerKey: string; + consumerSecret: string; + callbackURL: string; + + reguestTokenURL?: string; + accessTokenURL?: string; + userAuthorizationURL?: string; + sessionKey?: string; + + userProfileURL?: string; + skipExtendedUserProfile?: boolean; + } + + class Strategy implements passport.Strategy { + constructor(options: IStrategyOption, + verify: (accessToken: string, refreshToken: string, profile: Profile, done: (error: any, user?: any) => void) => void); + name: string; + authenticate: (req: express.Request, options?: Object) => void; + } +} From a1915bad2e932a2be44a718818c3b5286793f26c Mon Sep 17 00:00:00 2001 From: Josh Heyse Date: Wed, 3 Jun 2015 12:35:10 -0500 Subject: [PATCH 0059/2220] fixed twitter tests, added _raw and _json properties --- passport-facebook/passport-facebook.d.ts | 3 +++ passport-google-oauth/passport-google-oauth.d.ts | 3 +++ passport-twitter/passport-twitter-tests.ts | 6 +++--- passport-twitter/passport-twitter.d.ts | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/passport-facebook/passport-facebook.d.ts b/passport-facebook/passport-facebook.d.ts index 26479cc296..b3adaf8605 100644 --- a/passport-facebook/passport-facebook.d.ts +++ b/passport-facebook/passport-facebook.d.ts @@ -14,6 +14,9 @@ declare module 'passport-facebook' { gender: string; profileUrl: string; username: string; + + _raw: string; + _json: any; } interface IStrategyOption { diff --git a/passport-google-oauth/passport-google-oauth.d.ts b/passport-google-oauth/passport-google-oauth.d.ts index ea6c1e91a3..27744021fa 100644 --- a/passport-google-oauth/passport-google-oauth.d.ts +++ b/passport-google-oauth/passport-google-oauth.d.ts @@ -12,6 +12,9 @@ declare module 'passport-google-oauth' { interface Profile extends passport.Profile { gender: string; + + _raw: string; + _json: any; } interface IOAuthStrategyOption { diff --git a/passport-twitter/passport-twitter-tests.ts b/passport-twitter/passport-twitter-tests.ts index 3abead1b2a..ae644dfa2a 100644 --- a/passport-twitter/passport-twitter-tests.ts +++ b/passport-twitter/passport-twitter-tests.ts @@ -12,9 +12,9 @@ var User = { } passport.use(new twitter.Strategy({ - clientID: process.env.PASSPORT_FACEBOOK_CLIENT_ID, - clientSecret: process.env.PASSPORT_FACEBOOK_CLIENT_SECRET, - callbackURL: process.env.PASSPORT_FACEBOOK_CALLBACK_URL + consumerKey: process.env.PASSPORT_TWITTER_CONSUMER_KEY, + consumerSecret: process.env.PASSPORT_TWITTER_CONSUMER_SECRET, + callbackURL: process.env.PASSPORT_TWITTER_CALLBACK_URL }, function(accessToken:string, refreshToken:string, profile:twitter.Profile, done:(error:any, user?:any) => void) { User.findOrCreate(profile.id, profile.provider, function(err, user) { diff --git a/passport-twitter/passport-twitter.d.ts b/passport-twitter/passport-twitter.d.ts index 22e292acf0..cb43aad263 100644 --- a/passport-twitter/passport-twitter.d.ts +++ b/passport-twitter/passport-twitter.d.ts @@ -12,6 +12,11 @@ declare module 'passport-twitter' { interface Profile extends passport.Profile { gender: string; + username: string; + + _raw: string; + _json: any; + _accessLevel: string; } interface IStrategyOption { From 60d204c382a6a5126f9708b3848cf783cd535717 Mon Sep 17 00:00:00 2001 From: Vadim Macagon Date: Thu, 4 Jun 2015 16:49:28 +0700 Subject: [PATCH 0060/2220] Extend Mocha typings to allow writing of custom reporters --- mocha/mocha-tests.ts | 34 +++++++ mocha/mocha.d.ts | 230 ++++++++++++++++++++++++++----------------- 2 files changed, 173 insertions(+), 91 deletions(-) diff --git a/mocha/mocha-tests.ts b/mocha/mocha-tests.ts index f90fefaf96..a2e2b07961 100644 --- a/mocha/mocha-tests.ts +++ b/mocha/mocha-tests.ts @@ -249,3 +249,37 @@ function test_run_withOnComplete() { console.log(failures); }); } + +class CustomSpecReporter extends MochaDef.reporters.Spec { + constructor(runner: Mocha.IRunner) { + super(runner); + + runner.on('test', (test: Mocha.ITest) => { + console.log(test.parent.title + '/' + test.title); + }); + } +} + +class MyReporter extends MochaDef.reporters.Base { + passes: number = 0; + failures: number = 0; + + constructor(runner: Mocha.IRunner) { + super(runner); + + runner.on('pass', (test: Mocha.ITest) => { + this.passes++; + console.log('pass: %s', test.fullTitle()); + }); + + runner.on('fail', (test: Mocha.ITest, err: Error) => { + this.failures++; + console.log('fail: %s -- error: %s', test.fullTitle(), err.message); + }); + + runner.on('end', () => { + console.log('end: %d/%d', this.passes, this.passes + this.failures); + process.exit(this.failures); + }); + } +} diff --git a/mocha/mocha.d.ts b/mocha/mocha.d.ts index 63ad66014a..fefd919466 100644 --- a/mocha/mocha.d.ts +++ b/mocha/mocha.d.ts @@ -1,24 +1,9 @@ -// Type definitions for mocha 2.0.1 +// Type definitions for mocha 2.2.5 // Project: http://mochajs.org/ -// Definitions by: Kazi Manzur Rashid , otiai10 , jt000 +// Definitions by: Kazi Manzur Rashid , otiai10 , jt000 , Vadim Macagon // Definitions: https://github.com/borisyankov/DefinitelyTyped -interface Mocha { - // Setup mocha with the given setting options. - setup(options: MochaSetupOptions): Mocha; - - //Run tests and invoke `fn()` when complete. - run(callback?: () => void): void; - - // Set reporter as function - reporter(reporter: () => void): Mocha; - - // Set reporter, defaults to "dot" - reporter(reporter: string): Mocha; - - // Enable growl support. - growl(): Mocha -} +/// interface MochaSetupOptions { //milliseconds to wait before considering a test slow @@ -33,7 +18,7 @@ interface MochaSetupOptions { //array of accepted globals globals?: any[]; - // reporter instance (function or string), defaults to `mocha.reporters.Dot` + // reporter instance (function or string), defaults to `mocha.reporters.Spec` reporter?: any; // bail on the first test failure @@ -45,56 +30,20 @@ interface MochaSetupOptions { // grep string or regexp to filter tests with grep?: any; } - + interface MochaDone { (error?: Error): void; } declare var mocha: Mocha; - -declare var describe: { - (description: string, spec: () => void): void; - only(description: string, spec: () => void): void; - skip(description: string, spec: () => void): void; - timeout(ms: number): void; -} - +declare var describe: Mocha.IContextDefinition; // alias for `describe` -declare var context: { - (contextTitle: string, spec: () => void): void; - only(contextTitle: string, spec: () => void): void; - skip(contextTitle: string, spec: () => void): void; - timeout(ms: number): void; -}; - +declare var context: Mocha.IContextDefinition; // alias for `describe` -declare var suite: { - (suiteTitle: string, spec: () => void): void; - only(suiteTitle: string, spec: () => void): void; - skip(suiteTitle: string, spec: () => void): void; - timeout(ms: number): void; -}; - -declare var it: { - (expectation: string, assertion?: () => void): void; - (expectation: string, assertion?: (done: MochaDone) => void): void; - only(expectation: string, assertion?: () => void): void; - only(expectation: string, assertion?: (done: MochaDone) => void): void; - skip(expectation: string, assertion?: () => void): void; - skip(expectation: string, assertion?: (done: MochaDone) => void): void; - timeout(ms: number): void; -}; - +declare var suite: Mocha.IContextDefinition; +declare var it: Mocha.ITestDefinition; // alias for `it` -declare var test: { - (expectation: string, assertion?: () => void): void; - (expectation: string, assertion?: (done: MochaDone) => void): void; - only(expectation: string, assertion?: () => void): void; - only(expectation: string, assertion?: (done: MochaDone) => void): void; - skip(expectation: string, assertion?: () => void): void; - skip(expectation: string, assertion?: (done: MochaDone) => void): void; - timeout(ms: number): void; -}; +declare var test: Mocha.ITestDefinition; declare function before(action: () => void): void; @@ -128,39 +77,138 @@ declare function suiteTeardown(action: () => void): void; declare function suiteTeardown(action: (done: MochaDone) => void): void; -declare module "mocha" { +declare class Mocha { + constructor(options?: { + grep?: RegExp; + ui?: string; + reporter?: string; + timeout?: number; + bail?: boolean; + }); - class Mocha { - constructor(options?: { - grep?: RegExp; - ui?: string; - reporter?: string; - timeout?: number; - bail?: boolean; - }); + /** Setup mocha with the given options. */ + setup(options: MochaSetupOptions): Mocha; + bail(value?: boolean): Mocha; + addFile(file: string): Mocha; + /** Sets reporter by name, defaults to "spec". */ + reporter(name: string): Mocha; + /** Sets reporter constructor, defaults to mocha.reporters.Spec. */ + reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha; + ui(value: string): Mocha; + grep(value: string): Mocha; + grep(value: RegExp): Mocha; + invert(): Mocha; + ignoreLeaks(value: boolean): Mocha; + checkLeaks(): Mocha; + /** Enables growl support. */ + growl(): Mocha; + globals(value: string): Mocha; + globals(values: string[]): Mocha; + useColors(value: boolean): Mocha; + useInlineDiffs(value: boolean): Mocha; + timeout(value: number): Mocha; + slow(value: number): Mocha; + enableTimeouts(value: boolean): Mocha; + asyncOnly(value: boolean): Mocha; + noHighlighting(value: boolean): Mocha; + /** Runs tests and invokes `onComplete()` when finished. */ + run(onComplete?: (failures: number) => void): Mocha.IRunner; +} - bail(value?: boolean): Mocha; - addFile(file: string): Mocha; - reporter(value: string): Mocha; - ui(value: string): Mocha; - grep(value: string): Mocha; - grep(value: RegExp): Mocha; - invert(): Mocha; - ignoreLeaks(value: boolean): Mocha; - checkLeaks(): Mocha; - growl(): Mocha; - globals(value: string): Mocha; - globals(values: string[]): Mocha; - useColors(value: boolean): Mocha; - useInlineDiffs(value: boolean): Mocha; - timeout(value: number): Mocha; - slow(value: number): Mocha; - enableTimeouts(value: boolean): Mocha; - asyncOnly(value: boolean): Mocha; - noHighlighting(value: boolean): Mocha; - - run(onComplete?: (failures: number) => void): void; +// merge the Mocha class declaration with a module +declare module Mocha { + /** Partial interface for Mocha's `Runnable` class. */ + interface IRunnable extends NodeJS.EventEmitter { + title: string; + fn: Function; + async: boolean; + sync: boolean; + timedOut: boolean; } + /** Partial interface for Mocha's `Suite` class. */ + interface ISuite extends NodeJS.EventEmitter { + parent: ISuite; + title: string; + + fullTitle(): string; + } + + /** Partial interface for Mocha's `Test` class. */ + interface ITest extends IRunnable { + parent: ISuite; + pending: boolean; + + fullTitle(): string; + } + + /** Partial interface for Mocha's `Runner` class. */ + interface IRunner extends NodeJS.EventEmitter {} + + interface IContextDefinition { + (description: string, spec: () => void): ISuite; + only(description: string, spec: () => void): ISuite; + skip(description: string, spec: () => void): void; + timeout(ms: number): void; + } + + interface ITestDefinition { + (expectation: string, assertion?: () => void): ITest; + (expectation: string, assertion?: (done: MochaDone) => void): ITest; + only(expectation: string, assertion?: () => void): ITest; + only(expectation: string, assertion?: (done: MochaDone) => void): ITest; + skip(expectation: string, assertion?: () => void): void; + skip(expectation: string, assertion?: (done: MochaDone) => void): void; + timeout(ms: number): void; + } + + export module reporters { + export class Base { + stats: { + suites: number; + tests: number; + passes: number; + pending: number; + failures: number; + }; + + constructor(runner: IRunner); + } + + export class Doc extends Base {} + export class Dot extends Base {} + export class HTML extends Base {} + export class HTMLCov extends Base {} + export class JSON extends Base {} + export class JSONCov extends Base {} + export class JSONStream extends Base {} + export class Landing extends Base {} + export class List extends Base {} + export class Markdown extends Base {} + export class Min extends Base {} + export class Nyan extends Base {} + export class Progress extends Base { + /** + * @param options.open String used to indicate the start of the progress bar. + * @param options.complete String used to indicate a complete test on the progress bar. + * @param options.incomplete String used to indicate an incomplete test on the progress bar. + * @param options.close String used to indicate the end of the progress bar. + */ + constructor(runner: IRunner, options?: { + open?: string; + complete?: string; + incomplete?: string; + close?: string; + }); + } + export class Spec extends Base {} + export class TAP extends Base {} + export class XUnit extends Base { + constructor(runner: IRunner, options?: any); + } + } +} + +declare module "mocha" { export = Mocha; } From f844c0947a137399b8fb0e7135613b9e68797e16 Mon Sep 17 00:00:00 2001 From: Aurelien Souchet Date: Thu, 4 Jun 2015 16:35:13 +0200 Subject: [PATCH 0061/2220] added new pickers interface / methods to WinRT --- winrt/winrt.d.ts | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index ed4f33e773..8671e62e08 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -44,6 +44,17 @@ declare module Windows { clear(): void; first(): Windows.Foundation.Collections.IIterator>; } + export class ValueSet implements Windows.Foundation.Collections.IPropertySet, Windows.Foundation.Collections.IObservableMap, Windows.Foundation.Collections.IMap, Windows.Foundation.Collections.IIterable> { + size: number; + onmapchanged: any/* TODO */; + lookup(key: string): any; + hasKey(key: string): boolean; + getView(): Windows.Foundation.Collections.IMapView; + insert(key: string, value: any): boolean; + remove(key: string): void; + clear(): void; + first(): Windows.Foundation.Collections.IIterator>; + } export interface IIterable { first(): Windows.Foundation.Collections.IIterator; } @@ -7940,7 +7951,7 @@ declare module Windows { control: Windows.Networking.Sockets.MessageWebSocketControl; information: Windows.Networking.Sockets.MessageWebSocketInformation; onmessagereceived: any/* TODO */; - close(): void; + close(): void; close(code: number, reason: string): void; } export class MessageWebSocketControl implements Windows.Networking.Sockets.IMessageWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { @@ -7980,7 +7991,7 @@ declare module Windows { control: Windows.Networking.Sockets.StreamWebSocketControl; information: Windows.Networking.Sockets.StreamWebSocketInformation; inputStream: Windows.Storage.Streams.IInputStream; - close(): void; + close(): void; close(code: number, reason: string): void; } export class StreamWebSocketControl implements Windows.Networking.Sockets.IStreamWebSocketControl, Windows.Networking.Sockets.IWebSocketControl { @@ -10986,6 +10997,11 @@ declare module Windows { pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; } + export interface IFileOpenPicker2 { + continuationData: Windows.Foundation.Collections.ValueSet; + pickMultipleFilesAndContinue(): void; + pickSingleFileAndContinue(): void; + } export interface IFileSavePicker { commitButtonText: string; defaultFileExtension: string; @@ -10996,6 +11012,10 @@ declare module Windows { suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } + export interface IFileSavePicker2 { + continuationData: Windows.Foundation.Collections.ValueSet; + pickSaveFileAndContinue(): void; + } export interface IFolderPicker { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; @@ -11004,16 +11024,23 @@ declare module Windows { viewMode: Windows.Storage.Pickers.PickerViewMode; pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; } - export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker { + export interface IFolderPicker2 { + continuationData: Windows.Foundation.Collections.ValueSet; + pickFolderAndContinue(): void; + } + export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker, Windows.Storage.Pickers.IFileOpenPicker2 { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; + continuationData: Windows.Foundation.Collections.ValueSet; + pickSingleFileAndContinue(): void; pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; + pickMultipleFilesAndContinue(): void; pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; } - export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker { + export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker, Windows.Storage.Pickers.IFileSavePicker2 { commitButtonText: string; defaultFileExtension: string; fileTypeChoices: Windows.Foundation.Collections.IMap>; @@ -11021,14 +11048,18 @@ declare module Windows { suggestedFileName: string; suggestedSaveFile: Windows.Storage.StorageFile; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; + continuationData: Windows.Foundation.Collections.ValueSet; + pickSaveFileAndContinue(): void; pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } - export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker { + export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker, Windows.Storage.Pickers.IFolderPicker2 { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; + continuationData: Windows.Foundation.Collections.ValueSet; + pickFolderAndContinue(): void; pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; } } @@ -14750,4 +14781,4 @@ declare module Windows.Foundation { dispatchEvent?(type: string, details: any): boolean; removeEventListener?(eventType: string, listener: Function, capture?: boolean): void; } -} +} \ No newline at end of file From 18e1d3ad8c7b38e86ec6531c3f7308172a302072 Mon Sep 17 00:00:00 2001 From: Yaron Librach Date: Fri, 5 Jun 2015 01:06:34 -0400 Subject: [PATCH 0062/2220] Update definitions and tests to 1.0.1 spec. --- oclazyload/oclazyload-tests.ts | 106 +++++++++++++++++++---- oclazyload/oclazyload.d.ts | 153 +++++++++++++++++++++++++++++---- 2 files changed, 223 insertions(+), 36 deletions(-) diff --git a/oclazyload/oclazyload-tests.ts b/oclazyload/oclazyload-tests.ts index 3879a564b3..d3d3d6b119 100644 --- a/oclazyload/oclazyload-tests.ts +++ b/oclazyload/oclazyload-tests.ts @@ -1,23 +1,95 @@ /// -var lazyloader:Function = ()=>{}; +angular.module('app', ['oc.lazyLoad']).config(['$ocLazyLoadProvider', function ($ocLazyLoadProvider: oc.ILazyLoadProvider) { + $ocLazyLoadProvider.config({ + debug: true, + events: true, + modules: [{ + name: 'TestModule', + files: ['js/TestModule.js'] + }] + }) +}]); -var config1: oc.ILazyLoadConfig = { - asyncLoader: lazyloader -}; +angular.module('app').controller(['$ocLazyLoadProvider', function ($ocLazyLoad: oc.ILazyLoad) { + $ocLazyLoad.load('testModule.js'); -var config2:oc.ILazyLoadConfig = { - asyncLoader: lazyloader, - loadedModules: ['module1', 'module2'] -}; + $ocLazyLoad.load(['testModule.js', 'testModuleCtrl.js', 'testModuleService.js']); -var moduleConfig:oc.ILazyLoadModuleConfig = { - name:'testmodule', - files:['testmodule'] -} + $ocLazyLoad.load([ + 'testModule.js', + { + type: 'css', + path: 'testModuleCtrl' + }, + { + type: 'html', + path: 'testModuleCtrl.html' + }, + { + type: 'js', + path: 'testModuleCtrl' + }, + 'js!testModuleService', + 'less!testModuleLessFile' + ]); -var config2:oc.ILazyLoadConfig = { - asyncLoader: lazyloader, - loadedModules: ['module1', 'module2'], - modules: [moduleConfig] -}; + $ocLazyLoad.load([ + { + files: [ + 'testModule.js', + 'bower_components/bootstrap/dist/js/bootstrap.js' + ], + cache: false, + kjdf: false + }, + { + files: ['anotherModule.js'], + cache: true + } + ]); + + $ocLazyLoad.load( + [ + 'testModule.js', + 'bower_components/bootstrap/dist/js/bootstrap.js', + 'anotherModule.js' + ], + { + cache: false + }); + + $ocLazyLoad.load( + [ + 'partials/template1.html', + 'partials/template2.html' + ], + { + cache: false, + reconfig: true, + rerun: true, + serie: true, + insertBefore: '#load_css_before', + timeout: 5000 + }); + + $ocLazyLoad.setModuleConfig({ + files: [ + 'testModule.js' + ], + cache: true + }); + + var getConfig: oc.IModuleConfig = $ocLazyLoad.getModuleConfig('testModule'); + + var getModules: string[] = $ocLazyLoad.getModules(); + + var isLoaded: boolean = $ocLazyLoad.isLoaded([ + 'testModule1.js', + 'testModule2.js' + ]); + + $ocLazyLoad.inject('testModule'); + + $ocLazyLoad.toggleWatch(true); +}]); \ No newline at end of file diff --git a/oclazyload/oclazyload.d.ts b/oclazyload/oclazyload.d.ts index 22ac45f9d9..1acf7e7819 100644 --- a/oclazyload/oclazyload.d.ts +++ b/oclazyload/oclazyload.d.ts @@ -7,28 +7,143 @@ declare module oc { - interface ILazyLoadConfig { - asyncLoader:any; - loadedModules?:string[]; - modules?:ILazyLoadModuleConfig[]; - } - - interface ILazyLoadModuleConfig { - name:string; - files:string[]; - } - interface ILazyLoad { - load(module:any):ng.IPromise; - loadTemplateFile(url:string, config:ILazyLoadModuleConfig):ng.IPromise; - loadTemplateFile(urls:string[], config:ILazyLoadModuleConfig):ng.IPromise; - getModuleName(moduleName:string):string; - getModules():string[]; - getModuleConfig(name:string):ILazyLoadModuleConfig; - setModuleConfig(config:ILazyLoadModuleConfig):void; + /** + * Loads a module or a list of modules into Angular. + * + * @param module The name of a predefined module config object, or a module config object, or an array of either + * @param config Options to be used when loading the modules + */ + load(module: string|ITypedModuleConfig|IModuleConfig|(string|ITypedModuleConfig|IModuleConfig)[], config?: IOptionsConfig): ng.IPromise; + + /** + * Defines a module config object. + * @param config The module config object + * @returns The module config object that was passed in + */ + setModuleConfig(config: IModuleConfig): IModuleConfig; + + /** + * Gets the specified module config object. + * @param name The name of the module config object to get + */ + getModuleConfig(name: string): IModuleConfig; + + /** + * Gets the list of loaded module names. + */ + getModules(): string[]; + + /** + * Checks if a module name, or list of modules names, has been previously loaded into Angular. + */ + isLoaded(moduleName: string|string[]): boolean; + + /** + * Injects a module with the associated name into Angular. Useful for manual injection when loading through RequireJS, SystemJS, etc. Useful in + * conjunction with the toggleWatch() method. + */ + inject(moduleName: string|string[]): boolean; + + /** + * Enables or disables watching Angular for new modules. Useful in conjunction with the inject() method. Make sure to not keep the watch enabled + * indefinitely, or unexpected results may occur. + */ + toggleWatch(watch: boolean): void; + } + + interface ITypedModuleConfig extends IOptionsConfig { + /** + * The file extension, without the period. For example, 'html'. + */ + type: string; + + /** + * The file path, including file name. + */ + path: string; + } + + interface IModuleConfig extends IOptionsConfig { + /** + * The name of the module for easy retrieval later. + */ + name?: string; + + /** + * The list of files to be loaded for this module. + */ + files: string[]; + } + + interface IOptionsConfig extends ng.IRequestShortcutConfig { + /** + * If true, bypasses browser cache by appending a timestamp to URLs. Defaults to true. + */ + cache?: boolean; + + /** + * If true, a module config will be invoked each time the module is reloaded. Use with caution, as re-invoking configs can lead to unexpected results. + * Defaults to false. + */ + reconfig?: boolean; + + /** + * If true, a module run block will be invoked each time the module is reloaded. Use with caution, as re-invoking run blocks can lead to unexpected results. + * Defaults to false. + */ + rerun?: boolean; + + /** + * If true, will load files in a series, instead of in parallel. Defaults to false. + */ + serie?: boolean; + + /** + * If set, will insert files immediately before the provided CSS selector, instead of the default behavior of inserting files immediately before the + * last child of the element. Defaults to undefined. + */ + insertBefore?: string; } interface ILazyLoadProvider { - config(config:ILazyLoadConfig):void; + /** + * Configures the main service provider. + * @param config The configuration settings to use + */ + config(config: IProviderConfig): void; + } + + interface IProviderConfig { + /** + * If true, all errors will be logged to the console, in addition to rejecting a promise. Defaults to false. + */ + debug?: boolean; + + /** + * If true, an event will be broadcast whenever a module, component or file is loaded. Events that can be broadcast are: ocLazyLoad.moduleLoaded, + * ocLazyLoad.moduleReloaded, ocLazyLoad.componentLoaded, ocLazyLoad.fileLoaded. Defaults to false. + */ + events?: boolean; + + /** + * Predefines a set of module configurations for later use. A name must be provided for each module so that it can be retrieved later. + */ + modules?: IModuleConfig[]; + } +} + +declare module angular { + interface IAngularStatic { + /** + * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism. + * + * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved. + * + * @param name The name of the module to create or retrieve. + * @param requires The names of modules this module depends on, and/or ocLazyLoad module configurations. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration. + * @param configFn Optional configuration function for the module. + */ + module(name: string, requires?: (string|oc.IModuleConfig)[], configFn?: Function): IModule; } } \ No newline at end of file From 8f9ff607f0a79e5a976682d00ce156781f9efd19 Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Sat, 6 Jun 2015 16:26:00 +0800 Subject: [PATCH 0063/2220] moment: Use type alias for moment-like parameters --- moment/moment-node.d.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index eaacb8855f..f491833f9d 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -216,8 +216,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: Moment|string|number|Date|number[], suffix?: boolean): string; - to(f: Moment|string|number|Date|number[], suffix?: boolean): string; + from(f: MomentLike, suffix?: boolean): string; + to(f: MomentLike, suffix?: boolean): string; diff(b: Moment): number; diff(b: Moment, unitOfTime: string): number; @@ -240,13 +240,13 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBefore(b: MomentLike, granularity?: string): boolean; isAfter(): boolean; - isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isAfter(b: MomentLike, granularity?: string): boolean; - isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; - isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; + isSame(b: MomentLike, granularity?: string): boolean; + isBetween(a: MomentLike, b: MomentLike, granularity?: string): boolean; // Deprecated as of 2.8.0. lang(language: string): Moment; @@ -262,11 +262,11 @@ declare module moment { localeData(): MomentLanguage; // Deprecated as of 2.7.0. - max(date: Moment|string|number|Date|any[]): Moment; + max(date: MomentLike|any[]): Moment; max(date: string, format: string): Moment; // Deprecated as of 2.7.0. - min(date: Moment|string|number|Date|any[]): Moment; + min(date: MomentLike|any[]): Moment; min(date: string, format: string): Moment; get(unit: string): number; @@ -439,6 +439,9 @@ declare module moment { } + // Moment.js automatically converts datetime parameters from a number of types + type MomentLike = Moment | string | number | Date | number[]; + } declare module 'moment' { From c4d7013d2c2084c290a751d6bfcfcd3f1a753e05 Mon Sep 17 00:00:00 2001 From: Dustin Wehr Date: Sat, 6 Jun 2015 23:35:38 -0400 Subject: [PATCH 0064/2220] Sufficiently complete for basic use of the API. Needs additions for multiple collaborators and some other things, which will be added in the coming months. --- google-realtime/google-realtime.d.ts | 521 +++++++++++++++++++++++++++ google-realtime/library-tests.ts | 196 ++++++++++ 2 files changed, 717 insertions(+) create mode 100644 google-realtime/google-realtime.d.ts create mode 100644 google-realtime/library-tests.ts diff --git a/google-realtime/google-realtime.d.ts b/google-realtime/google-realtime.d.ts new file mode 100644 index 0000000000..b72471a045 --- /dev/null +++ b/google-realtime/google-realtime.d.ts @@ -0,0 +1,521 @@ +// Type definitions for Google Realtime API +// Project: https://developers.google.com/google-apps/realtime/ +// Definitions by: Dustin Wehr +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// For Typescript newbs: To get shorter names, use e.g. +// type CollabModel = googleRealtime.Model; +// interface CollabList extends googleRealtime.CollaborativeList {} +// See section "Type Aliases" of http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf + +// Note the occurrences of "INCOMPLETE". For some interfaces and object types, I have only included +// the properties and methods that I've actually used so-far, and will add more as they become useful to me. +// Or, maybe you want to complete them? + +declare module googleRealtime { + + type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeObject + export class CollaborativeObject { + // The id of this collaborative object. Read-only. + id:string; + + // The type of this collaborative object. For standard collaborative objects, + // 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; + + // 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 + // when the event is dispatched. + addEventListener(type:string, listener: GoogEventHandler, opt_capture?:boolean):void; + + // Removes all event listeners from this object. + removeAllEventListeners():void; + + // Removes an event listener from the event target. The handler must be the same object as the one added. + // If the handler has not been added then nothing is done. + removeEventListener(type:string, listener: GoogEventHandler, opt_capture?:boolean):void; + + // Returns a string representation of this collaborative object. + toString():string; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.IndexReference + export class IndexReference extends CollaborativeObject { + // (Categories of) the shift behavior of an index reference when the element it points at is deleted. + static DeleteMode:{ + SHIFT_AFTER_DELETE: string + SHIFT_BEFORE_DELETE: string + SHIFT_TO_INVALID: string + }; + + //The index of the current location the reference points to. Write to this property to change the referenced index. + index:number; + + // The behavior of this index reference when the element it points at is deleted. + // @return one of the elements of DeleteMode + deleteMode():string; + + // The object this reference points to. Read-only. + referencedObject():V; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeMap + export class CollaborativeMap extends CollaborativeObject { + size:string; + + static type:string; // equals "Map" + + // Removes all entries. + clear():void; + + // Removes the entry for the given key (if such an entry exists). + // @return the value that was mapped to this key, or null if there was no existing value. + delete(key:string):V; + + // Returns the value mapped to the given key. + get(key:string):V; + + // Checks if this map contains an entry for the given key. + has(key:string):boolean; + + // Returns whether this map is empty. + isEmpty():boolean; + + // Returns an array containing a copy of the items in this map. Modifications to the returned array do + // not modify this collaborative map. + // @return non-null Array of Arrays, where the inner arrays are tupples [string, V] + items():[string,V][]; + + // Returns an array containing a copy of the keys in this map. Modifications to the returned array + // do not modify this collaborative map. + keys():string[]; + + // Put the value into the map with the given key, overwriting an existing value for that key. + // @return the old map value, if any, that used to be mapped to the given key. + set(key:string, value:V):V; + + // Returns an array containing a copy of the values in this map. Modifications to the returned array + // do not modify this collaborative map. + values():V[]; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeString + export class CollaborativeString extends CollaborativeObject { + // The length of the string. Read only. + length:number; + + // 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" + + // Appends a string to the end of this one. + append(text:string):void; + + // Gets a string representation of the collaborative string. + getText():string; + + // Inserts a string into the collaborative string at a specific index. + insertString(index:number, text:string):void; + + // Creates an IndexReference at the given {@code index}. If {@code canBeDeleted} is set, then a delete + // over the index will delete the reference. Otherwise the reference will shift to the beginning of the deleted range. + registerReference(index:number, canBeDeleted:boolean):IndexReference; + + // Deletes the text between startIndex (inclusive) and endIndex (exclusive). + removeRange(startIndex:number, endIndex:number):void; + + // Sets the contents of this collaborative string. Note that this method performs a text diff between the + // current string contents and the new contents so that the string will be modified using the minimum number + // of text inserts and deletes possible to change the current contents to the newly-specified contents. + setText(text:string):void; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeList + export class CollaborativeList extends CollaborativeObject { + // The number of entries in the list. Assign to this field to reduce the size of the list. + // Note that the length given must be less than or equal to the current size. + // The length of a list cannot be extended in this way. + length:number; + + static type:string; // equals "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. + asArray():V[]; + + // Removes all values from the list. + clear():void; + + // Gets the value at the given index. + get(ind:number):V; + + //Returns the first index of the given value, or -1 if it cannot be found. + indexOf(value:V, opt_comparatorFn?:(x1:V, x2:V) => boolean):number; + + //Inserts an item into the list at a given index. + insert(index:number, value:V):void; + + // Inserts a list of items into the list at a given index. + insertAll(index:number, values:V[]):void; + + // Returns the last index of the given value, or -1 if it cannot be found. + lastIndexOf(value:V, opt_comparatorFn?:(x1:V, x2:V) => boolean):number; + + //Moves a single element in this list (at index) to immediately before destinationIndex. + //Both indices are with respect to the position of elements before the move. + //For example, given the list: ['A', 'B', 'C'] + //move(0, 0) is a no-op + //move(0, 1) is a no-op + //move(0, 2) yields ['B', 'A', 'C'] ('A' is moved to immediately before 'C') + //move(0, 3) yields ['B', 'C', 'A'] ('A' is moved to immediately before an imaginary element after the list end) + //move(1, 0) yields ['B', 'A', 'C'] ('B' is moved to immediately before 'A') + //move(1, 1) is a no-op + //move(1, 2) is a no-op + //move(1, 3) yields ['A', 'C', 'B'] ('B' is moved to immediately before an imaginary element after the list end) + move(index:number, destinationIndex:number):void; + + // Moves a single element in this list (at index) to immediately before destinationIndex in the list destination. + // Both indices are with respect to the position of elements before the move. + // If the provided destination is this list, this function is identical to move(index, destinationIndex). + moveToList(index:number, destination:CollaborativeList, destinationIndex:number):void; + + // Adds an item to the end of the list. + // @return the new length of the list + push(value:V):number; + + // Adds an array of values to the end of the list. + pushAll(values:V[]):void; + + // Creates an IndexReference at the given index. If canBeDeleted is true, then a delete over the index will delete + // the reference. Otherwise the reference will shift to the beginning of the deleted range. + registerReference(index:number, canBeDeleted:boolean):IndexReference>; + + // Removes the item at the given index from the list. + remove(index:number):void; + + // Removes the items between startIndex (inclusive) and endIndex (exclusive). + removeRange(startIndex:number, endIndex:number):void; + + // Removes the first instance of the given value from the list. + // @return whether the item was removed + removeValue(value:V):boolean; + + // Replaces items in the list with the given items, starting at the given index. + replaceRange(index:number, values:V[]):void; + + // Sets the item at the given index + set(index:number, value:V):void; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Model + export class Model { + + // Returns the collaborative object with the given id. + // @return non-null Object + getObject:any; + + // An estimate of the number of bytes used by data stored in the model. + bytesUsed:number; + + // True if the model can currently redo. + canRedo:boolean; + + // True if the model can currently undo. + canUndo:boolean; + + // Creates the native JS object for a given collaborative object type. + // @return non-null Object + createJsObject(typeName:string):any; + + // 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 when the event is dispatched. + addEventListener(type:string, listener:() => void | EventListener, opt_capture?:boolean):void; + + // Starts a compound operation. If a name is given, that name will be recorded in the mutation for use in revision + // history, undo menus, etc. When beginCompoundOperation() is called, all subsequent edits to the data model will + // be batched together in the undo stack and revision history until endCompoundOperation() is called. + // Compound operations may be nested inside other compound operations. + // If the root compound operation is undoable, all nested compound operations must be undoable as well. + // If the root compound operation is non-undoable, nested operations can be undoable, although the entire operation + // will obey the root's opt_isUndoable value. + // Note that the compound operation MUST start and end in the same synchronous execution block. If this invariant + // is violated, the data model will become invalid and all future changes will fail. + beginCompoundOperation(opt_name?:string, opt_isUndoable?:boolean):void; + + + // Creates and returns a new collaborative object. This can be used to create custom collaborative objects. + // For built in types, use the specific create* functions. + // @return non-null Object + create(ref:string|Function, ...var_args:any[]):any; + + // Creates a collaborative list. + createList(opt_initialValue?:Array):CollaborativeList; + + // Creates a collaborative map. + createMap(opt_initialValue?:Array<[string,T]>):CollaborativeMap; + + // Creates a collaborative string. + createString(opt_initialValue?:string):CollaborativeString; + + //Ends a compound operation. This method will throw an exception if no compound operation is in progress. + endCompoundOperation():void; + + // Returns the root of the object model. + getRoot():CollaborativeMap; + + // The mode of the document. If true, the document is read-only. If false, it is editable. + isReadOnly():boolean; + + // Redo the last thing the active collaborator undid. + redo():void; + + // Removes all event listeners from this object. + removeAllEventListeners():void; + + // Removes an event listener from the event target. The handler must be the same object as the one added. + // If the handler has not been added then nothing is done. + removeEventListener(type:string, listener:() => void | EventListener, opt_capture?:boolean):void; + + // The current server revision number for this model. The revision number begins at 1 (the initial empty model) + // and is incremented each time the model is changed on the server (either by the current session or any + // other collaborator). Because this revision number includes only changes that the server knows about, + // it is only updated while this client is connected to the Realtime API server and it does not include changes + // that have not yet been saved to the server. + serverRevision():number; + + // Serializes this data model to a JSON-based format which is compatible with the Realtime API's import/export + // REST API. The exported JSON can also be used with gapi.drive.realtime.loadFromJson to load an in-memory + // version of this data model which does not require a network connection. + // See https://developers.google.com/drive/v2/reference/realtime/update for more information. + toJson(opt_appId?:string, opt_revision?:number):string; + + // Undo the last thing the active collaborator did. + undo():void; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.BaseModelEvent + interface BaseModelEvent { + // Whether this event bubbles. + bubbles : boolean; + + // The list of names from the hierarchy of compound operations that initiated this event. + compoundOperationNames : string[]; + + // True if this event originated in the local session. + isLocal : boolean; + + // True if this event originated from a redo call. + isRedo : boolean; + + // True if this event originated from an undo call. + isUndo : boolean; + + // Prevents an event from performing its default action. In the Realtime API, this function is only present + // for compatibility with the DOM event interface and therefore it does nothing. + preventDefault() : void; + + // The id of the session that initiated this event. + sessionId : string; + + // The collaborative object that initiated this event. + target : Object; + + // The type of the event. + type : string; + + // The user id of the user that initiated this event. + userId : string; + + // Stops an event which bubbles from propagating to the target's parent. + stopPropagation() : void; + + /* Parameters: + target + gapi.drive.realtime.CollaborativeObject + The collaborative object that initiated the event. + Value must not be null. + + sessionId + string + The id of the session that initiated the event. + + userId + string + The user id of the user that initiated the event. + + compoundOperationNames + 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. + + isUndo + boolean + True if the event originated from an undo call. + + isRedo + boolean + True if the event originated from a redo call. + */ + new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames: string[], + isLocal:boolean, isUndo:boolean, isRedo:boolean) : BaseModelEvent; + } + + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.ObjectChangedEvent + interface ObjectChangedEvent extends BaseModelEvent { + // parameters as in BaseModelEvent above except for addition of: + // events: + // Array of gapi.drive.realtime.BaseModelEvent + // The specific events that document the changes that occurred on the object. + // Value must not be null. + new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames: string[], + isLocal:boolean, isUndo:boolean, isRedo:boolean, events:BaseModelEvent[]) : ObjectChangedEvent; + + // The specific events that document the changes that occurred on the object. + events : BaseModelEvent[]; + } + + + // INCOMPLETE + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Document + export class Document { + // Gets the collaborative model associated with this document. + // @return non-null Model + getModel():Model; + + // Closes the document and disconnects from the server. + // After this function is called, event listeners will no longer fire and attempts to access the document, model, + // or model objects will throw a gapi.drive.realtime.DocumentClosedError. + // Calling this function after the document has been closed will have no effect. + close():void; + } + + // *********************************** + // 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 + // https://apis.google.com/js/api.js + // *********************************** + + + // Complete + export interface LoaderOptions { + // Your Application ID from the Google APIs Console. + appId: string; + + // Autocreate files right after auth automatically. + autoCreate: boolean; + + // Client ID from the console. + clientId: string; + + // The ID of the button to click to authorize. Must be a DOM element ID. + authButtonElementId: string; + + // The MIME type of newly created Drive Files. By default the application + // specific MIME type will be used: + // application/vnd.google-apps.drive-sdk. + newFileMimeType: string; + //newFileMimeType = null // default + + // Function to be called to initialize custom Collaborative Objects types. + registerTypes: () => void; + + // The name of newly created Drive files, if no title is specified. + defaultTitle: string; + + // Function to be called after authorization and before loading files. + afterAuth: () => void; + + // Function to be called when a Realtime model is first created. + initializeModel: (model:Model) => void; + + // Function to be called every time a Realtime file is loaded. + onFileLoaded: (rtdoc:Document) => void; + } + + // INCOMPLETE + export interface DriveAPIFileResource { + id: string; + } + + // INCOMPLETE + export interface RealtimeLoader { + start():void; + load():void; + } + interface RealtimeLoaderFactory { + new (options:googleRealtime.LoaderOptions) : RealtimeLoader; + } + + // INCOMPLETE + export interface ClientUtils { + // INCOMPLETE + params: { + // string containing one or more file ids separated by spaces. + fileIds : string + }; + RealtimeLoader : RealtimeLoaderFactory; + + /** + * Creates a new Realtime file. + * @param title {string} title of the newly created file. + * @param mimeType {string} the MIME type of the new file. + * @param callback {(file:DriveAPIFileResource) => void} the callback to call after creation. + */ + createRealtimeFile(title:string, mimeType:string, callback:(file:DriveAPIFileResource) => void) : void; + } + + // COMPLETE + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.databinding.Binding + export interface Binding { + // Throws gapi.drive.realtime.databinding.AlreadyBoundError If domElement has already been bound. + + // The collaborative object to bind. + collaborativeObject : CollaborativeObject; + + // The DOM element that the collaborative object is bound to. Value must not be null. + domElement : Element; + + // Unbinds the domElement from collaborativeObject. + unbind() : void; + } + + export interface GoogleAPI { + drive : { + realtime : { + databinding : { + bindString(s:googleRealtime.CollaborativeString, textinput:HTMLInputElement) : googleRealtime.Binding; + } + EventType : { + TEXT_INSERTED: string; + TEXT_DELETED: string; + OBJECT_CHANGED: string; + } + } + } + } + +} + +// global var introduced by realtime-client-utils.js +declare var rtclient:googleRealtime.ClientUtils; + +// global var introduced by https://apis.google.com/js/api.js +declare var gapi: googleRealtime.GoogleAPI; \ No newline at end of file diff --git a/google-realtime/library-tests.ts b/google-realtime/library-tests.ts new file mode 100644 index 0000000000..5adc8184af --- /dev/null +++ b/google-realtime/library-tests.ts @@ -0,0 +1,196 @@ +/// + +// Don't use this as a reference. Use the examples at +// https://developers.google.com/google-apps/realtime/ +// To use the Realtime API effectively, I needed to read lots of the +// (well-written) documentation on the site, and to understand parts of +// realtime-client-utils.js +// which you can find in the tutorial section of the project's homepage. + +declare var $ : any; +interface JQuery { + [key: string]: any; +}; + +type CollabModel = googleRealtime.Model; +type CollabDoc = googleRealtime.Document; +interface CollaborativeObject extends googleRealtime.CollaborativeObject {} +interface CollaborativeList extends googleRealtime.CollaborativeList {} +interface CollaborativeMap extends googleRealtime.CollaborativeMap {} +interface IndexReference extends googleRealtime.IndexReference {} +interface CollaborativeString extends googleRealtime.CollaborativeString {} + +type CListOfCObj = CollaborativeList +type CObjOrStr = CollaborativeObject | string; +type CMapOfCObjOrStr = CollaborativeMap; + + +module GRealtime { + + + + + var default_loader_options : googleRealtime.LoaderOptions = { + // Your Application ID from the Google APIs Console. + appId: "YOUR_APP_ID", + + // This tells us if need to we automatically create a file after auth. + autoCreate: false, + + // Client ID from the console. + clientId: 'YOUR_CLIENT_ID.apps.googleusercontent.com', + + // The ID of the button to click to authorize. Must be a DOM element ID. + authButtonElementId: 'realtime-authorize-button', + + // The MIME type of newly created Drive Files. By default the application + // specific MIME type will be used: + // application/vnd.google-apps.drive-sdk. + //newFileMimeType: 'text/json', + newFileMimeType: 'text', + //newFileMimeType: null, // default + + // Function to be called to initialize custom Collaborative Objects types. + registerTypes: null, // No action + + defaultTitle: "Default default-doc-title", + + // The rest are only defaults + afterAuth: function() : void { + console.log("default afterAuth called") + }, + + initializeModel: function(rtmodel:CollabModel) : void { + console.log("default initializeModel called"); + }, + + onFileLoaded : function(rtdoc:CollabDoc) : void { + console.log("default onFileLoaded called"); + } + + }; + + export class MyRTLoader { + public loader_options : googleRealtime.LoaderOptions = $.extend({},default_loader_options); + private rtloader_client : googleRealtime.RealtimeLoader; + + // call after setting loader_options appropriately + authorize() { + this.rtloader_client = new rtclient.RealtimeLoader(this.loader_options); + this.rtloader_client.start(); + } + + createNew(title:string, callback: (file:any) => void) { + rtclient.createRealtimeFile(title, null, callback); + } + + loadAfterAuth(fileid:string) { + // use this as part of your afterAuth callback + rtclient.params.fileIds = fileid; + this.rtloader_client.load(); + } + } + + export class MyRealtimeDoc { + protected rtmodel: CollabModel; + protected rtdoc: CollabDoc; + private myRTLoader = new GRealtime.MyRTLoader(); + + newFile(title: string, + initializeModel: (x:CollabModel) => void, + onFileLoaded: (x:CollabDoc) => void) : void { + + var _afterAuth = () => { + this.myRTLoader.createNew(title, (file:googleRealtime.DriveAPIFileResource) => { + console.log(`\n\nThis is the createNew callback. New file's id: ${file.id}\n\n`); + $("#file-id-text-input").val(file.id); + this.myRTLoader.loadAfterAuth(file.id) + }) + } + + var _initializeModel = (model:CollabModel) => { + console.log("\n\nRTModel initialized for NEW document.\n\n"); + this.rtmodel = model; + if( initializeModel ) { + initializeModel(model); + } + } + + var _onFileLoaded = (doc:CollabDoc) => { + console.log("\n\nNEW document loaded.\n\n"); + this.rtmodel = doc.getModel(); + this.rtdoc = doc; + if( onFileLoaded ) { + onFileLoaded(doc); + } + } + + this.myRTLoader.loader_options.onFileLoaded = _onFileLoaded; + this.myRTLoader.loader_options.afterAuth = _afterAuth; + this.myRTLoader.loader_options.initializeModel = _initializeModel; + this.myRTLoader.authorize(); + } + + loadExisting(fileid: string, + onFileLoaded: (doc:CollabDoc) => void) : void { + + rtclient.params.fileIds = fileid; + + var _onFileLoaded = (doc:CollabDoc) => { + console.log("\n\nEXISTING document loaded.\n\n"); + this.rtdoc = doc; + this.rtmodel = doc.getModel(); + if( onFileLoaded ) { + onFileLoaded(doc); + } + }; + + this.myRTLoader.loader_options.onFileLoaded = _onFileLoaded; + //this.myRTLoader.loader_options.afterAuth = ... + this.myRTLoader.authorize(); + } + + createString() : CollaborativeString { return this.rtmodel.createString(""); } + + createList() : CollaborativeList { return this.rtmodel.createList(); } + + createMap() : CollaborativeMap { return this.rtmodel.createMap(); } + + addToPersistDocRoot(x:{pdata:any}, key:string) { + this.rtmodel.getRoot().set(key,x.pdata); + } + + bindString(istring:CollaborativeString, $textinput: JQuery) : googleRealtime.Binding { + return gapi.drive.realtime.databinding.bindString( + istring, + $textinput[0] ); + } + + + } + + // alternative to RealtimePSDoc.bindString + function registerLocalStringChangeListener( + x: CollaborativeString, + listener_or_callback: (e:Event) => void | EventListener) : void { + x.addEventListener(gapi.drive.realtime.EventType.TEXT_INSERTED, listener_or_callback); + x.addEventListener(gapi.drive.realtime.EventType.TEXT_DELETED, listener_or_callback); + } + +} + + +// Next example from https://developers.google.com/google-apps/realtime/model-events + +declare var doc : CollabDoc; +function displayObjectChangedEvent(evt:googleRealtime.ObjectChangedEvent) { + var events = evt.events; + var eventCount = evt.events.length; + for (var i = 0; i < eventCount; i++) { + console.log('Event type: ' + events[i].type); + console.log('Local event: ' + events[i].isLocal); + console.log('User ID: ' + events[i].userId); + console.log('Session ID: ' + events[i].sessionId); + } +} +doc.getModel().getRoot().addEventListener(gapi.drive.realtime.EventType.OBJECT_CHANGED, displayObjectChangedEvent); \ No newline at end of file From 1ffa82132b1eb541e9560c47199153a393748191 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 7 Jun 2015 09:43:00 +0200 Subject: [PATCH 0065/2220] First take on the api of xmlbuilder --- xmlbuilder/xmlbuilder.d.ts | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 xmlbuilder/xmlbuilder.d.ts diff --git a/xmlbuilder/xmlbuilder.d.ts b/xmlbuilder/xmlbuilder.d.ts new file mode 100644 index 0000000000..9fee2a85ba --- /dev/null +++ b/xmlbuilder/xmlbuilder.d.ts @@ -0,0 +1,80 @@ +declare class XMLDocType { + clone(): XMLDocType; + element(name, value): XMLDocType; + attList(elementName, attributeName, attributeType, defaultValueType, defaultValue): XMLDocType; + entity(name, value): XMLDocType; + pEntity(name, value): XMLDocType; + notation(name, value): XMLDocType; + cdata(value): XMLDocType; + comment(value): XMLDocType; + instruction(target, value): XMLDocType; + root(): XMLDocType; + document(): any; + toString(options, level): string; + + ele(name, value): XMLDocType; + att(elementName, attributeName, attributeType, defaultValueType, defaultValue): XMLDocType; + ent(name, value): XMLDocType; + pent(name, value): XMLDocType; + not(name, value): XMLDocType; + dat(value): XMLDocType; + com(value): XMLDocType; + ins(target, value): XMLDocType; + up(): XMLDocType; + doc(): any; +} + +declare class XMLNode { + element(name, attributes, text): XMLNode; + ele(name, attributes, text): XMLNode; + insertBefore(name, attributes, text): XMLNode; + insertAfter(name, attributes, text): XMLNode; + remove(): XMLNode; + node(name, attributes, text): XMLNode; + text(value): XMLNode; + cdata(value): XMLNode; + comment(value): XMLNode; + raw(value): XMLNode; + declaration(version, encoding, standalone): XMLNode; + doctype(pubID, sysID): XMLDocType; + up(): XMLNode; + root(): XMLNode; + document(): any; + end(options): string; + prev(): XMLNode; + next(): XMLNode; + nod(name, attributes, text): XMLNode; + txt(value): XMLNode; + dat(value): XMLNode; + com(value): XMLNode; + doc(value): XMLNode; + dec(version, encoding, standalone): XMLNode; + dtd(pubID, sysID): XMLDocType; + e(name, attributes, text): XMLNode; + n(name, attributes, text): XMLNode; + t(value): XMLNode; + d(value): XMLNode; + c(value): XMLNode; + r(value): XMLNode; + u(value): XMLNode; +} + +declare class XMLElement extends XMLNode { + clone(): XMLElement; + attribute(name: string, value: any): XMLElement; + att(name: string, value: any): XMLElement; + removeAttribute(name: string): XMLElement; + instruction(target, value): XMLElement; + ins(target, value): XMLElement; + a(name, value): XMLElement; + i(target, value): XMLElement; + toString(options?, level?): string; +} + +interface XMLBuilderStatic { + create(name: string, xmldec?: Object, doctype?: string, options?: Object): XMLElement; +} + +declare module 'xmlbuilder' { + export = XMLBuilderStatic; +} From 2c568d3bd07d61383ba4c7d2275e2bf4a8279046 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 7 Jun 2015 12:33:03 +0200 Subject: [PATCH 0066/2220] Type definition meta information --- xmlbuilder/xmlbuilder.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xmlbuilder/xmlbuilder.d.ts b/xmlbuilder/xmlbuilder.d.ts index 9fee2a85ba..cfbeb56b65 100644 --- a/xmlbuilder/xmlbuilder.d.ts +++ b/xmlbuilder/xmlbuilder.d.ts @@ -1,3 +1,8 @@ +// Type definitions for xmlbuilder +// Project: https://github.com/oozcitak/xmlbuilder-js +// Definitions by: Oskar Gewalli +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare class XMLDocType { clone(): XMLDocType; element(name, value): XMLDocType; From f872f895ee3a6ad1026cb5f8d252ec59c8c3f481 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 7 Jun 2015 22:07:01 +0200 Subject: [PATCH 0067/2220] Some tests based on test code from xmlbuilder --- xmlbuilder/xmlbuilder-tests.ts | 44 +++++++++ xmlbuilder/xmlbuilder.d.ts | 160 +++++++++++++++++---------------- 2 files changed, 126 insertions(+), 78 deletions(-) create mode 100644 xmlbuilder/xmlbuilder-tests.ts diff --git a/xmlbuilder/xmlbuilder-tests.ts b/xmlbuilder/xmlbuilder-tests.ts new file mode 100644 index 0000000000..bebc5f4d8f --- /dev/null +++ b/xmlbuilder/xmlbuilder-tests.ts @@ -0,0 +1,44 @@ +/// + +import xmlbuilder = require('xmlbuilder'); +var xml = xmlbuilder.create; + +// https://github.com/oozcitak/xmlbuilder-js/blob/master/test/comment.coffee +xml('comment', {}, {}, { headless: true }).comment('<>\'"&\t\n\r').end(); + +// https://github.com/oozcitak/xmlbuilder-js/blob/master/test/instructions.coffee +xml('test17', { headless: true }).ins('pi', 'mypi').end(); + +xml('test17', { headless: true }).ins({ 'pi': 'mypi', 'pi2': 'mypi2', 'pi3': null }).end(); + +xml('test17', { headless: true }).ins(['pi', 'pi2']).end(); + +xml('test18', { headless: true }) + .ins('renderCache.subset', '"Verdana" 0 0 ISO-8859-1 4 268 67 "#(),-./') + .ins('pitarget', () => 'pivalue') + .end(); + +// https://github.com/oozcitak/xmlbuilder-js/blob/master/test/createxml.coffee +xml('root') + .ele('xmlbuilder') + .att('for', 'node-js') + .com('CoffeeScript is awesome.') + .nod('repo') + .att('type', 'git') + .txt('git://github.com/oozcitak/xmlbuilder-js.git') + .up() + .up() + .ele('test') + .att('escaped', 'chars <>\'"&\t\n\r') + .txt('complete 100%<>\'"&\t\n\r') + .up() + .ele('cdata') + .cdata('this is a test\nSecond line') + .up() + .ele('raw') + .raw('&<>&') + .up() + .ele('atttest', { 'att': 'val' }, 'text') + .up() + .ele('atttest', 'text') + .end(); diff --git a/xmlbuilder/xmlbuilder.d.ts b/xmlbuilder/xmlbuilder.d.ts index cfbeb56b65..cf9bba9fa2 100644 --- a/xmlbuilder/xmlbuilder.d.ts +++ b/xmlbuilder/xmlbuilder.d.ts @@ -3,83 +3,87 @@ // Definitions by: Oskar Gewalli // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare class XMLDocType { - clone(): XMLDocType; - element(name, value): XMLDocType; - attList(elementName, attributeName, attributeType, defaultValueType, defaultValue): XMLDocType; - entity(name, value): XMLDocType; - pEntity(name, value): XMLDocType; - notation(name, value): XMLDocType; - cdata(value): XMLDocType; - comment(value): XMLDocType; - instruction(target, value): XMLDocType; - root(): XMLDocType; - document(): any; - toString(options, level): string; - - ele(name, value): XMLDocType; - att(elementName, attributeName, attributeType, defaultValueType, defaultValue): XMLDocType; - ent(name, value): XMLDocType; - pent(name, value): XMLDocType; - not(name, value): XMLDocType; - dat(value): XMLDocType; - com(value): XMLDocType; - ins(target, value): XMLDocType; - up(): XMLDocType; - doc(): any; -} - -declare class XMLNode { - element(name, attributes, text): XMLNode; - ele(name, attributes, text): XMLNode; - insertBefore(name, attributes, text): XMLNode; - insertAfter(name, attributes, text): XMLNode; - remove(): XMLNode; - node(name, attributes, text): XMLNode; - text(value): XMLNode; - cdata(value): XMLNode; - comment(value): XMLNode; - raw(value): XMLNode; - declaration(version, encoding, standalone): XMLNode; - doctype(pubID, sysID): XMLDocType; - up(): XMLNode; - root(): XMLNode; - document(): any; - end(options): string; - prev(): XMLNode; - next(): XMLNode; - nod(name, attributes, text): XMLNode; - txt(value): XMLNode; - dat(value): XMLNode; - com(value): XMLNode; - doc(value): XMLNode; - dec(version, encoding, standalone): XMLNode; - dtd(pubID, sysID): XMLDocType; - e(name, attributes, text): XMLNode; - n(name, attributes, text): XMLNode; - t(value): XMLNode; - d(value): XMLNode; - c(value): XMLNode; - r(value): XMLNode; - u(value): XMLNode; -} - -declare class XMLElement extends XMLNode { - clone(): XMLElement; - attribute(name: string, value: any): XMLElement; - att(name: string, value: any): XMLElement; - removeAttribute(name: string): XMLElement; - instruction(target, value): XMLElement; - ins(target, value): XMLElement; - a(name, value): XMLElement; - i(target, value): XMLElement; - toString(options?, level?): string; -} - -interface XMLBuilderStatic { - create(name: string, xmldec?: Object, doctype?: string, options?: Object): XMLElement; -} - declare module 'xmlbuilder' { - export = XMLBuilderStatic; + export = xmlbuilder; + class XMLDocType { + clone(): XMLDocType; + element(name: string, value?: Object): XMLDocType; + attList(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType; + entity(name: string, value: any): XMLDocType; + pEntity(name: string, value: any): XMLDocType; + notation(name: string, value: any): XMLDocType; + cdata(value: string): XMLDocType; + comment(value: string): XMLDocType; + instruction(target: string, value: any): XMLDocType; + root(): XMLDocType; + document(): any; + toString(options?: Object, level?: Number): string; + + ele(name: string, value?: Object): XMLDocType; + att(elementName: string, attributeName: string, attributeType: string, defaultValueType?: string, defaultValue?: any): XMLDocType; + ent(name: string, value: any): XMLDocType; + pent(name: string, value: any): XMLDocType; + not(name: string, value: any): XMLDocType; + dat(value: string): XMLDocType; + com(value: string): XMLDocType; + ins(target: string, value: any): XMLDocType; + up(): XMLDocType; + doc(): any; + } + + class XMLElementOrXMLNode { + // XMLElement: + clone(): XMLElementOrXMLNode; + attribute(name: any, value?: any): XMLElementOrXMLNode; + att(name: any, value?: any): XMLElementOrXMLNode; + removeAttribute(name: string): XMLElementOrXMLNode; + instruction(target: string, value: any): XMLElementOrXMLNode; + instruction(array: Array): XMLElementOrXMLNode; + instruction(obj: Object): XMLElementOrXMLNode; + ins(target: string, value: any): XMLElementOrXMLNode; + ins(array: Array): XMLElementOrXMLNode; + ins(obj: Object): XMLElementOrXMLNode; + a(name: any, value?: any): XMLElementOrXMLNode; + i(target: string, value: any): XMLElementOrXMLNode; + i(array: Array): XMLElementOrXMLNode; + i(obj: Object): XMLElementOrXMLNode; + toString(options?:Object, level?:Number): string; + // XMLNode: + element(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + ele(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + insertBefore(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + insertAfter(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + remove(): XMLElementOrXMLNode; + node(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + text(value: string): XMLElementOrXMLNode; + cdata(value: string): XMLElementOrXMLNode; + comment(value: string): XMLElementOrXMLNode; + raw(value: string): XMLElementOrXMLNode; + declaration(version: string, encoding: string, standalone: boolean): XMLElementOrXMLNode; + doctype(pubID: string, sysID: string): XMLDocType; + up(): XMLElementOrXMLNode; + root(): XMLElementOrXMLNode; + document(): any; + end(options?: Object): string; + prev(): XMLElementOrXMLNode; + next(): XMLElementOrXMLNode; + nod(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + txt(value: string): XMLElementOrXMLNode; + dat(value: string): XMLElementOrXMLNode; + com(value: string): XMLElementOrXMLNode; + doc(): XMLElementOrXMLNode; + dec(version: string, encoding: string, standalone: boolean): XMLElementOrXMLNode; + dtd(pubID: string, sysID: string): XMLDocType; + e(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + n(name: any, attributes?: Object, text?: any): XMLElementOrXMLNode; + t(value: string): XMLElementOrXMLNode; + d(value: string): XMLElementOrXMLNode; + c(value: string): XMLElementOrXMLNode; + r(value: string): XMLElementOrXMLNode; + u(): XMLElementOrXMLNode; + } + + module xmlbuilder { + function create(name: string, xmldec?: Object, doctype?: any, options?: Object): XMLElementOrXMLNode; + } } From fc8ac28f9c336f927a6fa29431dbbf04f58000c2 Mon Sep 17 00:00:00 2001 From: Oskar Gewalli Date: Sun, 7 Jun 2015 22:12:03 +0200 Subject: [PATCH 0068/2220] Fixed header in order to pass npm test --- xmlbuilder/xmlbuilder.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmlbuilder/xmlbuilder.d.ts b/xmlbuilder/xmlbuilder.d.ts index cf9bba9fa2..6f13452c1d 100644 --- a/xmlbuilder/xmlbuilder.d.ts +++ b/xmlbuilder/xmlbuilder.d.ts @@ -1,6 +1,6 @@ // Type definitions for xmlbuilder // Project: https://github.com/oozcitak/xmlbuilder-js -// Definitions by: Oskar Gewalli +// Definitions by: Wallymathieu // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module 'xmlbuilder' { From c3d8ef39391c08c8466ce7ffae1c55f6ac4b3f64 Mon Sep 17 00:00:00 2001 From: pingcrosby Date: Mon, 8 Jun 2015 13:30:55 +0100 Subject: [PATCH 0069/2220] Set LanuageSettings to optional Language info fields marked as optional to allow constructs as var table = $('#example').DataTable({ processing: true, serverSide: true, pagingType: "full_numbers", lengthMenu: [5, 10, 15], language: { paginate: { first: "Fsairst", last: "Laasst", next: "Nexast", previous: "Preavious" } }, --- jquery.dataTables/jquery.dataTables.d.ts | 27 ++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/jquery.dataTables/jquery.dataTables.d.ts b/jquery.dataTables/jquery.dataTables.d.ts index 50ff52edd5..9a5ea2124d 100755 --- a/jquery.dataTables/jquery.dataTables.d.ts +++ b/jquery.dataTables/jquery.dataTables.d.ts @@ -1617,20 +1617,21 @@ declare module DataTables { //#region "language-settings" + // these are all optional interface LanguageSettings { - emptyTable: string; - info: string; - infoEmpty: string; - infoFiltered: string; - infoPostFix: string; - thousands: string; - lengthMenu: string; - loadingRecords: string; - processing: string; - search: string; - zeroRecords: string; - paginate: LanguagePaginateSettings; - aria: LanguageAriaSettings; + emptyTable?: string; + info?: string; + infoEmpty?: string; + infoFiltered?: string; + infoPostFix?: string; + thousands?: string; + lengthMenu?: string; + loadingRecords?: string; + processing?: string; + search?: string; + zeroRecords?: string; + paginate?: LanguagePaginateSettings; + aria?: LanguageAriaSettings; } interface LanguagePaginateSettings { From 468f1a1007ac727c953e66f3a6765aabee6f02dc Mon Sep 17 00:00:00 2001 From: Dustin Wehr Date: Mon, 8 Jun 2015 14:42:11 -0400 Subject: [PATCH 0070/2220] renamed. made compatible with ../gapi/gapi.d.ts. --- .../google-drive-realtime-api-tests.ts | 28 +-- .../google-drive-realtime-api.d.ts | 184 ++++++++++-------- 2 files changed, 113 insertions(+), 99 deletions(-) rename google-realtime/library-tests.ts => google-drive-realtime-api/google-drive-realtime-api-tests.ts (85%) rename google-realtime/google-realtime.d.ts => google-drive-realtime-api/google-drive-realtime-api.d.ts (87%) diff --git a/google-realtime/library-tests.ts b/google-drive-realtime-api/google-drive-realtime-api-tests.ts similarity index 85% rename from google-realtime/library-tests.ts rename to google-drive-realtime-api/google-drive-realtime-api-tests.ts index 5adc8184af..62578f42a8 100644 --- a/google-realtime/library-tests.ts +++ b/google-drive-realtime-api/google-drive-realtime-api-tests.ts @@ -1,4 +1,4 @@ -/// +/// // Don't use this as a reference. Use the examples at // https://developers.google.com/google-apps/realtime/ @@ -12,13 +12,13 @@ interface JQuery { [key: string]: any; }; -type CollabModel = googleRealtime.Model; -type CollabDoc = googleRealtime.Document; -interface CollaborativeObject extends googleRealtime.CollaborativeObject {} -interface CollaborativeList extends googleRealtime.CollaborativeList {} -interface CollaborativeMap extends googleRealtime.CollaborativeMap {} -interface IndexReference extends googleRealtime.IndexReference {} -interface CollaborativeString extends googleRealtime.CollaborativeString {} +type CollabModel = gapi.drive.realtime.Model; +type CollabDoc = gapi.drive.realtime.Document; +interface CollaborativeObject extends gapi.drive.realtime.CollaborativeObject {} +interface CollaborativeList extends gapi.drive.realtime.CollaborativeList {} +interface CollaborativeMap extends gapi.drive.realtime.CollaborativeMap {} +interface IndexReference extends gapi.drive.realtime.IndexReference {} +interface CollaborativeString extends gapi.drive.realtime.CollaborativeString {} type CListOfCObj = CollaborativeList type CObjOrStr = CollaborativeObject | string; @@ -30,7 +30,7 @@ module GRealtime { - var default_loader_options : googleRealtime.LoaderOptions = { + var default_loader_options : rtclient.LoaderOptions = { // Your Application ID from the Google APIs Console. appId: "YOUR_APP_ID", @@ -71,8 +71,8 @@ module GRealtime { }; export class MyRTLoader { - public loader_options : googleRealtime.LoaderOptions = $.extend({},default_loader_options); - private rtloader_client : googleRealtime.RealtimeLoader; + public loader_options : rtclient.LoaderOptions = $.extend({},default_loader_options); + private rtloader_client : rtclient.RealtimeLoader; // call after setting loader_options appropriately authorize() { @@ -101,7 +101,7 @@ module GRealtime { onFileLoaded: (x:CollabDoc) => void) : void { var _afterAuth = () => { - this.myRTLoader.createNew(title, (file:googleRealtime.DriveAPIFileResource) => { + this.myRTLoader.createNew(title, (file:rtclient.DriveAPIFileResource) => { console.log(`\n\nThis is the createNew callback. New file's id: ${file.id}\n\n`); $("#file-id-text-input").val(file.id); this.myRTLoader.loadAfterAuth(file.id) @@ -160,7 +160,7 @@ module GRealtime { this.rtmodel.getRoot().set(key,x.pdata); } - bindString(istring:CollaborativeString, $textinput: JQuery) : googleRealtime.Binding { + bindString(istring:CollaborativeString, $textinput: JQuery) : gapi.drive.realtime.databinding.Binding { return gapi.drive.realtime.databinding.bindString( istring, $textinput[0] ); @@ -183,7 +183,7 @@ module GRealtime { // Next example from https://developers.google.com/google-apps/realtime/model-events declare var doc : CollabDoc; -function displayObjectChangedEvent(evt:googleRealtime.ObjectChangedEvent) { +function displayObjectChangedEvent(evt:gapi.drive.realtime.ObjectChangedEvent) { var events = evt.events; var eventCount = evt.events.length; for (var i = 0; i < eventCount; i++) { diff --git a/google-realtime/google-realtime.d.ts b/google-drive-realtime-api/google-drive-realtime-api.d.ts similarity index 87% rename from google-realtime/google-realtime.d.ts rename to google-drive-realtime-api/google-drive-realtime-api.d.ts index b72471a045..8cf4aa97ba 100644 --- a/google-realtime/google-realtime.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -3,16 +3,19 @@ // Definitions by: Dustin Wehr // Definitions: https://github.com/borisyankov/DefinitelyTyped -// For Typescript newbs: To get shorter names, use e.g. -// type CollabModel = googleRealtime.Model; -// interface CollabList extends googleRealtime.CollaborativeList {} -// See section "Type Aliases" of http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf +// This definition file is merge-compatible with ../gapi/gapi.d.ts // Note the occurrences of "INCOMPLETE". For some interfaces and object types, I have only included // the properties and methods that I've actually used so-far, and will add more as they become useful to me. // Or, maybe you want to complete them? -declare module googleRealtime { +// For Typescript newbs: To get shorter names, use e.g. +// type CollabModel = gapi.drive.realtime.Model; +// interface CollabList extends gapi.drive.realtime.CollaborativeList {} +// See section "Type Aliases" of http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf + +// gapi is a global var introduced by https://apis.google.com/js/api.js +declare module gapi.drive.realtime { type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; @@ -31,14 +34,14 @@ declare module googleRealtime { // 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 // when the event is dispatched. - addEventListener(type:string, listener: GoogEventHandler, opt_capture?:boolean):void; + addEventListener(type:string, listener:GoogEventHandler, opt_capture?:boolean):void; // Removes all event listeners from this object. removeAllEventListeners():void; // Removes an event listener from the event target. The handler must be the same object as the one added. // If the handler has not been added then nothing is done. - removeEventListener(type:string, listener: GoogEventHandler, opt_capture?:boolean):void; + removeEventListener(type:string, listener:GoogEventHandler, opt_capture?:boolean):void; // Returns a string representation of this collaborative object. toString():string; @@ -309,13 +312,13 @@ declare module googleRealtime { // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.BaseModelEvent interface BaseModelEvent { // Whether this event bubbles. - bubbles : boolean; + bubbles : boolean; // The list of names from the hierarchy of compound operations that initiated this event. compoundOperationNames : string[]; // True if this event originated in the local session. - isLocal : boolean; + isLocal : boolean; // True if this event originated from a redo call. isRedo : boolean; @@ -325,54 +328,54 @@ declare module googleRealtime { // Prevents an event from performing its default action. In the Realtime API, this function is only present // for compatibility with the DOM event interface and therefore it does nothing. - preventDefault() : void; + preventDefault() : void; // The id of the session that initiated this event. - sessionId : string; + sessionId : string; // The collaborative object that initiated this event. - target : Object; + target : Object; // The type of the event. - type : string; + type : string; // The user id of the user that initiated this event. - userId : string; + userId : string; // Stops an event which bubbles from propagating to the target's parent. - stopPropagation() : void; + stopPropagation() : void; /* Parameters: - target - gapi.drive.realtime.CollaborativeObject - The collaborative object that initiated the event. - Value must not be null. + target + gapi.drive.realtime.CollaborativeObject + The collaborative object that initiated the event. + Value must not be null. - sessionId - string - The id of the session that initiated the event. + sessionId + string + The id of the session that initiated the event. - userId - string - The user id of the user that initiated the event. + userId + string + The user id of the user that initiated the event. - compoundOperationNames - 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. + compoundOperationNames + 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. - isUndo - boolean - True if the event originated from an undo call. + isUndo + boolean + True if the event originated from an undo call. - isRedo - boolean - True if the event originated from a redo call. - */ - new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames: string[], + isRedo + boolean + True if the event originated from a redo call. + */ + new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[], isLocal:boolean, isUndo:boolean, isRedo:boolean) : BaseModelEvent; } @@ -384,7 +387,7 @@ declare module googleRealtime { // Array of gapi.drive.realtime.BaseModelEvent // The specific events that document the changes that occurred on the object. // Value must not be null. - new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames: string[], + new (target:CollaborativeObject, sessionId:string, userId:string, compoundOperationNames:string[], isLocal:boolean, isUndo:boolean, isRedo:boolean, events:BaseModelEvent[]) : ObjectChangedEvent; // The specific events that document the changes that occurred on the object. @@ -405,6 +408,46 @@ declare module googleRealtime { // Calling this function after the document has been closed will have no effect. close():void; } +} + + +declare module gapi.drive.realtime.databinding { + // COMPLETE + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.databinding.Binding + export interface Binding { + // Throws gapi.drive.realtime.databinding.AlreadyBoundError If domElement has already been bound. + + // The collaborative object to bind. + collaborativeObject : CollaborativeObject; + + // The DOM element that the collaborative object is bound to. Value must not be null. + domElement : Element; + + // Unbinds the domElement from collaborativeObject. + unbind() : void; + } + + export function bindString(s:CollaborativeString, textinput:HTMLInputElement) : Binding +} + + +declare module gapi.drive.realtime.EventType { + export var TEXT_INSERTED: string + export var TEXT_DELETED: string + export var OBJECT_CHANGED: string +} + + +// rtclient is a global var introduced by realtime-client-utils.js +declare module rtclient { + // INCOMPLETE + export interface RealtimeLoader { + start():void; + load():void; + } + interface RealtimeLoaderFactory { + new (options:LoaderOptions) : RealtimeLoader; + } // *********************************** // The remainder of this file types some (not all) things in realtime-client-utils.js, found here: @@ -444,10 +487,10 @@ declare module googleRealtime { afterAuth: () => void; // Function to be called when a Realtime model is first created. - initializeModel: (model:Model) => void; + initializeModel: (model:gapi.drive.realtime.Model) => void; // Function to be called every time a Realtime file is loaded. - onFileLoaded: (rtdoc:Document) => void; + onFileLoaded: (rtdoc:gapi.drive.realtime.Document) => void; } // INCOMPLETE @@ -455,15 +498,6 @@ declare module googleRealtime { id: string; } - // INCOMPLETE - export interface RealtimeLoader { - start():void; - load():void; - } - interface RealtimeLoaderFactory { - new (options:googleRealtime.LoaderOptions) : RealtimeLoader; - } - // INCOMPLETE export interface ClientUtils { // INCOMPLETE @@ -482,40 +516,20 @@ declare module googleRealtime { createRealtimeFile(title:string, mimeType:string, callback:(file:DriveAPIFileResource) => void) : void; } - // COMPLETE - // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.databinding.Binding - export interface Binding { - // Throws gapi.drive.realtime.databinding.AlreadyBoundError If domElement has already been bound. - - // The collaborative object to bind. - collaborativeObject : CollaborativeObject; - - // The DOM element that the collaborative object is bound to. Value must not be null. - domElement : Element; - - // Unbinds the domElement from collaborativeObject. - unbind() : void; - } - - export interface GoogleAPI { - drive : { - realtime : { - databinding : { - bindString(s:googleRealtime.CollaborativeString, textinput:HTMLInputElement) : googleRealtime.Binding; - } - EventType : { - TEXT_INSERTED: string; - TEXT_DELETED: string; - OBJECT_CHANGED: string; - } - } - } - } + export var RealtimeLoader : RealtimeLoaderFactory + /** + * Creates a new Realtime file. + * @param title {string} title of the newly created file. + * @param mimeType {string} the MIME type of the new file. + * @param callback {(file:DriveAPIFileResource) => void} the callback to call after creation. + */ + export function createRealtimeFile(title:string, mimeType:string, callback:(file:DriveAPIFileResource) => void) : void } -// global var introduced by realtime-client-utils.js -declare var rtclient:googleRealtime.ClientUtils; +// INCOMPLETE +declare module rtclient.params { + // string containing one or more file ids separated by spaces. + export var fileIds:string +} -// global var introduced by https://apis.google.com/js/api.js -declare var gapi: googleRealtime.GoogleAPI; \ No newline at end of file From 2f4323724b8344f7ffa302340772e31355eaa220 Mon Sep 17 00:00:00 2001 From: "Bogdan I. Bursuc" Date: Tue, 9 Jun 2015 08:03:03 +0300 Subject: [PATCH 0071/2220] Tests for ICurrentRoute property --- angularjs/angular-route-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/angularjs/angular-route-tests.ts b/angularjs/angular-route-tests.ts index 3607b6f137..0260359fb6 100644 --- a/angularjs/angular-route-tests.ts +++ b/angularjs/angular-route-tests.ts @@ -34,3 +34,7 @@ $routeProvider }) .otherwise({ redirectTo: '/' }) .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }); + + +var current: ng.route.ICurrentRoute; +current.locals['test-key'] = 'test-value'; From 30c8088847080625c1526eab9cad288ba489bc4a Mon Sep 17 00:00:00 2001 From: Robert Mulder Date: Tue, 9 Jun 2015 10:07:27 +0200 Subject: [PATCH 0072/2220] Fixed typo and added a missing default property --- angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index c3675e7a98..fe5d403fd9 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -590,7 +590,14 @@ declare module angular.ui.bootstrap { * * @default false */ - appendtoBody?: boolean; + appendToBody?: boolean; + + /** + * Determines the default open triggers for tooltips and popovers + * + * @default 'mouseenter' for tooltip, 'click' for popover + */ + trigger?: string; } interface ITooltipProvider { From 743ed605df86ad4e7df91c0f8ae30b763666b5e7 Mon Sep 17 00:00:00 2001 From: Aurelien Souchet Date: Tue, 9 Jun 2015 11:06:18 +0200 Subject: [PATCH 0073/2220] merging interfaces --- winrt/winrt.d.ts | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/winrt/winrt.d.ts b/winrt/winrt.d.ts index 8671e62e08..b8b40f7cd7 100644 --- a/winrt/winrt.d.ts +++ b/winrt/winrt.d.ts @@ -10990,45 +10990,39 @@ declare module Windows { } export interface IFileOpenPicker { commitButtonText: string; + continuationData: Windows.Foundation.Collections.ValueSet; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; - pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; - pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; - } - export interface IFileOpenPicker2 { - continuationData: Windows.Foundation.Collections.ValueSet; pickMultipleFilesAndContinue(): void; + pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; pickSingleFileAndContinue(): void; + pickSingleFileAsync(): Windows.Foundation.IAsyncOperation; } export interface IFileSavePicker { commitButtonText: string; + continuationData: Windows.Foundation.Collections.ValueSet; defaultFileExtension: string; fileTypeChoices: Windows.Foundation.Collections.IMap>; settingsIdentifier: string; suggestedFileName: string; suggestedSaveFile: Windows.Storage.StorageFile; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; - pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; - } - export interface IFileSavePicker2 { - continuationData: Windows.Foundation.Collections.ValueSet; pickSaveFileAndContinue(): void; + pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } export interface IFolderPicker { commitButtonText: string; + continuationData: Windows.Foundation.Collections.ValueSet; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; suggestedStartLocation: Windows.Storage.Pickers.PickerLocationId; viewMode: Windows.Storage.Pickers.PickerViewMode; + pickFolderAndContinue(): void; pickSingleFolderAsync(): Windows.Foundation.IAsyncOperation; } - export interface IFolderPicker2 { - continuationData: Windows.Foundation.Collections.ValueSet; - pickFolderAndContinue(): void; - } - export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker, Windows.Storage.Pickers.IFileOpenPicker2 { + export class FileOpenPicker implements Windows.Storage.Pickers.IFileOpenPicker { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; @@ -11040,7 +11034,7 @@ declare module Windows { pickMultipleFilesAndContinue(): void; pickMultipleFilesAsync(): Windows.Foundation.IAsyncOperation>; } - export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker, Windows.Storage.Pickers.IFileSavePicker2 { + export class FileSavePicker implements Windows.Storage.Pickers.IFileSavePicker { commitButtonText: string; defaultFileExtension: string; fileTypeChoices: Windows.Foundation.Collections.IMap>; @@ -11052,7 +11046,7 @@ declare module Windows { pickSaveFileAndContinue(): void; pickSaveFileAsync(): Windows.Foundation.IAsyncOperation; } - export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker, Windows.Storage.Pickers.IFolderPicker2 { + export class FolderPicker implements Windows.Storage.Pickers.IFolderPicker { commitButtonText: string; fileTypeFilter: Windows.Foundation.Collections.IVector; settingsIdentifier: string; From 0f99f0b37a60f723012e261e66e99285c9e0f6f9 Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Tue, 9 Jun 2015 16:09:01 +0300 Subject: [PATCH 0074/2220] Definitions for 14.1 removed --- devextreme/14.1/dx.chartjs-14.1-tests.ts | 26 - devextreme/14.1/dx.chartjs-14.1.d.ts | 1865 --------------------- devextreme/14.1/dx.phonejs-14.1-tests.ts | 258 --- devextreme/14.1/dx.phonejs-14.1.d.ts | 1507 ----------------- devextreme/14.1/dx.webappjs-14.1-tests.ts | 93 - devextreme/14.1/dx.webappjs-14.1.d.ts | 1648 ------------------ 6 files changed, 5397 deletions(-) delete mode 100644 devextreme/14.1/dx.chartjs-14.1-tests.ts delete mode 100644 devextreme/14.1/dx.chartjs-14.1.d.ts delete mode 100644 devextreme/14.1/dx.phonejs-14.1-tests.ts delete mode 100644 devextreme/14.1/dx.phonejs-14.1.d.ts delete mode 100644 devextreme/14.1/dx.webappjs-14.1-tests.ts delete mode 100644 devextreme/14.1/dx.webappjs-14.1.d.ts diff --git a/devextreme/14.1/dx.chartjs-14.1-tests.ts b/devextreme/14.1/dx.chartjs-14.1-tests.ts deleted file mode 100644 index b9a0be0dfb..0000000000 --- a/devextreme/14.1/dx.chartjs-14.1-tests.ts +++ /dev/null @@ -1,26 +0,0 @@ -/// - -module Test { - $("
").appendTo(document.body).dxChart({ - size: { - width: 600, - height: 400 - }, - title: { - text: 'Chart in jQuery mode', - font: { color: 'rgb(0, 128, 128)!important' } - }, - argumentAxis: { - categories: ['January', 'February', 'March', 'April', 'May', 'June'] - }, - dataSource: [ - { arg: 'January', v1: 10, v2: 20, v3: 24 }, - { arg: 'February', v1: 5, v2: 35, v3: 43 }, - { arg: 'March', v1: 50, v2: 10, v3: 80 }, - { arg: 'April', v1: 9, v2: 79, v3: 39 }, - { arg: 'May', v1: 100, v2: 42, v3: 22 }, - { arg: 'June', v1: 95, v2: 11, v3: 41 } - ], - series: [{ valueField: 'v1' }, { valueField: 'v2' }, { valueField: 'v3' }] - }); -} \ No newline at end of file diff --git a/devextreme/14.1/dx.chartjs-14.1.d.ts b/devextreme/14.1/dx.chartjs-14.1.d.ts deleted file mode 100644 index 632767e7ed..0000000000 --- a/devextreme/14.1/dx.chartjs-14.1.d.ts +++ /dev/null @@ -1,1865 +0,0 @@ -// Type definitions for ChartJS 14.1.+ -// Project: http://js.devexpress.com/WebDevelopment/Charts/ -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module DevExpress { - export function abstract(): void; - export var rtlEnabled: boolean; - export var hardwareBackButton: JQueryCallback; - interface Endpoint { - local?: string; - production: string; - } - class EndpointSelector { - constructor(config: { [key: string]: Endpoint }); - urlFor(key: string): string; - } - export interface ActionOptions { - context?: Object; - component?: any; - beforeExecute? (e:ActionExecuteArgs): void; - afterExecute? (e:ActionExecuteArgs): void; - } - export interface ActionExecuteArgs { - action: any; - args: any[]; - context: any; - component: any; - cancel: boolean; - handled: boolean; - } - export class Action { - constructor(action?: any, config?: ActionOptions); - execute(): any; - } - export interface IDevice { - deviceType?: string; - platform?: string; - version?: Array; - phone?: boolean; - tablet?: boolean; - android?: boolean; - ios?: boolean; - win8?: boolean; - tizen?: boolean; - generic?: boolean; - } - export module devices { - export function orientation(): string; - export var orientationChanged: JQueryCallback; - export function real(): IDevice; - export function current(deviceOrName: string): IDevice; - export function current(deviceOrName: IDevice): IDevice; - } - export function registerComponent(name: string, componentClass: any): void; - export interface ComponentOptions { - disabled?: boolean; - } - export class Component { - constructor(element: Element, options?: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - disposing: JQueryCallback; - optionChanged: JQueryCallback; - instance(): Component; - beginUpdate(): void; - endUpdate(): void; - option(): any; - option(options: string): any; - option(options: string): T; - option(options: string, value: any): void; - option(options: { [key: string]: any }): void; - option(options?: any): any; - } - export interface DOMComponentOptions extends ComponentOptions { - rtlEnabled?: boolean; - } - export class DOMComponent extends Component { - constructor(element: HTMLElement, options?: DOMComponentOptions); - static defaultOptions(rule: { - device: any; - options: { [key: string]: any }; - }): void; - } -} -declare module DevExpress.data { - export interface DataError extends Error { - httpStatus?: number; - errorDetails?: any; - } - export interface ErrorHandler { (e: DataError): void; } - export interface EntityOptions { key: any; keyType: any; } - export interface Getter { (obj: any, options?: any): any; } - export interface Setter { (obj: any, value: any, options?: any): void; } - export interface QueryOptions { - errorHandler?: ErrorHandler; - requireTotalCount?: boolean; - } - export interface ODataQueryOptions extends QueryOptions { - adapter?: any; - } - interface IQuery { - enumerate(): JQueryPromise>; - count(): JQueryPromise; - slice(skip: number, take?: number): IQuery; - sortBy(field: string): IQuery; - sortBy(field: Getter): IQuery; - sortBy(field: { field: string; desc?: boolean }): IQuery; - sortBy(field: { field: Getter; desc?: boolean }): IQuery; - thenBy(field: string): IQuery; - thenBy(field: Getter): IQuery; - thenBy(field: { field: string; desc?: boolean }): IQuery; - thenBy(field: { field: Getter; desc?: boolean }): IQuery; - filter(field: string, operator: string, value: any): IQuery; - filter(field: string, value: any): IQuery; - filter(criteria: any[]): IQuery; - select(field: string): IQuery; - select(field: string[]): IQuery; - select(...field: string[]): IQuery; - select(field: Getter): IQuery; - select(field: Getter[]): IQuery; - select(...field: Getter[]): IQuery; - groupBy(field: string[]): IQuery; - groupBy(field: Getter[]): IQuery; - groupBy(field: { field: string; desc?: boolean }[]): IQuery; - groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; - sum(getter?: string): JQueryPromise; - min(getter?: string): JQueryPromise; - max(getter?: string): JQueryPromise; - avg(getter?: string): JQueryPromise; - aggregate(step: number): JQueryPromise; - aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryPromise; - } - export interface ArrayQuery extends IQuery { - toArray(): Array; - } - export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } - export function base64_encode(input: string): string; - export function base64_encode(input: any[]): string; - export function query(items?: any[]): IQuery; - export var queryImpl: { - remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; - array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; - }; - export class Guid { - constructor(value?: string); - constructor(value?: any); - toString(): string; - valueOf(): string; - toJSON(): string; - } - export class EdmLiteral { - constructor(value: any); - valueOf(): any; - } - export module utils { - export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeBinaryCriterion(criteria: Array): Array; - export function keysEqual(key1: any, key2: any): boolean; - export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; - export function toComparable(value: Date, caseSensitive?: boolean): number; - export function toComparable(value: Guid, caseSensitive?: boolean): string; - export function toComparable(value: string, caseSensitive?: boolean): string; - export function compileGetter(): Getter; - export function compileGetter(expr: any[]): Getter; - export function compileGetter(expr: string): Getter; - export function compileGetter(expr: "this"): Getter; - export function compileGetter(expr: Getter): Getter; - export function compileSetter(expr: string): Setter; - export module odata { - export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; - export function serializePropName(propName: EdmLiteral): string; - export function serializePropName(propName: string): string; - export function serializeValue(value: Date): string; - export function serializeValue(value: Guid): string; - export function serializeValue(value: string): string; - export function serializeValue(value: "string"): string; - export function serializeValue(value: EdmLiteral): string; - export function serializeKey(key: any): string; - export function serializeKey(key: Date): string; - export function serializeKey(key: Guid): string; - export function serializeKey(key: string): string; - export function serializeKey(key: "string"): string; - export function serializeKey(key: EdmLiteral): string; - export var keyConverters: { - String(value: any): string; - Guid(value: any): Guid; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - }; - } - } - export module queryAdapters { - export function odata(queryOptions: ODataQueryOptions): RemoteQuery; - } - export interface DataSourceOptions { - map? (item: any): any; - postProcess? (result: any[]): any; - pageSize: number; - paginate: boolean; - } - export class DataSource { - public changed: JQueryCallback; - public loadError: JQueryCallback; - public loadingChanged: JQueryCallback; - constructor(options?: Store); - constructor(options?: string); - constructor(options?: Array); - constructor(options?: { store: Store }); - constructor(options?: CustomStoreOptions); - constructor(options?: { store: Array }); - constructor(options?: { store: { type: string } }); - constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); - constructor(options?: { load(options?: LoadOptions): Array; }); - constructor(options?: { load(options?: LoadOptions): JQueryPromise; }); - constructor(options?: DataSourceOptions); - loadOptions(): { [key: string]: any }; - items(): Array; - store(): data.Store; - isLastPage(): boolean; - pageIndex(newIndex?: number): number; - sort(expr: any[]): any[]; - group(expr: any[]): any[]; - filter(expr: any[]): any[]; - select(expr: string[]): string[]; - searchValue(value?: string): string; - searchOperation(op?: string): string; - searchExpr(selector: string): string; - key(): any; - isLoaded(): boolean; - isLoading(): boolean; - totalCount(): number; - load(): JQueryPromise; - dispose(): void; - } - export interface StoreOptions { - key?: any; - errorHandler?: ErrorHandler; - loaded?: (result: Array) => void; - loading?: (loadOptions: LoadOptions) => void; - modified?: () => void; - modifying?: () => void; - inserted?: (values: Object, key: any) => void; - inserting?: (values: Object) => void; - updated?: (key: any, values: Object) => void; - updating?: (key: any, values: Object) => void; - removed?: (key: any) => void; - removing?: (key: any) => void; - } - export interface LoadOptions extends QueryOptions { - skip?: number; - take?: number; - sort?: any; - select?: any; - filter?: any; - group?: any; - expand?: any; - } - export class Store { - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - inserted: JQueryCallback; - inserting: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - constructor(options?: StoreOptions); - key(): any; - keyOf(obj: any): any; - load(options?: LoadOptions): JQueryPromise; - createQuery(options?: QueryOptions): IQuery; - totalCount(options?: { - filter?: any[]; - group?: string[]; - }): JQueryPromise; - byKey(key: any, extraOptions?: { - expand?: string[] - }): JQueryPromise; - remove(key: any): JQueryPromise; - insert(values: any): JQueryPromise; - update(key: any, values: any): JQueryPromise; - } - export interface CustomStoreOptions extends StoreOptions { - load? (options?: LoadOptions): any; - byKey? (key: any): any; - insert? (values: any): any; - update? (key: any, values: any): any; - remove? (key: any): any; - totalCount? (options?: { - filter?: any[]; - group?: string[]; - }): any; - } - export class CustomStore extends Store { - constructor(options?: CustomStoreOptions); - } - export interface ArrayStoreOptions extends StoreOptions { - data?: Array - } - export class ArrayStore extends Store { - constructor(options?: Array); - constructor(options?: ArrayStoreOptions); - } - export interface LocalStoreOptions extends ArrayStoreOptions { - name: string; - } - export class LocalStore extends ArrayStore { - constructor(options?: string); - constructor(options?: LocalStoreOptions); - clear(): void; - } - export interface ODataStoreOptions extends StoreOptions { - url?: string; - name?: string; - keyType?: string; - jsonp?: boolean; - withCredentials?: boolean; - } - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - } - export interface ODataContextOptions { - url: string; - jsonp?: boolean; - withCredentials?: boolean; - errorHandler?: ErrorHandler; - beforeSend?: () => any; - entities?: { - [entityAlias: string]: ODataStoreOptions; - }; - } - export class ODataContext { - constructor(options?: ODataContextOptions); - get(operationName: string, params: { [key: string]: any }): JQueryPromise>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryPromise>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; - } -} -declare module DevExpress.ui { - export var themes: { - current(): string; - current(themeName: string): void; - }; - interface ViewportOptions { - allowPan?: boolean; - allowZoom?: boolean; - } - export interface ITemplate { - compile(html: string): any; - render(template: JQuery, data: any): any; - render(template: any, data: any): any; - } - class Template { - constructor(element: HTMLElement); - constructor(element: JQueryStatic); - render(container: HTMLElement): any; - render(container: JQueryStatic): any; - dispose(): void; - } - interface TemplateStatic { - new (element: HTMLElement): Template; - new (element: JQueryStatic): Template; - } - class TemplateProvider { - constructor(); - getTemplateClass(widget: any): TemplateStatic; - getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; - } - export function initViewport(options: ViewportOptions): void; - interface NotifyOptions { - message: string; - type?: string; - displayTime?: number; - hiddenAction: () => any; - } - export function notyfy(options: any): void; - export function notify(message: string, type?: string, displayTime?: number): void; - export module dialog { - interface Dialog { - show(): JQueryPromise; - hide(value?: any): void; - } - interface DialogButton { - text: string; - icon: string; - clickAction: () => any; - } - interface DialogOptions { - message: string; - title?: string; - } - export function custom(options: DialogOptions): Dialog; - export function custom(message: string, title?: string): Dialog; - export function alert(options: DialogOptions): JQueryPromise; - export function alert(message: string, title?: string): JQueryPromise; - export function confirm(options: DialogOptions): JQueryPromise; - export function confirm(message: string, title?: string): JQueryPromise; - } - export interface CollectionContainerWidgetOptions extends WidgetOptions { - items?: Array; - itemTemplate?: any; - itemRender?: Function; - itemClickAction?: any; - itemRenderedAction?: any; - noDataText?: string; - dataSource?: data.DataSource; - selectedIndex?: number; - itemSelectAction?: any; - itemHoldAction?: any; - itemHoldTimeout?: number; - } - export class CollectionContainerWidget extends Widget { - constructor(element: Element, options?: CollectionContainerWidgetOptions); - constructor(element: JQuery, options?: CollectionContainerWidgetOptions); - } - export interface WidgetOptions extends ComponentOptions { - contentReadyAction?: any; - width?: any; - height?: any; - visible?: boolean; - activeStateEnabled?: boolean; - } - export class Widget extends Component { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - init(): void; - repaint(): void; - addTemplate(template: ITemplate): void; - } - export interface dxEditorOptions extends WidgetOptions { - value?: any; - valueChangeAction?: any; - } - export class dxEditor extends Widget { - constructor(element: Element, options?: dxEditorOptions); - constructor(element: JQuery, options?: dxEditorOptions); - } -} -declare module DevExpress.viz { - export class Chart extends Component { - constructor(element: Element, options?: viz.charts.ChartOptions); - constructor(element: JQuery, options?: viz.charts.ChartOptions); - clearSelection(): void; - getSeries(): viz.charts.series.Series; - hidiTooltip(): void; - render(options: viz.charts.RenderOptions): void; - render(): void; - zoomArgument(minArg: any, maxArg: any): void; - getSeriesByPos(seriesIndex: number): viz.charts.series.Series; - getSeriesByName(seriesName: string): viz.charts.series.Series; - getAllSeries(): Array; - instance(): Chart; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - getSize(): { width: number; height: number }; - } - export class PieChart extends Component { - constructor(element: Element, options?: viz.charts.PieOptions); - constructor(element: JQuery, options?: viz.charts.PieOptions); - clearSelection(): void; - getSeries(): viz.charts.series.PieSeries; - hidiTooltip(): void; - render(options: viz.charts.RenderOptions): void; - render(): void; - instance(): PieChart; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - getSize(): { width: number; height: number }; - } - export class RangeSelector extends Component { - constructor(element: Element, options?: viz.rangeSelector.RangeSelectorOptions); - constructor(element: JQuery, options?: viz.rangeSelector.RangeSelectorOptions); - getSelectedRange: () => viz.rangeSelector.SelectedRange; - setSelectedRange: (selectedRange: viz.rangeSelector.SelectedRange) => void; - render(): RangeSelector; - instance(): RangeSelector; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - } - export class CircularGauge extends Component { - constructor(element: Element, options?: viz.gauges.CircularGaugeOptions); - constructor(element: JQuery, options?: viz.gauges.CircularGaugeOptions); - value(): number; - value(val: number): CircularGauge; - subvalues(): Array; - subvalues(values: Array): CircularGauge; - render(): CircularGauge; - instance(): CircularGauge; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - } - export class LinearGauge extends Component { - constructor(element: Element, options?: viz.gauges.LinearGaugeOptions); - constructor(element: JQuery, options?: viz.gauges.LinearGaugeOptions); - value(): number; - value(val: number): LinearGauge; - subvalues(): Array; - subvalues(values: Array): LinearGauge; - render(): LinearGauge; - instance(): LinearGauge; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - } - export class BarGauge extends Component { - constructor(element: Element, options?: viz.gauges.BarGaugeOptions); - constructor(element: JQuery, options?: viz.gauges.BarGaugeOptions); - values(): Array; - values(vals: Array): BarGauge; - render(): BarGauge; - instance(): BarGauge; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - } - export class Sparkline extends Component { - constructor(element: Element, options?: viz.sparklines.SparklineOptions); - constructor(element: JQuery, options?: viz.sparklines.SparklineOptions); - render(): Sparkline; - instance(): Sparkline; - svg(): string; - } - export class Bullet extends Component { - constructor(element: Element, options?: viz.sparklines.BulletOptions); - constructor(element: JQuery, options?: viz.sparklines.BulletOptions); - render(): Bullet; - instance(): Bullet; - svg(): string; - } - export class Map extends Component { - constructor(element: Element, options?: viz.map.VectorMapOptions); - constructor(element: JQuery, options?: viz.map.VectorMapOptions); - render(): Map; - instance(): Map; - getAreas(): Array; - getMarkers(): Array; - clearAreaSelection(): Map; - clearMarkerSelection(): Map; - clearSelection(): Map; - showLoadingIndicator(): void; - hideLoadingIndicator(): void; - svg(): string; - center(): Array; - center(center: Array): Map; - zoomFactor(): number; - zoomFactor(zoomFactor: number): Map; - viewport(): Array; - viewport(viewport: Array): Map; - convertCoordinates(x: number, y: number): Array; - } -} -declare module DevExpress.viz.charts { - interface z_BaseLegendOptions { - backgroundColor?: string; - hoverMode?: string; - customizeText?: (arg: { - seriesName: string; - seriesNumber: number; - seriesColor: string; - }) => string; - verticalAlignment?: string; - horizontalAlignment?: string; - itemTextPosition?: string; - equalColumnWidth?: boolean; - font?: viz.common.FontOptions; - visible?: boolean; - margin?: any; - markerSize?: number; - border?: { - visible?: boolean; - width?: number; - color?: string; - cornerRadius?: number; - opacity?: number; - dashStyle?: string; - }; - paddingLeftRight?: number; - paddingTopBottom?: number; - columnsCount?: number; - rowsCount?: number; - columnItemSpacing?: number; - rowItemSpacing?: number; - orientation?: string; - } - interface z_BaseTooltipCustomizeArgument { - value?: any; - valueText: string; - originalValue: string; - argument: any; - argumentText: string; - originalArgument: any; - percent?: any; - percentText?: string; - seriesName: string; - } - interface z_BaseTooltipOptions extends common.BaseTooltipOptions { - customizeText?: (arg: z_BaseTooltipCustomizeArgument) => string; - customizeTooltip?: (arg: z_BaseTooltipCustomizeArgument) => common.CustomizeTooltipResult; - format?: string; - argumentFormat?: string; - precision?: number; - argumentPrecision?: number; - percentPrecision?: number; - } - interface z_ChartTooltipCustomizeArgument extends z_BaseTooltipCustomizeArgument{ - closeValueText?: string; - highValueText?: string; - lowValueText?: string; - openValueText?: string; - originalCloseValue?: any; - originalHighValue?: any; - originalLowValue?: any; - originalOpenValue?: any; - closeValue?: any; - highValue?: any; - lowValue?: any; - openValue?: any; - reductionValue?: any; - reductionValueText?: string; - originalMinValue?: any; - rangeValue1?: any; - rangeValue1Text?: string; - rangeValue2?: any; - rangeValue2Text?: string; - point: series.Point; - } - interface z_ChartTooltipOptions extends z_BaseTooltipOptions { - customizeText?: (arg: z_ChartTooltipCustomizeArgument) => string; - customizeTooltip?: (arg: z_ChartTooltipCustomizeArgument) => common.CustomizeTooltipResult; - shared?: boolean; - } - interface z_BaseChartOptions extends ComponentOptions { - incidentOccured?: () => void; - done?: () => void; - tooltipShown?: () => void; - tooltipHidden?: () => void; - pointSelectionMode?: string; - redrawOnResize?: boolean; - tooltip?: z_BaseTooltipOptions; - loadingIndicator?: common.LoadingIndicatorOptions; - margin?: { - left?: number; - top?: number; - right?: number; - bottom?: number; - }; - size?: { - width?: number; - height?: number; - }; - title?: { - horizontalAlignment?: string; - verticalAlignment?: string; - font?: viz.common.FontOptions; - text?: string; - placeholderSize?: number; - margin?: any; - }; - dataSource?: any; - palette?: any; legend?: z_BaseLegendOptions; - theme?: string; - animation?: { - enabled?: boolean; - duration?: number; - easing?: string; - maxPointCountSupported?: number; - asyncSeriesRendering?: boolean; - asyncTrackersRendering?: boolean; - trackerRenderingDelay?: number; - }; - pathModified?: boolean; - } - export interface CommonPaneSettings { - backgroundColor?: string; - border?: { - color?: string; - bottom?: boolean; - left?: boolean; - right?: boolean; - top?: boolean; - dashStyle?: string; - visible?: boolean; - width?: number; - opacity?: number; - }; - } - export interface PaneSettings extends CommonPaneSettings { - name: string; - } - export interface ChartLegendOptions extends z_BaseLegendOptions { - hoverMode?: string; - position?: string; - } - interface z_CommonAxisLabelSettings { - alignment?: string; - font?: viz.common.FontOptions; - indentFromAxis?: number; - overlappingBehavior?: { - mode?: string; - rotationAngle?: number; - staggeringSpacing?: number; - }; - rotationAngle?: number; - staggered?: boolean; - staggeringSpacing?: number; - } - interface z_BaseConstantLineLabel { - visible?: boolean; - position?: string; - font?: viz.common.FontOptions; - } - interface ConstantLineAxisLabel extends z_BaseConstantLineLabel { - horizontalAlignment?: string; - verticalAlignment?: string; - } - export interface ConstantLineLabel extends ConstantLineAxisLabel { - text?: string; - } - export interface CommonConstantLineStyle { - paddingLeftRight?: number; - paddingTopBottom?: number; - width?: number; - dashStyle?: string; - color?: string; - label?: z_BaseConstantLineLabel; - } - export interface ConstantLineOptions extends CommonConstantLineStyle{ - value?: any; - label?: ConstantLineLabel; - } - interface z_AxisConstantLineStyle extends CommonConstantLineStyle { - label?: ConstantLineAxisLabel; - } - interface z_StripStyle { - label?: { - font?: viz.common.FontOptions; - horizontalAlignment?: string; - verticalAlignment?: string; - }; - paddingLeftRight?: number; - paddingTopBottom?: number; - } - export interface CommonAxisSettings { - color?: string; - discreteAxisDivisionMode?: string; - grid?: { - color?: string; - opacity?: string; - visible?: boolean; - width?: number; - } - inverted?: boolean; - label?: z_CommonAxisLabelSettings; - maxValueMargin?: number; - minValueMargin?: number; - opacity?: number; - placeholderSize?: number; - setTicksAtUnitBeginning?: boolean; - stripStyle?: z_StripStyle - constantLineStyle?: CommonConstantLineStyle; - tick?: { - color?: string; - opacity?: number; - visible?: boolean; - }; - title?: { - font?: viz.common.FontOptions; - margin?: number; - text?: string; - }; - valueMarginsEnabled?: boolean; - visible?: boolean; - width?: number; - } - export interface StripOptions extends z_StripStyle{ - color?: string; - endValue: any; - startValue: any; - label?: { - font?: viz.common.FontOptions; - horizontalAlignment?: string; - verticalAlignment?: string; - text?: string; - }; - } - interface z_AxisLabelSettings extends z_CommonAxisLabelSettings{ - customizeText: (arg: { - value: any; - valueText: string; - }) => string; - } - export interface ArgumentAxisOptions extends CommonAxisSettings { - argumentType?: string; - axisDivisionFactor?: number; - categories?: Array; - hoverMode?: string; - label?: z_AxisLabelSettings; - max?: number; - min?: number; - tickInterval?: any; - position?: string; - constantLineStyle?: z_AxisConstantLineStyle; - strips?: Array; - constantLines?: Array; - type?: string; - } - export interface ValueAxisOptions extends CommonAxisSettings { - valueType?: string; - axisDivisionFactor?: number; - categories?: Array; - hoverMode?: string; - max?: number; - min?: number; - tickInterval?: any; position?: string; - strips?: Array; - constantLines?: Array; - constantLineStyle?: z_AxisConstantLineStyle; - type?: string; - name?: string; - label?: z_AxisLabelSettings; - } - interface z_CrosshairLine { - color?: string; - width?: number; - dashStyle?: string; - opacity?: number; - } - interface z_CrosshairOptions extends z_CrosshairLine { - enabled?: boolean; - verticalLine?: z_CrosshairLine; - horizontalLine?: z_CrosshairLine; - } - export interface ChartOptions extends z_BaseChartOptions { - needAggregate?: boolean; - defaultPane?: string; - adjustOnZoom?: boolean; - rotated?: boolean; - synchronizeMultiAxes?: boolean; - equalBarWidth?: { - spacing?: number; - width?: number; - }; - adaptiveLayout?: { - width?: number; - height?: number; - keepLabels?: boolean; - }; - customizePoint?: (arg: { - index: number; - argument: any; - seriesName: string; - tag: any; - value?: any; - rangeValue1?: any; - rangeValue2?: any; - }) => series.BasePointOptions; - customizeLabel?: (arg: { - index: number; - argument: any; - seriesName: string; - tag: any; - value?: any; - ramgeValue1?: any; - rangeValue2?: any; - }) => series.z_BaseLabelOptions; - commonPaneSettings?: CommonPaneSettings; - panes?: Array; - containerBackgroundColor?: string; - seriesTemplate?: { - nameField?: string; - customizeSeries?: (valueFromNameField: string) => viz.charts.series.SeriesOptions; - }; - crosshair?: z_CrosshairOptions; - seriesSelectionMode?: string; - tooltip?: z_ChartTooltipOptions; - dataPrepareSettings?: { - checkTypeForAllData?: boolean; - convertToAxisDataType?: boolean; - sortingMethod?: any; - }; - useAggregation?: boolean; - argumentAxisClick?: (axis: any, argument: any, event: JQueryMouseEventObject) => void; - legend?: ChartLegendOptions; - argumentAxis?: ArgumentAxisOptions; - valueAxis?: Array; - commonAxisSettings?: CommonAxisSettings; - series?: Array; - commonSeriesSettings?: viz.charts.series.commonSeriesSettings; - seriesClick?: (series: viz.charts.series.Series, event: JQueryMouseEventObject) => void; - seriesHover?: (series: viz.charts.series.Series) => void; - seriesSelected?: (series: viz.charts.series.Series) => void; - seriesHoverChanged?: (series: viz.charts.series.Series) => void; - pointClick?: (point: viz.charts.series.Point, event: JQueryMouseEventObject) => void; - legendClick?: (obj: any, event: JQueryMouseEventObject) => void; pointHover?: (point: viz.charts.series.Point) => void; - pointSelected?: (point: viz.charts.series.Point) => void; - seriesSelectionChanged?: (series: viz.charts.series.Series) => void; - pointSelectionChanged?: (point: viz.charts.series.Point) => void; - pointHoverChanged?: (point: viz.charts.series.Point) => void; - drawn?: (arg:viz.Chart) => void; - minBubbleSize?: number; - maxBubbleSize?: number; - } - export interface PieOptions extends z_BaseChartOptions { - pointClick?: (point: viz.charts.series.PiePoint, event: JQueryMouseEventObject) => void; - legendClick?: (point: viz.charts.series.PiePoint, event: JQueryMouseEventObject) => void; - pointHover?: (point: viz.charts.series.PiePoint) => void; - pointSelected?: (point: viz.charts.series.PiePoint) => void; - pointSelectionChanged?: (point: viz.charts.series.PiePoint) => void; - pointHoverChanged?: (point: viz.charts.series.PiePoint) => void; - series?: viz.charts.series.PieSeriesOptions; - drawn?: (arg:viz.PieChart) => void; - } - export interface RenderOptions { - force?: boolean; - animate?: boolean; - asyncSeriesRendering?: boolean; - } -} -declare module DevExpress.viz.charts.series { - export interface z_BasePointStyle { - color?: string; - border?: { - visible?: boolean; - width?: number; - color?: string; - }; - size?: number; - } - interface BasePointOptions extends z_BasePointStyle { - hoverMode?: string; - selectionMode?: string; - visible?: boolean; - symbol?: string; - image?: any; - hoverStyle?: z_BasePointStyle; - selectionStyle?: z_BasePointStyle; - } - interface z_BaseSeriesOptions { - argumentField?: string; - hoverMode?: string; - maxLabelCount?: number; - label?: z_BaseLabelOptions; - selectionMode?: string; - showInLegend?: boolean; - tagField?: string; - visible?: boolean; - } - interface z_BaseLabelOptions { - visible?: boolean; - alignment?: string; - rotationAngle?: number; - format?: string; - precision?: number; - argumentFormat?: string; - argumentPrecision?: number; - precission?: number; - percentPrecision?: number; - font?: viz.common.FontOptions; - backgroundColor?: string; - border?: { - visible?: boolean; - width?: number; - color?: string; - dashStyle?: string; - }; - connector?: { - visible?: boolean; - width?: number; - color?: string; - } - } - interface z_BaseChartSeriesLabelOptions extends z_BaseLabelOptions { - horizontalOffset?: number; - verticalOffset?: number; - customizeText?: (arg: { - originalValue: any; - value: any; - valueText: string; - originalArgument: any; - argument: any; - argumentText: string; - seriesName: string; - }) => string; - } - interface z_BaseSeriesStyle { - color?: string; - } - export interface ScatterSeriesOptions extends z_BaseSeriesOptions, z_BaseSeriesStyle { - selectionStyle?: z_BaseSeriesStyle; - hoverStyle?: z_BaseSeriesStyle; - valueField?: string; - point?: BasePointOptions; - axis?: string; - pane?: string; - } - export interface LineSeriesStyle extends z_BaseSeriesStyle { - dashStyle?: string; - width?: number; - } - export interface LineSeriesOptions extends LineSeriesStyle, z_BaseSeriesOptions { - selectionStyle?: LineSeriesStyle; - hoverStyle?: LineSeriesStyle; - valueField?: string; - point?: BasePointOptions; - pane?: string; - } - export interface AreaSeriesStyle extends z_BaseSeriesStyle { - hatching?: { - direction?: string; - width?: number; - step?: number; - opacity?: number - }; - border?: { - visible?: boolean; - width?: number; - color?: string; - dashStyle?: string; - }; - } - export interface AreaSeriesOptions extends AreaSeriesStyle, z_BaseSeriesOptions { - selectionStyle?: AreaSeriesStyle; - hoverStyle?: AreaSeriesStyle; - valueField?: string; - point?: BasePointOptions; - pane?: string; - axis?: string; - } - export interface BarSeriesLabel extends z_BaseChartSeriesLabelOptions { - position?: string; - showForZeroValues?: boolean; - } - export interface BarSeriesStyle extends AreaSeriesStyle { } - interface z_BaseBarSeriesOptions extends z_BaseSeriesOptions, BarSeriesStyle { - minBarSize?: number; - cornerRadius?: number; - label?: BarSeriesLabel; - selectionStyle?: BarSeriesStyle; - hoverStyle?: BarSeriesStyle; - pane?: string; - axis?: string; - } - export interface BarSeriesOptions extends z_BaseBarSeriesOptions { - valueField?: string; - } - export interface OHLCSeriesStyle extends z_BaseSeriesStyle{ - width?: number; - } - interface z_BaseOHLCSeries extends z_BaseSeriesOptions{ - openValueField?: string; - highValueField?: string; - lowValueField?: string; - closeValueField?: string; - reduction?: { - color?: string; - level?: string; - }; - pane?: string; - axis?: string; - } - export interface CandleStickSeriesOptions extends z_BaseOHLCSeries, OHLCSeriesStyle { - innerColor?: string; - selectionStyle?: OHLCSeriesStyle; - hoverStyle?: OHLCSeriesStyle; - } - export interface StockSeriesOptions extends z_BaseOHLCSeries, OHLCSeriesStyle { - selectionStyle?: OHLCSeriesStyle; - hoverStyle?: OHLCSeriesStyle; - } - export interface FullStackedAreaSeriesOptions extends z_BaseSeriesOptions, AreaSeriesOptions { - valueField?: string; - selectionStyle?: AreaSeriesStyle; - hoverStyle?: AreaSeriesStyle; - point?: BasePointOptions; - } - export interface FullStackedBarSeriesOptions extends BarSeriesOptions { - stack?: string; - } - export interface FullStackedLineSeriesOptions extends LineSeriesOptions{ - point?: BasePointOptions; - } - interface z_BaseRangeSeriesOptions extends z_BaseSeriesOptions { - rangeValue1Field?: string; - rangeValue2Field?: string; - pane?: string; - axis?: string; - } - export interface RangeAreaSeriesOptions extends z_BaseSeriesOptions, AreaSeriesStyle { - selectionStyle?: AreaSeriesStyle; - hoverStyle?: AreaSeriesStyle; - point?: BasePointOptions; - } - export interface RangeBarSeriesOptions extends z_BaseBarSeriesOptions { - rangeValue1Field?: string; - rangeValue2Field?: string; - pane?: string; - axis?: string; - } - export interface SplineSeriesOptions extends LineSeriesOptions {} - export interface SplineAreaSeries extends AreaSeriesOptions { } - export interface StackedLineSeries extends LineSeriesOptions { } - export interface StackedAreaSeries extends AreaSeriesOptions { } - export interface StackedBasrSeriesOptions extends BarSeriesOptions { - stack?: string; - } - export interface BubbleSeriesStyle extends AreaSeriesStyle { } - export interface BubbleSeriesOptions extends z_BaseBarSeriesOptions, BubbleSeriesStyle { - selectionStyle?: LineSeriesStyle; - hoverStyle?: LineSeriesStyle; - valueField?: string; - pane?: string; - sizeField?: string; - } - export interface StepLineSeries extends LineSeriesOptions { } - export interface StepAreaSeries extends AreaSeriesOptions { } - export interface PieSeriesStyle extends AreaSeriesStyle { } - interface PieSeriesLabelOptions extends z_BaseLabelOptions { - customizeText: (arg: { - value: any; - valueText: string; - originalValue: any; - argument: any; - argumentText: string; - originalArgument: any; - percent: any; - percentText: string; - seriesName: string; - }) => string; - radialOffset?: number; - } - export interface PieSeriesOptions extends z_BaseSeriesOptions, PieSeriesStyle{ - valueField?: string; - minSegmentSize?: string; - selectionStyle?: PieSeriesStyle; - hoverStyle?: PieSeriesStyle; - segmentsDirection?: string; - startAngle?: number; - type?: string; - label?: PieSeriesLabelOptions; - smallValuesGrouping?: valuesGrouping; - } - interface valuesGrouping{ - mode?: string; - topCount?: number; - threshold?: number; - groupName?: string; - } - interface AllSeriesStyleOptions extends z_BaseSeriesStyle, AreaSeriesStyle, LineSeriesStyle { } - interface z_AllLabelsOptions extends z_BaseChartSeriesLabelOptions, BarSeriesLabel { } - export interface CommonSeriesOptions extends z_BaseSeriesOptions, z_BaseBarSeriesOptions, z_BaseRangeSeriesOptions, z_BaseOHLCSeries, AllSeriesStyleOptions, BubbleSeriesOptions { - selectionStyle?: AllSeriesStyleOptions; - hoverStyle?: AllSeriesStyleOptions; - label?: z_AllLabelsOptions; - valueField?: string; - } - export interface SeriesOptions extends CommonSeriesOptions { - tag?: any; - name?: string; - type?: string; - } - export interface commonSeriesSettings extends CommonSeriesOptions { - area?: AreaSeriesOptions; - bar?: BarSeriesOptions; - candlestick?: CandleStickSeriesOptions; - fullstackedarea?: FullStackedAreaSeriesOptions; - fullstackedbar?: FullStackedBarSeriesOptions; - fullstackedline?: FullStackedLineSeriesOptions; - line?: LineSeriesOptions; - rangearea?: RangeAreaSeriesOptions; - rangebar?: RangeBarSeriesOptions; - scatter?: ScatterSeriesOptions; - spline?: SplineSeriesOptions; - splinearea?: SplineAreaSeries; - stackedarea?: StackedAreaSeries; - stackedbar?: StackedBasrSeriesOptions; - stackedline?: StackedLineSeries; - steparea?: StepAreaSeries; - stepline?: StepLineSeries; - stock?: StockSeriesOptions; - bubble?: BubbleSeriesOptions; - } - class z_BasePoint { - fullState: number; - originalArgument: any; - originalValue: any; - tag: any; - clearSelection(): void; - select(): void; - hideTootip(): void; - isSelected(): boolean; - isHovered(): boolean; - getColor(): string; - } - export class Point extends z_BasePoint{ - series: Series; - } - export class PiePoint extends z_BasePoint { - percent: any; - series: PieSeries; - isVisible():boolean; - hide(): void; - show(): void; - } - export class Series { - axis: string; - fullState: number; - name: string; - pane: string; - tag: any; - type: string; - clearSelection (): void; - deselectPoint (point:Point) : void; - getAllPoints () : Array - getPointByArg(pointArg: any): Point; - getPointByPos(positionIndex: number): Point; - select () : void; - selectPoint (point:Point) : void; - isSelected (): boolean; - isHovered(): boolean; - isVisible(): boolean; - show(): void; - hode(): void; - } - export class PieSeries { - fullState: number; - type: string; - clearSelection(): void; - deselectPoint(point:PiePoint): void; - getAllPoints(): Array - getPointByArg(pointArg: any): PiePoint; - getPointByPos(positionIndex: number): PiePoint; - select(): void; - selectPoint(point: PiePoint): void; - isSelected(): boolean; - isHovered(): boolean; - } -} -declare module DevExpress.viz.common { - export interface FontOptions { - color?: string; - family?: string; - opacity?: number; - size?: number; - weight?: number; - } - export interface tickIntervalObject { - years?: number; - quarters?: number; - months?: number; - days?: number; - hours?: number; - minutes?: number; - seconds?: number; - milliseconds?: number; - } - export interface LoadingIndicatorOptions { - backgroundColor?: string; - text?: string; - font?: FontOptions; - } - export interface CustomizeTooltipResult { - color?: string; - text?:string; - } - export interface BaseTooltipOptions { - enabled?: boolean; - color?: string; - border?: { - dashStyle?: string; - color?: string; - opacity?: number; - visible?: boolean; - width?: number; - }; - font?: FontOptions; - arrowLength?: number; - paddingLeftRight?: number; - paddingTopBottom?: number; - opacity?: number; - chadow?: { - color?: string; - opacity?: number; - offsetX?: number; - offsetY?: number; - blur?: number; - } - } -} -declare module DevExpress.viz.gauges { - interface CustomizeTextArgument { - value: number; - valueText: string; - color: string; - } - interface z_textOptions { - format?: string; - precision?: number; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - } - interface z_textOptionsWithIndent extends z_textOptions { - indent?: number; - } - interface z_GaugeTooltipOptions extends common.BaseTooltipOptions { - format?: string; - precision?: number; - customizeText?: (arg: CustomizeTextArgument) => string; - customizeTooltip?: (arg: CustomizeTextArgument) => common.CustomizeTooltipResult; - } - interface z_BaseGaugeOptions { - size?: { - width?: number; - height?: number; - }; - margin?: { - left?: number; - right?: number; - top?: number; - bottom?: number; - }; - theme?: string; - loadingIndicator?: common.LoadingIndicatorOptions; - containerBackgroundColor?: string; - animation?: { - enabled?: boolean; - duration?: number; - easing?: string; - }; - redrawOnResize?: boolean; - title?: { - position?: string; - text?: string; - font?: viz.common.FontOptions; - }; - subtitle?: { - text?: string; - font?: viz.common.FontOptions; - }; - tooltip?: z_GaugeTooltipOptions; - value?: number; - subvalues?: Array; - pathModified?: boolean; - } - interface z_BaseRangeContainer { - offset?: number; - backgroundColor?: string; - ranges?: Array<{ - startValue?: number; - endValue?: number; - color?: string; - }> - } - interface z_BaseScale { - startValue?: number; - endValue?: number; - hideFirstTick?: boolean; - hideLastTick?: boolean; - hideFirstLabel?: boolean; - hideLastLabel?: boolean; - majorTick?: { - color?: string; - length?: number; - width?: number; - customTickValues?: Array; - useTicksAutoArrangement?: boolean; - tickInterval?: number; - showCalculatedTicks?: boolean; - visible?: boolean; - }; - minorTick?: { - color?: string; - length?: number; - width?: number; - customTickValues?: Array; - tickInterval?: number; - showCalculatedTicks?: boolean; - visible?: boolean; - }; - label?: z_textOptions; - } - interface z_BaseValueIndicator { - color?: string; - baseValue?: number; - size?: number; - backgroundColor?: string; - text?: z_textOptionsWithIndent; - } - interface z_BaseSubValueIndicator { - type?: string; - length?: number; - width?: number; - color?: string; - arrowLength?: number; - text?: z_textOptions; - palette?: Array - } - export interface CircularGaugeRangeContainer extends z_BaseRangeContainer { - width?: number; - orientation?: string; - } - export interface CircularGaugeScale extends z_BaseScale{ - orientation: string; - label: { - format?: string; - precision?: number; - customizeText?: (arg:CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - indentFromTick?: number; - } - } - export interface CircularGaugeValueIndicator extends z_BaseValueIndicator { - type?: string; - offset?: number; - indentFromCenter?: number; - width?: number; - secondColor?: string; - secondFraction?: number; - spindleSize?: number; - spindleGapSize?: number; - } - export interface CircularGaugeSubValueIndicator extends z_BaseSubValueIndicator { - offset?: number; - } - export interface CircularGaugeOptions extends z_BaseGaugeOptions{ - rangeContainer?: CircularGaugeRangeContainer; - geometry?: { - startAngle?: number; - endAngle?: number; - }; - scale?: CircularGaugeScale; - valueIndicator?: CircularGaugeValueIndicator; - spindle?: { - visible?: boolean; - size?: number; - gapSize?: number; - color?: string; - }; - drawn?: (arg:viz.CircularGauge) => void; - } - export interface LinearGaugeScale extends z_BaseScale { - verticalOrientation?: string; - horizontalOrientation?: string; - label?: { - format?: string; - precision?: number; - customizeText?: (arg:CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - indentFromTick?: number; - } - } - export interface LinearGaugeRangeContainer extends z_BaseRangeContainer { - width?: { - start?: number; - end?: number; - }; - verticalOrientation?: string; - horizontalOrientation?: string; - } - export interface LinearGaugeValueIndicator extends z_BaseValueIndicator { - offset?: number; - horizontalOrientation?: string; - verticalOrientation?: string; - length?: number; - width?: number; - } - export interface LinearGaugeSubValueIndicator extends z_BaseSubValueIndicator { - offset?: number; - horizontalOrientation?: string; - verticalOrientation?: string; - } - export interface LinearGaugeOptions extends z_BaseGaugeOptions { - geometry?: { - orientation?: string; - }; - scale?: LinearGaugeScale; - valueIndicator?: LinearGaugeValueIndicator; - drawn?: (arg:viz.LinearGauge) => void; - } - export interface BarGaugeOptions { - size?: { - width?: number; - height?: number; - }; - theme?: string; - loadingIndicator?: common.LoadingIndicatorOptions; - animationEnabled?: boolean; - animationDuration?: number; - animation?: { - enabled?: boolean; - duration?: number; - easing?: string; - }; - redrawOnResize?: boolean; - title?: { - position?: string; - text?: string; - font?: viz.common.FontOptions; - }; - subtitle?: { - text?: string; - font?: viz.common.FontOptions; - }; - tooltip?: z_GaugeTooltipOptions; - geometry?: { - startAngle?: number; - endAngle?: number; - }; - label?: { - visible?: boolean; - indent?: number; - connectorWidth?: number; - connectorColor?: string; - format?: string; - precision?: number; - customizeText?: (arg:CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - }; - startValue?: number; - endValue?: number; - baseValue?: number; - values?: Array; - drawn?: (arg:viz.BarGauge) => void; - pathModified?: boolean; - } -} -declare module DevExpress.viz.map { - interface TooltipOptions extends common.BaseTooltipOptions { - customizeText?: (arg: Proxy) => string; - customizeTooltip?: (arg: Proxy) => common.CustomizeTooltipResult; - borderColor?: string; - } - export interface VectorMapOptions { - size?: { - width?: number; - height?: number; - }; - theme?: string; - background?: { - borderColor?: string; - color?: string; - }; - loadingIndicator?: common.LoadingIndicatorOptions; - mapData?: any; - areaSettings?: { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - hoverEnabled?: boolean; - selectionMode?: string; - palette?: any; - paletteSize?: number; - customize?: (arg: any) => AreaOptions; - click?: (arg: AreaProxy, event: JQueryMouseEventObject) => void; - selectionChanged?: (arg: AreaProxy) => void; - }; - markers?: any; - markerSettings?: { - size?: number; - minSize?: number; - maxSize?: number; - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - font?: common.FontOptions; - hoverEnabled?: boolean; - selectionMode?: string; - customize?: (arg: any) => MarkerOptions; - click?: (arg: MarkerProxy, event: JQueryMouseEventObject) => void; - selectionChanged?: (arg: MarkerProxy) => void; - }; - controlBar?: { - enabled?: boolean; - borderColor?: string; - color?: string; - }; - tooltip?: TooltipOptions; - bounds?: Array; - center?: Array; - zoomFactor?: number; - click?: (event: JQueryMouseEventObject) => void; - centerChanged?: (arg: Array) => void; - zoomFactorChanged?: (arg: number) => void; - drawn?: (arg: viz.Map) => void; - pathModified?: boolean; - } - export interface AreaOptions { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - paletteIndex?: number; - isSelected?: boolean; - } - export interface MarkerOptions { - borderColor?: string; - color?: string; - hoveredBorderColor?: string; - hoveredColor?: string; - selectedBorderColor?: string; - selectedColor?: string; - isSelected?: boolean; - } - export interface Proxy { - type: string; - attribute(name: string): any; - selected(state: boolean): void; - selected(): boolean; - } - export interface AreaProxy extends Proxy { - } - export interface MarkerProxy extends Proxy { - coordinates(): Array; - } -} -declare module DevExpress.viz.rangeSelector { - export interface SelectedRange { - startValue: any; endValue: any; - } - interface CustomizeTextArgument { - value: any; - valueText: string; - } - export interface RangeSelectorOptions { - background?: { - color?: string; - image?: { - location?: string; - url?: string; - } - visible?: boolean; - }; - loadingIndicator?: common.LoadingIndicatorOptions; - behavior?: { - allowSlidersSwap?: boolean; - animationEnabled?: boolean; - callSelectedRangeChanged?: string; - manualRangeSelectionEnabled?: boolean; - moveSelectedRangeByClick?: boolean; - snapToTicks?: boolean; - }; - chart?: { - bottomIndent?: number; - equalBarWidth?: { - spacing?: number; - width?: number; - }; - dataPrepareSettings?: { - checkTypeForAllData?: boolean; - convertToAxisDataType?: boolean; - sortingMethod?: any; }; - useAggregation?: boolean; - series?: Array; - commonSeriesSettings?: viz.charts.series.commonSeriesSettings; - topIndent?: number; - valueAxis?: { - max?: any; min?: any; inverted?: boolean; - valueType?: string; - type?: string; - logarithmBase?: number; - }; - } - containerBackgroundColor?: string; - dataSource?: Array<{}>; - dataSourceField?: string; - margin?: { - left?: number; - top?: number; - right?: number; - bottom?: number; - }; - redrawOnResize?: boolean; - scale?: { - startValue?: any; endValue?: any; - label?: { - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - format?: string; - precision?: number; - topIndent?: number; - visible?: boolean; - }; - majorTickInterval?: any; marker?: { - label?: { - customizeText?: (arg: CustomizeTextArgument) => string; - format?: string; - }; - separatorHeight?: number; - textLeftIndent?: number; - textTopIndent?: number; - topIndent?: number; - visible?: boolean; - }; - maxRange?: any; minorTickCount?: number; - placeHolderHeight?: number; - setTicksAtUnitBeginning?: boolean; - showCustomBoundaryTicks?: boolean; - showMinorTicks?: boolean; - tick?: { - color?: string; - opacity?: number; - width?: number; - }; - minorTickInterval?: any; useTicksAutoArrangement?: boolean; - valueType?: string; - type?: string; - logarithmBase?: number; - } - selectedRange?: SelectedRange; - selectedRangeChaged?: (startValue: any, endValue: any) => void; - shutter?: { - color?: string; - opacity?: string; - } - size?: { - width?: number; - height?: number; - }; - sliderHandle?: { - color?: string; - opacity?: number; - width?: string; - }; - sliderMarker?: { - color?: string; - customizeText?: (arg: CustomizeTextArgument) => string; - font?: viz.common.FontOptions; - format?: string; - invalidRangeColor?: string; - padding?: number; - placeHolderSize?: { - height?: number; - width?: { - left?: number; - right?: number; - } - precission?: number; - visible?: boolean; - } - }; - theme?: string; - drawn?: (arg:viz.RangeSelector) => void; - pathModified?: boolean; - } -} -declare module DevExpress.viz.sparklines { - interface z_SparklineTooltipFormatObject { - firstValue?: string; - lastValue?: string; - maxValue?: string; - minValue?: string; - originalFirstValue?: any; - originalLastValue?: any; - originalMaxValue?: any; - originalMinValue?: any; - } - interface SparklineTooltipOptions extends common.BaseTooltipOptions { - customizeText?: (arg: z_SparklineTooltipFormatObject) => string; - customizeTooltip?: (arg: z_SparklineTooltipFormatObject) => common.CustomizeTooltipResult; - allowContainerResizing?: boolean; - horizontalAlignment?: string; - verticalAlignment?: string; - format?: string; - precision?: number; - } - interface z_BaseSparklineSettings { - theme?: string; - size?: { - width?: number; - height?: number; - }; - tooltip?: SparklineTooltipOptions; - pathModified?: boolean; - } - interface SparklineOptions extends z_BaseSparklineSettings { - dataSource?: Array; - argumentField?: string; - valueField?: string; - type?: string; - lineColor?: string; - lineWidth?: number; - showFirstLast?: boolean; - showMinMax?: boolean; - minColor?: string; - maxColor?: string; - firstLastColor?: string; - barPositiveColor?: string; - barNegativeColor?: string; - winColor?: string; - lossColor?: string; - pointSymbol?: string; - pointSize?: number; - pointColor?: string; - winlossThreshold?: number; - drawn?: (arg:viz.Sparkline) => void; - ignoreEmptyPoints?: boolean; - } - interface z_BulletTooltipFormatObject { - originalValue?: any; - originalTarget?: any; - value?: string; - target?: string; - } - interface BulletTooltipOptions extends SparklineTooltipOptions { - customizeText?: (arg: z_BulletTooltipFormatObject) => string; - customizeTooltip?: (arg: z_BulletTooltipFormatObject) => common.CustomizeTooltipResult; - } - interface BulletOptions extends z_BaseSparklineSettings{ - value?: number; - target?: number; - endScaleValue?: number; - color?: string; - targetColor?: string; - targetWidth?: number; - targetVisible?: boolean; - tooltip?: BulletTooltipOptions; - drawn?: (arg:viz.Bullet) => void; - } -} -interface JQuery { - dxChart(options?: DevExpress.viz.charts.ChartOptions): JQuery; - dxChart(method: string, param1?:any, param2?:any): any; - dxPieChart(options?: DevExpress.viz.charts.PieOptions): JQuery; - dxPieChart(method: string, param1?: any, param2?: any): any; - dxRangeSelector(options?: DevExpress.viz.rangeSelector.RangeSelectorOptions): JQuery; - dxRangeSelector(method: string, param1?: any, param2?: any): any; - dxCircularGauge(options?: DevExpress.viz.gauges.CircularGaugeOptions): JQuery; - dxCircularGauge(method: string, param1?: any, param2?: any): any; - dxLinearGauge(options?: DevExpress.viz.gauges.LinearGaugeOptions): JQuery; - dxLinearGauge(method: string, param1?: any, param2?: any): any; - dxBarGauge(options?: DevExpress.viz.gauges.BarGaugeOptions): JQuery; - dxBarGauge(method: string, param1?: any, param2?: any): any; - dxSparkline(options?: DevExpress.viz.sparklines.SparklineOptions): JQuery; - dxSparkline(method: string, param1?: any, param2?: any): any; - dxBullet(options?: DevExpress.viz.sparklines.BulletOptions): JQuery; - dxBullet(method: string, param1?: any, param2?: any): any; - dxVectorMap(options?: DevExpress.viz.map.VectorMapOptions): JQuery; - dxVectorMap(method: string, param1?: any, param2?: any): any; -} \ No newline at end of file diff --git a/devextreme/14.1/dx.phonejs-14.1-tests.ts b/devextreme/14.1/dx.phonejs-14.1-tests.ts deleted file mode 100644 index 9c3f49db36..0000000000 --- a/devextreme/14.1/dx.phonejs-14.1-tests.ts +++ /dev/null @@ -1,258 +0,0 @@ -/// - -module Test { - var url = "http://some-json-service.net/data.json"; - var dsFromUrl = new DevExpress.data.DataSource(url); - - var dsFromObject = new DevExpress.data.DataSource({ - load: function (loadOptions?: DevExpress.data.LoadOptions) { - return $.ajax(url); - } - }); - - var application:DevExpress.framework.html.HtmlApplication = new DevExpress.framework.html.HtmlApplication({ - namespace: "global", - defaultLayout: "slideout", - navigation: [ - { id: "first", title: "Home", action: "#home" }, - { id: "second", title: "About", action: "#about" } - ] - }); - application.router.register(":view/:id", { view: "home", id: undefined }); - application.navigate(); - - $("div").appendTo(document.body).dxMap({ - location: [40.749825, -73.987963], - zoom: 13, - provider: "googleStatic", - controls: true, - routes: [ - { - weight: 4, - opacity: 0.75, - color: "red", - mode: "walking", - locations: [ - [40.737102, -73.990318], - [40.749825, -73.987963], - [40.75, -73.98], - [40.755823, -73.986397] - ] - } - ] - }); - $("div").appendTo(document.body).dxTabs({ - itemClickAction: function (e: any) { - console.log(e.itemData.text); - }, - items: [ - { text: "user" }, - { text: "analytics" }, - { text: "customers" }, - { text: "search" }, - { text: "favorites" } - ] - }); - - $("div").appendTo(document.body).dxList({ - scrollByContent: true, - items: ["item1", "item2", "item3"], - itemHoldAction: function (e: any) { console.log("itemHold"); }, - itemClickAction: function (e: any) { console.log("itemClick"); }, - itemSwipeAction: function (e: any) { console.log("itemSwipe " + e.direction); } - }); - $("div").appendTo(document.body).dxToast({ - type: 'error', - message: 'Sample error message' - }); - $("div").appendTo(document.body).dxPopup({ - closeButton: true, - title: "Popup title" - }); - $("div").appendTo(document.body).dxPivot({ - items: [ - { title: "all", text: "all" }, - { title: "unread", text: "unread" }, - { title: "favorites", text: "favorites" } - ], - itemSelectAction: function (e: Object) { console.log("itemSelectAction"); } - }); - $("div").appendTo(document.body).dxLookup({ - items: [ - { id: 1, caption: "red" }, - { id: 3, caption: "blue" }, - { id: 6, caption: "white" }, - { id: 2, caption: "green" }, - { id: 4, caption: "yellow" }, - { id: 5, caption: "orange" }, - { id: 7, caption: "purple" } - ], - valueExpr: 'id', - displayExpr: 'caption', - itemRender: function (item: any) { - return "Text is: " + item.caption; - } - }); - $("div").appendTo(document.body).dxSlider({ - min: 50, - value: 75, - max: 100, - disabled: false - }); - $("div").appendTo(document.body).dxNavBar({ - items: [ - { text: "user", icon: "user" }, - { text: "find", icon: "find", disabled: false }, - { text: "favorites", icon: "favorites" }, - { text: "about", icon: "info" }, - { text: "home", icon: "home" }, - { text: "URI", icon: "tips" } - ], - itemClickAction: function (e: any) { console.log(e.itemData.text); } - }); - $("div").appendTo(document.body).dxSwitch({ - value: false, - onText: 'LongName', - offText: 'Short', - width: "100%", - visible: true - }); - $("div").appendTo(document.body).dxButton({ - text: "Click me", - icon: 'add', - clickAction: function () { console.log("clicked"); } - }); - $("div").appendTo(document.body).dxOverlay({ - visible: false, - closeOnOutsideClick: true, - contentReadyAction: function () { - $("#hideButton").dxButton({ - text: "Hide", - clickAction: function () { $("#overlay").data("dxOverlay").option("visible", false); } - }); - } - }); - $("div").appendTo(document.body).dxDateBox({ - value: new Date(), - format: "datetime" - }); - $("div").appendTo(document.body).dxPopover({ - width: '300', - height: 'auto', - visible: true, - target: '.dx-button' - }); - $("div").appendTo(document.body).dxTextBox({ - value: "Text", - placeholder: "Placeholder", - mode: "email", - maxLength: 20, - readOnly: false, - changeAction: function (e:Object) { console.log("value changed"); }, - valueUpdateAction: function (e:Object) { console.log("value updated"); } - }); - $("div").appendTo(document.body).dxToolbar({ - items: [ - { align: 'left', widget: 'button', options: { type: 'back', text: 'Back', clickAction: function (e:Object) { console.log("back clicked"); } } }, - { align: 'center', widget: 'button', options: { text: 'button', clickAction: function (e:Object) { console.log("button clicked"); } } }, - { align: 'center', widget: 'button', options: { icon: 'plus', text: 'add', clickAction: function (e:Object) { console.log("plus clicked"); } } }, - { align: 'right', widget: 'button', options: { icon: 'find', clickAction: function (e:Object) { console.log("find clicked"); } }, useMenu: false }, - { text: 'Products', isMenu: true } - ] - }); - $("div").appendTo(document.body).dxTileView({ - items: [ - { text: "item1", widthRatio: 1.7, heightRatio: 1.7 }, - { text: "item2", widthRatio: 0.2, heightRatio: 0.2 }, - { text: "item3", widthRatio: 2, heightRatio: 2 } - ], - listHeight: 500, - itemRender: function (item: any) { return "Text is: " + item.text; }, - itemClickAction: function () { console.log("itemClick"); }, - baseItemWidth: 100, - baseItemHeight: 100, - itemMargin: 20 - }); - $("div").appendTo(document.body).dxPanorama({ - title: "my panorama", - items: [ - { header: "first", text: "first item" }, - { text: "second item" }, - { text: "third" }, - { text: "fourth" } - ], - selectedIndex: 0, - backgroundImage: { width: 89, height: 50 }, - itemSelectAction: function () { console.log("item selected"); } - }); - $("div").appendTo(document.body).dxCheckBox({ - checked: false, - disabled: false, - clickAction: function (e:Object) { console.log("clicked"); } - }); - $("div").appendTo(document.body).dxTextArea({ - value: 'Disabled', - disabled: true, - placeholder: "Placeholder" - }); - $("div").appendTo(document.body).dxLoadPanel({ - message: 'Please wait ...', - showIndicator: true, - visible: true - }); - $("div").appendTo(document.body).dxNumberBox({ - value: 100, - min: 0, - max: 200 - }); - $("div").appendTo(document.body).dxSelectBox({ - value: 2, - dataSource: new DevExpress.data.DataSource([1, 2, 2, 3]) - }); - $("div").appendTo(document.body).dxScrollable({ - useNative: false, - startAction: function (e:Object) { console.log("start"); }, - endAction: function (e:Object) { console.log("end"); } - }); - $("div").appendTo(document.body).dxRadioGroup({ - items: [{ text: "0" }, { text: "1" }, { text: "2" }], - name: "Sample", - selectedIndex: -1 - }); - $("div").appendTo(document.body).dxScrollView({ - pullDownAction: function (e:Object) { console.log("pulling down"); }, - reachBottomAction: function (e:Object) { console.log("bottom reached"); }, - disabled: false - }); - $("div").appendTo(document.body).dxActionSheet({ - title: 'Select action', - items: [ - { text: "Reply", clickAction: function () { console.log("Reply"); } }, - { text: "Forward", clickAction: function () { console.log("Forward"); } }, - { text: "Delete", clickAction: function () { console.log("Delete"); }, type: "danger" }, - { text: "Save Image", clickAction: function () { console.log("Save Image"); }, disabled: true } - ], - showTitle: true, - disabled: false, - target: '#button' - }); - $("div").appendTo(document.body).dxRangeSlider({ - start: 30, - end: 70, - min: 0, - max: 100, - step: 1 - }); - $("div").appendTo(document.body).dxAutocomplete({ - value: "Ivan", - dataSource: new DevExpress.data.DataSource(["Ivan", "Svyatoslav", "Alexander", "Nikolay", "Dmitry", "Afanasiy", "John", "Nash", "Stacy", "Izabella", "Margarita", "Anna"]), - placeholder: "Type name, please", - maxItemsCount: 3, - minSearchLength: 2, - searchTimeout: 1000 - }); - $("div").appendTo(document.body).dxDropDownMenu({ - items: ["Item 1", "Item 2", "Item 3"], - itemTemplate: 'itemWithIcon' - }); -} \ No newline at end of file diff --git a/devextreme/14.1/dx.phonejs-14.1.d.ts b/devextreme/14.1/dx.phonejs-14.1.d.ts deleted file mode 100644 index 54c2e19b72..0000000000 --- a/devextreme/14.1/dx.phonejs-14.1.d.ts +++ /dev/null @@ -1,1507 +0,0 @@ -// Type definitions for PhoneJS 14.1.+ -// Project: http://js.devexpress.com/MobileDevelopment/ -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module DevExpress { - export function abstract(): void; - export var rtlEnabled: boolean; - export var hardwareBackButton: JQueryCallback; - interface Endpoint { - local?: string; - production: string; - } - class EndpointSelector { - constructor(config: { [key: string]: Endpoint }); - urlFor(key: string): string; - } - export interface ActionOptions { - context?: Object; - component?: any; - beforeExecute? (e:ActionExecuteArgs): void; - afterExecute? (e:ActionExecuteArgs): void; - } - export interface ActionExecuteArgs { - action: any; - args: any[]; - context: any; - component: any; - cancel: boolean; - handled: boolean; - } - export class Action { - constructor(action?: any, config?: ActionOptions); - execute(): any; - } - export interface IDevice { - deviceType?: string; - platform?: string; - version?: Array; - phone?: boolean; - tablet?: boolean; - android?: boolean; - ios?: boolean; - win8?: boolean; - tizen?: boolean; - generic?: boolean; - } - export module devices { - export function orientation(): string; - export var orientationChanged: JQueryCallback; - export function real(): IDevice; - export function current(deviceOrName: string): IDevice; - export function current(deviceOrName: IDevice): IDevice; - } - export function registerComponent(name: string, componentClass: any): void; - export interface ComponentOptions { - disabled?: boolean; - } - export class Component { - constructor(element: Element, options?: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - disposing: JQueryCallback; - optionChanged: JQueryCallback; - instance(): Component; - beginUpdate(): void; - endUpdate(): void; - option(): any; - option(options: string): any; - option(options: string): T; - option(options: string, value: any): void; - option(options: { [key: string]: any }): void; - option(options?: any): any; - } - export interface DOMComponentOptions extends ComponentOptions { - rtlEnabled?: boolean; - } - export class DOMComponent extends Component { - constructor(element: HTMLElement, options?: DOMComponentOptions); - static defaultOptions(rule: { - device: any; - options: { [key: string]: any }; - }): void; - } -} -declare module DevExpress.data { - export interface DataError extends Error { - httpStatus?: number; - errorDetails?: any; - } - export interface ErrorHandler { (e: DataError): void; } - export interface EntityOptions { key: any; keyType: any; } - export interface Getter { (obj: any, options?: any): any; } - export interface Setter { (obj: any, value: any, options?: any): void; } - export interface QueryOptions { - errorHandler?: ErrorHandler; - requireTotalCount?: boolean; - } - export interface ODataQueryOptions extends QueryOptions { - adapter?: any; - } - interface IQuery { - enumerate(): JQueryPromise>; - count(): JQueryPromise; - slice(skip: number, take?: number): IQuery; - sortBy(field: string): IQuery; - sortBy(field: Getter): IQuery; - sortBy(field: { field: string; desc?: boolean }): IQuery; - sortBy(field: { field: Getter; desc?: boolean }): IQuery; - thenBy(field: string): IQuery; - thenBy(field: Getter): IQuery; - thenBy(field: { field: string; desc?: boolean }): IQuery; - thenBy(field: { field: Getter; desc?: boolean }): IQuery; - filter(field: string, operator: string, value: any): IQuery; - filter(field: string, value: any): IQuery; - filter(criteria: any[]): IQuery; - select(field: string): IQuery; - select(field: string[]): IQuery; - select(...field: string[]): IQuery; - select(field: Getter): IQuery; - select(field: Getter[]): IQuery; - select(...field: Getter[]): IQuery; - groupBy(field: string[]): IQuery; - groupBy(field: Getter[]): IQuery; - groupBy(field: { field: string; desc?: boolean }[]): IQuery; - groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; - sum(getter?: string): JQueryPromise; - min(getter?: string): JQueryPromise; - max(getter?: string): JQueryPromise; - avg(getter?: string): JQueryPromise; - aggregate(step: number): JQueryPromise; - aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryPromise; - } - export interface ArrayQuery extends IQuery { - toArray(): Array; - } - export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } - export function base64_encode(input: string): string; - export function base64_encode(input: any[]): string; - export function query(items?: any[]): IQuery; - export var queryImpl: { - remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; - array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; - }; - export class Guid { - constructor(value?: string); - constructor(value?: any); - toString(): string; - valueOf(): string; - toJSON(): string; - } - export class EdmLiteral { - constructor(value: any); - valueOf(): any; - } - export module utils { - export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeBinaryCriterion(criteria: Array): Array; - export function keysEqual(key1: any, key2: any): boolean; - export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; - export function toComparable(value: Date, caseSensitive?: boolean): number; - export function toComparable(value: Guid, caseSensitive?: boolean): string; - export function toComparable(value: string, caseSensitive?: boolean): string; - export function compileGetter(): Getter; - export function compileGetter(expr: any[]): Getter; - export function compileGetter(expr: string): Getter; - export function compileGetter(expr: "this"): Getter; - export function compileGetter(expr: Getter): Getter; - export function compileSetter(expr: string): Setter; - export module odata { - export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; - export function serializePropName(propName: EdmLiteral): string; - export function serializePropName(propName: string): string; - export function serializeValue(value: Date): string; - export function serializeValue(value: Guid): string; - export function serializeValue(value: string): string; - export function serializeValue(value: "string"): string; - export function serializeValue(value: EdmLiteral): string; - export function serializeKey(key: any): string; - export function serializeKey(key: Date): string; - export function serializeKey(key: Guid): string; - export function serializeKey(key: string): string; - export function serializeKey(key: "string"): string; - export function serializeKey(key: EdmLiteral): string; - export var keyConverters: { - String(value: any): string; - Guid(value: any): Guid; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - }; - } - } - export module queryAdapters { - export function odata(queryOptions: ODataQueryOptions): RemoteQuery; - } - export interface DataSourceOptions { - map? (item: any): any; - postProcess? (result: any[]): any; - pageSize: number; - paginate: boolean; - } - export class DataSource { - public changed: JQueryCallback; - public loadError: JQueryCallback; - public loadingChanged: JQueryCallback; - constructor(options?: Store); - constructor(options?: string); - constructor(options?: Array); - constructor(options?: { store: Store }); - constructor(options?: CustomStoreOptions); - constructor(options?: { store: Array }); - constructor(options?: { store: { type: string } }); - constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); - constructor(options?: { load(options?: LoadOptions): Array; }); - constructor(options?: { load(options?: LoadOptions): JQueryPromise; }); - constructor(options?: DataSourceOptions); - loadOptions(): { [key: string]: any }; - items(): Array; - store(): data.Store; - isLastPage(): boolean; - pageIndex(newIndex?: number): number; - sort(expr: any[]): any[]; - group(expr: any[]): any[]; - filter(expr: any[]): any[]; - select(expr: string[]): string[]; - searchValue(value?: string): string; - searchOperation(op?: string): string; - searchExpr(selector: string): string; - key(): any; - isLoaded(): boolean; - isLoading(): boolean; - totalCount(): number; - load(): JQueryPromise; - dispose(): void; - } - export interface StoreOptions { - key?: any; - errorHandler?: ErrorHandler; - loaded?: (result: Array) => void; - loading?: (loadOptions: LoadOptions) => void; - modified?: () => void; - modifying?: () => void; - inserted?: (values: Object, key: any) => void; - inserting?: (values: Object) => void; - updated?: (key: any, values: Object) => void; - updating?: (key: any, values: Object) => void; - removed?: (key: any) => void; - removing?: (key: any) => void; - } - export interface LoadOptions extends QueryOptions { - skip?: number; - take?: number; - sort?: any; - select?: any; - filter?: any; - group?: any; - expand?: any; - } - export class Store { - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - inserted: JQueryCallback; - inserting: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - constructor(options?: StoreOptions); - key(): any; - keyOf(obj: any): any; - load(options?: LoadOptions): JQueryPromise; - createQuery(options?: QueryOptions): IQuery; - totalCount(options?: { - filter?: any[]; - group?: string[]; - }): JQueryPromise; - byKey(key: any, extraOptions?: { - expand?: string[] - }): JQueryPromise; - remove(key: any): JQueryPromise; - insert(values: any): JQueryPromise; - update(key: any, values: any): JQueryPromise; - } - export interface CustomStoreOptions extends StoreOptions { - load? (options?: LoadOptions): any; - byKey? (key: any): any; - insert? (values: any): any; - update? (key: any, values: any): any; - remove? (key: any): any; - totalCount? (options?: { - filter?: any[]; - group?: string[]; - }): any; - } - export class CustomStore extends Store { - constructor(options?: CustomStoreOptions); - } - export interface ArrayStoreOptions extends StoreOptions { - data?: Array - } - export class ArrayStore extends Store { - constructor(options?: Array); - constructor(options?: ArrayStoreOptions); - } - export interface LocalStoreOptions extends ArrayStoreOptions { - name: string; - } - export class LocalStore extends ArrayStore { - constructor(options?: string); - constructor(options?: LocalStoreOptions); - clear(): void; - } - export interface ODataStoreOptions extends StoreOptions { - url?: string; - name?: string; - keyType?: string; - jsonp?: boolean; - withCredentials?: boolean; - } - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - } - export interface ODataContextOptions { - url: string; - jsonp?: boolean; - withCredentials?: boolean; - errorHandler?: ErrorHandler; - beforeSend?: () => any; - entities?: { - [entityAlias: string]: ODataStoreOptions; - }; - } - export class ODataContext { - constructor(options?: ODataContextOptions); - get(operationName: string, params: { [key: string]: any }): JQueryPromise>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryPromise>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; - } -} -declare module DevExpress.framework { - export interface dxViewOptions { - name: string; - title?: string; - layout?: string; - } - export class dxView extends Component { - constructor(options?: dxViewOptions); - } - export interface dxLayoutOptions { - name: string; - controller: string; - } - export class dxLayout extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxViewPlaceholderOptions { - viewName: string; - } - export class dxViewPlaceholder extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxTransitionOptions { - name: string; - type: string; - } - export class dxTransition extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxContentPlaceholderOptions { - name: string; - transition: string; - } - export class dxContentPlaceholder extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxContentOptions { - targetPlaceholder: string; - } - export class dxContent extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxCommandOptions extends ComponentOptions { - id: string; - action?: any; - icon?: string; - title?: string; - iconSrc?: string; - visible?: boolean; - } - export class dxCommand extends Component { - public beforeExecute: JQueryCallback; - public afterExecute: JQueryCallback; - constructor(element: JQuery, options?: dxCommandOptions); - constructor(element: Element, options?: dxCommandOptions); - execute(): void; - } - export class dxCommandContainer extends Component { - constructor(options: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - constructor(element: Element, options?: ComponentOptions); - } - export interface CommandMap { - [containerId: string]: { commands: any[]; defaults?: any; } - } - export class CommandMapping { - constructor(); - static defaultMapping: CommandMap; - mapCommands(containerId: string, commandMappings: any[]): CommandMapping; - unmapCommands(containerId: string, commandIds: string[]): void; - getCommandMappingForContainer(commandId: string, containerId: string): any; - load(config: CommandMap): CommandMapping; - } - interface IViewCache { - viewRemoved: JQueryCallback; - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class ViewCache implements IViewCache { - viewRemoved: JQueryCallback; - constructor(); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class NullViewCache implements IViewCache { - viewRemoved: JQueryCallback; - constructor(); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class CapacityViewCacheDecorator implements IViewCache { - viewRemoved: JQueryCallback; - constructor(options: { - size: number; - viewCache: IViewCache; - }); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class ConditionalViewCacheDecorator implements IViewCache { - viewRemoved: JQueryCallback; - constructor(options: { - filter: (key: string, viewInfo: any) => boolean; - viewCache: IViewCache; - }); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class HistoryDependentViewCacheDecorator implements IViewCache { - viewRemoved: JQueryCallback; - constructor(options: { - navigationManager: StackBasedNavigationManager; - viewCache: IViewCache; - }); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export interface IStorage { - getItem(key: string): any; - setItem(key: string, value: any): void; - removeItem(key: string): void; - } - export class MemoryKeyValueStorage implements IStorage { - constructor(); - getItem(key: string): any; - setItem(key: string, value: any): void; - removeItem(key: string): void; - } - export interface StateManagerOptions { - storage?: IStorage; - stateSources?: any[]; - } - export class StateManager { - public storage: IStorage; - public stateSources: any[]; - constructor(options?: StateManagerOptions); - addStateSource(stateSource: any): void; - removeStateSource(stateSource: any): void; - saveState(): void; - restoreState(): void; - clearState(): void; - } - export class Route { - constructor(pattern: string, defaults?: any, constraints?: any); - parse(url: string): any; - format(routeValues: any): string; - formatSegment(value: any): string; - parseSegment(): any; - } - export class MvcRouter { - constructor(); - register(pattern: string, defaults?: any, constraints?: any): void; - parse(uri: string): any; - format(obj: any): string; - } - interface BrowserAdapterOptions { - window: Window; - } - export class DefaultBrowserAdapter { - constructor(options?: BrowserAdapterOptions); - replaceState(uri: string): void; - pushState(uri: string): void; - createRootPage(): void; - getWindowName(): string; - setWindowName(windowName: string): void; - back(): void; - getHash(): string; - isRootPage(): boolean; - } - export class OldBrowserAdapter extends DefaultBrowserAdapter { } - export class HistorylessBrowserAdapter extends DefaultBrowserAdapter { } - export interface INavigationDevice { - init: Function; - setUri(uri: string): void; - getUri(): string; - back(): void; - } - export class StackBasedNavigationDevice extends HistoryBasedNavigationDevice implements INavigationDevice { - uriChanged: JQueryCallback; - constructor(options?: BrowserAdapterOptions); - } - export class HistoryBasedNavigationDevice implements INavigationDevice { - backInitiated: JQueryCallback; - init: Function; - setUri(uri: string): void; - getUri(): string; - back(): void; - } - export class NavigationStack { - public items: any[]; - public currentIndex: number; - public itemsRemoved: JQueryCallback; - constructor(); - currentItem(): any; - back(uri: string): void; - forward(): void; - navigate(uri: any, replaceCurrent?: boolean): any; - getPreviousItem(): any; - canBack(): boolean; - clear(): void; - } - export interface NavigationManagerOptions { - stateStorageKey?: string; - navigationDevice?: INavigationDevice; - keepPositionInStack?: boolean; - } - export interface INavigationManager { - navigating: JQueryCallback; - navigated: JQueryCallback; - navigatingBack: JQueryCallback; - navigationCanceled: JQueryCallback; - itemRemoved: JQueryCallback; - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - back(alternate: any): void; - canBack(): boolean; - rootUri(): string; - currentItem(): any; - previousItem(): any; - saveState(): void; - removeState(): void; - restoreState(): void; - } - export class StackBasedNavigationManager extends HistoryBasedNavigationManager { - init(): JQueryPromise; - public currentStack: NavigationStack; - public navigationStacks: { - [key: string]: NavigationStack - }; - public navigating: JQueryCallback; - public navigated: JQueryCallback; - public navigatingBack: JQueryCallback; - public navigationCanceled: JQueryCallback; - public itemRemoved: JQueryCallback; - constructor(options?: NavigationManagerOptions); - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - currentIndex(): number; - getItemByIndex(index: number): any; - clearHistory(): void; - } - export class HistoryBasedNavigationManager implements INavigationManager { - navigating: JQueryCallback; - navigated: JQueryCallback; - navigatingBack: JQueryCallback; - navigationCanceled: JQueryCallback; - itemRemoved: JQueryCallback; - constructor(options?: NavigationManagerOptions); - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - back(alternate: any): void; - canBack(): boolean; - rootUri(): string; - currentItem(): any; - previousItem(): any; - saveState(): void; - removeState(): void; - restoreState(): void; - } - export module utils { - export function mergeCommands(destination: any, source: any): dxCommand[]; - } - export interface ApplicationOptions { - router?: MvcRouter; - ns?: Object; - namespace?: Object; - viewCache?: IViewCache; - viewCacheSize?: number; - disableViewCache?: boolean; - useViewTitleAsBackText?: boolean; - stateManager?: StateManager; - navigationManager?: StackBasedNavigationManager; - navigation?: dxCommandOptions[]; - commandMapping?: CommandMap; - } - export class Application { - public router: MvcRouter; - public namespace: any; - public components: any[]; - public viewCache: IViewCache; - public stateManager: StateManager; - public commandMapping: CommandMap; - public navigation: dxCommand[]; - public navigationManager: StackBasedNavigationManager; - public beforeViewSetup: JQueryCallback; - public afterViewSetup: JQueryCallback; - public viewShowing: JQueryCallback; - public viewShown: JQueryCallback; - public viewHidden: JQueryCallback; - public viewDisposing: JQueryCallback; - public viewDisposed: JQueryCallback; - public navigating: JQueryCallback; - public navigatingBack: JQueryCallback; - constructor(options?: ApplicationOptions); - init(): any; - navigate(uri?: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - canBack(): boolean; - saveState(): void; - clearState(): void; - restoreState(): void; - } - export function createActionExecutors(app: Application): { - [key: string]: { execute(e: any): void; } - }; -} -declare module DevExpress.framework.html { - export interface ILayoutController { - viewReleased: JQueryCallback; - init(options: InitLayoutControllerOptions): void; - activate(): void; - deactivate(): void; - showView(viewInfo: any, direction?: string): JQueryPromise; - } - export interface ILayoutControllerRegistration extends IDevice { - name: string; - controller: ILayoutController; - root?: boolean; - } - export var layoutControllers: Array; - export var layoutSets: Object; - export interface InitLayoutControllerOptions { - $viewPort?: JQuery; - $hiddenBag?: JQuery; - navigationManager?: framework.StackBasedNavigationManager; - } - export class DefaultLayoutController implements ILayoutController { - public viewReleased: JQueryCallback; - constructor(options?: { layoutTemplateName: string }); - init(options: InitLayoutControllerOptions): void; - activate(): void; - deactivate(): void; - showView(viewInfo: any, direction?: string): JQueryPromise; - } - export interface CommandManagerOptions { - globalCommands?: framework.dxCommand[]; - commandMapping?: framework.CommandMapping; - } - export class CommandManager { - public globalCommands: framework.dxCommand[]; - public commandMapping: framework.CommandMapping; - constructor(options?: CommandManagerOptions); - layoutCommands($markup: JQuery, extraCommands?: any): void; } - export interface ITemplateEngine { - applyTemplate(template: string, model: any): void; - applyTemplate(template: Element, model: any): void; - applyTemplate(template: JQuery, model: any): void; - } - export class KnockoutJSTemplateEngine implements ITemplateEngine { - constructor(); - applyTemplate(template: string, model: any): void; - applyTemplate(template: Element, model: any): void; - applyTemplate(template: JQuery, model: any): void; - } - export interface TransitionExecutorOptions { - type?: string; - source?: JQuery; - destination?: JQuery; - } - export class TransitionExecutor { - public container: JQuery; - constructor(container: JQuery, options: TransitionExecutorOptions); - finalize(): void; - exec(): JQueryPromise; - static create(container: JQuery, options: TransitionExecutorOptions): TransitionExecutor; - } - export interface ViewEngineOptions { - $root: JQuery; - device: IDevice; - commandManager?: CommandManager; - templateEngine?: ITemplateEngine; - dataOptionsAttributeName?: string; - } - export class ViewEngineBase { - public $root: JQuery; - public device: IDevice; - public commandManager: CommandManager; - public templateEngine: ITemplateEngine; - public dataOptionsAttributeName: string; - public viewSelecting: JQueryCallback; - public modelFromViewDataExtended: JQueryCallback; - constructor(options?: ViewEngineOptions); - init(): JQueryPromise; - findViewTemplate(viewName: string): JQuery; - afterViewSetup(viewInfo: any): void; - } - export class ViewEngine extends ViewEngineBase { - public layoutSelecting: JQueryCallback; - constructor(options?: ViewEngineOptions); - init(): JQueryPromise; - findLayoutTemplate(layoutName: string): JQuery; - } - export interface HtmlApplicationOptions extends framework.ApplicationOptions { - commandManager?: CommandManager; - templateEngine?: ITemplateEngine; - navigateToRootViewMode?: string; - layoutControllers?: Array - device?: IDevice; - layoutSet?: Array; - } - export class HtmlApplication extends framework.Application { - public viewEngine: ViewEngineBase; - public viewRendered: JQueryCallback; - public resolveLayoutController: JQueryCallback; - constructor(options?: HtmlApplicationOptions); - init(): any; - viewPort(): JQuery; - } -} -declare module DevExpress.ui { - export var themes: { - current(): string; - current(themeName: string): void; - }; - interface ViewportOptions { - allowPan?: boolean; - allowZoom?: boolean; - } - export interface ITemplate { - compile(html: string): any; - render(template: JQuery, data: any): any; - render(template: any, data: any): any; - } - class Template { - constructor(element: HTMLElement); - constructor(element: JQueryStatic); - render(container: HTMLElement): any; - render(container: JQueryStatic): any; - dispose(): void; - } - interface TemplateStatic { - new (element: HTMLElement): Template; - new (element: JQueryStatic): Template; - } - class TemplateProvider { - constructor(); - getTemplateClass(widget: any): TemplateStatic; - getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; - } - export function initViewport(options: ViewportOptions): void; - interface NotifyOptions { - message: string; - type?: string; - displayTime?: number; - hiddenAction: () => any; - } - export function notyfy(options: any): void; - export function notify(message: string, type?: string, displayTime?: number): void; - export module dialog { - interface Dialog { - show(): JQueryPromise; - hide(value?: any): void; - } - interface DialogButton { - text: string; - icon: string; - clickAction: () => any; - } - interface DialogOptions { - message: string; - title?: string; - } - export function custom(options: DialogOptions): Dialog; - export function custom(message: string, title?: string): Dialog; - export function alert(options: DialogOptions): JQueryPromise; - export function alert(message: string, title?: string): JQueryPromise; - export function confirm(options: DialogOptions): JQueryPromise; - export function confirm(message: string, title?: string): JQueryPromise; - } - export interface CollectionContainerWidgetOptions extends WidgetOptions { - items?: Array; - itemTemplate?: any; - itemRender?: Function; - itemClickAction?: any; - itemRenderedAction?: any; - noDataText?: string; - dataSource?: data.DataSource; - selectedIndex?: number; - itemSelectAction?: any; - itemHoldAction?: any; - itemHoldTimeout?: number; - } - export class CollectionContainerWidget extends Widget { - constructor(element: Element, options?: CollectionContainerWidgetOptions); - constructor(element: JQuery, options?: CollectionContainerWidgetOptions); - } - export interface WidgetOptions extends ComponentOptions { - contentReadyAction?: any; - width?: any; - height?: any; - visible?: boolean; - activeStateEnabled?: boolean; - } - export class Widget extends Component { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - init(): void; - repaint(): void; - addTemplate(template: ITemplate): void; - } - export interface dxEditorOptions extends WidgetOptions { - value?: any; - valueChangeAction?: any; - } - export class dxEditor extends Widget { - constructor(element: Element, options?: dxEditorOptions); - constructor(element: JQuery, options?: dxEditorOptions); - } - export interface dxAutocompleteOptions extends dxDropDownEditorOptions { - minSearchLength?: number; - searchTimeout?: number; - placeholder?: string; - filterOperator?: string; - displayExpr?: string; - searchMode?: string; - dataSource?: data.DataSource; - items?: Array; - itemRender?: Function; - itemTemplate?: any; - } - export class dxAutocomplete extends dxDropDownEditor { - constructor(element: Element, options?: dxAutocompleteOptions); - constructor(element: JQuery, options?: dxAutocompleteOptions); - } - export interface dxButtonOptions extends WidgetOptions { - type?: string; - text?: string; - icon?: string; - iconSrc?: string; - clickAction?: any; - } - export class dxButton extends Widget { - constructor(element: Element, options?: dxButtonOptions); - constructor(element: JQuery, options?: dxButtonOptions); - } - export interface dxCheckBoxOptions extends dxEditorOptions { } - export class dxCheckBox extends dxEditor { - constructor(element: Element, options?: dxCheckBoxOptions); - constructor(element: JQuery, options?: dxCheckBoxOptions); - } - export interface dxCalendarOptions extends dxEditorOptions { - value?: Date; - min?: Date; - max?: Date; - firstDayOfWeek?: number; - } - export class dxCalendar extends dxEditor { - constructor(element: Element, options?: dxEditorOptions); - constructor(element: JQuery, options?: dxEditorOptions); - } - export interface dxDateBoxOptions extends dxTextEditorOptions { - format?: string; - useNativePicker?: boolean; - value?: Date; - type?: string; - min?: Date; - max?: Date; - useCalendar?: boolean; - formatString?: string; - closeOnValueChange?: boolean; - calendarOptions?: Object; - } - export class dxDateBox extends dxTextEditor { - constructor(element: Element, options?: dxDateBoxOptions); - constructor(element: JQuery, options?: dxDateBoxOptions); - } - export interface dxTextEditorOptions extends dxEditorOptions { - valueChangeEvent?: string; - placeholder?: string; - readOnly?: boolean; - focusInAction?: any; - focusOutAction?: any; - keyDownAction?: any; - keyPressAction?: any; - keyUpAction?: any; - changeAction?: any; - enterKeyAction?: any; - copyAction?: any; - pasteAction?: any; - cutAction?: any; - inputAction?: any; - showClearButton?: boolean; - mode?: string; - } - export class dxTextEditor extends dxEditor { - constructor(element: Element, options?: dxTextEditorOptions); - constructor(element: JQuery, options?: dxTextEditorOptions); - focus(): void; - blur(): void; - } - export interface dxListOptions extends CollectionContainerWidgetOptions { - pullRefreshEnabled?: boolean; - autoPagingEnabled?: boolean; - scrollingEnabled?: boolean; - showScrollbar?: boolean; - useNativeScrolling?: boolean; - grouped?: boolean; - editEnabled?: boolean; - showNextButton?: boolean; - groupTemplate?: string; - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - pageLoadingText?: string; - scrollAction?: any; - pullRefreshAction?: any; - pageLoadingAction?: any; - itemHoldAction?: any; - itemSwipeAction?: any; - itemHoldTimeout?: number; - groupRender? (groupData: any, groupIndex: number, groupElement: Element): any; - editConfig?: { - itemTemplate?: any; - itemRenderer? (itemData: any, itemIndex: number, itemElement: Element): any; - menuType?: string; - menuItems?: any[]; - deleteEnabled?: boolean; - deleteMode?: string; - selectionEnabled?: boolean; - selectionMode?: string; - selectionType?: string; - reorderEnabled?: boolean; - } - itemDeleteAction?: any; - selectedItems?: any[]; - itemSelectAction?: any; - itemUnselectAction?: any; - itemReorderAction?: any; - nextButtonText?: string; - selectionMode?: string; - } - export class dxList extends CollectionContainerWidget { - constructor(element: Element, options?: dxListOptions); - constructor(element: JQuery, options?: dxListOptions); - update(): JQueryPromise; - updateDimensions(): JQueryPromise; - refresh(): JQueryPromise; - reload(): JQueryPromise; - deleteItem(itemElement: JQuery): JQueryPromise; - deleteItem(itemElement: Element): JQueryPromise; - clearSelectedItems() : void; - isItemSelected(itemElement: JQuery): boolean; - isItemSelected(itemElement: Element): boolean; - selectItem(itemElement: JQuery): void; - selectItem(itemElement: Element): void; - unselectItem(itemElement: JQuery): void; - unselectItem(itemElement: Element): void; - reorderItem(itemElement: JQuery, toItemElement: JQuery): JQueryPromise; - reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; - getSelectedItems(): number[]; - clientHeight(): number; - scrollHeight(): number; - scrollBy(distance: number): void; - scrollTo(targetLocation: number): void; - scrollTop(): number; - } - export interface dxLoadPanelOptions extends dxOverlayOptions { - message?: string; - width?: number; - height?: number; - delay?: number; - showPane?: boolean; - showIndicator?: boolean; - indicatorSrc?: string; - } - export class dxLoadPanel extends dxOverlay { - constructor(element: Element, options?: dxLoadPanelOptions); - constructor(element: JQuery, options?: dxLoadPanelOptions); - hide(): void; - show(): void; - toggle(showing: boolean): void; - } - export interface dxLookupOptions extends dxEditorOptions { - dataSource?: data.DataSource; - displayValue?: string; - title?: string; - titleTemplate?: any; - valueExpr?: string; - displayExpr?: string; - placeholder?: string; - searchPlaceholder?: string; - searchEnabled?: boolean; - searchTimeout?: number; - minFilterLength?: number; - fullScreen?: boolean; - itemTemplate?: any; - itemRender?: Function; - showCancelButton?: boolean; - showClearButton?: boolean; - showDoneButton?: boolean; - showNextButton?: boolean; - doneButtonText?: string; - cancelButtonText?: string; - clearButtonText?: string; - nextButtonText?: string; - grouped?: boolean; - groupRender?: Function; - groupTemplate?: string; - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - pageLoadingText?: string; - noDataText?: string; - scrollAction?: any; - shading?: boolean; - closeOnOutsideClick?: boolean; - position?: any; - animation?: any; - shownAction?: any; - hiddenAction?: any; - popupWidth?: any; - popupHeight?: any; - autoPagingEnabled?: boolean; - useNativeScrolling?: boolean; - usePopover?: boolean; - openAction?: any; - closeAction?: any; - } - export class dxLookup extends dxEditor { - constructor(element: Element, options?: dxLookupOptions); - constructor(element: JQuery, options?: dxLookupOptions); - close(): void; - open(): void; - } - export interface dxMapOptions extends WidgetOptions { - location?: any; - width?: number; - height?: number; - zoom?: number; - mapType?: string; - provider?: string; - markers?: Array; - routes?: Array; - key?: string; - controls?: any; - mapReadyAction?: any; - autoAdjust?: boolean; - center?: any; - markerAddedAction?: any; - markerRemovedAction?: any; - markerIconSrc?: string; - routeAddedAction?: any; - routeRemovedAction?: any; - type?: string; - } - export class dxMap extends Widget { - constructor(element: Element, options?: dxMapOptions); - constructor(element: JQuery, options?: dxMapOptions); - addMarker(markerOptions: any, callback: Function): JQueryPromise; - removeMarker(marker: any): void; - addRoute(routeOptions: any, callback: Function): JQueryPromise; - removeRoute(route: any): void; - } - export interface dxNavBarOptions extends dxTabsOptions { } - export class dxNavBar extends dxTabs { - constructor(element: Element, options?: dxNavBarOptions); - constructor(element: JQuery, options?: dxNavBarOptions); - } - export interface dxNumberBoxOptions extends dxTextEditorOptions { - min?: number; - max?: number; - value?: number; - step?: number; - showSpinButtons?: boolean; - } - export class dxNumberBox extends dxTextEditor { - constructor(element: Element, options?: dxNumberBoxOptions); - constructor(element: JQuery, options?: dxNumberBoxOptions); - } - export interface dxOverlayOptions extends WidgetOptions { - activeStateEnabled?: boolean; - shading?: boolean; - closeOnOutsideClick?: boolean; - position?: any; - animation?: any; - showingAction?: any; - shownAction?: any; - hidingAction?: any; - hiddenAction?: any; - deferRendering?: boolean; - targetContainer?: any; - contentTemplate?: any; - } - export class dxOverlay extends Widget { - constructor(element: Element, options?: dxOverlayOptions); - constructor(element: JQuery, options?: dxOverlayOptions); - content(): JQuery; - hide(): void; - show(): void; - toggle(showing: boolean): void; - } - export interface dxPopupOptions extends dxOverlayOptions { - title?: string; - showTitle?: boolean; - fullScreen?: boolean; - cancelButton?: any; - doneButton?: any; - clearButton?: any; - titleTemplate?: any; - dragEnabled?: boolean; - } - export class dxPopup extends dxOverlay { - constructor(element: Element, options?: dxPopupOptions); - constructor(element: JQuery, options?: dxPopupOptions); - } - export interface dxPopoverOptions extends dxPopupOptions { - target?: any; - } - export class dxPopover extends dxPopup { - constructor(element: Element, options?: dxPopoverOptions); - constructor(element: JQuery, options?: dxPopoverOptions); - } - export interface dxTooltipOptions extends dxPopoverOptions { - target?: any; - } - export class dxTooltip extends dxPopover { - constructor(element: Element, options?: dxTooltipOptions); - constructor(element: JQuery, options?: dxTooltipOptions); - } - export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { - layout?: string; - name?: string; - value?: Object; - valueExpr?: string; - } - export class dxRadioGroup extends CollectionContainerWidget { - constructor(element: Element, options?: dxRadioGroupOptions); - constructor(element: JQuery, options?: dxRadioGroupOptions); - } - export interface dxRangeSliderOptions extends dxSliderOptions { - start?: number; - end?: number; - } - export class dxRangeSlider extends dxSlider { - constructor(element: Element, options?: dxRangeSliderOptions); - constructor(element: JQuery, options?: dxRangeSliderOptions); - } - export interface dxScrollableOptions extends ComponentOptions { - startAction?: any; - scrollAction?: any; - endAction?: any; - stopAction?: any; - inertiaAction?: any; - bounceAction?: any; - updateAction?: any; - bounceEnabled?: boolean; - direction?: string; - showScrollbar?: boolean; - useNative?: boolean; - } - export class dxScrollable extends Component { - constructor(element: Element, options?: dxScrollableOptions); - constructor(element: JQuery, options?: dxScrollableOptions); - update(): void; - content(): JQuery; - clientHeight(): number; - scrollHeight(): number; - clientWidth(): number; - scrollWidth(): number; - scrollLeft(): number; - scrollTop(): number; - scrollOffset(): Object; - scrollBy(distance: number): void; - scrollBy(distance: Object): void; - scrollTo(targetLocation: number): void; - scrollTo(targetLocation: Object): void; - } - export interface dxScrollViewOptions extends dxScrollableOptions { - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - reachBottomText?: string; - pullDownAction?: any; - reachBottomAction?: any; - } - export class dxScrollView extends dxScrollable { - constructor(element: Element, options?: dxScrollViewOptions); - constructor(element: JQuery, options?: dxScrollViewOptions); - release(preventReachBottom: boolean): JQueryPromise; - toggleLoading(showOrHide: boolean): void; - refresh(): void; - } - export interface dxSelectBoxOptions extends dxAutocompleteOptions { - fieldTemplate?: any; - displayValue?: string; - multiSelectEnabled?: boolean; - values?: any[]; - openAction?: any; - closeAction?: any; - } - export class dxSelectBox extends dxAutocomplete { - constructor(element: Element, options?: dxSelectBoxOptions); - constructor(element: JQuery, options?: dxSelectBoxOptions); - } - export interface dxSliderOptions extends dxEditorOptions { - min?: number; - max?: number; - step?: number; - showRange?: boolean; - label?: { - visible: boolean; - format?: any; - position?: string; - } - tooltip?: { - enabled?: boolean; - format?: any; - position?: string; - showMode?: string; - } - } - export class dxSlider extends dxEditor { - constructor(element: Element, options?: dxSliderOptions); - constructor(element: JQuery, options?: dxSliderOptions); - } - export interface dxTabsOptions extends CollectionContainerWidgetOptions { } - export class dxTabs extends CollectionContainerWidget { - constructor(element: Element, options?: dxTabsOptions); - constructor(element: JQuery, options?: dxTabsOptions); - } - export interface dxTextAreaOptions extends dxTextEditorOptions { - cols?: number; - rows?: number; - } - export class dxTextArea extends dxTextEditor { - constructor(element: Element, options?: dxTextAreaOptions); - constructor(element: JQuery, options?: dxTextAreaOptions); - } - export interface dxTextBoxOptions extends dxTextEditorOptions { - maxLength?: any; - } - export class dxTextBox extends dxTextEditor { - constructor(element: Element, options?: dxTextBoxOptions); - constructor(element: JQuery, options?: dxTextBoxOptions); - } - export interface dxToastOptions extends dxOverlayOptions { - message?: string; - type?: string; - displayTime?: number; - } - export class dxToast extends dxOverlay { - constructor(element: Element, options?: dxToastOptions); - constructor(element: JQuery, options?: dxToastOptions); - } - export interface dxToolbarOptions extends CollectionContainerWidgetOptions { - menuItemRender?: Function; - menuItemTemplate?: any; - submenuType?: string; - renderAs?: string; - } - export class dxToolbar extends CollectionContainerWidget { - constructor(element: Element, options?: dxToolbarOptions); - constructor(element: JQuery, options?: dxToolbarOptions); - } - export interface dxDropDownEditorOptions extends dxTextBoxOptions { - closeAction?: any; - openAction?: any; - } - export class dxDropDownEditor extends dxTextBox { - constructor(element: Element, options?: dxDropDownEditorOptions); - constructor(element: JQuery, options?: dxDropDownEditorOptions); - } - export interface dxLoadIndicatorOptions extends WidgetOptions { - indicatorSrc?: string; - } - export class dxLoadIndicator extends Widget { - constructor(element: Element, options?: dxLoadIndicatorOptions); - constructor(element: JQuery, options?: dxLoadIndicatorOptions); - } - export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { - loop?: boolean; - swipeEnabled?: boolean; - animationEnabled?: boolean; - selectedIndex?: number; - } - export class dxMultiView extends CollectionContainerWidget { - constructor(element: Element, options?: dxMultiViewOptions); - constructor(element: JQuery, options?: dxMultiViewOptions); - } - export interface dxGalleryOptions extends CollectionContainerWidgetOptions { - activeStateEnabled?: boolean; - animationDuration?: number; - loop?: boolean; - swipeEnabled?: boolean; - indicatorEnabled?: boolean; - showIndicator?: boolean; - selectedIndex?: number; - slideshowDelay?: number; - showNavButtons?: boolean; - } - export class dxGallery extends CollectionContainerWidget { - constructor(element: Element, options?: dxGalleryOptions); - constructor(element: JQuery, options?: dxGalleryOptions); - goToItem(itemIndex?: number, animation?: boolean): JQueryPromise; - prevItem(animation?: boolean): JQueryPromise; - nextItem(animation?: boolean): JQueryPromise; - } - export interface dxActionSheetOptions extends CollectionContainerWidgetOptions { - usePopover?: boolean; - target?: any; - title?: string; - showTitle?: boolean; - cancelText?: string; - noDataText?: string; - cancelClickAction?: any; - showCancelButton?: boolean; - } - export class dxActionSheet extends CollectionContainerWidget { - constructor(element: Element, options?: dxActionSheetOptions); - constructor(element: JQuery, options?: dxActionSheetOptions); - toggle(): void; - show(): void; - hide(): void; - } - export interface dxDropDownMenuOptions extends WidgetOptions { - items?: Array; - itemClickAction?: any; - dataSource?: data.DataSource; - itemTemplate?: any; - itemRender?: Function; - buttonText?: string; - buttonIcon?: string; - buttonIconSrc?: string; - buttonClickAction?: any; - usePopover?: boolean; - } - export class dxDropDownMenu extends Widget { - constructor(element: Element, options?: dxDropDownMenuOptions); - constructor(element: JQuery, options?: dxDropDownMenuOptions); - } - export interface dxPanoramaOptions extends CollectionContainerWidgetOptions { - title?: string; - backgroundImage?: any; - } - export class dxPanorama extends CollectionContainerWidget { - constructor(element: Element, options?: dxPanoramaOptions); - constructor(element: JQuery, options?: dxPanoramaOptions); - } - export interface dxPivotOptions extends CollectionContainerWidgetOptions { } - export class dxPivot extends CollectionContainerWidget { - constructor(element: Element, options?: dxPivotOptions); - constructor(element: JQuery, options?: dxPivotOptions); - } - export interface dxSwitchOptions extends dxEditorOptions { - onText?: string; - offText?: string; - } - export class dxSwitch extends dxEditor { - constructor(element: Element, options?: dxSwitchOptions); - constructor(element: JQuery, options?: dxSwitchOptions); - } - export interface dxTileViewOptions extends CollectionContainerWidgetOptions { - bounceEnabled?: boolean; - showScrollbar?: boolean; - listHeight?: number; - baseItemWidth?: number; - baseItemHeight?: number; - itemMargin?: number; - } - export class dxTileView extends CollectionContainerWidget { - constructor(element: Element, options?: dxTileViewOptions); - constructor(element: JQuery, options?: dxTileViewOptions); - } - export interface dxSlideOutOptions extends CollectionContainerWidgetOptions { - activeStateEnabled?: boolean; - menuItemRender? (itemData: any, itemIndex: number, itemElement: Element): any; - menuItemTemplate?: any; - swipeEnabled?: boolean; - menuVisible?: boolean; - menuGrouped?: boolean; - menuGroupRender? (groupData: any, groupIndex: number, groupElement: Element): any; - menuGroupTemplate?: any; - } - export class dxSlideOut extends CollectionContainerWidget { - constructor(element: Element, options?: dxSlideOutOptions); - constructor(element: JQuery, options?: dxSlideOutOptions); - showMenu(): JQueryPromise; - hideMenu(): JQueryPromise; - toggleMenuVisibility(showing?: boolean): JQueryPromise; - } -} -interface JQuery { - dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; - dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; - dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; - dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; - dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; - dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; - dxList(options?: DevExpress.ui.dxListOptions): JQuery; - dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; - dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; - dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; - dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; - dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; - dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; - dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; - dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; - dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; - dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; - dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; - dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; - dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; - dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; - dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; - dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; - dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; - dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; - dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; - dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; - dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; - dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; - dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; - dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; - dxActionSheet(options?: DevExpress.ui.dxActionSheetOptions): JQuery; - dxDropDownMenu(options?: DevExpress.ui.dxDropDownMenuOptions): JQuery; - dxPanorama(options?: DevExpress.ui.dxPanoramaOptions): JQuery; - dxPivot(options?: DevExpress.ui.dxPivotOptions): JQuery; - dxSwitch(options?: DevExpress.ui.dxSwitchOptions): JQuery; - dxTileView(options?: DevExpress.ui.dxTileViewOptions): JQuery; - dxSlideOut(options?: DevExpress.ui.dxSlideOutOptions): JQuery; -} \ No newline at end of file diff --git a/devextreme/14.1/dx.webappjs-14.1-tests.ts b/devextreme/14.1/dx.webappjs-14.1-tests.ts deleted file mode 100644 index 63b203ed10..0000000000 --- a/devextreme/14.1/dx.webappjs-14.1-tests.ts +++ /dev/null @@ -1,93 +0,0 @@ -/// - -module Test { - $('
').appendTo(document.body) - .dxDataGrid({ - allowColumnResizing: true, - allowColumnReordering: true, - cellClick: (clickedCell: Object) => { }, - rowClick: (clickedRow: Object) => { }, - columnChooser: { - enabled: true, - height: 180, - width: 400, - emptyPanelText: 'A place to hide the columns' - }, - columnAutoWidth: true, - columns: [ - 'author', 'title', 'year', 'genre', 'format', - { dataField: 'price', visible: false }, - { dataField: 'length', visible: false } - ], - dataSource: new DevExpress.data.DataSource({ - store: { - type: 'array', - data: [ - { id: 1, title: "The Catcher in the Rye", author: "J. D. Salinger", year: 1951, genre: "Bildungsroman", format: "paperback" }, - { id: 2, title: "The Hitchhiker's Guide to the Galaxy", author: "D. Adams", year: 1979, genre: "Comedy, sci-fi", format: "hardcover" }, - { id: 3, title: "Fahrenheit 451", author: "R. Bradbury", year: 1953, genre: "Dystopian novel", format: "paperback" }, - { id: 4, title: "Nineteen Eighty-Four", author: "G. Orwell", year: 1949, genre: "Dystopian novel, political fiction", format: "hardcover" }, - { id: 5, title: "Crime and Punishment", author: "F. Dostoyevsky", year: 1866, genre: "Philosophical novel", format: "paperback" } - ], - key: "id" - } - }), - customizeColumns: (columns: Array) => { }, - dataErrorOccurred: (error: Error) => { }, - disabled: false, - editing: { - editMode: 'batch', - editEnabled: true, - insertEnabled: true, - removeEnabled: true - }, - filterRow: { - visible: true, - showOperationChooser: false - }, - groupPanel: { - visible: true - }, - grouping: { - autoExpandAll: false - }, - height: () => { - return 200; - }, - hoverStateEnabled: true, - loadPanel: { - height: 150, - width: 400, - text: 'Data is loading...' - }, - noDataText: "It isn't the data you're looking for", - pager: { - showPageSizeSelector: true, - allowedPageSizes: [3, 5, 8] - }, - paging: { - pageSize: 8, - pageIndex: 19 - }, - rowAlternationEnabled: true, - rowPrepared: (rowElement: JQuery, rowInfo: Object) => { }, - rtlEnabled: false, - scrolling: { mode: 'infinite' }, - searchPanel: { - visible: true, - width: 250 - }, - selectedRowKeys: [1, 2, 4], - selection: { - mode: 'multiple', - allowSelectAll: false - }, - showColumnHeaders: true, - showColumnLines: true, - showRowLines: true, - sorting: { mode: 'multiple' }, - visible: true, - width: () => { return 400; }, - wordWrapEnabled: true - }); -} \ No newline at end of file diff --git a/devextreme/14.1/dx.webappjs-14.1.d.ts b/devextreme/14.1/dx.webappjs-14.1.d.ts deleted file mode 100644 index 908b816f96..0000000000 --- a/devextreme/14.1/dx.webappjs-14.1.d.ts +++ /dev/null @@ -1,1648 +0,0 @@ -// Type definitions for WebAppJS 14.1.+ -// Project: http://js.devexpress.com/WebDevelopment/ -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module DevExpress { - export function abstract(): void; - export var rtlEnabled: boolean; - export var hardwareBackButton: JQueryCallback; - interface Endpoint { - local?: string; - production: string; - } - class EndpointSelector { - constructor(config: { [key: string]: Endpoint }); - urlFor(key: string): string; - } - export interface ActionOptions { - context?: Object; - component?: any; - beforeExecute? (e:ActionExecuteArgs): void; - afterExecute? (e:ActionExecuteArgs): void; - } - export interface ActionExecuteArgs { - action: any; - args: any[]; - context: any; - component: any; - cancel: boolean; - handled: boolean; - } - export class Action { - constructor(action?: any, config?: ActionOptions); - execute(): any; - } - export interface IDevice { - deviceType?: string; - platform?: string; - version?: Array; - phone?: boolean; - tablet?: boolean; - android?: boolean; - ios?: boolean; - win8?: boolean; - tizen?: boolean; - generic?: boolean; - } - export module devices { - export function orientation(): string; - export var orientationChanged: JQueryCallback; - export function real(): IDevice; - export function current(deviceOrName: string): IDevice; - export function current(deviceOrName: IDevice): IDevice; - } - export function registerComponent(name: string, componentClass: any): void; - export interface ComponentOptions { - disabled?: boolean; - } - export class Component { - constructor(element: Element, options?: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - disposing: JQueryCallback; - optionChanged: JQueryCallback; - instance(): Component; - beginUpdate(): void; - endUpdate(): void; - option(): any; - option(options: string): any; - option(options: string): T; - option(options: string, value: any): void; - option(options: { [key: string]: any }): void; - option(options?: any): any; - } - export interface DOMComponentOptions extends ComponentOptions { - rtlEnabled?: boolean; - } - export class DOMComponent extends Component { - constructor(element: HTMLElement, options?: DOMComponentOptions); - static defaultOptions(rule: { - device: any; - options: { [key: string]: any }; - }): void; - } -} -declare module DevExpress.data { - export interface DataError extends Error { - httpStatus?: number; - errorDetails?: any; - } - export interface ErrorHandler { (e: DataError): void; } - export interface EntityOptions { key: any; keyType: any; } - export interface Getter { (obj: any, options?: any): any; } - export interface Setter { (obj: any, value: any, options?: any): void; } - export interface QueryOptions { - errorHandler?: ErrorHandler; - requireTotalCount?: boolean; - } - export interface ODataQueryOptions extends QueryOptions { - adapter?: any; - } - interface IQuery { - enumerate(): JQueryPromise>; - count(): JQueryPromise; - slice(skip: number, take?: number): IQuery; - sortBy(field: string): IQuery; - sortBy(field: Getter): IQuery; - sortBy(field: { field: string; desc?: boolean }): IQuery; - sortBy(field: { field: Getter; desc?: boolean }): IQuery; - thenBy(field: string): IQuery; - thenBy(field: Getter): IQuery; - thenBy(field: { field: string; desc?: boolean }): IQuery; - thenBy(field: { field: Getter; desc?: boolean }): IQuery; - filter(field: string, operator: string, value: any): IQuery; - filter(field: string, value: any): IQuery; - filter(criteria: any[]): IQuery; - select(field: string): IQuery; - select(field: string[]): IQuery; - select(...field: string[]): IQuery; - select(field: Getter): IQuery; - select(field: Getter[]): IQuery; - select(...field: Getter[]): IQuery; - groupBy(field: string[]): IQuery; - groupBy(field: Getter[]): IQuery; - groupBy(field: { field: string; desc?: boolean }[]): IQuery; - groupBy(field: { field: Getter; desc?: boolean }[]): IQuery; - sum(getter?: string): JQueryPromise; - min(getter?: string): JQueryPromise; - max(getter?: string): JQueryPromise; - avg(getter?: string): JQueryPromise; - aggregate(step: number): JQueryPromise; - aggregate(seed: number, step: (accumulator: any, current: any) => any, finalize?: (accumulator: any) => any): JQueryPromise; - } - export interface ArrayQuery extends IQuery { - toArray(): Array; - } - export interface RemoteQuery extends IQuery { /*todo: exec() ? */ } - export function base64_encode(input: string): string; - export function base64_encode(input: any[]): string; - export function query(items?: any[]): IQuery; - export var queryImpl: { - remote: (url: string, queryOptions: QueryOptions) => RemoteQuery; - array: (iter: Array, queryOptions: QueryOptions) => ArrayQuery; - }; - export class Guid { - constructor(value?: string); - constructor(value?: any); - toString(): string; - valueOf(): string; - toJSON(): string; - } - export class EdmLiteral { - constructor(value: any); - valueOf(): any; - } - export module utils { - export function normalizeSortingInfo(info: string): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: string[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: Getter[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { field: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; dir?: string }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }): Array<{ selector: string; desc?: boolean }>; - export function normalizeSortingInfo(info: { selector: string; desc?: boolean }[]): Array<{ selector: string; desc?: boolean }>; - export function normalizeBinaryCriterion(criteria: Array): Array; - export function keysEqual(key1: any, key2: any): boolean; - export function keysEqual(keyExpr: any, key1: any, key2: any): boolean; - export function toComparable(value: Date, caseSensitive?: boolean): number; - export function toComparable(value: Guid, caseSensitive?: boolean): string; - export function toComparable(value: string, caseSensitive?: boolean): string; - export function compileGetter(): Getter; - export function compileGetter(expr: any[]): Getter; - export function compileGetter(expr: string): Getter; - export function compileGetter(expr: "this"): Getter; - export function compileGetter(expr: Getter): Getter; - export function compileSetter(expr: string): Setter; - export module odata { - export function sendRequest(request: JQueryXHR, requestOptions?: JQueryAjaxSettings): any; - export function serializePropName(propName: EdmLiteral): string; - export function serializePropName(propName: string): string; - export function serializeValue(value: Date): string; - export function serializeValue(value: Guid): string; - export function serializeValue(value: string): string; - export function serializeValue(value: "string"): string; - export function serializeValue(value: EdmLiteral): string; - export function serializeKey(key: any): string; - export function serializeKey(key: Date): string; - export function serializeKey(key: Guid): string; - export function serializeKey(key: string): string; - export function serializeKey(key: "string"): string; - export function serializeKey(key: EdmLiteral): string; - export var keyConverters: { - String(value: any): string; - Guid(value: any): Guid; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - }; - } - } - export module queryAdapters { - export function odata(queryOptions: ODataQueryOptions): RemoteQuery; - } - export interface DataSourceOptions { - map? (item: any): any; - postProcess? (result: any[]): any; - pageSize: number; - paginate: boolean; - } - export class DataSource { - public changed: JQueryCallback; - public loadError: JQueryCallback; - public loadingChanged: JQueryCallback; - constructor(options?: Store); - constructor(options?: string); - constructor(options?: Array); - constructor(options?: { store: Store }); - constructor(options?: CustomStoreOptions); - constructor(options?: { store: Array }); - constructor(options?: { store: { type: string } }); - constructor(options?: { load(options?: LoadOptions): JQueryXHR; }); - constructor(options?: { load(options?: LoadOptions): Array; }); - constructor(options?: { load(options?: LoadOptions): JQueryPromise; }); - constructor(options?: DataSourceOptions); - loadOptions(): { [key: string]: any }; - items(): Array; - store(): data.Store; - isLastPage(): boolean; - pageIndex(newIndex?: number): number; - sort(expr: any[]): any[]; - group(expr: any[]): any[]; - filter(expr: any[]): any[]; - select(expr: string[]): string[]; - searchValue(value?: string): string; - searchOperation(op?: string): string; - searchExpr(selector: string): string; - key(): any; - isLoaded(): boolean; - isLoading(): boolean; - totalCount(): number; - load(): JQueryPromise; - dispose(): void; - } - export interface StoreOptions { - key?: any; - errorHandler?: ErrorHandler; - loaded?: (result: Array) => void; - loading?: (loadOptions: LoadOptions) => void; - modified?: () => void; - modifying?: () => void; - inserted?: (values: Object, key: any) => void; - inserting?: (values: Object) => void; - updated?: (key: any, values: Object) => void; - updating?: (key: any, values: Object) => void; - removed?: (key: any) => void; - removing?: (key: any) => void; - } - export interface LoadOptions extends QueryOptions { - skip?: number; - take?: number; - sort?: any; - select?: any; - filter?: any; - group?: any; - expand?: any; - } - export class Store { - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - inserted: JQueryCallback; - inserting: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - constructor(options?: StoreOptions); - key(): any; - keyOf(obj: any): any; - load(options?: LoadOptions): JQueryPromise; - createQuery(options?: QueryOptions): IQuery; - totalCount(options?: { - filter?: any[]; - group?: string[]; - }): JQueryPromise; - byKey(key: any, extraOptions?: { - expand?: string[] - }): JQueryPromise; - remove(key: any): JQueryPromise; - insert(values: any): JQueryPromise; - update(key: any, values: any): JQueryPromise; - } - export interface CustomStoreOptions extends StoreOptions { - load? (options?: LoadOptions): any; - byKey? (key: any): any; - insert? (values: any): any; - update? (key: any, values: any): any; - remove? (key: any): any; - totalCount? (options?: { - filter?: any[]; - group?: string[]; - }): any; - } - export class CustomStore extends Store { - constructor(options?: CustomStoreOptions); - } - export interface ArrayStoreOptions extends StoreOptions { - data?: Array - } - export class ArrayStore extends Store { - constructor(options?: Array); - constructor(options?: ArrayStoreOptions); - } - export interface LocalStoreOptions extends ArrayStoreOptions { - name: string; - } - export class LocalStore extends ArrayStore { - constructor(options?: string); - constructor(options?: LocalStoreOptions); - clear(): void; - } - export interface ODataStoreOptions extends StoreOptions { - url?: string; - name?: string; - keyType?: string; - jsonp?: boolean; - withCredentials?: boolean; - } - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - } - export interface ODataContextOptions { - url: string; - jsonp?: boolean; - withCredentials?: boolean; - errorHandler?: ErrorHandler; - beforeSend?: () => any; - entities?: { - [entityAlias: string]: ODataStoreOptions; - }; - } - export class ODataContext { - constructor(options?: ODataContextOptions); - get(operationName: string, params: { [key: string]: any }): JQueryPromise>; - invoke(operationName: string, params: { [key: string]: any }, httpMethod?: string): JQueryPromise>; - objectLink(entityAlias: string, key: any): { __metadata: { uri: string }; }; - } -} -declare module DevExpress.framework { - export interface dxViewOptions { - name: string; - title?: string; - layout?: string; - } - export class dxView extends Component { - constructor(options?: dxViewOptions); - } - export interface dxLayoutOptions { - name: string; - controller: string; - } - export class dxLayout extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxViewPlaceholderOptions { - viewName: string; - } - export class dxViewPlaceholder extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxTransitionOptions { - name: string; - type: string; - } - export class dxTransition extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxContentPlaceholderOptions { - name: string; - transition: string; - } - export class dxContentPlaceholder extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxContentOptions { - targetPlaceholder: string; - } - export class dxContent extends Component { - constructor(options?: dxLayoutOptions); - } - export interface dxCommandOptions extends ComponentOptions { - id: string; - action?: any; - icon?: string; - title?: string; - iconSrc?: string; - visible?: boolean; - } - export class dxCommand extends Component { - public beforeExecute: JQueryCallback; - public afterExecute: JQueryCallback; - constructor(element: JQuery, options?: dxCommandOptions); - constructor(element: Element, options?: dxCommandOptions); - execute(): void; - } - export class dxCommandContainer extends Component { - constructor(options: ComponentOptions); - constructor(element: JQuery, options?: ComponentOptions); - constructor(element: Element, options?: ComponentOptions); - } - export interface CommandMap { - [containerId: string]: { commands: any[]; defaults?: any; } - } - export class CommandMapping { - constructor(); - static defaultMapping: CommandMap; - mapCommands(containerId: string, commandMappings: any[]): CommandMapping; - unmapCommands(containerId: string, commandIds: string[]): void; - getCommandMappingForContainer(commandId: string, containerId: string): any; - load(config: CommandMap): CommandMapping; - } - interface IViewCache { - viewRemoved: JQueryCallback; - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class ViewCache implements IViewCache { - viewRemoved: JQueryCallback; - constructor(); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class NullViewCache implements IViewCache { - viewRemoved: JQueryCallback; - constructor(); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class CapacityViewCacheDecorator implements IViewCache { - viewRemoved: JQueryCallback; - constructor(options: { - size: number; - viewCache: IViewCache; - }); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class ConditionalViewCacheDecorator implements IViewCache { - viewRemoved: JQueryCallback; - constructor(options: { - filter: (key: string, viewInfo: any) => boolean; - viewCache: IViewCache; - }); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export class HistoryDependentViewCacheDecorator implements IViewCache { - viewRemoved: JQueryCallback; - constructor(options: { - navigationManager: StackBasedNavigationManager; - viewCache: IViewCache; - }); - setView(key: string, viewInfo: any): void; - removeView(key: string): any; - hasView(viewInfo: any): boolean; - getView(key: string): any; - clear(): void; - } - export interface IStorage { - getItem(key: string): any; - setItem(key: string, value: any): void; - removeItem(key: string): void; - } - export class MemoryKeyValueStorage implements IStorage { - constructor(); - getItem(key: string): any; - setItem(key: string, value: any): void; - removeItem(key: string): void; - } - export interface StateManagerOptions { - storage?: IStorage; - stateSources?: any[]; - } - export class StateManager { - public storage: IStorage; - public stateSources: any[]; - constructor(options?: StateManagerOptions); - addStateSource(stateSource: any): void; - removeStateSource(stateSource: any): void; - saveState(): void; - restoreState(): void; - clearState(): void; - } - export class Route { - constructor(pattern: string, defaults?: any, constraints?: any); - parse(url: string): any; - format(routeValues: any): string; - formatSegment(value: any): string; - parseSegment(): any; - } - export class MvcRouter { - constructor(); - register(pattern: string, defaults?: any, constraints?: any): void; - parse(uri: string): any; - format(obj: any): string; - } - interface BrowserAdapterOptions { - window: Window; - } - export class DefaultBrowserAdapter { - constructor(options?: BrowserAdapterOptions); - replaceState(uri: string): void; - pushState(uri: string): void; - createRootPage(): void; - getWindowName(): string; - setWindowName(windowName: string): void; - back(): void; - getHash(): string; - isRootPage(): boolean; - } - export class OldBrowserAdapter extends DefaultBrowserAdapter { } - export class HistorylessBrowserAdapter extends DefaultBrowserAdapter { } - export interface INavigationDevice { - init: Function; - setUri(uri: string): void; - getUri(): string; - back(): void; - } - export class StackBasedNavigationDevice extends HistoryBasedNavigationDevice implements INavigationDevice { - uriChanged: JQueryCallback; - constructor(options?: BrowserAdapterOptions); - } - export class HistoryBasedNavigationDevice implements INavigationDevice { - backInitiated: JQueryCallback; - init: Function; - setUri(uri: string): void; - getUri(): string; - back(): void; - } - export class NavigationStack { - public items: any[]; - public currentIndex: number; - public itemsRemoved: JQueryCallback; - constructor(); - currentItem(): any; - back(uri: string): void; - forward(): void; - navigate(uri: any, replaceCurrent?: boolean): any; - getPreviousItem(): any; - canBack(): boolean; - clear(): void; - } - export interface NavigationManagerOptions { - stateStorageKey?: string; - navigationDevice?: INavigationDevice; - keepPositionInStack?: boolean; - } - export interface INavigationManager { - navigating: JQueryCallback; - navigated: JQueryCallback; - navigatingBack: JQueryCallback; - navigationCanceled: JQueryCallback; - itemRemoved: JQueryCallback; - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - back(alternate: any): void; - canBack(): boolean; - rootUri(): string; - currentItem(): any; - previousItem(): any; - saveState(): void; - removeState(): void; - restoreState(): void; - } - export class StackBasedNavigationManager extends HistoryBasedNavigationManager { - init(): JQueryPromise; - public currentStack: NavigationStack; - public navigationStacks: { - [key: string]: NavigationStack - }; - public navigating: JQueryCallback; - public navigated: JQueryCallback; - public navigatingBack: JQueryCallback; - public navigationCanceled: JQueryCallback; - public itemRemoved: JQueryCallback; - constructor(options?: NavigationManagerOptions); - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - currentIndex(): number; - getItemByIndex(index: number): any; - clearHistory(): void; - } - export class HistoryBasedNavigationManager implements INavigationManager { - navigating: JQueryCallback; - navigated: JQueryCallback; - navigatingBack: JQueryCallback; - navigationCanceled: JQueryCallback; - itemRemoved: JQueryCallback; - constructor(options?: NavigationManagerOptions); - navigate(uri: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - back(alternate: any): void; - canBack(): boolean; - rootUri(): string; - currentItem(): any; - previousItem(): any; - saveState(): void; - removeState(): void; - restoreState(): void; - } - export module utils { - export function mergeCommands(destination: any, source: any): dxCommand[]; - } - export interface ApplicationOptions { - router?: MvcRouter; - ns?: Object; - namespace?: Object; - viewCache?: IViewCache; - viewCacheSize?: number; - disableViewCache?: boolean; - useViewTitleAsBackText?: boolean; - stateManager?: StateManager; - navigationManager?: StackBasedNavigationManager; - navigation?: dxCommandOptions[]; - commandMapping?: CommandMap; - } - export class Application { - public router: MvcRouter; - public namespace: any; - public components: any[]; - public viewCache: IViewCache; - public stateManager: StateManager; - public commandMapping: CommandMap; - public navigation: dxCommand[]; - public navigationManager: StackBasedNavigationManager; - public beforeViewSetup: JQueryCallback; - public afterViewSetup: JQueryCallback; - public viewShowing: JQueryCallback; - public viewShown: JQueryCallback; - public viewHidden: JQueryCallback; - public viewDisposing: JQueryCallback; - public viewDisposed: JQueryCallback; - public navigating: JQueryCallback; - public navigatingBack: JQueryCallback; - constructor(options?: ApplicationOptions); - init(): any; - navigate(uri?: any, options?: { - root?: boolean; - target?: string; - direction?: string; - }): void; - back(): void; - canBack(): boolean; - saveState(): void; - clearState(): void; - restoreState(): void; - } - export function createActionExecutors(app: Application): { - [key: string]: { execute(e: any): void; } - }; -} -declare module DevExpress.framework.html { - export interface ILayoutController { - viewReleased: JQueryCallback; - init(options: InitLayoutControllerOptions): void; - activate(): void; - deactivate(): void; - showView(viewInfo: any, direction?: string): JQueryPromise; - } - export interface ILayoutControllerRegistration extends IDevice { - name: string; - controller: ILayoutController; - root?: boolean; - } - export var layoutControllers: Array; - export var layoutSets: Object; - export interface InitLayoutControllerOptions { - $viewPort?: JQuery; - $hiddenBag?: JQuery; - navigationManager?: framework.StackBasedNavigationManager; - } - export class DefaultLayoutController implements ILayoutController { - public viewReleased: JQueryCallback; - constructor(options?: { layoutTemplateName: string }); - init(options: InitLayoutControllerOptions): void; - activate(): void; - deactivate(): void; - showView(viewInfo: any, direction?: string): JQueryPromise; - } - export interface CommandManagerOptions { - globalCommands?: framework.dxCommand[]; - commandMapping?: framework.CommandMapping; - } - export class CommandManager { - public globalCommands: framework.dxCommand[]; - public commandMapping: framework.CommandMapping; - constructor(options?: CommandManagerOptions); - layoutCommands($markup: JQuery, extraCommands?: any): void; } - export interface ITemplateEngine { - applyTemplate(template: string, model: any): void; - applyTemplate(template: Element, model: any): void; - applyTemplate(template: JQuery, model: any): void; - } - export class KnockoutJSTemplateEngine implements ITemplateEngine { - constructor(); - applyTemplate(template: string, model: any): void; - applyTemplate(template: Element, model: any): void; - applyTemplate(template: JQuery, model: any): void; - } - export interface TransitionExecutorOptions { - type?: string; - source?: JQuery; - destination?: JQuery; - } - export class TransitionExecutor { - public container: JQuery; - constructor(container: JQuery, options: TransitionExecutorOptions); - finalize(): void; - exec(): JQueryPromise; - static create(container: JQuery, options: TransitionExecutorOptions): TransitionExecutor; - } - export interface ViewEngineOptions { - $root: JQuery; - device: IDevice; - commandManager?: CommandManager; - templateEngine?: ITemplateEngine; - dataOptionsAttributeName?: string; - } - export class ViewEngineBase { - public $root: JQuery; - public device: IDevice; - public commandManager: CommandManager; - public templateEngine: ITemplateEngine; - public dataOptionsAttributeName: string; - public viewSelecting: JQueryCallback; - public modelFromViewDataExtended: JQueryCallback; - constructor(options?: ViewEngineOptions); - init(): JQueryPromise; - findViewTemplate(viewName: string): JQuery; - afterViewSetup(viewInfo: any): void; - } - export class ViewEngine extends ViewEngineBase { - public layoutSelecting: JQueryCallback; - constructor(options?: ViewEngineOptions); - init(): JQueryPromise; - findLayoutTemplate(layoutName: string): JQuery; - } - export interface HtmlApplicationOptions extends framework.ApplicationOptions { - commandManager?: CommandManager; - templateEngine?: ITemplateEngine; - navigateToRootViewMode?: string; - layoutControllers?: Array - device?: IDevice; - layoutSet?: Array; - } - export class HtmlApplication extends framework.Application { - public viewEngine: ViewEngineBase; - public viewRendered: JQueryCallback; - public resolveLayoutController: JQueryCallback; - constructor(options?: HtmlApplicationOptions); - init(): any; - viewPort(): JQuery; - } -} -declare module DevExpress.ui { - export var themes: { - current(): string; - current(themeName: string): void; - }; - interface ViewportOptions { - allowPan?: boolean; - allowZoom?: boolean; - } - export interface ITemplate { - compile(html: string): any; - render(template: JQuery, data: any): any; - render(template: any, data: any): any; - } - class Template { - constructor(element: HTMLElement); - constructor(element: JQueryStatic); - render(container: HTMLElement): any; - render(container: JQueryStatic): any; - dispose(): void; - } - interface TemplateStatic { - new (element: HTMLElement): Template; - new (element: JQueryStatic): Template; - } - class TemplateProvider { - constructor(); - getTemplateClass(widget: any): TemplateStatic; - getDefaultTemplate(widget: any): void; supportDefaultTemplate(): boolean; - } - export function initViewport(options: ViewportOptions): void; - interface NotifyOptions { - message: string; - type?: string; - displayTime?: number; - hiddenAction: () => any; - } - export function notyfy(options: any): void; - export function notify(message: string, type?: string, displayTime?: number): void; - export module dialog { - interface Dialog { - show(): JQueryPromise; - hide(value?: any): void; - } - interface DialogButton { - text: string; - icon: string; - clickAction: () => any; - } - interface DialogOptions { - message: string; - title?: string; - } - export function custom(options: DialogOptions): Dialog; - export function custom(message: string, title?: string): Dialog; - export function alert(options: DialogOptions): JQueryPromise; - export function alert(message: string, title?: string): JQueryPromise; - export function confirm(options: DialogOptions): JQueryPromise; - export function confirm(message: string, title?: string): JQueryPromise; - } - export interface CollectionContainerWidgetOptions extends WidgetOptions { - items?: Array; - itemTemplate?: any; - itemRender?: Function; - itemClickAction?: any; - itemRenderedAction?: any; - noDataText?: string; - dataSource?: data.DataSource; - selectedIndex?: number; - itemSelectAction?: any; - itemHoldAction?: any; - itemHoldTimeout?: number; - } - export class CollectionContainerWidget extends Widget { - constructor(element: Element, options?: CollectionContainerWidgetOptions); - constructor(element: JQuery, options?: CollectionContainerWidgetOptions); - } - export interface WidgetOptions extends ComponentOptions { - contentReadyAction?: any; - width?: any; - height?: any; - visible?: boolean; - activeStateEnabled?: boolean; - } - export class Widget extends Component { - constructor(element: Element, options?: WidgetOptions); - constructor(element: JQuery, options?: WidgetOptions); - init(): void; - repaint(): void; - addTemplate(template: ITemplate): void; - } - export interface dxEditorOptions extends WidgetOptions { - value?: any; - valueChangeAction?: any; - } - export class dxEditor extends Widget { - constructor(element: Element, options?: dxEditorOptions); - constructor(element: JQuery, options?: dxEditorOptions); - } - export interface dxAutocompleteOptions extends dxDropDownEditorOptions { - minSearchLength?: number; - searchTimeout?: number; - placeholder?: string; - filterOperator?: string; - displayExpr?: string; - searchMode?: string; - dataSource?: data.DataSource; - items?: Array; - itemRender?: Function; - itemTemplate?: any; - } - export class dxAutocomplete extends dxDropDownEditor { - constructor(element: Element, options?: dxAutocompleteOptions); - constructor(element: JQuery, options?: dxAutocompleteOptions); - } - export interface dxButtonOptions extends WidgetOptions { - type?: string; - text?: string; - icon?: string; - iconSrc?: string; - clickAction?: any; - } - export class dxButton extends Widget { - constructor(element: Element, options?: dxButtonOptions); - constructor(element: JQuery, options?: dxButtonOptions); - } - export interface dxCheckBoxOptions extends dxEditorOptions { } - export class dxCheckBox extends dxEditor { - constructor(element: Element, options?: dxCheckBoxOptions); - constructor(element: JQuery, options?: dxCheckBoxOptions); - } - export interface dxCalendarOptions extends dxEditorOptions { - value?: Date; - min?: Date; - max?: Date; - firstDayOfWeek?: number; - } - export class dxCalendar extends dxEditor { - constructor(element: Element, options?: dxEditorOptions); - constructor(element: JQuery, options?: dxEditorOptions); - } - export interface dxDateBoxOptions extends dxTextEditorOptions { - format?: string; - useNativePicker?: boolean; - value?: Date; - type?: string; - min?: Date; - max?: Date; - useCalendar?: boolean; - formatString?: string; - closeOnValueChange?: boolean; - calendarOptions?: Object; - } - export class dxDateBox extends dxTextEditor { - constructor(element: Element, options?: dxDateBoxOptions); - constructor(element: JQuery, options?: dxDateBoxOptions); - } - export interface dxTextEditorOptions extends dxEditorOptions { - valueChangeEvent?: string; - placeholder?: string; - readOnly?: boolean; - focusInAction?: any; - focusOutAction?: any; - keyDownAction?: any; - keyPressAction?: any; - keyUpAction?: any; - changeAction?: any; - enterKeyAction?: any; - copyAction?: any; - pasteAction?: any; - cutAction?: any; - inputAction?: any; - showClearButton?: boolean; - mode?: string; - } - export class dxTextEditor extends dxEditor { - constructor(element: Element, options?: dxTextEditorOptions); - constructor(element: JQuery, options?: dxTextEditorOptions); - focus(): void; - blur(): void; - } - export interface dxListOptions extends CollectionContainerWidgetOptions { - pullRefreshEnabled?: boolean; - autoPagingEnabled?: boolean; - scrollingEnabled?: boolean; - showScrollbar?: boolean; - useNativeScrolling?: boolean; - grouped?: boolean; - editEnabled?: boolean; - showNextButton?: boolean; - groupTemplate?: string; - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - pageLoadingText?: string; - scrollAction?: any; - pullRefreshAction?: any; - pageLoadingAction?: any; - itemHoldAction?: any; - itemSwipeAction?: any; - itemHoldTimeout?: number; - groupRender? (groupData: any, groupIndex: number, groupElement: Element): any; - editConfig?: { - itemTemplate?: any; - itemRenderer? (itemData: any, itemIndex: number, itemElement: Element): any; - menuType?: string; - menuItems?: any[]; - deleteEnabled?: boolean; - deleteMode?: string; - selectionEnabled?: boolean; - selectionMode?: string; - selectionType?: string; - reorderEnabled?: boolean; - } - itemDeleteAction?: any; - selectedItems?: any[]; - itemSelectAction?: any; - itemUnselectAction?: any; - itemReorderAction?: any; - nextButtonText?: string; - selectionMode?: string; - } - export class dxList extends CollectionContainerWidget { - constructor(element: Element, options?: dxListOptions); - constructor(element: JQuery, options?: dxListOptions); - update(): JQueryPromise; - updateDimensions(): JQueryPromise; - refresh(): JQueryPromise; - reload(): JQueryPromise; - deleteItem(itemElement: JQuery): JQueryPromise; - deleteItem(itemElement: Element): JQueryPromise; - clearSelectedItems() : void; - isItemSelected(itemElement: JQuery): boolean; - isItemSelected(itemElement: Element): boolean; - selectItem(itemElement: JQuery): void; - selectItem(itemElement: Element): void; - unselectItem(itemElement: JQuery): void; - unselectItem(itemElement: Element): void; - reorderItem(itemElement: JQuery, toItemElement: JQuery): JQueryPromise; - reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; - getSelectedItems(): number[]; - clientHeight(): number; - scrollHeight(): number; - scrollBy(distance: number): void; - scrollTo(targetLocation: number): void; - scrollTop(): number; - } - export interface dxLoadPanelOptions extends dxOverlayOptions { - message?: string; - width?: number; - height?: number; - delay?: number; - showPane?: boolean; - showIndicator?: boolean; - indicatorSrc?: string; - } - export class dxLoadPanel extends dxOverlay { - constructor(element: Element, options?: dxLoadPanelOptions); - constructor(element: JQuery, options?: dxLoadPanelOptions); - hide(): void; - show(): void; - toggle(showing: boolean): void; - } - export interface dxLookupOptions extends dxEditorOptions { - dataSource?: data.DataSource; - displayValue?: string; - title?: string; - titleTemplate?: any; - valueExpr?: string; - displayExpr?: string; - placeholder?: string; - searchPlaceholder?: string; - searchEnabled?: boolean; - searchTimeout?: number; - minFilterLength?: number; - fullScreen?: boolean; - itemTemplate?: any; - itemRender?: Function; - showCancelButton?: boolean; - showClearButton?: boolean; - showDoneButton?: boolean; - showNextButton?: boolean; - doneButtonText?: string; - cancelButtonText?: string; - clearButtonText?: string; - nextButtonText?: string; - grouped?: boolean; - groupRender?: Function; - groupTemplate?: string; - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - pageLoadingText?: string; - noDataText?: string; - scrollAction?: any; - shading?: boolean; - closeOnOutsideClick?: boolean; - position?: any; - animation?: any; - shownAction?: any; - hiddenAction?: any; - popupWidth?: any; - popupHeight?: any; - autoPagingEnabled?: boolean; - useNativeScrolling?: boolean; - usePopover?: boolean; - openAction?: any; - closeAction?: any; - } - export class dxLookup extends dxEditor { - constructor(element: Element, options?: dxLookupOptions); - constructor(element: JQuery, options?: dxLookupOptions); - close(): void; - open(): void; - } - export interface dxMapOptions extends WidgetOptions { - location?: any; - width?: number; - height?: number; - zoom?: number; - mapType?: string; - provider?: string; - markers?: Array; - routes?: Array; - key?: string; - controls?: any; - mapReadyAction?: any; - autoAdjust?: boolean; - center?: any; - markerAddedAction?: any; - markerRemovedAction?: any; - markerIconSrc?: string; - routeAddedAction?: any; - routeRemovedAction?: any; - type?: string; - } - export class dxMap extends Widget { - constructor(element: Element, options?: dxMapOptions); - constructor(element: JQuery, options?: dxMapOptions); - addMarker(markerOptions: any, callback: Function): JQueryPromise; - removeMarker(marker: any): void; - addRoute(routeOptions: any, callback: Function): JQueryPromise; - removeRoute(route: any): void; - } - export interface dxNavBarOptions extends dxTabsOptions { } - export class dxNavBar extends dxTabs { - constructor(element: Element, options?: dxNavBarOptions); - constructor(element: JQuery, options?: dxNavBarOptions); - } - export interface dxNumberBoxOptions extends dxTextEditorOptions { - min?: number; - max?: number; - value?: number; - step?: number; - showSpinButtons?: boolean; - } - export class dxNumberBox extends dxTextEditor { - constructor(element: Element, options?: dxNumberBoxOptions); - constructor(element: JQuery, options?: dxNumberBoxOptions); - } - export interface dxOverlayOptions extends WidgetOptions { - activeStateEnabled?: boolean; - shading?: boolean; - closeOnOutsideClick?: boolean; - position?: any; - animation?: any; - showingAction?: any; - shownAction?: any; - hidingAction?: any; - hiddenAction?: any; - deferRendering?: boolean; - targetContainer?: any; - contentTemplate?: any; - } - export class dxOverlay extends Widget { - constructor(element: Element, options?: dxOverlayOptions); - constructor(element: JQuery, options?: dxOverlayOptions); - content(): JQuery; - hide(): void; - show(): void; - toggle(showing: boolean): void; - } - export interface dxPopupOptions extends dxOverlayOptions { - title?: string; - showTitle?: boolean; - fullScreen?: boolean; - cancelButton?: any; - doneButton?: any; - clearButton?: any; - titleTemplate?: any; - dragEnabled?: boolean; - } - export class dxPopup extends dxOverlay { - constructor(element: Element, options?: dxPopupOptions); - constructor(element: JQuery, options?: dxPopupOptions); - } - export interface dxPopoverOptions extends dxPopupOptions { - target?: any; - } - export class dxPopover extends dxPopup { - constructor(element: Element, options?: dxPopoverOptions); - constructor(element: JQuery, options?: dxPopoverOptions); - } - export interface dxTooltipOptions extends dxPopoverOptions { - target?: any; - } - export class dxTooltip extends dxPopover { - constructor(element: Element, options?: dxTooltipOptions); - constructor(element: JQuery, options?: dxTooltipOptions); - } - export interface dxRadioGroupOptions extends CollectionContainerWidgetOptions { - layout?: string; - name?: string; - value?: Object; - valueExpr?: string; - } - export class dxRadioGroup extends CollectionContainerWidget { - constructor(element: Element, options?: dxRadioGroupOptions); - constructor(element: JQuery, options?: dxRadioGroupOptions); - } - export interface dxRangeSliderOptions extends dxSliderOptions { - start?: number; - end?: number; - } - export class dxRangeSlider extends dxSlider { - constructor(element: Element, options?: dxRangeSliderOptions); - constructor(element: JQuery, options?: dxRangeSliderOptions); - } - export interface dxScrollableOptions extends ComponentOptions { - startAction?: any; - scrollAction?: any; - endAction?: any; - stopAction?: any; - inertiaAction?: any; - bounceAction?: any; - updateAction?: any; - bounceEnabled?: boolean; - direction?: string; - showScrollbar?: boolean; - useNative?: boolean; - } - export class dxScrollable extends Component { - constructor(element: Element, options?: dxScrollableOptions); - constructor(element: JQuery, options?: dxScrollableOptions); - update(): void; - content(): JQuery; - clientHeight(): number; - scrollHeight(): number; - clientWidth(): number; - scrollWidth(): number; - scrollLeft(): number; - scrollTop(): number; - scrollOffset(): Object; - scrollBy(distance: number): void; - scrollBy(distance: Object): void; - scrollTo(targetLocation: number): void; - scrollTo(targetLocation: Object): void; - } - export interface dxScrollViewOptions extends dxScrollableOptions { - pullingDownText?: string; - pulledDownText?: string; - refreshingText?: string; - reachBottomText?: string; - pullDownAction?: any; - reachBottomAction?: any; - } - export class dxScrollView extends dxScrollable { - constructor(element: Element, options?: dxScrollViewOptions); - constructor(element: JQuery, options?: dxScrollViewOptions); - release(preventReachBottom: boolean): JQueryPromise; - toggleLoading(showOrHide: boolean): void; - refresh(): void; - } - export interface dxSelectBoxOptions extends dxAutocompleteOptions { - fieldTemplate?: any; - displayValue?: string; - multiSelectEnabled?: boolean; - values?: any[]; - openAction?: any; - closeAction?: any; - } - export class dxSelectBox extends dxAutocomplete { - constructor(element: Element, options?: dxSelectBoxOptions); - constructor(element: JQuery, options?: dxSelectBoxOptions); - } - export interface dxSliderOptions extends dxEditorOptions { - min?: number; - max?: number; - step?: number; - showRange?: boolean; - label?: { - visible: boolean; - format?: any; - position?: string; - } - tooltip?: { - enabled?: boolean; - format?: any; - position?: string; - showMode?: string; - } - } - export class dxSlider extends dxEditor { - constructor(element: Element, options?: dxSliderOptions); - constructor(element: JQuery, options?: dxSliderOptions); - } - export interface dxTabsOptions extends CollectionContainerWidgetOptions { } - export class dxTabs extends CollectionContainerWidget { - constructor(element: Element, options?: dxTabsOptions); - constructor(element: JQuery, options?: dxTabsOptions); - } - export interface dxTextAreaOptions extends dxTextEditorOptions { - cols?: number; - rows?: number; - } - export class dxTextArea extends dxTextEditor { - constructor(element: Element, options?: dxTextAreaOptions); - constructor(element: JQuery, options?: dxTextAreaOptions); - } - export interface dxTextBoxOptions extends dxTextEditorOptions { - maxLength?: any; - } - export class dxTextBox extends dxTextEditor { - constructor(element: Element, options?: dxTextBoxOptions); - constructor(element: JQuery, options?: dxTextBoxOptions); - } - export interface dxToastOptions extends dxOverlayOptions { - message?: string; - type?: string; - displayTime?: number; - } - export class dxToast extends dxOverlay { - constructor(element: Element, options?: dxToastOptions); - constructor(element: JQuery, options?: dxToastOptions); - } - export interface dxToolbarOptions extends CollectionContainerWidgetOptions { - menuItemRender?: Function; - menuItemTemplate?: any; - submenuType?: string; - renderAs?: string; - } - export class dxToolbar extends CollectionContainerWidget { - constructor(element: Element, options?: dxToolbarOptions); - constructor(element: JQuery, options?: dxToolbarOptions); - } - export interface dxDropDownEditorOptions extends dxTextBoxOptions { - closeAction?: any; - openAction?: any; - } - export class dxDropDownEditor extends dxTextBox { - constructor(element: Element, options?: dxDropDownEditorOptions); - constructor(element: JQuery, options?: dxDropDownEditorOptions); - } - export interface dxLoadIndicatorOptions extends WidgetOptions { - indicatorSrc?: string; - } - export class dxLoadIndicator extends Widget { - constructor(element: Element, options?: dxLoadIndicatorOptions); - constructor(element: JQuery, options?: dxLoadIndicatorOptions); - } - export interface dxMultiViewOptions extends CollectionContainerWidgetOptions { - loop?: boolean; - swipeEnabled?: boolean; - animationEnabled?: boolean; - selectedIndex?: number; - } - export class dxMultiView extends CollectionContainerWidget { - constructor(element: Element, options?: dxMultiViewOptions); - constructor(element: JQuery, options?: dxMultiViewOptions); - } - export interface dxGalleryOptions extends CollectionContainerWidgetOptions { - activeStateEnabled?: boolean; - animationDuration?: number; - loop?: boolean; - swipeEnabled?: boolean; - indicatorEnabled?: boolean; - showIndicator?: boolean; - selectedIndex?: number; - slideshowDelay?: number; - showNavButtons?: boolean; - } - export class dxGallery extends CollectionContainerWidget { - constructor(element: Element, options?: dxGalleryOptions); - constructor(element: JQuery, options?: dxGalleryOptions); - goToItem(itemIndex?: number, animation?: boolean): JQueryPromise; - prevItem(animation?: boolean): JQueryPromise; - nextItem(animation?: boolean): JQueryPromise; - } - export interface dxDataGridFilterDescriptions { - '='?: string; - '<>'?: string; - '<'?: string; - '<='?: string; - '>'?: string; - '>='?: string; - 'startswith'?: string; - 'contains'?: string; - 'notcontains'?: string; - 'endswith'?: string; - } - export interface dxDataGridColumn { - allowSorting?: boolean; - allowFiltering?: boolean; - allowHiding?: boolean; - allowEditing?: boolean; - allowGrouping?: boolean; - allowReordering?: boolean; - allowResizing?: boolean; - visible?: boolean; - dataField?: string; - dataType?: string; - calculateCellValue?: (rowData: {}) => any; - calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; - caption?: string; - width?: any; cssClass?: string; - trueText?: string; - falseText?: string; - sortOrder?: string; - sortIndex?: number; - groupIndex?: number; - alignment?: string; - format?: string; - precision?: number; - customizeText?: (options: { value: any; valueText: string }) => string; - filterOperations?: dxDataGridFilterDescriptions; - selectedFilterOperation?: string; - cellTemplate?: any; headerCellTemplate?: any; editCellTemplate?: any; groupCellTemplate?: any; lookup?: { - dataSource?: any; valueExpr?: any; displayExpr?: any; }; - } - export interface dxDataGridOptions extends ui.WidgetOptions { - dataSource?: any; - dataErrorOccurred?: (errorObject: {}) => void; - showColumnHeaders?: boolean; - columnAutoWidth?: boolean; - noDataText?: string; - wordWrapEnabled?: boolean; - showColumnLines?: boolean; - showRowLines?: boolean; - rowAlternationEnabled?: boolean; - allowColumnReordering?: boolean; - allowColumnResizing?: boolean; - hoverStateEnabled?: boolean; - selectedItems?: Array; - columnChooser?: { - enabled?: boolean; - width?: number; - height?: number; - title?: string; - emptyPanelText?: string; - }; - selection?: { - mode?: string; - allowSelectAll?: boolean; - }; - sorting?: { - mode?: string; - ascendingText?: string; - descendingText?: string; - clearText?: string; - }; - searchPanel?: { - visible?: boolean; - width?: number; - placeholder?: string; - highlightSearchText?: boolean; - }; - grouping?: { - autoExpandAll?: boolean; - allowCollapsing?: boolean; - groupContinuesMessage?: string; - groupContinuedMessage?: string; - }; - groupPanel?: { - visible?: boolean; - emptyPanelText?: string; - allowColumnDragging?: boolean; - }; - filterRow?: { - visible?: boolean; - showOperationChooser?: boolean; - showAllText?: string; - resetOperationText?: string; - operationDescriptions?: dxDataGridFilterDescriptions; - }; - paging?: { - enabled?: boolean; - pageSize?: number; - pageIndex?: number; - }; - pager?: { - visible?: any; showPageSizeSelector?: boolean; - allowedPageSizes?: Array; - }; - editing?: { - editMode?: string; - insertEnabled?: boolean; - editEnabled?: boolean; - removeEnabled?: boolean; - texts?: { - editRow?: string; - saveRowChanges?: string; - cancelRowChanges?: string; - deleteRow?: string; - recoverRow?: string; - undeleteRow?: string; - confirmDeleteMessage?: string; - confirmDeleteTitle?: string; - } - }; - scrolling?: { - mode?: string; - preloadEnabled?: boolean; - useNativeScrolling?: boolean; - }; - loadPanel?: { - enabled?: boolean; - text?: string; - width?: number; - height?: number; - }; - stateStoring?: { - enabled?: boolean; - storageKey?: string; - type?: string; - customLoad?: () => any; - customSave?: (state: {}) => void; - }; - rowTemplate?: any; columns?: Array; - selectionChanged?: (options: {}) => void; - customizeColumns?: (columns: Array) => void; - rowClick?: (data: {}) => void; - cellClick?: (clickedCell: {}) => void; - cellHoverChanged?: (hoveredCell: {}) => void; - } - export class dxDataGrid extends Widget { - constructor(element: Element, options?: dxDataGridOptions); - constructor(element: JQuery, options?: dxDataGridOptions); - showColumnChooser: () => void; - hideColumnChooser: () => void; - beginCustomLoading: (messageText?: string) => void; - endCustomLoading: () => void; - startSelectionWithCheckboxes: () => void; - stopSelectionWithCheckboxes: () => void; - selectAll: () => void; - clearSelection: () => void; - getSelectedRowKeys: () => Array; - getSelectedRowsData: () => Array; - selectRows: (keys: Array) => void; - selectRowsByIndexes: (indexes: Array) => void; - searchByText: (text: string) => void; - insertRow: () => void; - editRow: (rowIndex: number) => void; - editCell: (rowIndex: number, columnIndex: number) => void; - removeRow: (rowIndex: number) => void; - saveEditData: () => void; - undeleteRow: (rowIndex: number) => void; - cancelEditData: () => void; - refresh: () => void; - filter: (expr: any) => void; - clearFilter: () => void; - keyOf: (data: {}) => any; - byKey: (key: any) => {}; - getDataByKeys: (rowKeys: Array) => Array<{}>; - pageIndex: (value: number) => number; - totalCount: () => number; - closeEditCell: () => void; - collapseAll: (groupIndex?: number) => void; - expandAll: (groupIndex?: number) => void; - addColumn: (options: any) => void; - columnOption: (columnIndex: number, optionName?: string, optionValue?: any) => {}; - isScrollbarVisible: () => boolean; - getTopVisibleRowData: () => {}; - } - export interface dxMenuOptions extends CollectionContainerWidgetOptions { - orientation?: string; - submenuDirection?: string; - showFirstSubmenuMode?: string; - enableHotTrack?: boolean; - allowSelection?: boolean; - allowSelectOnClick?: boolean; - selectedItem?: any; - itemSelectAction?: any; - cssClass?: string; - } - export interface dxContextMenuOptions extends CollectionContainerWidgetOptions { - showSubmenuMode?: string; - invokeOnlyFromCode?: boolean; - cssClass?: string; - enableHotTrack?: boolean; - allowSelection?: boolean; - allowSelectOnClick?: boolean; - selectedItem?: any; - itemSelectAction?: any; - animation?: any; - position?: any; - showingAction?: any; - submenuDirection?: string; - } - export class dxMenu extends CollectionContainerWidget { - constructor(element: Element, options?: dxMenuOptions); - constructor(element: JQuery, options?: dxMenuOptions); - } - export class dxContextMenu extends CollectionContainerWidget { - constructor(element: Element, options?: dxContextMenuOptions); - constructor(element: JQuery, options?: dxContextMenuOptions); - } - export interface dxColorPickerOptions extends dxDropDownEditorOptions { - editAlphaChannel?: boolean; - applyButtonText?: string; - cancelButtonText?: string; - } - export class dxColorPicker extends dxDropDownEditor { - constructor(element: Element, options?: dxColorPickerOptions); - constructor(element: JQuery, options?: dxColorPickerOptions); - } -} -interface JQuery { - dxAutocomplete(options?: DevExpress.ui.dxAutocompleteOptions): JQuery; - dxButton(options?: DevExpress.ui.dxButtonOptions): JQuery; - dxCheckBox(options?: DevExpress.ui.dxCheckBoxOptions): JQuery; - dxCalendar(options?: DevExpress.ui.dxCalendarOptions): JQuery; - dxDateBox(options?: DevExpress.ui.dxDateBoxOptions): JQuery; - dxTextEditor(options?: DevExpress.ui.dxTextEditorOptions): JQuery; - dxList(options?: DevExpress.ui.dxListOptions): JQuery; - dxLoadPanel(options?: DevExpress.ui.dxLoadPanelOptions): JQuery; - dxLookup(options?: DevExpress.ui.dxLookupOptions): JQuery; - dxMap(options?: DevExpress.ui.dxMapOptions): JQuery; - dxNavBar(options?: DevExpress.ui.dxNavBarOptions): JQuery; - dxNumberBox(options?: DevExpress.ui.dxNumberBoxOptions): JQuery; - dxOverlay(options?: DevExpress.ui.dxOverlayOptions): JQuery; - dxPopup(options?: DevExpress.ui.dxPopupOptions): JQuery; - dxPopover(options?: DevExpress.ui.dxPopoverOptions): JQuery; - dxTooltip(options?: DevExpress.ui.dxTooltipOptions): JQuery; - dxRadioGroup(options?: DevExpress.ui.dxRadioGroupOptions): JQuery; - dxRangeSlider(options?: DevExpress.ui.dxRangeSliderOptions): JQuery; - dxScrollable(options?: DevExpress.ui.dxScrollableOptions): JQuery; - dxScrollView(options?: DevExpress.ui.dxScrollViewOptions): JQuery; - dxSelectBox(options?: DevExpress.ui.dxSelectBoxOptions): JQuery; - dxSlider(options?: DevExpress.ui.dxSliderOptions): JQuery; - dxTabs(options?: DevExpress.ui.dxTabsOptions): JQuery; - dxTextArea(options?: DevExpress.ui.dxTextAreaOptions): JQuery; - dxTextBox(options?: DevExpress.ui.dxTextBoxOptions): JQuery; - dxToast(options?: DevExpress.ui.dxToastOptions): JQuery; - dxToolbar(options?: DevExpress.ui.dxToolbarOptions): JQuery; - dxDropDownEditor(options?: DevExpress.ui.dxDropDownEditorOptions): JQuery; - dxLoadIndicator(options?: DevExpress.ui.dxLoadIndicatorOptions): JQuery; - dxMultiView(options?: DevExpress.ui.dxMultiViewOptions): JQuery; - dxGallery(options?: DevExpress.ui.dxGalleryOptions): JQuery; - dxDataGrid(options?: DevExpress.ui.dxDataGridOptions): JQuery; - dxMenu(options?: DevExpress.ui.dxMenuOptions): JQuery; - dxContextMenu(options?: DevExpress.ui.dxContextMenuOptions): JQuery; - dxColorPicker(options?: DevExpress.ui.dxColorPickerOptions): JQuery; -} \ No newline at end of file From 1ba173f3bc34379bd798103096c8002f75baaaa5 Mon Sep 17 00:00:00 2001 From: Erik Hesselink Date: Tue, 9 Jun 2015 16:22:13 +0200 Subject: [PATCH 0075/2220] jquery: add second signature for triggerHandler. This one takes an event instead of an event type. See documentation (http://api.jquery.com/triggerHandler/) and related documentation ticket (https://github.com/jquery/api.jquery.com/issues/393). --- jquery/jquery.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 6a7bc47c2e..465323931b 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -2455,6 +2455,14 @@ interface JQuery { */ triggerHandler(eventType: string, ...extraParameters: any[]): Object; + /** + * Execute all handlers attached to an element for an event. + * + * @param event A jQuery.Event object. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(event: JQueryEventObject, ...extraParameters: any[]): Object; + /** * Remove a previously-attached event handler from the elements. * From 3c6a35db55e49d25f87928e02e15c5345d5724a1 Mon Sep 17 00:00:00 2001 From: Tsuyoshi Maeda Date: Tue, 9 Jun 2015 23:26:50 +0900 Subject: [PATCH 0076/2220] add define column(name: string) --- angular-protractor/angular-protractor.d.ts | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/angular-protractor/angular-protractor.d.ts b/angular-protractor/angular-protractor.d.ts index 11e9d3268b..76f0b5f10c 100644 --- a/angular-protractor/angular-protractor.d.ts +++ b/angular-protractor/angular-protractor.d.ts @@ -564,7 +564,7 @@ declare module protractor { */ element(subLocator: webdriver.Locator): ElementFinder; - /** + /** * Calls to element may be chained to find an array of elements within a parent. * * @alias element(locator).all(locator) @@ -652,7 +652,7 @@ declare module protractor { /** * Override for WebElement.prototype.isElementPresent so that protractor waits * for Angular to settle before making the check. - * + * * @see ElementFinder.isPresent * * @param {webdriver.Locator} subLocator Locator for element to look for. @@ -879,7 +879,7 @@ declare module protractor { * filteredElements[0].click(); * }); * - * @param {function(ElementFinder, number): webdriver.WebElement.Promise} filterFn + * @param {function(ElementFinder, number): webdriver.WebElement.Promise} filterFn * Filter function that will test if an element should be returned. * filterFn can either return a boolean or a promise that resolves to a boolean. * @return {!ElementArrayFinder} A ElementArrayFinder that represents an array @@ -888,11 +888,11 @@ declare module protractor { filter(filterFn: (element: ElementFinder, index: number) => any): ElementArrayFinder; /** - * Apply a reduce function against an accumulator and every element found + * Apply a reduce function against an accumulator and every element found * using the locator (from left-to-right). The reduce function has to reduce - * every element into a single value (the accumulator). Returns promise of - * the accumulator. The reduce function receives the accumulator, current - * ElementFinder, the index, and the entire array of ElementFinders, + * every element into a single value (the accumulator). Returns promise of + * the accumulator. The reduce function receives the accumulator, current + * ElementFinder, the index, and the entire array of ElementFinders, * respectively. * * @alias element.all(locator).reduce(reduceFn) @@ -912,11 +912,11 @@ declare module protractor { * * expect(value).toEqual('First Second Third '); * - * @param {function(number, ElementFinder, number, Array.)} + * @param {function(number, ElementFinder, number, Array.)} * reduceFn Reduce function that reduces every element into a single value. - * @param {*} initialValue Initial value of the accumulator. + * @param {*} initialValue Initial value of the accumulator. * @return {!webdriver.promise.Promise} A promise that resolves to the final - * value of the accumulator. + * value of the accumulator. */ reduce(reduceFn: (acc: T, element: ElementFinder, index: number, arr: ElementFinder[]) => webdriver.promise.Promise, initialValue: T): webdriver.promise.Promise; reduce(reduceFn: (acc: T, element: ElementFinder, index: number, arr: ElementFinder[]) => T, initialValue: T): webdriver.promise.Promise; @@ -924,7 +924,7 @@ declare module protractor { /** * Represents the ElementArrayFinder as an array of ElementFinders. * - * @return {Array.} Return a promise, which resolves to a list + * @return {Array.} Return a promise, which resolves to a list * of ElementFinders specified by the locator. */ asElementFinders_(): ElementFinder[]; @@ -1221,6 +1221,7 @@ declare module protractor { interface LocatorWithColumn extends webdriver.Locator { column(index: number): webdriver.Locator; + column(name: string): webdriver.Locator; } interface RepeaterLocator extends LocatorWithColumn { @@ -1299,7 +1300,7 @@ declare module protractor { * expect(element(by.exactBinding('person_phone')).isPresent()).toBe(true); * expect(element(by.exactBinding('person_phone|uppercase')).isPresent()).toBe(true); * expect(element(by.exactBinding('phone')).isPresent()).toBe(false); - * + * * @param {string} bindingDescriptor * @return {{findElementsOverride: findElementsOverride, toString: Function|string}} */ From efaab812e1f09ed92825ca0a5bd08c6cb5422104 Mon Sep 17 00:00:00 2001 From: Norbert Wagner Date: Tue, 9 Jun 2015 17:21:31 +0200 Subject: [PATCH 0077/2220] Changed export to make Knex interface available without creating an instance. Allows to define migrations in Typescript --- knex/knex.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/knex/knex.d.ts b/knex/knex.d.ts index c9a6ada4bc..53a2e722a6 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -41,6 +41,8 @@ declare module "knex" { fn: any; } + function Knex( config : Config ) : Knex; + // // QueryInterface // @@ -452,6 +454,5 @@ declare module "knex" { tableName?: string; } - var _: KnexStatic; - export = _; + export = Knex; } From 8c64199797695335ace599f27a3ee86b4c7d5545 Mon Sep 17 00:00:00 2001 From: Bill Chen Date: Tue, 9 Jun 2015 16:57:24 +0100 Subject: [PATCH 0078/2220] Made the signature of INgModelController.$validators more precise and corrected the return type of $asyncValidators Tests included. --- angularjs/angular-tests.ts | 28 +++++++++++++++++++++++++++- angularjs/angular.d.ts | 4 ++-- 2 files changed, 29 insertions(+), 3 deletions(-) mode change 100644 => 100755 angularjs/angular-tests.ts diff --git a/angularjs/angular-tests.ts b/angularjs/angular-tests.ts old mode 100644 new mode 100755 index 7511f3627e..9750599999 --- a/angularjs/angular-tests.ts +++ b/angularjs/angular-tests.ts @@ -702,4 +702,30 @@ module locationTests { $location.path() == '/foo/bar' $location.url() == '/foo/bar?x=y' $location.absUrl() == 'http://example.com/#!/foo/bar?x=y' -} \ No newline at end of file +} + +// NgModelController +function NgModelControllerTyping() { + var ngModel: angular.INgModelController; + var $http: angular.IHttpService; + var $q: angular.IQService; + + // See https://docs.angularjs.org/api/ng/type/ngModel.NgModelController#$validators + ngModel.$validators['validCharacters'] = function(modelValue, viewValue) { + var value = modelValue || viewValue; + return /[0-9]+/.test(value) && + /[a-z]+/.test(value) && + /[A-Z]+/.test(value) && + /\W+/.test(value); + }; + + ngModel.$asyncValidators['uniqueUsername'] = function(modelValue, viewValue) { + var value = modelValue || viewValue; + return $http.get('/api/users/' + value). + then(function resolved() { + return $q.reject('exists'); + }, function rejected() { + return true; + }); + }; +} diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 0e54c2aea8..eb826fa48f 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -524,11 +524,11 @@ declare module angular { } interface IModelValidators { - [index: string]: (...args: any[]) => boolean; + [index: string]: (modelValue: any, viewValue: string) => boolean; } interface IAsyncModelValidators { - [index: string]: (...args: any[]) => IPromise; + [index: string]: (modelValue: any, viewValue: string) => IPromise; } interface IModelParser { From 70e7942287d65aaec272ef0736d0e07bdb7dfdbb Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Tue, 9 Jun 2015 15:06:04 -0700 Subject: [PATCH 0079/2220] L.LineUtil.closestPointOnSegment update [L.LineUtil.closestPointOnSegment](http://leafletjs.com/reference.html#lineutil-closestpointonsegment) should return L.Point rather than number --- leaflet/leaflet.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index 2bd6a51189..dd57395001 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -1980,7 +1980,7 @@ declare module L { /** * Returns the closest point from a point p on a segment p1 to p2. */ - export function closestPointOnSegment(p: Point, p1: Point, p2: Point): number; + export function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point; /** * Clips the segment a to b by rectangular bounds (modifying the segment points From 8a42c1d47433e939dd44be6d25830995ecd6e4f9 Mon Sep 17 00:00:00 2001 From: joswhite Date: Tue, 9 Jun 2015 16:08:25 -0600 Subject: [PATCH 0080/2220] Update jasmine.d.ts Add Jasmine's .anything() matcher --- jasmine/jasmine.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index 43831c68a1..c0bd008435 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -46,6 +46,7 @@ declare module jasmine { var clock: () => Clock; function any(aclass: any): Any; + function anything(): Any; function objectContaining(sample: any): ObjectContaining; function createSpy(name: string, originalFn?: Function): Spy; function createSpyObj(baseName: string, methodNames: any[]): any; From 8e67664543cac82ce1d0c3751a5b828d58336d66 Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 10 Jun 2015 01:17:24 +0200 Subject: [PATCH 0081/2220] bad copy paste on comments --- knockout.punches/knockout.punches.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout.punches/knockout.punches.d.ts b/knockout.punches/knockout.punches.d.ts index d219d61f15..fbb78cd46f 100644 --- a/knockout.punches/knockout.punches.d.ts +++ b/knockout.punches/knockout.punches.d.ts @@ -1,6 +1,6 @@ // Type definitions for knockout.punches 0.5.1 // Project: https://github.com/mbest/knockout.punches -// Definitions by: Stephen Lautier +// Definitions by: Stephen Lautier // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From da3183460c16650131ad94f29f501fd2e0e81aad Mon Sep 17 00:00:00 2001 From: Matthew Traynham Date: Tue, 9 Jun 2015 20:34:12 -0400 Subject: [PATCH 0082/2220] Data function doesn't return the group accessor. Composite chart should be extendable. --- dcjs/dc.d.ts | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dcjs/dc.d.ts b/dcjs/dc.d.ts index 62739e16a6..bf31738019 100644 --- a/dcjs/dc.d.ts +++ b/dcjs/dc.d.ts @@ -20,6 +20,11 @@ declare module DC { (t: T, r?: R): V; } + export interface IGetSetComputed { + (): R; + (t: T): V; + } + export interface Scale { (x: any): T; @@ -118,7 +123,7 @@ declare module DC { minWidth: IGetSet; minHeight: IGetSet; dimension: IGetSet; - data: IGetSet<(group: any) => Array, T>; + data: IGetSetComputed<(group: any) => Array, Array, T>; group: IGetSet; ordering: IGetSet, T>; filterAll(): void; @@ -297,19 +302,21 @@ declare module DC { elasticRadius: IGetSet; } - export interface CompositeChart extends CoordinateGridMixin { - useRightAxisGridLines: IGetSet; - childOptions: IGetSet; - rightYAxisLabel: IGetSet; - compose: IGetSet>, CompositeChart>; + export interface ICompositeChart extends CoordinateGridMixin { + useRightAxisGridLines: IGetSet>; + childOptions: IGetSet>; + rightYAxisLabel: IGetSet>; + compose: IGetSet>, ICompositeChart>; children(): Array>; - shareColors: IGetSet; - shareTitle: IGetSet; - rightY: IGetSet<(n: any) => any, CompositeChart>; - rightYAxis: IGetSet; + shareColors: IGetSet>; + shareTitle: IGetSet>; + rightY: IGetSet<(n: any) => any, ICompositeChart>; + rightYAxis: IGetSet>; } - export interface SeriesChart extends CompositeChart { + export interface CompositeChart extends ICompositeChart {} + + export interface SeriesChart extends ICompositeChart { chart: IGetSet<(c: any) => BaseMixin, SeriesChart>; seriesAccessor: IGetSet, SeriesChart>; seriesSort: IGetSet<(a: any, b: any) => number, SeriesChart>; From e06dd57152c4964ecb4fbd4f3f8d93abf931235c Mon Sep 17 00:00:00 2001 From: Hung Date: Tue, 9 Jun 2015 18:10:18 -0700 Subject: [PATCH 0083/2220] Update chrome.identity with new API version 29 For reference: https://developer.chrome.com/apps/identity#method-launchWebAuthFlow --- chrome/chrome.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 19d5c4d0bd..17c57c88d1 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -1082,6 +1082,7 @@ declare module chrome.history { //////////////////// declare module chrome.identity { var getAuthToken: (options: any, cb: (token: {}) => void) => void; + var launchWebAuthFlow: (options: any, cb: (redirect_url: string) => void) => void; } From 4e2bf8aeb5baacbdc09f64393f65e55683a7dcb2 Mon Sep 17 00:00:00 2001 From: The Gitter Badger Date: Wed, 10 Jun 2015 01:55:51 +0000 Subject: [PATCH 0084/2220] Added Gitter badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cf20cf55a1..c17e2f7240 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # DefinitelyTyped [![Build Status](https://travis-ci.org/borisyankov/DefinitelyTyped.png?branch=master)](https://travis-ci.org/borisyankov/DefinitelyTyped) +[![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + > The repository for *high quality* TypeScript type definitions. For more information see the [definitelytyped.org](http://definitelytyped.org) website. From eb5f7c2d2a1ee0de72fe9d8b40c9d33ec2612e63 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Wed, 10 Jun 2015 16:38:16 +1200 Subject: [PATCH 0085/2220] Add definition with test for when.settle, add a test for when.all --- when/when-tests.ts | 10 ++++++++++ when/when.d.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/when/when-tests.ts b/when/when-tests.ts index 61b688a035..7f365b4cc1 100644 --- a/when/when-tests.ts +++ b/when/when-tests.ts @@ -91,6 +91,16 @@ promise = liftedFunc5(when(1), when('2'), when(true), when(4), when('5')); var joinedPromise: when.Promise = when.join(when(1), when(2), when(3)); +/* when.all(arr) */ +when.all([when(1), when(2), when(3)]).then(results => { + return results.reduce((r, x) => r + x, 0); +}); + +/* when.settle(arr) */ +when.settle([when(1), when(2), when.reject(new Error("Foo"))]).then(descriptors => { + return descriptors.filter(d => d.state === 'rejected').reduce((r, d) => r + d.value, 0); +}); + /* when.promise(resolver) */ promise = when.promise(resolve => resolve(5)); diff --git a/when/when.d.ts b/when/when.d.ts index be5e25f154..ab44901de6 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -101,6 +101,32 @@ declare module When { */ function all(promisesOrValues: any[]): Promise; + /** + * Describes the status of a promise. + * state may be one of: + * "fulfilled" - the promise has resolved + * "pending" - the promise is still pending to resolve/reject + * "rejected" - the promise has rejected + */ + interface Descriptor { + state: string; + value?: T; + reason?: any; + } + + /** + * Returns a promise for an array containing the same number of elements as the input array. + * Each element is a descriptor object describing of the outcome of the corresponding element in the input. + * The returned promise will only reject if array itself is a rejected promise. Otherwise, + * it will always fulfill with an array of descriptors. This is in contrast to when.all, + * which will reject if any element of array rejects. + * @memberOf when + * + * @param promisesOrValues array of anything, may contain a mix + * of {@link Promise}s and values + */ + function settle(promisesOrValues: any[]): Promise[]>; + /** * Creates a {promise, resolver} pair, either or both of which * may be given out safely to consumers. From 097dc2e2ba1f05755500a722c209715e56b40621 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Wed, 10 Jun 2015 17:01:55 +1200 Subject: [PATCH 0086/2220] Add definition with tests for spread --- when/when-tests.ts | 8 +++++--- when/when.d.ts | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/when/when-tests.ts b/when/when-tests.ts index 61b688a035..602a2867ed 100644 --- a/when/when-tests.ts +++ b/when/when-tests.ts @@ -132,9 +132,11 @@ promise = when(1).then((val: number) => when(val + val), (err: any) => 2); /* promise.spread(onFulfilledArray) */ -// TODO: Work out how to do this... -// promise = when([1, '2', true]).spread((a: number, b: string, c: boolean) => a); -// promise = when([1, '2', true]).spread((a: number, b: string, c: boolean) => when(a)); +promise = when([]).spread(() => 2); +promise = when([1]).spread((a: number) => a); +promise = when([1, '2']).spread((a: number, b: string) => a); +promise = when([1, '2', true]).spread((a: number, b: string, c: boolean) => a); +promise = when([1, '2', true]).spread((a: number, b: string, c: boolean) => when(a)); /* promise.fold(combine, promise2) */ diff --git a/when/when.d.ts b/when/when.d.ts index be5e25f154..cd99d2a9a0 100644 --- a/when/when.d.ts +++ b/when/when.d.ts @@ -180,6 +180,13 @@ declare module When { then(onFulfilled: (value: T) => U | Promise, onRejected?: (reason: any) => U | Promise, onProgress?: (update: any) => void): Promise; + spread(onFulfilled: _.Fn0 | T>): Promise; + spread(onFulfilled: _.Fn1 | T>): Promise; + spread(onFulfilled: _.Fn2 | T>): Promise; + spread(onFulfilled: _.Fn3 | T>): Promise; + spread(onFulfilled: _.Fn4 | T>): Promise; + spread(onFulfilled: _.Fn5 | T>): Promise; + done(onFulfilled: (value: T) => void, onRejected?: (reason: any) => void): void; fold(combine: (value1: T, value2: V) => U | Promise, value2: V | Promise): Promise; From da8abdb2f402496287cb8720af5ca2ffbb44d306 Mon Sep 17 00:00:00 2001 From: ciju cherian Date: Wed, 10 Jun 2015 12:38:53 +0530 Subject: [PATCH 0087/2220] Update chosen.jquery.d.ts Width can be string --- chosen/chosen.jquery.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chosen/chosen.jquery.d.ts b/chosen/chosen.jquery.d.ts index 1c95073394..14d37fa971 100644 --- a/chosen/chosen.jquery.d.ts +++ b/chosen/chosen.jquery.d.ts @@ -18,7 +18,7 @@ interface ChosenOptions { placeholder_text_single?: string; search_contains?: boolean; single_backstroke_delete?: boolean; - width?: number; + width?: number|string; display_disabled_options?: boolean; display_selected_options?: boolean; include_group_label_in_selected?: boolean; From 8296b143be88a1363a625b5ee5a1418a08231378 Mon Sep 17 00:00:00 2001 From: Igor Kriklivets Date: Wed, 10 Jun 2015 12:09:17 +0300 Subject: [PATCH 0088/2220] Definitions for 14.2 removed --- devextreme/14.2/dx.devextreme-14.2.7.d.ts | 5813 --------------------- 1 file changed, 5813 deletions(-) delete mode 100644 devextreme/14.2/dx.devextreme-14.2.7.d.ts diff --git a/devextreme/14.2/dx.devextreme-14.2.7.d.ts b/devextreme/14.2/dx.devextreme-14.2.7.d.ts deleted file mode 100644 index c8827de9cd..0000000000 --- a/devextreme/14.2/dx.devextreme-14.2.7.d.ts +++ /dev/null @@ -1,5813 +0,0 @@ -// Type definitions for DevExtreme 14.2.7 -// Project: http://js.devexpress.com/ -// Definitions by: DevExpress Inc. -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module DevExpress { - /** A mixin that provides a capability to fire and subscribe to events. */ - export interface EventsMixin { - /** Subscribes to a specified event. */ - on(eventName: string, eventHandler: Function): T; - /** Subscribes to the specified events. */ - on(events: { [eventName: string]: Function; }): T; - /** Detaches all event handlers from the specified event. */ - off(eventName: string): Object; - /** Detaches a particular event handler from the specified event. */ - off(eventName: string, eventHandler: Function): T; - } - /** An object that serves as a namespace for the methods required to perform validation. */ - export module validationEngine { - export interface IValidator { - validate(): ValidatorValidationResult; - reset(): void; - } - export interface ValidatorValidationResult { - isValid: boolean; - name?: string; - value: any; - brokenRule: any; - validationRules: any[]; - } - export interface ValidationGroupValidationResult { - isValid: boolean; - brokenRules: any[]; - validators: IValidator[]; - } - export interface GroupConfig extends EventsMixin { - group: any; - validators: IValidator[]; - validate(): ValidationGroupValidationResult; - reset(): void; - } - /** Provides access to the object that represents the specified validation group. */ - export function getGroupConfig(group: any): GroupConfig - /** Provides access to the object that represents the default validation group. */ - export function getGroupConfig(): GroupConfig - /** Validates rules of the validators that belong to the specified validation group. */ - export function validateGroup(group: any): ValidationGroupValidationResult; - /** Validates rules of the validators that belong to the default validation group. */ - export function validateGroup(): ValidationGroupValidationResult; - /** Resets the values and validation result of the editors that belong to the specified validation group. */ - export function resetGroup(group: any): void; - /** Resets the values and validation result of the editors that belong to the default validation group. */ - export function resetGroup(): void; - /** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */ - export function validateModel(model: Object): ValidationGroupValidationResult; - /** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */ - export function registerModelForValidation(model: Object): void; - } - export var hardwareBackButton: JQueryCallback; - /** Processes the hardware back button click. */ - export function processHardwareBackButton(): void; - /** Specifies whether or not the entire application/site supports right-to-left representation. */ - export var rtlEnabled: boolean; - /** Registers a new component in the DevExpress.ui namespace, and a jQuery plugin and Knockout binding for the required component. */ - export function registerComponent(name: string, componentClass: Object): void; - /** Registers a new component in the specified namespace as a jQuery plugin, Angular directive and Knockout binding. */ - export function registerComponent(name: string, namespace: Object, componentClass: Object): void; - /** Requests that the browser call a specified function to update animation before the next repaint. */ - export function requestAnimationFrame(callback: Function): number; - /** Cancels an animation frame request scheduled with the requestAnimationFrame method. */ - export function cancelAnimationFrame(requestID: number): void; - /** Custom Knockout binding that links an HTML element with a specific action. */ - export class Action { } - /** Used to get URLs that vary in a locally running application and the application running on production. */ - export class EndpointSelector { - constructor(options: { - [key: string]: { - local?: string; - production?: string; - } - }); - /** Returns a local or a productional URL depending on how the application is currently running. */ - urlFor(key: string): string; - } - /** An object that serves as a namespace for the methods that are used to animate UI elements. */ - export module fx { - /** The animation object specifies the widget animation options. */ - export interface AnimationOptions { - /** A function called after animation is completed. */ - complete?: (element: JQuery, config: AnimationOptions) => void; - /** A number specifying wait time before animation execution. */ - delay?: number; - /** A number specifying the time in milliseconds spent on animation. */ - duration?: number; - /** A string specifying the type of an easing function used for animation. */ - easing?: string; - /** Specifies the initial widget animation state. */ - from?: any; - /** A function called before animation is started. */ - start?: (element: JQuery, config: AnimationOptions) => void; - /** Specifies the initial widget animation state. */ - to?: any; - /** A string value specifying the animation type. */ - type?: string; - /** Specifies the animation direction for the "slideIn" and "slideOut" animation types. */ - direction?: string; - } - /** Animates the specified element. */ - export function animate(element: HTMLElement, config: Object): Object; - /** Returns a value indicating whether the specified element is being animated. */ - export function isAnimating(element: HTMLElement): boolean; - /** Stops the animation. */ - export function stop(element: HTMLElement, jumpToEnd: boolean): void; - } - /** An object that serves as a namespace for the methods and events specifying information on the current device. */ - export module devices { - /** The device object defines the device on which the application is running. */ - export interface Device { - /** Indicates whether or not the device platform is Android. */ - android?: boolean; - /** Specifies the type of the device on which the application is running. */ - deviceType?: string; - /** Indicates whether or not the device platform is generic, which means that the application will look and behave according to a generic "light" or "dark" theme. */ - generic?: boolean; - /** Indicates whether or not the device platform is iOS. */ - ios?: boolean; - /** Indicates whether or not the device type is 'phone'. */ - phone?: boolean; - /** Specifies the platform of the device on which the application is running. */ - platform?: string; - /** Indicates whether or not the device type is 'tablet'. */ - tablet?: boolean; - /** Indicates whether or not the device platform is Tizen. */ - tizen?: boolean; - /** Specifies an array with the major and minor versions of the device platform. */ - version?: Array; - /** Indicates whether or not the device platform is Windows8. */ - win8?: boolean; - } - export var orientationChanged: JQueryCallback; - /** Overrides actual device information to force the application to operate as if it was running on the specified device. */ - export function current(deviceName: any): void; - /** Returns information about the current device. */ - export function current(): Device; - /** Returns the current device orientation. */ - export function orientation(): string; - /** Returns real information about the current device regardless of the value passed to the devices.current(deviceName) method. */ - export function real(): Device; - } - /** The position object specifies the widget positioning options. */ - export interface PositionOptions { - /** The target element position that the widget is positioned against. */ - at?: string; - /** The element within which the widget is positioned. */ - boundary?: Element; - /** A string value holding horizontal and vertical offset from the window's boundaries. */ - boundaryOffset?: string; - /** Specifies how to move the widget if it overflows the screen. */ - collision?: any; - /** The position of the widget to align against the target element. */ - my?: string; - /** The target element that the widget is positioned against. */ - of?: HTMLElement; - /** A string value holding horizontal and vertical offset in pixels, separated by a space (e.g., "5 -10"). */ - offset?: string; - } - export interface ComponentOptions { - /** A handler for the optionChanged event. */ - onOptionChanged?: Function; - /** A handler for the disposing event. */ - onDisposing?: Function; - } - /** A base class for all components and widgets. */ - export class Component { - constructor(options?: ComponentOptions) - /** Prevents the component from refreshing until the endUpdate method is called. */ - beginUpdate(): void; - /** Enables the component to refresh after the beginUpdate method call. */ - endUpdate(): void; - /** Returns an instance of this component class. */ - instance(): Component; - /** Sets one or more options of this component. */ - option(options: Object): void; - /** Returns the configuration options of this component. */ - option(): Object; - /** Gets the value of the specified configuration option of this component. */ - option(optionName: string): any; - /** Sets a value to the specified configuration option of this component. */ - option(optionName: string, optionValue: any): void; - } - export interface DOMComponentOptions extends ComponentOptions { - /** Specifies whether or not the current component supports a right-to-left representation. */ - rtlEnabled?: boolean; - } - /** A base class for all components. */ - export class DOMComponent extends Component { - constructor(element: JQuery, options?: DOMComponentOptions); - constructor(element: HTMLElement, options?: DOMComponentOptions); - /** Returns the root HTML element of the widget. */ - element(): JQuery; - /** Specifies the device-dependent default configuration options for this component. */ - static defaultOptions(rule: { - device?: any; - options?: any; - }): void; - } - export module data { - export interface ODataError extends Error { - httpStatus?: number; - errorDetails?: any; - } - export interface StoreOptions { - inserted?: (values: Object, key: any) => void; - inserting?: (values: Object) => void; - loaded?: (result: Array) => void; - loading?: (loadOptions: LoadOptions) => void; - modified?: () => void; - modifying?: () => void; - removed?: (key: any) => void; - removing?: (key: any) => void; - updated?: (key: any, values: Object) => void; - updating?: (key: any, values: Object) => void; - /** A handler for the modified event. */ - onModified?: () => void; - /** A handler for the modifying event. */ - onModifying?: () => void; - /** A handler for the removed event. */ - onRemoved?: (key: any) => void; - /** A handler for the removing event. */ - onRemoving?: (key: any) => void; - /** A handler for the updated event. */ - onUpdated?: (key: any, values: Object) => void; - /** A handler for the updating event. */ - onUpdating?: (key: any, values: Object) => void; - /** A handler for the loaded event. */ - onLoaded?: (result: Array) => void; - /** A handler for the loading event. */ - onLoading?: (loadOptions: LoadOptions) => void; - /** A handler for the inserted event. */ - onInserted?: (values: Object, key: any) => void; - /** A handler for the inserting event. */ - onInserting?: (values: Object) => void; - /** Specifies the function called when the Store causes an error. */ - errorHandler?: (e: Error) => void; - /** Specifies the key properties within the data associated with the Store. */ - key?: any; - } - export interface LoadOptions { - filter?: Object; - sort?: Object; - select?: Object; - expand?: Object; - group?: Object; - skip?: number; - take?: number; - userData?: Object; - requireTotalCount?: boolean; - } - /** The base class for all Stores. */ - export class Store implements EventsMixin { - inserted: JQueryCallback; - inserting: JQueryCallback; - loaded: JQueryCallback; - loading: JQueryCallback; - modified: JQueryCallback; - modifying: JQueryCallback; - removed: JQueryCallback; - removing: JQueryCallback; - updated: JQueryCallback; - updating: JQueryCallback; - constructor(options?: StoreOptions); - /** Returns the data item specified by the key. */ - byKey(key: any): JQueryPromise; - /** Adds an item to the data associated with this Store. */ - insert(values: Object): JQueryPromise; - /** Returns the key expression specified via the key configuration option. */ - key(): any; - /** Returns the key of the Store item that matches the specified object. */ - keyOf(obj: Object): any; - /** Starts loading the data. */ - load(obj?: LoadOptions): JQueryPromise; - /** Removes the data item specified by the key. */ - remove(key: any): JQueryPromise; - /** Obtains the total count of items that will be returned by the load() function. */ - totalCount(obj?: { - filter?: Object; - select?: Object; - group?: Object; - sort?: Object; - }): JQueryPromise; - /** Updates the data item specified by the key. */ - update(key: any, values: Object): JQueryPromise; - on(eventName: "removing", eventHandler: (key: any) => void): Store; - on(eventName: "removed", eventHandler: (key: any) => void): Store; - on(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; - on(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; - on(eventName: "inserting", eventHandler: (values: Object) => void): Store; - on(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; - on(eventName: "modifying", eventHandler: () => void): Store; - on(eventName: "modified", eventHandler: () => void): Store; - on(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; - on(eventName: "loaded", eventHandler: (result: Array) => void): Store; - on(eventName: string, eventHandler: Function): Store; - on(events: { [eventName: string]: Function; }): Store; - off(eventName: "removing"): Store; - off(eventName: "removed"): Store; - off(eventName: "updating"): Store; - off(eventName: "updated"): Store; - off(eventName: "inserting"): Store; - off(eventName: "inserted"): Store; - off(eventName: "modifying"): Store; - off(eventName: "modified"): Store; - off(eventName: "loading"): Store; - off(eventName: "loaded"): Store; - off(eventName: string): Store; - off(eventName: "removing", eventHandler: (key: any) => void): Store; - off(eventName: "removed", eventHandler: (key: any) => void): Store; - off(eventName: "updating", eventHandler: (key: any, values: Object) => void): Store; - off(eventName: "updated", eventHandler: (key: any, values: Object) => void): Store; - off(eventName: "inserting", eventHandler: (values: Object) => void): Store; - off(eventName: "inserted", eventHandler: (values: Object, key: any) => void): Store; - off(eventName: "modifying", eventHandler: () => void): Store; - off(eventName: "modified", eventHandler: () => void): Store; - off(eventName: "loading", eventHandler: (loadOptions: LoadOptions) => void): Store; - off(eventName: "loaded", eventHandler: (result: Array) => void): Store; - off(eventName: string, eventHandler: Function): Store; - } - export interface ArrayStoreOptions extends StoreOptions { - /** Specifies the array associated with this Store. */ - data?: Array; - } - /** A Store accessing an in-memory array. */ - export class ArrayStore extends Store { - constructor(options?: ArrayStoreOptions); - /** Clears all data associated with the current ArrayStore. */ - clear(): void; - /** Creates the Query object for the underlying array. */ - createQuery(): Query; - } - interface Promise { - then(doneFn?: Function, failFn?: Function, progressFn?: Function): Promise; - } - export interface CustomStoreOptions extends StoreOptions { - /** The user implementation of the byKey(key, extraOptions) method. */ - byKey?: (key: any) => Promise; - /** - * User implementation of the byKey(key, extraOptions) method. - * @deprecated byKey.md - */ - lookup?: (key: any) => Promise; - /** The user implementation of the insert(values) method. */ - insert?: (values: Object) => Promise; - /** The user implementation of the load(options) method. */ - load?: (options?: LoadOptions) => Promise; - /** The user implementation of the remove(key) method. */ - remove?: (key: any) => Promise; - /** The user implementation of the totalCount(options) method. */ - totalCount?: () => Promise; - /** The user implementation of the update(key, values) method. */ - update?: (key: any, values: Object) => Promise; - } - /** A Store object that enables you to implement your own data access logic. */ - export class CustomStore extends Store { - constructor(options: CustomStoreOptions); - } - export interface DataSourceOptions { - /** Specifies data filtering conditions. */ - filter?: Object; - /** Specifies data grouping conditions. */ - group?: Object; - /** The item mapping function. */ - map?: (record: any) => any; - /** Specifies the maximum number of items the page can contain. */ - pageSize?: number; - /** Specifies whether a DataSource loads data by pages, or all items at once. */ - paginate?: boolean; - /** The data post processing function. */ - postProcess?: (data: any[]) => any[]; - /** Specifies a value by which the required items are searched. */ - searchExpr?: Object; - /** Specifies the comparison operation used to search for the required items. */ - searchOperation?: string; - /** Specifies the value to which the search expression is compared. */ - searchValue?: Object; - /** Specifies the initial select option value. */ - select?: Object; - /** An array of the strings that represent the names of the navigation properties to be loaded simultaneously with the OData store's entity. */ - expand?: Object; - /** Specifies the initial sort option value. */ - sort?: Object; - /** Specifies the underlying Store instance used to access data. */ - store?: any; - /** A handler for the changed event. */ - onChanged?: () => void; - /** A handler for the loadingChanged event. */ - onLoadingChanged?: (isLoading: boolean) => void; - /** A handler for the loadError event. */ - onLoadError?: (e?: Error) => void; - } - /** An object that provides access to a data web service or local data storage for collection container widgets. */ - export class DataSource implements EventsMixin { - constructor(options?: DataSourceOptions); - changed: JQueryCallback; - loadError: JQueryCallback; - loadingChanged: JQueryCallback; - /** Disposes all resources associated with this DataSource. */ - dispose(): void; - /** Returns the current filter option value. */ - filter(): Object; - /** Sets the filter option value. */ - filter(filterExpr: Object): void; - /** Returns the current group option value. */ - group(): Object; - /** Sets the group option value. */ - group(groupExpr: Object): void; - /** Indicates whether or not the current page contains fewer items than the number of items specified by the pageSize configuration option. */ - isLastPage(): boolean; - /** Indicates whether or not at least one load() method execution has successfully finished. */ - isLoaded(): boolean; - /** Indicates whether or not the DataSource is currently being loaded. */ - isLoading(): boolean; - /** Returns the array of items currently operated by the DataSource. */ - items(): Array; - /** Returns the key expression. */ - key(): any; - /** Starts loading data. */ - load(): JQueryPromise>; - /** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */ - loadOptions(): Object; - /** Returns the current pageSize option value. */ - pageSize(): number; - /** Sets the pageSize option value. */ - pageSize(value: number): void; - /** Specifies the index of the currently loaded page. */ - pageIndex(): number; - /** Specifies the index of the page to be loaded during the next load() method execution. */ - pageIndex(newIndex: number): void; - /** Returns the current paginate option value. */ - paginate(): boolean; - /** Sets the paginate option value. */ - paginate(value: boolean): void; - /** Returns the searchExpr option value. */ - searchExpr(): Object; - /** Sets the searchExpr option value. */ - searchExpr(expr: Object): void; - /** Returns the currently specified search operation. */ - searchOperation(): string; - /** Sets the current search operation. */ - searchOperation(op: string): void; - /** Returns the searchValue option value. */ - searchValue(): Object; - /** Sets the searchValue option value. */ - searchValue(value: Object): void; - /** Returns the current select option value. */ - select(): Object; - /** Sets the select option value. */ - select(expr: Object): void; - /** Returns the current sort option value. */ - sort(): Object; - /** Sets the sort option value. */ - sort(sortExpr: Object): void; - /** Returns the underlying Store instance. */ - store(): Store; - /** Returns the number of data items available in an underlying Store after the last load() operation without paging. */ - totalCount(): number; - on(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; - on(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; - on(eventName: "changed", eventHandler: () => void): DataSource; - on(eventName: string, eventHandler: Function): DataSource; - on(events: { [eventName: string]: Function; }): DataSource; - off(eventName: "loadingChanged"): DataSource; - off(eventName: "loadError"): DataSource; - off(eventName: "changed"): DataSource; - off(eventName: string): DataSource; - off(eventName: "loadingChanged", eventHandler: (isLoading: boolean) => void): DataSource; - off(eventName: "loadError", eventHandler: (e?: Error) => void): DataSource; - off(eventName: "changed", eventHandler: () => void): DataSource; - off(eventName: string, eventHandler: Function): DataSource; - } - /** An object used to work with primitive data types not supported by JavaScript when accessing an OData web service. */ - export class EdmLiteral { - /** Returns a string representation of the value associated with this EdmLiteral object. */ - valueOf(): string; - } - /** An object used to generate and hold the GUID. */ - export class Guid { - /** Creates a new Guid instance that holds the specified GUID. */ - constructor(value: string); - /** Creates a new Guid instance holding the generated GUID. */ - constructor(); - /** Returns a string representation of the Guid instance. */ - toString(): string; - /** Returns a string representation of the Guid instance. */ - valueOf(): string; - } - export interface LocalStoreOptions extends ArrayStoreOptions { - /** Specifies the time (in miliseconds) after the change operation, before the data is flushed. */ - flushInterval?: number; - /** Specifies whether the data is flushed immediatelly after each change operation, or after the delay specified via the flushInterval option. */ - immediate?: boolean; - /** The unique identifier used to distinguish the data within the HTML5 Web Storage. */ - name?: string; - } - /** A Store providing access to the HTML5 Web Storage. */ - export class LocalStore extends ArrayStore { - constructor(options?: LocalStoreOptions); - /** Removes all data associated with this Store. */ - clear(): void; - } - export interface ODataContextOptions extends ODataStoreOptions { - /** Specifies the list of entities to be accessed via the ODataContext. */ - entities?: Object; - /** Specifies the function called if the ODataContext causes an error. */ - errorHandler?: (e: Error) => void; - } - /** Provides access to the entire OData service. */ - export class ODataContext { - constructor(options?: ODataContextOptions); - /** Initiates the specified WebGet service operation that returns a value. For the information on service operations, refer to the OData documentation. */ - get(operationName: string, params: Object): JQueryPromise; - /** Initiates the specified WebGet service operation that returns nothing. For the information on service operations, refer to the OData documentation. */ - invoke(operationName: string, params: Object, httpMethod: Object): JQueryPromise; - /** Return a special proxy object to describe the entity link. */ - objectLink(entityAlias: string, key: any): Object; - } - export interface ODataStoreOptions extends StoreOptions { - /** A function used to customize a web request before it is sent. */ - beforeSend?: (request: Object) => void; - /** Specifies whether the ODataStore uses the JSONP approach to access non-CORS-compatible remote services. */ - jsonp?: boolean; - /** Specifies the type of the ODataStore key property. The following key types are supported out of the box: String, Int32, Int64, and Guid. */ - keyType?: any; - /** Specifies the URL of the data service being accessed via the current ODataContext. */ - url?: string; - /** Specifies the version of the OData protocol used to interact with the data service. */ - version?: number; - /** Specifies the value of the withCredentials field of the underlying jqXHR object. */ - withCredentials?: boolean; - } - /** A Store providing access to a separate OData web service entity. */ - export class ODataStore extends Store { - constructor(options?: ODataStoreOptions); - /** Creates the Query object for the OData endpoint. */ - createQuery(loadOptions: Object): Object; - /** Returns the data item specified by the key. */ - byKey(key: any, extraOptions?: { expand?: Object }): JQueryPromise; - } - /** An universal chainable data query interface object. */ - export interface Query { - /** Calculates a custom summary for the items in the current Query. */ - aggregate(step: (accumulator: any, value: any) => any): JQueryPromise; - /** Calculates a custom summary for the items in the current Query. */ - aggregate(seed: any, step: (accumulator: any, value: any) => any, finalize: (result: any) => any): JQueryPromise; - /** Calculates the average item value for the current Query. */ - avg(getter: Object): JQueryPromise; - /** Finds the item with the maximum getter value. */ - max(getter: Object): JQueryPromise; - /** Finds the item with the maximum value in the Query. */ - max(): JQueryPromise; - /** Finds the item with the minimum value in the Query. */ - min(): JQueryPromise; - /** Finds the item with the minimum getter value. */ - min(getter: Object): JQueryPromise; - /** Calculates the average item value for the current Query, if each Query item has a numeric type. */ - avg(): JQueryPromise; - /** Returns the total count of items in the current Query. */ - count(): JQueryPromise; - /** Executes the Query. */ - enumerate(): JQueryPromise; - /** Filters the current Query data. */ - filter(criteria: Array): Query; - /** Groups the current Query data. */ - groupBy(getter: Object): Query; - /** Applies the specified transformation to each item. */ - select(getter: Object): Query; - /** Limits the data item count. */ - slice(skip: number, take?: number): Query; - /** Sorts current Query data. */ - sortBy(getter: Object, desc: boolean): Query; - /** Sorts current Query data. */ - sortBy(getter: Object): Query; - /** Calculates the sum of item getter values in the current Query. */ - sum(getter: Object): JQueryPromise; - /** Calculates the sum of item values in the current Query. */ - sum(): JQueryPromise; - /** Adds one more sorting condition to the current Query. */ - thenBy(getter: Object): Query; - /** Adds one more sorting condition to the current Query. */ - thenBy(getter: Object, desc: boolean): Query; - /** Returns the array of current Query items. */ - toArray(): Array; - } - /** The global data layer error handler. */ - export var errorHandler: (e: Error) => void; - /** Encodes the specified string or array of bytes to base64 encoding. */ - export function base64_encode(input: any): string; - /** Creates a Query instance. */ - export function query(array: Array): Query; - /** Creates a Query instance for accessing the remote service specified by a URL. */ - export function query(url: string, queryOptions: Object): Query; - /** This section describes the utility objects provided by the DevExtreme data layer. */ - export var utils: { - /** Compiles a getter function from the getter expression. */ - compileGetter(expr: any): Function; - /** Compiles a setter function from the setter expression. */ - compileSetter(expr: any): Function; - odata: { - /** Holds key value converters for OData. */ - keyConverters: { - String(value: any): string; - Int32(value: any): number; - Int64(value: any): EdmLiteral; - Guid(value: any): Guid; - Boolean(value: any): boolean; - Single(value: any): EdmLiteral; - Decimal(value: any): EdmLiteral; - }; - } - } - } - /** An object that serves as a namespace for DevExtreme UI widgets as well as for methods implementing UI logic in DevExtreme sites/applications. */ - export module ui { - /** - * Sets parameters for the viewport meta tag. - * @deprecated Use the "DevExpress.utils.initMobileViewport" option instead. - */ - export function initViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; - export interface WidgetOptions extends DOMComponentOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A Boolean value specifying whether or not the widget can respond to user interaction. */ - disabled?: boolean; - /** Specifies the height of the widget. */ - height?: any; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; - /** Specifies whether or not the widget can be focused. */ - focusStateEnabled?: boolean; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - /** Specifies the width of the widget. */ - width?: any; - /** Specifies the widget tab index. */ - tabIndex?: number; - /** Specifies the text of the hint displayed for the widget. */ - hint?: string; - } - /** The base class for widgets. */ - export class Widget extends DOMComponent { - constructor(options?: WidgetOptions); - /** Redraws the widget. */ - repaint(): void; - /** Sets focus on the widget. */ - focus(): void; - } - export interface CollectionWidgetOptions extends WidgetOptions { - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - itemClickAction?: any; - itemHoldAction?: Function; - /** The time period in milliseconds before the onItemHold event is raised. */ - itemHoldTimeout?: number; - itemRender?: any; - itemRenderedAction?: Function; - /** An array of items displayed by the widget. */ - items?: Array; - /** - * A function performed when a widget item is selected. - * @deprecated onSelectionChanged.md - */ - itemSelectAction?: Function; - /** The template to be used for rendering items. */ - itemTemplate?: any; - loopItemFocus?: boolean; - /** The text or HTML markup displayed by the widget if the item collection is empty. */ - noDataText?: string; - onContentReady?: any; - contentReadyAction?: any; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** A handler for the itemContextMenu event. */ - onItemContextMenu?: Function; - /** A handler for the itemHold event. */ - onItemHold?: Function; - /** A handler for the itemRendered event. */ - onItemRendered?: Function; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: Function; - /** The index of the currently selected widget item. */ - selectedIndex?: number; - /** The selected item object. */ - selectedItem?: Object; - /** An array of currently selected item objects. */ - selectedItems?: Array; - /** A handler for the itemDeleting event. */ - onItemDeleting?: Function; - /** A handler for the itemDeleted event. */ - onItemDeleted?: Function; - /** A handler for the itemReordered event. */ - onItemReordered?: Function; - } - /** The base class for widgets containing an item collection. */ - export class CollectionWidget extends Widget { - constructor(element: JQuery, options?: CollectionWidgetOptions); - constructor(element: HTMLElement, options?: CollectionWidgetOptions); - selectItem(itemElement: any): void; - unselectItem(itemElement: any): void; - deleteItem(itemElement: any): JQueryPromise; - isItemSelected(itemElement: any): boolean; - reorderItem(itemElement: any, toItemElement: any): JQueryPromise; - } - export interface DataExpressionMixinOptions { - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies the name of a data source item field whose value is held in the value configuration option. */ - valueExpr?: any; - itemRender?: any; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - /** The currently selected value in the widget. */ - value?: Object; - } - export interface EditorOptions extends WidgetOptions { - /** The currently specified value. */ - value?: Object; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - valueChangeAction?: Function; - /** A Boolean value specifying whether or not the widget is read-only. */ - readOnly?: boolean; - /** Holds the object that defines the error that occurred during validation. */ - validationError?: Object; - /** Specifies whether the editor's value is valid. */ - isValid?: boolean; - /** Specifies how the message about the validation rules that are not satisfied by this editor's value is displayed. */ - validationMessageMode?: string; - } - /** A base class for editors. */ - export class Editor extends Widget { - /** Resets the editor's value to undefined. */ - reset(): void; - } - /** An object that serves as a namespace for methods displaying a message in an application/site. */ - export var dialog: { - /** Creates an alert dialog message containing a single "OK" button. */ - alert(message: string, title: string): JQueryPromise; - /** Creates a confirm dialog that contains "Yes" and "No" buttons. */ - confirm(message: string, title: string): JQueryPromise; - /** Creates a custom dialog using the options specified by the passed configuration object. */ - custom(options: { title?: string; message?: string; buttons?: Array; }): { - show(): JQueryPromise; - hide(): void; - hide(value: any): void; - }; - }; - /** Creates a toast message. */ - export function notify(message: any, type: string, displayTime: number): void; - /** Creates a toast message. */ - export function notify(options: Object): void; - /** An object that serves as a namespace for the methods that work with DevExtreme CSS Themes. */ - export var themes: { - /** Returns the name of the currently applied theme. */ - current(): string; - /** Changes the current theme to the specified one. */ - current(themeName: string): void; - }; - /** Sets a specified template engine. */ - export function setTemplateEngine(name: string): void; - /** Sets a custom template engine defined via custom compile and render functions. */ - export function setTemplateEngine(options: Object): void; - /** An object that serves as a namespace for utility methods that can be helpful when working with the DevExtreme framework and UI widgets. */ - export var utils: { - /** Sets parameters for the viewport meta tag. */ - initMobileViewport(options: { allowZoom?: boolean; allowPan?: boolean; allowSelection?: boolean }): void; - }; - } -} -declare module DevExpress.framework { - /** An object used to store information on the views displayed in an application. */ - export class ViewCache { - viewRemoved: JQueryCallback; - /** Removes all the viewInfo objects from the cache. */ - clear(): void; - /** Obtains a viewInfo object from the cache by the specified key. */ - getView(key: string): Object; - /** Checks whether or not a viewInfo object is contained in the view cache under the specified key. */ - hasView(key: string): boolean; - /** Removes a viewInfo object from the cache by the specified key. */ - removeView(key: string): Object; - /** Adds the specified viewInfo object to the cache under the specified key. */ - setView(key: string, viewInfo: Object): void; - } - export interface dxCommandOptions extends DOMComponentOptions { - action?: any; - /** Specifies an action performed when the execute() method of the command is called. */ - onExecute?: any; - /** Indicates whether or not the widget that displays this command is disabled. */ - disabled?: boolean; - /** Specifies the name of the icon shown inside the widget associated with this command. */ - icon?: string; - /** A URL pointing to the icon shown inside the widget associated with this command. */ - iconSrc?: string; - /** The identifier of the command. */ - id?: string; - /** Specifies the title of the widget associated with this command. */ - title?: string; - /** Specifies the type of the button, if the command is rendered as a dxButton widget. */ - type?: string; - /** A Boolean value specifying whether or not the widget associated with this command is visible. */ - visible?: boolean; - } - /** A markup component used to define markup options for a command. */ - export class dxCommand extends DOMComponent { - constructor(element: JQuery, options: dxCommandOptions); - constructor(options: dxCommandOptions); - /** Executes the action associated with this command. */ - execute(): void; - } - /** An object responsible for routing. */ - export class Router { - /** Adds a routing rule to the list of registered rules. */ - register(pattern: string, defaults?: Object, constraints?: Object): void; - /** Decodes the specified URI to an object using the registered routing rules. */ - parse(uri: string): Object; - /** Formats an object to a URI. */ - format(obj: Object): string; - } - export interface StateManagerOptions { - /** A storage to which the state manager saves the application state. */ - storage?: Object; - } - /** An object used to store the current application state. */ - export class StateManager { - constructor(options?: StateManagerOptions); - /** Adds an object that implements an interface of a state source to the state manager's collection of state sources. */ - addStateSource(stateSource: Object): void; - /** Removes a specified state source from the state manager's collection of state sources. */ - removeStateSource(stateSource: Object): void; - /** Saves the current application state. */ - saveState(): void; - /** Restores the application state that has been saved by the saveState() method to the state storage. */ - restoreState(): void; - /** Removes the application state that has been saved by the saveState() method to the state storage. */ - clearState(): void; - } - export module html { - export var layoutSets: Array; - export interface HtmlApplicationOptions { - /** Specifies where the commands that are defined in the application's views must be displayed. */ - commandMapping?: Object; - /** - * The name of the default layout used by the application. - * @deprecated navigationType.md - */ - defaultLayout?: string; - /** Specifies whether or not view caching is disabled. */ - disableViewCache?: boolean; - /** An array of layout controllers that should be used to show application views in the current navigation context. */ - layoutSet?: any; - /** Specifies whether the current application must behave as a mobile or web application. */ - mode?: string; - /** Specifies the object that represents a root namespace of the application. */ - namespace?: Object; - /** Specifies application behavior when the user navigates to a root view. */ - navigateToRootViewMode?: string; - /** An array of dxCommand configuration objects used to define commands available from the application's global navigation. */ - navigation?: Array; - /** A state manager to be used in the application. */ - stateManager?: StateManager; - /** Specifies the storage to be used by the application's state manager to store the application state. */ - stateStorage?: Object; - /** - * Specifies a strategy for choosing layouts for views in your application. - * @deprecated layoutSet.md - */ - navigationType?: string; - /** - * Specifies the object that represents the root namespace of the application. - * @deprecated namespace.md - */ - ns?: Object; - /** Indicates whether on not to use the title of the previously displayed view as text on the Back button. */ - useViewTitleAsBackText?: boolean; - /** A custom view cache to be used in the application. */ - viewCache?: Object; - /** Specifies a limit for the views that can be cached. */ - viewCacheSize?: number; - /** Specifies options for the viewport meta tag of a mobile browser. */ - viewPort?: JQuery; - /** A custom router to be used in the application. */ - router?: Router; - } - /** An object used to manage views, as well as control the application life cycle. */ - export class HtmlApplication implements EventsMixin { - constructor(options: HtmlApplicationOptions); - afterViewSetup: JQueryCallback; - beforeViewSetup: JQueryCallback; - initialized: JQueryCallback; - navigating: JQueryCallback; - navigatingBack: JQueryCallback; - resolveLayoutController: JQueryCallback; - viewDisposed: JQueryCallback; - viewDisposing: JQueryCallback; - viewHidden: JQueryCallback; - viewRendered: JQueryCallback; - viewShowing: JQueryCallback; - viewShown: JQueryCallback; - /** Provides access to the ViewCache object. */ - viewCache: ViewCache; - /** An array of dxCommand components that are created based on the application's navigation option value. */ - navigation: Array; - /** Provides access to the StateManager object. */ - stateManager: StateManager; - /** Provides access to the Router object. */ - router: Router; - /** Navigates to the URI preceding the current one in the navigation history. */ - back(): void; - /** Returns a Boolean value indicating whether or not backwards navigation is currently possible. */ - canBack(): boolean; - /** Calls the clearState() method of the application's StateManager object. */ - clearState(): void; - /** Creates global navigation commands. */ - createNavigation(navigationConfig: Array): void; - /** Returns an HTML template of the specified view. */ - getViewTemplate(viewName: string): JQuery; - /** Returns a configuration object used to create a dxView component for a specified view. */ - getViewTemplateInfo(viewName: string): Object; - /** Adds a specified HTML template to a collection of view or layout templates. */ - loadTemplates(source: any): JQueryPromise; - /** Navigates to the specified URI. */ - navigate(uri?: any, options?: Object): void; - /** Renders navigation commands to the navigation command containers that are located in the layouts used in the application. */ - renderNavigation(): void; - /** Calls the restoreState() method of the application's StateManager object. */ - restoreState(): void; - /** Calls the saveState method of the application's StateManager object. */ - saveState(): void; - /** Provides access to the object that defines the current context to be considered when choosing an appropriate template for a view. */ - templateContext(): Object; - on(eventName: "initialized", eventHandler: () => void): HtmlApplication; - on(eventName: "afterViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "beforeViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "navigating", eventHandler: (e: { - currentUri: string; - uri: string; - cancel: boolean; - options: { - root: boolean; - target: string; - direction: string; - rootInDetailPane: boolean; - modal: boolean; - }; - }) => void): HtmlApplication; - on(eventName: "navigatingBack", eventHandler: (e: { - cancel: boolean; - isHardwareButton: boolean; - }) => void): HtmlApplication; - on(eventName: "resolveLayoutController", eventHandler: (e: { - viewInfo: Object; - layoutController: Object; - availableLayoutControllers: Array; - }) => void): HtmlApplication; - on(eventName: "viewDisposed", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewDisposing", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewHidden", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewRendered", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - on(eventName: "viewShowing", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - on(eventName: "viewShown", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - on(eventName: string, eventHandler: Function): HtmlApplication; - on(events: { [eventName: string]: Function; }): HtmlApplication; - off(eventName: "initialized"): HtmlApplication; - off(eventName: "afterViewSetup"): HtmlApplication; - off(eventName: "beforeViewSetup"): HtmlApplication; - off(eventName: "navigating"): HtmlApplication; - off(eventName: "navigatingBack"): HtmlApplication; - off(eventName: "resolveLayoutController"): HtmlApplication; - off(eventName: "viewDisposed"): HtmlApplication; - off(eventName: "viewDisposing"): HtmlApplication; - off(eventName: "viewHidden"): HtmlApplication; - off(eventName: "viewRendered"): HtmlApplication; - off(eventName: "viewShowing"): HtmlApplication; - off(eventName: "viewShown"): HtmlApplication; - off(eventName: string): HtmlApplication; - off(eventName: "initialized", eventHandler: () => void): HtmlApplication; - off(eventName: "afterViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "beforeViewSetup", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "navigating", eventHandler: (e: { - currentUri: string; - uri: string; - cancel: boolean; - options: { - root: boolean; - target: string; - direction: string; - rootInDetailPane: boolean; - modal: boolean; - }; - }) => void): HtmlApplication; - off(eventName: "navigatingBack", eventHandler: (e: { - cancel: boolean; - isHardwareButton: boolean; - }) => void): HtmlApplication; - off(eventName: "resolveLayoutController", eventHandler: (e: { - viewInfo: Object; - layoutController: Object; - availableLayoutControllers: Array; - }) => void): HtmlApplication; - off(eventName: "viewDisposed", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewDisposing", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewHidden", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewRendered", eventHandler: (e: { - viewInfo: Object; - }) => void): HtmlApplication; - off(eventName: "viewShowing", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - off(eventName: "viewShown", eventHandler: (e: { - viewInfo: Object; - direction: string; - }) => void): HtmlApplication; - off(eventName: string, eventHandler: Function): HtmlApplication; - } - } -} -declare module DevExpress.ui { - export interface dxValidatorOptions extends DOMComponentOptions { - /** An array of validation rules to be checked for the editor with which the dxValidator object is associated. */ - validationRules?: Array; - /** Specifies the editor name to be used in the validation default messages. */ - name?: string; - /** An object that specifies what and when to validate and how to apply the validation result. */ - adapter?: Object; - /** Specifies the validation group the editor will be related to. */ - validationGroup?: string; - /** A handler for the validated event. */ - onValidated?: (params: validationEngine.ValidatorValidationResult) => void; - } - /** A widget that is used to validate the associated DevExtreme editors against the defined validation rules. */ - export class dxValidator extends DOMComponent implements validationEngine.IValidator { - constructor(element: JQuery, options?: dxValidatorOptions); - constructor(element: Element, options?: dxValidatorOptions); - /** Validates the value of the editor that is controlled by the current dxValidator object against the list of the specified validation rules. */ - validate(): validationEngine.ValidatorValidationResult; - /** Resets the value and validation result of the editor associated with the current dxValidator object. */ - reset(): void; - } - /** The widget that is used in the Knockout and Angular approaches to combine the editors to be validated. */ - export class dxValidationGroup extends DOMComponent { - constructor(element: JQuery); - constructor(element: Element); - /** Validates rules of the validators that belong to the current validation group. */ - validate(): validationEngine.ValidationGroupValidationResult; - /** Resets the value and validation result of the editors that are included to the current validation group. */ - reset(): void; - } - export interface dxValidationSummaryOptions extends CollectionWidgetOptions { - /** Specifies the validation group for which summary should be generated. */ - validationGroup?: string; - } - /** A widget for displaying the result of checking validation rules for editors. */ - export class dxValidationSummary extends CollectionWidget { - constructor(element: JQuery, options?: dxValidationSummaryOptions); - constructor(element: Element, options?: dxValidationSummaryOptions); - } - export interface dxTooltipOptions extends dxPopoverOptions { - } - /** A tooltip widget. */ - export class dxTooltip extends dxPopover { - constructor(element: JQuery, options?: dxTooltipOptions); - constructor(element: Element, options?: dxTooltipOptions); - } - export interface dxDropDownListOptions extends dxDropDownEditorOptions { - /** Returns the value currently displayed by the widget. */ - displayValue?: string; - /** The minimum number of characters that must be entered into the text box to begin a search. */ - minSearchLength?: number; - /** Specifies the name of a data source item field or an expression whose value is compared to the search criterion. */ - searchExpr?: Object; - /** Specifies the binary operation used to filter data. */ - searchMode?: string; - /** Specifies the time delay, in milliseconds, after the last character has been typed in, before a search is executed. */ - searchTimeout?: number; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - /** Specifies DOM event names that update a widget's value. */ - valueChangeEvent?: string; - /** Specifies whether or not the widget supports searching. */ - searchEnabled?: boolean; - /** Specifies whether or not the widget displays items by pages. */ - pagingEnabled?: boolean; - /** The text or HTML markup displayed by the widget if the item collection is empty. */ - noDataText?: string; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: Function; - /** A handler for the itemClick event. */ - onItemClick?: Function; - onContentReady?: Function; - /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ - focusStateEnabled?: boolean; - } - /** A base class for drop-down list widgets. */ - export class dxDropDownList extends dxDropDownEditor { - constructor(element: JQuery, options?: dxDropDownListOptions); - constructor(element: Element, options?: dxDropDownListOptions); - } - export interface dxToolbarOptions extends CollectionWidgetOptions { - menuItemRender?: any; - /** The template used to render menu items. */ - menuItemTemplate?: any; - /** Informs the widget about its location in a view HTML markup. */ - renderAs?: string; - } - /** A toolbar widget. */ - export class dxToolbar extends CollectionWidget { - constructor(element: JQuery, options?: dxToolbarOptions); - constructor(element: Element, options?: dxToolbarOptions); - } - export interface dxToastOptions extends dxOverlayOptions { - animation?: fx.AnimationOptions; - /** The time span in milliseconds during which the dxToast widget is visible. */ - displayTime?: number; - height?: any; - /** The dxToast message text. */ - message?: string; - position?: PositionOptions; - shading?: boolean; - /** Specifies the dxToast widget type. */ - type?: string; - width?: any; - closeOnBackButton?: boolean; - } - /** The toast message widget. */ - export class dxToast extends dxOverlay { - constructor(element: JQuery, options?: dxToastOptions); - constructor(element: Element, options?: dxToastOptions); - } - export interface dxTextEditorOptions extends EditorOptions { - /** A handler for the change event. */ - onChange?: Function; - changeAction?: Function; - /** A handler for the copy event. */ - onCopy?: Function; - copyAction?: Function; - /** A handler for the cut event. */ - onCut?: Function; - cutAction?: Function; - /** A handler for the enterKey event. */ - onEnterKey?: Function; - enterKeyAction?: Function; - /** A handler for the focusIn event. */ - onFocusIn?: Function; - focusInAction?: Function; - /** A handler for the focusOut event. */ - onFocusOut?: Function; - focusOutAction?: Function; - /** A handler for the input event. */ - onInput?: Function; - inputAction?: Function; - /** A handler for the keyDown event. */ - onKeyDown?: Function; - keyDownAction?: Function; - /** A handler for the keyPress event. */ - onKeyPress?: Function; - keyPressAction?: Function; - /** A handler for the keyUp event. */ - onKeyUp?: Function; - keyUpAction?: Function; - /** A handler for the paste event. */ - onPaste?: Function; - pasteAction?: Function; - /** The text displayed by the widget when the widget value is empty. */ - placeholder?: string; - /** Specifies whether to display the Clear button in the widget. */ - showClearButton?: boolean; - /** Specifies the current value displayed by the widget. */ - value?: any; - valueUpdateAction?: Function; - /** Specifies DOM event names that update a widget's value. */ - valueChangeEvent?: string; - valueUpdateEvent?: string; - /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ - spellcheck?: boolean; - /** Specifies HTML attributes applied to the inner input element of the widget. */ - attr?: Object; - /** The read-only option that holds the text displayed by the widget input element. */ - text?: string; - /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ - focusStateEnabled?: boolean; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; - } - /** A base class for text editing widgets. */ - export class dxTextEditor extends Editor { - constructor(element: JQuery, options?: dxTextEditorOptions); - constructor(element: Element, options?: dxTextEditorOptions); - /** Removes focus from the input element. */ - blur(): void; - /** Sets focus to the input element representing the widget. */ - focus(): void; - } - export interface dxTextBoxOptions extends dxTextEditorOptions { - /** Specifies the maximum number of characters you can enter into the textbox. */ - maxLength?: any; - /** The "mode" attribute value of the actual HTML input element representing the text box. */ - mode?: string; - } - /** A single-line text box widget. */ - export class dxTextBox extends dxTextEditor { - constructor(element: JQuery, options?: dxTextBoxOptions); - constructor(element: Element, options?: dxTextBoxOptions); - } - export interface dxTextAreaOptions extends dxTextBoxOptions { - /** Specifies whether or not the widget checks the inner text for spelling mistakes. */ - spellcheck?: boolean; - } - /** A widget used to display and edit multi-line text. */ - export class dxTextArea extends dxTextBox { - constructor(element: JQuery, options?: dxTextAreaOptions); - constructor(element: Element, options?: dxTextAreaOptions); - } - export interface dxTabsOptions extends CollectionWidgetOptions { - /** Specifies whether the widget enables an end-user to select only a single item or multiple items. */ - selectionMode?: string; - /** Specifies whether or not an end-user can scroll tabs by swiping. */ - scrollByContent?: boolean; - /** Specifies whether or not an end-user can scroll tabs. */ - scrollingEnabled?: boolean; - /** A Boolean value that specifies the availability of navigation buttons. */ - showNavButtons?: boolean; - } - /** A tab strip used to switch between pages. */ - export class dxTabs extends CollectionWidget { - constructor(element: JQuery, options?: dxTabsOptions); - constructor(element: Element, options?: dxTabsOptions); - } - export interface dxTabPanelOptions extends dxMultiViewOptions { - /** A handler for the titleClick event. */ - onTitleClick?: any; - /** A handler for the titleHold event. */ - onTitleHold?: Function; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - titleTemplate?: any; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - } - /** A widget used to display a view and to switch between several views by clicking the appropriate tabs. */ - export class dxTabPanel extends dxMultiView { - constructor(element: JQuery, options?: dxTabPanelOptions); - constructor(element: Element, options?: dxTabPanelOptions); - } - export interface dxSelectBoxOptions extends dxDropDownListOptions { - /** The template to be used for rendering the widget text field. */ - fieldTemplate?: any; - /** The text that is provided as a hint in the select box editor. */ - placeholder?: string; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - fieldEditEnabled?: boolean; - } - /** A widget that allows you to select an item in a dropdown list. */ - export class dxSelectBox extends dxDropDownList { - constructor(element: JQuery, options?: dxSelectBoxOptions); - constructor(element: Element, options?: dxSelectBoxOptions); - } - export interface dxTagBoxOptions extends dxSelectBoxOptions { - /** Holds the list of selected values. */ - values?: Array; - } - /** A widget that allows you to select multiple items from a dropdown list. */ - export class dxTagBox extends dxSelectBox { - constructor(element: JQuery, options?: dxTagBoxOptions); - constructor(element: Element, options?: dxTagBoxOptions); - } - export interface dxScrollViewOptions extends dxScrollableOptions { - /** A handler for the pullDown event. */ - onPullDown?: Function; - pullDownAction?: Function; - /** Specifies the text shown in the pullDown panel when pulling the content down lowers the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while pulling the content down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the reachBottom event. */ - onReachBottom?: Function; - reachBottomAction?: Function; - /** Specifies the text shown in the pullDown panel displayed when content is scrolled to the bottom. */ - reachBottomText?: string; - /** Specifies the text shown in the pullDown panel displayed when the content is being refreshed. */ - refreshingText?: string; - /** Returns a value indicating if the scrollView content is larger then the widget container. */ - isFull(): boolean; - /** Locks the widget until the release(preventScrollBottom) method is called and executes the function passed to the onPullDown option and the handler assigned to the pullDown event. */ - refresh(): void; - /** Notifies the scroll view that data loading is finished. */ - release(preventScrollBottom: boolean): JQueryPromise; - /** Toggles the loading state of the widget. */ - toggleLoading(showOrHide: boolean): void; - } - /** A widget used to display scrollable content. */ - export class dxScrollView extends dxScrollable { - constructor(element: JQuery, options?: dxScrollViewOptions); - constructor(element: Element, options?: dxScrollViewOptions); - } - export interface dxScrollableLocation { - top?: number; - left?: number; - } - export interface dxScrollableOptions extends DOMComponentOptions { - /** A string value specifying the available scrolling directions. */ - direction?: string; - /** A Boolean value specifying whether or not the widget can respond to user interaction. */ - disabled?: boolean; - /** A handler for the scroll event. */ - onScroll?: Function; - scrollAction?: Function; - /** Specifies when the widget shows the scrollbar. */ - showScrollbar?: string; - /** A handler for the update event. */ - onUpdated?: Function; - updateAction?: Function; - /** Indicates whether to use native or simulated scrolling. */ - useNative?: boolean; - /** A Boolean value specifying whether to enable or disable the bounce-back effect. */ - bounceEnabled?: boolean; - /** A Boolean value specifying whether or not an end-user can scroll the widget content swiping it up or down. */ - scrollByContent?: boolean; - /** A Boolean value specifying whether or not an end-user can scroll the widget content using the scrollbar. */ - scrollByThumb?: boolean; - } - /** A widget used to display scrollable content. */ - export class dxScrollable extends DOMComponent { - constructor(element: JQuery, options?: dxScrollableOptions); - constructor(element: Element, options?: dxScrollableOptions); - /** Returns the height of the scrollable widget in pixels. */ - clientHeight(): number; - /** Returns the width of the scrollable widget in pixels. */ - clientWidth(): number; - /** An HTML element of the widget. */ - content(): JQuery; - /** Scrolls the widget content by the specified number of pixels. */ - scrollBy(distance: number): void; - /** Scrolls widget content by the specified number of pixels in horizontal and vertical directions. */ - scrollBy(distanceObject: dxScrollableLocation): void; - /** Returns the height of the scrollable content in pixels. */ - scrollHeight(): number; - /** Returns the current scroll position against the leftmost position. */ - scrollLeft(): number; - /** Returns how far the scrollable content is scrolled from the top and from the left. */ - scrollOffset(): dxScrollableLocation; - /** Scrolls widget content to the specified position. */ - scrollTo(targetLocation: number): void; - /** Scrolls widget content to a specified position. */ - scrollTo(targetLocation: dxScrollableLocation): void; - /** Scrolls widget content to the specified element. */ - scrollToElement(element: Element): void; - /** Returns the current scroll position against the topmost position. */ - scrollTop(): number; - /** Returns the width of the scrollable content in pixels. */ - scrollWidth(): number; - /** Updates the dimensions of the scrollable contents. */ - update(): void; - } - export interface dxRadioGroupOptions extends CollectionWidgetOptions { - /** Specifies the radio group layout. */ - layout?: string; - } - /** A widget that enables a user to select one item within a list of items represented by radio buttons. */ - export class dxRadioGroup extends CollectionWidget { - constructor(element: JQuery, options?: dxRadioGroupOptions); - constructor(element: Element, options?: dxRadioGroupOptions); - } - export interface dxPopupOptions extends dxOverlayOptions { - animation?: fx.AnimationOptions; - /** Specifies whether or not to allow a user to drag the popup window. */ - dragEnabled?: boolean; - /** A Boolean value specifying whether or not to display the widget in full-screen mode. */ - fullScreen?: boolean; - position?: PositionOptions; - /** A Boolean value specifying whether or not to display the title in the overlay window. */ - showTitle?: boolean; - /** The title in the overlay window. */ - title?: string; - /** A template to be used for rendering the widget title. */ - titleTemplate?: any; - width?: any; - /** Specifies items displayed on the top or bottom toolbar of the popup window. */ - buttons?: Array; - /** Specifies whether or not the widget displays the Close button. */ - showCloseButton?: boolean; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - } - /** A widget that displays required content in a popup window. */ - export class dxPopup extends dxOverlay { - constructor(element: JQuery, options?: dxPopupOptions); - constructor(element: Element, options?: dxPopupOptions); - } - export interface dxPopoverOptions extends dxPopupOptions { - /** An object defining animation options of the widget. */ - animation?: fx.AnimationOptions; - /** Specifies the height of the widget. */ - height?: any; - /** An object defining widget positioning options. */ - position?: PositionOptions; - shading?: boolean; - /** A Boolean value specifying whether or not to display the title in the overlay window. */ - showTitle?: boolean; - /** The target element associated with a popover. */ - target?: any; - /** Specifies the width of the widget. */ - width?: any; - } - /** A widget that displays the required content in a popup window. */ - export class dxPopover extends dxPopup { - constructor(element: JQuery, options?: dxPopoverOptions); - constructor(element: Element, options?: dxPopoverOptions); - /** Displays the widget for the specified target element. */ - show(target?: any): JQueryPromise; - } - export interface dxOverlayOptions extends WidgetOptions { - /** An object that defines the animation options of the widget. */ - animation?: fx.AnimationOptions; - /** A Boolean value specifying whether or not the widget is closed if a user presses the Back hardware button. */ - closeOnBackButton?: boolean; - /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlapping window. */ - closeOnOutsideClick?: any; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - /** Specifies whether widget content is rendered when the widget is shown or when rendering the widget. */ - deferRendering?: boolean; - /** Specifies whether or not an end-user can drag the widget. */ - dragEnabled?: boolean; - /** The height of the widget in pixels. */ - height?: any; - /** A handler for the hidden event. */ - onHidden?: Function; - hiddenAction?: Function; - /** A handler for the hiding event. */ - onHiding?: Function; - hidingAction?: Function; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** A Boolean value specifying whether or not the main screen is inactive while the widget is active. */ - shading?: boolean; - /** Specifies the shading color. */ - shadingColor?: string; - /** A handler for the showing event. */ - onShowing?: Function; - showingAction?: Function; - /** A handler for the shown event. */ - onShown?: Function; - shownAction?: Function; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - /** The widget width in pixels. */ - width?: any; - } - /** A widget displaying the required content in an overlay window. */ - export class dxOverlay extends Widget { - constructor(element: JQuery, options?: dxOverlayOptions); - constructor(element: Element, options?: dxOverlayOptions); - /** An HTML element of the widget. */ - content(): JQuery; - /** Hides the widget. */ - hide(): JQueryPromise; - /** Recalculates the overlay's size and position. */ - repaint(): void; - /** Shows the widget. */ - show(): JQueryPromise; - /** Toggles the visibility of the widget. */ - toggle(showing: boolean): JQueryPromise; - /** A static method that specifies the default z-index for all overlay widgets. */ - static baseZIndex(zIndex: number): void; - } - export interface dxNumberBoxOptions extends dxTextEditorOptions { - /** The maximum value accepted by the number box. */ - max?: number; - /** The minimum value accepted by the number box. */ - min?: number; - /** Specifies whether or not to show spin buttons. */ - showSpinButtons?: boolean; - useTouchSpinButtons?: boolean; - /** Specifies by which value the widget value changes when a spin button is clicked. */ - step?: number; - /** The current number box value. */ - value?: number; - } - /** A textbox widget that enables a user to enter numeric values. */ - export class dxNumberBox extends dxTextEditor { - constructor(element: JQuery, options?: dxNumberBoxOptions); - constructor(element: Element, options?: dxNumberBoxOptions); - } - export interface dxNavBarOptions extends dxTabsOptions { - scrollingEnabled?: boolean; - } - /** A widget that contains items used to navigate through application views. */ - export class dxNavBar extends dxTabs { - constructor(element: JQuery, options?: dxNavBarOptions); - constructor(element: Element, options?: dxNavBarOptions); - } - export interface dxMultiViewOptions extends CollectionWidgetOptions { - /** Specifies whether or not to animate the displayed item change. */ - animationEnabled?: boolean; - /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ - loop?: boolean; - /** The index of the currently displayed item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to allow users to change the selected index by swiping. */ - swipeEnabled?: boolean; - } - /** A widget used to display a view and to switch between several views. */ - export class dxMultiView extends CollectionWidget { - constructor(element: JQuery, options?: dxMultiViewOptions); - constructor(element: Element, options?: dxMultiViewOptions); - } - export interface dxMapOptions extends WidgetOptions { - /** Specifies whether or not the widget automatically adjusts center and zoom option values when adding a new marker or route. */ - autoAdjust?: boolean; - bounds?: { - northEast?: { - lat?: number; - lng?: number; - }; - southWest?: { - lat?: number; - lng?: number; - }; - /** An object, a string, or an array specifying the location displayed at the center of the widget. */ - center?: { - /** The latitude location displayed in the center of the widget. */ - lat?: number; - /** The longitude location displayed in the center of the widget. */ - lng?: number; - }; - /** A handler for the click event. */ - onClick?: any; - clickAction?: any; - /** Specifies whether or not map widget controls are available. */ - controls?: boolean; - /** Specifies the height of the widget. */ - height?: number; - /** A key used to authenticate the application within the required map provider. */ - key?: { - /** A key used to authenticate the application within the "Bing" map provider. */ - bing?: string; - /** A key used to authenticate the application within the "Google" map provider. */ - google?: string; - /** A key used to authenticate the application within the "Google Static" map provider. */ - googleStatic?: string; - } - /** - * An object, a string, or an array specifying the location displayed at the center of the widget. - * @deprecated center.md - */ - location?: { - lat?: number; - lng?: number; - }; - /** A handler for the markerAdded event. */ - onMarkerAdded?: Function; - markerAddedAction?: Function; - /** A URL pointing to the custom icon to be used for map markers. */ - markerIconSrc?: string; - /** A handler for the markerRemoved event. */ - onMarkerRemoved?: Function; - markerRemovedAction?: Function; - /** An array of markers displayed on a map. */ - markers?: Array; - /** The name of the current map data provider. */ - provider?: string; - /** A handler for the ready event. */ - onReady?: Function; - readyAction?: Function; - /** A handler for the routeAdded event. */ - onRouteAdded?: Function; - routeAddedAction?: Function; - /** A handler for the routeRemoved event. */ - onRouteRemoved?: Function; - routeRemovedAction?: Function; - /** An array of routes shown on the map. */ - routes?: Array; - /** The type of a map to display. */ - type?: string; - /** Specifies the width of the widget. */ - width?: number; - /** The zoom level of the map. */ - zoom?: number; - /** Adds a marker to the map. */ - addMarker(markerOptions: Object): JQueryPromise; - /** Adds a route to the map. */ - addRoute(options: Object): JQueryPromise; - /** Removes a marker from the map. */ - removeMarker(marker: Object): JQueryPromise; - /** Removes a route from the map. */ - removeRoute(route: any): JQueryPromise; - }; - } - /** An interactive map widget. */ - export class dxMap extends Widget { - constructor(element: JQuery, options?: dxMapOptions); - constructor(element: Element, options?: dxMapOptions); - } - export interface dxLookupOptions extends dxDropDownListOptions { - /** An object defining widget animation options. */ - animation?: fx.AnimationOptions; - autoPagingEnabled?: boolean; - /** The text displayed on the Cancel button. */ - cancelButtonText?: string; - /** The text displayed on the Clear button. */ - clearButtonText?: string; - /** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window. */ - closeOnOutsideClick?: any; - /** The text displayed on the Apply button. */ - applyButtonText?: string; - /** A Boolean value specifying whether or not to display the lookup in full-screen mode. */ - fullScreen?: boolean; - /** A Boolean value specifying whether or not to group widget items. */ - grouped?: boolean; - groupRender?: any; - /** The name of the template used to display a group header. */ - groupTemplate?: any; - /** The text displayed on the button used to load the next page from the data source. */ - nextButtonText?: string; - /** A handler for the pageLoading event. */ - onPageLoading?: Function; - pageLoadingAction?: Function; - /** Specifies the text shown in the pullDown panel, which is displayed when the widget is scrolled to the bottom. */ - pageLoadingText?: string; - /** The text displayed by the widget when nothing is selected. */ - placeholder?: string; - /** The height of the widget popup element. */ - popupHeight?: any; - /** The width of the widget popup element. */ - popupWidth?: any; - /** An object defining widget positioning options. */ - position?: PositionOptions; - /** Specifies the text displayed in the pullDown panel when the widget is pulled below the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the pullRefresh event. */ - onPullRefresh?: Function; - pullRefreshAction?: Function; - /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ - pullRefreshEnabled?: boolean; - /** Specifies the text displayed in the pullDown panel while the widget is being refreshed. */ - refreshingText?: string; - /** A handler for the scroll event. */ - onScroll?: Function; - scrollAction?: Function; - /** A Boolean value specifying whether or not the search bar is visible. */ - searchEnabled?: boolean; - /** The text that is provided as a hint in the lookup's search bar. */ - searchPlaceholder?: string; - /** A Boolean value specifying whether or not the main screen is inactive while the lookup is active. */ - shading?: boolean; - /** Specifies whether to display the Cancel button in the lookup window. */ - showCancelButton?: boolean; - /** A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. */ - showNextButton?: boolean; - /** The title of the lookup window. */ - title?: string; - /** A template to be used for rendering the widget title. */ - titleTemplate?: any; - /** Specifies whether or not the widget uses native scrolling. */ - useNativeScrolling?: boolean; - /** Specifies whether or not to show lookup contents in a dxPopover widget. */ - usePopover?: boolean; - /** A handler for the valueChanged event. */ - onValueChanged?: Function; - contentReadyAction?: Function; - titleRender?: any; - /** A handler for the titleRendered event. */ - onTitleRendered?: Function; - /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ - focusStateEnabled?: boolean; - } - /** A widget that allows a user to select predefined values from a lookup window. */ - export class dxLookup extends dxDropDownList { - constructor(element: JQuery, options?: dxLookupOptions); - constructor(element: Element, options?: dxLookupOptions); - /** This section lists the data source fields that are used in a default template for lookup drop-down items. */ - } - export interface dxLoadPanelOptions extends dxOverlayOptions { - /** An object defining the animation options of the widget. */ - animation?: fx.AnimationOptions; - /** The delay in milliseconds after which the load panel is displayed. */ - delay?: number; - /** The height of the widget. */ - height?: number; - /** A URL pointing to an image to be used as a load indicator. */ - indicatorSrc?: string; - /** The text displayed in the load panel. */ - message?: string; - /** A Boolean value specifying whether or not to show a load indicator. */ - showIndicator?: boolean; - /** A Boolean value specifying whether or not to show the pane behind the load indicator. */ - showPane?: boolean; - /** The width of the widget. */ - width?: number; - } - /** A widget used to indicate whether or not an element is loading. */ - export class dxLoadPanel extends dxOverlay { - constructor(element: JQuery, options?: dxLoadPanelOptions); - constructor(element: Element, options?: dxLoadPanelOptions); - } - export interface dxLoadIndicatorOptions extends WidgetOptions { - /** Specifies the path to an image used as the indicator. */ - indicatorSrc?: string; - } - /** The widget used to indicate the loading process. */ - export class dxLoadIndicator extends Widget { - constructor(element: JQuery, options?: dxLoadIndicatorOptions); - constructor(element: Element, options?: dxLoadIndicatorOptions); - } - export interface dxListOptions extends CollectionWidgetOptions { - /** A Boolean value specifying whether or not to load the next page from the data source when the list is scrolled to the bottom. */ - autoPagingEnabled?: boolean; - /** Specifies whether or not the widget displays items by pages. */ - pagingEnabled?: boolean; - /** An object used to set configuration options for the dxList's edit mode. */ - editConfig?: { - /** Specifies whether the list items can be deleted. */ - deleteEnabled?: boolean; - /** - * A mode specifying how to delete a list item. - * @deprecated deleteType.md - */ - deleteMode?: string; - /** Specifies the way a user can delete items from the list. */ - deleteType?: string; - itemRender?: any; - /** The template used to render list items in edit mode. */ - itemTemplate?: any; - /** Specifies the array of items for a context menu called for a list item. */ - menuItems?: Array; - /** Specifies whether an item context menu is shown when a user swipes or holds an item. */ - menuType?: string; - /** Specifies whether or not a user can reorder items. */ - reorderEnabled?: boolean; - /** Specifies whether the list items can be selected. */ - selectionEnabled?: boolean; - /** - * A mode specifying how to select a list item. - * @deprecated selectionType.md - */ - selectionMode?: string; - /** A type specifying how to select a list item. */ - selectionType?: string; - /** Specifies whether the item list represented by this widget is editable. */ - editEnabled?: boolean; - /** Specifies whether or not to show the loading panel when the DataSource bound to the widget is loading data. */ - indicateLoading?: boolean; - }; - /** A Boolean value specifying whether or not to display a grouped list. */ - grouped?: boolean; - groupRender?: any; - /** The name of the template used to display a group header. */ - groupTemplate?: any; - onItemDeleting?: Function; - /** A handler for the itemDeleted event. */ - onItemDeleted?: Function; - itemDeleteAction?: Function; - /** A handler for the itemReordered event. */ - onItemReordered?: Function; - itemReorderAction?: Function; - /** A handler for the itemClick event. */ - onItemClick?: any; - /** A handler for the itemSwipe event. */ - onItemSwipe?: Function; - itemSwipeAction?: Function; - /** The text displayed on the button used to load the next page from the data source. */ - nextButtonText?: string; - /** A handler for the pageLoading event. */ - onPageLoading?: Function; - pageLoadingAction?: Function; - /** Specifies the text shown in the pullDown panel, which is displayed when the list is scrolled to the bottom. */ - pageLoadingText?: string; - /** Specifies the text displayed in the pullDown panel when the list is pulled below the refresh threshold. */ - pulledDownText?: string; - /** Specifies the text shown in the pullDown panel while the list is being pulled down to the refresh threshold. */ - pullingDownText?: string; - /** A handler for the pullRefresh event. */ - onPullRefresh?: Function; - pullRefreshAction?: Function; - /** A Boolean value specifying whether or not the widget supports the "pull down to refresh" gesture. */ - pullRefreshEnabled?: boolean; - /** Specifies the text displayed in the pullDown panel while the list is being refreshed. */ - refreshingText?: string; - /** A handler for the scroll event. */ - onScroll?: Function; - scrollAction?: Function; - /** A Boolean value specifying whether to enable or disable list scrolling. */ - scrollingEnabled?: boolean; - /** Specifies whether the list supports single item selection or multi-selection. */ - selectionMode?: string; - /** A Boolean value specifying whether the widget loads the next page automatically when you reach the bottom of the list or when a button is clicked. */ - showNextButton?: boolean; - /** Specifies when the widget shows the scrollbar. */ - showScrollbar?: string; - /** Specifies whether or not the widget uses native scrolling. */ - useNativeScrolling?: boolean; - itemUnselectAction?: Function; - onItemContextMenu?: Function; - onItemHold?: Function; - /** Specifies whether or not an end-user can collapse groups. */ - collapsibleGroups?: boolean; - } - /** A list widget. */ - export class dxList extends CollectionWidget { - constructor(element: JQuery, options?: dxListOptions); - constructor(element: Element, options?: dxListOptions); - /** Returns the height of the widget in pixels. */ - clientHeight(): number; - /** Removes the specified item from the list. */ - deleteItem(itemIndex: any): JQueryPromise; - /** Removes the specified item from the list. */ - deleteItem(itemElement: Element): JQueryPromise; - /** Returns a Boolean value that indicates whether or not the specified item is selected. */ - isItemSelected(itemIndex: any): boolean; - /** Returns a Boolean value that indicates whether or not the specified item is selected. */ - isItemSelected(itemElement: Element): boolean; - /** - * Reloads list data. - * @deprecated Use the "reload" method instead. - */ - refresh(): void; - /** Reloads list data. */ - reload(): void; - /** Moves the specified item to the specified position in the list. */ - reorderItem(itemElement: Element, toItemElement: Element): JQueryPromise; - /** Moves the specified item to the specified position in the list. */ - reorderItem(itemIndex: any, toItemIndex: any): JQueryPromise; - /** Scrolls the list content by the specified number of pixels. */ - scrollBy(distance: number): void; - /** Returns the height of the list content in pixels. */ - scrollHeight(): number; - /** Scrolls list content to the specified position. */ - scrollTo(location: number): void; - /** Scrolls the list to the specified item. */ - scrollToItem(itemElement: Element): void; - /** Scrolls the list to the specified item. */ - scrollToItem(itemIndex: any): void; - /** Returns how far the list content is scrolled from the top. */ - scrollTop(): number; - /** Selects the specified item from the list. */ - selectItem(itemElement: Element): void; - /** Selects the specified item from the list. */ - selectItem(itemIndex: any): void; - /** Deselects the specified item from the list. */ - unselectItem(itemElement: Element): void; - /** Unselects the specified item from the list. */ - unselectItem(itemIndex: any): void; - /** - * Updates the widget scrollbar according to widget content size. - * @deprecated updateDimensions.md - */ - update(): JQueryPromise; - /** Updates the widget scrollbar according to widget content size. */ - updateDimensions(): JQueryPromise; - /** Expands the specified group. */ - expandGroup(groupIndex: number): JQueryPromise; - /** Collapses the specified group. */ - collapseGroup(groupIndex: number): JQueryPromise; - } - export interface dxGalleryOptions extends CollectionWidgetOptions { - /** The time, in milliseconds, spent on slide animation. */ - animationDuration?: number; - /** Specifies whether or not to animate the displayed item change. */ - animationEnabled?: boolean; - /** A Boolean value specifying whether or not to allow users to switch between items by clicking an indicator. */ - indicatorEnabled?: boolean; - /** A Boolean value specifying whether or not to scroll back to the first item after the last item is swiped. */ - loop?: boolean; - /** The index of the currently active gallery item. */ - selectedIndex?: number; - /** A Boolean value specifying whether or not to display an indicator that points to the selected gallery item. */ - showIndicator?: boolean; - /** A Boolean value that specifies the availability of the "Forward" and "Back" navigation buttons. */ - showNavButtons?: boolean; - /** The time interval in milliseconds, after which the gallery switches to the next item. */ - slideshowDelay?: number; - /** A Boolean value specifying whether or not to allow users to switch between items by swiping. */ - swipeEnabled?: boolean; - } - /** An image gallery widget. */ - export class dxGallery extends CollectionWidget { - constructor(element: JQuery, options?: dxGalleryOptions); - constructor(element: Element, options?: dxGalleryOptions); - /** Shows the specified gallery item. */ - goToItem(itemIndex: number, animation: boolean): JQueryPromise; - /** Shows the next gallery item. */ - nextItem(animation: boolean): JQueryPromise; - /** Shows the previous gallery item. */ - prevItem(animation: boolean): JQueryPromise; - } - export interface dxDropDownEditorOptions extends dxTextBoxOptions { - /** Specifies the current value displayed by the widget. */ - value?: Object; - /** A handler for the closed event. */ - onClosed?: Function; - /** A handler for the opened event. */ - onOpened?: Function; - /** Specifies whether or not the drop-down editor is displayed. */ - opened?: boolean; - closeAction?: Function; - openAction?: Function; - shownAction?: Function; - hiddenAction?: Function; - /** Specifies whether or not the widget allows an end-user to enter a custom value. */ - fieldEditEnabled?: boolean; - editEnabled?: boolean; - /** Specifies the way an end-user applies the selected value. */ - applyValueMode?: string; - /** Specifies whether or not the widget supports the focused state and keyboard navigation. */ - focusStateEnabled?: boolean; - } - /** A drop-down editor widget. */ - export class dxDropDownEditor extends dxTextBox { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - /** Closes the drop-down editor. */ - close(): void; - /** Opens the drop-down editor. */ - open(): void; - /** Resets the widget's value to null. */ - reset(): void; - } - export interface dxDateBoxOptions extends dxTextEditorOptions { - /** A format used to display date/time information. */ - format?: string; - /** A Globalize format string specifying the date display format. */ - formatString?: string; - /** The last date that can be selected within the widget. */ - max?: Date; - /** The minimum date that can be selected within the widget. */ - min?: Date; - /** The text displayed by the widget when the widget value is not yet specified. This text is also used as a title of the date picker. */ - placeholder?: string; - /** Specifies whether or not a user can pick out a date using the drop-down calendar. */ - useCalendar?: boolean; - /** A Date object specifying the date and time currently selected using the date box. */ - value?: Date; - /** Specifies whether or not the widget uses the native HTML input element. */ - useNative?: boolean; - /** Specifies the interval between neighboring values in the popup list in minutes. */ - interval?: number; - } - /** A date box widget. */ - export class dxDateBox extends dxDropDownEditor { - constructor(element: JQuery, options?: dxDateBoxOptions); - constructor(element: Element, options?: dxDateBoxOptions); - } - export interface dxCheckBoxOptions extends EditorOptions { - checked?: boolean; - /** Specifies the widget state. */ - value?: boolean; - /** Specifies the text displayed by the check box. */ - text?: string; - } - /** A check box widget. */ - export class dxCheckBox extends Editor { - constructor(element: JQuery, options?: dxCheckBoxOptions); - constructor(element: Element, options?: dxCheckBoxOptions); - } - export interface dxCalendarOptions extends EditorOptions { - /** Specifies a date displayed on the current calendar page. */ - currentDate?: Date; - /** Specifies the first day of a week. */ - firstDayOfWeek?: number; - /** The latest date the widget allows to select. */ - max?: Date; - /** The earliest date the widget allows to select. */ - min?: Date; - } - /** A calendar widget. */ - export class dxCalendar extends Editor { - constructor(element: JQuery, options?: dxCalendarOptions); - constructor(element: Element, options?: dxCalendarOptions); - } - export interface dxButtonOptions extends WidgetOptions { - /** A handler for the click event. */ - onClick?: any; - clickAction?: any; - /** The name of an icon to be displayed on the button. */ - icon?: string; - /** A URL pointing to the image to be displayed on the button. */ - iconSrc?: string; - /** The text displayed on the button. */ - text?: string; - /** Specifies the button type. */ - type?: string; - /** Specifies the name of the validation group to be accessed in the click event handler. */ - validationGroup?: string; - } - /** A button widget. */ - export class dxButton extends Widget { - constructor(element: JQuery, options?: dxButtonOptions); - constructor(element: Element, options?: dxButtonOptions); - } - export interface dxBoxOptions extends CollectionWidget { - /** Specifies how widget items are aligned along the main direction. */ - align?: string; - /** Specifies the direction of item positioning in the widget. */ - direction?: string; - /** Specifies how widget items are aligned cross-wise. */ - crossAlign?: string; - } - /** A container widget used to arrange inner elements. */ - export class dxBox extends CollectionWidget { - constructor(element: JQuery, options?: dxBoxOptions); - constructor(element: Element, options?: dxBoxOptions); - } - export interface dxResponsiveBoxOptions extends CollectionWidgetOptions { - /** Specifies the collection of rows for the grid used to position layout elements. */ - rows?: Array; - /** Specifies the collection of columns for the grid used to position layout elements. */ - cols?: Array; - /** Specifies the function returning the screen factor depending on the screen width. */ - screenByWidth?: (width: number) => string; - /** Specifies the screen factor with which all elements are located in a single column. */ - singleColumnScreen?: string; - } - /** A widget used to build an adaptive markup that is dependent on screen resolution. */ - export class dxResponsiveBox extends CollectionWidget { - constructor(element: JQuery, options?: dxBoxOptions); - constructor(element: Element, options?: dxBoxOptions); - } - export interface dxAutocompleteOptions extends dxDropDownListOptions { - /** Specifies the current value displayed by the widget. */ - value?: string; - /** The minimum number of characters that must be entered into the text box to begin a search. */ - minSearchLength?: number; - /** Specifies the maximum count of items displayed by the widget. */ - maxItemCount?: number; - /** Specifies the currently selected item. */ - selectedItem?: Object; - } - /** A textbox widget that supports autocompletion. */ - export class dxAutocomplete extends dxDropDownList { - constructor(element: JQuery, options?: dxAutocompleteOptions); - constructor(element: Element, options?: dxAutocompleteOptions); - /** Opens the drop-down editor. */ - open(): void; - /** Closes the drop-down editor. */ - close(): void; - } - export interface dxAccordionOptions extends CollectionWidgetOptions { - /** A number specifying the time in milliseconds spent on the animation of the expanding or collapsing of a panel. */ - animationDuration?: number; - /** Specifies the height of the widget. */ - height?: any; - /** Specifies whether all items can be collapsed or whether at least one item must always be expanded. */ - collapsible?: boolean; - /** Specifies whether the widget can expand several items or only a single item at once. */ - multiple?: boolean; - /** The template to be used for rendering dxAccordion items. */ - itemTemplate?: any; - /** A handler for the itemTitleClick event. */ - onItemTitleClick?: any; - /** A handler for the itemTitleHold event. */ - onItemTitleHold?: Function; - /** The template to be used for rendering an item title. */ - itemTitleTemplate?: any; - /** The index number of the currently selected item. */ - selectedIndex?: number; - } - /** A widget that displays data source items on collapsible panels. */ - export class dxAccordion extends CollectionWidget { - constructor(element: JQuery, options?: dxAccordionOptions); - constructor(element: Element, options?: dxAccordionOptions); - /** Collapses the specified item. */ - collapseItem(index: number): JQueryPromise; - /** Expands the specified item. */ - expandItem(index: number): JQueryPromise; - } - export interface dxFileUploaderOptions extends EditorOptions { - /** A read-only option that holds a File instance representing the selected file. */ - value?: File; - /** Holds the File instances representing files selected in the widget. */ - values?: Array; - /** Specifies the text displayed on the button opening the file selection dialog. */ - buttonText?: string; - /** Specifies the text displayed on the area to which an end-user can drop a file. */ - labelText?: string; - /** Specifies the value passed to the name attribute of the underlying input element. */ - name?: string; - /** Specifies whether the widget enables an end-user to select a single file or multiple files. */ - multiple?: boolean; - /** Specifies a file type or several types accepted by the widget. */ - accept?: string; - } - /** A widget used to select and upload a file or multiple files. */ - export class dxFileUploader extends Editor { - constructor(element: JQuery, options?: dxFileUploaderOptions); - constructor(element: Element, options?: dxFileUploaderOptions); - } - export interface dxTrackBarOptions extends EditorOptions { - /** The minimum value the widget can accept. */ - min?: number; - /** The maximum value the widget can accept. */ - max?: number; - /** The current widget value. */ - value?: number; - } - /** A base class for track bar widgets. */ - export class dxTrackBar extends Editor { - constructor(element: JQuery, options?: dxTrackBarOptions); - constructor(element: Element, options?: dxTrackBarOptions); - } - export interface dxProgressBarOptions extends dxTrackBarOptions { - /** Specifies a format for the progress status. */ - statusFormat?: any; - /** Specifies whether or not the widget displays a progress status. */ - showStatus?: boolean; - /** A handler for the complete event. */ - onComplete?: Function; - } - /** A widget used to indicate progress. */ - export class dxProgressBar extends dxTrackBar { - constructor(element: JQuery, options?: dxProgressBarOptions); - constructor(element: Element, options?: dxProgressBarOptions); - } - export interface dxSliderOptions extends dxTrackBarOptions { - /** The slider step size. */ - step?: number; - /** The current slider value. */ - value?: number; - /** Specifies whether or not to highlight a range selected within the widget. */ - showRange?: boolean; - /** Specifies options for the slider tooltip. */ - tooltip?: { - /** Specifies whether or not the tooltip is enabled. */ - enabled?: boolean; - /** Specifies format for the tooltip. */ - format?: any; - /** Specifies whether the tooltip is located over or under the slider. */ - position?: string; - /** Specifies whether the widget always shows a tooltip or only when a pointer is over the slider. */ - showMode?: string; - }; - /** Specifies options for labels displayed at the min and max values. */ - label?: { - /** Specifies whether or not slider labels are visible. */ - visible?: boolean; - /** Specifies whether labels are located over or under the scale. */ - position?: string; - /** Specifies a format for labels. */ - format?: any; - }; - } - /** A widget that allows a user to select a numeric value within a given range. */ - export class dxSlider extends dxTrackBar { - constructor(element: JQuery, options?: dxSliderOptions); - constructor(element: Element, options?: dxSliderOptions); - } - export interface dxRangeSliderOptions extends dxSliderOptions { - /** The left edge of the interval currently selected using the range slider. */ - start?: number; - /** The right edge of the interval currently selected using the range slider. */ - end?: number; - } - /** A widget that enables a user to select a range of numeric values. */ - export class dxRangeSlider extends dxSlider { - constructor(element: JQuery, options?: dxRangeSliderOptions); - constructor(element: Element, options?: dxRangeSliderOptions); - } - export interface dxTileViewOptions extends CollectionWidgetOptions { - /** Specifies the height of the base tile view item. */ - baseItemHeight?: number; - /** Specifies the width of the base tile view item. */ - baseItemWidth?: number; - /** Specifies the height of the widget. */ - height?: any; - /** Specifies the distance in pixels between adjacent tiles. */ - itemMargin?: number; - listHeight?: any; - /** A Boolean value specifying whether or not to display a scrollbar. */ - showScrollbar?: boolean; - } - /** A widget displaying several blocks of data as tiles. */ - export class dxTileView extends CollectionWidget { - constructor(element: JQuery, options?: dxTileViewOptions); - constructor(element: Element, options?: dxTileViewOptions); - /** Returns the current scroll position of the widget content. */ - scrollPosition(): number; - } - export interface dxSwitchOptions extends EditorOptions { - /** Text displayed when the widget is in a disabled state. */ - offText?: string; - /** Text displayed when the widget is in an enabled state. */ - onText?: string; - /** A Boolean value specifying whether the current switch state is "On" or "Off". */ - value?: boolean; - } - /** A switch widget. */ - export class dxSwitch extends Editor { - constructor(element: JQuery, options?: dxSwitchOptions); - constructor(element: Element, options?: dxSwitchOptions); - } - export interface dxSlideOutOptions extends CollectionWidgetOptions { - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** A Boolean value specifying whether or not to display a grouped menu. */ - menuGrouped?: boolean; - menuGroupRender?: any; - /** The name of the template used to display a group header. */ - menuGroupTemplate?: any; - menuItemRender?: any; - /** The template used to render menu items. */ - menuItemTemplate?: any; - /** Specifies whether or not the slide-out menu is displayed. */ - menuVisible?: boolean; - /** Indicates whether the menu can be shown/hidden by swiping the widget's main panel. */ - swipeEnabled?: boolean; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - } - /** The widget that allows you to slide-out the current view to reveal an item list. */ - export class dxSlideOut extends CollectionWidget { - constructor(element: JQuery, options?: dxSlideOutOptions); - constructor(element: Element, options?: dxSlideOutOptions); - /** Hides the widget's slide-out menu. */ - hideMenu(): JQueryPromise; - /** Displays the widget's slide-out menu. */ - showMenu(): JQueryPromise; - /** Toggles the visibility of the widget's slide-out menu. */ - toggleMenuVisibility(showing: boolean): JQueryPromise; - } - export interface dxPivotOptions extends CollectionWidgetOptions { - /** The index of the currently active pivot item. */ - selectedIndex?: number; - /** A template to be used for rendering widget content. */ - contentTemplate?: any; - } - /** A widget that is similar to a traditional tab control, but optimized for the phone with simplified end-user interaction. */ - export class dxPivot extends CollectionWidget { - constructor(element: JQuery, options?: dxPivotOptions); - constructor(element: Element, options?: dxPivotOptions); - } - export interface dxPanoramaOptions extends CollectionWidgetOptions { - /** An object exposing options for setting a background image for the panorama. */ - backgroundImage?: { - /** Specifies the height of the panorama's background image. */ - height?: number; - /** Specifies the URL of the image that is used as the panorama's background image. */ - url?: string; - /** Specifies the width of the panorama's background image. */ - width?: number; - }; - /** The index of the currently active panorama item. */ - selectedIndex?: number; - /** Specifies the widget content title. */ - title?: string; - } - /** A widget displaying the required content in a long horizontal canvas that extends beyond the frames of the screen. */ - export class dxPanorama extends CollectionWidget { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - } - export interface dxDropDownMenuOptions extends WidgetOptions { - /** A handler for the buttonClick event. */ - onButtonClick?: any; - buttonClickAction?: any; - /** The name of the icon to be displayed by the DropDownMenu button. */ - buttonIcon?: string; - /** A URL pointing to the image to be displayed by the DropDownMenu button. */ - buttonIconSrc?: string; - /** The text displayed in the DropDownMenu button. */ - buttonText?: string; - /** A data source used to fetch data to be displayed by the widget. */ - dataSource?: any; - /** A handler for the itemClick event. */ - onItemClick?: any; - itemClickAction?: any; - itemRender?: any; - /** An array of items displayed by the widget. */ - items?: Array; - /** The template to be used for rendering items. */ - itemTemplate?: any; - /** Specifies whether or not to show the drop down menu within a dxPopover widget. */ - usePopover?: boolean; - /** The width of the menu popup in pixels. */ - popupWidth?: any; - /** The height of the menu popup in pixels. */ - popupHeight?: any; - /** Specifies whether or not the drop-down menu is displayed. */ - opened?: boolean; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; - } - /** A drop-down menu widget. */ - export class dxDropDownMenu extends Widget { - constructor(element: JQuery, options?: dxDropDownEditorOptions); - constructor(element: Element, options?: dxDropDownEditorOptions); - /** This section lists the data source fields that are used in a default template for drop-down menu items. */ - /** Opens the drop-down menu. */ - open(): void; - /** Closes the drop-down menu. */ - close(): void; - } - export interface dxActionSheetOptions extends CollectionWidgetOptions { - cancelClickAction?: any; - /** A handler for the cancelClick event. */ - onCancelClick?: any; - /** The text displayed in the button that closes the action sheet. */ - cancelText?: string; - /** Specifies whether or not to display the Cancel button in action sheet. */ - showCancelButton?: boolean; - /** A Boolean value specifying whether or not the title of the action sheet is visible. */ - showTitle?: boolean; - /** Specifies the element the action sheet popover points at. */ - target?: any; - /** The title of the action sheet. */ - title?: string; - /** Specifies whether or not to show the action sheet within a dxPopover widget. */ - usePopover?: boolean; - /** A Boolean value specifying whether or not the dxActionSheet widget is visible. */ - visible?: boolean; - } - /** A widget consisting of a set of choices related to a certain task. */ - export class dxActionSheet extends CollectionWidget { - constructor(element: JQuery, options?: dxActionSheetOptions); - constructor(element: Element, options?: dxActionSheetOptions); - /** Hides the widget. */ - hide(): JQueryPromise; - /** Shows the widget. */ - show(): JQueryPromise; - /** Shows or hides the widget depending on the Boolean value passed as the parameter. */ - toggle(showing: boolean): JQueryPromise; - } - export interface dxColorBoxOptions extends dxDropDownEditorOptions { - /** Specifies the text displayed on the button that applies changes and closes the drop-down editor. */ - applyButtonText?: string; - applyValueMode?: string; - /** Specifies the text displayed on the button that cancels changes and closes the drop-down editor. */ - cancelButtonText?: string; - /** Specifies whether or not the widget value includes the alpha channel component. */ - editAlphaChannel?: boolean; - } - /** A widget used to specify a color value. */ - export class dxColorBox extends dxDropDownEditor { - constructor(element: JQuery, options?: dxColorBoxOptions); - constructor(element: Element, options?: dxColorBoxOptions); - } - export interface dxColorPickerOptions extends dxColorBoxOptions { } - /** - * A widget used to specify a color value. - * @deprecated Use the dxColorBox widget instead - */ - export class dxColorPicker extends dxColorBox { - constructor(element: JQuery, options?: dxColorPickerOptions); - constructor(element: Element, options?: dxColorPickerOptions); - } - export interface dxTreeViewOptions extends CollectionWidgetOptions { - /** Specifies whether a nested or plain array is used as a data source. */ - dataStructure?: string; - /** Specifies whether or not a user can expand all tree view items by the "*" hot key. */ - expandAllEnabled?: boolean; - /** - * An array of currently expanded item objects. - * @deprecated Use item.expanded field instead - */ - expandedItems?: Array; - /** Specifies whether or not a check box is displayed at each tree view item. */ - showCheckBoxes?: boolean; - /** Specifies whether or not to select nodes recursively. */ - selectNodesRecursive?: boolean; - /** Specifies whether the "Select All" check box is displayed over the tree view. */ - selectAllEnabled?: boolean; - /** Specifies the text displayed at the "Select All" check box. */ - selectAllText?: string; - /** Specifies the name of the data source item field used as a key. */ - keyExpr?: any; - /** Specifies the name of the data source item field whose value is displayed by the widget. */ - displayExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is selected. */ - selectedExpr?: any; - /** Specifies the name of the data source item field whose value defines whether or not the corresponding node is expanded. */ - expandedExpr?: any; - /** Specifies the name of the data source item field that contains an array of nested items. */ - itemsExpr?: any; - /** Specifies the name of the data source item field that holds the key of the parent item. */ - parentIdExpr?: any; - disabledExpr?: any; - /** A string value specifying available scrolling directions. */ - scrollDirection?: string; - /** A handler for the itemSelected event. */ - onItemSelected?: Function; - /** A handler for the itemExpanded event. */ - onItemExpanded?: Function; - /** A handler for the itemCollapsed event. */ - onItemCollapsed?: Function; - } - /** A widget displaying specified data items as a tree. */ - export class dxTreeView extends CollectionWidget { - constructor(element: JQuery, options?: dxTreeViewOptions); - constructor(element: Element, options?: dxTreeViewOptions); - /** Updates the tree view scrollbars according to the current size of the widget content. */ - updateDimensions(): JQueryPromise; - /** Selects the specified item. */ - selectItem(itemElement: any): void; - /** Unselects the specified item. */ - unselectItem(itemElement: any): void; - /** Expands the specified item. */ - expandItem(itemElement: any): void; - /** Collapses the specified item. */ - collapseItem(itemElement: any): void; - /** Returns all nodes of the tree view. */ - getNodes(): Array; - /** Selects all widget items. */ - selectAll(): void; - /** Unselects all widget items. */ - unselectAll(): void; - } - export interface dxMenuBaseOptions extends CollectionWidgetOptions { - /** An object that defines the animation options of the widget. */ - animation?: fx.AnimationOptions; - /** A Boolean value specifying whether or not the widget changes its state when interacting with a user. */ - activeStateEnabled?: boolean; - /** Specifies the name of the CSS class associated with the menu. */ - cssClass?: string; - /** Holds an array of menu items. */ - items?: Array; - /** Specifies whether or not an item becomes selected if an end-user clicks it. */ - selectionByClick?: boolean; - /** Specifies the selection mode supported by the menu. */ - selectionMode?: string; - /** Specifies the user interaction by which submenus are shown. */ - showSubmenuMode?: string; - /** A Boolean value specifying whether or not the widget changes its state when being hovered by an end user. */ - hoverStateEnabled?: boolean; - } - export class dxMenuBase extends CollectionWidget { - constructor(element: JQuery, options?: dxMenuBaseOptions); - constructor(element: Element, options?: dxMenuBaseOptions); - /** Selects the specified item. */ - selectItem(itemElement: any): void; - /** Unselects the specified item. */ - unselectItem(itemElement: any): void; - } - export interface dxMenuOptions extends dxMenuBaseOptions { - firstSubMenuDirection?: string; - /** Specifies whether the menu has horizontal or vertical orientation. */ - orientation?: string; - /** Specifies by which user interaction the first-level submenu is shown. */ - showFirstSubmenuMode?: string; - showPopupMode?: string; - /** Specifies the direction at which the submenus are displayed. */ - submenuDirection?: string; - /** A handler for the submenuHidden event. */ - onSubmenuHidden?: Function; - submenuHiddenAction?: Function; - /** A handler for the submenuHiding event. */ - onSubmenuHiding?: Function; - submenuHidingAction?: Function; - /** A handler for the submenuShowing event. */ - onSubmenuShowing?: Function; - submenuShowingAction?: Function; - /** A handler for the submenuShown event. */ - onSubmenuShown?: Function; - submenuShownAction?: Function; - } - /** A menu widget. */ - export class dxMenu extends dxMenuBase { - constructor(element: JQuery, options?: dxMenuOptions); - constructor(element: Element, options?: dxMenuOptions); - } - export interface dxContextMenuOptions extends dxMenuBaseOptions { - direction?: string; - hiddenAction?: Function; - hidingAction?: Function; - /** Specifies whether the context menu can be called only from code or by user interaction as well. */ - invokeOnlyFromCode?: boolean; - /** A handler for the hidden event. */ - onHidden?: Function; - /** A handler for the hiding event. */ - onHiding?: Function; - /** A handler for the positioning event. */ - onPositioning?: Function; - /** A handler for the showing event. */ - onShowing?: Function; - /** A handler for the shown event. */ - onShown?: Function; - /** An object defining widget positioning options. */ - position?: PositionOptions; - positioningAction?: Function; - showingAction?: Function; - shownAction?: Function; - /** Specifies the direction at which submenus are displayed. */ - submenuDirection?: string; - /** The target element associated with a popover. */ - target?: any; - /** A Boolean value specifying whether or not the widget is visible. */ - visible?: boolean; - } - /** A context menu widget. */ - export class dxContextMenu extends dxMenuBase { - constructor(element: JQuery, options?: dxContextMenuOptions); - constructor(element: Element, options?: dxContextMenuOptions); - /** Toggles the visibility of the widget. */ - toggle(showing: boolean): JQueryPromise; - /** Shows the widget. */ - show(): JQueryPromise; - /** Hides the widget. */ - hide(): JQueryPromise; - } - export interface dxRemoteOperations { - /** Specifies whether or not filtering must be performed on the server side. */ - filtering?: boolean; - /** Specifies whether or not paging must be performed on the server side. */ - paging?: boolean; - /** Specifies whether or not sorting must be performed on the server side. */ - sorting?: boolean; - } - export interface dxDataGridColumn { - /** Specifies the content alignment within column cells. */ - alignment?: string; - /** Specifies whether the values in a column can be edited at runtime. Setting this option makes sense only when editing is enabled for a grid. */ - allowEditing?: boolean; - /** Specifies whether or not a column can be used for filtering grid records. Setting this option makes sense only when the filter row or search panel is visible. */ - allowFiltering?: boolean; - /** Specifies whether a column can be used for grouping grid records at runtime. Setting this option makes sense only when the group panel is visible. */ - allowGrouping?: boolean; - /** Specifies whether or not a column can be hidden by a user. Setting this option makes sense only when the column chooser is visible. */ - allowHiding?: boolean; - /** Specifies whether or not a particular column can be used in column reordering. Setting this option makes sense only when the allowColumnReordering option is set to true. */ - allowReordering?: boolean; - /** Specifies whether or not a particular column can be resized by a user. Setting this option makes sense only when the allowColumnResizing option is true. */ - allowResizing?: boolean; - /** Specifies whether grid records can be sorted by a specific column at runtime. Setting this option makes sense only when the sorting mode differs from none. */ - allowSorting?: boolean; - /** Specifies whether groups appear expanded or not when records are grouped by a specific column. Setting this option makes sense only when grouping is allowed for this column. */ - autoExpandGroup?: boolean; - /** Specifies a callback function that returns a value to be displayed in a column cell. */ - calculateCellValue?: (rowData: Object) => string; - /** Specifies a callback function that defines filters for customary calculated grid cells. */ - calculateFilterExpression?: (filterValue: any, selectedFilterOperation: string) => Array; - /** Specifies a caption for a column. */ - caption?: string; - /** Specifies a custom template for grid column cells. */ - cellTemplate?: any; - /** Specifies a CSS class to be applied to a column. */ - cssClass?: string; - /** Specifies a callback function that determines grouping values. */ - calculateGroupValue?: (rowData: Object) => string; - /** Specifies a callback function that returns the text to be displayed in the cells of a column. */ - customizeText?: (cellInfo: { value: any; valueText: string }) => string; - /** Specifies the field of a data source that provides data for a column. */ - dataField?: string; - /** Specifies the required type of column values. */ - dataType?: string; - /** Specifies a custom template for the cell of a grid column when it is in an editing state. */ - editCellTemplate?: any; - /** Specifies whether HTML tags are displayed as plain text or applied to the values of the column. */ - encodeHtml?: boolean; - /** In a boolean column, replaces all false items with a specified text. */ - falseText?: string; - /** Specifies the set of available filter operations. */ - filterOperations?: Array; - /** Specifies a filter value for a column. */ - filterValue?: any; - /** Specifies a format for the values displayed in a column. */ - format?: string; - /** Specifies a custom template for the group cell of a grid column. */ - groupCellTemplate?: any; - /** Specifies the index of a column when grid records are grouped by the values of this column. */ - groupIndex?: number; - /** Specifies a custom template for the header of a grid column. */ - headerCellTemplate?: any; - /** Specifies options of a lookup column. */ - lookup?: { - /** Specifies whether or not a user can nullify values of a lookup column. */ - allowClearing?: boolean; - /** -Specifies the data source providing data for a lookup column. - */ - dataSource?: any; - /** Specifies the expression defining the data source field whose values must be displayed. */ - displayExpr?: any; - /** Specifies the expression defining the data source field whose values must be replaced. */ - valueExpr?: string; - }; - /** Specifies a precision for formatted values displayed in a column. */ - precision?: number; - /** Specifies a filter operation applied to a column. */ - selectedFilterOperation?: string; - /** Specifies whether or not the column displays its values by using editors. */ - showEditorAlways?: boolean; - /** Specifies whether or not to display the column when grid records are grouped by it. */ - showWhenGrouped?: boolean; - /** Specifies the index of a column when grid records are sorted by the values of this column. */ - sortIndex?: number; - /** Specifies the initial sort order of column values. */ - sortOrder?: string; - /** In a boolean column, replaces all true items with a specified text. */ - trueText?: string; - /** Specifies whether a column is visible or not. */ - visible?: boolean; - /** Specifies the sequence number of the column in the grid. */ - visibleIndex?: number; - /** Specifies a column width in pixels or percentages. */ - width?: any; - /** Specifies an array of validation rules to be checked when updating column cell values. */ - validationRules?: Array; - /** Specifies whether or not to display the header of a hidden column in the column chooser. */ - showInColumnChooser?: boolean; - /** Specifies the identifier of the column. */ - name?: string; - } - export interface dxDataGridOptions extends WidgetOptions { - /** Specifies whether the outer borders of the grid are visible or not. */ - showBorders?: boolean; - /** Indicates whether to show the error row for the grid. */ - errorRowEnabled?: boolean; - /** A handler for the rowValidating event. */ - onRowValidating?: (e: Object) => void; - initNewRow?: (e: { data: Object }) => void; - /** A handler for the initNewRow event. */ - onInitNewRow?: (e: { data: Object }) => void; - rowInserted?: (e: { data: Object; key: any }) => void; - /** A handler for the rowInserted event. */ - onRowInserted?: (e: { data: Object; key: any }) => void; - rowInserting?: (e: { data: Object; cancel: boolean }) => void; - /** A handler for the rowInserting event. */ - onRowInserting?: (e: { data: Object; cancel: boolean }) => void; - rowRemoved?: (e: { data: Object; key: any }) => void; - /** A handler for the rowRemoved event. */ - onRowRemoved?: (e: { data: Object; key: any }) => void; - rowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; - /** A handler for the rowRemoving event. */ - onRowRemoving?: (e: { data: Object; key: any; cancel: boolean }) => void; - rowUpdated?: (e: { data: Object; key: any }) => void; - /** A handler for the rowUpdated event. */ - onRowUpdated?: (e: { data: Object; key: any }) => void; - rowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; - /** A handler for the rowUpdating event. */ - onRowUpdating?: (e: { oldData: Object; newData: Object; key: any; cancel: boolean }) => void; - /** Enables a hint that appears when a user hovers the mouse pointer over a cell with truncated content. */ - cellHintEnabled?: boolean; - /** Specifies whether or not grid columns can be reordered by a user. */ - allowColumnReordering?: boolean; - /** Specifies whether or not grid columns can be resized by a user. */ - allowColumnResizing?: boolean; - cellClick?: any; - /** A handler for the cellClick event. */ - onCellClick?: any; - cellHoverChanged?: (e: Object) => void; - /** A handler for the cellHoverChanged event. */ - onCellHoverChanged?: (e: Object) => void; - cellPrepared?: (e: Object) => void; - /** A handler for the cellPrepared event. */ - onCellPrepared?: (e: Object) => void; - /** Specifies whether or not the width of grid columns depends on column content. */ - columnAutoWidth?: boolean; - /** Specifies the options of a column chooser. */ - columnChooser?: { - /** Specifies text displayed by the column chooser panel when it does not contain any columns. */ - emptyPanelText?: string; - /** Specifies whether a user can invoke the column chooser or not. */ - enabled?: boolean; - /** Specifies the height of the column chooser panel. */ - height?: number; - /** Specifies text displayed in the title of the column chooser panel. */ - title?: string; - /** Specifies the width of the column chooser panel. */ - width?: number; - }; - /** -An array of grid columns. - */ - columns?: Array; - onContentReady?: Function; - contentReadyAction?: Function; - /** Specifies a function that customizes grid columns after they are created. */ - customizeColumns?: (columns: Array) => void; - dataErrorOccurred?: (errorObject: Error) => void; - /** Specifies a data source for the grid. */ - dataSource?: any; - editingStart?: (e: { - data: Object; - key: any; - cancel: boolean; - column: dxDataGridColumn - }) => void; - /** A handler for the editingStart event. */ - onEditingStart?: (e: { - data: Object; - key: any; - cancel: boolean; - column: dxDataGridColumn - }) => void; - editorPrepared?: (e: Object) => void; - /** A handler for the editorPrepared event. */ - onEditorPrepared?: (e: Object) => void; - editorPreparing?: (e: Object) => void; - /** A handler for the editorPreparing event. */ - onEditorPreparing?: (e: Object) => void; - /** Contains options that specify how grid content can be changed. */ - editing?: { - /** Specifies whether or not grid records can be edited at runtime. */ - editEnabled?: boolean; - /** Specifies how grid values can be edited manually. */ - editMode?: string; - /** Specifies whether or not new records can be inserted into a grid. */ - insertEnabled?: boolean; - /** Specifies whether or not records can be deleted from a grid. */ - removeEnabled?: boolean; - /** Contains options that specify texts for editing-related grid controls. */ - texts?: { - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Save" button. Setting this option makes sense only when the editMode option is set to batch. */ - saveAllChanges?: string; - /** Specifies text for a cancel button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ - cancelRowChanges?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Revert" button. Setting this option makes sense only when the editMode option is set to batch. */ - cancelAllChanges?: string; - /** Specifies a message to be displayed by a confirmation window. Setting this option makes sense only when the edit mode is "row". */ - confirmDeleteMessage?: string; - /** Specifies text to be displayed in the title of a confirmation window. Setting this option makes sense only when the edit mode is "row". */ - confirmDeleteTitle?: string; - /** Specifies text for a button that deletes a row from a grid. Setting this option makes sense only when the removeEnabled option is set to true. */ - deleteRow?: string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the "Add" button. Setting this option makes sense only when the insertEnabled option is true. */ - addRow?: string; - /** Specifies text for a button that turns a row into the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ - editRow?: string; - /** - * Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the removeEnabled option is set to true. - * @deprecated Use the "undeleteRow" option instead. - */ - recoverRow?: string; - /** Specifies text for a save button displayed when a row is in the editing state. Setting this option makes sense only when the editEnabled option is set to true. */ - saveRowChanges?: string; - /** Specifies text for a button that recovers a deleted row. Setting this option makes sense only if the grid uses the batch edit mode and the removeEnabled option is set to true. */ - undeleteRow?: string; - }; - }; - /** Specifies filter row options. */ - filterRow?: { - /** Specifies when to apply a filter. */ - applyFilter?: string; - /** Specifies text for the hint that pops up when a user hovers the mouse pointer over the "Apply Filter" button. */ - applyFilterText?: string; - /** Specifies descriptions for filter operations. */ - operationDescriptions?: { - "=": string; - "<>": string; - "<": string; - "<=": string; - ">": string; - ">=": string; - "startswith": string; - "contains": string; - "notcontains": string; - "endswith": string; - }; - /** Specifies text for the reset operation in a filter list. */ - resetOperationText?: string; - /** Specifies text for the operation of clearing the applied filter when a select box is used. */ - showAllText?: string; - /** Specifies whether or not an icon that allows the user to choose a filter operation is visible. */ - showOperationChooser?: boolean; - /** Specifies whether the filter row is visible or not. */ - visible?: boolean; - }; - /** Specifies the behavior of grouped grid records. */ - grouping?: { - /** Specifies whether the user can collapse grouped records in a grid or not. */ - allowCollapsing?: boolean; - /** Specifies whether groups appear expanded or not. */ - autoExpandAll?: boolean; - /** Specifies the message displayed in a group row when the corresponding group is continued from the previous page. */ - groupContinuedMessage?: string; - /** -Specifies the message displayed in a group row when the corresponding group continues on the next page. - */ - groupContinuesMessage?: string; - }; - /** Specifies options that configure the group panel. */ - groupPanel?: { - /** Specifies whether columns can be dragged onto or from the group panel. */ - allowColumnDragging?: boolean; - /** Specifies text displayed by the group panel when it does not contain any columns. */ - emptyPanelText?: string; - /** Specifies whether the group panel is visible or not. */ - visible?: boolean; - }; - /** Specifies options configuring the load panel. */ - loadPanel?: { - /** Specifies whether to show the load panel or not. */ - enabled?: boolean; - /** Specifies the height of the load panel in pixels. */ - height?: number; - /** Specifies a URL pointing to an image to be used as a loading indicator. */ - indicatorSrc?: string; - /** Specifies whether or not a loading indicator must be displayed on the load panel. */ - showIndicator?: boolean; - /** Specifies whether or not the pane of the load panel must be displayed. */ - showPane?: boolean; - /** Specifies text displayed by the load panel. */ - text?: string; - /** Specifies the width of the load panel in pixels. */ - width?: number; - }; - /** Specifies text displayed when a grid does not contain any records. */ - noDataText?: string; - /** Specifies the options of a grid pager. */ - pager?: { - /** Specifies the page sizes that can be selected at runtime. */ - allowedPageSizes?: any; - /** Specifies whether to show the page size selector or not. */ - showPageSizeSelector?: boolean; - /** Specifies whether to show the pager or not. */ - visible?: any; - /** Specifies the text accompanying the page navigator. */ - infoText?: string; - /** Specifies whether or not to display the text accompanying the page navigator. This text is specified by the infoText option. */ - showInfo?: boolean; - /** Specifies whether or not to display buttons that switch the grid to the previous or next page. */ - showNavigationButtons?: boolean; - }; - /** Specifies paging options. */ - paging?: { - /** Specifies whether dxDataGrid loads data page by page or all at once. */ - enabled?: boolean; - /** Specifies the grid page that should be displayed by default. */ - pageIndex?: number; - /** Specifies the size of grid pages. */ - pageSize?: number; - }; - /** Specifies whether or not grid rows must be shaded in a different way. */ - rowAlternationEnabled?: boolean; - rowClick?: any; - /** A handler for the rowClick event. */ - onRowClick?: any; - rowPrepared?: (e: Object) => void; - /** A handler for the rowPrepared event. */ - onRowPrepared?: (e: Object) => void; - /** Specifies a custom template for grid rows. */ - rowTemplate?: any; - /** A configuration object specifying scrolling options. */ - scrolling?: { - /** Specifies the scrolling mode. */ - mode?: string; - /** Specifies whether or not a grid must preload pages adjacent to the current page when using virtual scrolling. */ - preloadEnabled?: boolean; - }; - /** Specifies options of the search panel. */ - searchPanel?: { - /** Specifies whether or not search strings in the located grid records should be highlighted. */ - highlightSearchText?: boolean; - /** Specifies text displayed by the search panel when no search string was typed. */ - placeholder?: string; - /** Specifies whether the search panel is visible or not. */ - visible?: boolean; - /** Specifies the width of the search panel in pixels. */ - width?: number; - /** Sets a search string for the search panel. */ - text?: string; - }; - /** Specifies the operations that must be performed on the server side. */ - remoteOperations?: any; - /** Allows you to sort groups according to the values of group summary items. */ - sortByGroupSummaryInfo?: Array<{ - /** Specifies the group summary item whose values must be used to sort groups. */ - summaryItem?: string; - /** Specifies the identifier of the column that must be used in grouping so that sorting by group summary item values be applied. */ - groupColumn?: string; - /** Specifies the sort order of group summary item values. */ - sortOrder?: string; - }>; - /** Allows you to build a master-detail interface in the grid. */ - masterDetail?: { - /** Enables an end-user to expand/collapse detail sections. */ - enabled?: boolean; - /** Specifies whether detail sections appear expanded or collapsed. */ - autoExpandAll?: boolean; - /** Specifies the template for detail sections. */ - template?: any; - }; - /** Specifies the keys of the records that must appear selected initially. */ - selectedRowKeys?: Array; - /** Specifies options of runtime selection. */ - selection?: { - /** Specifies whether the user can select all grid records at once. */ - allowSelectAll?: boolean; - /** Specifies the selection mode. */ - mode?: string; - }; - selectionChanged?: (e: { - currentSelectedRowKeys: Array; - currentDeselectedRowKeys: Array; - selectedRowKeys: Array; - selectedRowsData: Array; - }) => void; - /** A handler for the dataErrorOccured event. */ - onDataErrorOccurred?: (e: { error: Error }) => void; - /** A handler for the selectionChanged event. */ - onSelectionChanged?: (e: { - currentSelectedRowKeys: Array; - currentDeselectedRowKeys: Array; - selectedRowKeys: Array; - selectedRowsData: Array; - }) => void; - /** Specifies whether column headers are visible or not. */ - showColumnHeaders?: boolean; - /** Specifies whether or not vertical lines separating one grid column from another are visible. */ - showColumnLines?: boolean; - /** Specifies whether or not horizontal lines separating one grid row from another are visible. */ - showRowLines?: boolean; - /** Specifies options of runtime sorting. */ - sorting?: { - /** Specifies text for the context menu item that sets an ascending sort order in a column. */ - ascendingText?: string; - /** Specifies text for the context menu item that resets sorting settings for a column. */ - clearText?: string; - /** Specifies text for the context menu item that sets a descending sort order in a column. */ - descendingText?: string; - /** Specifies the runtime sorting mode. */ - mode?: string; - }; - /** Specifies options of state storing. */ - stateStoring?: { - /** Specifies a callback function that performs specific actions on state loading. */ - customLoad?: () => JQueryPromise; - /** Specifies a callback function that performs specific actions on state saving. */ - customSave?: (gridState: Object) => void; - /** Specifies whether or not a grid saves its state. */ - enabled?: boolean; - /** Specifies the delay between the last change of a grid state and the operation of saving this state in milliseconds. */ - savingTimeout?: number; - /** Specifies a unique key to be used for storing the grid state. */ - storageKey?: string; - /** Specifies the type of storage to be used for state storing. */ - type?: string; - }; - /** Specifies the options of the grid summary. */ - summary?: { - /** Contains options that specify text patterns for summary items. */ - texts?: { - /** Specifies a pattern for the 'sum' summary items when they are displayed in the parent column. */ - sum?: string; - /** Specifies a pattern for the 'sum' summary items displayed in a group row or in any other column rather than the parent one. */ - sumOtherColumn?: string; - /** Specifies a pattern for the 'min' summary items when they are displayed in the parent column. */ - min?: string; - /** Specifies a pattern for the 'min' summary items displayed in a group row or in any other column rather than the parent one. */ - minOtherColumn?: string; - /** Specifies a pattern for the 'max' summary items when they are displayed in the parent column. */ - max?: string; - /** Specifies a pattern for the 'max' summary items displayed in a group row or in any other column rather than the parent one. */ - maxOtherColumn?: string; - /** Specifies a pattern for the 'avg' summary items when they are displayed in the parent column. */ - avg?: string; - /** Specifies a pattern for the 'avg' summary items displayed in a group row or in any other column rather than the parent one. */ - avgOtherColumn?: string; - /** Specifies a pattern for the 'count' summary items. */ - count?: string; - }; - /** Specifies items of the group summary. */ - groupItems?: Array<{ - /** Specifies the identifier of a summary item. */ - name?: string; - /** Specifies the column that provides data for a group summary item. */ - column?: string; - /** Customizes the text to be displayed in the summary item. */ - customizeText?: (itemInfo: { - value: any; - valueText: string; - }) => string; - /** Specifies a pattern for the summary item text. */ - displayFormat?: string; - /** Specifies a precision for the summary item value of a numeric format. */ - precision?: number; - /** Specifies whether or not a summary item must be displayed in the group footer. */ - showInGroupFooter?: boolean; - /** Specifies the column that must hold the summary item when this item is displayed in the group footer. */ - showInColumn?: string; - /** Specifies how to aggregate data for a summary item. */ - summaryType?: string; - /** Specifies a format for the summary item value. */ - valueFormat?: string; - }>; - /** Specifies items of the total summary. */ - totalItems?: Array<{ - /** Specifies the identifier of a summary item. */ - name?: string; - /** Specifies the alignment of a summary item. */ - alignment?: string; - /** Specifies the column that provides data for a summary item. */ - column?: string; - /** Specifies a CSS class to be applied to a summary item. */ - cssClass?: string; - /** Customizes the text to be displayed in the summary item. */ - customizeText?: (itemInfo: { - value: any; - valueText: string; - }) => string; - /** Specifies a pattern for the summary item text. */ - displayFormat?: string; - /** Specifies a precision for the summary item value of a numeric format. */ - precision?: number; - /** Specifies the column that must hold the summary item. */ - showInColumn?: string; - /** Specifies how to aggregate data for a summary item. */ - summaryType?: string; - /** Specifies a format for the summary item value. */ - valueFormat?: string; - }>; - /** Allows you to use a custom aggregate function to calculate the value of a summary item. */ - calculateCustomSummary?: (options: { - component: dxDataGrid; - name?: string; - value: any; - totalValue: any; - summaryProcess: string - }) => void; - }; - /** Specifies whether text that does not fit into a column should be wrapped. */ - wordWrapEnabled?: boolean; - } - /** A data grid widget. */ - export class dxDataGrid extends Widget { - constructor(element: JQuery, options?: dxDataGridOptions); - constructor(element: Element, options?: dxDataGridOptions); - /** Ungroups grid records. */ - clearGrouping(): void; - /** Clears sorting settings of all grid columns at once. */ - clearSorting(): void; - /** Allows you to obtain a cell by its row index and the data field of its column. */ - getCellElement(rowIndex: number, dataField: string): any; - /** Allows you to obtain a cell by its row index and the visible index of its column. */ - getCellElement(rowIndex: number, visibleColumnIndex: number): any; - /** Returns the current state of the grid. */ - state(): Object; - /** Sets the grid state. */ - state(state: Object): void; - /** Allows you to obtain the row index by a data key. */ - getRowIndexByKey(key: any): number; - /** Allows you to obtain the data key by a row index. */ - getKeyByRowIndex(rowIndex: number): any; - /** Adds a new column to a grid. */ - addColumn(columnOptions: dxDataGridColumn): void; - /** Displays the load panel. */ - beginCustomLoading(messageText: string): void; - /** Discards changes made in a grid. */ - cancelEditData(): void; - /** Clears the filter applied to grid records from code. */ - clearFilter(): void; - /** Deselects all grid records. */ - clearSelection(): void; - /** Draws the cell being edited from the editing state. Use this method when the edit mode is batch. */ - closeEditCell(): void; - /** Collapses groups or master rows in a grid. */ - collapseAll(groupIndex?: number): void; - /** Returns the number of data columns in a grid. */ - columnCount(): number; - /** Returns the value of a specific column option. */ - columnOption(id: number, optionName: string): any; - /** Sets an option of a specific column. */ - columnOption(id: number, optionName: string, optionValue: any): void; - /** Returns the options of a column by an identifier. */ - columnOption(id: any): Object; - /** Sets several options of a column at once. */ - columnOption(id: any, options: Object): void; - /** Sets a specific cell into the editing state. */ - editCell(rowIndex: number, columnIndex: number): void; - /** Sets a specific row into the editing state. */ - editRow(rowIndex: number): void; - /** Hides the load panel. */ - endCustomLoading(): void; - /** Expands groups or master rows in a grid. */ - expandAll(groupIndex: number): void; - /** Allows you to find out whether a specific group or master row is expanded or collapsed. */ - isRowExpanded(key: any): boolean; - /** Allows you to expand a specific group or master row by its key. */ - expandRow(key: any): void; - /** Allows you to collapse a specific group or master row by its key. */ - collapseRow(key: any): void; - /** Applies a filter to grid records. */ - filter(filterExpr: Array): void; - /** Gets the keys of currently selected grid records. */ - getSelectedRowKeys(): Array; - /** Gets the data objects of currently selected grid records. */ - getSelectedRowsData(): Array; - /** Hides the column chooser panel. */ - hideColumnChooser(): void; - /** Adds a new data row to a grid. */ - insertRow(): void; - /** Returns the key corresponding to the passed data object. */ - keyOf(obj: Object): any; - /** Switches a grid to a specified page. */ - pageIndex(newIndex: number): void; - /** Gets the index of the current page. */ - pageIndex(): number; - /** Sets the page size. */ - pageSize(value: number): void; - /** Gets the current page size. */ - pageSize(): number; - /** - * Recovers a row deleted in the batch edit mode. - * @deprecated Use the "undeleteRow" method instead. - */ - recoverRow(rowIndex: number): void; - /** Refreshes grid data. */ - refresh(): void; - /** Removes a specific row from a grid. */ - removeRow(rowIndex: number): void; - /** Saves changes made in a grid. */ - saveEditData(): void; - /** -Searches grid records by a search string. - */ - searchByText(text: string): void; - /** Selects all grid records. */ - selectAll(): void; - deselectAll(): void; - /** Selects specific grid records. */ - selectRows(keys: Array, preserve: boolean): void; - /** Deselects specific grid records. */ - deselectRows(keys: Array): void; - /** Selects grid rows by indexes. */ - selectRowsByIndexes(indexes: Array): void; - /** Allows you to find out whether a row is selected or not. */ - isRowSelected(key: any): boolean; - /** Invokes the column chooser panel. */ - showColumnChooser(): void; - startSelectionWithCheckboxes(): boolean; - /** Returns the number of records currently held by a grid. */ - totalCount(): number; - /** Recovers a row deleted in the batch edit mode. */ - undeleteRow(rowIndex: number): void; - /** Allows you to obtain a data object by its key. */ - byKey(key: any): JQueryPromise; - /** Gets the value of a total summary item. */ - getTotalSummaryValue(summaryItemName: string): any; - } -} -declare module DevExpress.viz.charts { - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface BaseSeries { - /** Provides information about the state of the series object. */ - fullState: number; - /** Returns the type of the series. */ - type: string; - /** Unselects all the selected points of the series. The points are displayed in an initial style. */ - clearSelection(): void; - /** - * Gets a point from the series point collection based on the specified argument. - * @deprecated getPointsByArg(pointArg).md - */ - getPointByArg(pointArg: any): Object; - /** Gets points from the series point collection based on the specified argument. */ - getPointsByArg(pointArg: any): Array; - /** Gets a point from the series point collection based on the specified point position. */ - getPointByPos(positionIndex: number): Object; - /** Selects the series. The series is displayed in a 'selected' style until another series is selected or the current series is deselected programmatically. */ - select(): void; - /** Selects the specified point. The point is displayed in a 'selected' style. */ - selectPoint(point: BasePoint): void; - /** Deselects the specified point. The point is displayed in an initial style. */ - deselectPoint(point: BasePoint): void; - /** Returns an array of all points in the series. */ - getAllPoints(): Array; - /** Returns visible series points. */ - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface BasePoint { - /** Provides information about the state of the point object. */ - fullState: number; - /** Returns the point's argument value that was set in the data source. */ - originalArgument: any; - /** Returns the point's value that was set in the data source. */ - originalValue: any; - /** Returns the tag of the point. */ - tag: string; - /** Deselects the point. */ - clearSelection(): void; - /** Gets the color of a particular point. */ - getColor(): string; - /** Hides the tooltip of the point. */ - hideTooltip(): void; - /** Provides information about the hover state of a point. */ - isHovered(): any; - /** Provides information about the selection state of a point. */ - isSelected(): any; - /** Selects the point. The point is displayed in a 'selected' style until another point is selected or the current point is deselected programmatically. */ - select(): void; - /** Shows the tooltip of the point. */ - showTooltip(): void; - /** Allows you to obtain the label of a series point. */ - getLabel(): any; - /** Returns the series object to which the point belongs. */ - series: BaseSeries; - } - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface ChartSeries extends BaseSeries { - /** Returns the name of the series pane. */ - pane: string; - /** Returns the name of the value axis of the series. */ - axis: string; - /** Returns the name of the series. */ - name: string; - /** Returns the tag of the series. */ - tag: string; - /** Hides a particular series. */ - hide(): void; - /** Provides information about the hover state of a series. */ - isHovered(): any; - /** Provides information about the selection state of a series. */ - isSelected(): any; - /** Provides information about the visibility state of a series. */ - isVisible(): boolean; - /** Makes a particular series visible. */ - show(): void; - selectPoint(point: ChartPoint): void; - deselectPoint(point: ChartPoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface ChartPoint extends BasePoint { - /** Contains the close value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalCloseValue: any; - /** Contains the high value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalHighValue: any; - /** Contains the low value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalLowValue: any; - /** Contains the first value of the point. This field is useful for points belonging to a series of the range area or range bar type only. */ - originalMinValue: any; - /** Contains the open value of the point. This field is useful for points belonging to a series of the candle stick or stock type only. */ - originalOpenValue: any; - /** Contains the size of the bubble as it was set in the data source. This field is useful for points belonging to a series of the bubble type only. */ - size: any; - /** Gets the parameters of the point's minimum bounding rectangle (MBR). */ - getBoundingRect(): { x: number; y: number; width: number; height: number; }; - series: ChartSeries; - } - /** This section describes the methods that can be used in code to manipulate the Label object. */ - export interface Label { - /** Gets the parameters of the label's minimum bounding rectangle (MBR). */ - getBoundingRect(): { x: number; y: number; width: number; height: number; }; - /** Hides the point label. */ - hide(): void; - /** Shows the point label. */ - show(): void; - } - export interface PieSeries extends BaseSeries { - selectPoint(point: PiePoint): void; - deselectPoint(point: PiePoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface PiePoint extends BasePoint { - /** Gets the percentage value of the specific point. */ - percent: any; - /** Provides information about the visibility state of a point. */ - isVisible(): boolean; - /** Makes a specific point visible. */ - show(): void; - /** Hides a specific point. */ - hide(): void; - series: PieSeries; - } - /** This section describes the fields and methods that can be used in code to manipulate the Series object. */ - export interface PolarSeries extends BaseSeries { - /** Returns the name of the value axis of the series. */ - axis: string; - /** Returns the name of the series. */ - name: string; - /** Returns the tag of the series. */ - tag: string; - /** Hides a particular series. */ - hide(): void; - /** Provides information about the hover state of a series. */ - isHovered(): any; - /** Provides information about the selection state of a series. */ - isSelected(): any; - /** Provides information about the visibility state of a series. */ - isVisible(): boolean; - /** Makes a particular series visible. */ - show(): void; - selectPoint(point: PolarPoint): void; - deselectPoint(point: PolarPoint): void; - getAllPoints(): Array; - getVisiblePoints(): Array; - } - /** This section describes the methods that can be used in code to manipulate the Point object. */ - export interface PolarPoint extends BasePoint { - series: PolarSeries; - } - export interface Strip { - /** Specifies a color for a strip. */ - color?: string; - /** An object that defines the label configuration options of a strip. */ - label?: { - /** Specifies the text displayed in a strip. */ - text?: string; - }; - /** Specifies a start value for a strip. */ - startValue?: any; - /** Specifies an end value for a strip. */ - endValue?: any; - } - export interface BaseSeriesConfigLabel { - /** Specifies a format for arguments displayed by point labels. */ - argumentFormat?: string; - /** Specifies a precision for formatted point arguments displayed in point labels. */ - argumentPrecision?: number; - /** Specifies a background color for point labels. */ - backgroundColor?: string; - /** Specifies border options for point labels. */ - border?: viz.core.DashedBorder; - /** Specifies connector options for series point labels. */ - connector?: { - /** Specifies the color of label connectors. */ - color?: string; - /** Indicates whether or not label connectors are visible. */ - visible?: boolean; - /** Specifies the width of label connectors. */ - width?: number; - }; - /** Specifies a callback function that returns the text to be displayed by point labels. */ - customizeText?: (pointInfo: Object) => string; - /** Specifies font options for the text displayed in point labels. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed by point labels. */ - format?: string; - position?: string; - /** Specifies a precision for formatted point values displayed in point labels. */ - precision?: number; - /** Specifies the angle used to rotate point labels from their initial position. */ - rotationAngle?: number; - /** Specifies the visibility of point labels. */ - visible?: boolean; - } - export interface SeriesConfigLabel extends BaseSeriesConfigLabel { - /** Specifies whether or not to show a label when the point has a zero value. */ - showForZeroValues?: boolean; - } - export interface ChartSeriesConfigLabel extends SeriesConfigLabel { - /** Specifies how to align point labels relative to the corresponding data points that they represent. */ - alignment?: string; - /** Specifies how to shift point labels horizontally from their initial positions. */ - horizontalOffset?: number; - /** Specifies how to shift point labels vertically from their initial positions. */ - verticalOffset?: number; - /** Specifies a precision for the percentage values displayed in the labels of a full-stacked-like series. */ - percentPrecision?: number; - } - export interface BaseCommonSeriesConfig { - /** Specifies the data source field that provides arguments for series points. */ - argumentField?: string; - axis?: string; - /** An object defining the label configuration options for a series in the dxChart widget. */ - label?: ChartSeriesConfigLabel; - /** Specifies border options for point labels. */ - border?: viz.core.DashedBorder; - /** Specifies a series color. */ - color?: string; - /** Specifies the dash style of the series' line. */ - dashStyle?: string; - hoverMode?: string; - /** An object defining configuration options for a hovered series. */ - hoverStyle?: { - /** An object defining the border options for a hovered series. */ - border?: viz.core.DashedBorder; - /**

Sets a color for a series when it is hovered over.

*/ - color?: string; - /** Specifies the dash style for the line in a hovered series. */ - dashStyle?: string; - /** Specifies the hatching options to be applied when a series is hovered over. */ - hatching?: viz.core.Hatching; - /** Specifies the width of a line in a hovered series. */ - width?: number; - }; - /** Specifies whether a chart ignores null data points or not. */ - ignoreEmptyPoints?: boolean; - /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ - maxLabelCount?: number; - /** Specifies the minimal length of a displayed bar in pixels. */ - minBarSize?: number; - /** Specifies opacity for a series. */ - opacity?: number; - /** Specifies the series elements to highlight when the series is selected. */ - selectionMode?: string; - /** An object defining configuration options for a selected series. */ - selectionStyle?: { - /** An object defining the border options for a selected series. */ - border?: viz.core.DashedBorder; - /** Sets a color for a series when it is selected. */ - color?: string; - /** Specifies the dash style for the line in a selected series. */ - dashStyle?: string; - /** Specifies the hatching options to be applied when a series is selected. */ - hatching?: viz.core.Hatching; - /** Specifies the width of a line in a selected series. */ - width?: number; - }; - /** Specifies whether or not to show the series in the chart's legend. */ - showInLegend?: boolean; - /** Specifies the name of the stack where the values of the _stackedBar_ series must be located. */ - stack?: string; - /** Specifies the name of the data source field that provides data about a point. */ - tagField?: string; - /** Specifies the data source field that provides values for series points. */ - valueField?: string; - /** Specifies the visibility of a series. */ - visible?: boolean; - /** Specifies a line width. */ - width?: number; - /** Configures error bars. */ - valueErrorBar?: { - /** Specifies whether error bars must be displayed in full or partially. */ - displayMode?: string; - /** Specifies the data field that provides data for low error values. */ - lowValueField?: string; - /** Specifies the data field that provides data for high error values. */ - highValueField?: string; - /** Specifies how error bar values must be calculated. */ - type?: string; - /** Specifies the value to be used for generating error bars. */ - value?: number; - /** Specifies the color of error bars. */ - color?: string; - /** Specifies the opacity of error bars. */ - opacity?: number; - /** Specifies the length of the lines that indicate the error bar edges. */ - edgeLength?: number; - /** Specifies the width of the error bar line. */ - lineWidth?: number; - }; - } - export interface CommonPointOptions { - /** Specifies border options for points in the line and area series. */ - border?: viz.core.Border; - /** Specifies the points color. */ - color?: string; - /** Specifies what series points to highlight when a point is hovered over. */ - hoverMode?: string; - /** An object defining configuration options for a hovered point. */ - hoverStyle?: { - /** An object defining the border options for a hovered point. */ - border?: viz.core.Border; - /** Sets a color for a point when it is hovered over. */ - color?: string; - /** Specifies the diameter of a hovered point in the series that represents data points as symbols (not as bars for instance). */ - size?: number; - }; - /** Specifies what series points to highlight when a point is selected. */ - selectionMode?: string; - /** An object defining configuration options for a selected point. */ - selectionStyle?: { - /** An object defining the border options for a selected point. */ - border?: viz.core.Border; - /**

Sets a color for a point when it is selected.

*/ - color?: string; - /** Specifies the diameter of a selected point in the series that represents data points as symbols (not as bars for instance). */ - size?: number; - }; - /** Specifies the point diameter in pixels for those series that represent data points as symbols (not as bars for instance). */ - size?: number; - /** Specifies a symbol for presenting points of the line and area series. */ - symbol?: string; - visible?: boolean; - } - export interface ChartCommonPointOptions extends CommonPointOptions { - /** An object specifying the parameters of an image that is used as a point marker. */ - image?: { - /** Specifies the height of an image that is used as a point marker. */ - height?: any; - /** Specifies a URL leading to the image to be used as a point marker. */ - url?: any; - /** Specifies the width of an image that is used as a point marker. */ - width?: any; - }; - } - export interface PolarCommonPointOptions extends CommonPointOptions { - /** An object specifying the parameters of an image that is used as a point marker. */ - image?: { - /** Specifies the height of an image that is used as a point marker. */ - height?: number; - /** Specifies a URL leading to the image to be used as a point marker. */ - url?: string; - /** Specifies the width of an image that is used as a point marker. */ - width?: number; - }; - } - /** An object that defines configuration options for chart series. */ - export interface CommonSeriesConfig extends BaseCommonSeriesConfig { - /** Specifies the data source field that provides a 'close' value for a _candleStick_ or _stock_ series. */ - closeValueField?: string; - /** Specifies a radius for bar corners. */ - cornerRadius?: number; - /** Specifies the data source field that provides a 'high' value for a _candleStick_ or _stock_ series. */ - highValueField?: string; - /** Specifies the color for the body (rectangle) of a _candleStick_ series. */ - innerColor?: string; - /** Specifies the data source field that provides a 'low' value for a _candleStick_ or _stock_ series. */ - lowValueField?: string; - /** Specifies the data source field that provides an 'open' value for a _candleStick_ or _stock_ series. */ - openValueField?: string; - /** Specifies the pane that will be used to display a series. */ - pane?: string; - /** An object defining configuration options for points in line-, scatter- and area-like series. */ - point?: ChartCommonPointOptions; - /** Specifies the data source field that provides values for one end of a range series. To set the data source field for the other end of the range series, use the rangeValue2Field property. */ - rangeValue1Field?: string; - /** Specifies the data source field that provides values for the second end of a range series. To set the data source field for the other end of the range series, use the rangeValue1Field property. */ - rangeValue2Field?: string; - /** Specifies reduction options for the stock or candleStick series. */ - reduction?: { - /** Specifies a color for the points whose reduction level price is lower in comparison to the value in the previous point. */ - color?: string; - /** Specifies for which price level (open, high, low or close) to enable reduction options in the series. */ - level?: string; - }; - /** Specifies the data source field that defines the size of bubbles. */ - sizeField?: string; - } - export interface CommonSeriesSettings extends CommonSeriesConfig { - /**

An object that specifies configuration options for all series of the area type in the chart.

*/ - area?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ - bar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the bubble type in the chart. */ - bubble?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _candleStick_ type in the chart. */ - candlestick?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _fullStackedArea_ type in the chart. */ - fullstackedarea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Full-Stacked Spline Area type in the chart. */ - fullstackedsplinearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _fullStackedBar_ type in the chart. */ - fullstackedbar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _fullStackedLine_ type in the chart. */ - fullstackedline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Full-Stacked Spline type in the chart. */ - fullstackedspline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _line_ type in the chart. */ - line?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _rangeArea_ type in the chart. */ - rangearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _rangeBar_ type in the chart. */ - rangebar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ - scatter?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _spline_ type in the chart. */ - spline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _splineArea_ type in the chart. */ - splinearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedArea_ type in the chart. */ - stackedarea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Stacked Spline Area type in the chart. */ - stackedsplinearea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ - stackedbar?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedLine_ type in the chart. */ - stackedline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the Stacked Spline type in the chart. */ - stackedspline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stepArea_ type in the chart. */ - steparea?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stepLine_ type in the chart. */ - stepline?: CommonSeriesConfig; - /** An object that specifies configuration options for all series of the _stock_ type in the chart. */ - stock?: CommonSeriesConfig; - /** Sets a series type. */ - type?: string; - } - export interface SeriesConfig extends CommonSeriesConfig { - /** Specifies the name that identifies the series. */ - name?: string; - /** Specifies data about a series. */ - tag?: any; - /** Sets the series type. */ - type?: string; - } - /** An object that defines configuration options for polar chart series. */ - export interface CommonPolarSeriesConfig extends BaseCommonSeriesConfig { - /** Specifies whether or not to close the chart by joining the end point with the first point. */ - closed?: boolean; - label?: SeriesConfigLabel; - point?: PolarCommonPointOptions; - } - export interface CommonPolarSeriesSettings extends CommonPolarSeriesConfig { - /** An object that specifies configuration options for all series of the area type in the chart. */ - area?: CommonPolarSeriesConfig; - /** An object that specifies configuration options for all series of the _bar_ type in the chart. */ - bar?: CommonPolarSeriesConfig; - /** An object that specifies configuration options for all series of the _line_ type in the chart. */ - line?: CommonPolarSeriesConfig; - /** An object that specifies configuration options for all series of the _scatter_ type in the chart. */ - scatter?: CommonPolarSeriesConfig; - /** An object that specifies configuration options for all series of the _stackedBar_ type in the chart. */ - stackedbar?: CommonPolarSeriesConfig; - /** Sets a series type. */ - type?: string; - } - export interface PolarSeriesConfig extends CommonPolarSeriesConfig { - /** Specifies the name that identifies the series. */ - name?: string; - /** Specifies data about a series. */ - tag?: any; - /** Sets the series type. */ - type?: string; - } - export interface PieSeriesConfigLabel extends BaseSeriesConfigLabel { - /** Specifies how to shift labels from their initial position in a radial direction in pixels. */ - radialOffset?: number; - /** Specifies a precision for the percentage values displayed in labels. */ - percentPrecision?: number; - } - /** An object that defines configuration options for chart series. */ - export interface CommonPieSeriesConfig { - /** Specifies the data source field that provides arguments for series points. */ - argumentField?: string; - /** Specifies the required type for series arguments. */ - argumentType?: string; - /** An object defining the series border configuration options. */ - border?: viz.core.DashedBorder; - /** Specifies a series color. */ - color?: string; - /** Specifies the chart elements to highlight when a series is hovered over. */ - hoverMode?: string; - /** An object defining configuration options for a hovered series. */ - hoverStyle?: { - /** An object defining the border options for a hovered series. */ - border?: viz.core.DashedBorder; - /** Sets a color for the series when it is hovered over. */ - color?: string; - /** Specifies the hatching options to be applied when a point is hovered over. */ - hatching?: viz.core.Hatching; - }; - /** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. */ - innerRadius?: number; - /** An object defining the label configuration options. */ - label?: PieSeriesConfigLabel; - /** Specifies how many points are acceptable to be in a series to display all labels for these points. Otherwise, the labels will not be displayed. */ - maxLabelCount?: number; - /** Specifies a minimal size of a displayed pie segment. */ - minSegmentSize?: number; - /** Specifies the direction in which the dxPieChart's series points are located. */ - segmentsDirection?: string; - /**

Specifies the chart elements to highlight when the series is selected.

*/ - selectionMode?: string; - /** An object defining configuration options for the series when it is selected. */ - selectionStyle?: { - /** An object defining the border options for a selected series. */ - border?: viz.core.DashedBorder; - /** Sets a color for a series when it is selected. */ - color?: string; - /** Specifies the hatching options to be applied when a point is selected. */ - hatching?: viz.core.Hatching; - }; - /** Specifies chart segment grouping options. */ - smallValuesGrouping?: { - /** Specifies the name of the grouped chart segment. This name represents the segment in the chart legend. */ - groupName?: string; - /** Specifies the segment grouping mode. */ - mode?: string; - /** Specifies a threshold for segment values. */ - threshold?: number; - /** Specifies how many segments must not be grouped. */ - topCount?: number; - }; - /** Specifies a start angle for a pie chart in arc degrees. */ - startAngle?: number; - /**

Specifies the name of the data source field that provides data about a point.

*/ - tagField?: string; - /** Specifies the data source field that provides values for series points. */ - valueField?: string; - } - export interface PieSeriesConfig extends CommonPieSeriesConfig { - /** Sets the series type. */ - type?: string; - } - export interface SeriesTemplate { - /** Specifies a callback function that returns a series object with individual series settings. */ - customizeSeries?: (seriesName: string) => SeriesConfig; - /** Specifies a data source field that represents the series name. */ - nameField?: string; - } - export interface PolarSeriesTemplate { - /** Specifies a callback function that returns a series object with individual series settings. */ - customizeSeries?: (seriesName: string) => PolarSeriesConfig; - /** Specifies a data source field that represents the series name. */ - nameField?: string; - } - export interface ChartCommonConstantLineLabel { - /** Specifies font options for a constant line label. */ - font?: viz.core.Font; - /** Specifies the position of the constant line label relative to the chart plot. */ - position?: string; - /** Indicates whether or not to display labels for the axis constant lines. */ - visible?: boolean; - } - export interface PolarCommonConstantLineLabel { - /** Indicates whether or not to display labels for the axis constant lines. */ - visible?: boolean; - /** Specifies font options for a constant line label. */ - font?: viz.core.Font; - } - export interface ConstantLineStyle { - /** Specifies a color for a constant line. */ - color?: string; - /** Specifies a dash style for a constant line. */ - dashStyle?: string; - /** Specifies a constant line width in pixels. */ - width?: number; - } - export interface ChartCommonConstantLineStyle extends ConstantLineStyle { - /** An object defining constant line label options. */ - label?: ChartCommonConstantLineLabel; - /** Specifies the space between the constant line label and the left/right side of the constant line. */ - paddingLeftRight?: number; - /** Specifies the space between the constant line label and the top/bottom side of the constant line. */ - paddingTopBottom?: number; - } - export interface PolarCommonConstantLineStyle extends ConstantLineStyle { - /** An object defining constant line label options. */ - label?: PolarCommonConstantLineLabel; - } - export interface CommonAxisLabel { - /** Specifies font options for axis labels. */ - font?: viz.core.Font; - /** Specifies the spacing between an axis and its labels in pixels. */ - indentFromAxis?: number; - /** Indicates whether or not axis labels are visible. */ - visible?: boolean; - } - export interface ChartCommonAxisLabel extends CommonAxisLabel { - /** Specifies the label's position relative to the tick (grid line). */ - alignment?: string; - /** Specifies the overlap resolving algorithm to be applied to axis labels. */ - overlappingBehavior?: { - /** Specifies how to arrange axis labels. */ - mode?: string; - /** Specifies the angle used to rotate axis labels. */ - rotationAngle?: number; - /** Specifies the spacing that must be set between staggered rows when the 'stagger' algorithm is applied. */ - staggeringSpacing?: number; - }; - } - export interface PolarCommonAxisLabel extends CommonAxisLabel { - /** Specifies the overlap resolving algorithm to be applied to axis labels. */ - overlappingBehavior?: string; - } - export interface CommonAxisTitle { - /** Specifies font options for an axis title. */ - font?: viz.core.Font; - /** Specifies a margin for an axis title in pixels. */ - margin?: number; - } - export interface BaseCommonAxisSettings { - /** Specifies the color of the line that represents an axis. */ - color?: string; - /** Specifies whether ticks/grid lines of a discrete axis are located between labels or cross the labels. */ - discreteAxisDivisionMode?: string; - /** An object defining the configuration options for the grid lines of an axis in the dxPolarChart widget. */ - grid?: { - /** Specifies a color for grid lines. */ - color?: string; - /** Specifies an opacity for grid lines. */ - opacity?: number; - /** Indicates whether or not the grid lines of an axis are visible. */ - visible?: boolean; - /** Specifies the width of grid lines. */ - width?: number; - }; - /** Specifies the options of the minor grid. */ - minorGrid?: { - /** Specifies a color for the lines of the minor grid. */ - color?: string; - /** Specifies an opacity for the lines of the minor grid. */ - opacity?: number; - /** Indicates whether the minor grid is visible or not. */ - visible?: boolean; - /** Specifies a width for the lines of the minor grid. */ - width?: number; - }; - /** Indicates whether or not an axis is inverted. */ - inverted?: boolean; - /** Specifies the opacity of the line that represents an axis. */ - opacity?: number; - /** Indicates whether or not to set ticks/grid lines of a continuous axis of the 'date-time' type at the beginning of each date-time interval. */ - setTicksAtUnitBeginning?: boolean; - /** An object defining the configuration options for axis ticks. */ - tick?: { - /** Specifies ticks color. */ - color?: string; - /** Specifies tick opacity. */ - opacity?: number; - /** Indicates whether or not ticks are visible on an axis. */ - visible?: boolean; - }; - /** Specifies the options of the minor ticks. */ - minorTick?: { - /** Specifies a color for the minor ticks. */ - color?: string; - /** Specifies an opacity for the minor ticks. */ - opacity?: number; - /** Indicates whether or not the minor ticks are displayed on an axis. */ - visible?: boolean; - }; - /** Indicates whether or not the line that represents an axis in a chart is visible. */ - visible?: boolean; - /** Specifies the width of the line that represents an axis in the chart. */ - width?: number; - } - export interface ChartCommonAxisSettings extends BaseCommonAxisSettings { - /** Specifies the appearance of all the widget's constant lines. */ - constantLineStyle?: ChartCommonConstantLineStyle; - /** An object defining the label configuration options that are common for all axes in the dxChart widget. */ - label?: ChartCommonAxisLabel; - /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ - maxValueMargin?: number; - /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ - minValueMargin?: number; - /** Specifies, in pixels, the space reserved for an axis. */ - placeholderSize?: number; - /** An object defining configuration options for strip style. */ - stripStyle?: { - /** An object defining the configuration options for a strip label style. */ - label?: { - /** Specifies font options for a strip label. */ - font?: viz.core.Font; - /** Specifies the label's position on a strip. */ - horizontalAlignment?: string; - /** Specifies a label's position on a strip. */ - verticalAlignment?: string; - }; - /** Specifies the spacing, in pixels, between the left/right strip border and the strip label. */ - paddingLeftRight?: number; - /** Specifies the spacing, in pixels, between the top/bottom strip borders and the strip label. */ - paddingTopBottom?: number; - }; - /** An object defining the title configuration options that are common for all axes in the dxChart widget. */ - title?: CommonAxisTitle; - /** Indicates whether or not to display series with indents from axis boundaries. */ - valueMarginsEnabled?: boolean; - } - export interface PolarCommonAxisSettings extends BaseCommonAxisSettings { - /** Specifies the appearance of all the widget's constant lines. */ - constantLineStyle?: PolarCommonConstantLineStyle; - /** An object defining the label configuration options that are common for all axes in the dxPolarChart widget. */ - label?: PolarCommonAxisLabel; - /** An object defining configuration options for strip style. */ - stripStyle?: { - /** An object defining the configuration options for a strip label style. */ - label?: { - /** Specifies font options for a strip label. */ - font?: viz.core.Font; - }; - }; - } - export interface ChartConstantLineLabel extends ChartCommonConstantLineLabel { - /** Specifies the horizontal alignment of a constant line label. */ - horizontalAlignment?: string; - /** Specifies the vertical alignment of a constant line label. */ - verticalAlignment?: string; - /** Specifies the text to be displayed in a constant line label. */ - text?: string; - } - export interface PolarConstantLineLabel extends PolarCommonConstantLineLabel { - /** Specifies the text to be displayed in a constant line label. */ - text?: string; - } - export interface AxisLabel { - /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a label on the value axis. */ - customizeHint?: (argument: { value: any; valueText: string }) => string; - /** Specifies a callback function that returns the text to be displayed in value axis labels. */ - customizeText?: (argument: { value: any; valueText: string }) => string; - /** Specifies a format for the text displayed by axis labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the axis labels. */ - precision?: number; - } - export interface ChartAxisLabel extends ChartCommonAxisLabel, AxisLabel { } - export interface PolarAxisLabel extends PolarCommonAxisLabel, AxisLabel { } - export interface AxisTitle extends CommonAxisTitle { - /** Specifies the text for the value axis title. */ - text?: string; - } - export interface ChartConstantLineStyle extends ChartCommonConstantLineStyle { - /** An object defining constant line label options. */ - label?: ChartConstantLineLabel; - } - export interface ChartConstantLine extends ChartConstantLineStyle { - /** An object defining constant line label options. */ - label?: ChartConstantLineLabel; - /** Specifies a value to be displayed by a constant line. */ - value?: any; - } - export interface PolarConstantLine extends PolarCommonConstantLineStyle { - /** An object defining constant line label options. */ - label?: PolarConstantLineLabel; - /** Specifies a value to be displayed by a constant line. */ - value?: any; - } - export interface Axis { - /** Specifies a coefficient for dividing the value axis. */ - axisDivisionFactor?: number; - /** Specifies the order in which discrete values are arranged on the value axis. */ - categories?: Array; - /** Specifies the value to be raised to a power when generating ticks for a logarithmic axis. */ - logarithmBase?: number; - /** Specifies an interval between axis ticks/grid lines. */ - tickInterval?: any; - /** Specifies the interval between minor ticks. */ - minorTickInterval?: any; - /** Specifies the number of minor ticks between two neighboring major ticks. */ - minorTickCount?: number; - /** Specifies the required type of the value axis. */ - type?: string; - /** Specifies the pane on which the current value axis will be displayed. */ - pane?: string; - /** Specifies options for value axis strips. */ - strips?: Array; - } - export interface ChartAxis extends ChartCommonAxisSettings, Axis { - /** Defines an array of the value axis constant lines. */ - constantLines?: Array; - /** Specifies the appearance options for the constant lines of the value axis. */ - constantLineStyle?: ChartCommonConstantLineStyle; - /** Specifies options for value axis labels. */ - label?: ChartAxisLabel; - /** Specifies the maximum value on the value axis. */ - max?: any; - /** Specifies the minimum value on the value axis. */ - min?: any; - /** Specifies the position of the value axis on a chart. */ - position?: string; - /** Specifies the title for a value axis. */ - title?: AxisTitle; - } - export interface PolarAxis extends PolarCommonAxisSettings, Axis { - /** Defines an array of the value axis constant lines. */ - constantLines?: Array; - /** Specifies options for value axis labels. */ - label?: PolarAxisLabel; - } - export interface ArgumentAxis { - /** Specifies the desired type of axis values. */ - argumentType?: string; - /** Specifies the elements that will be highlighted when the argument axis is hovered over. */ - hoverMode?: string; - } - export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { } - export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis { - /** Specifies a start angle for the argument axis in degrees. */ - startAngle?: number; - /** Specifies whether or not to display the first point at the angle specified by the startAngle option. */ - firstPointOnStartAngle?: boolean; - /** Specifies the period of the argument values in the data source. */ - period?: number; - } - export interface ValueAxis { - /** Specifies the name of the value axis. */ - name?: string; - /** Specifies whether or not to indicate a zero value on the value axis. */ - showZero?: boolean; - /** Specifies the desired type of axis values. */ - valueType?: string; - } - export interface ChartValueAxis extends ChartAxis, ValueAxis { - /** Specifies the spacing, in pixels, between multiple value axes in a chart. */ - multipleAxesSpacing?: number; - /** Specifies the value by which the chart's value axes are synchronized. */ - synchronizedValue?: number; - } - export interface PolarValueAxis extends PolarAxis, ValueAxis { - /** Indicates whether to display series with indents from axis boundaries. */ - valueMarginsEnabled?: boolean; - /** Specifies a coefficient that determines the spacing between the maximum series point and the axis. */ - maxValueMargin?: number; - /** Specifies a coefficient that determines the spacing between the minimum series point and the axis. */ - minValueMargin?: number; - tick?: { - visible?: boolean; - } - } - export interface CommonPane { - /** Specifies a background color in a pane. */ - backgroundColor?: string; - /** Specifies the border options of a chart's pane. */ - border?: PaneBorder; - } - export interface Pane extends CommonPane { - /** Specifies the name of a pane. */ - name?: string; - } - export interface PaneBorder extends viz.core.DashedBorderWithOpacity { - /** Specifies the bottom border's visibility state in a pane. */ - bottom?: boolean; - /** Specifies the left border's visibility state in a pane. */ - left?: boolean; - /** Specifies the right border's visibility state in a pane. */ - right?: boolean; - /** Specifies the top border's visibility state in a pane. */ - top?: boolean; - } - export interface ChartAnimation extends viz.core.Animation { - /** Specifies the maximum series point count in the chart that the animation supports. */ - maxPointCountSupported?: number; - } - export interface BaseChartTooltip extends viz.core.Tooltip { - /** Specifies a format for arguments of the chart's series points. */ - argumentFormat?: string; - /** Specifies a precision for formatted arguments displayed in tooltips. */ - argumentPrecision?: number; - /** Specifies a precision for a percent value displayed in tooltips for stacked series and dxPieChart series. */ - percentPrecision?: number; - } - export interface BaseChartOptions extends viz.core.BaseWidgetOptions { - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - /** Specifies the width of the widget container that is small enough for the layout to begin adapting. */ - width?: number; - /** Specifies the height of the widget container that is small enough for the layout to begin adapting. */ - height?: number; - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ - keepLabels?: boolean; - }; - /** Specifies animation options. */ - animation?: ChartAnimation; - /** Specifies a callback function that returns an object with options for a specific point label. */ - customizeLabel?: (labelInfo: Object) => Object; - /** Specifies a callback function that returns an object with options for a specific point. */ - customizePoint?: (pointInfo: Object) => Object; - /** Specifies a data source for the chart. */ - dataSource?: any; - done?: Function; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies options of a dxChart's (dxPieChart's) legend. */ - legend?: core.BaseLegend; - /** Specifies the blank space between the chart's extreme elements and the boundaries of the area provided for the widget (see size) in pixels. */ - margin?: viz.core.Margins; - /** Sets the name of the palette to be used in the chart. Alternatively, an array of colors can be set as a custom palette to be used within this chart. */ - palette?: any; - /** A handler for the done event. */ - onDone?: (e: { - component: BaseChart; - element: Element; - }) => void; - /** A handler for the pointClick event. */ - onPointClick?: any; - pointClick?: any; - /** A handler for the pointHoverChanged event. */ - onPointHoverChanged?: (e: { - component: BaseChart; - element: Element; - target: TPoint; - }) => void; - pointHoverChanged?: (point: TPoint) => void; - /** A handler for the pointSelectionChanged event. */ - onPointSelectionChanged?: (e: { - component: BaseChart; - element: Element; - target: TPoint; - }) => void; - pointSelectionChanged?: (point: TPoint) => void; - /** Specifies whether a single point or multiple points can be selected in the chart. */ - pointSelectionMode?: string; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies options for the dxChart and dxPieChart widget series. */ - series?: any; - /** Specifies the size of the widget in pixels. */ - size?: viz.core.Size; - /** Sets the name of the theme to be used in the chart. */ - theme?: string; - /** Specifies a title for the chart. */ - title?: { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** Specifies the title's horizontal position in the chart. */ - horizontalAlignment?: string; - /** Specifies a title's position on the chart in the vertical direction. */ - verticalAlignment?: string; - /** Specifies the distance between the title and surrounding chart elements in pixels. */ - margin?: viz.core.Margins; - /** Specifies the height of the space reserved for the title. */ - placeholderSize?: number; - /** Specifies a text for the chart's title. */ - text?: string; - }; - /** Specifies tooltip options. */ - tooltip?: BaseChartTooltip; - /** A handler for the tooltipShown event. */ - onTooltipShown?: (e: { - component: BaseChart; - element: Element; - }) => void; - /** A handler for the tooltipHidden event. */ - onTooltipHidden?: (e: { - component: BaseChart; - element: Element; - }) => void; - tooltipHidden?: (point: TPoint) => void; - tooltipShown?: (point: TPoint) => void; - } - /** A base class for all chart widgets included in the ChartJS library. */ - export class BaseChart extends viz.core.BaseWidget { - /** Deselects the chart's selected series. The series is displayed in an initial style. */ - clearSelection(): void; - /** Gets the current size of the widget. */ - getSize(): { width: number; height: number }; - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Hides all widget tooltips. */ - hideTooltip(): void; - /** Redraws a widget. */ - render(renderOptions?: { - force?: boolean; - animate?: boolean; - asyncSeriesRendering?: boolean; - }): void; - } - export interface AdvancedLegend extends core.BaseLegend { - /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ - customizeHint?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; - /**

Specifies a callback function that returns the text to be displayed by legend items.

*/ - customizeText?: (seriesInfo: { seriesName: string; seriesIndex: number; seriesColor: string; }) => string; - /** Specifies what series elements to highlight when a corresponding item in the legend is hovered over. */ - hoverMode?: string; - } - export interface AdvancedOptions extends BaseChartOptions { - /** A handler for the argumentAxisClick event. */ - onArgumentAxisClick?: any; - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** An object providing options for managing data from a data source. */ - dataPrepareSettings?: { - /** Specifies whether or not to validate the values from a data source. */ - checkTypeForAllData?: boolean; - /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ - convertToAxisDataType?: boolean; - /** Specifies how to sort the series points. */ - sortingMethod?: any; - }; - /** A handler for the legendClick event. */ - onLegendClick?: any; - /** A handler for the seriesClick event. */ - onSeriesClick?: any; - /** A handler for the seriesHoverChanged event. */ - onSeriesHoverChanged?: (e: { - component: BaseChart; - element: Element; - target: TSeries; - }) => void; - /** A handler for the seriesSelectionChanged event. */ - onSeriesSelectionChanged?: (e: { - component: BaseChart; - element: Element; - target: TSeries; - }) => void; - /** Specifies whether a single series or multiple series can be selected in the chart. */ - seriesSelectionMode?: string; - /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; - } - export interface Legend extends AdvancedLegend { - /** Specifies whether the legend is located outside or inside the chart's plot. */ - position?: string; - } - export interface ChartTooltip extends BaseChartTooltip { - /** Specifies whether the tooltip must be located in the center of a bar or on its edge. Applies only to the Bar series. */ - location?: string; - /** Specifies the kind of information to display in a tooltip. */ - shared?: boolean; - } - export interface dxChartOptions extends AdvancedOptions { - /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ - equalBarWidth?: any; - adaptiveLayout?: { - keepLabels?: boolean; - }; - /** Indicates whether or not to synchronize value axes when they are displayed on a single pane. */ - synchronizeMultiAxes?: boolean; - /** Specifies whether or not to filter the series points depending on their quantity. */ - useAggregation?: boolean; - /** Indicates whether or not to adjust a value axis to the current minimum and maximum values of a zoomed chart. */ - adjustOnZoom?: boolean; - /** Specifies argument axis options for the dxChart widget. */ - argumentAxis?: ChartArgumentAxis; - argumentAxisClick?: any; - /** An object defining the configuration options that are common for all axes of the dxChart widget. */ - commonAxisSettings?: ChartCommonAxisSettings; - /** An object defining the configuration options that are common for all panes in the dxChart widget. */ - commonPaneSettings?: CommonPane; - /** An object defining the configuration options that are common for all series of the dxChart widget. */ - commonSeriesSettings?: CommonSeriesSettings; - /** An object that specifies the appearance options of the chart crosshair. */ - crosshair?: { - /** Specifies a color for the crosshair lines. */ - color?: string; - /** Specifies a dash style for the crosshair lines. */ - dashStyle?: string; - /** Specifies whether to enable the crosshair or not. */ - enabled?: boolean; - /** Specifies the opacity of the crosshair lines. */ - opacity?: number; - /** Specifies the width of the crosshair lines. */ - width?: number; - /** Specifies the appearance of the horizontal crosshair line. */ - horizontalLine?: CrosshaierWithLabel; - /** Specifies the appearance of the vertical crosshair line. */ - verticalLine?: CrosshaierWithLabel; - /** Specifies the options of the crosshair labels. */ - label?: { - /** Specifies a color for the background of the crosshair labels. */ - backgroundColor?: string; - /** Specifies whether the crosshair labels are visible or not. */ - visible?: boolean; - /** Specifies font options for the text of the crosshair labels. */ - font?: viz.core.Font; - } - }; - /** Specifies a default pane for the chart's series. */ - defaultPane?: string; - /** Specifies a coefficient determining the diameter of the largest bubble. */ - maxBubbleSize?: number; - /** Specifies the diameter of the smallest bubble measured in pixels. */ - minBubbleSize?: number; - /** Defines the dxChart widget's pane(s). */ - panes?: Array; - /** Swaps the axes round so that the value axis becomes horizontal and the argument axes becomes vertical. */ - rotated?: boolean; - /** Specifies the options of a chart's legend. */ - legend?: Legend; - /** Specifies options for dxChart widget series. */ - series?: Array; - legendClick?: any; - seriesClick?: any; - seriesHoverChanged?: (series: ChartSeries) => void; - seriesSelectionChanged?: (series: ChartSeries) => void; - /** Defines options for the series template. */ - seriesTemplate?: SeriesTemplate; - /** Specifies tooltip options. */ - tooltip?: ChartTooltip; - /** Specifies value axis options for the dxChart widget. */ - valueAxis?: Array; - /** Enables scrolling in your chart. */ - scrollingMode?: string; - /** Enables zooming in your chart. */ - zoomingMode?: string; - /** Specifies the settings of the scroll bar. */ - scrollBar?: { - /** Specifies whether the scroll bar is visible or not. */ - visible?: boolean; - /** Specifies the spacing between the scroll bar and the chart's plot in pixels. */ - offset?: number; - /** Specifies the color of the scroll bar. */ - color?: string; - /** Specifies the width of the scroll bar in pixels. */ - width?: number; - /** Specifies the opacity of the scroll bar. */ - opacity?: number; - /** Specifies the position of the scroll bar in the chart. */ - position?: string; - }; - } - /** A widget used to embed charts into HTML JS applications. */ - export class dxChart extends BaseChart { - constructor(element: JQuery, options?: dxChartOptions); - constructor(element: Element, options?: dxChartOptions); - /** Returns an array of all series in the chart. */ - getAllSeries(): Array; - /** Gets a series within the chart's series collection by the specified name (see the name option). */ - getSeriesByName(seriesName: string): ChartSeries; - /** Gets a series within the chart's series collection by its position number. */ - getSeriesByPos(seriesIndex: number): ChartSeries; - /** Sets the specified start and end values for the chart's argument axis. */ - zoomArgument(startValue: any, endValue: any): void; - } - interface CrosshaierWithLabel extends viz.core.DashedBorderWithOpacity { - /** Configures the label that belongs to the horizontal crosshair line. */ - label?: { - /** Specifies a color for the background of the label that belongs to the horizontal crosshair line. */ - backgroundColor?: string; - /** Specifies whether the label of the horizontal crosshair line is visible or not. */ - visible?: boolean; - /** Specifies font options for the text of the label that belongs to the horizontal crosshair line. */ - font?: viz.core.Font; - } - } - export interface PolarChartTooltip extends BaseChartTooltip { - /** Specifies the kind of information to display in a tooltip. */ - shared?: boolean; - } - export interface dxPolarChartOptions extends AdvancedOptions { - /** Specifies a value indicating whether all bars in a series must have the same angle, or may have different angles if any points in other series are missing. */ - equalBarWidth?: boolean; - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - width?: number; - height?: number; - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ - keepLabels?: boolean; - }; - /** Indicates whether or not to display a "spider web". */ - useSpiderWeb?: boolean; - /** Specifies argument axis options for the dxPolarChart widget. */ - argumentAxis?: PolarArgumentAxis; - /** An object defining the configuration options that are common for all axes of the dxPolarChart widget. */ - commonAxisSettings?: PolarCommonAxisSettings; - /** An object defining the configuration options that are common for all series of the dxPolarChart widget. */ - commonSeriesSettings?: CommonPolarSeriesSettings; - /** Specifies the options of a chart's legend. */ - legend?: AdvancedLegend; - /** Specifies options for dxPolarChart widget series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: PolarSeriesTemplate; - /** Specifies tooltip options. */ - tooltip?: PolarChartTooltip; - /** Specifies value axis options for the dxPolarChart widget. */ - valueAxis?: PolarValueAxis; - } - /** A chart widget displaying data in a polar coordinate system. */ - export class dxPolarChart extends BaseChart { - constructor(element: JQuery, options?: dxPolarChartOptions); - constructor(element: Element, options?: dxPolarChartOptions); - /** Returns an array of all series in the chart. */ - getAllSeries(): Array; - /** Gets a series within the chart's series collection by the specified name (see the name option). */ - getSeriesByName(seriesName: string): PolarSeries; - /** Gets a series within the chart's series collection by its position number. */ - getSeriesByPos(seriesIndex: number): PolarSeries; - } - export interface PieLegend extends core.BaseLegend { - /** Specifies what chart elements to highlight when a corresponding item in the legend is hovered over. */ - hoverMode?: string; - /** Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item. */ - customizeHint?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; - /** Specifies a callback function that returns the text to be displayed by a legend item. */ - customizeText?: (pointInfo: { pointName: string; pointIndex: number; pointColor: string; }) => string; - } - export interface dxPieChartOptions extends BaseChartOptions { - /** Specifies adaptive layout options. */ - adaptiveLayout?: { - /** Specifies whether or not point labels can be hidden when the layout is adapting. */ - keepLabels?: boolean; - }; - /** Specifies dxPieChart legend options. */ - legend?: PieLegend; - /** Specifies options for the series of the dxPieChart widget. */ - series?: Array; - /** Specifies the diameter of the pie. */ - diameter?: number; - /** A handler for the legendClick event. */ - onLegendClick?: any; - legendClick?: any; - /** Specifies how the chart must behave when series point labels overlap. */ - resolveLabelOverlapping?: string; - } - /** A circular chart widget for HTML JS applications. */ - export class dxPieChart extends BaseChart { - constructor(element: JQuery, options?: dxPieChartOptions); - constructor(element: Element, options?: dxPieChartOptions); - /** Provides access to the dxPieChart series. */ - getSeries(): PieSeries; - } -} -declare module DevExpress.viz.core { - export interface Border { - /** Sets a border color for a selected series. */ - color?: string; - /** Sets border visibility for a selected series. */ - visible?: boolean; - /** Sets a border width for a selected series. */ - width?: number; - } - export interface DashedBorder extends Border { - /** Specifies a dash style for the border of a selected series point. */ - dashStyle?: string; - } - export interface DashedBorderWithOpacity extends DashedBorder { - /** Specifies the opacity of the tooltip's border. */ - opacity?: number; - } - export interface Font { - /** Specifies the font color for a strip label. */ - color?: string; - /** Specifies the font family for a strip label. */ - family?: string; - /** Specifies the font opacity for a strip label. */ - opacity?: number; - /** Specifies the font size for a strip label. */ - size?: any; - /** Specifies the font weight for the text displayed in strips. */ - weight?: number; - } - export interface Hatching { - /** Specifies how to apply hatching to highlight a selected series. */ - direction?: string; - /** Specifies the opacity of hatching lines. */ - opacity?: number; - /** Specifies the distance between hatching lines in pixels. */ - step?: number; - /** Specifies the width of hatching lines in pixels. */ - width?: number; - } - export interface Margins { - /** Specifies the legend's bottom margin in pixels. */ - bottom?: number; - /** Specifies the legend's left margin in pixels. */ - left?: number; - /** Specifies the legend's right margin in pixels. */ - right?: number; - /** Specifies the legend's bottom margin in pixels. */ - top?: number; - } - export interface Size { - /** Specifies the width of the widget. */ - width?: number; - /** Specifies the height of the widget. */ - height?: number; - } - export interface Tooltip { - /** Specifies the length of the tooltip's arrow in pixels. */ - arrowLength?: number; - /** Specifies the appearance of the tooltip's border. */ - border?: viz.core.DashedBorderWithOpacity; - /** Specifies a color for the tooltip. */ - color?: string; - customizeText?: Function; - /** Specifies text and appearance of a particular set of tooltips. */ - customizeTooltip?: (arg: Object) => { color?: string; text?: string }; - /** Specifies whether or not the tooltip is enabled. */ - enabled?: boolean; - /** Specifies font options for the text displayed by the tooltip. */ - font?: Font; - /** Specifies a format for the text displayed by the tooltip. */ - format?: string; - /** Specifies the opacity of a tooltip. */ - opacity?: number; - /** Specifies a distance from the tooltip's left/right boundaries to the inner text in pixels. */ - paddingLeftRight?: number; - /** Specifies a distance from the tooltip's top/bottom boundaries to the inner text in pixels. */ - paddingTopBottom?: number; - /** Specifies a precision for formatted values displayed by the tooltip. */ - precision?: number; - /** Specifies options of the tooltip's shadow. */ - shadow?: { - /** Specifies the blur distance of the tooltip's shadow. */ - blur?: number; - /** Specifies the color of the tooltip's shadow. */ - color?: string; - /** Specifies the horizontal offset of the tooltip's shadow relative to the tooltip in pixels. */ - offsetX?: number; - /** Specifies the vertical offset of the tooltip's shadow relative to the tooltip in pixels. */ - offsetY?: number; - /** Specifies the opacity of the tooltip's shadow. */ - opacity?: number; - }; - } - export interface Animation { - /** Determines how long animation runs. */ - duration?: number; - /** Specifies the animation easing mode. */ - easing?: string; - /** Indicates whether or not animation is enabled. */ - enabled?: boolean; - } - export interface LoadingIndicator { - /** Specifies a color for the loading indicator background. */ - backgroundColor?: string; - /** Specifies font options for the loading indicator text. */ - font?: viz.core.Font; - /** Specifies whether to show the loading indicator or not. */ - show?: boolean; - /** Specifies a text to be displayed by the loading indicator. */ - text?: string; - } - export interface LegendBorder extends viz.core.DashedBorderWithOpacity { - /** Specifies a radius for the corners of the legend border. */ - cornerRadius?: number; - } - export interface BaseLegend { - /** Specifies the color of the legend's background. */ - backgroundColor?: string; - /** Specifies legend border settings. */ - border?: viz.core.LegendBorder; - /** Specifies how many columns must be taken to arrange legend items. */ - columnCount?: number; - /** Specifies the spacing between a pair of neighboring legend columns in pixels. */ - columnItemSpacing?: number; - /** Specifies whether or not item columns in the legend have an equal width. */ - equalColumnWidth?: boolean; - /** Specifies font options for legend items. */ - font?: viz.core.Font; - /** Specifies the legend's position on the map. */ - horizontalAlignment?: string; - /** Specifies the alignment of legend items. */ - itemsAlignment?: string; - /** Specifies the position of text relative to the item marker. */ - itemTextPosition?: string; - /** Specifies the distance between the legend and the container borders in pixels. */ - margin?: viz.core.Margins; - /** Specifies the size of item markers in the legend in pixels. */ - markerSize?: number; - /** Specifies whether to arrange legend items horizontally or vertically. */ - orientation?: string; - /** Specifies the spacing between the legend left/right border and legend items in pixels. */ - paddingLeftRight?: number; - /** Specifies the spacing between the legend top/bottom border and legend items in pixels. */ - paddingTopBottom?: number; - /** Specifies how many rows must be taken to arrange legend items. */ - rowCount?: number; - /** Specifies the spacing between a pair of neighboring legend rows in pixels. */ - rowItemSpacing?: number; - /** Specifies the legend's position on the map. */ - verticalAlignment?: string; - /** Specifies whether or not the legend is visible on the map. */ - visible?: boolean; - } - export interface BaseWidgetOptions { - drawn?: (widget: Object) => void; - /** A handler for the drawn event. */ - onDrawn?: (e: { - component: BaseWidget; - element: Element; - }) => void; - incidentOccured?: (incidentInfo: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - }) => void; - /** A handler for the incidentOccurred event. */ - onIncidentOccurred?: ( - component: BaseWidget, - element: Element, - target: { - id: string; - type: string; - args: any; - text: string; - widget: string; - version: string; - } - ) => void; - /** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */ - pathModified?: boolean; - /** Specifies whether or not the widget supports right-to-left representation. */ - rtlEnabled?: boolean; - } - /** This section describes options and methods that are common to all widgets. */ - export class BaseWidget extends DOMComponent { - /** Returns the widget's SVG markup. */ - svg(): string; - } -} -declare module DevExpress.viz.gauges { - export interface BaseRangeContainer { - /** Specifies a range container's background color. */ - backgroundColor?: string; - /** Specifies the offset of the range container from an invisible scale line in pixels. */ - offset?: number; - /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ - palette?: any; - /** An array of objects representing ranges contained in the range container. */ - ranges?: Array<{ startValue: number; endValue: number; color: string }>; - /** Specifies a color of a range. */ - color?: string; - /** Specifies an end value of a range. */ - endValue?: number; - /** Specifies a start value of a range. */ - startValue?: number; - } - export interface ScaleTick { - /** Specifies the color of the scale's minor ticks. */ - color?: string; - /** Specifies an array of custom minor ticks. */ - customTickValues?: Array; - /** Specifies the length of the scale's minor ticks. */ - length?: number; - /** Indicates whether automatically calculated minor ticks are visible or not. */ - showCalculatedTicks?: boolean; - /** Specifies an interval between minor ticks. */ - tickInterval?: number; - /** Indicates whether scale minor ticks are visible or not. */ - visible?: boolean; - /** Specifies the width of the scale's minor ticks. */ - width?: number; - } - export interface ScaleMajorTick extends ScaleTick { - /** Specifies whether or not to expand the current major tick interval if labels overlap each other. */ - useTicksAutoArrangement?: boolean; - } - export interface BaseScaleLabel { - /** Specifies whether or not scale labels should be colored similarly to their corresponding ranges in the range container. */ - useRangeColors?: boolean; - /** Specifies a callback function that returns the text to be displayed in scale labels. */ - customizeText?: (scaleValue: { value: number; valueText: string }) => string; - /** Specifies font options for the text displayed in the scale labels of the gauge. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in scale labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the scale labels. */ - precision?: number; - /** Specifies whether or not scale labels are visible on the gauge. */ - visible?: boolean; - } - export interface BaseScale { - /** Specifies the end value for the scale of the gauge. */ - endValue?: number; - /** Specifies whether or not to hide the first scale label. */ - hideFirstLabel?: boolean; - /** Specifies whether or not to hide the first major tick on the scale. */ - hideFirstTick?: boolean; - /** Specifies whether or not to hide the last scale label. */ - hideLastLabel?: boolean; - /** Specifies whether or not to hide the last major tick on the scale. */ - hideLastTick?: boolean; - /** Specifies common options for scale labels. */ - label?: BaseScaleLabel; - /** Specifies options of the gauge's major ticks. */ - majorTick?: ScaleMajorTick; - /** Specifies options of the gauge's minor ticks. */ - minorTick?: ScaleTick; - /** Specifies the start value for the scale of the gauge. */ - startValue?: number; - } - export interface BaseValueIndicator { - /** Specifies the type of subvalue indicators. */ - type?: string; - /** Specifies the background color for the indicator of the rangeBar type. */ - backgroundColor?: string; - /** Specifies the base value for the indicator of the rangeBar type. */ - baseValue?: number; - /** Specifies a color of the indicator. */ - color?: string; - /** Specifies the range bar size for an indicator of the rangeBar type. */ - size?: number; - text?: { - /** Specifies a callback function that returns the text to be displayed in an indicator. */ - customizeText?: (indicatedValue: { value: number; valueText: string }) => string; - font?: viz.core.Font; - /** Specifies a format for the text displayed in an indicator. */ - format?: string; - /** Specifies the range bar's label indent in pixels. */ - indent?: number; - /** Specifies a precision for the formatted value displayed by an indicator. */ - precision?: number; - }; - offset?: number; - length?: number; - width?: number; - /** Specifies the length of an arrow for the indicator of the textCloud type in pixels. */ - arrowLength?: number; - /** Sets the array of colors to be used for coloring subvalue indicators. */ - palette?: Array; - /** Specifies the distance between the needle and the center of a gauge for the indicator of a needle-like type. */ - indentFromCenter?: number; - /** Specifies the second color for the indicator of the twoColorNeedle type. */ - secondColor?: string; - /** Specifies the length of a twoNeedleColor type indicator tip as a percentage. */ - secondFraction?: number; - /** Specifies the spindle's diameter in pixels for the indicator of a needle-like type. */ - spindleSize?: number; - /** Specifies the inner diameter in pixels, so that the spindle has the shape of a ring. */ - spindleGapSize?: number; - /** Specifies the orientation of the rangeBar indicator on a vertically oriented dxLinearGauge widget. */ - horizontalOrientation?: string; - /** Specifies the orientation of the rangeBar indicator on a horizontally oriented dxLinearGauge widget. */ - verticalOrientation?: string; - } - export interface SharedGaugeOptions { - /** Specifies animation options. */ - animation?: viz.core.Animation; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies the size of the widget in pixels. */ - size?: viz.core.Size; - /** Specifies a subtitle for a gauge. */ - subtitle?: { - /** Specifies font options for the subtitle. */ - font?: viz.core.Font; - /** Specifies a text for the subtitle. */ - text?: string; - }; - /** Specifies the name of the theme to be applied. */ - theme?: string; - /** Specifies a title for a gauge. */ - title?: { - /** Specifies font options for the title. */ - font?: viz.core.Font; - /** Specifies a title's position on the gauge. */ - position?: string; - /** Specifies a text for the title. */ - text?: string; - }; - /** Specifies options for gauge tooltips. */ - tooltip?: viz.core.Tooltip; - } - export interface BaseGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** Specifies the blank space in pixels between the widget's extreme elements and the boundaries of the area provided for the widget (see the size option). */ - margin?: viz.core.Margins; - /** Specifies options of the gauge's range container. */ - rangeContainer?: BaseRangeContainer; - /** Specifies a gauge's scale options. */ - scale?: BaseScale; - /** Specifies the appearance options of subvalue indicators. */ - subvalueIndicator?: BaseValueIndicator; - /** Specifies a set of subvalues to be designated by the subvalue indicators. */ - subvalues?: Array; - /** Specifies the main value on a gauge. */ - value?: number; - /** Specifies the appearance options of the value indicator. */ - valueIndicator?: BaseValueIndicator; - } - /** A gauge widget. */ - export class dxBaseGauge extends viz.core.BaseWidget { - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(): void; - /** Returns the main gauge value. */ - value(): number; - /** Updates a gauge value. */ - value(value: number): void; - /** Returns an array of gauge subvalues. */ - subvalues(): Array; - /** Updates gauge subvalues. */ - subvalues(subvalues: Array): void; - } - export interface LinearRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container on a vertically oriented dxLinearGauge widget. */ - horizontalOrientation?: string; - /** Specifies the orientation of a range container on a horizontally oriented dxLinearGauge widget. */ - verticalOrientation?: string; - /** Specifies the width of the range container's start and end boundaries in the dxLinearGauge widget. */ - width?: any; - /** Specifies an end width of a range container. */ - end?: number; - /** Specifies a start width of a range container. */ - start?: number; - } - export interface LinearScaleLabel extends BaseScaleLabel { - /** Specifies the spacing between scale labels and ticks. */ - indentFromTick?: number; - } - export interface LinearScale extends BaseScale { - /** Specifies the orientation of scale ticks on a vertically oriented dxLinearGauge widget. */ - horizontalOrientation?: string; - label?: LinearScaleLabel; - /** Specifies the orientation of scale ticks on a horizontally oriented dxLinearGauge widget. */ - verticalOrientation?: string; - } - export interface dxLinearGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the dxLinearGauge widget. */ - geometry?: { - /** Indicates whether to display the dxLinearGauge widget vertically or horizontally. */ - orientation?: string; - }; - /** Specifies gauge range container options. */ - rangeContainer?: LinearRangeContainer; - scale?: LinearScale; - } - /** A widget that represents a gauge with a linear scale. */ - export class dxLinearGauge extends dxBaseGauge { - constructor(element: JQuery, options?: dxLinearGaugeOptions); - constructor(element: Element, options?: dxLinearGaugeOptions); - } - export interface CircularRangeContainer extends BaseRangeContainer { - /** Specifies the orientation of the range container in the dxCircularGauge widget. */ - orientation?: string; - /** Specifies the range container's width in pixels. */ - width?: number; - } - export interface CircularScaleLabel extends BaseScaleLabel { - /** Specifies the spacing between scale labels and ticks. */ - indentFromTick?: number; - } - export interface CircularScale extends BaseScale { - label?: CircularScaleLabel; - /** Specifies the orientation of scale ticks. */ - orientation?: string; - } - export interface dxCircularGaugeOptions extends BaseGaugeOptions { - /** Specifies the options required to set the geometry of the dxCircularGauge widget. */ - geometry?: { - /** Specifies the end angle of the circular gauge's arc. */ - endAngle?: number; - /** Specifies the start angle of the circular gauge's arc. */ - startAngle?: number; - }; - /** Specifies gauge range container options. */ - rangeContainer?: CircularRangeContainer; - scale?: CircularScale; - } - /** A widget that represents a gauge with a circular scale. */ - export class dxCircularGauge extends dxBaseGauge { - constructor(element: JQuery, options?: dxCircularGaugeOptions); - constructor(element: Element, options?: dxCircularGaugeOptions); - } - export interface dxBarGaugeOptions extends viz.core.BaseWidgetOptions, SharedGaugeOptions { - /** Specifies a color for the remaining segment of the bar's track. */ - backgroundColor?: string; - /** Specifies a distance between bars in pixels. */ - barSpacing?: number; - /** Specifies a base value for bars. */ - baseValue?: number; - /** Specifies an end value for the gauge's invisible scale. */ - endValue?: number; - /** Defines the shape of the gauge's arc. */ - geometry?: { - /** Specifies the end angle of the bar gauge's arc. */ - endAngle?: number; - /** Specifies the start angle of the bar gauge's arc. */ - startAngle?: number; - }; - /** Specifies the options of the labels that accompany gauge bars. */ - label?: { - /** Specifies a color for the label connector text. */ - connectorColor?: string; - /** Specifies the width of the label connector in pixels. */ - connectorWidth?: number; - /** Specifies a callback function that returns a text for labels. */ - customizeText?: (barValue: { value: number; valueText: string }) => string; - /** Specifies font options for bar labels. */ - font?: viz.core.Font; - /** Specifies a format for bar labels. */ - format?: string; - /** Specifies the distance between the upper bar and bar labels in pixels. */ - indent?: number; - /** Specifies a precision for the formatted value displayed by labels. */ - precision?: number; - /** Specifies whether bar labels appear on a gauge or not. */ - visible?: boolean; - }; - /** Sets the name of the palette or an array of colors to be used for coloring the gauge range container. */ - palette?: string; - /** Defines the radius of the bar that is closest to the center relatively to the radius of the topmost bar. */ - relativeInnerRadius?: number; - /** Specifies a start value for the gauge's invisible scale. */ - startValue?: number; - /** Specifies the array of values to be indicated on a bar gauge. */ - values?: Array; - } - /** A circular bar widget. */ - export class dxBarGauge extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxBarGaugeOptions); - constructor(element: Element, options?: dxBarGaugeOptions); - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws the widget. */ - render(): void; - /** Returns an array of gauge values. */ - values(): Array; - /** Updates the values displayed by a gauge. */ - values(values: Array): void; - } -} -declare module DevExpress.viz.map { - /** This section describes the fields and methods that can be used in code to manipulate the Area object. */ - export interface Area { - /** Contains the element type. */ - type: string; - /** Return the value of an attribute. */ - attribute(name: string): any; - /** Provides information about the selection state of an area. */ - selected(): boolean; - /** Sets a new selection state for an area. */ - selected(state: boolean): void; - } - /** This section describes the fields and methods that can be used in code to manipulate the Markers object. */ - export interface Marker { - /** Contains the descriptive text accompanying the map marker. */ - text: string; - /** Contains the type of the element. */ - type: string; - /** Contains the URL of an image map marker. */ - url: string; - /** Contains the value of a bubble map marker. */ - value: number; - /** Contains the values of a pie map marker. */ - values: Array; - /** Returns the value of an attribute. */ - attribute(name: string): any; - /** Returns the coordinates of a specific marker. */ - coordinates(): Array; - /** Provides information about the selection state of a marker. */ - selected(): boolean; - /** Sets a new selection state for a marker. */ - selected(state: boolean): void; - } - export interface AreaSettings { - /** Specifies the width of the area border in pixels. */ - borderWidth?: number; - /** Specifies a color for the area border. */ - borderColor?: string; - click?: any; - /** Specifies a color for an area. */ - color?: string; - /** Specifies the function that customizes each area individually. */ - customize?: (areaInfo: Area) => AreaSettings; - /** Specifies a color for the area border when the area is hovered over. */ - hoveredBorderColor?: string; - /** Specifies the pixel-measured width of the area border when the area is hovered over. */ - hoveredBorderWidth?: number; - /** Specifies a color for an area when this area is hovered over. */ - hoveredColor?: string; - /** Specifies whether or not to change the appearance of an area when it is hovered over. */ - hoverEnabled?: boolean; - /** Configures area labels. */ - label?: { - /** Specifies the data field that provides data for area labels. */ - dataField?: string; - /** Enables area labels. */ - enabled?: boolean; - /** Specifies font options for area labels. */ - font?: viz.core.Font; - }; - /** Specifies the name of the palette or a custom range of colors to be used for coloring a map. */ - palette?: any; - /** Specifies the number of colors in a palette. */ - paletteSize?: number; - /** Allows you to paint areas with similar attributes in the same color. */ - colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring areas. */ - colorGroupingField?: string; - /** Specifies a color for the area border when the area is selected. */ - selectedBorderColor?: string; - /** Specifies a color for an area when this area is selected. */ - selectedColor?: string; - /** Specifies the pixel-measured width of the area border when the area is selected. */ - selectedBorderWidth?: number; - selectionChanged?: (area: Area) => void; - /** Specifies whether single or multiple areas can be selected on a vector map. */ - selectionMode?: string; - } - export interface MarkerSettings { - /** Specifies a color for the marker border. */ - borderColor?: string; - /** Specifies the width of the marker border in pixels. */ - borderWidth?: number; - click?: any; - /** Specifies a color for a marker of the dot or bubble type. */ - color?: string; - /** Specifies the function that customizes each marker individually. */ - customize?: (markerInfo: Marker) => MarkerSettings; - font?: Object; - /** Specifies the pixel-measured width of the marker border when the marker is hovered over. */ - hoveredBorderWidth?: number; - /** Specifies a color for the marker border when the marker is hovered over. */ - hoveredBorderColor?: string; - /** Specifies a color for a marker of the dot or bubble type when this marker is hovered over. */ - hoveredColor?: string; - /** Specifies whether or not to change the appearance of a marker when it is hovered over. */ - hoverEnabled?: boolean; - /** Specifies marker label options. */ - label?: { - /** Enables marker labels. */ - enabled?: boolean; - /** Specifies font options for marker labels. */ - font?: viz.core.Font; - }; - /** Specifies the pixel-measured diameter of the marker that represents the biggest value. Setting this option makes sense only if you use markers of the bubble type. */ - maxSize?: number; - /** Specifies the pixel-measured diameter of the marker that represents the smallest value. Setting this option makes sense only if you use markers of the bubble type. */ - minSize?: number; - /** Specifies the opacity of markers. Setting this option makes sense only if you use markers of the bubble type. */ - opacity?: number; - /** Specifies the pixel-measured width of the marker border when the marker is selected. */ - selectedBorderWidth?: number; - /** Specifies a color for the marker border when the marker is selected. */ - selectedBorderColor?: string; - /** Specifies a color for a marker of the dot or bubble type when this marker is selected. */ - selectedColor?: string; - selectionChanged?: (marker: Marker) => void; - /** Specifies whether a single or multiple markers can be selected on a vector map. */ - selectionMode?: string; - /** Specifies the size of markers. Setting this option makes sense for any type of marker except bubble. */ - size?: number; - /** Specifies the type of markers to be used on the map. */ - type?: string; - /** Specifies the name of a palette or a custom set of colors to be used for coloring markers of the pie type. */ - palette?: any; - /** Allows you to paint markers with similar attributes in the same color. */ - colorGroups?: Array; - /** Specifies the field that provides data to be used for coloring markers. */ - colorGroupingField?: string; - /** Allows you to display bubbles with similar attributes in the same size. */ - sizeGroups?: Array; - /** Specifies the field that provides data to be used for sizing bubble markers. */ - sizeGroupingField?: string; - } - export interface dxVectorMapOptions extends viz.core.BaseWidgetOptions { - /** An object specifying options for the map areas. */ - areaSettings?: AreaSettings; - /** Specifies the options for the map background. */ - background?: { - /** Specifies a color for the background border. */ - borderColor?: string; - /** Specifies a color for the background. */ - color?: string; - }; - /** Specifies the positioning of a map in geographical coordinates. */ - bounds?: Array; - /** Specifies the options of the control bar. */ - controlBar?: { - /** Specifies a color for the outline of the control bar elements. */ - borderColor?: string; - /** Specifies a color for the inner area of the control bar elements. */ - color?: string; - /** Specifies whether or not to display the control bar. */ - enabled?: boolean; - /** Specifies the margin of the control bar in pixels. */ - margin?: number; - /** Specifies the position of the control bar. */ - horizontalAlignment?: string; - /** Specifies the position of the control bar. */ - verticalAlignment?: string; - }; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies a data source for the map area. */ - mapData?: any; - /** Specifies a data source for the map markers. */ - markers?: any; - /** An object specifying options for the map markers. */ - markerSettings?: MarkerSettings; - /** Specifies the size of the dxVectorMap widget. */ - size?: viz.core.Size; - /** Specifies the name of the theme to be applied. */ - theme?: Object; - /** Specifies tooltip options. */ - tooltip?: viz.core.Tooltip; - /** Configures map legends. */ - legends?: Array; - /** Specifies whether or not the map should respond when a user rolls the mouse wheel. */ - wheelEnabled?: boolean; - /** Specifies whether the map should respond to touch gestures. */ - touchEnabled?: boolean; - /** Disables the zooming capability. */ - zoomingEnabled?: boolean; - /** Specifies the geographical coordinates of the center for a map. */ - center?: Array; - centerChanged?: (center: Array) => void; - /** A handler for the centerChanged event. */ - onCenterChanged?: (e: { - center: Array; - component: dxVectorMap; - element: Element; - }) => void; - /** Specifies a number that is used to zoom a map initially. */ - zoomFactor?: number; - zoomFactorChanged?: (zoomFactor: number) => void; - /** A handler for the zoomFactorChanged event. */ - onZoomFactorChanged?: (e: { - zoomFactor: number; - component: dxVectorMap; - element: Element; - }) => void; - click?: any; - /** A handler for the click event. */ - onClick?: any; - /** A handler for the areaClick event. */ - onAreaClick?: any; - /** A handler for the areaSelectionChanged event. */ - onAreaSelectionChanged?: (e: { - target: Area; - component: dxVectorMap; - element: Element; - }) => void; - /** A handler for the markerClick event. */ - onMarkerClick?: any; - /** A handler for the markerSelectionChanged event. */ - onMarkerSelectionChanged?: (e: { - target: Marker; - component: dxVectorMap; - element: Element; - }) => void; - /** Disables the panning capability. */ - panningEnabled?: boolean; - } - export interface Legend extends viz.core.BaseLegend { - /** Specifies text for legend items. */ - customizeText?: (itemInfo: { start: number; end: number; index: number; color: string; size: number; }) => string; - /** Specifies text for a hint that appears when a user hovers the mouse pointer over the text of a legend item. */ - customizeHint?: (itemInfo: { start: number; end: number; index: number; color: string; size: number }) => string; - /** Specifies the source of data for the legend. */ - source?: string; - } - /** A vector map widget. */ - export class dxVectorMap extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxVectorMapOptions); - constructor(element: Element, options?: dxVectorMapOptions); - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(): void; - /** Gets the current coordinates of the map center. */ - center(): Array; - /** Sets the coordinates of the map center. */ - center(centerCoordinates: Array): void; - /** Deselects all the selected areas on a map. The areas are displayed in their initial style after. */ - clearAreaSelection(): void; - /** Deselects all the selected markers on a map. The markers are displayed in their initial style after. */ - clearMarkerSelection(): void; - /** Deselects all the selected area and markers on a map at once. The areas and markers are displayed in their initial style after. */ - clearSelection(): void; - /** Converts client area coordinates into map coordinates. */ - convertCoordinates(x: number, y: number): Array; - /** Returns an array with all the map areas. */ - getAreas(): Array; - /** Returns an array with all the map markers. */ - getMarkers(): Array; - /** Gets the current coordinates of the map viewport. */ - viewport(): Array; - /** Sets the coordinates of the map viewport. */ - viewport(viewportCoordinates: Array): void; - /** Gets the current value of the map zoom factor. */ - zoomFactor(): number; - /** Sets the value of the map zoom factor. */ - zoomFactor(zoomFactor: number): void; - } -} -declare module DevExpress.viz.rangeSelector { - export interface dxRangeSelectorOptions extends viz.core.BaseWidgetOptions { - /** Specifies the options for the range selector's background. */ - background?: { - /** Specifies the background color for the dxRangeSelector. */ - color?: string; - /** Specifies image options. */ - image?: { - /** Specifies a location for the image in the background of a range selector. */ - location?: string; - /** Specifies the image's URL. */ - url?: string; - }; - /** Indicates whether or not the background (background color and/or image) is visible. */ - visible?: boolean; - }; - /** Specifies the dxRangeSelector's behavior options. */ - behavior?: { - /** Indicates whether or not you can swap sliders. */ - allowSlidersSwap?: boolean; - /** -Indicates whether or not animation is enabled. - */ - animationEnabled?: boolean; - /** Specifies when to call the onSelectedRangeChanged function. */ - callSelectedRangeChanged?: string; - /** Indicates whether or not an end user can specify the range using a mouse, without the use of sliders. */ - manualRangeSelectionEnabled?: boolean; - /** Indicates whether or not an end user can shift the selected range to the required location on a scale by clicking. */ - moveSelectedRangeByClick?: boolean; - /** Indicates whether to snap a slider to ticks. */ - snapToTicks?: boolean; - }; - /** Specifies the options required to display a chart as the range selector's background. */ - chart?: { - /** Specifies a coefficient for determining an indent from the bottom background boundary to the lowest chart point. */ - bottomIndent?: number; - /** An object defining the common configuration options for the chart’s series. */ - commonSeriesSettings?: viz.charts.CommonSeriesSettings; - /** An object providing options for managing data from a data source. */ - dataPrepareSettings?: { - /** Specifies whether or not to validate values from a data source. */ - checkTypeForAllData?: boolean; - /** Specifies whether or not to convert the values from a data source into the data type of an axis. */ - convertToAxisDataType?: boolean; - /** Specifies how to sort series points. */ - sortingMethod?: any; - }; - /** Specifies a value indicating whether all bars in a series must have the same width, or may have different widths if any points in other series are missing. */ - equalBarWidth?: any; - /** An object defining the chart’s series. */ - series?: Array; - /** Defines options for the series template. */ - seriesTemplate?: viz.charts.SeriesTemplate; - /** Specifies a coefficient for determining an indent from the background's top boundary to the topmost chart point. */ - topIndent?: number; - /** Specifies whether or not to filter the series points depending on their quantity. */ - useAggregation?: boolean; - /** Specifies options for the chart's value axis. */ - valueAxis?: { - /** Indicates whether or not the chart's value axis must be inverted. */ - inverted?: boolean; - /** Specifies the value to be raised to a power when generating ticks for a logarithmic value axis. */ - logarithmBase?: number; - /** Specifies the maximum value of the chart's value axis. */ - max?: number; - /** Specifies the minimum value of the chart's value axis. */ - min?: number; - /** Specifies the type of the value axis. */ - type?: string; - /** Specifies the desired type of axis values. */ - valueType?: string; - }; - }; - /** Specifies the color of the parent page element. */ - containerBackgroundColor?: string; - /** Specifies a data source for the scale values and for the chart at the background. */ - dataSource?: any; - /** Specifies the data source field that provides data for the scale. */ - dataSourceField?: string; - /** Specifies the appearance of the loading indicator. */ - loadingIndicator?: viz.core.LoadingIndicator; - /** Specifies the blank space in pixels between the dxRangeSelector widget's extreme elements and the boundaries of the area provided for the widget (see size). */ - margin?: viz.core.Margins; - /** Specifies whether to redraw the widget when the size of the parent browser window changes or a mobile device rotates. */ - redrawOnResize?: boolean; - /** Specifies options of the range selector's scale. */ - scale?: { - /** Specifies the scale's end value. */ - endValue?: any; - /** Specifies common options for scale labels. */ - label?: { - /** Specifies a callback function that returns the text to be displayed in scale labels. */ - customizeText?: (scaleValue: { value: any; valueText: string; }) => string; - /** Specifies font options for the text displayed in the range selector's scale labels. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in scale labels. */ - format?: string; - /** Specifies a precision for the formatted value displayed in the scale labels. */ - precision?: number; - /** Specifies a spacing between scale labels and the background bottom edge. */ - topIndent?: number; - /** Specifies whether or not the scale's labels are visible. */ - visible?: boolean; - }; - /** Specifies the value to be raised to a power when generating ticks for a logarithmic scale. */ - logarithmBase?: number; - /** Specifies an interval between major ticks. */ - majorTickInterval?: any; - /** Specifies options for the date-time scale's markers. */ - marker?: { - /** Defines the options that can be set for the text that is displayed by the scale markers. */ - label?: { - /** Specifies a callback function that returns the text to be displayed in scale markers. */ - customizeText?: (markerValue: { value: any; valueText: string }) => string; - /** Specifies a format for the text displayed in scale markers. */ - format?: string; - }; - /** Specifies the height of the marker's separator. */ - separatorHeight?: number; - /** Specifies the space between the marker label and the marker separator. */ - textLeftIndent?: number; - /** Specifies the space between the marker's label and the top edge of the marker's separator. */ - textTopIndent?: number; - /** Specified the indent between the marker and the scale lables. */ - topIndent?: number; - /** Indicates whether scale markers are visible. */ - visible?: boolean; - }; - /** Specifies the maximum range that can be selected. */ - maxRange?: any; - /** Specifies the number of minor ticks between neighboring major ticks. */ - minorTickCount?: number; - /** -Specifies an interval between minor ticks. - */ - minorTickInterval?: any; - /** Specifies the minimum range that can be selected. */ - minRange?: any; - /** Specifies the height of the space reserved for the scale in pixels. */ - placeholderHeight?: number; - /** Indicates whether or not to set ticks of a date-time scale at the beginning of each date-time interval. */ - setTicksAtUnitBeginning?: boolean; - /** Specifies whether or not to show ticks for the boundary scale values, when neither major ticks nor minor ticks are created for these values. */ - showCustomBoundaryTicks?: boolean; - /** Indicates whether or not to show minor ticks on the scale. */ - showMinorTicks?: boolean; - /** Specifies the scale's start value. */ - startValue?: any; - /** Specifies options defining the appearance of scale ticks. */ - tick?: { - /** Specifies the color of scale ticks (both major and minor ticks). */ - color?: string; - /** Specifies the opacity of scale ticks (both major and minor ticks). */ - opacity?: number; - /** Specifies the width of the scale's ticks (both major and minor ticks). */ - width?: number; - }; - /** Specifies the type of the scale. */ - type?: string; - /** Specifies whether or not to expand the current tick interval if labels overlap each other. */ - useTicksAutoArrangement?: boolean; - /** Specifies the type of values on the scale. */ - valueType?: string; - /** Specifies the order of arguments on a discrete scale. */ - categories?: Array; - }; - /** Specifies the range to be selected when displaying the dxRangeSelector. */ - selectedRange?: { - /** Specifies the start value of the range to be selected when displaying the dxRangeSelector widget on a page. */ - startValue?: any; - /** Specifies the end value of the range to be selected when displaying the dxRangeSelector widget on a page. */ - endValue?: any; - }; - selectedRangeChanged?: (selectedRange: { startValue: any; endValue: any; }) => void; - /** A handler for the selectedRangeChanged event. */ - onSelectedRangeChanged?: (e: { - startValue: any; - endValue: any; - component: dxRangeSelector; - element: Element; - }) => void; - /** Specifies the options of the range selector's shutters. */ - shutter?: { - /** Specifies shutter color. */ - color?: string; - /** Specifies the opacity of the color of shutters. */ - opacity?: number; - }; - /** Specifies in pixels the size of the dxRangeSelector widget. */ - size?: viz.core.Size; - /** Specifies the appearance of the range selector's slider handles. */ - sliderHandle?: { - /** Specifies the color of the slider handles. */ - color?: string; - /** Specifies the opacity of the slider handles. */ - opacity?: number; - /** Specifies the width of the slider handles. */ - width?: number; - }; - /** Defines the options of the range selector slider markers. */ - sliderMarker?: { - /** Specifies the color of the slider markers. */ - color?: string; - /** Specifies a callback function that returns the text to be displayed by slider markers. */ - customizeText?: (scaleValue: { value: any; valueText: any; }) => string; - /** Specifies font options for the text displayed by the range selector slider markers. */ - font?: viz.core.Font; - /** Specifies a format for the text displayed in slider markers. */ - format?: string; - /** Specifies the color used for the slider marker text when the currently selected range does not match the minRange and maxRange values. */ - invalidRangeColor?: string; - /** Specifies the empty space between the marker's border and the marker’s text. */ - padding?: number; - /** Specifies in pixels the height and width of the space reserved for the range selector slider markers. */ - placeholderSize?: { - /** Specifies the height of the placeholder for the left and right slider markers. */ - height?: number; - /** Specifies the width of the placeholder for the left and right slider markers. */ - width?: { - /** Specifies the width of the left slider marker's placeholder. */ - left?: number; - /** Specifies the width of the right slider marker's placeholder. */ - right?: number; - }; - }; - /** Specifies a precision for the formatted value displayed in slider markers. */ - precision?: number; - /** Indicates whether or not the slider markers are visible. */ - visible?: boolean; - }; - /** Sets the name of the theme to be used by the range selector. */ - theme?: string; - } - /** A widget that allows end users to select a range of values on a scale. */ - export class dxRangeSelector extends viz.core.BaseWidget { - constructor(element: JQuery, options?: dxRangeSelectorOptions); - constructor(element: Element, options?: dxRangeSelectorOptions); - /** Displays the loading indicator. */ - showLoadingIndicator(): void; - /** Conceals the loading indicator. */ - hideLoadingIndicator(): void; - /** Redraws a widget. */ - render(skipChartAnimation?: boolean): void; - /** Returns the currently selected range. */ - getSelectedRange(): { startValue: any; endValue: any; }; - /** Sets a specified range. */ - setSelectedRange(selectedRange: { startValue: any; endValue: any; }): void; - } -} -declare module DevExpress.viz.sparklines { - export interface SparklineTooltip extends viz.core.Tooltip { - /** Specifies how a tooltip is horizontally aligned relative to the graph. */ - horizontalAlignment?: string; - /** Specifies how a tooltip is vertically aligned relative to the graph. */ - verticalAlignment?: string; - } - export interface BaseSparklineOptions extends viz.core.BaseWidgetOptions { - /** Specifies the blank space between the widget's extreme elements and the boundaries of the area provided for the widget in pixels. */ - margin?: viz.core.Margins; - /** Specifies the size of the widget. */ - size?: viz.core.Size; - /** Specifies the name of the theme to be applied. */ - theme?: string; - /** Specifies tooltip options. */ - tooltip?: SparklineTooltip; - } - /** Overridden by descriptions for particular widgets. */ - export class BaseSparkline extends viz.core.BaseWidget { - /** Redraws a widget. */ - render(): void; - } - export interface dxBulletOptions extends BaseSparkline { - /** Specifies a color for the bullet bar. */ - color?: string; - /** Specifies an end value for the invisible scale. */ - endScaleValue?: number; - /** Specifies whether or not to show the target line. */ - showTarget?: boolean; - /** Specifies whether or not to show the line indicating zero on the invisible scale. */ - showZeroLevel?: boolean; - /** Specifies a start value for the invisible scale. */ - startScaleValue?: number; - /** Specifies the value indicated by the target line. */ - target?: number; - /** Specifies a color for both the target and zero level lines. */ - targetColor?: string; - /** Specifies the width of the target line. */ - targetWidth?: number; - /** Specifies the primary value indicated by the bullet bar. */ - value?: number; - } - /** A bullet graph widget. */ - export class dxBullet extends BaseSparkline { - constructor(element: JQuery, options?: dxBulletOptions); - constructor(element: Element, options?: dxBulletOptions); - } - export interface dxSparklineOptions extends BaseSparklineOptions { - /** Specifies the data source field that provides arguments for a sparkline. */ - argumentField?: string; - /** Sets a color for the bars indicating negative values. Available for a sparkline of the bar type only. */ - barNegativeColor?: string; - /** Sets a color for the bars indicating positive values. Available for a sparkline of the bar type only. */ - barPositiveColor?: string; - /** Specifies a data source for the sparkline. */ - dataSource?: Array; - /** Sets a color for the boundary of both the first and last points on a sparkline. */ - firstLastColor?: string; - /** Specifies whether a sparkline ignores null data points or not. */ - ignoreEmptyPoints?: boolean; - /** Sets a color for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ - lineColor?: string; - /** Specifies a width for a line on a sparkline. Available for the sparklines of the line- and area-like types. */ - lineWidth?: number; - /** Sets a color for the bars indicating the values that are less than the winloss threshold. Available for a sparkline of the winloss type only. */ - lossColor?: string; - /** Sets a color for the boundary of the maximum point on a sparkline. */ - maxColor?: string; - /** Sets a color for the boundary of the minimum point on a sparkline. */ - minColor?: string; - /** Sets a color for points on a sparkline. Available for the sparklines of the line- and area-like types. */ - pointColor?: string; - /** Specifies the diameter of sparkline points in pixels. Available for the sparklines of line- and area-like types. */ - pointSize?: number; - /** Specifies a symbol to use as a point marker on a sparkline. Available for the sparklines of the line- and area-like types. */ - pointSymbol?: string; - /** Specifies whether or not to indicate both the first and last values on a sparkline. */ - showFirstLast?: boolean; - /** Specifies whether or not to indicate both the minimum and maximum values on a sparkline. */ - showMinMax?: boolean; - /** Determines the type of a sparkline. */ - type?: string; - /** Specifies the data source field that provides values for a sparkline. */ - valueField?: string; - /** Sets a color for the bars indicating the values greater than a winloss threshold. Available for a sparkline of the winloss type only. */ - winColor?: string; - /** Specifies a value that serves as a threshold for the sparkline of the winloss type. */ - winlossThreshold?: number; - } - /** A sparkline widget. */ - export class dxSparkline extends BaseSparkline { - constructor(element: JQuery, options?: dxSparklineOptions); - constructor(element: Element, options?: dxSparklineOptions); - } -} -interface JQuery { - dxProgressBar(): JQuery; - dxProgressBar(options: "instance"): DevExpress.ui.dxProgressBar; - dxProgressBar(options: string): any; - dxProgressBar(options: string, ...params: any[]): any; - dxProgressBar(options: DevExpress.ui.dxProgressBarOptions): JQuery; - dxSlider(): JQuery; - dxSlider(options: "instance"): DevExpress.ui.dxSlider; - dxSlider(options: string): any; - dxSlider(options: string, ...params: any[]): any; - dxSlider(options: DevExpress.ui.dxSliderOptions): JQuery; - dxRangeSlider(): JQuery; - dxRangeSlider(options: "instance"): DevExpress.ui.dxRangeSlider; - dxRangeSlider(options: string): any; - dxRangeSlider(options: string, ...params: any[]): any; - dxRangeSlider(options: DevExpress.ui.dxRangeSliderOptions): JQuery; - dxFileUploader(): JQuery; - dxFileUploader(options: "instance"): DevExpress.ui.dxFileUploader; - dxFileUploader(options: string): any; - dxFileUploader(options: string, ...params: any[]): any; - dxFileUploader(options: DevExpress.ui.dxFileUploaderOptions): JQuery; - dxValidator(): JQuery; - dxValidator(options: "instance"): DevExpress.ui.dxValidator; - dxValidator(options: string): any; - dxValidator(options: string, ...params: any[]): any; - dxValidationGroup(): JQuery; - dxValidationGroup(options: "instance"): DevExpress.ui.dxValidationGroup; - dxValidationGroup(options: string): any; - dxValidationGroup(options: string, ...params: any[]): any; - dxValidationSummary(): JQuery; - dxValidationSummary(options: "instance"): DevExpress.ui.dxValidationSummary; - dxValidationSummary(options: string): any; - dxValidationSummary(options: string, ...params: any[]): any; - dxTooltip(): JQuery; - dxTooltip(options: "instance"): DevExpress.ui.dxTooltip; - dxTooltip(options: string): any; - dxTooltip(options: string, ...params: any[]): any; - dxTooltip(options: DevExpress.ui.dxTooltipOptions): JQuery; - dxDropDownList(): JQuery; - dxDropDownList(options: "instance"): DevExpress.ui.dxDropDownList; - dxDropDownList(options: string): any; - dxDropDownList(options: string, ...params: any[]): any; - dxDropDownList(options: DevExpress.ui.dxDropDownListOptions): JQuery; - dxToolbar(): JQuery; - dxToolbar(options: "instance"): DevExpress.ui.dxToolbar; - dxToolbar(options: string): any; - dxToolbar(options: string, ...params: any[]): any; - dxToolbar(options: DevExpress.ui.dxToolbarOptions): JQuery; - dxToast(): JQuery; - dxToast(options: "instance"): DevExpress.ui.dxToast; - dxToast(options: string): any; - dxToast(options: string, ...params: any[]): any; - dxToast(options: DevExpress.ui.dxToastOptions): JQuery; - dxTextEditor(): JQuery; - dxTextEditor(options: "instance"): DevExpress.ui.dxTextEditor; - dxTextEditor(options: string): any; - dxTextEditor(options: string, ...params: any[]): any; - dxTextEditor(options: DevExpress.ui.dxTextEditorOptions): JQuery; - dxTextBox(): JQuery; - dxTextBox(options: "instance"): DevExpress.ui.dxTextBox; - dxTextBox(options: string): any; - dxTextBox(options: string, ...params: any[]): any; - dxTextBox(options: DevExpress.ui.dxTextBoxOptions): JQuery; - dxTextArea(): JQuery; - dxTextArea(options: "instance"): DevExpress.ui.dxTextArea; - dxTextArea(options: string): any; - dxTextArea(options: string, ...params: any[]): any; - dxTextArea(options: DevExpress.ui.dxTextAreaOptions): JQuery; - dxTabs(): JQuery; - dxTabs(options: "instance"): DevExpress.ui.dxTabs; - dxTabs(options: string): any; - dxTabs(options: string, ...params: any[]): any; - dxTabs(options: DevExpress.ui.dxTabsOptions): JQuery; - dxTabPanel(): JQuery; - dxTabPanel(options: "instance"): DevExpress.ui.dxTabPanel; - dxTabPanel(options: string): any; - dxTabPanel(options: string, ...params: any[]): any; - dxTabPanel(options: DevExpress.ui.dxTabPanelOptions): JQuery; - dxSelectBox(): JQuery; - dxSelectBox(options: "instance"): DevExpress.ui.dxSelectBox; - dxSelectBox(options: string): any; - dxSelectBox(options: string, ...params: any[]): any; - dxSelectBox(options: DevExpress.ui.dxSelectBoxOptions): JQuery; - dxScrollView(): JQuery; - dxScrollView(options: "instance"): DevExpress.ui.dxScrollView; - dxScrollView(options: string): any; - dxScrollView(options: string, ...params: any[]): any; - dxScrollView(options: DevExpress.ui.dxScrollViewOptions): JQuery; - dxScrollable(): JQuery; - dxScrollable(options: "instance"): DevExpress.ui.dxScrollable; - dxScrollable(options: string): any; - dxScrollable(options: string, ...params: any[]): any; - dxScrollable(options: DevExpress.ui.dxScrollableOptions): JQuery; - dxRadioGroup(): JQuery; - dxRadioGroup(options: "instance"): DevExpress.ui.dxRadioGroup; - dxRadioGroup(options: string): any; - dxRadioGroup(options: string, ...params: any[]): any; - dxRadioGroup(options: DevExpress.ui.dxRadioGroupOptions): JQuery; - dxPopup(): JQuery; - dxPopup(options: "instance"): DevExpress.ui.dxPopup; - dxPopup(options: string): any; - dxPopup(options: string, ...params: any[]): any; - dxPopup(options: DevExpress.ui.dxPopupOptions): JQuery; - dxPopover(): JQuery; - dxPopover(options: "instance"): DevExpress.ui.dxPopover; - dxPopover(options: string): any; - dxPopover(options: string, ...params: any[]): any; - dxPopover(options: DevExpress.ui.dxPopoverOptions): JQuery; - dxOverlay(): JQuery; - dxOverlay(options: "instance"): DevExpress.ui.dxOverlay; - dxOverlay(options: string): any; - dxOverlay(options: string, ...params: any[]): any; - dxOverlay(options: DevExpress.ui.dxOverlayOptions): JQuery; - dxNumberBox(): JQuery; - dxNumberBox(options: "instance"): DevExpress.ui.dxNumberBox; - dxNumberBox(options: string): any; - dxNumberBox(options: string, ...params: any[]): any; - dxNumberBox(options: DevExpress.ui.dxNumberBoxOptions): JQuery; - dxNavBar(): JQuery; - dxNavBar(options: "instance"): DevExpress.ui.dxNavBar; - dxNavBar(options: string): any; - dxNavBar(options: string, ...params: any[]): any; - dxNavBar(options: DevExpress.ui.dxNavBarOptions): JQuery; - dxMultiView(): JQuery; - dxMultiView(options: "instance"): DevExpress.ui.dxMultiView; - dxMultiView(options: string): any; - dxMultiView(options: string, ...params: any[]): any; - dxMultiView(options: DevExpress.ui.dxMultiViewOptions): JQuery; - dxMap(): JQuery; - dxMap(options: "instance"): DevExpress.ui.dxMap; - dxMap(options: string): any; - dxMap(options: string, ...params: any[]): any; - dxMap(options: DevExpress.ui.dxMapOptions): JQuery; - dxLookup(): JQuery; - dxLookup(options: "instance"): DevExpress.ui.dxLookup; - dxLookup(options: string): any; - dxLookup(options: string, ...params: any[]): any; - dxLookup(options: DevExpress.ui.dxLookupOptions): JQuery; - dxLoadPanel(): JQuery; - dxLoadPanel(options: "instance"): DevExpress.ui.dxLoadPanel; - dxLoadPanel(options: string): any; - dxLoadPanel(options: string, ...params: any[]): any; - dxLoadPanel(options: DevExpress.ui.dxLoadPanelOptions): JQuery; - dxLoadIndicator(): JQuery; - dxLoadIndicator(options: "instance"): DevExpress.ui.dxLoadIndicator; - dxLoadIndicator(options: string): any; - dxLoadIndicator(options: string, ...params: any[]): any; - dxLoadIndicator(options: DevExpress.ui.dxLoadIndicatorOptions): JQuery; - dxList(): JQuery; - dxList(options: "instance"): DevExpress.ui.dxList; - dxList(options: string): any; - dxList(options: string, ...params: any[]): any; - dxList(options: DevExpress.ui.dxListOptions): JQuery; - dxGallery(): JQuery; - dxGallery(options: "instance"): DevExpress.ui.dxGallery; - dxGallery(options: string): any; - dxGallery(options: string, ...params: any[]): any; - dxGallery(options: DevExpress.ui.dxGalleryOptions): JQuery; - dxDropDownEditor(): JQuery; - dxDropDownEditor(options: "instance"): DevExpress.ui.dxDropDownEditor; - dxDropDownEditor(options: string): any; - dxDropDownEditor(options: string, ...params: any[]): any; - dxDropDownEditor(options: DevExpress.ui.dxDropDownEditorOptions): JQuery; - dxDateBox(): JQuery; - dxDateBox(options: "instance"): DevExpress.ui.dxDateBox; - dxDateBox(options: string): any; - dxDateBox(options: string, ...params: any[]): any; - dxDateBox(options: DevExpress.ui.dxDateBoxOptions): JQuery; - dxCheckBox(): JQuery; - dxCheckBox(options: "instance"): DevExpress.ui.dxCheckBox; - dxCheckBox(options: string): any; - dxCheckBox(options: string, ...params: any[]): any; - dxCheckBox(options: DevExpress.ui.dxCheckBoxOptions): JQuery; - dxBox(): JQuery; - dxBox(options: "instance"): DevExpress.ui.dxBox; - dxBox(options: string): any; - dxBox(options: string, ...params: any[]): any; - dxBox(options: DevExpress.ui.dxBoxOptions): JQuery; - dxButton(): JQuery; - dxButton(options: "instance"): DevExpress.ui.dxButton; - dxButton(options: string): any; - dxButton(options: string, ...params: any[]): any; - dxButton(options: DevExpress.ui.dxButtonOptions): JQuery; - dxCalendar(): JQuery; - dxCalendar(options: "instance"): DevExpress.ui.dxCalendar; - dxCalendar(options: string): any; - dxCalendar(options: string, ...params: any[]): any; - dxCalendar(options: DevExpress.ui.dxCalendarOptions): JQuery; - dxAccordion(): JQuery; - dxAccordion(options: "instance"): DevExpress.ui.dxAccordion; - dxAccordion(options: string): any; - dxAccordion(options: string, ...params: any[]): any; - dxAccordion(options: DevExpress.ui.dxAccordionOptions): JQuery; - dxAutocomplete(): JQuery; - dxAutocomplete(options: "instance"): DevExpress.ui.dxAutocomplete; - dxAutocomplete(options: string): any; - dxAutocomplete(options: string, ...params: any[]): any; - dxAutocomplete(options: DevExpress.ui.dxAutocompleteOptions): JQuery; - dxTileView(): JQuery; - dxTileView(options: "instance"): DevExpress.ui.dxTileView; - dxTileView(options: string): any; - dxTileView(options: string, ...params: any[]): any; - dxTileView(options: DevExpress.ui.dxTileViewOptions): JQuery; - dxSwitch(): JQuery; - dxSwitch(options: "instance"): DevExpress.ui.dxSwitch; - dxSwitch(options: string): any; - dxSwitch(options: string, ...params: any[]): any; - dxSwitch(options: DevExpress.ui.dxSwitchOptions): JQuery; - dxSlideOut(): JQuery; - dxSlideOut(options: "instance"): DevExpress.ui.dxSlideOut; - dxSlideOut(options: string): any; - dxSlideOut(options: string, ...params: any[]): any; - dxSlideOut(options: DevExpress.ui.dxSlideOutOptions): JQuery; - dxPivot(): JQuery; - dxPivot(options: "instance"): DevExpress.ui.dxPivot; - dxPivot(options: string): any; - dxPivot(options: string, ...params: any[]): any; - dxPivot(options: DevExpress.ui.dxPivotOptions): JQuery; - dxPanorama(): JQuery; - dxPanorama(options: "instance"): DevExpress.ui.dxPanorama; - dxPanorama(options: string): any; - dxPanorama(options: string, ...params: any[]): any; - dxPanorama(options: DevExpress.ui.dxPanoramaOptions): JQuery; - dxActionSheet(): JQuery; - dxActionSheet(options: "instance"): DevExpress.ui.dxActionSheet; - dxActionSheet(options: string): any; - dxActionSheet(options: string, ...params: any[]): any; - dxActionSheet(options: DevExpress.ui.dxActionSheetOptions): JQuery; - dxDropDownMenu(): JQuery; - dxDropDownMenu(options: "instance"): DevExpress.ui.dxDropDownMenu; - dxDropDownMenu(options: string): any; - dxDropDownMenu(options: string, ...params: any[]): any; - dxDropDownMenu(options: DevExpress.ui.dxDropDownMenuOptions): JQuery; - dxTreeView(): JQuery; - dxTreeView(options: "instance"): DevExpress.ui.dxTreeView; - dxTreeView(options: string): any; - dxTreeView(options: string, ...params: any[]): any; - dxTreeView(options: DevExpress.ui.dxTreeViewOptions): JQuery; - dxMenuBase(): JQuery; - dxMenuBase(options: "instance"): DevExpress.ui.dxMenuBase; - dxMenuBase(options: string): any; - dxMenuBase(options: string, ...params: any[]): any; - dxMenuBase(options: DevExpress.ui.dxMenuBaseOptions): JQuery; - dxMenu(): JQuery; - dxMenu(options: "instance"): DevExpress.ui.dxMenu; - dxMenu(options: string): any; - dxMenu(options: string, ...params: any[]): any; - dxMenu(options: DevExpress.ui.dxMenuOptions): JQuery; - dxContextMenu(): JQuery; - dxContextMenu(options: "instance"): DevExpress.ui.dxContextMenu; - dxContextMenu(options: string): any; - dxContextMenu(options: string, ...params: any[]): any; - dxContextMenu(options: DevExpress.ui.dxContextMenuOptions): JQuery; - dxColorBox(): JQuery; - dxColorBox(options: "instance"): DevExpress.ui.dxColorBox; - dxColorBox(options: string): any; - dxColorBox(options: string, ...params: any[]): any; - dxColorBox(options: DevExpress.ui.dxColorBoxOptions): JQuery; - dxDataGrid(): JQuery; - dxDataGrid(options: "instance"): DevExpress.ui.dxDataGrid; - dxDataGrid(options: string): any; - dxDataGrid(options: string, ...params: any[]): any; - dxDataGrid(options: DevExpress.ui.dxDataGridOptions): JQuery; - dxChart(options?: DevExpress.viz.charts.dxChartOptions): JQuery; - dxChart(methodName: string, ...params: any[]): any; - dxChart(methodName: "instance"): DevExpress.viz.charts.dxChart; - dxPieChart(options?: DevExpress.viz.charts.dxPieChartOptions): JQuery; - dxPieChart(methodName: string, ...params: any[]): any; - dxPieChart(methodName: "instance"): DevExpress.viz.charts.dxPieChart; - dxPolarChart(options?: DevExpress.viz.charts.dxPolarChartOptions): JQuery; - dxPolarChart(methodName: string, ...params: any[]): any; - dxPolarChart(methodName: "instance"): DevExpress.viz.charts.dxPolarChart; - dxLinearGauge(options?: DevExpress.viz.gauges.dxLinearGaugeOptions): JQuery; - dxLinearGauge(methodName: string, ...params: any[]): any; - dxLinearGauge(methodName: "instance"): DevExpress.viz.gauges.dxLinearGauge; - dxCircularGauge(options?: DevExpress.viz.gauges.dxCircularGaugeOptions): JQuery; - dxCircularGauge(methodName: string, ...params: any[]): any; - dxCircularGauge(methodName: "instance"): DevExpress.viz.gauges.dxCircularGauge; - dxBarGauge(options?: DevExpress.viz.gauges.dxBarGaugeOptions): JQuery; - dxBarGauge(methodName: string, ...params: any[]): any; - dxBarGauge(methodName: "instance"): DevExpress.viz.gauges.dxBarGauge; - dxRangeSelector(options?: DevExpress.viz.rangeSelector.dxRangeSelectorOptions): JQuery; - dxRangeSelector(methodName: string, ...params: any[]): any; - dxRangeSelector(methodName: "instance"): DevExpress.viz.rangeSelector.dxRangeSelector; - dxVectorMap(options?: DevExpress.viz.map.dxVectorMapOptions): JQuery; - dxVectorMap(methodName: string, ...params: any[]): any; - dxVectorMap(methodName: "instance"): DevExpress.viz.map.dxVectorMap; - dxBullet(options?: DevExpress.viz.sparklines.dxBulletOptions): JQuery; - dxBullet(methodName: string, ...params: any[]): any; - dxBullet(methodName: "instance"): DevExpress.viz.sparklines.dxBullet; - dxSparkline(options?: DevExpress.viz.sparklines.dxSparklineOptions): JQuery; - dxSparkline(methodName: string, ...params: any[]): any; - dxSparkline(methodName: "instance"): DevExpress.viz.sparklines.dxSparkline; -} \ No newline at end of file From dc8494fbc793686888120bd23bc4c385ce37cdde Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Wed, 10 Jun 2015 14:45:48 +0300 Subject: [PATCH 0089/2220] Update Kendo UI headers and definitions Closes #3976 for real --- kendo-ui/kendo-ui-tests.ts | 3 +- kendo-ui/kendo-ui.d.ts | 905 +++++++++++++++++++------------------ 2 files changed, 458 insertions(+), 450 deletions(-) diff --git a/kendo-ui/kendo-ui-tests.ts b/kendo-ui/kendo-ui-tests.ts index a9944b6afe..3c8a9bc042 100644 --- a/kendo-ui/kendo-ui-tests.ts +++ b/kendo-ui/kendo-ui-tests.ts @@ -1 +1,2 @@ -/// \ No newline at end of file +/// +/// diff --git a/kendo-ui/kendo-ui.d.ts b/kendo-ui/kendo-ui.d.ts index 3f5cb5d4fa..0683ab238b 100644 --- a/kendo-ui/kendo-ui.d.ts +++ b/kendo-ui/kendo-ui.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Kendo UI +// Type definitions for Kendo UI Professional v2015.1.609 // Project: http://www.telerik.com/kendo-ui -// Definitions by: Stefan Rahnev +// Definitions by: Telerik // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module kendo { @@ -1364,6 +1364,7 @@ declare module kendo.mobile { options: ApplicationOptions; hideLoading(): void; navigate(url: string, transition?: string): void; + replace(url: string, transition?: string): void; scroller(): kendo.mobile.ui.Scroller; showLoading(): void; view(): kendo.mobile.ui.View; @@ -1428,9 +1429,225 @@ declare module kendo.dataviz.map.layer { } } +declare module kendo.geometry { + class Arc extends Observable { + options: ArcOptions; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Circle extends Observable { + options: CircleOptions; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + center: kendo.geometry.Point; + radius: number; + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Matrix extends Observable { + options: MatrixOptions; + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Point extends Observable { + options: PointOptions; + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + x: number; + y: number; + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Rect extends Observable { + constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + options: RectOptions; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + 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; + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Size extends Observable { + options: SizeOptions; + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + width: number; + height: number; + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Transformation extends Observable { + options: TransformationOptions; + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + +} declare module kendo.drawing { class Arc extends kendo.drawing.Element { - constructor(options?: ArcOptions); + constructor(geometry: kendo.geometry.Arc, options?: ArcOptions); options: ArcOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -1465,7 +1682,7 @@ declare module kendo.drawing { class Circle extends kendo.drawing.Element { - constructor(options?: CircleOptions); + constructor(geometry: kendo.geometry.Circle, options?: CircleOptions); options: CircleOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -1605,7 +1822,7 @@ declare module kendo.drawing { class Image extends kendo.drawing.Element { - constructor(options?: ImageOptions); + constructor(src: string, rect: kendo.geometry.Rect); options: ImageOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -1638,7 +1855,7 @@ declare module kendo.drawing { class Layout extends kendo.drawing.Group { - constructor(options?: LayoutOptions); + constructor(rect: kendo.geometry.Rect, options?: LayoutOptions); options: LayoutOptions; rect(): kendo.geometry.Rect; rect(rect: kendo.geometry.Rect): void; @@ -1733,6 +1950,7 @@ declare module kendo.drawing { class OptionsStore extends kendo.Class { + constructor(options?: OptionsStoreOptions); options: OptionsStoreOptions; get(field: string): any; set(field: string, value: any): void; @@ -1837,6 +2055,7 @@ declare module kendo.drawing { class Segment extends kendo.Class { + constructor(anchor: kendo.geometry.Point, controlIn: kendo.geometry.Point, controlOut: kendo.geometry.Point); options: SegmentOptions; anchor(): kendo.geometry.Point; anchor(value: kendo.geometry.Point): void; @@ -1910,7 +2129,7 @@ declare module kendo.drawing { class Text extends kendo.drawing.Element { - constructor(options?: TextOptions); + constructor(content: string, position: kendo.geometry.Point, options?: TextOptions); options: TextOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -1947,221 +2166,6 @@ declare module kendo.drawing { } -} -declare module kendo.geometry { - class Arc extends Observable { - options: ArcOptions; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Circle extends Observable { - options: CircleOptions; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - center: kendo.geometry.Point; - radius: number; - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Matrix extends Observable { - options: MatrixOptions; - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Point extends Observable { - options: PointOptions; - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - x: number; - y: number; - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Rect extends Observable { - options: RectOptions; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - 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; - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Size extends Observable { - options: SizeOptions; - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - width: number; - height: number; - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Transformation extends Observable { - options: TransformationOptions; - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - } declare module kendo.ui { class AutoComplete extends kendo.ui.Widget { @@ -5569,7 +5573,7 @@ declare module kendo.ui { name?: string; axis?: string; container?: any; - connectWith?: any; + connectWith?: string; cursor?: string; cursorOffset?: SortableCursorOffset; disabled?: string; @@ -9601,7 +9605,7 @@ declare module kendo.dataviz.ui { interface DiagramShapeDefaultsConnector { name?: string; - position?: any; + position?: Function; } interface DiagramShapeDefaultsContent { @@ -9671,7 +9675,7 @@ declare module kendo.dataviz.ui { interface DiagramShapeConnector { description?: string; name?: string; - position?: any; + position?: Function; } interface DiagramShapeContent { @@ -13331,7 +13335,6 @@ declare module kendo.dataviz.diagram { constructor(options?: ConnectorOptions); options: ConnectorOptions; position(): kendo.dataviz.diagram.Point; - position(position: kendo.dataviz.diagram.Point): void; } interface ConnectorFill { @@ -13617,7 +13620,7 @@ declare module kendo { module drawing { function align(elements: any, rect: kendo.geometry.Rect, alignment: string): void; - function drawDOM(element: HTMLElement): JQueryPromise; + function drawDOM(element: JQuery): 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; @@ -13671,6 +13674,7 @@ declare module kendo { } declare module kendo.dataviz.map { class Extent extends kendo.Class { + constructor(nw: kendo.dataviz.map.Location, se: kendo.dataviz.map.Location); options: ExtentOptions; contains(location: kendo.dataviz.map.Location): boolean; containsAny(locations: any): boolean; @@ -13699,6 +13703,7 @@ declare module kendo.dataviz.map { class Layer extends kendo.Class { + constructor(map: kendo.dataviz.ui.Map, options?: LayerOptions); options: LayerOptions; show(): void; hide(): void; @@ -13716,6 +13721,7 @@ declare module kendo.dataviz.map { class Location extends kendo.Class { + constructor(lat: number, lng: number); options: LocationOptions; clone(): kendo.dataviz.map.Location; destination(destination: kendo.dataviz.map.Location): number; @@ -14631,9 +14637,225 @@ declare module kendo.ooxml { } +declare module kendo.dataviz.geometry { + class Arc extends Observable { + options: ArcOptions; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Circle extends Observable { + options: CircleOptions; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + center: kendo.geometry.Point; + radius: number; + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Matrix extends Observable { + options: MatrixOptions; + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Point extends Observable { + options: PointOptions; + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + x: number; + y: number; + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Rect extends Observable { + constructor(origin: kendo.geometry.Point, size: kendo.geometry.Size); + options: RectOptions; + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + 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; + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Size extends Observable { + options: SizeOptions; + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + width: number; + height: number; + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + + class Transformation extends Observable { + options: TransformationOptions; + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + isDefaultPrevented(): boolean; + preventDefault: Function; + } + + +} declare module kendo.dataviz.drawing { class Arc extends kendo.drawing.Element { - constructor(options?: ArcOptions); + constructor(geometry: kendo.geometry.Arc, options?: ArcOptions); options: ArcOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -14668,7 +14890,7 @@ declare module kendo.dataviz.drawing { class Circle extends kendo.drawing.Element { - constructor(options?: CircleOptions); + constructor(geometry: kendo.geometry.Circle, options?: CircleOptions); options: CircleOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -14808,7 +15030,7 @@ declare module kendo.dataviz.drawing { class Image extends kendo.drawing.Element { - constructor(options?: ImageOptions); + constructor(src: string, rect: kendo.geometry.Rect); options: ImageOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -14841,7 +15063,7 @@ declare module kendo.dataviz.drawing { class Layout extends kendo.drawing.Group { - constructor(options?: LayoutOptions); + constructor(rect: kendo.geometry.Rect, options?: LayoutOptions); options: LayoutOptions; rect(): kendo.geometry.Rect; rect(rect: kendo.geometry.Rect): void; @@ -14936,6 +15158,7 @@ declare module kendo.dataviz.drawing { class OptionsStore extends kendo.Class { + constructor(options?: OptionsStoreOptions); options: OptionsStoreOptions; get(field: string): any; set(field: string, value: any): void; @@ -15040,6 +15263,7 @@ declare module kendo.dataviz.drawing { class Segment extends kendo.Class { + constructor(anchor: kendo.geometry.Point, controlIn: kendo.geometry.Point, controlOut: kendo.geometry.Point); options: SegmentOptions; anchor(): kendo.geometry.Point; anchor(value: kendo.geometry.Point): void; @@ -15113,7 +15337,7 @@ declare module kendo.dataviz.drawing { class Text extends kendo.drawing.Element { - constructor(options?: TextOptions); + constructor(content: string, position: kendo.geometry.Point, options?: TextOptions); options: TextOptions; bbox(): kendo.geometry.Rect; clip(): kendo.drawing.Path; @@ -15150,221 +15374,6 @@ declare module kendo.dataviz.drawing { } -} -declare module kendo.dataviz.geometry { - class Arc extends Observable { - options: ArcOptions; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Circle extends Observable { - options: CircleOptions; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - center: kendo.geometry.Point; - radius: number; - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Matrix extends Observable { - options: MatrixOptions; - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Point extends Observable { - options: PointOptions; - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - x: number; - y: number; - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Rect extends Observable { - options: RectOptions; - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - 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; - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Size extends Observable { - options: SizeOptions; - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - width: number; - height: number; - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - - class Transformation extends Observable { - options: TransformationOptions; - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - isDefaultPrevented(): boolean; - preventDefault: Function; - } - - } interface HTMLElement { @@ -15378,8 +15387,6 @@ interface JQueryEventObject { } interface JQueryPromise { - pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise; - then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryPromise; } interface JQuery { From b3a3a0746c9fde9e6119e8a777e9857a6b2e1df2 Mon Sep 17 00:00:00 2001 From: Tobias Lundin Date: Wed, 10 Jun 2015 15:14:12 +0200 Subject: [PATCH 0090/2220] chrome: Add queue-interface for cast --- chrome/{chrome-cast.ts => chrome-cast.d.ts} | 253 ++++++++++++++++++-- 1 file changed, 238 insertions(+), 15 deletions(-) rename chrome/{chrome-cast.ts => chrome-cast.d.ts} (79%) diff --git a/chrome/chrome-cast.ts b/chrome/chrome-cast.d.ts similarity index 79% rename from chrome/chrome-cast.ts rename to chrome/chrome-cast.d.ts index 71a5305428..a314fb0631 100644 --- a/chrome/chrome-cast.ts +++ b/chrome/chrome-cast.d.ts @@ -206,7 +206,7 @@ declare module chrome.cast { sessionListener: (session: chrome.cast.Session) => void, receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void, autoJoinPolicy?: chrome.cast.AutoJoinPolicy, - defaultActionPolicy: chrome.cast.DefaultActionPolicy + defaultActionPolicy?: chrome.cast.DefaultActionPolicy ); sessionRequest: chrome.cast.SessionRequest; @@ -419,6 +419,17 @@ declare module chrome.cast { successCallback: (media: chrome.cast.media.Media) => void, errorCallback: (error: chrome.cast.Error) => void ) + + /** + * @param {!chrome.cast.media.QueueLoadRequest} queueLoadRequest + * @param {function(!chrome.cast.media.Media)} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueLoad( + queueLoadRequest: chrome.cast.media.QueueLoadRequest, + successCallback: (media: chrome.cast.media.Media) => void, + errorCallback: (error: chrome.cast.Error) => void + ) } interface Receiver { @@ -479,6 +490,9 @@ declare module chrome.cast { } declare module chrome.cast.media { + + const DEFAULT_MEDIA_RECEIVER_APP_ID: string; + /** * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaCommand @@ -542,7 +556,98 @@ declare module chrome.cast.media { FINISHED: string; ERROR: string; } - + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest + */ + interface RepeatMode { + OFF:string; + ALL:string; + SINGLE:string; + ALL_AND_SHUFFLE:string; + } + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem + */ + interface QueueItem { + new( + mediaInfo: chrome.cast.media.MediaInfo + ); + + activeTrackIds: Array; + autoplay: boolean; + customData: Object; + itemId: number; + media: chrome.cast.media.MediaInfo; + preloadTime: number; + startTime: number; + } + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest + */ + interface QueueLoadRequest { + new( + items: Array + ); + + customData: Object; + items: Array; + repeatMode: chrome.cast.media.RepeatMode; + startIndex: number; + } + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest + */ + interface QueueInsertItemsRequest { + new( + itemsToInsert: Array + ); + + customData: Object; + insertBefore:number; + items: Array; + } + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest + */ + interface QueueRemoveItemsRequest { + new( + itemIdsToRemove: Array + ); + + customData: Object; + itemIds: Array; + } + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest + */ + interface QueueReorderItemsRequest { + new( + itemIdsToReorder: Array + ); + + customData: Object; + insertBefore: number; + itemIds: Array; + } + + /** + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest + */ + interface QueueUpdateItemsRequest { + new( + itemsToUpdate: Array + ); + + customData: Object; + item: Array; + } + /** * @enum {string} * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TrackType @@ -724,7 +829,7 @@ declare module chrome.cast.media { images: Array; releaseDate: string; - // Deprecated + /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; releaseYear: number; } @@ -743,7 +848,7 @@ declare module chrome.cast.media { images: Array; releaseDate: string; - // Deprecated + /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; releaseYear: number; } @@ -763,7 +868,7 @@ declare module chrome.cast.media { images: Array; originalAirdate: string; - // Deprecated + /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; episodeTitle: string; seasonNumber: number; @@ -790,7 +895,7 @@ declare module chrome.cast.media { images: Array; releaseDate: string; - // Deprecated + /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; artistName: string; releaseYear: number; @@ -814,7 +919,7 @@ declare module chrome.cast.media { height: number; creationDateTime: string; - // Deprecated + /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; } @@ -852,18 +957,23 @@ declare module chrome.cast.media { mediaSessionId: number ); - sessionId: string; - mediaSessionId: number; + activeTrackIds: Array; + currentItemId: number; + customData: Object; + idleReason: chrome.cast.media.IdleReason; + items: Array; + loadingItemId: number; media: chrome.cast.media.MediaInfo; + mediaSessionId: number; playbackRate: number; playerState: chrome.cast.media.PlayerState; + preloadedItemId: number; + repeatMode: chrome.cast.media.RepeatMode; + sessionId: string; supportedMediaCommands: Array; volume: chrome.cast.Volume; - idleReason: chrome.cast.media.IdleReason; - activeTrackIds: Array; - customData: Object; - - // Deprecated + + /** Deprecated. Use getEstimatedTime instead */ currentTime: number; /** @@ -965,12 +1075,120 @@ declare module chrome.cast.media { listener: (boolean) => void ) - // Deprecated /** * @return {number} * @suppress {deprecated} Uses currentTime member to compute estimated time. */ getEstimatedTime(): number + + /** + * @param {!chrome.cast.media.QueueItem} item + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueAppendItem ( + item: chrome.cast.media.QueueItem, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!chrome.cast.media.QueueInsertItemsRequest} queueInsertItemsRequest + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueInsertItems ( + queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!number} itemId + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueJumpToItem ( + itemId: number, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!number} itemId + * @param {!number} newIndex + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueMoveItemToNewIndex ( + itemId: number, + newIndex: number, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueNext ( + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queuePrev ( + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!number} itemId + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueRemoveItem ( + itemId: number, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!chrome.cast.media.QueueReorderItemsRequest} queueReorderItemsRequest + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueReorderItems ( + queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!chrome.cast.media.RepeatMode} repeatMode + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueSetRepeatMode ( + repeatMode: chrome.cast.media.RepeatMode, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + + /** + * @param {!chrome.cast.media.QueueUpdateItemsRequest} queueUpdateItemsRequest + * @param {function()} successCallback + * @param {function(!chrome.cast.Error)} errorCallback + */ + queueUpdateItems ( + queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest, + successCallback: Function, + errorCallback: (error: chrome.cast.Error) => void + ) + } interface Track { @@ -1030,4 +1248,9 @@ declare module chrome.cast.media.timeout { var stop: number; var setVolume: number; var editTracksInfo: number; + var queueInsert: number; + var queueLoad: number; + var queueRemove: number; + var queueReorder: number; + var queueUpdate: number; } \ No newline at end of file From 878c6889f4e276df10b5175477e5fed4dc60df59 Mon Sep 17 00:00:00 2001 From: Norbert Wagner Date: Wed, 10 Jun 2015 17:48:10 +0200 Subject: [PATCH 0091/2220] Knex: Added primary(), index() and unique() for TableBuilder --- knex/knex.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/knex/knex.d.ts b/knex/knex.d.ts index 53a2e722a6..c4408aecb3 100644 --- a/knex/knex.d.ts +++ b/knex/knex.d.ts @@ -343,6 +343,9 @@ declare module "knex" { uuid(columnName: string): ColumnBuilder; comment(val: string): TableBuilder; specificType(columnName: string, type: string): ColumnBuilder; + primary(columnNames: string[]) : TableBuilder; + index(columnNames: string[], indexName?: string, indexType?: string) : TableBuilder; + unique(columnNames: string[], indexName?: string) : TableBuilder; } interface CreateTableBuilder extends TableBuilder { From 4e5e52edca5d0d8eb92710cb40fa04b0cfda04d9 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 8 Jun 2015 16:48:55 -0700 Subject: [PATCH 0092/2220] [moment]: relativeTimeThreshold can be a getter fix signature. --- moment/moment-node.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index 13f1b9362e..ba5fe85d16 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -465,7 +465,8 @@ declare module moment { max(moments: Moment[]): Moment; normalizeUnits(unit: string): string; - relativeTimeThreshold(threshold: string, limit: number): void; + relativeTimeThreshold(threshold: string): number|boolean; + relativeTimeThreshold(threshold: string, limit:number): boolean; /** * Constant used to enable explicit ISO_8601 format parsing. From df507c636cf0c799a8a20f35af89a3d0caae6c32 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 10 Jun 2015 12:29:45 -0500 Subject: [PATCH 0093/2220] Add virtual-dom tests and fix syntax to appease DT's automated checkers --- virtual-dom/virtual-dom-tests.ts | 33 ++++++++++++++++++++++++++++++++ virtual-dom/virtual-dom.d.ts | 26 +++++++++++++++++-------- 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 virtual-dom/virtual-dom-tests.ts diff --git a/virtual-dom/virtual-dom-tests.ts b/virtual-dom/virtual-dom-tests.ts new file mode 100644 index 0000000000..98d5f16429 --- /dev/null +++ b/virtual-dom/virtual-dom-tests.ts @@ -0,0 +1,33 @@ +/// +import virtual_dom = require("virtual-dom"); +import VNode = virtual_dom.VNode; +import h = virtual_dom.h; + +function renderAny(object: any): VNode { + if (object === undefined) { + return h('i.undefined', 'undefined'); + } + else if (object === null) { + return h('b.null', 'null'); + } + else if (Array.isArray(object)) { + return h('span.array', ['[', object.map(renderAny), ']']); + } + else if (typeof object === 'object') { + var object_children = Object.keys(object).map(key => { + var child = object[key]; + return h('div', [ + h('span.key', [key, ':']), + renderAny(child), + ]); + }); + return h('div.object', object_children); + } + else if (typeof object === 'number') { + return h('span.number', object.toString()); + } + else if (typeof object === 'boolean') { + return h('span.boolean', object.toString()); + } + return h('span.string', object.toString()); +} diff --git a/virtual-dom/virtual-dom.d.ts b/virtual-dom/virtual-dom.d.ts index 10575e8ca8..4902304a1d 100644 --- a/virtual-dom/virtual-dom.d.ts +++ b/virtual-dom/virtual-dom.d.ts @@ -1,3 +1,8 @@ +// Type definitions for virtual-dom 2.0.1 +// Project: https://github.com/Matt-Esch/virtual-dom +// Definitions by: Christopher Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module VirtualDOM { interface VHook { hook(node: Element, propertyName: string): void; @@ -39,7 +44,7 @@ declare module VirtualDOM { interface VText { text: string; - new (text: any); + new(text: any): VText; version: string; type: string; // 'VirtualText' } @@ -71,7 +76,7 @@ declare module VirtualDOM { // THUNK = 8 // } interface VPatch { - vNode: VNode, + vNode: VNode; patch: any; new(type: number, vNode: VNode, patch: any): VPatch; version: string; @@ -93,8 +98,8 @@ declare module VirtualDOM { create() calls either document.createElement() or document.createElementNS(), for which the common denominator is Element (not HTMLElement). */ - function create(vnode: VText, opts?: {document?: Document, warn?: boolean}): Text; - function create(vnode: VNode | Widget | Thunk, opts?: {document?: Document, warn?: boolean}): Element; + function create(vnode: VText, opts?: {document?: Document; warn?: boolean}): Text; + function create(vnode: VNode | Widget | Thunk, opts?: {document?: Document; warn?: boolean}): Element; function h(tagName: string, properties: createProperties, children: string | VChild[]): VNode; function h(tagName: string, children: string | VChild[]): VNode; function diff(left: VTree, right: VTree): VPatch[]; @@ -106,16 +111,21 @@ declare module VirtualDOM { } declare module "virtual-dom/h" { - export = VirtualDOM.h; + // export = VirtualDOM.h; works just fine, but the DT checker doesn't like it + import h = VirtualDOM.h; + export = h; } declare module "virtual-dom/create-element" { - export = VirtualDOM.create; + import create = VirtualDOM.create; + export = create; } declare module "virtual-dom/diff" { - export = VirtualDOM.diff; + import diff = VirtualDOM.diff; + export = diff; } declare module "virtual-dom/patch" { - export = VirtualDOM.patch; + import patch = VirtualDOM.patch; + export = patch; } declare module "virtual-dom" { export = VirtualDOM; From e75a0e995133de6ae22f7df7e3b9aad22819b185 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 10 Jun 2015 12:39:40 -0500 Subject: [PATCH 0094/2220] Add unorm.d.ts header and unorm tests file --- unorm/unorm-tests.ts | 11 +++++++++++ unorm/unorm.d.ts | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 unorm/unorm-tests.ts diff --git a/unorm/unorm-tests.ts b/unorm/unorm-tests.ts new file mode 100644 index 0000000000..6d2ba030dc --- /dev/null +++ b/unorm/unorm-tests.ts @@ -0,0 +1,11 @@ +/// +import unorm = require("unorm"); + +function listNormalizations(raw: string) { + return [ + unorm.nfd(raw), + unorm.nfkd(raw), + unorm.nfc(raw), + unorm.nfkc(raw), + ]; +} diff --git a/unorm/unorm.d.ts b/unorm/unorm.d.ts index 9f96fcef05..b2f0bc5773 100644 --- a/unorm/unorm.d.ts +++ b/unorm/unorm.d.ts @@ -1,3 +1,8 @@ +// Type definitions for unorm 1.3.3 +// Project: https://github.com/walling/unorm +// Definitions by: Christopher Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + declare module unorm { interface Static { nfd(str: string): string; From 5ebf25ddbff4017a65efeb23cdd0003123e0e8e9 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 10 Jun 2015 13:12:36 -0500 Subject: [PATCH 0095/2220] Fix async.waterfall signature (callback has variadic argument structure) --- async/async.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/async/async.d.ts b/async/async.d.ts index 475191aaf2..adf6fe11be 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -96,7 +96,7 @@ interface Async { doWhilst(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void; until(test: () => boolean, fn: AsyncVoidFunction, callback: (err: any) => void): void; doUntil(fn: AsyncVoidFunction, test: () => boolean, callback: (err: any) => void): void; - waterfall(tasks: Function[], callback?: AsyncResultArrayCallback): void; + waterfall(tasks: Function[], callback?: (err: any, ...arguments: any[]) => void): void; queue(worker: AsyncWorker, concurrency: number): AsyncQueue; priorityQueue(worker: AsyncWorker, concurrency: number): AsyncPriorityQueue; auto(tasks: any, callback?: AsyncResultArrayCallback): void; From 76b5640ff738f23be0e69d017577fe273c68bb34 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 10 Jun 2015 13:33:24 -0500 Subject: [PATCH 0096/2220] Add {read,write}{U,}Int{LE,BE} methods to NodeBuffer interface --- node/node.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 7043a2806f..574439b7e1 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -329,6 +329,14 @@ interface NodeBuffer { length: number; copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; readUInt8(offset: number, noAsset?: boolean): number; readUInt16LE(offset: number, noAssert?: boolean): number; readUInt16BE(offset: number, noAssert?: boolean): number; From b9804ec7533f0bab72e6ae2b125a0aca8c487352 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Wed, 10 Jun 2015 13:40:24 -0500 Subject: [PATCH 0097/2220] Add Sync versions for all convenience methods in Node.js's built-in 'zlib' module --- node/node.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 7043a2806f..841212a16b 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -596,12 +596,19 @@ declare module "zlib" { export function createUnzip(options?: ZlibOptions): Unzip; export function deflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateSync(buf: Buffer, options?: ZlibOptions): any; export function deflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function deflateRawSync(buf: Buffer, options?: ZlibOptions): any; export function gzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gzipSync(buf: Buffer, options?: ZlibOptions): any; export function gunzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function gunzipSync(buf: Buffer, options?: ZlibOptions): any; export function inflate(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateSync(buf: Buffer, options?: ZlibOptions): any; export function inflateRaw(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function inflateRawSync(buf: Buffer, options?: ZlibOptions): any; export function unzip(buf: Buffer, callback: (error: Error, result: any) =>void ): void; + export function unzipSync(buf: Buffer, options?: ZlibOptions): any; // Constants export var Z_NO_FLUSH: number; From 7ce1ae3e69aca7c88a9013b398916e6874cd029c Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 10 Jun 2015 21:35:45 +0200 Subject: [PATCH 0098/2220] added angular-dynamic-locale --- .../angular-dynamic-locale-tests.ts | 23 +++++++++++++++++++ .../angular-dynamic-locale.d.ts | 21 +++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 angular-dynamic-locale/angular-dynamic-locale-tests.ts create mode 100644 angular-dynamic-locale/angular-dynamic-locale.d.ts diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/angular-dynamic-locale/angular-dynamic-locale-tests.ts new file mode 100644 index 0000000000..a42d0c4460 --- /dev/null +++ b/angular-dynamic-locale/angular-dynamic-locale-tests.ts @@ -0,0 +1,23 @@ +/// +/// + +var app = angular.module('testModule', ['tmh.dynamicLocale']); +app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => { + localStorageServiceProvider + .localeLocationPattern("app/config/locales/") + .useCookieStorage(); +}); + +class LocaleTestController { + + constructor(tmhDynamicLocaleService: angular.dynamicLocale.tmhDynamicLocaleService) { + + var locale = tmhDynamicLocaleService.get(); + + var newLocale = "mt" + tmhDynamicLocaleService.set(newLocale); + } + +} + +app.controller('TestController', LocaleTestController); diff --git a/angular-dynamic-locale/angular-dynamic-locale.d.ts b/angular-dynamic-locale/angular-dynamic-locale.d.ts new file mode 100644 index 0000000000..a30df1d7ed --- /dev/null +++ b/angular-dynamic-locale/angular-dynamic-locale.d.ts @@ -0,0 +1,21 @@ +// Type definitions for angular-dynamic-locale v0.1.27 +// Project: https://github.com/lgalfaso/angular-dynamic-locale +// Definitions by: Stephen Lautier +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.dynamicLocale { + + interface tmhDynamicLocaleService { + set(locale: string): void; + get(): string; + } + + interface tmhDynamicLocaleProvider extends angular.IServiceProvider { + localeLocationPattern(location: string): tmhDynamicLocaleProvider; + localeLocationPattern(): string; + useStorage(storageName: string): void; + useCookieStorage(): void; + } +} \ No newline at end of file From abb8a7f490d60cdae88bc09427ce125e374c43e7 Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 10 Jun 2015 21:40:56 +0200 Subject: [PATCH 0099/2220] removed angular-dynamic-locale until other pull request is done --- .../angular-dynamic-locale-tests.ts | 23 ------------------- .../angular-dynamic-locale.d.ts | 21 ----------------- 2 files changed, 44 deletions(-) delete mode 100644 angular-dynamic-locale/angular-dynamic-locale-tests.ts delete mode 100644 angular-dynamic-locale/angular-dynamic-locale.d.ts diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/angular-dynamic-locale/angular-dynamic-locale-tests.ts deleted file mode 100644 index a42d0c4460..0000000000 --- a/angular-dynamic-locale/angular-dynamic-locale-tests.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// -/// - -var app = angular.module('testModule', ['tmh.dynamicLocale']); -app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => { - localStorageServiceProvider - .localeLocationPattern("app/config/locales/") - .useCookieStorage(); -}); - -class LocaleTestController { - - constructor(tmhDynamicLocaleService: angular.dynamicLocale.tmhDynamicLocaleService) { - - var locale = tmhDynamicLocaleService.get(); - - var newLocale = "mt" - tmhDynamicLocaleService.set(newLocale); - } - -} - -app.controller('TestController', LocaleTestController); diff --git a/angular-dynamic-locale/angular-dynamic-locale.d.ts b/angular-dynamic-locale/angular-dynamic-locale.d.ts deleted file mode 100644 index a30df1d7ed..0000000000 --- a/angular-dynamic-locale/angular-dynamic-locale.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Type definitions for angular-dynamic-locale v0.1.27 -// Project: https://github.com/lgalfaso/angular-dynamic-locale -// Definitions by: Stephen Lautier -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -/// - -declare module angular.dynamicLocale { - - interface tmhDynamicLocaleService { - set(locale: string): void; - get(): string; - } - - interface tmhDynamicLocaleProvider extends angular.IServiceProvider { - localeLocationPattern(location: string): tmhDynamicLocaleProvider; - localeLocationPattern(): string; - useStorage(storageName: string): void; - useCookieStorage(): void; - } -} \ No newline at end of file From e7d05ef700ef36cb3a57b2a58effd2d12be120b4 Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Wed, 10 Jun 2015 15:46:06 -0400 Subject: [PATCH 0100/2220] Fixes coordinate grid mixin --- dcjs/dc.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dcjs/dc.d.ts b/dcjs/dc.d.ts index bf31738019..9a7cda23a3 100644 --- a/dcjs/dc.d.ts +++ b/dcjs/dc.d.ts @@ -185,7 +185,7 @@ declare module DC { colorCalculator: IGetSet, T>; } - export interface CoordinateGridMixin extends BaseMixin, MarginMixin, BaseMixin { + export interface CoordinateGridMixin extends BaseMixin, MarginMixin, ColorMixin { rangeChart: IGetSet, T>; zoomScale: IGetSet, T>; zoomOutRestrict: IGetSet; From fa362c0ba9371f044ba716da118fd75e8615ec65 Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 10 Jun 2015 22:36:23 +0200 Subject: [PATCH 0101/2220] added angular-dynamic-locale definitions --- .../angular-dynamic-locale-tests.ts | 23 +++++++++++++++++++ .../angular-dynamic-locale.d.ts | 21 +++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 angular-dynamic-locale/angular-dynamic-locale-tests.ts create mode 100644 angular-dynamic-locale/angular-dynamic-locale.d.ts diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/angular-dynamic-locale/angular-dynamic-locale-tests.ts new file mode 100644 index 0000000000..a42d0c4460 --- /dev/null +++ b/angular-dynamic-locale/angular-dynamic-locale-tests.ts @@ -0,0 +1,23 @@ +/// +/// + +var app = angular.module('testModule', ['tmh.dynamicLocale']); +app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleProvider) => { + localStorageServiceProvider + .localeLocationPattern("app/config/locales/") + .useCookieStorage(); +}); + +class LocaleTestController { + + constructor(tmhDynamicLocaleService: angular.dynamicLocale.tmhDynamicLocaleService) { + + var locale = tmhDynamicLocaleService.get(); + + var newLocale = "mt" + tmhDynamicLocaleService.set(newLocale); + } + +} + +app.controller('TestController', LocaleTestController); diff --git a/angular-dynamic-locale/angular-dynamic-locale.d.ts b/angular-dynamic-locale/angular-dynamic-locale.d.ts new file mode 100644 index 0000000000..a30df1d7ed --- /dev/null +++ b/angular-dynamic-locale/angular-dynamic-locale.d.ts @@ -0,0 +1,21 @@ +// Type definitions for angular-dynamic-locale v0.1.27 +// Project: https://github.com/lgalfaso/angular-dynamic-locale +// Definitions by: Stephen Lautier +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular.dynamicLocale { + + interface tmhDynamicLocaleService { + set(locale: string): void; + get(): string; + } + + interface tmhDynamicLocaleProvider extends angular.IServiceProvider { + localeLocationPattern(location: string): tmhDynamicLocaleProvider; + localeLocationPattern(): string; + useStorage(storageName: string): void; + useCookieStorage(): void; + } +} \ No newline at end of file From cb4e2e858b2b6995a81f6ad27958347cd4e9e8fb Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 10 Jun 2015 22:39:57 +0200 Subject: [PATCH 0102/2220] reverted knockout.punches header update for this branch --- knockout.punches/knockout.punches.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout.punches/knockout.punches.d.ts b/knockout.punches/knockout.punches.d.ts index fbb78cd46f..d219d61f15 100644 --- a/knockout.punches/knockout.punches.d.ts +++ b/knockout.punches/knockout.punches.d.ts @@ -1,6 +1,6 @@ // Type definitions for knockout.punches 0.5.1 // Project: https://github.com/mbest/knockout.punches -// Definitions by: Stephen Lautier +// Definitions by: Stephen Lautier // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 1e3569b0df144dff1cfacbf649e9c861ef9e7936 Mon Sep 17 00:00:00 2001 From: Urs Wegmann Date: Thu, 11 Jun 2015 09:20:35 +0200 Subject: [PATCH 0103/2220] Fixed Options.tagNameProcessors for xml2js --- xml2js/xml2js.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xml2js/xml2js.d.ts b/xml2js/xml2js.d.ts index 33ad64978b..0dc03add70 100644 --- a/xml2js/xml2js.d.ts +++ b/xml2js/xml2js.d.ts @@ -64,7 +64,7 @@ declare module 'xml2js' { normalize?: boolean; normalizeTags?: boolean; strict?: boolean; - tagNameProcessors?: (name: string) => string; + tagNameProcessors?: [(name: string) => string]; trim?: boolean; validator?: Function; xmlns?: boolean; From 2a714679f74a80b935ed3d968815506fa08fba7e Mon Sep 17 00:00:00 2001 From: Tobias Lundin Date: Thu, 11 Jun 2015 09:45:01 +0200 Subject: [PATCH 0104/2220] chrome: fix failing tests for cast syntax --- chrome/chrome-cast.d.ts | 150 ++++++++++++++++++++-------------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/chrome/chrome-cast.d.ts b/chrome/chrome-cast.d.ts index a314fb0631..53945029f6 100644 --- a/chrome/chrome-cast.d.ts +++ b/chrome/chrome-cast.d.ts @@ -188,7 +188,7 @@ declare module chrome.cast { receiver: chrome.cast.Receiver, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void interface ApiConfig { /** @@ -207,7 +207,7 @@ declare module chrome.cast { receiverListener: (receiverAvailability: chrome.cast.ReceiverAvailability) => void, autoJoinPolicy?: chrome.cast.AutoJoinPolicy, defaultActionPolicy?: chrome.cast.DefaultActionPolicy - ); + ):ApiConfig; sessionRequest: chrome.cast.SessionRequest; sessionListener: (session: chrome.cast.Session) => void; @@ -228,7 +228,7 @@ declare module chrome.cast { code: chrome.cast.ErrorCode, description?: string, details?: Object - ); + ):Error; code: chrome.cast.ErrorCode; description?: string; @@ -244,7 +244,7 @@ declare module chrome.cast { */ new( url: string - ); + ):Image; url: string; height?: number; @@ -255,7 +255,7 @@ declare module chrome.cast { new( platform: chrome.cast.SenderPlatform - ); + ):SenderApplication; platform: chrome.cast.SenderPlatform; url?: string; @@ -274,7 +274,7 @@ declare module chrome.cast { appId: string, capabilities?: Array, timeout?: number - ); + ):SessionRequest; appId: string; capabilities: Array; @@ -298,7 +298,7 @@ declare module chrome.cast { displayName: string, appImages: Array, receiver: chrome.cast.Receiver - ); + ):Session; sessionId: string; appId: string; @@ -319,7 +319,7 @@ declare module chrome.cast { newLevel: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ):void /** * @param {boolean} muted @@ -330,7 +330,7 @@ declare module chrome.cast { muted: boolean, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ):void /** * @param {function()} successCallback @@ -339,7 +339,7 @@ declare module chrome.cast { leave( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ):void /** * @param {function()} successCallback @@ -348,7 +348,7 @@ declare module chrome.cast { stop( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ):void /** * @param {string} namespace @@ -361,21 +361,21 @@ declare module chrome.cast { message: string, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ):void /** * @param {function(boolean)} listener */ addUpdateListener( - listener: (boolean) => void - ) + listener: (isAlive:boolean) => void + ):void /** * @param {function(boolean)} listener */ removeUpdateListener( - listener: (boolean) => void - ) + listener: (isAlive:boolean) => void + ):void /** * @param {string} namespace @@ -383,8 +383,8 @@ declare module chrome.cast { */ addMessageListener( namespace: string, - listener: (string, string) => void - ) + listener: (namespace: string, message: string) => void + ):void /** * @param {string} namespace @@ -392,22 +392,22 @@ declare module chrome.cast { */ removeMessageListener( namespace: string, - listener: (string, string) => void - ) + listener: (namespace:string, message:string) => void + ):void /** * @param {function(!chrome.cast.media.Media)} listener */ addMediaListener( listener: (media: chrome.cast.media.Media) => void - ) + ):void /** * @param {function(!chrome.cast.media.Media)} listener */ removeMediaListener( listener: (media: chrome.cast.media.Media) => void - ) + ):void /** * @param {!chrome.cast.media.LoadRequest} loadRequest @@ -418,7 +418,7 @@ declare module chrome.cast { loadRequest: chrome.cast.media.LoadRequest, successCallback: (media: chrome.cast.media.Media) => void, errorCallback: (error: chrome.cast.Error) => void - ) + ):void /** * @param {!chrome.cast.media.QueueLoadRequest} queueLoadRequest @@ -429,7 +429,7 @@ declare module chrome.cast { queueLoadRequest: chrome.cast.media.QueueLoadRequest, successCallback: (media: chrome.cast.media.Media) => void, errorCallback: (error: chrome.cast.Error) => void - ) + ):void } interface Receiver { @@ -446,7 +446,7 @@ declare module chrome.cast { friendlyName: string, capabilities?: Array, volume?: chrome.cast.Volume - ); + ):Receiver; label: string; friendlyName: string; @@ -466,7 +466,7 @@ declare module chrome.cast { new( statusText: string, appImages: Array - ); + ):ReceiverDisplayStatus; statusText: string; appImages: Array; @@ -482,7 +482,7 @@ declare module chrome.cast { new( level?: number, muted?: boolean - ); + ):Volume; level?: number; muted?: boolean; @@ -491,7 +491,7 @@ declare module chrome.cast { declare module chrome.cast.media { - const DEFAULT_MEDIA_RECEIVER_APP_ID: string; + var DEFAULT_MEDIA_RECEIVER_APP_ID: string; /** * @enum {string} @@ -573,7 +573,7 @@ declare module chrome.cast.media { interface QueueItem { new( mediaInfo: chrome.cast.media.MediaInfo - ); + ):QueueItem; activeTrackIds: Array; autoplay: boolean; @@ -590,7 +590,7 @@ declare module chrome.cast.media { interface QueueLoadRequest { new( items: Array - ); + ):QueueLoadRequest; customData: Object; items: Array; @@ -604,7 +604,7 @@ declare module chrome.cast.media { interface QueueInsertItemsRequest { new( itemsToInsert: Array - ); + ):QueueInsertItemsRequest; customData: Object; insertBefore:number; @@ -617,7 +617,7 @@ declare module chrome.cast.media { interface QueueRemoveItemsRequest { new( itemIdsToRemove: Array - ); + ):QueueRemoveItemsRequest; customData: Object; itemIds: Array; @@ -629,7 +629,7 @@ declare module chrome.cast.media { interface QueueReorderItemsRequest { new( itemIdsToReorder: Array - ); + ):QueueReorderItemsRequest; customData: Object; insertBefore: number; @@ -642,7 +642,7 @@ declare module chrome.cast.media { interface QueueUpdateItemsRequest { new( itemsToUpdate: Array - ); + ):QueueUpdateItemsRequest; customData: Object; item: Array; @@ -722,7 +722,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest */ - new(); + new():GetStatusRequest; customData: Object; } @@ -732,7 +732,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest */ - new(); + new():PauseRequest; customData: Object; } @@ -742,7 +742,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest */ - new(); + new():PlayRequest; customData: Object; } @@ -752,7 +752,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest */ - new(); + new():SeekRequest; currentTime: number; resumeState: chrome.cast.media.ResumeState; @@ -764,7 +764,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest */ - new(); + new():StopRequest; customData: Object; } @@ -777,7 +777,7 @@ declare module chrome.cast.media { */ new( volume: chrome.cast.Volume - ); + ):VolumeRequest; volume: chrome.cast.Volume; customData: Object; @@ -791,7 +791,7 @@ declare module chrome.cast.media { */ new( mediaInfo: chrome.cast.media.MediaInfo - ); + ):LoadRequest; activeTrackIds: Array; autoplay: boolean; @@ -810,7 +810,7 @@ declare module chrome.cast.media { new( activeTrackIds?: Array, textTrackStyle?: chrome.cast.media.TextTrackStyle - ); + ):EditTracksInfoRequest; activeTrackIds: Array; textTrackStyle: chrome.cast.media.TextTrackStyle; @@ -821,17 +821,17 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GenericMediaMetadata */ - new(); + new():GenericMediaMetadata; - metadataType: chrome.cast.media.MetadataType; - title: string; - subtitle: string; images: Array; + metadataType: chrome.cast.media.MetadataType; releaseDate: string; + releaseYear: number; + subtitle: string; + title: string; /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; - releaseYear: number; } interface MovieMediaMetadata { @@ -839,18 +839,18 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata */ - new(); - + new():MovieMediaMetadata; + + images: Array; metadataType: chrome.cast.media.MetadataType; + releaseDate: string; + releaseYear: number; + subtitle: string; title: string; studio: string; - subtitle: string; - images: Array; - releaseDate: string; - + /** Deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; - releaseYear: number; } interface TvShowMediaMetadata { @@ -858,7 +858,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata */ - new(); + new(): TvShowMediaMetadata; metadataType: chrome.cast.media.MetadataType; seriesTitle: string; @@ -881,7 +881,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata */ - new(); + new(): MusicTrackMediaMetadata; metadataType: chrome.cast.media.MetadataType; albumName: string; @@ -906,7 +906,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata */ - new(); + new(): PhotoMediaMetadata; metadataType: chrome.cast.media.MetadataType; title: string; @@ -933,7 +933,7 @@ declare module chrome.cast.media { new( contentId: string, contentType: string - ); + ): MediaInfo; contentId: string; streamType: chrome.cast.media.StreamType; @@ -955,7 +955,7 @@ declare module chrome.cast.media { new( sessionId: string, mediaSessionId: number - ); + ): Media; activeTrackIds: Array; currentItemId: number; @@ -1065,15 +1065,15 @@ declare module chrome.cast.media { * @param {function(boolean)} listener */ addUpdateListener( - listener: (boolean) => void - ) + listener: (isAlive:boolean) => void + ): void /** * @param {function(boolean)} listener */ removeUpdateListener( - listener: (boolean) => void - ) + listener: (isAlive:boolean) => void + ): void /** * @return {number} @@ -1090,7 +1090,7 @@ declare module chrome.cast.media { item: chrome.cast.media.QueueItem, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!chrome.cast.media.QueueInsertItemsRequest} queueInsertItemsRequest @@ -1101,7 +1101,7 @@ declare module chrome.cast.media { queueInsertItemsRequest: chrome.cast.media.QueueInsertItemsRequest, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!number} itemId @@ -1112,7 +1112,7 @@ declare module chrome.cast.media { itemId: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!number} itemId @@ -1125,7 +1125,7 @@ declare module chrome.cast.media { newIndex: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {function()} successCallback @@ -1134,7 +1134,7 @@ declare module chrome.cast.media { queueNext ( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {function()} successCallback @@ -1143,7 +1143,7 @@ declare module chrome.cast.media { queuePrev ( successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!number} itemId @@ -1154,7 +1154,7 @@ declare module chrome.cast.media { itemId: number, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!chrome.cast.media.QueueReorderItemsRequest} queueReorderItemsRequest @@ -1165,7 +1165,7 @@ declare module chrome.cast.media { queueReorderItemsRequest: chrome.cast.media.QueueReorderItemsRequest, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!chrome.cast.media.RepeatMode} repeatMode @@ -1176,7 +1176,7 @@ declare module chrome.cast.media { repeatMode: chrome.cast.media.RepeatMode, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void /** * @param {!chrome.cast.media.QueueUpdateItemsRequest} queueUpdateItemsRequest @@ -1187,7 +1187,7 @@ declare module chrome.cast.media { queueUpdateItemsRequest: chrome.cast.media.QueueUpdateItemsRequest, successCallback: Function, errorCallback: (error: chrome.cast.Error) => void - ) + ): void } @@ -1201,7 +1201,7 @@ declare module chrome.cast.media { new( trackId: number, trackType: chrome.cast.media.TrackType - ); + ): Track; trackId: number; trackContentId: string; @@ -1218,7 +1218,7 @@ declare module chrome.cast.media { * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle */ - new(); + new(): TextTrackStyle; foregroundColor: string; backgroundColor: string; From d2801f50eb05d6d5d91256642640f721321bf845 Mon Sep 17 00:00:00 2001 From: Wayne Maurer Date: Thu, 11 Jun 2015 11:55:01 +0200 Subject: [PATCH 0105/2220] backdropClass property added backdropClass property to modal service settings --- angular-ui-bootstrap/angular-ui-bootstrap.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts index c3675e7a98..f6273dbd34 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap.d.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap.d.ts @@ -264,6 +264,11 @@ declare module angular.ui.bootstrap { */ keyboard?: boolean; + /** + * additional CSS class(es) to be added to a modal backdrop template + */ + backdropClass?: string; + /** * additional CSS class(es) to be added to a modal window template */ From af5f3b0cd3862197d7a8d4bde2d7b7ba10f59e6f Mon Sep 17 00:00:00 2001 From: Wayne Maurer Date: Thu, 11 Jun 2015 11:57:13 +0200 Subject: [PATCH 0106/2220] backdropClass property added backdropClass property to modal service settings --- angular-ui-bootstrap/angular-ui-bootstrap-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index c9883f86e0..5aef97afac 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -141,6 +141,7 @@ testApp.controller('TestCtrl', ( scope: $scope, template: "
i'm a template!
", templateUrl: '/templates/modal.html', + backdropClass: 'modal-backdrop-test', windowClass: 'modal-test' }); @@ -227,4 +228,4 @@ interface IModalTestCtrlScope { close(): void; dismiss(): void; -} \ No newline at end of file +} From ce644f3dd330e22fa0e5b7eb43a728618d3fd41b Mon Sep 17 00:00:00 2001 From: vilicvane Date: Thu, 11 Jun 2015 18:00:48 +0800 Subject: [PATCH 0107/2220] complete multer declaration. --- multer/multer.d.ts | 87 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/multer/multer.d.ts b/multer/multer.d.ts index b188c22ae4..7e152894f6 100644 --- a/multer/multer.d.ts +++ b/multer/multer.d.ts @@ -1,14 +1,95 @@ // Type definitions for multer // Project: https://github.com/expressjs/multer -// Definitions by: jt000 +// Definitions by: jt000 vilicvane // Definitions: https://github.com/borisyankov/DefinitelyTyped /// +declare module Express { + export interface Request { + files: { + [fieldname: string]: { + /** Field name specified in the form */ + fieldname: string; + /** Name of the file on the user's computer */ + originalname: string; + /** Renamed file name */ + name: string; + /** Encoding type of the file */ + encoding: string; + /** Mime type of the file */ + mimetype: string; + /** Location of the uploaded file */ + path: string; + /** Extension of the file */ + extension: string; + /** Size of the file in bytes */ + size: number; + /** If the file was truncated due to size limitation */ + truncated: boolean; + /** Raw data (is null unless the inMemory option is true) */ + buffer: Buffer; + } + } + } +} + declare module "multer" { import express = require('express'); - function multer(options?: any): express.RequestHandler; + function multer(options?: multer.Options): express.RequestHandler; + + module multer { + type Options = { + /** The destination directory for the uploaded files. */ + dest?: string; + /** An object specifying the size limits of the following optional properties. This object is passed to busboy directly, and the details of properties can be found on https://github.com/mscdex/busboy#busboy-methods */ + limits?: { + /** Max field name size (Default: 100 bytes) */ + fieldNameSize?: number; + /** Max field value size (Default: 1MB) */ + fieldSize?: number; + /** Max number of non- file fields (Default: Infinity) */ + fields?: number; + /** For multipart forms, the max file size (in bytes)(Default: Infinity) */ + fileSize?: number; + /** For multipart forms, the max number of file fields (Default: Infinity) */ + files?: number; + /** For multipart forms, the max number of parts (fields + files)(Default: Infinity) */ + parts?: number; + /** For multipart forms, the max number of header key=> value pairs to parse Default: 2000(same as node's http). */ + headerPairs?: number; + }; + /** A Boolean value to specify whether empty submitted values should be processed and applied to req.body; defaults to false; */ + includeEmptyFields?: boolean; + /** If this Boolean value is true, the file.buffer property holds the data in-memory that Multer would have written to disk. The dest option is still populated and the path property contains the proposed path to save the file. Defaults to false. */ + inMemory?: boolean; + /** Function to rename the uploaded files. Whatever the function returns will become the new name of the uploaded file (extension is not included). The fieldname and filename of the file will be available in this function, use them if you need to. */ + rename?: (fieldname: string, filename: string, req: Express.Request, res: Express.Response) => string; + /** Function to rename the directory in which to place uploaded files. The dest parameter is the default value originally assigned or passed into multer. The req and res parameters are also passed into the function because they may contain information (eg session data) needed to create the path (eg get userid from the session). */ + changeDest?: (dest: string, req: Express.Request, res: Express.Response) => string; + /** Event handler triggered when a file starts to be uploaded. A file object, with the following properties, is available to this function: fieldname, originalname, name, encoding, mimetype, path, and extension. */ + onFileUploadStart?: (file: string, req: Express.Request, res: Express.Response) => void; + /** Event handler triggered when a chunk of buffer is received. A buffer object along with a file object is available to the function. */ + onFileUploadData?: (file: string, data: Buffer, req: Express.Request, res: Express.Response) => void; + /** Event handler trigger when a file is completely uploaded. A file object is available to the function. */ + onFileUploadComplete?: (file: string, req: Express.Request, res: Express.Response) => void; + /** Event handler triggered when the form parsing starts. */ + onParseStart?: () => void; + /** Event handler triggered when the form parsing completes. The request object and the next objects are are passed to the function. */ + onParseEnd?: (req: Express.Request, next: () => void) => void; + /** Event handler for any errors encountering while processing the form. The error object and the next object is available to the function. If you are handling errors yourself, make sure to terminate the request or call the next() function, else the request will be left hanging. */ + onError?: () => void; + /** Event handler triggered when a file size exceeds the specification in the limit object. No more files will be parsed after the limit is reached. */ + onFileSizeLimit?: (file: string) => void; + /** Event handler triggered when the number of files exceed the specification in the limit object. No more files will be parsed after the limit is reached. */ + onFilesLimit?: () => void; + /** Event handler triggered when the number of fields exceed the specification in the limit object. No more fields will be parsed after the limit is reached. */ + onFieldsLimit?: () => void; + /** Event handler triggered when the number of parts exceed the specification in the limit object. No more files or fields will be parsed after the limit is reached. */ + onPartsLimit?: () => void; + }; + } export = multer; -} \ No newline at end of file +} From 376aa3d4ba6651c5c22a2a66fe67a2b32fc1d98a Mon Sep 17 00:00:00 2001 From: vilicvane Date: Thu, 11 Jun 2015 18:06:03 +0800 Subject: [PATCH 0108/2220] now multer extended `files` property --- express/express.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/express/express.d.ts b/express/express.d.ts index 0bd42b82f6..c5c623c9ba 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -389,8 +389,6 @@ declare module "express" { authenticatedUser: any; - files: any; - /** * Clear cookie `name`. * From a94992717c1800017483dc7de8aafdcfa0d87cd7 Mon Sep 17 00:00:00 2001 From: vilicvane Date: Thu, 11 Jun 2015 18:10:41 +0800 Subject: [PATCH 0109/2220] add missing comma --- 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 7e152894f6..fdde44b54f 100644 --- a/multer/multer.d.ts +++ b/multer/multer.d.ts @@ -1,6 +1,6 @@ // Type definitions for multer // Project: https://github.com/expressjs/multer -// Definitions by: jt000 vilicvane +// Definitions by: jt000 , vilicvane // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From 813035a67ff6e52846da23f58fe4739cecc60161 Mon Sep 17 00:00:00 2001 From: Ole Rehmsen Date: Thu, 11 Jun 2015 21:35:17 +0200 Subject: [PATCH 0110/2220] Add type definition for the mime property exposed on serve-static. JS source of serve-static exposes npm module mime, see: https://github.com/expressjs/serve-static/blob/master/index.js#L122 --- serve-static/serve-static-tests.ts | 6 ++++++ serve-static/serve-static.d.ts | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/serve-static/serve-static-tests.ts b/serve-static/serve-static-tests.ts index 6b16e842b2..36d2761cdd 100644 --- a/serve-static/serve-static-tests.ts +++ b/serve-static/serve-static-tests.ts @@ -18,3 +18,9 @@ app.use(serveStatic('/3', { res.setHeader('Server', 'server-static middleware'); } })); + +serveStatic.mime.define({ + 'application/babylon': ['babylon'], + 'application/babylonmeshdata': ['babylonmeshdata'], + 'application/fx': ['fx'] +}); \ No newline at end of file diff --git a/serve-static/serve-static.d.ts b/serve-static/serve-static.d.ts index b116d43848..f7d7e502f1 100644 --- a/serve-static/serve-static.d.ts +++ b/serve-static/serve-static.d.ts @@ -11,6 +11,7 @@ =============================================== */ /// +/// declare module "serve-static" { import express = require('express'); @@ -75,5 +76,11 @@ declare module "serve-static" { setHeaders?: (res: express.Response, path: string, stat: any) => any; }): express.Handler; + import m = require('mime'); + + module serveStatic { + var mime: typeof m; + } + export = serveStatic; } From cf09bf76ceed90346e23e70815e9b2a99bc21137 Mon Sep 17 00:00:00 2001 From: Alex Ford Date: Thu, 11 Jun 2015 16:09:10 -0400 Subject: [PATCH 0111/2220] Liberalize type of d3.event. Addresses #4590. --- d3/d3-tests.ts | 19 ++++++++++++++++--- d3/d3.d.ts | 8 +++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/d3/d3-tests.ts b/d3/d3-tests.ts index 5db3528f5f..a0c2d03120 100644 --- a/d3/d3-tests.ts +++ b/d3/d3-tests.ts @@ -873,7 +873,7 @@ function populationPyramid() { // Allow the arrow keys to change the displayed year. window.focus(); d3.select(window).on("keydown", function () { - switch (( d3.event).keyCode) { + switch (d3.event.keyCode) { case 37: year = Math.max(year0, year - 10); break; case 39: year = Math.min(year1, year + 10); break; } @@ -1291,12 +1291,12 @@ function forceDirectedVoronoi() { d3.select(window) .on("keydown", function() { // shift - if(( d3.event).keyCode == 16) { + if(d3.event.keyCode == 16) { zoomToAdd = false } // s - if(( d3.event).keyCode == 83) { + if(d3.event.keyCode == 83) { simulate = !simulate if(simulate) { force.start() @@ -2665,3 +2665,16 @@ function multiTest() { .attr("transform", "translate(0," + height + ")") .call(xAxis); } + +function testD3Events () { + d3.select('svg') + .on('click', () => { + var coords = [d3.event.pageX, d3.event.pageY]; + console.log("clicked", d3.event.target, "at " + coords); + }) + .on('keypress', () => { + if (d3.event.shiftKey) { + console.log('shift + ' + d3.event.which); + } + }); +} \ No newline at end of file diff --git a/d3/d3.d.ts b/d3/d3.d.ts index 2fa1493b7f..be329db811 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -918,7 +918,13 @@ declare module d3 { } /** - * The current event's value. Use this variable in a handler registered with selection.on. + * Interface for any and all d3 events. + */ + interface Event extends KeyboardEvent, MouseEvent { + } + + /** + * The current event's value. Use this variable in a handler registered with `selection.on`. */ export var event: Event; From 86d2c6672785f69f38060ea5cfba5b92a9eaa0fe Mon Sep 17 00:00:00 2001 From: Dustin Wehr Date: Thu, 11 Jun 2015 17:22:10 -0400 Subject: [PATCH 0112/2220] couple type tightenings --- google-drive-realtime-api/google-drive-realtime-api.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 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 8cf4aa97ba..8bb4af5c00 100644 --- a/google-drive-realtime-api/google-drive-realtime-api.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -226,7 +226,7 @@ declare module gapi.drive.realtime { // Returns the collaborative object with the given id. // @return non-null Object - getObject:any; + getObject: (id:string) => CollaborativeObject; // An estimate of the number of bytes used by data stored in the model. bytesUsed:number; @@ -334,7 +334,7 @@ declare module gapi.drive.realtime { sessionId : string; // The collaborative object that initiated this event. - target : Object; + target : CollaborativeObject; // The type of the event. type : string; From 7f74fc1a314a0cecaab10522e5e84a804711fa48 Mon Sep 17 00:00:00 2001 From: Dustin Wehr Date: Thu, 11 Jun 2015 17:43:06 -0400 Subject: [PATCH 0113/2220] Add definition for gapi.drive.realtime.Document --- .../google-drive-realtime-api.d.ts | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 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 8bb4af5c00..b1d970e3c6 100644 --- a/google-drive-realtime-api/google-drive-realtime-api.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -19,6 +19,9 @@ declare module gapi.drive.realtime { type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; + // TODO + export class Collaborator {} + // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeObject export class CollaborativeObject { @@ -395,18 +398,57 @@ declare module gapi.drive.realtime { } - // INCOMPLETE + // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Document export class Document { - // Gets the collaborative model associated with this document. - // @return non-null Model - getModel():Model; + // Whether the document is closed. Read-only; call close() to close the document. + isClosed : boolean; + + // Whether the document is stored in Google Drive. Read-only. + // This property is false for documents created using gapi.drive.realtime.newInMemoryDocument or + // gapi.drive.realtime.loadFromJson and true for all other documents. + isInGoogleDrive : boolean; + + // The approximate amount of time (in milliseconds) that changes have been waiting to be saved in Google Drive. + // If there are no unsaved changes or this is an in-memory document, this value is always 0. + // This value should remain low (for example, less than a few seconds) as long as the network is healthy and + // changes are being saved as quickly as they are generated. If the network is unreliable or down, or if changes + // are being made to the model more quickly than they can be saved, this value will continue to grow until the + // network catches up and the changes are successfully saved. + saveDelay : number; + + // 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 when + // the event is dispatched. + addEventListener(type:string, listener:GoogEventHandler, opt_capture?:boolean) : void; // Closes the document and disconnects from the server. // After this function is called, event listeners will no longer fire and attempts to access the document, model, // or model objects will throw a gapi.drive.realtime.DocumentClosedError. // Calling this function after the document has been closed will have no effect. close():void; + + // Gets an array of collaborators active in this session. Each collaborator is a jsMap with these fields: + // sessionId, userId, displayName, color, isMe, isAnonymous. + getCollaborators() : Collaborator[]; + + // Gets the collaborative model associated with this document. + // @return non-null Model + getModel():Model; + + // Removes all event listeners from this object. + removeAllEventListeners() : void; + + // Removes an event listener from the event target. The handler must be the same object as the one added. + // If the handler has not been added then nothing is done. + removeEventListener(type:string, listener:GoogEventHandler, opt_capture?:boolean) : void; + + // Saves a copy of this document to a new file. After this function is called, all changes to this document no + // longer affect the old document and are instead saved to the new file. + // The provided file ID must refer to a valid file in Drive which does not have any Realtime data for your app. + // This function can also be used on an in-memory file to convert it to a Drive-connected file. + saveAs(fileId:string) : void; + } } From d3dd026976a30f25e16e3677dd72dcb39af333ef Mon Sep 17 00:00:00 2001 From: mcivort Date: Thu, 11 Jun 2015 16:11:37 -0600 Subject: [PATCH 0114/2220] Add ability to specify custom map types --- googlemaps/google.maps.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index ecf319c83b..2250527c3a 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -65,7 +65,7 @@ declare module google.maps { getCenter(): LatLng; getDiv(): Element; getHeading(): number; - getMapTypeId(): MapTypeId; + getMapTypeId(): MapTypeId | string; getProjection(): Projection; getStreetView(): StreetViewPanorama; getTilt(): number; @@ -75,7 +75,7 @@ declare module google.maps { panToBounds(latLngBounds: LatLngBounds): void; setCenter(latlng: LatLng): void; setHeading(heading: number): void; - setMapTypeId(mapTypeId: MapTypeId): void; + setMapTypeId(mapTypeId: MapTypeId | string): void; setOptions(options: MapOptions): void; setStreetView(panorama: StreetViewPanorama): void; setTilt(tilt: number): void; @@ -133,7 +133,7 @@ declare module google.maps { /***** Controls *****/ export interface MapTypeControlOptions { - mapTypeIds?: MapTypeId[]; + mapTypeIds?: (MapTypeId | string)[]; position?: ControlPosition; style?: MapTypeControlStyle; } From 27eac40620e5a64d0437750754494b019f242e9b Mon Sep 17 00:00:00 2001 From: Guilherme Bernal Date: Thu, 11 Jun 2015 20:39:38 -0300 Subject: [PATCH 0115/2220] node-uuid: Use proper OR-type --- node-uuid/node-uuid.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-uuid/node-uuid.d.ts b/node-uuid/node-uuid.d.ts index b069e8f37f..c4fa865e52 100644 --- a/node-uuid/node-uuid.d.ts +++ b/node-uuid/node-uuid.d.ts @@ -23,7 +23,7 @@ interface UUIDOptions { * (Number | Date) Time in milliseconds since unix Epoch. * Default: The current time is used. */ - msecs?: any + msecs?: number|Date /** * (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if msecs is unspecified. From 15b2c6a2335d1e8bdbdbe29d29e1fd74d7e36dcb Mon Sep 17 00:00:00 2001 From: ukyo Date: Fri, 12 Jun 2015 18:02:29 +0900 Subject: [PATCH 0116/2220] Added definitions for pluralize --- pluralize/pluralize-tests.ts | 25 ++++++++++++++ pluralize/pluralize.d.ts | 65 ++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 pluralize/pluralize-tests.ts create mode 100644 pluralize/pluralize.d.ts diff --git a/pluralize/pluralize-tests.ts b/pluralize/pluralize-tests.ts new file mode 100644 index 0000000000..07d5a3dccf --- /dev/null +++ b/pluralize/pluralize-tests.ts @@ -0,0 +1,25 @@ +/// + +import pluralize = require('pluralize'); + +pluralize('test'); //=> "tests" +pluralize('test', 1); //=> "test" +pluralize('test', 5); //=> "tests" +pluralize('test', 1, true); //=> "1 test" +pluralize('test', 5, true); //=> "5 tests" + +pluralize.plural('regex'); //=> "regexes" +pluralize.addPluralRule(/gex$/i, 'gexii'); +pluralize.plural('regex'); //=> "regexii" + +pluralize.singular('singles'); //=> "single" +pluralize.addSingularRule(/singles$/i, 'singular'); +pluralize.singular('singles'); //=> "singular" + +pluralize.plural('irregular'); //=> "irregulars" +pluralize.addIrregularRule('irregular', 'regular'); +pluralize.plural('irregular'); //=> "regular" + +pluralize.plural('paper'); //=> "papers" +pluralize.addUncountableRule('paper'); +pluralize.plural('paper'); //=> "paper" \ No newline at end of file diff --git a/pluralize/pluralize.d.ts b/pluralize/pluralize.d.ts new file mode 100644 index 0000000000..501a96b124 --- /dev/null +++ b/pluralize/pluralize.d.ts @@ -0,0 +1,65 @@ +// Type definitions for pluralize +// Project: https://www.npmjs.com/package/pluralize +// Definitions by: Syu Kato +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface PluralizeStatic { + /** + * Pluralize or singularize a word based on the passed in count. + * + * @param word + * @param count + * @param inclusive + */ + (word: string, count?: number, inclusive?: boolean): string; + + /** + * Pluralize a word based. + * + * @param word + */ + plural(word: string): string; + + /** + * Singularize a word based. + * + * @param word + */ + singular(word: string): string; + + /** + * Add a pluralization rule to the collection. + * + * @param rule + * @param replacement + */ + addPluralRule(rule: string|RegExp, replacemant: string): void; + + /** + * Add a singularization rule to the collection. + * + * @param rule + * @param replacement + */ + addSingularRule(rule: string|RegExp, replacemant: string): void; + + /** + * Add an irregular word definition. + * + * @param single + * @param plural + */ + addIrregularRule(single: string, plural: string): void; + + /** + * Add an uncountable word rule. + * + * @param word + */ + addUncountableRule(word: string|RegExp): void; +} + +declare module "pluralize" { + export = pluralize; +} +declare var pluralize: PluralizeStatic; \ No newline at end of file From bfdb58ea52669e1391574b8a2536fec63c70e0a9 Mon Sep 17 00:00:00 2001 From: Aleksandr Filatov Date: Fri, 12 Jun 2015 12:52:59 +0300 Subject: [PATCH 0117/2220] added definitely typed for quixote library quixote is a css testing framework --- quixote/quixote-tests.ts | 36 ++++++ quixote/quixote.d.ts | 233 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) create mode 100644 quixote/quixote-tests.ts create mode 100644 quixote/quixote.d.ts diff --git a/quixote/quixote-tests.ts b/quixote/quixote-tests.ts new file mode 100644 index 0000000000..9217a076e8 --- /dev/null +++ b/quixote/quixote-tests.ts @@ -0,0 +1,36 @@ +/// +/// + +function test_createFrame() { + var frame; + before((done) => { + var options = { src: "" }; + frame = quixote.createFrame(options, done()); + }); +} + +function test_resetFrame() { + var frame; + before((done) => { + var options = { src: "" }; + frame = quixote.createFrame(options, done()); + }); + + beforeEach(() => { + frame.reset(); + }); +} + +function test_removeFrame() { + var frame; + before((done) => { + var options = { src: "" }; + frame = quixote.createFrame(options, done()); + }); + + after(function() { + frame.remove(); + }); +} + + diff --git a/quixote/quixote.d.ts b/quixote/quixote.d.ts new file mode 100644 index 0000000000..af9bf00561 --- /dev/null +++ b/quixote/quixote.d.ts @@ -0,0 +1,233 @@ +// Type definitions for quixote v0.7.0 +// Project: http://quixote-css.com/ +// Definitions by: Aleksandr Filatov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Quixote { + // Create a test iframe. This is a slow operation, so once you have a frame, it's best to use QFrame.reset() on it rather than creating a new frame for each test + createFrame(options: QuixoteFrameOptions, callback: (err: Error, loadedFrame: QFrame) => void): QFrame; +} + +interface QFrame { + // Reset the frame back to the state it was in immediately after you called quixote.createFrame() + reset(): void; + + // Remove the test frame entirely. + remove(): void; + + // Retrieve an element matching a selector. Throws an exception unless exactly one matching element is found + get(selector: string, nickname?: string): QElement; + + // Retrieve a list of elements matching a selector. If you want to ensure that exactly one element is retrieved, use frame.get() instead. + getAll(selector: string, nickname?: string): QElementList; + + // Create an element and append it to the frame's body. Throws an exception unless exactly one element is created. (But that one element may contain children.) + add(html: string, nickname?: string): QElement; + + // Provides access to descriptors for the frame's viewport (the part of the page that you can see in the frame, not including scrollbars) + viewport(): QElement; + + // Provides access to descriptors for the frame's page (everything you can see or scroll to, not including scrollbars) + page(): QElement; + + // Retrieves the frame's body element. + body(): QElement; + + // Changes the size of the frame. + resize(width: number, height: number): void; + + // Scroll the page so that top-left corner of the frame is as close as possible to an (x, y) coordinate. + scroll(x: number, y: number): void; + + // Determine the (x, y) coordinate of the top-left corner of the frame. This uses pageXOffset and pageYOffset under the covers. (On IE 8, it uses scrollLeft and scrollTop.) + getRawScrollPosition(x: number, y: number): Object; + + // Retrieve the underlying HTMLIFrameElement DOM element for the frame. + toDomElement(): HTMLIFrameElement; +} + +interface QElement { + // Compare the element's descriptors to a set of expected values and throw an exception if they don't match + assert(expected: ElementDescriptor, message?: string): void; + + // Compare the element's descriptors to a set of expected values. + diff(expected: ElementDescriptor): string; + + // Determine how the browser is actually rendering an element's style. This uses getComputedStyle() under the covers. (On IE 8, it uses currentStyle) + getRawStyle(property: string): string; + + // Determine where an element is displayed within the frame viewport, as computed by the browser + getRawPosition(): RawPositionObject; + + // Retrieve the underlying HTMLElement DOM element for the frame. + toDomElement(): HTMLElement; +} + +interface QElementList { + // Determine the number of elements in the list. + length(): number; + + // Retrieve an element from the list. Positive and negative indices are allowed. Throws an exception if the index is out of bounds. + at(index: number, nickname?: string): QElement; +} + +// Element positions and sizes are available on all QElement instances. +interface ElementDescriptor { + // The top edge of the element + top: PositionDescriptor; + + // The right edge of the element + right: PositionDescriptor; + + // The bottom edge of the element + bottom: PositionDescriptor; + + // The left edge of the element + left: PositionDescriptor; + + // Horizontal center: midway between the right and left edges. + center: PositionDescriptor; + + // Vertical middle: midway between the top and bottom edges. + middle: PositionDescriptor; + + // Width of the element. + width: SizeDescriptor; + + // Height of the element. + height: SizeDescriptor; +} + +// Viewport positions and sizes are available on QFrame.viewport() +interface ViewportDescriptor { + // The highest visible part of the page. + top: PositionDescriptor; + + // The rightmost visible part of the page. + right: PositionDescriptor; + + // The lowest visible part of the page. + bottom: PositionDescriptor; + + // The leftmost visible part of the page. + left: PositionDescriptor; + + // Horizontal center: midway between right and left + center: PositionDescriptor; + + // Vertical middle: midway between top and bottom. + middle: PositionDescriptor; + + // Width of the viewport. + width: SizeDescriptor; + + // Height of the viewport. + height: SizeDescriptor; +} + +// Page positions and sizes are available on QFrame.page(). +interface PageDescriptor { + // The top of the page. + top: PositionDescriptor; + + // The right side of the page. + right: PositionDescriptor; + + // The bottom of the page. + bottom: PositionDescriptor; + + // The left side of the page. + left: PositionDescriptor; + + // Horizontal center: midway between right and left. + center: PositionDescriptor; + + // Vertical middle: midway between top and bottom. + middle: PositionDescriptor; + + // Width of the page. + width: SizeDescriptor; + + // Height of the page. + height: SizeDescriptor; +} + +// Position descriptors represent an X or Y coordinate. The top-left corner of the page is (0, 0) and the values increase downward and to the right. +interface PositionDescriptor { + // Create a new descriptor that is further down the page or to the right. + plus(amount: SizeDescriptor): PositionDescriptor; + + // Create a new descriptor that is further down the page or to the right. + plus(amount: nubmer): PositionDescriptor; + + // Create a new descriptor that is further down the page or to the right. + minus(amount: SizeDescriptor): PositionDescriptor; + + // Create a new descriptor that is further down the page or to the right. + minus(amount: nubmer): PositionDescriptor; +} + +// Size descriptors represent width or height. +interface SizeDescriptor { + // Create a descriptor that's bigger than this one. + plus(amount: SizeDescriptor): SizeDescriptor; + + // Create a descriptor that's bigger than this one. + plus(amount: nubmer): SizeDescriptor; + + // Create a descriptor that's smaller than this one. + minus(amount: SizeDescriptor): SizeDescriptor; + + // Create a descriptor that's smaller than this one. + minus(amount: nubmer): SizeDescriptor; + + // Create a new descriptor that's a multiple or fraction of the size of this one. + times(multiple: nubmer): SizeDescriptor; +} + +interface QuixoteFrameOptions { + // Width of the iframe. Defaults to a large value (see stability note below) + width?: number; + + // Height of the iframe. Defaults to a large value (see stability note below) + height?: number; + + // URL of an HTML document to load into the frame. Must be served from same domain as the enclosing test document, or you could get same-origin policy errors. Defaults to an empty document with (to enable standards-mode rendering) + src?: string; + + // URL of a CSS stylesheet to load into the frame. Defaults to loading nothing + stylesheet?: string; +} + +interface RawPositionObject { + // top edge + top: number; + + // right edge + right: number; + + // bottom edge + bottom: number; + + // left edge + left: number; + + // width (right edge minus left edge) + width: number; + + // height (bottom edge minus top edge) + height: number; +} + +declare var quixote: Quixote; + +declare module "quixote" { + + class Quixote { + constructor(); + + createFrame(options, callback(err, frame)): QFrame; + } + + export = Quixote; +} From 939fb46dfad9dffcfe7b317791a5bba012153cd0 Mon Sep 17 00:00:00 2001 From: Aleksandr Filatov Date: Fri, 12 Jun 2015 13:43:18 +0300 Subject: [PATCH 0118/2220] fixed broken build --- quixote/quixote-tests.ts | 2 +- quixote/quixote.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quixote/quixote-tests.ts b/quixote/quixote-tests.ts index 9217a076e8..ee6b6e0906 100644 --- a/quixote/quixote-tests.ts +++ b/quixote/quixote-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// function test_createFrame() { diff --git a/quixote/quixote.d.ts b/quixote/quixote.d.ts index af9bf00561..bc9100b715 100644 --- a/quixote/quixote.d.ts +++ b/quixote/quixote.d.ts @@ -226,8 +226,8 @@ declare module "quixote" { class Quixote { constructor(); - createFrame(options, callback(err, frame)): QFrame; + createFrame(options, callback: (err: Error, frame: QFrame) => void): QFrame; } export = Quixote; -} +} \ No newline at end of file From dee1325471b483e66724dae11d9d31d4e6bee1a9 Mon Sep 17 00:00:00 2001 From: Aleksandr Filatov Date: Fri, 12 Jun 2015 13:53:42 +0300 Subject: [PATCH 0119/2220] fix #3 --- quixote/quixote-tests.ts | 2 +- quixote/quixote.d.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/quixote/quixote-tests.ts b/quixote/quixote-tests.ts index ee6b6e0906..e653df2508 100644 --- a/quixote/quixote-tests.ts +++ b/quixote/quixote-tests.ts @@ -1,4 +1,4 @@ -/// +/// /// function test_createFrame() { diff --git a/quixote/quixote.d.ts b/quixote/quixote.d.ts index bc9100b715..37bc1eb0ca 100644 --- a/quixote/quixote.d.ts +++ b/quixote/quixote.d.ts @@ -158,13 +158,13 @@ interface PositionDescriptor { plus(amount: SizeDescriptor): PositionDescriptor; // Create a new descriptor that is further down the page or to the right. - plus(amount: nubmer): PositionDescriptor; + plus(amount: number): PositionDescriptor; // Create a new descriptor that is further down the page or to the right. minus(amount: SizeDescriptor): PositionDescriptor; // Create a new descriptor that is further down the page or to the right. - minus(amount: nubmer): PositionDescriptor; + minus(amount: number): PositionDescriptor; } // Size descriptors represent width or height. @@ -173,16 +173,16 @@ interface SizeDescriptor { plus(amount: SizeDescriptor): SizeDescriptor; // Create a descriptor that's bigger than this one. - plus(amount: nubmer): SizeDescriptor; + plus(amount: number): SizeDescriptor; // Create a descriptor that's smaller than this one. minus(amount: SizeDescriptor): SizeDescriptor; // Create a descriptor that's smaller than this one. - minus(amount: nubmer): SizeDescriptor; + minus(amount: number): SizeDescriptor; // Create a new descriptor that's a multiple or fraction of the size of this one. - times(multiple: nubmer): SizeDescriptor; + times(multiple: number): SizeDescriptor; } interface QuixoteFrameOptions { @@ -226,7 +226,7 @@ declare module "quixote" { class Quixote { constructor(); - createFrame(options, callback: (err: Error, frame: QFrame) => void): QFrame; + createFrame(options: QuixoteFrameOptions, callback: (err: Error, loadedFrame: QFrame) => void): QFrame; } export = Quixote; From fe0ea20630acd7f7bf39621d86a15b2ae28a7ac5 Mon Sep 17 00:00:00 2001 From: Aleksandr Filatov Date: Fri, 12 Jun 2015 14:00:31 +0300 Subject: [PATCH 0120/2220] fixed test #1 --- quixote/quixote-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/quixote/quixote-tests.ts b/quixote/quixote-tests.ts index e653df2508..0f2d051f24 100644 --- a/quixote/quixote-tests.ts +++ b/quixote/quixote-tests.ts @@ -2,7 +2,7 @@ /// function test_createFrame() { - var frame; + var frame: QFrame; before((done) => { var options = { src: "" }; frame = quixote.createFrame(options, done()); @@ -10,7 +10,7 @@ function test_createFrame() { } function test_resetFrame() { - var frame; + var frame: QFrame; before((done) => { var options = { src: "" }; frame = quixote.createFrame(options, done()); @@ -22,7 +22,7 @@ function test_resetFrame() { } function test_removeFrame() { - var frame; + var frame: QFrame; before((done) => { var options = { src: "" }; frame = quixote.createFrame(options, done()); From 52038eca8702b6d3b1c1a75dd08c1a6d784b7b89 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Fri, 12 Jun 2015 19:00:56 +0200 Subject: [PATCH 0121/2220] adding Stream class with static factory methods --- streamjs/streamjs-tests.ts | 11 +++++++++++ streamjs/streamjs.d.ts | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 streamjs/streamjs-tests.ts create mode 100644 streamjs/streamjs.d.ts diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts new file mode 100644 index 0000000000..e5d9338515 --- /dev/null +++ b/streamjs/streamjs-tests.ts @@ -0,0 +1,11 @@ +// + +var numStream = Stream.make(10, 20); +numStream = Stream.make([10, 20]); +numStream = Stream.range(1, 5); +numStream = Stream.rangeClosed(1, 5); + +Stream.generate(function() { + return 1; +}); +Stream.generate(() => 1); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts new file mode 100644 index 0000000000..e1fe425366 --- /dev/null +++ b/streamjs/streamjs.d.ts @@ -0,0 +1,12 @@ +// Type definitions for streamjs 1.4.0 +// Project: http://streamjs.org/ +// Definitions by: Bence Eros +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare class Stream { + static make (...elems: T[]): Stream; + static make(elems: T[]): Stream; + static range(startInclusive: number, endExclusive: number): Stream; + static rangeClosed(startInclusive: number, endInclusive: number): Stream; + static generate(supplier: () => T): Stream; +} From a90baa3446ca61e406957a6bbde40d438c462231 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Fri, 12 Jun 2015 22:36:12 +0200 Subject: [PATCH 0122/2220] streamjs nonterminal operation definitions --- streamjs/streamjs-tests.ts | 36 +++++++++++++++++++++++++++++++++++- streamjs/streamjs.d.ts | 30 +++++++++++++++++++++++++----- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index e5d9338515..55bad2bd5f 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -1,6 +1,7 @@ // -var numStream = Stream.make(10, 20); +var numStream: Stream; +// numStream = Stream.make(10, 20); numStream = Stream.make([10, 20]); numStream = Stream.range(1, 5); numStream = Stream.rangeClosed(1, 5); @@ -9,3 +10,36 @@ Stream.generate(function() { return 1; }); Stream.generate(() => 1); + +var comparator = (s1, s2) => 0; + +numStream = numStream.filter(n => n % 2 == 0); +var strStream = numStream + .dropWhile((n) => n % 2 == 0) + .map(n => "number " + n) + .dropWhile(/^$/) + .limit(100) + .sorted() + .sort() + .sorted(comparator) + .sort(comparator) + .shuffle() + .reverse() + .distinct() + .skip(5) + .peek(s => console.log(s)) + .takeWhile(s => s.length < 5) + .takeWhile(/^aa.*$/) + .slice(5, 2) + ; + +var strArray = strStream.toArray(); + +class MyList { + elems: any[]; +} + +var elems: any[]; +elems = Stream.make([new MyList, new MyList]) + .flatMap(list => list.elems) + .toArray(); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index e1fe425366..1ac6c534c8 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -4,9 +4,29 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare class Stream { - static make (...elems: T[]): Stream; - static make(elems: T[]): Stream; - static range(startInclusive: number, endExclusive: number): Stream; - static rangeClosed(startInclusive: number, endInclusive: number): Stream; - static generate(supplier: () => T): Stream; + // static make (...elems: T[]): Stream; + static make (elems: T[]): Stream; + static range (startInclusive: number, endExclusive: number): Stream; + static rangeClosed (startInclusive: number, endInclusive: number): Stream; + static generate (supplier: () => T): Stream; + + distinct(): Stream; + dropWhile(predicate: (elem: T) => boolean): Stream; + dropWhile(regexp: RegExp): Stream; + filter(predicate: (T) => boolean): Stream; + map (mapper: (T) => U): Stream; + flatMap (mapper: (T) => U[]): Stream; + limit(limit: number): Stream; + peek(consumer: (elem: T) => void ): Stream; + reverse(): Stream; + sorted(): Stream; + sorted(comparator: (e1: T, e2: T) => number): Stream; + sort(): Stream; + sort(comparator: (e1: T, e2: T) => number): Stream; + shuffle(): Stream; + skip(n: number): Stream; + slice(begin, end): Stream; + takeWhile(predicate: (elem: T) => boolean): Stream; + takeWhile(regexp: RegExp): Stream; + toArray(): T[]; } From 57e6fd59b6e022b7ead2acc5811dc27363971a03 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Fri, 12 Jun 2015 23:19:26 +0200 Subject: [PATCH 0123/2220] streamjs nonterminal operation definitions --- streamjs/streamjs-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index 55bad2bd5f..b1fba365cd 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -31,6 +31,7 @@ var strStream = numStream .takeWhile(s => s.length < 5) .takeWhile(/^aa.*$/) .slice(5, 2) + .forEach(s => console.log(s)) ; var strArray = strStream.toArray(); From b68684ddb562dbda02a4c10608e2f32e0b95f636 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sat, 13 Jun 2015 01:55:29 +0200 Subject: [PATCH 0124/2220] adding most is the terminal operations - partitioning, joining, and iterator ops are missing yet --- streamjs/streamjs-tests.ts | 50 ++++++++++++++++++++++++++++++++++++-- streamjs/streamjs.d.ts | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index b1fba365cd..50a398418d 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -31,16 +31,62 @@ var strStream = numStream .takeWhile(s => s.length < 5) .takeWhile(/^aa.*$/) .slice(5, 2) - .forEach(s => console.log(s)) ; var strArray = strStream.toArray(); +strStream.forEach(s => console.log(s)); +var opt: Stream.Optional = strStream.findFirst(); +opt = strStream.findAny(); +opt = strStream.max(); +opt = strStream.max((s1, s2) => 0); +opt = strStream.min(); +opt = strStream.min((s1, s2) => 0); + +var sum = numStream.sum(); +var avg = numStream.average(); +avg = numStream.avg(); + +var count = numStream.count(); +count = numStream.size(); + +var allMatch: boolean = numStream.allMatch(n => true); +allMatch = strStream.allMatch(/^$/); + +var anyMatch: boolean = numStream.anyMatch(n => false); +anyMatch = strStream.anyMatch(/^$/); + +var noneMatch: boolean = numStream.noneMatch(n => false); +noneMatch = strStream.noneMatch(/^$/); + +sum = numStream.reduce(0, (n1, n2) => n1 + n2); +opt = strStream.reduce((s1, s2) => s1 + s2); + class MyList { elems: any[]; + name: string } var elems: any[]; -elems = Stream.make([new MyList, new MyList]) + +var myStream = Stream.make([new MyList, new MyList]); +elems = myStream .flatMap(list => list.elems) .toArray(); + //.forEach(s => console.log(s)); + + +numStream.collect({ + supplier: () => 0, + accumulator: (n1, n2) => n1 + n2, + finisher: n => n +}); + +var groupingResult = myStream.groupBy(lst => lst.name); +var elems = groupingResult["hello"].elems; +groupingResult = myStream.groupingBy(lst => lst.name); + +var mappingResult = myStream.toMap(lst => lst.name, (e1, e2) => e2); +console.log(mappingResult["a"]); + +myStream.toMap(lst => lst.name); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 1ac6c534c8..1478d7a68d 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -10,15 +10,40 @@ declare class Stream { static rangeClosed (startInclusive: number, endInclusive: number): Stream; static generate (supplier: () => T): Stream; + anyMatch(predicate: (elem: T) => boolean): boolean; + anyMatch(regexp: RegExp): boolean; + allMatch(predicate: (elem: T) => boolean): boolean; + allMatch(regexp: RegExp): boolean; + average(): number; + avg(): number; + collect(collector: Stream.Collector): T; + count(): number; distinct(): Stream; dropWhile(predicate: (elem: T) => boolean): Stream; dropWhile(regexp: RegExp): Stream; filter(predicate: (T) => boolean): Stream; + findAny(): Stream.Optional; + findFirst(): Stream.Optional; + forEach(consumer: (elem: T) => void): void; + + groupBy(mapper: (elem: T) => string): Stream.GroupingResult; + groupingBy(mapper: (elem: T) => string): Stream.GroupingResult; + toMap(keyMapper: (elem: T) => string, mergeFunction?: (elem1: T, elem2: T) => T): T[]; + map (mapper: (T) => U): Stream; + max(): Stream.Optional; + max(comparator: (e1: T, e2: T) => number): Stream.Optional; + min(): Stream.Optional; + min(comparator: (elem1: T, elem2: T) => number): Stream.Optional; + noneMatch(predicate: (elem: T) => boolean): boolean; + noneMatch(regexp: RegExp): boolean; flatMap (mapper: (T) => U[]): Stream; limit(limit: number): Stream; peek(consumer: (elem: T) => void ): Stream; + reduce(identity: T, accumulator: (e1: T, e2: T) => T): T; + reduce(accumulator: (e1: T, e2: T) => T): Stream.Optional; reverse(): Stream; + size(): number; sorted(): Stream; sorted(comparator: (e1: T, e2: T) => number): Stream; sort(): Stream; @@ -26,7 +51,24 @@ declare class Stream { shuffle(): Stream; skip(n: number): Stream; slice(begin, end): Stream; + sum(): T; takeWhile(predicate: (elem: T) => boolean): Stream; takeWhile(regexp: RegExp): Stream; toArray(): T[]; } + +declare module Stream { + export interface GroupingResult { + [index: string]: T + } + + export interface Collector { + supplier(): T; + accumulator(e1: T, e2: T): T; + finisher(result: T): T + } + + export class Optional { + + } +} From 0b7ba6010e409cf9a69430ff72476cbf438744e4 Mon Sep 17 00:00:00 2001 From: Abe Haruhiko Date: Sat, 13 Jun 2015 16:17:47 +0900 Subject: [PATCH 0125/2220] Update parse/parse.d.ts --- parse/parse.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 9f8df5c3f6..4237247ef0 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -649,7 +649,7 @@ declare module Parse { static current(): User; static signUp(username: string, password: string, attrs: any, options?: ParseDefaultOptions): Promise; static logIn(username: string, password: string, options?: ParseDefaultOptions): Promise; - static logOut(): void; + static logOut(): Promise; static allowCustomUserClass(isAllowed: boolean): void; static become(sessionToken: string, options?: ParseDefaultOptions): Promise; static requestPasswordReset(email: string, options?: ParseDefaultOptions): Promise; From 4db5c10489fc72213b19e3b5f10df985384fddf5 Mon Sep 17 00:00:00 2001 From: AbeHaruhiko Date: Sat, 13 Jun 2015 16:29:15 +0900 Subject: [PATCH 0126/2220] Update parse/parse.d.ts --- parse/parse.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse/parse.d.ts b/parse/parse.d.ts index 4237247ef0..cb4fa8b2b3 100644 --- a/parse/parse.d.ts +++ b/parse/parse.d.ts @@ -649,7 +649,7 @@ declare module Parse { static current(): User; static signUp(username: string, password: string, attrs: any, options?: ParseDefaultOptions): Promise; static logIn(username: string, password: string, options?: ParseDefaultOptions): Promise; - static logOut(): Promise; + static logOut(): Promise; static allowCustomUserClass(isAllowed: boolean): void; static become(sessionToken: string, options?: ParseDefaultOptions): Promise; static requestPasswordReset(email: string, options?: ParseDefaultOptions): Promise; From 128121aa80e95e0e470c4e45269f154d44f9bf9a Mon Sep 17 00:00:00 2001 From: AbeHaruhiko Date: Sat, 13 Jun 2015 22:45:59 +0900 Subject: [PATCH 0127/2220] Update parse/parse-tests.ts --- parse/parse-tests.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parse/parse-tests.ts b/parse/parse-tests.ts index c7cc6ff49e..d373c064d6 100644 --- a/parse/parse-tests.ts +++ b/parse/parse-tests.ts @@ -265,7 +265,9 @@ function test_user_acl_roles() { role.getRoles().add(role); role.save(); - Parse.User.logOut(); + Parse.User.logOut().then(function (data) { + // logged out + }); } function test_facebook_util() { @@ -397,4 +399,4 @@ function test_view() { var model = Parse.User.current(); var view = new Parse.View(); -} \ No newline at end of file +} From b1192f0e1571397a03137b0df39652047d03c1db Mon Sep 17 00:00:00 2001 From: Kristof Mattei Date: Sat, 13 Jun 2015 16:21:22 +0200 Subject: [PATCH 0128/2220] Set the correct namespace --- angular-local-storage/angular-local-storage.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-local-storage/angular-local-storage.d.ts b/angular-local-storage/angular-local-storage.d.ts index f0500a96f6..940874d23b 100644 --- a/angular-local-storage/angular-local-storage.d.ts +++ b/angular-local-storage/angular-local-storage.d.ts @@ -6,7 +6,7 @@ /// declare module angular.local.storage { - interface ILocalStorageServiceProvider extends IServiceProvider { + interface ILocalStorageServiceProvider extends ng.IServiceProvider { /** * Setter for the prefix * You should set a prefix to avoid overwriting any local storage variables from the rest of your app @@ -129,7 +129,7 @@ declare module angular.local.storage { * @param value optional * @param key The corresponding key used in local storage */ - bind(scope: angular.IScope, property: string, value?: any, key?: string): Function; + bind(scope: ng.IScope, property: string, value?: any, key?: string): Function; /** * Return the derive key * Returns String From b496f1e760bbbc3256ae54a0cabda1263b60c55c Mon Sep 17 00:00:00 2001 From: Dustin Wehr Date: Sat, 13 Jun 2015 16:02:41 -0400 Subject: [PATCH 0129/2220] add gapi.drive.realtime.Collaborator --- .../google-drive-realtime-api.d.ts | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 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 b1d970e3c6..95f239a349 100644 --- a/google-drive-realtime-api/google-drive-realtime-api.d.ts +++ b/google-drive-realtime-api/google-drive-realtime-api.d.ts @@ -19,8 +19,41 @@ declare module gapi.drive.realtime { type GoogEventHandler = ((evt:ObjectChangedEvent) => void) | ((e:Event) => void) | EventListener; - // TODO - export class Collaborator {} + // Complete + // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.Collaborator + export class Collaborator { + // The HTML color associated with this collaborator. When possible, collaborators are assigned unique colors. + color : string; + + // The display name for this collaborator. + displayName : string; + + // True if this collaborator is anonymous, false otherwise. + isAnonymous : boolean + + // True if this collaborator is the local user, false otherwise. + isMe : boolean; + + // The permission ID for this collaborator. This ID is stable for a given user and is compatible with the + // Drive API permissions APIs. Use the userId property for all other uses. + permissionId : string; + + // A URL that points to the profile photo for this collaborator, or to a generic profile photo for + // anonymous collaborators. + photoUrl : string; + + // The session ID for this collaborator. A single user may have multiple sessions if they have the same document + // open on multiple devices or in multiple browser tabs. + sessionId : string; + + // The user ID for this collaborator. This ID is stable for a given user and is compatible with most Google APIs + // except the Drive API permission APIs. For an ID which is compatible with the Drive API permission APIs, + // use the permissionId property. + userId : string; + + new (sessionId:string, userId:string, displayName:string, color:string, isMe:boolean, isAnonymous:boolean, + photoUrl:string, permissionId:string) : Collaborator; + } // Complete // https://developers.google.com/google-apps/realtime/reference/gapi.drive.realtime.CollaborativeObject From bcbadfe78abb6c0ed3979cafd9994c04e48648e0 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 00:05:19 +0200 Subject: [PATCH 0130/2220] adding partitioning and joining operators to Stream, and the nonterminals of Optional --- streamjs/streamjs-tests.ts | 32 ++++++++++++++++++++++++++++++++ streamjs/streamjs.d.ts | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index 50a398418d..e59af31ae1 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -5,6 +5,7 @@ var numStream: Stream; numStream = Stream.make([10, 20]); numStream = Stream.range(1, 5); numStream = Stream.rangeClosed(1, 5); +// numStream = Stream.empty(); Stream.generate(function() { return 1; @@ -90,3 +91,34 @@ var mappingResult = myStream.toMap(lst => lst.name, (e1, e2) => e2); console.log(mappingResult["a"]); myStream.toMap(lst => lst.name); + +mappingResult = myStream.indexBy(lst => lst.name, (e1, e2) => e2); + +var partitionedNums: number[][] = numStream.partitioningBy(n => n % 2 == 0); +partitionedNums = numStream.partitionBy(n => n % 2 == 0); + +var partitionedStrings : string[][] = strStream.partitionBy(/^a$/); +partitionedStrings = strStream.partitioningBy(/^a$/); +partitionedStrings = strStream.partitioningBy(5); +partitionedStrings = strStream.partitionBy(5); + +var s: string = numStream.joining(); +s = numStream.join(); +s = numStream.joining(", "); +s = numStream.join(", "); +s = numStream.joining({prefix: "{", delimiter: ", ", suffix: "}"}); +s = numStream.join({prefix: "{", delimiter: ", ", suffix: "}"}); + + +var iter = numStream.iterator(); +var n: number = iter.next(); +var done: boolean = iter.done; + +var optNum: Stream.Optional = Stream.Optional.of(2); +optNum = Stream.Optional.ofNullable(null); +optNum = Stream.Optional.empty(); + +var optStr: Stream.Optional = optNum.filter(n => n % 2 == 0) + .map(n => "number" + n) + .flatMap(n => Stream.Optional.of(n + 2)) + ; diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 1478d7a68d..6d13346a98 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -9,6 +9,7 @@ declare class Stream { static range (startInclusive: number, endExclusive: number): Stream; static rangeClosed (startInclusive: number, endInclusive: number): Stream; static generate (supplier: () => T): Stream; + // static empty(): Stream; anyMatch(predicate: (elem: T) => boolean): boolean; anyMatch(regexp: RegExp): boolean; @@ -28,8 +29,7 @@ declare class Stream { groupBy(mapper: (elem: T) => string): Stream.GroupingResult; groupingBy(mapper: (elem: T) => string): Stream.GroupingResult; - toMap(keyMapper: (elem: T) => string, mergeFunction?: (elem1: T, elem2: T) => T): T[]; - + indexBy(keyMapper: (elem: T) => string, mergeFunction?: (elem1: T, elem2: T) => T): T[]; map (mapper: (T) => U): Stream; max(): Stream.Optional; max(comparator: (e1: T, e2: T) => number): Stream.Optional; @@ -38,7 +38,20 @@ declare class Stream { noneMatch(predicate: (elem: T) => boolean): boolean; noneMatch(regexp: RegExp): boolean; flatMap (mapper: (T) => U[]): Stream; + iterator(): Stream.Iterator; + joining(): string; + joining(delimiter: string): string; + joining(options: Stream.JoinOptions): string; + join(): string; + join(delimiter: string): string; + join(options: Stream.JoinOptions): string; limit(limit: number): Stream; + partitioningBy(predicate: (elem: T) => boolean): T[][]; + partitionBy(predicate: (elem: T) => boolean): T[][]; + partitioningBy(regexp: RegExp): T[][]; + partitionBy(regexp: RegExp): T[][]; + partitioningBy(size: number): T[][]; + partitionBy(size: number): T[][]; peek(consumer: (elem: T) => void ): Stream; reduce(identity: T, accumulator: (e1: T, e2: T) => T): T; reduce(accumulator: (e1: T, e2: T) => T): Stream.Optional; @@ -55,9 +68,22 @@ declare class Stream { takeWhile(predicate: (elem: T) => boolean): Stream; takeWhile(regexp: RegExp): Stream; toArray(): T[]; + toMap(keyMapper: (elem: T) => string, mergeFunction?: (elem1: T, elem2: T) => T): T[]; } declare module Stream { + + export interface Iterator { + next(): T; + done: boolean; + } + + export interface JoinOptions { + prefix: string; + delimiter: string; + suffix: string; + } + export interface GroupingResult { [index: string]: T } @@ -69,6 +95,12 @@ declare module Stream { } export class Optional { - + static of(elem: T): Optional; + static ofNullable(elem: T): Optional; + static empty(): Optional; + + filter(predicate: (elem: T) => boolean): Optional; + map(mapper: (elem: T) => U): Optional; + flatMap(mapper: (elem: T) => Stream.Optional): Optional; } } From 09899c1ffa639cb80a835dcde5afc93d1f987af7 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 00:38:59 +0200 Subject: [PATCH 0131/2220] added termial operations of Optional --- streamjs/streamjs-tests.ts | 9 ++++++++- streamjs/streamjs.d.ts | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index e59af31ae1..3d836b56f1 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -116,9 +116,16 @@ var done: boolean = iter.done; var optNum: Stream.Optional = Stream.Optional.of(2); optNum = Stream.Optional.ofNullable(null); -optNum = Stream.Optional.empty(); +//optNum = Stream.Optional.empty(); var optStr: Stream.Optional = optNum.filter(n => n % 2 == 0) .map(n => "number" + n) .flatMap(n => Stream.Optional.of(n + 2)) ; + +var isPresent: boolean = optNum.isPresent(); +var num: number = optNum.get(); +optNum.ifPresent(n => console.log(n)); +var def: number = optNum.orElse(2); +def = optNum.orElseGet(() => 3); +def = optNum.orElseThrow("something went wrong"); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 6d13346a98..5a0ea94a4d 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -102,5 +102,11 @@ declare module Stream { filter(predicate: (elem: T) => boolean): Optional; map(mapper: (elem: T) => U): Optional; flatMap(mapper: (elem: T) => Stream.Optional): Optional; + isPresent(): boolean; + get(): T; + ifPresent(consumer: (elem: T) => void): void; + orElse(other: T): T; + orElseGet(supplier: () => T): T; + orElseThrow(error: any): T; } } From aad6b603afa58007377fdc65649d9fdcdad4fc1e Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 00:39:46 +0200 Subject: [PATCH 0132/2220] added termial operations of Optional --- streamjs/streamjs.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 5a0ea94a4d..8ac67d583c 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -11,7 +11,7 @@ declare class Stream { static generate (supplier: () => T): Stream; // static empty(): Stream; - anyMatch(predicate: (elem: T) => boolean): boolean; + anyMatch(predicate: Stream.Predicate): boolean; anyMatch(regexp: RegExp): boolean; allMatch(predicate: (elem: T) => boolean): boolean; allMatch(regexp: RegExp): boolean; @@ -73,6 +73,10 @@ declare class Stream { declare module Stream { + export interface Predicate { + (elem: T): boolean; + } + export interface Iterator { next(): T; done: boolean; From c5432f4533707047327ee32618e0dbde55621c40 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 00:57:48 +0200 Subject: [PATCH 0133/2220] added some functional interfaces to reduce the number of inline anonymous types --- streamjs/streamjs.d.ts | 86 ++++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 8ac67d583c..464a449ca4 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -8,36 +8,36 @@ declare class Stream { static make (elems: T[]): Stream; static range (startInclusive: number, endExclusive: number): Stream; static rangeClosed (startInclusive: number, endInclusive: number): Stream; - static generate (supplier: () => T): Stream; + static generate (supplier: Stream.Supplier): Stream; // static empty(): Stream; - anyMatch(predicate: Stream.Predicate): boolean; + anyMatch(predicate: Stream.Predicate): boolean; anyMatch(regexp: RegExp): boolean; - allMatch(predicate: (elem: T) => boolean): boolean; + allMatch(predicate: Stream.Predicate): boolean; allMatch(regexp: RegExp): boolean; average(): number; avg(): number; collect(collector: Stream.Collector): T; count(): number; distinct(): Stream; - dropWhile(predicate: (elem: T) => boolean): Stream; + dropWhile(predicate: Stream.Predicate): Stream; dropWhile(regexp: RegExp): Stream; - filter(predicate: (T) => boolean): Stream; + filter(predicate: Stream.Predicate): Stream; findAny(): Stream.Optional; findFirst(): Stream.Optional; - forEach(consumer: (elem: T) => void): void; + forEach(consumer: Stream.Consumer): void; - groupBy(mapper: (elem: T) => string): Stream.GroupingResult; - groupingBy(mapper: (elem: T) => string): Stream.GroupingResult; - indexBy(keyMapper: (elem: T) => string, mergeFunction?: (elem1: T, elem2: T) => T): T[]; - map (mapper: (T) => U): Stream; + groupBy(mapper: Stream.Function): Stream.GroupingResult; + groupingBy(mapper: Stream.Function): Stream.GroupingResult; + indexBy(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; + map (mapper: Stream.Function): Stream; max(): Stream.Optional; - max(comparator: (e1: T, e2: T) => number): Stream.Optional; + max(comparator: Stream.Comparator): Stream.Optional; min(): Stream.Optional; - min(comparator: (elem1: T, elem2: T) => number): Stream.Optional; + min(comparator: Stream.Comparator): Stream.Optional; noneMatch(predicate: (elem: T) => boolean): boolean; noneMatch(regexp: RegExp): boolean; - flatMap (mapper: (T) => U[]): Stream; + flatMap (mapper: Stream.Function): Stream; iterator(): Stream.Iterator; joining(): string; joining(delimiter: string): string; @@ -46,56 +46,76 @@ declare class Stream { join(delimiter: string): string; join(options: Stream.JoinOptions): string; limit(limit: number): Stream; - partitioningBy(predicate: (elem: T) => boolean): T[][]; - partitionBy(predicate: (elem: T) => boolean): T[][]; + partitioningBy(predicate: Stream.Predicate): T[][]; + partitionBy(predicate: Stream.Predicate): T[][]; partitioningBy(regexp: RegExp): T[][]; partitionBy(regexp: RegExp): T[][]; partitioningBy(size: number): T[][]; partitionBy(size: number): T[][]; - peek(consumer: (elem: T) => void ): Stream; - reduce(identity: T, accumulator: (e1: T, e2: T) => T): T; - reduce(accumulator: (e1: T, e2: T) => T): Stream.Optional; + peek(consumer: Stream.Consumer): Stream; + reduce(identity: T, accumulator: Stream.Accumulator): T; + reduce(accumulator: Stream.Accumulator): Stream.Optional; reverse(): Stream; size(): number; sorted(): Stream; - sorted(comparator: (e1: T, e2: T) => number): Stream; + sorted(comparator: Stream.Comparator): Stream; sort(): Stream; - sort(comparator: (e1: T, e2: T) => number): Stream; + sort(comparator: Stream.Comparator): Stream; shuffle(): Stream; skip(n: number): Stream; slice(begin, end): Stream; sum(): T; - takeWhile(predicate: (elem: T) => boolean): Stream; + takeWhile(predicate: Stream.Predicate): Stream; takeWhile(regexp: RegExp): Stream; toArray(): T[]; - toMap(keyMapper: (elem: T) => string, mergeFunction?: (elem1: T, elem2: T) => T): T[]; + toMap(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; } declare module Stream { - export interface Predicate { - (elem: T): boolean; + export interface Accumulator { + (e1: T, e2: T): T; + } + + export interface Collector { + supplier: Supplier; + accumulator: Stream.Accumulator; + finisher: Function; } + export interface Comparator { + (e1: T, e2: T): number + } + + export interface Consumer { + (elem: T): void; + } + + export interface Function { + (elem: T): U; + } + + export interface GroupingResult { + [index: string]: T + } + export interface Iterator { next(): T; done: boolean; } - + export interface JoinOptions { prefix: string; delimiter: string; suffix: string; } - export interface GroupingResult { - [index: string]: T + export interface Predicate { + (elem: T): boolean; } - - export interface Collector { - supplier(): T; - accumulator(e1: T, e2: T): T; - finisher(result: T): T + + export interface Supplier { + (): T } export class Optional { @@ -110,7 +130,7 @@ declare module Stream { get(): T; ifPresent(consumer: (elem: T) => void): void; orElse(other: T): T; - orElseGet(supplier: () => T): T; + orElseGet(supplier: Stream.Supplier): T; orElseThrow(error: any): T; } } From a8871c9dfaccaed9df047617c5a7bcee8d6f92cf Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 01:17:49 +0200 Subject: [PATCH 0134/2220] adding Stream.iterate() constructor --- streamjs/streamjs-tests.ts | 2 ++ streamjs/streamjs.d.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index 3d836b56f1..083940311d 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -12,6 +12,8 @@ Stream.generate(function() { }); Stream.generate(() => 1); +numStream = Stream.iterate(1, (n) => n * 2); + var comparator = (s1, s2) => 0; numStream = numStream.filter(n => n % 2 == 0); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 464a449ca4..3b82680dfd 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -9,6 +9,7 @@ declare class Stream { static range (startInclusive: number, endExclusive: number): Stream; static rangeClosed (startInclusive: number, endInclusive: number): Stream; static generate (supplier: Stream.Supplier): Stream; + static iterate(seed: T, fn: Stream.Function): Stream; // static empty(): Stream; anyMatch(predicate: Stream.Predicate): boolean; From b9dab01b68ad9b959cb3e057bed6b861e9de33f6 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 02:05:27 +0200 Subject: [PATCH 0135/2220] adding some missing methods, adding README with unsupported method list --- streamjs/README.md | 22 ++++++++++++++++++++++ streamjs/streamjs-tests.ts | 8 ++++---- streamjs/streamjs.d.ts | 4 ++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 streamjs/README.md diff --git a/streamjs/README.md b/streamjs/README.md new file mode 100644 index 0000000000..ae3fcfc97a --- /dev/null +++ b/streamjs/README.md @@ -0,0 +1,22 @@ +# StreamJS Type Definitions + +Unsupported StreamJS function / method signatures: + * Stream(collection) + * Stream(string) + * Stream.empty() + * filter(sample) + * map(path) + * flatMap(path) + * sorted(path) + * takeWhile(sample) + * dropWhile(sample) + * min(path) + * max(path) + * sum(path) + * average(path) + * allMatch(sample) + * anyMatch(sample) + * groupingBy(path) + * toMap(path, mergeFunction) + * partitioningBy(sample); + * Optional.empty() diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index 083940311d..c5f1ea8624 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -1,11 +1,9 @@ // var numStream: Stream; -// numStream = Stream.make(10, 20); -numStream = Stream.make([10, 20]); +numStream = Stream.of(1, 2, 3); numStream = Stream.range(1, 5); numStream = Stream.rangeClosed(1, 5); -// numStream = Stream.empty(); Stream.generate(function() { return 1; @@ -37,7 +35,9 @@ var strStream = numStream ; var strArray = strStream.toArray(); - +strArray = strStream.toList(); +strStream.each(s => console.log(s)); +strStream.filter(/^$/); strStream.forEach(s => console.log(s)); var opt: Stream.Optional = strStream.findFirst(); opt = strStream.findAny(); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 3b82680dfd..17889ff2fc 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -6,6 +6,7 @@ declare class Stream { // static make (...elems: T[]): Stream; static make (elems: T[]): Stream; + static of(...elems: T[]): Stream; static range (startInclusive: number, endExclusive: number): Stream; static rangeClosed (startInclusive: number, endInclusive: number): Stream; static generate (supplier: Stream.Supplier): Stream; @@ -23,7 +24,9 @@ declare class Stream { distinct(): Stream; dropWhile(predicate: Stream.Predicate): Stream; dropWhile(regexp: RegExp): Stream; + each(consumer: Stream.Consumer): void; filter(predicate: Stream.Predicate): Stream; + filter(regexp: RegExp): Stream; findAny(): Stream.Optional; findFirst(): Stream.Optional; forEach(consumer: Stream.Consumer): void; @@ -69,6 +72,7 @@ declare class Stream { takeWhile(predicate: Stream.Predicate): Stream; takeWhile(regexp: RegExp): Stream; toArray(): T[]; + toList(): T[]; toMap(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; } From f4fd84bb109efaf4c1e62dc65b543180ea90fd70 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 02:13:48 +0200 Subject: [PATCH 0136/2220] commenting out Optional.empty() since it does not work as expected --- streamjs/streamjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 17889ff2fc..aa2a82e61f 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -126,7 +126,7 @@ declare module Stream { export class Optional { static of(elem: T): Optional; static ofNullable(elem: T): Optional; - static empty(): Optional; + // static empty(): Optional; filter(predicate: (elem: T) => boolean): Optional; map(mapper: (elem: T) => U): Optional; From 9b073d0f81a128a3d4a67a5889f8a72a1bdb630a Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Sun, 14 Jun 2015 01:05:09 -0400 Subject: [PATCH 0137/2220] Fix #4620: Add module declaration for 'module' magic module --- requirejs/require-tests.ts | 8 ++++++++ requirejs/require.d.ts | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/requirejs/require-tests.ts b/requirejs/require-tests.ts index a8cfdc87e0..0f3cc8194f 100644 --- a/requirejs/require-tests.ts +++ b/requirejs/require-tests.ts @@ -41,3 +41,11 @@ require(['main'], (main: any, $: any, _: any, Backbone: any) => { var recOne = require.config({ baseUrl: 'js' }); recOne(['core'], function (core: any) {/*some code*/}); +// Tests for 'module' magic module typings +// (Using 'module' only actually makes sense in an external module) + +import module = require('module'); + +var moduleConfig: any = module.config(); +var moduleId: string = module.id; +var moduleUri: string = module.uri; diff --git a/requirejs/require.d.ts b/requirejs/require.d.ts index 47c754c602..21f9aeebb7 100644 --- a/requirejs/require.d.ts +++ b/requirejs/require.d.ts @@ -29,6 +29,15 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +declare module 'module' { + var mod: { + config: () => any; + id: string; + uri: string; + } + export = mod; +} + interface RequireError extends Error { /** @@ -342,7 +351,7 @@ interface RequireDefine { * callback return module definition **/ (name: string, ready: Function): void; - + /** * Used to allow a clear indicator that a global define function (as needed for script src browser loading) conforms * to the AMD API, any global define function SHOULD have a property called "amd" whose value is an object. From bd123fb8824cc1a554ed1fa4abc2f4331ceaff17 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Sun, 14 Jun 2015 13:57:39 +0200 Subject: [PATCH 0138/2220] adding support for most of the methods receiving sample or path as parameter --- streamjs/README.md | 13 ------------- streamjs/streamjs-tests.ts | 23 ++++++++++++++++++++++- streamjs/streamjs.d.ts | 25 +++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/streamjs/README.md b/streamjs/README.md index ae3fcfc97a..9428177672 100644 --- a/streamjs/README.md +++ b/streamjs/README.md @@ -4,19 +4,6 @@ Unsupported StreamJS function / method signatures: * Stream(collection) * Stream(string) * Stream.empty() - * filter(sample) * map(path) * flatMap(path) - * sorted(path) - * takeWhile(sample) - * dropWhile(sample) - * min(path) - * max(path) - * sum(path) - * average(path) - * allMatch(sample) - * anyMatch(sample) - * groupingBy(path) - * toMap(path, mergeFunction) - * partitioningBy(sample); * Optional.empty() diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index c5f1ea8624..f83ec69e82 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -22,8 +22,10 @@ var strStream = numStream .limit(100) .sorted() .sort() + .sort("propName") .sorted(comparator) .sort(comparator) + .sorted("propName") .shuffle() .reverse() .distinct() @@ -47,8 +49,11 @@ opt = strStream.min(); opt = strStream.min((s1, s2) => 0); var sum = numStream.sum(); +sum = numStream.sum("foo"); var avg = numStream.average(); +avg = numStream.average("foo"); avg = numStream.avg(); +avg = numStream.avg("foo"); var count = numStream.count(); count = numStream.size(); @@ -78,6 +83,13 @@ elems = myStream .toArray(); //.forEach(s => console.log(s)); +myStream = myStream.takeWhile({name: "foo"}); +myStream = myStream.dropWhile({name: "foo"}); +myStream = myStream.filter({name: "foo"}); +var myResult = myStream.min("name"); +myResult = myStream.max("name"); +var match: boolean = myStream.allMatch({name: "foo"}); +match = myStream.anyMatch({name: "foo"}); numStream.collect({ supplier: () => 0, @@ -88,9 +100,13 @@ numStream.collect({ var groupingResult = myStream.groupBy(lst => lst.name); var elems = groupingResult["hello"].elems; groupingResult = myStream.groupingBy(lst => lst.name); +groupingResult = myStream.groupBy("name"); +groupingResult = myStream.groupingBy("name"); var mappingResult = myStream.toMap(lst => lst.name, (e1, e2) => e2); -console.log(mappingResult["a"]); +var aMappingResult: MyList = mappingResult["a"]; + +mappingResult = myStream.toMap("a"); myStream.toMap(lst => lst.name); @@ -104,6 +120,9 @@ partitionedStrings = strStream.partitioningBy(/^a$/); partitionedStrings = strStream.partitioningBy(5); partitionedStrings = strStream.partitionBy(5); +var partitionedList: MyList[][] = myStream.partitionBy({name : "foo"}); +partitionedList = myStream.partitioningBy({name : "foo"}); + var s: string = numStream.joining(); s = numStream.join(); s = numStream.joining(", "); @@ -131,3 +150,5 @@ optNum.ifPresent(n => console.log(n)); var def: number = optNum.orElse(2); def = optNum.orElseGet(() => 3); def = optNum.orElseThrow("something went wrong"); + + diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index aa2a82e61f..81ed58a82f 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -1,5 +1,5 @@ // Type definitions for streamjs 1.4.0 -// Project: http://streamjs.org/ +// Project: https://github.com/winterbe/streamjs // Definitions by: Bence Eros // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -15,30 +15,40 @@ declare class Stream { anyMatch(predicate: Stream.Predicate): boolean; anyMatch(regexp: RegExp): boolean; + anyMatch(sample: Stream.Sample): boolean; allMatch(predicate: Stream.Predicate): boolean; allMatch(regexp: RegExp): boolean; + allMatch(sample: Stream.Sample): boolean; average(): number; + average(path: string): number; avg(): number; + avg(path: string): number; collect(collector: Stream.Collector): T; count(): number; distinct(): Stream; dropWhile(predicate: Stream.Predicate): Stream; dropWhile(regexp: RegExp): Stream; + dropWhile(sample: Stream.Sample): Stream; each(consumer: Stream.Consumer): void; filter(predicate: Stream.Predicate): Stream; filter(regexp: RegExp): Stream; + filter(sample: Stream.Sample): Stream; findAny(): Stream.Optional; findFirst(): Stream.Optional; forEach(consumer: Stream.Consumer): void; groupBy(mapper: Stream.Function): Stream.GroupingResult; + groupBy(path: string): Stream.GroupingResult; groupingBy(mapper: Stream.Function): Stream.GroupingResult; + groupingBy(path: string): Stream.GroupingResult; indexBy(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; map (mapper: Stream.Function): Stream; max(): Stream.Optional; max(comparator: Stream.Comparator): Stream.Optional; + max(path: string): Stream.Optional; min(): Stream.Optional; min(comparator: Stream.Comparator): Stream.Optional; + min(path: string): Stream.Optional; noneMatch(predicate: (elem: T) => boolean): boolean; noneMatch(regexp: RegExp): boolean; flatMap (mapper: Stream.Function): Stream; @@ -52,10 +62,12 @@ declare class Stream { limit(limit: number): Stream; partitioningBy(predicate: Stream.Predicate): T[][]; partitionBy(predicate: Stream.Predicate): T[][]; + partitionBy(sample: Stream.Sample): T[][]; partitioningBy(regexp: RegExp): T[][]; partitionBy(regexp: RegExp): T[][]; partitioningBy(size: number): T[][]; partitionBy(size: number): T[][]; + partitioningBy(sample: Stream.Sample): T[][]; peek(consumer: Stream.Consumer): Stream; reduce(identity: T, accumulator: Stream.Accumulator): T; reduce(accumulator: Stream.Accumulator): Stream.Optional; @@ -63,21 +75,30 @@ declare class Stream { size(): number; sorted(): Stream; sorted(comparator: Stream.Comparator): Stream; + sorted(path: string): Stream; sort(): Stream; sort(comparator: Stream.Comparator): Stream; + sort(path: string): Stream; shuffle(): Stream; skip(n: number): Stream; slice(begin, end): Stream; - sum(): T; + sum(): number; + sum(path: string): number; takeWhile(predicate: Stream.Predicate): Stream; takeWhile(regexp: RegExp): Stream; + takeWhile(sample: Stream.Sample): Stream; toArray(): T[]; toList(): T[]; toMap(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; + toMap(path: string, mergeFunction?: Stream.Accumulator): T[]; } declare module Stream { + export interface Sample { + [index: string]: any + } + export interface Accumulator { (e1: T, e2: T): T; } From 7c374bf1e59ce14e9e28207e2ba2ab202ba55350 Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Sun, 14 Jun 2015 11:40:06 -0400 Subject: [PATCH 0139/2220] Fix whitespace in requirejs typings/tests --- requirejs/require-tests.ts | 2 +- requirejs/require.d.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/requirejs/require-tests.ts b/requirejs/require-tests.ts index 0f3cc8194f..f3521e043c 100644 --- a/requirejs/require-tests.ts +++ b/requirejs/require-tests.ts @@ -47,5 +47,5 @@ recOne(['core'], function (core: any) {/*some code*/}); import module = require('module'); var moduleConfig: any = module.config(); -var moduleId: string = module.id; +var moduleId: string = module.id; var moduleUri: string = module.uri; diff --git a/requirejs/require.d.ts b/requirejs/require.d.ts index 21f9aeebb7..58fb4f6f12 100644 --- a/requirejs/require.d.ts +++ b/requirejs/require.d.ts @@ -30,12 +30,12 @@ OTHER DEALINGS IN THE SOFTWARE. */ declare module 'module' { - var mod: { - config: () => any; - id: string; - uri: string; - } - export = mod; + var mod: { + config: () => any; + id: string; + uri: string; + } + export = mod; } interface RequireError extends Error { From 7da2851ffc22ac4b875d0d91584232e03a79c25b Mon Sep 17 00:00:00 2001 From: nfantone Date: Sun, 14 Jun 2015 17:38:54 -0300 Subject: [PATCH 0140/2220] Add sample() to LoDashArrayWrapper interface --- lodash/lodash-tests.ts | 2 ++ lodash/lodash.d.ts | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 633c4ed0d4..e0f2b82269 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -605,6 +605,8 @@ result = _(foodsCombined).reject({ 'type': 'fruit' }).value(); result = _.sample([1, 2, 3, 4]); result = _.sample([1, 2, 3, 4], 2); +result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).sample(); +result = <_.LoDashArrayWrapper>_([1, 2, 3, 4]).sample(2); result = _.shuffle([1, 2, 3, 4, 5, 6]); result = <_.LoDashArrayWrapper>_([1, 2, 3]).shuffle(); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 9cb55485d9..a906b907f3 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -22,7 +22,7 @@ declare module _ { * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy, * indexBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min, * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject, - * remove, rest, reverse, shuffle, slice, sort, sortBy, splice, tap, throttle, times, + * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times, * toArray, transform, union, uniq, unshift, unzip, values, where, without, wrap, and zip * * The non-chainable wrapper functions are: @@ -4559,6 +4559,18 @@ declare module _ { sample(collection: Dictionary, n: number): T[]; } + interface LoDashArrayWrapper { + /** + * @see _.sample + **/ + sample(n: number): LoDashArrayWrapper; + + /** + * @see _.sample + **/ + sample(): LoDashArrayWrapper; + } + //_.shuffle interface LoDashStatic { /** From 983cd5df0985ff17cbfcbf4701a893369b433d8f Mon Sep 17 00:00:00 2001 From: Basarat Ali Syed Date: Mon, 15 Jun 2015 10:01:01 +1000 Subject: [PATCH 0141/2220] Revert "React : test for modernComponent" --- react/react-tests.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/react/react-tests.ts b/react/react-tests.ts index 64b59e1950..2802a34cdf 100644 --- a/react/react-tests.ts +++ b/react/react-tests.ts @@ -150,8 +150,6 @@ var classicComponent: React.ClassicComponent = React.render(classicElement, container); var domComponent: React.DOMComponent = React.render(domElement, container); -var modernComponent = - React.render(React.createElement(ModernComponent, props), container); // Other Top-Level API var unmounted: boolean = React.unmountComponentAtNode(container); From f9c3edf6c6c32726e7e424fc3690da5ff1b0eef6 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Sun, 14 Jun 2015 23:21:47 -0300 Subject: [PATCH 0142/2220] Each is not void, it returns a parameter of type A[] --- prelude-ls/prelude-ls-tests.ts | 16 ++++++++++------ prelude-ls/prelude-ls.d.ts | 6 ++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index b6e50e2256..8c37a1e717 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -1,23 +1,27 @@ +/// + import prelude = require("prelude-ls"); -prelude.id(5); //=> 5 -prelude.id({}); //=> {} +var five: number = prelude.id(5); //=> 5 +var emptyObj: Object = prelude.id({}); //=> {} -prelude.isType("Undefined", void 8); //=> true +var expectBool: boolean = prelude.isType("Undefined", void 8); //=> true prelude.isType("Boolean", true); //=> true prelude.isType("Number", 1); //=> true prelude.isType("String", "hi"); //=> true prelude.isType("Object", {}); //=> true prelude.isType("Array", []); //=> true -prelude.replicate(4, 3); //=> [3, 3, 3, 3] -prelude.replicate(4, "a"); //=> ["a", "a", "a", "a"] +var numberArray: Array = prelude.replicate(4, 3); //=> [3, 3, 3, 3] +var strArray: Array = + prelude.replicate(4, "a"); //=> ["a", "a", "a", "a"] prelude.replicate(0, "a"); //=> [] // List -prelude.each(x => x.push("boom"), [["a"], ["b"], ["c"]]); +var dblStrArray: Array> = + prelude.each(x => x.push("boom"), [["a"], ["b"], ["c"]]); //=> [["a", "boom"], ["b", "boom"], ["c", "boom"]] prelude.map(x => x * 2, [1, 2, 3, 4, 5]); //=> [2, 4, 6, 8, 10] diff --git a/prelude-ls/prelude-ls.d.ts b/prelude-ls/prelude-ls.d.ts index 848077c822..0de28f63a8 100644 --- a/prelude-ls/prelude-ls.d.ts +++ b/prelude-ls/prelude-ls.d.ts @@ -3,6 +3,8 @@ // Definitions by: Aya Morisawa // Definitions: https://github.com/borisyankov/DefinitelyTyped +// Change [0]: 2015/06/14 - Marcelo Camargo + declare module "prelude-ls" { module PreludeLS { export function id(x: A): A; @@ -14,8 +16,8 @@ declare module "prelude-ls" { // List - export function each(f: (x: A) => void): (xs: A[]) => void; - export function each(f: (x: A) => void, xs: A[]): void; + export function each(f: (x: A) => void): (xs: A[]) => A[]; + export function each(f: (x: A) => void, xs: A[]): A[]; export function map(f: (x: A) => B): (xs: A[]) => B[]; export function map(f: (x: A) => B, xs: A[]): B[]; export function compact(xs: A[]): A[]; From 19795463b32a83f4f68b55e8c8068f3956a4b7d3 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Sun, 14 Jun 2015 23:31:32 -0300 Subject: [PATCH 0143/2220] Correction on return types for find, head and last --- prelude-ls/prelude-ls-tests.ts | 30 +++++++++++++++++++----------- prelude-ls/prelude-ls.d.ts | 8 ++++---- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index 8c37a1e717..080f40afbd 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -20,32 +20,40 @@ prelude.replicate(0, "a"); //=> [] // List -var dblStrArray: Array> = +var eachRes: Array> = prelude.each(x => x.push("boom"), [["a"], ["b"], ["c"]]); //=> [["a", "boom"], ["b", "boom"], ["c", "boom"]] -prelude.map(x => x * 2, [1, 2, 3, 4, 5]); //=> [2, 4, 6, 8, 10] +var mapRes: Array = + prelude.map(x => x.toString(), [1, 2, 3, 4, 5]) //=> ["1", "2", "3", "4", "5"] + prelude.map(x => x.toUpperCase(), ["ha", "ma"]); //=> ["HA", "MA"] prelude.map(x => x.num, [{num: 3}, {num: 1}]); //=> [3, 1] -prelude.compact([0, 1, false, true, "", "ha"]) //=> [1, true, "ha"] +var compactRes: Array = + prelude.compact([0, 1, false, true, "", "ha"]) //=> [1, true, "ha"] -prelude.filter(x => x < 3, [1, 2, 3, 4, 5]); //=> [1, 2] +var filterRes: Array = + prelude.filter(x => x < 3, [1, 2, 3, 4, 5]); //=> [1, 2] prelude.filter(prelude.even, [3, 4, 0]); //=> [4, 0] -prelude.reject(prelude.odd, [1, 2, 3, 4, 5]); //=> [2, 4] +var rejectRes: Array = + prelude.reject(prelude.odd, [1, 2, 3, 4, 5]); //=> [2, 4] -prelude.partition(x => x > 60, [49, 58, 76, 43, 88, 77, 90]); //=> [[76, 88, 77, 90], [49, 58, 43]] +var partitionRes: Array> = + prelude.partition(x => x > 60, [49, 58, 76, 43, 88, 77, 90]); + //=> [[76, 88, 77, 90], [49, 58, 43]] -prelude.find(prelude.odd, [2, 4, 6, 7, 8, 9, 10]); //=> 7 +var findRes: number = prelude.find(prelude.odd, [2, 4, 6, 7, 8, 9, 10]); //=> 7 -prelude.head([1, 2, 3, 4, 5]); //=> 1 +var headRes: number = prelude.head([1, 2, 3, 4, 5]); //=> 1 -prelude.tail([1, 2, 3, 4, 5]); //=> [2, 3, 4, 5] +var tailRes: Array = prelude.tail([1, 2, 3, 4, 5]); //=> [2, 3, 4, 5] -prelude.last([1, 2, 3, 4, 5]); //=> 5 +var lastRes: number = prelude.last([1, 2, 3, 4, 5]); //=> 5 -prelude.initial([1, 2, 3, 4, 5]); //=> [1, 2, 3, 4] +var initialRes: Array = + prelude.initial([1, 2, 3, 4, 5]); //=> [1, 2, 3, 4] prelude.empty([]); //=> true diff --git a/prelude-ls/prelude-ls.d.ts b/prelude-ls/prelude-ls.d.ts index 0de28f63a8..f72db01800 100644 --- a/prelude-ls/prelude-ls.d.ts +++ b/prelude-ls/prelude-ls.d.ts @@ -27,11 +27,11 @@ declare module "prelude-ls" { export function reject(f: (x: A) => boolean, xs: A[]): A[]; export function partition(f: (x: A) => Boolean): (xs: A[]) => [A[], A[]]; export function partition(f: (x: A) => Boolean, xs: A[]): [A[], A[]]; - export function find(f: (x: A) => Boolean): (xs: A[]) => (A | void); - export function find(f: (x: A) => Boolean, xs: A[]): (A | void); - export function head(xs: A[]): (A | void); + export function find(f: (x: A) => Boolean): (xs: A[]) => A; + export function find(f: (x: A) => Boolean, xs: A[]): A; + export function head(xs: A[]): A; export function tail(xs: A[]): A[]; - export function last(xs: A[]): (A | void); + export function last(xs: A[]): A; export function initial(xs: A[]): A[]; export function empty(xs: A[]): boolean; export function reverse(xs: A[]): A[]; From c5eee1bdc66ce227a58140a8ae166de4485bd883 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Sun, 14 Jun 2015 23:40:03 -0300 Subject: [PATCH 0144/2220] Correction on argument types for intersection and union --- prelude-ls/prelude-ls-tests.ts | 56 ++++++++++++++++++++++------------ prelude-ls/prelude-ls.d.ts | 4 +-- 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index 080f40afbd..d3d5fcd4dd 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -55,41 +55,57 @@ var lastRes: number = prelude.last([1, 2, 3, 4, 5]); //=> 5 var initialRes: Array = prelude.initial([1, 2, 3, 4, 5]); //=> [1, 2, 3, 4] -prelude.empty([]); //=> true +var emptyRes: boolean = prelude.empty([]); //=> true -prelude.reverse([1, 2, 3]); //=> [3, 2, 1] +var reverseRes: Array = prelude.reverse([1, 2, 3]); //=> [3, 2, 1] -prelude.unique([1, 1, 1, 3, 3, 6, 7, 8]); //=> [1, 3, 6, 7, 8] +var uniqueRes: Array = + prelude.unique([1, 1, 1, 3, 3, 6, 7, 8]); //=> [1, 3, 6, 7, 8] -prelude.uniqueBy(x => x.length, ["and", "here", "are", "some", "words"]); //=> ["and", "here", "words"] +var uniqueByRes: Array = + prelude.uniqueBy(x => x.length, ["and", "here", "are", "some", "words"]); //=> ["and", "here", "words"] -prelude.fold(x => y => x + y, 0, [1, 2, 3, 4, 5]); //=> 15 -var product = prelude.fold(x => y => x * y, 1); +var foldRes: number = + prelude.fold(x => y => x + y, 0, [1, 2, 3, 4, 5]); //=> 15 -prelude.fold1(x => y => x + y, [1, 2, 3]); //=> 6 +var fold1Res: number = + prelude.fold1(x => y => x + y, [1, 2, 3]); //=> 6 -prelude.foldr(x => y => x - y, 9, [1, 2, 3, 4]); //=> 7 -prelude.foldr(x => y => x + y, "e", ["a", "b", "c", "d"]); //=> "abcde" +var foldrRes: number = + prelude.foldr(x => y => x - y, 9, [1, 2, 3, 4]); //=> 7 -prelude.foldr1(x => y => x - y, [1, 2, 3, 4, 9]); //=> 7 +var foldrStrRes: string = + prelude.foldr(x => y => x + y, "e", ["a", "b", "c", "d"]); //=> "abcde" -prelude.unfoldr(x => x === 0 ? null : [x, x - 1], 10); -//=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] +var foldr1Res: number = + prelude.foldr1(x => y => x - y, [1, 2, 3, 4, 9]); //=> 7 -prelude.concat([[1], [2, 3], [4]]); //=> [1, 2, 3, 4] +var unfoldrRes: Array = + prelude.unfoldr(x => x === 0 ? null : [x, x - 1], 10); + //=> [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] -prelude.concatMap(x => ["hoge", x, x + 2], [1, 2, 3]); //=> ["hoge", 1, 3, "hoge", 2, 4, "hoge", 3, 5] +var concatRes: Array = + prelude.concat([[1], [2, 3], [4]]); //=> [1, 2, 3, 4] -prelude.flatten([1, [[2], 3], [4, [[5]]]]); //=> [1, 2, 3, 4, 5] +var concatMapRes: Array = + prelude.concatMap(x => ["hoge", x, x + 2], [1, 2, 3]); + //=> ["hoge", 1, 3, "hoge", 2, 4, "hoge", 3, 5] -prelude.difference([1, 2, 3], [1]); //=> [2, 3] +var flattenRes: Array = + prelude.flatten([1, [[2], 3], [4, [[5]]]]); //=> [1, 2, 3, 4, 5] + +var differenceRes: Array = + prelude.difference([1, 2, 3], [1]); //=> [2, 3] prelude.difference([1, 2, 3, 4, 5], [5, 2, 10], [9]); //=> [1, 3, 4] -prelude.intersection([2, 3], [9, 8], [12, 1], [99]); //=> [] -prelude.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1], [-1, 0, 1, 2]); //=> [1, 2] -prelude.intersection([1, 2, 3], [2, 1, 3], [3, 1, 2]); //=> [1, 2, 3] +prelude.intersection([2, 3], [9, 8], [12, 1], [99]); //=> [] +var intersectionRes: Array = + prelude.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1], [-1, 0, 1, 2]); +//=> [1, 2] +prelude.intersection([1, 2, 3], [2, 1, 3], [3, 1, 2]); //=> [1, 2, 3] -prelude.union([1, 5, 7], [3, 5], []); //=> [1, 5, 7, 3] +var unionRes: Array = + prelude.union([1, 5, 7], [3, 5], []); //=> [1, 5, 7, 3] prelude.countBy(prelude.floor, [4.2, 6.1, 6.4]); //=> {4: 1, 6: 2} prelude.countBy(x => x.length, ["one", "two", "three"]); //=> {3: 2, 5: 1} diff --git a/prelude-ls/prelude-ls.d.ts b/prelude-ls/prelude-ls.d.ts index f72db01800..fde6ed1578 100644 --- a/prelude-ls/prelude-ls.d.ts +++ b/prelude-ls/prelude-ls.d.ts @@ -60,8 +60,8 @@ declare module "prelude-ls" { export function concatMap(f: (x: A) => B[], xs: A[]): B[]; export function flatten(xs: any[]): any[]; export function difference(...xss: A[][]): A[]; - export function intersection(...xss: A[]): A[]; - export function union(...xss: A[]): A[]; + export function intersection(...xss: A[][]): A[]; + export function union(...xss: A[][]): A[]; export function countBy(f: (x: A) => B): (xs: A[]) => any; export function countBy(f: (x: A) => B, xs: A[]): any; export function groupBy(f: (x: A) => B): (xs: A[]) => any; From b64f70ca142cb7932abfd2c2db501c182362ab25 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Sun, 14 Jun 2015 23:50:43 -0300 Subject: [PATCH 0145/2220] Added tests for numbers and strings, with assignment --- prelude-ls/prelude-ls-tests.ts | 80 +++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index d3d5fcd4dd..5bc034bc48 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -107,6 +107,8 @@ prelude.intersection([1, 2, 3], [2, 1, 3], [3, 1, 2]); //=> [1, 2, 3] var unionRes: Array = prelude.union([1, 5, 7], [3, 5], []); //=> [1, 5, 7, 3] +// --- UNION --- + prelude.countBy(prelude.floor, [4.2, 6.1, 6.4]); //=> {4: 1, 6: 2} prelude.countBy(x => x.length, ["one", "two", "three"]); //=> {3: 2, 5: 1} @@ -300,94 +302,100 @@ prelude.Str.breakStr(x => x === "h", "mmmmmhmm"); //=> ["mmmmm", "hmm"] // Func -prelude.apply((x, y) => x + y, [2, 3]); //=> 5 +var applyRes: number = prelude.apply((x, y) => x + y, [2, 3]); //=> 5 var add = (x: number, y: number) => x + y; var addCurried = prelude.curry(add); var addFour = addCurried(4); addFour(2); //=> 6 -var invertedPower = prelude.flip(x => y => Math.pow(x, y)); -invertedPower(2)(3); //=> 9 +var flipRes: (x: number) => (y: number) => number + = prelude.flip(x => y => Math.pow(x, y)); -prelude.fix((fib: (n: number) => number) => (n: number) => n <= 1 ? 1 : fib(n - 1) + fib(n - 2))(9); //=> 55 +var fixRes: number = prelude.fix( + (fib: (n: number) => number) => (n: number) => + n <= 1 + ? 1 + : fib(n - 1) + fib(n - 2) +)(9); //=> 55 -var sameLength = prelude.over((x, y) => x == y, x => x.length); +var sameLength: (x: string, y: string) => boolean + = prelude.over((x, y) => x == y, x => x.length); sameLength('hi', 'me'); //=> true sameLength('one', 'boom'); //=> false // Num prelude.max(3, 1); //=> 3 -prelude.max("a", "c"); //=> "c" +var maxRes: string = prelude.max("a", "c"); //=> "c" -prelude.min(3, 1); //=> 1 +var minRes: number = prelude.min(3, 1); //=> 1 prelude.min("a", "c"); //=> "a" -prelude.negate(3); //=> -3 +var negateRes: number = prelude.negate(3); //=> -3 prelude.negate(-2); //=> 2 -prelude.abs(-2); //=> 2 +var absRes: number = prelude.abs(-2); //=> 2 prelude.abs(2); //=> 2 -prelude.signum(-5); //=> -1 +var signumRes: number = prelude.signum(-5); //=> -1 prelude.signum(0); //=> 0 prelude.signum(9); //=> 1 -prelude.quot(-20, 3); //=> -6 +var quotRes: number = prelude.quot(-20, 3); //=> -6 -prelude.rem(-20, 3); //=> -2 +var remRes: number = prelude.rem(-20, 3); //=> -2 -prelude.div(-20, 3); //=> -7 +var divRes: number = prelude.div(-20, 3); //=> -7 -prelude.mod(-20, 3); //=> 1 +var modRes: number = prelude.mod(-20, 3); //=> 1 -prelude.recip(4); //=> 0.25 +var recipRes: number = prelude.recip(4); //=> 0.25 -prelude.pi; //=> 3.141592653589793 +var piRes: number = prelude.pi; //=> 3.141592653589793 -prelude.tau; //=> 6.283185307179586 +var tauRes: number = prelude.tau; //=> 6.283185307179586 -prelude.exp(1); //=> 2.718281828459045 +var expRes: number = prelude.exp(1); //=> 2.718281828459045 -prelude.sqrt(4); //=> 2 +var sqrtRes: number = prelude.sqrt(4); //=> 2 -prelude.ln(10); //=> 2.302585092994046 +var lnRes: number = prelude.ln(10); //=> 2.302585092994046 -prelude.pow(-2, 2); //=> 4 +var powRes: number = prelude.pow(-2, 2); //=> 4 -prelude.sin(prelude.pi / 2); //=> 1 +var sinRes: number = prelude.sin(prelude.pi / 2); //=> 1 -prelude.cos(prelude.pi); //=> -1 +var cosRes: number = prelude.cos(prelude.pi); //=> -1 -prelude.tan(prelude.pi / 4); //=> 1 +var aTanRes: number = prelude.tan(prelude.pi / 4); //=> 1 -prelude.asin(0); //=> 0 +var asinRes: number = prelude.asin(0); //=> 0 -prelude.acos(1); //=> 0 +var acosRes: number = prelude.acos(1); //=> 0 prelude.atan(0); //=> 0 -prelude.atan2(1, 0); //=> 1.5707963267948966 +var atanRes: number = prelude.atan2(1, 0); //=> 1.5707963267948966 -prelude.truncate(-1.5); //=> -1 +var truncateRes: number = prelude.truncate(-1.5); //=> -1 prelude.truncate(1.5); //=> 1 -prelude.round(0.6); //=> 1 +var roundRes: number = prelude.round(0.6); //=> 1 prelude.round(0.5); //=> 1 prelude.round(0.4); //=> 0 -prelude.ceiling(0.1); //=> 1 +var ceilingRes: number = prelude.ceiling(0.1); //=> 1 -prelude.floor(0.9); //=> 0 +var floorRes: number = prelude.floor(0.9); //=> 0 -prelude.isItNaN(prelude.sqrt(-1)); //=> true +var isItNanRes: boolean = prelude.isItNaN(prelude.sqrt(-1)); //=> true -prelude.even(4); //=> true +var evenRes: boolean = prelude.even(4); //=> true prelude.even(0); //=> true -prelude.odd(3); //=> true +var oddRes: boolean = prelude.odd(3); //=> true -prelude.gcd(12, 18); //=> 6 +var gcdRes: number = prelude.gcd(12, 18); //=> 6 -prelude.lcm(12, 18); //=> 36 \ No newline at end of file +var lcmRes: number = prelude.lcm(12, 18); //=> 36 \ No newline at end of file From 827ec75fbbf3d125a680b0b74e10f0c5e6beb567 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Sun, 14 Jun 2015 23:56:22 -0300 Subject: [PATCH 0146/2220] sortBy should return A[] instead of A --- prelude-ls/prelude-ls-tests.ts | 36 ++++++++++++++++++++++------------ prelude-ls/prelude-ls.d.ts | 4 ++-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index 5bc034bc48..c04fb2277e 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -107,28 +107,31 @@ prelude.intersection([1, 2, 3], [2, 1, 3], [3, 1, 2]); //=> [1, 2, 3] var unionRes: Array = prelude.union([1, 5, 7], [3, 5], []); //=> [1, 5, 7, 3] -// --- UNION --- - -prelude.countBy(prelude.floor, [4.2, 6.1, 6.4]); //=> {4: 1, 6: 2} +var countByRes: Object = prelude.countBy(prelude.floor, [4.2, 6.1, 6.4]); +//=> {4: 1, 6: 2} prelude.countBy(x => x.length, ["one", "two", "three"]); //=> {3: 2, 5: 1} -prelude.groupBy(prelude.floor, [4.2, 6.1, 6.4]); //=> {4: [4.2], 6: [6.1, 6.4]} -prelude.groupBy(x => x.length, ["one", "two", "three"]); //=> {3: ["one", "two"], 5: ["three"]} +var groupByRes: Object = prelude.groupBy(prelude.floor, [4.2, 6.1, 6.4]); +//=> {4: [4.2], 6: [6.1, 6.4]} +prelude.groupBy(x => x.length, ["one", "two", "three"]); +//=> {3: ["one", "two"], 5: ["three"]} -prelude.andList([true, 2 + 2 == 4]); //=> true +var andListRes: boolean = prelude.andList([true, 2 + 2 == 4]); //=> true prelude.andList([true, true, false]); //=> false prelude.andList([]); //=> true -prelude.orList([false, false, true, false]); //=> true +var orListRes: boolean = prelude.orList([false, false, true, false]); //=> true prelude.orList([]); //=> false -prelude.any(prelude.even, [3, 5, 7, 8, 9]); //=> true +var anyRes: boolean = prelude.any(prelude.even, [3, 5, 7, 8, 9]); //=> true prelude.any(prelude.even, []); //=> false -prelude.all(prelude.isType("String"), ["ha", "ma", "la"]); //=> true +var allRes: boolean = prelude.all(prelude.isType("String"), ["ha", "ma", "la"]); +//=> true prelude.all(prelude.isType("String"), []); //=> true -prelude.sort([3, 1, 5, 2, 4, 6]); //=> [1, 2, 3, 4, 5, 6] +var sortRes: Array = prelude.sort([3, 1, 5, 2, 4, 6]); +//=> [1, 2, 3, 4, 5, 6] var f = (x: string) => (y: string) => x.length > y.length ? @@ -137,11 +140,18 @@ var f = (x: string) => (y: string) => -1 : 0; -prelude.sortWith(f, ["three", "one", "two"]); //=> ["one", "two", "three"] -prelude.sortBy(x => x.length, ["there", "hey", "a", "ha"]); //=> ["a", "ha", "hey", "there"] +var sortWithRes: Array = prelude.sortWith(f, ["three", "one", "two"]); +//=> ["one", "two", "three"] -var table = [{ +var sortByRes: Array = + prelude.sortBy(x => x.length, ["there", "hey", "a", "ha"]); + //=> ["a", "ha", "hey", "there"] + +var table: Array<{ + id: number, + name: string +}> = [{ id: 1, name: "george" }, { diff --git a/prelude-ls/prelude-ls.d.ts b/prelude-ls/prelude-ls.d.ts index fde6ed1578..26c1890d4f 100644 --- a/prelude-ls/prelude-ls.d.ts +++ b/prelude-ls/prelude-ls.d.ts @@ -75,8 +75,8 @@ declare module "prelude-ls" { export function sort(xs: A[]): A[]; export function sortWith(f: (x: A) => (y: A) => number): (xs: A[]) => A[]; export function sortWith(f: (x: A) => (y: A) => number, xs: A[]): A[]; - export function sortBy(f: (x: A) => B): (xs: A[]) => A; - export function sortBy(f: (x: A) => B, xs: A[]): A; + export function sortBy(f: (x: A) => B): (xs: A[]) => A[]; + export function sortBy(f: (x: A) => B, xs: A[]): A[]; export function sum(xs: number[]): number[]; export function product(xs: number[]): number[]; export function mean(xs: number[]): number[]; From d8822b4a8c471de06715e6bb23a494e62a643c68 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Mon, 15 Jun 2015 00:00:47 -0300 Subject: [PATCH 0147/2220] Return type for sum, product and mean are number, not number[] --- prelude-ls/prelude-ls-tests.ts | 20 +++++++++++--------- prelude-ls/prelude-ls.d.ts | 6 +++--- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index c04fb2277e..a92c3c4243 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -162,23 +162,25 @@ var table: Array<{ name: "donald" }]; prelude.sortBy(x => x.name, table); -//=> [{"id": 3, "name": "donald"}, {"id": 1, "name": "george"}, {"id": 2, "name": "mike"}] +//=> [{"id": 3, "name": "donald"}, +// {"id": 1, "name": "george"}, +// {"id": 2, "name": "mike"}] -prelude.sum([1, 2, 3, 4, 5]); //=> 15 +var sumRes: number = prelude.sum([1, 2, 3, 4, 5]); //=> 15 prelude.sum([]); //=> 0 -prelude.product([1, 2, 3]); //=> 6 +var productRes: number = prelude.product([1, 2, 3]); //=> 6 prelude.product([]); //=> 1 -prelude.mean([1, 2, 3, 4, 5]); //=> 3 +var meanRes: number = prelude.mean([1, 2, 3, 4, 5]); //=> 3 -prelude.maximum([4, 1, 9, 3]); //=> 9 +var maximumRes: number = prelude.maximum([4, 1, 9, 3]); //=> 9 -prelude.minimum(["c", "e", "a", "d", "b"]); //=> "a" +var minimumRes: string = prelude.minimum(["c", "e", "a", "d", "b"]); //=> "a" -prelude.maximumBy(x => x.length, ["hi", "there", "I", "am", "looooong"]); //=> "looooong" - -prelude.maximumBy(x => x.length, ["hi", "there", "I", "am", "looooong"]); //=> "looooong" +var maximumByRes: string = + prelude.maximumBy(x => x.length, ["hi", "there", "I", "am", "looooong"]); + //=> "looooong" prelude.scan(x => y => x + y, 0, [1, 2, 3]); //=> [0, 1, 3, 6] diff --git a/prelude-ls/prelude-ls.d.ts b/prelude-ls/prelude-ls.d.ts index 26c1890d4f..053ed53a4a 100644 --- a/prelude-ls/prelude-ls.d.ts +++ b/prelude-ls/prelude-ls.d.ts @@ -77,9 +77,9 @@ declare module "prelude-ls" { export function sortWith(f: (x: A) => (y: A) => number, xs: A[]): A[]; export function sortBy(f: (x: A) => B): (xs: A[]) => A[]; export function sortBy(f: (x: A) => B, xs: A[]): A[]; - export function sum(xs: number[]): number[]; - export function product(xs: number[]): number[]; - export function mean(xs: number[]): number[]; + export function sum(xs: number[]): number; + export function product(xs: number[]): number; + export function mean(xs: number[]): number; export function maximum(xs: A[]): A; export function minimum(xs: A[]): A; export function maximumBy(f: (x: A) => B): (xs: A[]) => A; From e7c93592608108364fcbb09771c4a3222d9ac9dc Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Mon, 15 Jun 2015 00:07:00 -0300 Subject: [PATCH 0148/2220] Passed tests for Prelude.List --- prelude-ls/prelude-ls-tests.ts | 51 ++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index a92c3c4243..e21893e525 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -182,48 +182,63 @@ var maximumByRes: string = prelude.maximumBy(x => x.length, ["hi", "there", "I", "am", "looooong"]); //=> "looooong" -prelude.scan(x => y => x + y, 0, [1, 2, 3]); //=> [0, 1, 3, 6] +var scanRes: Array = prelude.scan(x => y => x + y, 0, [1, 2, 3]); +//=> [0, 1, 3, 6] -prelude.scan1(x => y => x + y, [1, 2, 3]); //=> [1, 3, 6] +var scan1Res: Array = prelude.scan1(x => y => x + y, [1, 2, 3]); +//=> [1, 3, 6] -prelude.scanr(x => y => x + y, 0, [1, 2, 3]); //=> [6, 5, 3, 0] +var scanrRes: Array = prelude.scanr(x => y => x + y, 0, [1, 2, 3]); +//=> [6, 5, 3, 0] -prelude.scanr1(x => y => x + y, [1, 2, 3]); //=> [6, 5, 3] +var scanr1Res: Array = prelude.scanr1(x => y => x + y, [1, 2, 3]); +//=> [6, 5, 3] -prelude.slice(2, 4, [1, 2, 3, 4, 5]); //=> [3, 4] +var sliceRes: Array = prelude.slice(2, 4, [1, 2, 3, 4, 5]); //=> [3, 4] -prelude.take(2, [1, 2, 3, 4, 5]); //=> [1, 2] +var takeRes: Array = prelude.take(2, [1, 2, 3, 4, 5]); //=> [1, 2] -prelude.drop(2, [1, 2, 3, 4, 5]); //=> [3, 4, 5] +var dropRes: Array = prelude.drop(2, [1, 2, 3, 4, 5]); //=> [3, 4, 5] -prelude.splitAt(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [3, 4, 5]] +var splitAtRes: Array> = + prelude.splitAt(2, [1, 2, 3, 4, 5]); //=> [[1, 2], [3, 4, 5]] -prelude.takeWhile(prelude.odd, [1, 3, 5, 4, 8, 7, 9]); //=> [1, 3, 5] +var takeWhileRes: Array = + prelude.takeWhile(prelude.odd, [1, 3, 5, 4, 8, 7, 9]); //=> [1, 3, 5] -prelude.dropWhile(prelude.even, [2, 4, 5, 6]); //=> [5, 6] +var dropWhileRes: Array = + prelude.dropWhile(prelude.even, [2, 4, 5, 6]); //=> [5, 6] +var spanRes: Array> = prelude.span(prelude.even, [2, 4, 5, 6]); //=> [[2, 4], [5, 6]] -prelude.breakList(x => x == 3, [1, 2, 3, 4, 5]); //=> [[1, 2], [3, 4, 5]] +var breakListRes: Array> = + prelude.breakList(x => x == 3, [1, 2, 3, 4, 5]); //=> [[1, 2], [3, 4, 5]] -prelude.zip([1, 2, 3], [4, 5, 6]); //=> [[1, 4], [2, 5], [3, 6]] +var zipRes: Array> = prelude.zip([1, 2, 3], [4, 5, 6]); +//=> [[1, 4], [2, 5], [3, 6]] -prelude.zipWith(x => y => x + y, [1, 2, 3], [4, 5, 6]); //=> [5, 7, 9] +var zipWithRes: Array = + prelude.zipWith(x => y => x + y, [1, 2, 3], [4, 5, 6]); //=> [5, 7, 9] +var zipAllRes: Array> = prelude.zipAll([1, 2, 3], [4, 5, 6], [7, 8, 9]); //=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] +var zipAllWithRes: Array = prelude.zipAllWith((a, b, c) => a + b + c, [1, 2, 3], [3, 2, 1], [1, 1, 1]); //=> [5, 5, 5] -prelude.at(2, [1, 2, 3, 4]); //=> 3 +var atRes: number = prelude.at(2, [1, 2, 3, 4]); //=> 3 prelude.at(-3, [1, 2, 3, 4]); //=> 2 -prelude.elemIndex("a", ["c", "a", "b", "a"]); //=> 1 +var elemIndexRes: number = prelude.elemIndex("a", ["c", "a", "b", "a"]); //=> 1 -prelude.elemIndices("a", ["c", "a", "b", "a"]); //=> [1, 3] +var elemIndicesRes: Array = + prelude.elemIndices("a", ["c", "a", "b", "a"]); //=> [1, 3] -prelude.findIndex(prelude.even, [1, 2, 3, 4]); //=> 1 +var findIndexRes: number = prelude.findIndex(prelude.even, [1, 2, 3, 4]); //=> 1 -prelude.findIndices(prelude.even, [1, 2, 3, 4]); //=> [1, 3] +var findIndicesRes: Array = + prelude.findIndices(prelude.even, [1, 2, 3, 4]); //=> [1, 3] // Obj From 835b936c5a3080da4f960631f23dadd0ccd69fe4 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Mon, 15 Jun 2015 00:16:37 -0300 Subject: [PATCH 0149/2220] Final tests --- prelude-ls/prelude-ls-tests.ts | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index e21893e525..bea29403b2 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -242,19 +242,27 @@ var findIndicesRes: Array = // Obj -prelude.keys({a: 2, b: 3, c: 9}); //=> ["a", "b", "c"] +var keysRes: Array = prelude.keys({a: 2, b: 3, c: 9}); +//=> ["a", "b", "c"] -prelude.values({a: 2, b: 3, c: 9}); //=> [2, 3, 9] +var valuesRes: Array = prelude.values({a: 2, b: 3, c: 9}); +//=> [2, 3, 9] -prelude.pairsToObj([["a", "b"], ["c", "d"], ["e", 1]]); //=> {a: "b", c: "d", e: 1} +var pairsToObjRes: Object = + prelude.pairsToObj([["a", "b"], ["c", "d"], ["e", 1]]); //=> {a: "b", c: "d", e: 1} -prelude.objToPairs({a: "b", c: "d", e: 1}); //=> [["a", "b"], ["c", "d"], ["e", 1]] +var objToPairsRes: Array> = + prelude.objToPairs({a: "b", c: "d", e: 1}); + //=> [["a", "b"], ["c", "d"], ["e", 1]] -prelude.listsToObj(["a", "b", "c"], [1, 2, 3]); //=> {a: 1, b: 2, c: 3} +var listsToObjRes: Object = + prelude.listsToObj(["a", "b", "c"], [1, 2, 3]); //=> {a: 1, b: 2, c: 3} -prelude.objToLists({a: 1, b: 2, c: 3}); //=> [["a", "b", "c"], [1, 2, 3]] +var objToListsRes = + prelude.objToLists({a: 1, b: 2, c: 3}); + //=> [["a", "b", "c"], [1, 2, 3]] -prelude.Obj.empty({}); //=> true +var objEmptyRes: boolean = prelude.Obj.empty({}); //=> true var count = 4; prelude.Obj.each(x => count += x, {a: 1, b: 2, c: 3}); From 87ed92fda4291cbb83e58241ad7956ada6895662 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Mon, 15 Jun 2015 00:25:15 -0300 Subject: [PATCH 0150/2220] (;) for Travis --- prelude-ls/prelude-ls-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prelude-ls/prelude-ls-tests.ts b/prelude-ls/prelude-ls-tests.ts index bea29403b2..dc36e9913b 100644 --- a/prelude-ls/prelude-ls-tests.ts +++ b/prelude-ls/prelude-ls-tests.ts @@ -149,8 +149,8 @@ var sortByRes: Array = //=> ["a", "ha", "hey", "there"] var table: Array<{ - id: number, - name: string + id: number; + name: string; }> = [{ id: 1, name: "george" From 503a60a6d656b20950157c201c0787ed157e6b12 Mon Sep 17 00:00:00 2001 From: Kristof Mattei Date: Mon, 15 Jun 2015 08:09:02 +0200 Subject: [PATCH 0151/2220] Changed namespace to angular as per comment --- angular-local-storage/angular-local-storage.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-local-storage/angular-local-storage.d.ts b/angular-local-storage/angular-local-storage.d.ts index 940874d23b..ae027527a4 100644 --- a/angular-local-storage/angular-local-storage.d.ts +++ b/angular-local-storage/angular-local-storage.d.ts @@ -6,7 +6,7 @@ /// declare module angular.local.storage { - interface ILocalStorageServiceProvider extends ng.IServiceProvider { + interface ILocalStorageServiceProvider extends angular.IServiceProvider { /** * Setter for the prefix * You should set a prefix to avoid overwriting any local storage variables from the rest of your app @@ -129,7 +129,7 @@ declare module angular.local.storage { * @param value optional * @param key The corresponding key used in local storage */ - bind(scope: ng.IScope, property: string, value?: any, key?: string): Function; + bind(scope: angular.IScope, property: string, value?: any, key?: string): Function; /** * Return the derive key * Returns String From 22ad73a73c130bd33c32ab92ab2efd21e534e605 Mon Sep 17 00:00:00 2001 From: Kei Nakazawa Date: Mon, 15 Jun 2015 15:46:00 +0900 Subject: [PATCH 0152/2220] Replace `Uri` with `URI` regarding https://github.com/atom/atom/commit/7f8ab72 --- atom/atom.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/atom.d.ts b/atom/atom.d.ts index 0abeda3160..3700363ca1 100644 --- a/atom/atom.d.ts +++ b/atom/atom.d.ts @@ -591,7 +591,7 @@ declare module AtomCore { getTextInRange(range:any):any; getLineCount():number; getBuffer():TextBuffer.ITextBuffer; - getUri():string; + getURI():string; isBufferRowBlank(bufferRow:any):boolean; isBufferRowCommented(bufferRow:any):void; nextNonBlankBufferRow(bufferRow:any):void; @@ -886,8 +886,8 @@ declare module AtomCore { saveItem(item:any, nextAction:Function):void; saveItemAs(item:any, nextAction:Function):void; saveItems():any[]; - itemForUri(uri:any):any; - activateItemForUri(uri:any):any; + itemForURI(uri:any):any; + activateItemForURI(uri:any):any; copyActiveItem():void; splitLeft(params:any):IPane; splitRight(params:any):IPane; @@ -978,7 +978,7 @@ declare module AtomCore { open(uri:string, options:any):Q.Promise; openLicense():void; openSync(uri:string, options:any):any; - openUriInPane(uri:string, pane:any, options:any):Q.Promise; + openURIInPane(uri:string, pane:any, options:any):Q.Promise; reopenItemSync():any; registerOpener(opener:(urlToOpen:string)=>any):void; unregisterOpener(opener:Function):void; @@ -988,7 +988,7 @@ declare module AtomCore { saveAll():void; activateNextPane():any; activatePreviousPane():any; - paneForUri: (uri:string) => IPane; + paneForURI: (uri:string) => IPane; saveActivePaneItem():any; saveActivePaneItemAs():any; destroyActivePaneItem():any; From ebe6f6affedba1b2ce8047c58ba32cab9335c9d4 Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 15 Jun 2015 11:29:51 +0200 Subject: [PATCH 0153/2220] Add typings for Pikaday --- pikaday/pikaday-tests.ts | 57 +++++++++++++++++++++++++ pikaday/pikaday.d.ts | 89 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 pikaday/pikaday-tests.ts create mode 100644 pikaday/pikaday.d.ts diff --git a/pikaday/pikaday-tests.ts b/pikaday/pikaday-tests.ts new file mode 100644 index 0000000000..924a559bd9 --- /dev/null +++ b/pikaday/pikaday-tests.ts @@ -0,0 +1,57 @@ +/// +/// +/// + +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.isVisible(); + picker.show(); + picker.adjustPosition(); + picker.hide(); + picker.destroy(); +})(); + +(() => { + var i18n: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}); +})(); diff --git a/pikaday/pikaday.d.ts b/pikaday/pikaday.d.ts new file mode 100644 index 0000000000..21a112b8e4 --- /dev/null +++ b/pikaday/pikaday.d.ts @@ -0,0 +1,89 @@ +// Type definitions for pikaday +// Project: https://github.com/dbushell/Pikaday +// Definitions by: Rudolph Gottesheim +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface PikadayI18nConfig { + previousMonth: string; + nextMonth: string; + months: string[]; + weekdays: string[]; + weekdaysShort: string[]; +} + +interface PikadayOptions { + field?: HTMLElement; + format?: string; + trigger?: HTMLElement; + bound?: boolean; + position?: string; + reposition?: boolean; + container?: HTMLElement; + defaultDate?: Date; + setDefaultDate?: boolean; + firstDay?: number; + minDate?: Date; + maxDate?: Date; + disableWeekends?: boolean; + disableDayFn?: (date:Date) => boolean; + yearRange?: number[]; + showWeekNumber?: boolean; + isRTL?: boolean; + i18n?: PikadayI18nConfig; + yearSuffix?: string; + showMonthAfterYear?: boolean; + numberOfMonths?: number; + mainCalendar?: string; + theme?: string; + onSelect?: (date:Date) => void; + onOpen?: () => void; + onClose?: () => void; + onDraw?: () => void; +} + +declare class Pikaday { + el:HTMLElement; + + constructor(options:PikadayOptions); + + toString():string; + toString(format:string):string; + + getDate():Date|void; + + setDate(date:string|Date, triggerOnSelect?:boolean):void; + + getMoment():moment.Moment; + + setMoment(moment:any):void; + + gotoDate(date:Date):void; + + gotoToday():void; + + gotoMonth(monthIndex:number):void; + + gotoYear(year:number):void; + + nextMonth():void; + + prevMonth():void; + + gogoYear(year:number):void; + + setMinDate(date:Date):void; + + setMaxDate(date:Date):void; + + isVisible():boolean; + + show():void; + + hide():void; + + adjustPosition():void; + + destroy():void; +} From 9baad8ed62aefe8ca323480ca5fa321a278d8135 Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 15 Jun 2015 11:42:23 +0200 Subject: [PATCH 0154/2220] Add Pikaday test --- pikaday/pikaday-tests.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pikaday/pikaday-tests.ts b/pikaday/pikaday-tests.ts index 924a559bd9..28d0c33c2c 100644 --- a/pikaday/pikaday-tests.ts +++ b/pikaday/pikaday-tests.ts @@ -55,3 +55,14 @@ new Pikaday({field: $('#datepicker')[0]}); }; 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] + }); +})(); From b116936ea52a2f437a44098718f7e64f4d60746d Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Mon, 15 Jun 2015 12:32:10 +0200 Subject: [PATCH 0155/2220] updates for streamjs 1.5.0 --- streamjs/README.md | 3 +++ streamjs/streamjs-tests.ts | 6 +++--- streamjs/streamjs.d.ts | 7 ++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/streamjs/README.md b/streamjs/README.md index 9428177672..36f8ec46c9 100644 --- a/streamjs/README.md +++ b/streamjs/README.md @@ -1,5 +1,8 @@ # StreamJS Type Definitions +Note: this definition file is not for the StreamJS library available at http://streamjs.org but the one at +http://winterbe.github.io/streamjs/ . + Unsupported StreamJS function / method signatures: * Stream(collection) * Stream(string) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index f83ec69e82..ca9d65183c 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -4,7 +4,7 @@ var numStream: Stream; numStream = Stream.of(1, 2, 3); numStream = Stream.range(1, 5); numStream = Stream.rangeClosed(1, 5); - +numStream = Stream.from([1, 2, 3]); Stream.generate(function() { return 1; }); @@ -35,7 +35,7 @@ var strStream = numStream .takeWhile(/^aa.*$/) .slice(5, 2) ; - +strStream = Stream.from("foobar"); var strArray = strStream.toArray(); strArray = strStream.toList(); strStream.each(s => console.log(s)); @@ -77,7 +77,7 @@ class MyList { var elems: any[]; -var myStream = Stream.make([new MyList, new MyList]); +var myStream = Stream.from([new MyList, new MyList]); elems = myStream .flatMap(list => list.elems) .toArray(); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 81ed58a82f..0db7cff727 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -1,11 +1,12 @@ -// Type definitions for streamjs 1.4.0 -// Project: https://github.com/winterbe/streamjs +// Type definitions for streamjs 1.5.0 +// Project: http://winterbe.github.io/streamjs/ // Definitions by: Bence Eros // Definitions: https://github.com/borisyankov/DefinitelyTyped declare class Stream { // static make (...elems: T[]): Stream; - static make (elems: T[]): Stream; + static from (elems: T[]): Stream; + static from(str: string): Stream; static of(...elems: T[]): Stream; static range (startInclusive: number, endExclusive: number): Stream; static rangeClosed (startInclusive: number, endInclusive: number): Stream; From a29d577f810ea05786bb9b9eaa9f06c58e4d4003 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Mon, 15 Jun 2015 12:33:38 +0200 Subject: [PATCH 0156/2220] removing some comments --- streamjs/streamjs-tests.ts | 2 -- streamjs/streamjs.d.ts | 3 --- 2 files changed, 5 deletions(-) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index ca9d65183c..ba989f4474 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -81,7 +81,6 @@ var myStream = Stream.from([new MyList, new MyList]); elems = myStream .flatMap(list => list.elems) .toArray(); - //.forEach(s => console.log(s)); myStream = myStream.takeWhile({name: "foo"}); myStream = myStream.dropWhile({name: "foo"}); @@ -137,7 +136,6 @@ var done: boolean = iter.done; var optNum: Stream.Optional = Stream.Optional.of(2); optNum = Stream.Optional.ofNullable(null); -//optNum = Stream.Optional.empty(); var optStr: Stream.Optional = optNum.filter(n => n % 2 == 0) .map(n => "number" + n) diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index 0db7cff727..e36dcca239 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare class Stream { - // static make (...elems: T[]): Stream; static from (elems: T[]): Stream; static from(str: string): Stream; static of(...elems: T[]): Stream; @@ -12,7 +11,6 @@ declare class Stream { static rangeClosed (startInclusive: number, endInclusive: number): Stream; static generate (supplier: Stream.Supplier): Stream; static iterate(seed: T, fn: Stream.Function): Stream; - // static empty(): Stream; anyMatch(predicate: Stream.Predicate): boolean; anyMatch(regexp: RegExp): boolean; @@ -148,7 +146,6 @@ declare module Stream { export class Optional { static of(elem: T): Optional; static ofNullable(elem: T): Optional; - // static empty(): Optional; filter(predicate: (elem: T) => boolean): Optional; map(mapper: (elem: T) => U): Optional; From f20634f5fc012b94acdc5624955dc8fa460ea4a1 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Mon, 15 Jun 2015 12:35:47 +0200 Subject: [PATCH 0157/2220] readme cleanup --- streamjs/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/streamjs/README.md b/streamjs/README.md index 36f8ec46c9..ba28f14426 100644 --- a/streamjs/README.md +++ b/streamjs/README.md @@ -4,9 +4,9 @@ Note: this definition file is not for the StreamJS library available at http://s http://winterbe.github.io/streamjs/ . Unsupported StreamJS function / method signatures: - * Stream(collection) - * Stream(string) - * Stream.empty() - * map(path) - * flatMap(path) - * Optional.empty() + * `Stream(collection)` (but `Stream.from(collection)` works) + * `Stream(string) (but `Stream.from(string)` works) + * `Stream.empty()` + * `map(path)` + * `flatMap(path)` + * `Optional.empty()` From d307a6399b0a22d24e24fc7ac1c1da98fa700ab8 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Mon, 15 Jun 2015 12:36:21 +0200 Subject: [PATCH 0158/2220] readme cleanup --- streamjs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/streamjs/README.md b/streamjs/README.md index ba28f14426..400e3bc412 100644 --- a/streamjs/README.md +++ b/streamjs/README.md @@ -5,7 +5,7 @@ http://winterbe.github.io/streamjs/ . Unsupported StreamJS function / method signatures: * `Stream(collection)` (but `Stream.from(collection)` works) - * `Stream(string) (but `Stream.from(string)` works) + * `Stream(string)` (but `Stream.from(string)` works) * `Stream.empty()` * `map(path)` * `flatMap(path)` From 5a1301bb499df624d27dbb24233e1d0847710674 Mon Sep 17 00:00:00 2001 From: Kei Son Date: Mon, 15 Jun 2015 21:08:16 +0900 Subject: [PATCH 0159/2220] bluebird: Add support to handle a type and a promise of the type altogether A fulfilled handler can handle a raw value and a promise of the raw value at same time. --- bluebird/bluebird-tests.ts | 5 +++++ bluebird/bluebird.d.ts | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index 65d9a0055d..7770e7c9b8 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -219,6 +219,11 @@ barProm = fooProm.then((value: Foo) => { barProm = fooProm.then((value: Foo) => { return bar; }); +barProm = barProm.then((value: Bar) => { + if (value) return value; + var b:Bar; + return Promise.resolve(b); +}); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts index 424cdcbf28..cd21d77e92 100644 --- a/bluebird/bluebird.d.ts +++ b/bluebird/bluebird.d.ts @@ -26,10 +26,8 @@ declare class Promise implements Promise.Thenable, Promise.Inspection { /** * Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise. */ - then(onFulfill: (value: R) => Promise.Thenable, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - then(onFulfill: (value: R) => Promise.Thenable, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; - then(onFulfill: (value: R) => U, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; - then(onFulfill?: (value: R) => U, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => U|Promise.Thenable, onReject: (error: any) => Promise.Thenable, onProgress?: (note: any) => any): Promise; + then(onFulfill: (value: R) => U|Promise.Thenable, onReject?: (error: any) => U, onProgress?: (note: any) => any): Promise; /** * This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler. @@ -633,10 +631,8 @@ declare module Promise { export function OperationalError(): OperationalError; export interface Thenable { - then(onFulfilled: (value: R) => Thenable, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled: (value: R) => Thenable, onRejected?: (error: any) => U): Thenable; - then(onFulfilled: (value: R) => U, onRejected: (error: any) => Thenable): Thenable; - then(onFulfilled?: (value: R) => U, onRejected?: (error: any) => U): Thenable; + then(onFulfilled: (value: R) => U|Thenable, onRejected: (error: any) => Thenable): Thenable; + then(onFulfilled: (value: R) => U|Thenable, onRejected?: (error: any) => U): Thenable; } export interface Resolver { From 6bae89e51d9b28d4792dc29da55b969c4ec4ad4f Mon Sep 17 00:00:00 2001 From: yiting Date: Mon, 15 Jun 2015 10:52:38 -0700 Subject: [PATCH 0160/2220] Update keypress.d.ts change keydown callback type definition according to keypress document --- keypress/keypress.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/keypress/keypress.d.ts b/keypress/keypress.d.ts index bd831d5b0a..f3eada39dc 100644 --- a/keypress/keypress.d.ts +++ b/keypress/keypress.d.ts @@ -16,12 +16,12 @@ declare module Keypress { is_solitary: boolean; is_sequence: boolean; } - + interface Combo { keys: string; - on_keydown: () => any; - on_keyup: () => any; - on_release: () => any; + on_keydown: (event?: KeyboardEvent, count?: number) => any; + on_keyup: (event?: KeyboardEvent) => any; + on_release: (event?: KeyboardEvent) => any; this: Element; prevent_default: boolean; prevent_repeat: boolean; @@ -31,14 +31,14 @@ declare module Keypress { is_sequence: boolean; is_solitary: boolean; } - + interface Listener { new(element: Element, defaults: ListenerDefaults): Listener; new(element: Element): Listener; new(): Listener; - simple_combo(keys: string, on_keydown_callback: () => any): void; - counting_combo(keys: string, on_count_callback: () => any): void; - sequence_combo(keys: string, callback: () => any): void; + simple_combo(keys: string, on_keydown_callback: (event?: KeyboardEvent, count?: number) => any): void; + counting_combo(keys: string, on_count_callback: (event?: KeyboardEvent, count?: number) => any): void; + sequence_combo(keys: string, callback: (event?: KeyboardEvent, count?: number) => any): void; register_combo(combo: Combo): void; unregister_combo(combo: Combo): void; unregister_combo(keys: string): void; @@ -50,7 +50,7 @@ declare module Keypress { listen(): void; stop_listening(): void; } - + interface Keypress { Listener: Listener; } From 257f64d3949b59846ee2116aa638d90582a7b99b Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Mon, 15 Jun 2015 11:32:45 -0700 Subject: [PATCH 0161/2220] PolylineOptions should extend PathOption `PolylineOptions` should extend `PathOptions`, so that user could supply options in the base class --- leaflet/leaflet.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index dd57395001..ac3d4c8ff0 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3448,7 +3448,7 @@ declare module L { declare module L { - export interface PolylineOptions { + export interface PolylineOptions extends PathOptions { /** * How much to simplify the polyline on each zoom level. More means better performance From cac474a0e2a81a311f4e10a5cdbfcc55823002c2 Mon Sep 17 00:00:00 2001 From: Calvin Fernandez Date: Mon, 15 Jun 2015 20:21:26 -0400 Subject: [PATCH 0162/2220] Move handlebars to handlebars-1.0.0. --- ember/ember-tests.ts | 2 +- ember/ember.d.ts | 2 +- handlebars/{handlebars.d.ts => handlebars-1.0.0.d.ts} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename handlebars/{handlebars.d.ts => handlebars-1.0.0.d.ts} (100%) diff --git a/ember/ember-tests.ts b/ember/ember-tests.ts index ef9b7e6d11..6889eef5c4 100644 --- a/ember/ember-tests.ts +++ b/ember/ember-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// var App : any; diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 332d31b1aa..cd1ef6079e 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// +/// declare var Handlebars: HandlebarsStatic; diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars-1.0.0.d.ts similarity index 100% rename from handlebars/handlebars.d.ts rename to handlebars/handlebars-1.0.0.d.ts From 660e1252cd797916da148fb381b629443ca5771d Mon Sep 17 00:00:00 2001 From: Calvin Fernandez Date: Mon, 15 Jun 2015 20:22:32 -0400 Subject: [PATCH 0163/2220] Update handlebars definition files for handlebars 3.0.3 --- handlebars/handlebars.d.ts | 224 +++++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) create mode 100644 handlebars/handlebars.d.ts diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts new file mode 100644 index 0000000000..6526857240 --- /dev/null +++ b/handlebars/handlebars.d.ts @@ -0,0 +1,224 @@ +// Type definitions for Handlebars v3.0.3 +// Project: http://handlebarsjs.com/ +// Definitions by: Boris Yankov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +declare module Handlebars { + export function registerHelper(name: string, fn: Function, inverse?: boolean): void; + export function registerPartial(name: string, str: any): void; + export function K(): void; + export function createFrame(object: any): any; + export function Exception(message: string): void; + export function log(level: number, obj: any): void; + export function parse(input: string): hbs.AST.Program; + export function compile(input: any, options?: any): HandlebarsTemplateDelegate; + + export var SafeString: typeof hbs.SafeString; + export var Utils: typeof hbs.Utils; + export var logger: Logger; + export var templates: HandlebarsTemplates; + + export module AST { + export var helpers: hbs.AST.helpers; + } + + interface ICompiler { + accept(node: hbs.AST.Node): void; + Program(program: hbs.AST.Program): void; + BlockStatement(block: hbs.AST.BlockStatement): void; + PartialStatement(partial: hbs.AST.PartialStatement): void; + MustacheStatement(mustache: hbs.AST.MustacheStatement): void; + ContentStatement(content: hbs.AST.ContentStatement): void; + CommentStatement(comment?: hbs.AST.CommentStatement): void; + SubExpression(sexpr: hbs.AST.SubExpression): void; + PathExpression(path: hbs.AST.PathExpression): void; + StringLiteral(str: hbs.AST.StringLiteral): void; + NumberLiteral(num: hbs.AST.NumberLiteral): void; + BooleanLiteral(bool: hbs.AST.BooleanLiteral): void; + UndefinedLiteral(): void; + NullLiteral(): void; + Hash(hash: hbs.AST.Hash): void; + } + + export class Visitor implements ICompiler { + accept(node: hbs.AST.Node): void; + acceptKey(node: hbs.AST.Node, name: string): void; + acceptArray(arr: hbs.AST.Expression[]): void; + Program(program: hbs.AST.Program): void; + BlockStatement(block: hbs.AST.BlockStatement): void; + PartialStatement(partial: hbs.AST.PartialStatement): void; + MustacheStatement(mustache: hbs.AST.MustacheStatement): void; + ContentStatement(content: hbs.AST.ContentStatement): void; + CommentStatement(comment?: hbs.AST.CommentStatement): void; + SubExpression(sexpr: hbs.AST.SubExpression): void; + PathExpression(path: hbs.AST.PathExpression): void; + StringLiteral(str: hbs.AST.StringLiteral): void; + NumberLiteral(num: hbs.AST.NumberLiteral): void; + BooleanLiteral(bool: hbs.AST.BooleanLiteral): void; + UndefinedLiteral(): void; + NullLiteral(): void; + Hash(hash: hbs.AST.Hash): void; + } +} + +/** +* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View +**/ +interface HandlebarsTemplatable { + template: HandlebarsTemplateDelegate; +} + +interface HandlebarsTemplateDelegate { + (context: any, options?: any): string; +} + +interface HandlebarsTemplates { + [index: string]: HandlebarsTemplateDelegate; +} + +declare module hbs { + class SafeString { + constructor(str: string); + static toString(): string; + } + + module Utils { + function escapeExpression(str: string): string; + } +} + +interface Logger { + DEBUG: number; + INFO: number; + WARN: number; + ERROR: number; + level: number; + + methodMap: { [level: number]: string }; + + log(level: number, obj: string): void; +} + +declare module hbs { + module AST { + interface Node { + type: string; + loc: SourceLocation; + } + + interface SourceLocation { + source: string; + start: Position; + end: Position; + } + + interface Position { + line: number; + column: number; + } + + interface Program extends Node { + body: Statement[]; + blockParams: string[]; + } + + interface Statement extends Node {} + + interface MustacheStatement extends Statement { + path: PathExpression | Literal; + params: Expression[]; + hash: Hash; + escaped: boolean; + strip: StripFlags; + } + + interface BlockStatement extends Statement { + path: PathExpression; + params: Expression[]; + hash: Hash; + program: Program; + inverse: Program; + openStrip: StripFlags; + inverseStrip: StripFlags; + closeStrip: StripFlags; + } + + interface PartialStatement extends Statement { + name: PathExpression | SubExpression; + params: Expression[]; + hash: Hash; + indent: string; + strip: StripFlags; + } + + interface ContentStatement extends Statement { + value: string; + original: StripFlags; + } + + interface CommentStatement extends Statement { + value: string; + strip: StripFlags; + } + + interface Expression extends Node {} + + interface SubExpression extends Expression { + path: PathExpression; + params: Expression[]; + hash: Hash; + } + + interface PathExpression extends Expression { + data: boolean; + depth: number; + parts: string[]; + original: string; + } + + interface Literal extends Expression {} + interface StringLiteral extends Literal { + value: string; + original: string; + } + + interface BooleanLiteral extends Literal { + value: boolean; + original: boolean; + } + + interface NumberLiteral extends Literal { + value: number; + original: number; + } + + interface UndefinedLiteral extends Literal {} + + interface NullLiteral extends Literal {} + + interface Hash extends Node { + pairs: HashPair[]; + } + + interface HashPair extends Node { + key: string; + value: Expression; + } + + interface StripFlags { + open: boolean; + close: boolean; + } + + interface helpers { + helperExpression(node: Node): boolean; + scopeId(path: PathExpression): boolean; + simpleId(path: PathExpression): boolean; + } + } +} + +declare module "handlebars" { + export = Handlebars; +} From 61a910b70f9b8d3a4eae2ac489622629d79d3b77 Mon Sep 17 00:00:00 2001 From: Jiayu Liu Date: Mon, 15 Jun 2015 17:23:06 -0700 Subject: [PATCH 0164/2220] Canvas should extend TileLayer As per [document](http://leafletjs.com/reference.html#tilelayer-canvas), the `Canvas` interface should extend `TileLayer` --- leaflet/leaflet.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet/leaflet.d.ts b/leaflet/leaflet.d.ts index dd57395001..6dcd0ce145 100755 --- a/leaflet/leaflet.d.ts +++ b/leaflet/leaflet.d.ts @@ -3886,7 +3886,7 @@ declare module L { setParams(params: WMS, noRedraw?: boolean): WMS; } - export interface Canvas { + export interface Canvas extends TileLayer { /** * You need to define this method after creating the instance to draw tiles; * canvas is the actual canvas tile on which you can draw, tilePoint represents From 1b37e4ae9b7f74fd81434cb62e4e86f697095c36 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 15 Jun 2015 18:49:48 -0700 Subject: [PATCH 0165/2220] documentdb improvements --- documentdb/documentdb-tests.ts | 61 ++++++++++++++++++++++++ documentdb/documentdb.d.ts | 87 +++++++++++++++++++++++++++++----- 2 files changed, 137 insertions(+), 11 deletions(-) diff --git a/documentdb/documentdb-tests.ts b/documentdb/documentdb-tests.ts index 13927cd93a..31f50624c4 100644 --- a/documentdb/documentdb-tests.ts +++ b/documentdb/documentdb-tests.ts @@ -13,6 +13,22 @@ docDBClient.createDatabase({ id: 'foo' }, undefined, (error, result) => { } }); +var dbQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM database d WHERE d.id = @id', parameters: [{name: 'id', value: 'foo'}]} +docDBClient.queryDatabases(dbQuerySpec).toArray((error, result) => { + + if (error) { + throw new Error(error.body); + } + else { + if (result.length < 1) { + throw new Error('Database foo not found'); + } + else { + console.log('Found database: ' + result[0].id); + } + } +}) + docDBClient.createCollection('database', { id: 'foo' }, undefined, (error, result) => { if (error) { @@ -40,6 +56,41 @@ docDBClient.createStoredProcedure('collection', procedure, undefined, (error, re } }); +var trigger: docDB.Trigger = { + id: 'trigger-one', + body: function () { + console.log('bar'); + }, + triggerType: 'pre', + triggerOperation: 'all' +} + +docDBClient.createTrigger('collection', trigger, undefined, (error, result) => { + + if (error) { + throw new Error(error.body); + } + else { + console.log('Created trigger: ' + result.id); + } +}); + +var triggerQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM trigger t WHERE t.id = @id', parameters: [{name: 'id', value: 'trigger-foo'}]} +docDBClient.queryTriggers('collection', triggerQuerySpec).toArray((error, result) => { + + if (error) { + throw new Error(error.body); + } + else { + if (result.length < 1) { + throw new Error('Trigger trigger-foo not found'); + } + else { + console.log('Found trigger: ' + result[0].id); + } + } +}); + var document: docDB.NewDocument<{ val: string }> = { id: '10' }; @@ -51,6 +102,16 @@ docDBClient.createDocument('collection', document, undefined, (error, result) => } else { console.log('Created document: ' + result.id); + + docDBClient.replaceDocument(result._self, document, undefined, (subError, subResult) => { + + if (subError) { + throw new Error(subError.body); + } + else { + console.log('Replaced document: ' + subResult.id); + } + }) } }); diff --git a/documentdb/documentdb.d.ts b/documentdb/documentdb.d.ts index 5815435081..6d064ef311 100644 --- a/documentdb/documentdb.d.ts +++ b/documentdb/documentdb.d.ts @@ -1,6 +1,6 @@ // Type definitions for DocumentDB // Project: https://github.com/Azure/azure-documentdb-node -// Definitions by: Noel Abrahams +// Definitions by: Noel Abrahams , Brett Gutstein // Definitions: https://github.com/borisyankov/DefinitelyTyped/documentdb declare module 'documentdb' { @@ -52,7 +52,25 @@ declare module 'documentdb' { /** Disables the automatic id generation. If id is missing in the body and this option is true, an error will be returned. */ disableAutomaticIdGeneration?: boolean; } - + + /** The Sql query parameter. */ + interface SqlParameter { + /** The name of the parameter. */ + name: string; + + /** The value of the parameter. */ + value: string; + } + + /** The Sql query specification. */ + interface SqlQuerySpec { + /** The body of the query. */ + query: string; + + /** The array of SqlParameters. */ + parameters: SqlParameter[]; + } + /** Represents the error object returned from a failed query. */ interface QueryError { @@ -130,6 +148,13 @@ declare module 'documentdb' { interface ProcedureMeta extends AbstractMeta { body: string; } + + /** Represents the meta data for a trigger. */ + interface TriggerMeta extends AbstractMeta { + body: string; + triggerType: string; + triggerOperation: string; + } /** An object that is used for authenticating requests and must contains one of the options. */ export interface AuthOptions { @@ -150,6 +175,18 @@ declare module 'documentdb' { /** The function representing the stored procedure. */ body(...params: any[]): void; } + + /** Represents a DocumentDB trigger. */ + export interface Trigger extends UniqueId { + /** The type of the trigger. Should be either 'pre' or 'post'. */ + triggerType: string; + + /** The trigger operation. Should be one of 'all', 'create', 'update', 'delete', or 'replace'. */ + triggerOperation: string; + + /** The function representing the trigger. */ + body(...params: any[]): void; + } /** Represents DocumentDB collection. */ export interface Collection extends UniqueId { @@ -195,12 +232,9 @@ declare module 'documentdb' { ExcludedPaths: string[]; } - - /** Provides a client-side logical representation of the Azure DocumentDB database account. This client is used to configure and execute requests against the service. */ export class DocumentClient { - /** * Constructs a DocumentClient. * @param urlConnection - The service endpoint to use to create the client. @@ -250,6 +284,19 @@ declare module 'documentdb' { * @param callback - The callback for the request. */ public createStoredProcedure(collectionLink: string, procedure: Procedure, options: RequestOptions, callback: RequestCallback): void; + + /** + * Create a trigger. + *

+ * DocumentDB supports pre and post triggers defined in JavaScript to be executed on creates, updates and deletes.
+ * For additional details, refer to the server-side JavaScript API documentation. + *

+ * @param collectionLink - The self-link of the collection. + * @param trigger - Represents the body of the trigger. + * @param [options] - The request options. + * @param callback - The callback for the request. + */ + public createTrigger(collectionLink: string, trigger: Trigger, options: RequestOptions, callback: RequestCallback): void; /** * Create a document. @@ -277,7 +324,7 @@ declare module 'documentdb' { * @param [options] - The feed options. * @returns - An instance of QueryIterator to handle reading feed. */ - public queryDatabases(query: string): QueryIterator; + public queryDatabases(query: string | SqlQuerySpec): QueryIterator; /** * Query the collections for the database. @@ -286,7 +333,7 @@ declare module 'documentdb' { * @param [options] - Represents the feed options. * @returns - An instance of queryIterator to handle reading feed. */ - public queryCollections(databaseLink: string, query: string): QueryIterator; + public queryCollections(databaseLink: string, query: string | SqlQuerySpec): QueryIterator; /** * Query the storedProcedures for the collection. @@ -295,7 +342,7 @@ declare module 'documentdb' { * @param [options] - Represents the feed options. * @returns - An instance of queryIterator to handle reading feed. */ - public queryStoredProcedures(collectionLink: string, query: string): QueryIterator; + public queryStoredProcedures(collectionLink: string, query: string | SqlQuerySpec): QueryIterator; /** * Query the documents for the collection. @@ -304,8 +351,17 @@ declare module 'documentdb' { * @param [options] - Represents the feed options. * @returns - An instance of queryIterator to handle reading feed. */ - public queryDocuments(collectionLink: string, query: string, options?: FeedOptions): QueryIterator>; + public queryDocuments(collectionLink: string, query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator>; + /** + * Query the triggers for the collection. + * @param {string} collectionLink - The self-link of the collection. + * @param {SqlQuerySpec | string} query - A SQL query. + * @param {FeedOptions} [options] - Represents the feed options. + * @returns {QueryIterator} - An instance of queryIterator to handle reading feed. + */ + public queryTriggers(collectionLink: string, query: string | SqlQuerySpec, options?: FeedOptions): QueryIterator; + /** * Delete the document object. * @param documentLink - The self-link of the document. @@ -337,7 +393,16 @@ declare module 'documentdb' { * @param callback - The callback for the request. */ public deleteStoredProcedure(procedureLink: string, options: RequestOptions, callback: RequestCallback): void; - + + /** + * Replace the document object. + * @param {string} documentLink - The self-link of the document. + * @param {object} document - Represent the new document body. + * @param {RequestOptions} [options] - The request options. + * @param {RequestCallback} callback - The callback for the request. + */ + public replaceDocument(documentLink: string, document: NewDocument, options: RequestOptions, callback: RequestCallback>): void; + /** * Replace the StoredProcedure object. * @param procedureLink - The self-link of the stored procedure. @@ -347,4 +412,4 @@ declare module 'documentdb' { */ public replaceStoredProcedure(procedureLink: string, procedure: Procedure, options: RequestOptions, callback: RequestCallback): void; } -} \ No newline at end of file +} From db86358f82ff71cd0e22c7c707f6ef16c4ebcd86 Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Tue, 16 Jun 2015 14:14:43 +0900 Subject: [PATCH 0166/2220] crossroads: specify return types explicitly. This also fix the compile error which will happwn if you pass `noImplicitAny` to tsc. --- crossroads/crossroads-tests.ts | 38 +++++++++++++++++----------------- crossroads/crossroads.d.ts | 14 ++++++------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/crossroads/crossroads-tests.ts b/crossroads/crossroads-tests.ts index 3663361125..26ff1dda3a 100644 --- a/crossroads/crossroads-tests.ts +++ b/crossroads/crossroads-tests.ts @@ -2,7 +2,7 @@ //String rule with param: //match '/news/123' passing "123" as param to handler -var route1 = crossroads.addRoute('/news/{id}', function(id){ +var route1 = crossroads.addRoute('/news/{id}', function(id: any){ console.log(id); }); @@ -16,7 +16,7 @@ route2.matched.add(console.log, console); //RegExp rule: //match '/lorem/ipsum' passing "ipsum" as param to handler //note the capturing group around segment -var route3 = crossroads.addRoute(/^\/lorem\/([a-z]+)$/, function(id){ +var route3 = crossroads.addRoute(/^\/lorem\/([a-z]+)$/, function(id: any){ console.log(id); }); @@ -29,13 +29,13 @@ route4.matched.add(console.log, console); //Query String: //match 'foo.php?lorem=ipsum&dolor=amet' -crossroads.addRoute('foo.php{?query}', function(query){ +crossroads.addRoute('foo.php{?query}', function(query: any){ // query strings are decoded into objects console.log('lorem '+ query.lorem +' dolor sit '+ query.dolor); }); var sectionRoute = crossroads.addRoute('/{section}/{id}'); -function onSectionMatch(section, id){ +function onSectionMatch(section: any, id: any){ console.log(section +' - '+ id); } sectionRoute.matched.add(onSectionMatch); @@ -46,21 +46,21 @@ crossroads.parse('/news/123'); crossroads.parse('/news/123', ["lorem", "ipsum"]); var route1 = crossroads.addRoute('/news/{id}'); -crossroads.bypassed.add(function(request){ +crossroads.bypassed.add(function(request: any){ console.log(request); }); //won't match any route, triggering `bypassed` Signal crossroads.parse('/foo'); -crossroads.routed.add(function(request, data){ +crossroads.routed.add(function(request: any, data: any){ console.log(request); console.log(data.route +' - '+ data.params +' - '+ data.isFirst); }); crossroads.parse('/news/123'); //match `route1`, triggering `routed` Signal var otherRouter = crossroads.create(); -otherRouter.addRoute('/news/{id}', function(id){ +otherRouter.addRoute('/news/{id}', function(id: any){ console.log(id); }); otherRouter.parse('/news/123'); @@ -70,36 +70,36 @@ crossroads.bypassed.add(otherRouter.parse, otherRouter); // same effect as calling: `crossroads.pipe(otherRouter)` crossroads.normalizeFn = crossroads.NORM_AS_OBJECT; -crossroads.addRoute('/{foo}/{bar}', function(vals){ +crossroads.addRoute('/{foo}/{bar}', function(vals: any){ //can access captured values as object properties console.log(vals.foo +' - '+ vals.bar); }); crossroads.parse('/lorem/ipsum'); crossroads.normalizeFn = crossroads.NORM_AS_ARRAY; -crossroads.addRoute('/{foo}/{bar}', function(vals){ +crossroads.addRoute('/{foo}/{bar}', function(vals: any){ //can access captured values as Array items console.log(vals[0] +' - '+ vals[1]); }); crossroads.parse('/dolor/amet'); -crossroads.normalizeFn = function(request, vals){ +crossroads.normalizeFn = function(request: any, vals: any){ //make sure first argument is always "news" return ['news', vals.id]; }; -crossroads.addRoute('/{cat}/{id}', function(cat, id){ +crossroads.addRoute('/{cat}/{id}', function(cat: any, id: any){ console.log(cat +' - '+ id); }); crossroads.parse('/article/123'); crossroads.shouldTypecast = true; //default = false -crossroads.addRoute('/news/{id}', function(id){ +crossroads.addRoute('/news/{id}', function(id: any){ console.log(id); // 12 (remove trailing zeroes since it's typecasted) }); crossroads.parse('/news/00012'); crossroads.shouldTypecast = false; //default = false -crossroads.addRoute('/news/{id}', function(id){ +crossroads.addRoute('/news/{id}', function(id: any){ console.log(id); // "00012" (keep trailing zeroes) }); crossroads.parse('/news/00012'); @@ -122,10 +122,10 @@ sectionRouter.unpipe(navRouter); sectionRouter.parse('bar'); var route1 = crossroads.addRoute('/news/{id}'); -route1.matched.add(function(id){ +route1.matched.add(function(id: any){ console.log('handler 1: '+ id); }); -route1.matched.add(function(id){ +route1.matched.add(function(id: any){ console.log('handler 2: '+ id); }); crossroads.parse('/news/123'); //will trigger both handlers of `route1` @@ -145,7 +145,7 @@ route1.rules = { * @param {object} valuesObj Values of all pattern segments. * @return {boolean} If segment value is valid. */ - id : function(value, request, valuesObj){ + id : function(value: any, request: string, valuesObj: any): boolean{ if(isNaN(value)){ return false; }else{ @@ -165,7 +165,7 @@ route1.rules = { * Note that request will be typecasted if value is a boolean * or number and crossroads.shouldTypecast = true (default = false). */ - request_ : function(request){ + request_ : function(request: any){ return (request != '123'); }, @@ -177,7 +177,7 @@ route1.rules = { * also a property `request_`. * @return {array} Array containing parameters. */ - normalize_ : function(request, vals){ + normalize_ : function(request: any, vals: any): Array { //ignore "date" since it isn't important for the application return [vals.section, vals.id]; } @@ -196,7 +196,7 @@ var route1 = crossroads.addRoute(/([\-\w]+)\/([\-\w]+)\/([\-\w]+)/); route1.rules = { '0' : ['blog', 'news', '123'], '1' : /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/, - '2' : function(value, request, valuesObj){ + '2' : function(value: any, request: any, valuesObj: any){ return ! isNaN(value); } }; diff --git a/crossroads/crossroads.d.ts b/crossroads/crossroads.d.ts index 1ef15aba7a..84f69ea4c8 100644 --- a/crossroads/crossroads.d.ts +++ b/crossroads/crossroads.d.ts @@ -28,7 +28,7 @@ declare module CrossroadsJs { /** * Remove route from crossroads and destroy it, releasing memory. */ - dispose(); + dispose(): void; /** * Test if Route matches against request. Return true if request validate against route rules and pattern. @@ -70,12 +70,12 @@ declare module CrossroadsJs { * * @param route Reference to the Route object returned by crossroads.addRoute(). */ - removeRoute(route: Route); + removeRoute(route: Route): void; /** * Remove all routes from crossroads collection. */ - removeAllRoutes(); + removeAllRoutes(): void; /** * Parse a string input and dispatch matched Signal of the first Route that matches the request. @@ -83,7 +83,7 @@ declare module CrossroadsJs { * @param request String that should be evaluated and matched against Routes to define which Route handlers should be executed and which parameters should be passed to the handlers. * @param defaultargs Array containing values passed to matched/routed/bypassed signals as first arguments. Useful for node.js in case you need to access the request and response objects. */ - parse(request: string, ...defaultArgs: any[]); + parse(request: string, ...defaultArgs: any[]): void; /** * Get number of Routes contained on the crossroads collection. @@ -133,7 +133,7 @@ declare module CrossroadsJs { /** * Resets the Router internal state. Will clear reference to previously matched routes (so they won't dispatch switched signal when matching a new route) and reset last request. */ - resetState(); + resetState(): void; /** * Sets if Router should care about previous state, so multiple crossroads.parse() calls passing same argument would not trigger the routed, matched and bypassed signals. @@ -143,12 +143,12 @@ declare module CrossroadsJs { /** * Pipe routers, so all crossroads.parse() calls will be forwarded to the other router as well. */ - pipe(router: CrossRoadsStatic); + pipe(router: CrossRoadsStatic): void; /** * "Ceci n'est pas une pipe" */ - unpipe(router: CrossRoadsStatic); + unpipe(router: CrossRoadsStatic): void; } } From 2d0a04f068aeeeacbcbfbc6fb2790a8e66b3f330 Mon Sep 17 00:00:00 2001 From: Arseniy Maximov Date: Tue, 16 Jun 2015 20:28:16 +0300 Subject: [PATCH 0167/2220] Add forEachOf, forEachOfSeries, forEachOfLimit definitions --- async/async.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/async/async.d.ts b/async/async.d.ts index adf6fe11be..56370c15dc 100644 --- a/async/async.d.ts +++ b/async/async.d.ts @@ -1,16 +1,23 @@ // Type definitions for Async 0.9.2 // Project: https://github.com/caolan/async -// Definitions by: Boris Yankov +// Definitions by: Boris Yankov , Arseniy Maximov // Definitions: https://github.com/borisyankov/DefinitelyTyped interface Dictionary { [key: string]: T; } +// Common interface between Arrays and Array-like objects +interface List { + [index: number]: T; + length: number; +} + interface ErrorCallback { (err?: Error): void; } interface AsyncResultCallback { (err: Error, result: T): void; } interface AsyncResultArrayCallback { (err: Error, results: T[]): void; } interface AsyncResultObjectCallback { (err: Error, results: Dictionary): void; } interface AsyncIterator { (item: T, callback: ErrorCallback): void; } +interface AsyncForEachOfIterator { (item: T, index: number, callback: ErrorCallback): void; } interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } @@ -61,6 +68,9 @@ interface Async { each(arr: T[], iterator: AsyncIterator, callback: ErrorCallback): void; eachSeries(arr: T[], iterator: AsyncIterator, callback: ErrorCallback): void; eachLimit(arr: T[], limit: number, iterator: AsyncIterator, callback: ErrorCallback): void; + forEachOf(obj: List, iterator: AsyncForEachOfIterator, callback: ErrorCallback): void; + forEachOfSeries(obj: List, iterator: AsyncForEachOfIterator, callback: ErrorCallback): void; + forEachOfLimit(obj: List, limit: number, iterator: AsyncForEachOfIterator, callback: ErrorCallback): void; map(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): any; mapSeries(arr: T[], iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): any; mapLimit(arr: T[], limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): any; From 7ff6577114c2c9e3354b302684dc87abc583c308 Mon Sep 17 00:00:00 2001 From: Bence Eros Date: Tue, 16 Jun 2015 19:38:51 +0200 Subject: [PATCH 0168/2220] created new Stream.Map interface, fixing build failures --- streamjs/streamjs-tests.ts | 10 +++++----- streamjs/streamjs.d.ts | 13 +++++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/streamjs/streamjs-tests.ts b/streamjs/streamjs-tests.ts index ba989f4474..f911c8f522 100644 --- a/streamjs/streamjs-tests.ts +++ b/streamjs/streamjs-tests.ts @@ -1,4 +1,4 @@ -// +/// var numStream: Stream; numStream = Stream.of(1, 2, 3); @@ -12,11 +12,11 @@ Stream.generate(() => 1); numStream = Stream.iterate(1, (n) => n * 2); -var comparator = (s1, s2) => 0; +var comparator = (s1: string, s2: string) => 0; numStream = numStream.filter(n => n % 2 == 0); var strStream = numStream - .dropWhile((n) => n % 2 == 0) + .dropWhile((n: number) => n % 2 == 0) .map(n => "number " + n) .dropWhile(/^$/) .limit(100) @@ -77,7 +77,7 @@ class MyList { var elems: any[]; -var myStream = Stream.from([new MyList, new MyList]); +var myStream: Stream = Stream.from([new MyList, new MyList]); elems = myStream .flatMap(list => list.elems) .toArray(); @@ -102,7 +102,7 @@ groupingResult = myStream.groupingBy(lst => lst.name); groupingResult = myStream.groupBy("name"); groupingResult = myStream.groupingBy("name"); -var mappingResult = myStream.toMap(lst => lst.name, (e1, e2) => e2); +var mappingResult = myStream.toMap((lst) => lst.name, (e1: MyList, e2: MyList) => e2); var aMappingResult: MyList = mappingResult["a"]; mappingResult = myStream.toMap("a"); diff --git a/streamjs/streamjs.d.ts b/streamjs/streamjs.d.ts index e36dcca239..59d8019f39 100644 --- a/streamjs/streamjs.d.ts +++ b/streamjs/streamjs.d.ts @@ -40,7 +40,7 @@ declare class Stream { groupBy(path: string): Stream.GroupingResult; groupingBy(mapper: Stream.Function): Stream.GroupingResult; groupingBy(path: string): Stream.GroupingResult; - indexBy(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; + indexBy(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): Stream.Map; map (mapper: Stream.Function): Stream; max(): Stream.Optional; max(comparator: Stream.Comparator): Stream.Optional; @@ -80,7 +80,7 @@ declare class Stream { sort(path: string): Stream; shuffle(): Stream; skip(n: number): Stream; - slice(begin, end): Stream; + slice(begin: number, end: number): Stream; sum(): number; sum(path: string): number; takeWhile(predicate: Stream.Predicate): Stream; @@ -88,12 +88,17 @@ declare class Stream { takeWhile(sample: Stream.Sample): Stream; toArray(): T[]; toList(): T[]; - toMap(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): T[]; - toMap(path: string, mergeFunction?: Stream.Accumulator): T[]; + toMap(keyMapper: Stream.Function, mergeFunction?: Stream.Accumulator): Stream.Map; + toMap(path: string, mergeFunction?: Stream.Accumulator): Stream.Map; } declare module Stream { + export interface Map { + [index: string]: T + } + + export interface Sample { [index: string]: any } From 793f52d261df17aba09938590f5e0997b2d1cbc8 Mon Sep 17 00:00:00 2001 From: joswhite Date: Tue, 16 Jun 2015 13:52:13 -0600 Subject: [PATCH 0169/2220] Add jasmine.stringMatching() function See http://jasmine.github.io/2.3/introduction.html --- jasmine/jasmine.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index c0bd008435..9e662c6e17 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -55,7 +55,9 @@ declare module jasmine { function getEnv(): Env; function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; function addMatchers(matchers: CustomMatcherFactories): void; - + function stringMatching(str: string): Any; + function stringMatching(str: RegExp): Any; + interface Any { new (expectedClass: any): any; From 50fffc55226fc87c7c9b5abdfdae961b299a9cf9 Mon Sep 17 00:00:00 2001 From: Brad Jones Date: Wed, 17 Jun 2015 16:12:26 +1000 Subject: [PATCH 0170/2220] Added MousetrapInstance Interface. As of Mousetrap 1.5, attaching event handlers to specific elements is now possible. see: WRAPPING SPECIFIC ELEMENTS @ https://craig.is/killing/mice --- mousetrap/mousetrap-tests.ts | 10 +++++++++- mousetrap/mousetrap.d.ts | 13 ++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/mousetrap/mousetrap-tests.ts b/mousetrap/mousetrap-tests.ts index d60d8278d3..c8974d8412 100644 --- a/mousetrap/mousetrap-tests.ts +++ b/mousetrap/mousetrap-tests.ts @@ -42,10 +42,18 @@ Mousetrap.trigger('esc', 'keyup'); Mousetrap.reset(); +// Test that we can create an instance of mousetrap and attach the +// event handler to the form element only, instead of the entire document. +var element = document.querySelector('form'); +var instance = new Mousetrap(element); +instance.bind('mod+s', function(){ console.log('Instance Saved'); }); + +// Test that the factory method works as well. +Mousetrap(element).bind('mod+s', function(){ console.log('Factory Saved'); }); + // Test that Mousetrap can be loaded as an external module. // Assume that if the externally-loaded module can be assigned to a variable with the type of global Mousetrap, // then everything is working correctly. import importedMousetrap = require('mousetrap'); var mousetrapModuleReference: typeof Mousetrap = importedMousetrap; - diff --git a/mousetrap/mousetrap.d.ts b/mousetrap/mousetrap.d.ts index 846e1f3ce2..90b59e11fe 100644 --- a/mousetrap/mousetrap.d.ts +++ b/mousetrap/mousetrap.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Mousetrap 1.2.2 +// Type definitions for Mousetrap 1.5.x // Project: http://craig.is/killing/mice // Definitions by: Dániel Tar // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -8,8 +8,19 @@ interface ExtendedKeyboardEvent extends KeyboardEvent { } interface MousetrapStatic { + (el: Element): MousetrapInstance; + new (el: Element): MousetrapInstance; stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => boolean; + bind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + bind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; + unbind(keys: string, action?: string): void; + unbind(keyArray: string[], action?: string): void; + trigger(keys: string, action?: string): void; + reset(): void; +} +interface MousetrapInstance { + stopCallback: (e: ExtendedKeyboardEvent, element: Element, combo: string) => boolean; bind(keys: string, callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; bind(keyArray: string[], callback: (e: ExtendedKeyboardEvent, combo: string) => any, action?: string): void; unbind(keys: string, action?: string): void; From 3e36972c57660da16768d170d463c64f4c763008 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 17 Jun 2015 04:06:48 -0400 Subject: [PATCH 0171/2220] Added js-beautify\js-beautify.d.ts Options sourced from https://github.com/beautify-web/js-beautify. --- js-beautify/js-beautify.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 js-beautify/js-beautify.d.ts diff --git a/js-beautify/js-beautify.d.ts b/js-beautify/js-beautify.d.ts new file mode 100644 index 0000000000..87ede5737f --- /dev/null +++ b/js-beautify/js-beautify.d.ts @@ -0,0 +1,29 @@ +// Type definitions for js_beautify +// Project: https://github.com/beautify-web/js-beautify/ +// Definitions by: Josh Goldberg +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var js_beautify: { + (js_source_text: string, options?: { + "indent_size"?: number; + "indent_char"?: string; + "eol"?: string; + "indent_level"?: number; + "indent_width_tabs"?: boolean; + "preserve_newlines"?: boolean; + "max_preserve_newlines"?: number; + "jslint_happy": boolean; + "space_after_anon_function": boolean; + "brace_style": string; + "keep_array_indentation": boolean; + "keep_function_indentation": boolean; + "space_before_conditional": boolean; + "break_chained_methods": boolean; + "eval_code": boolean; + "unescape_strings": boolean; + "wrap_line_length": number; + "wrap_attributes": string; + "wrap_attributes_indent_size": number; + "end_with_newline": boolean; + }): string; +}; From fe73bb68e7e2ff417eacb37d23887b29975d5abd Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 17 Jun 2015 04:09:21 -0400 Subject: [PATCH 0172/2220] Added js-beautify unit tests There are only two: a simple string for the basic usage, and a full string for the full usage. This should trigger Travis CI. --- js-beautify/js-beautify-tests.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 js-beautify/js-beautify-tests.ts diff --git a/js-beautify/js-beautify-tests.ts b/js-beautify/js-beautify-tests.ts new file mode 100644 index 0000000000..bcd431c2bd --- /dev/null +++ b/js-beautify/js-beautify-tests.ts @@ -0,0 +1,28 @@ +/// + +var simple: string = js_beautify("console.log('Hello world!');"); + +var full: string = js_beautify( + "console.log('Hello world!');", + { + "indent_size": 4, + "indent_char": " ", + "eol": "\n", + "indent_level": 0, + "indent_with_tabs": false, + "preserve_newlines": true, + "max_preserve_newlines": 10, + "jslint_happy": false, + "space_after_anon_function": false, + "brace_style": "collapse", + "keep_array_indentation": false, + "keep_function_indentation": false, + "space_before_conditional": true, + "break_chained_methods": false, + "eval_code": false, + "unescape_strings": false, + "wrap_line_length": 0, + "wrap_attributes": "auto", + "wrap_attributes_indent_size": 4, + "end_with_newline": false + }); From e7046a1b8598bb1d65d57d7f07bfbee48c1d3c6f Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 17 Jun 2015 05:24:12 -0400 Subject: [PATCH 0173/2220] Removed quotes from d.ts As requested in https://github.com/borisyankov/DefinitelyTyped/pull/4658/files#r32606502 --- js-beautify/js-beautify.d.ts | 40 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/js-beautify/js-beautify.d.ts b/js-beautify/js-beautify.d.ts index 87ede5737f..e52614ad82 100644 --- a/js-beautify/js-beautify.d.ts +++ b/js-beautify/js-beautify.d.ts @@ -5,25 +5,25 @@ declare var js_beautify: { (js_source_text: string, options?: { - "indent_size"?: number; - "indent_char"?: string; - "eol"?: string; - "indent_level"?: number; - "indent_width_tabs"?: boolean; - "preserve_newlines"?: boolean; - "max_preserve_newlines"?: number; - "jslint_happy": boolean; - "space_after_anon_function": boolean; - "brace_style": string; - "keep_array_indentation": boolean; - "keep_function_indentation": boolean; - "space_before_conditional": boolean; - "break_chained_methods": boolean; - "eval_code": boolean; - "unescape_strings": boolean; - "wrap_line_length": number; - "wrap_attributes": string; - "wrap_attributes_indent_size": number; - "end_with_newline": boolean; + indent_size?: number; + indent_char?: string; + eol?: string; + indent_level?: number; + indent_width_tabs?: boolean; + preserve_newlines?: boolean; + max_preserve_newlines?: number; + jslint_happy: boolean; + space_after_anon_function: boolean; + brace_style: string; + keep_array_indentation: boolean; + keep_function_indentation: boolean; + space_before_conditional: boolean; + break_chained_methods: boolean; + eval_code: boolean; + unescape_strings: boolean; + wrap_line_length: number; + wrap_attributes: string; + wrap_attributes_indent_size: number; + end_with_newline: boolean; }): string; }; From 83a7215480b4d02ca8f4f93bd84ba2cb9e7a2d5a Mon Sep 17 00:00:00 2001 From: Tobias Lundin Date: Wed, 17 Jun 2015 14:12:36 +0200 Subject: [PATCH 0174/2220] chrome: use @deprecated where appropiate and add documentation strings --- chrome/chrome-cast.d.ts | 112 ++++++++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 44 deletions(-) diff --git a/chrome/chrome-cast.d.ts b/chrome/chrome-cast.d.ts index 53945029f6..71a60ff10b 100644 --- a/chrome/chrome-cast.d.ts +++ b/chrome/chrome-cast.d.ts @@ -106,13 +106,14 @@ declare module chrome.cast { } /** - * @const {!Array.} - * @see https://developers.google.com/cast/docs/reference/chrome/ + * @const {!Array} + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.VERSION */ var VERSION: Array; /** * @type {boolean} + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable */ var isAvailable: boolean; @@ -169,7 +170,7 @@ declare module chrome.cast { ): void /** - * @param {!Array.} receivers + * @param {!Array} receivers * @param {function()} successCallback * @param {function(chrome.cast.Error)} errorCallback */ @@ -194,7 +195,7 @@ declare module chrome.cast { /** * @param {!chrome.cast.SessionRequest} sessionRequest * @param {function(!chrome.cast.Session)} sessionListener - * @param {function(!chrome.cast.ReceiverAvailability,Array.)} + * @param {function(!chrome.cast.ReceiverAvailability,Array)} * receiverListener * @param {chrome.cast.AutoJoinPolicy=} opt_autoJoinPolicy * @param {chrome.cast.DefaultActionPolicy=} opt_defaultActionPolicy @@ -216,14 +217,14 @@ declare module chrome.cast { defaultActionPolicy: chrome.cast.DefaultActionPolicy; } - /** - * @param {!chrome.cast.ErrorCode} code - * @param {string=} opt_description - * @param {Object=} opt_details - * @constructor - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error - */ interface Error { + /** + * @param {!chrome.cast.ErrorCode} code + * @param {string=} opt_description + * @param {Object=} opt_details + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Error + */ new( code: chrome.cast.ErrorCode, description?: string, @@ -252,7 +253,11 @@ declare module chrome.cast { } interface SenderApplication { - + /** + * @param {!chrome.cast.SenderPlatform} platform + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderApplication + */ new( platform: chrome.cast.SenderPlatform ):SenderApplication; @@ -265,7 +270,7 @@ declare module chrome.cast { interface SessionRequest { /** * @param {string} appId - * @param {!Array.=} opt_capabilities + * @param {!Array=} opt_capabilities * @param {number=} opt_timeout * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionRequest @@ -287,7 +292,7 @@ declare module chrome.cast { * @param {string} sessionId * @param {string} appId * @param {string} displayName - * @param {!Array.} appImages + * @param {!Array} appImages * @param {!chrome.cast.Receiver} receiver * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Session @@ -436,7 +441,7 @@ declare module chrome.cast { /** * @param {string} label * @param {string} friendlyName - * @param {Array.=} opt_capabilities + * @param {Array=} opt_capabilities * @param {chrome.cast.Volume=} opt_volume * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Receiver @@ -459,7 +464,7 @@ declare module chrome.cast { interface ReceiverDisplayStatus { /** * @param {string} statusText - * @param {!Array.} appImages + * @param {!Array} appImages * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverDisplayStatus */ @@ -558,7 +563,8 @@ declare module chrome.cast.media { } /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest + * @enum {string} + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode */ interface RepeatMode { OFF:string; @@ -567,10 +573,12 @@ declare module chrome.cast.media { ALL_AND_SHUFFLE:string; } - /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem - */ interface QueueItem { + /** + * @param {!chrome.cast.media.MediaInfo} mediaInfo + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueItem + */ new( mediaInfo: chrome.cast.media.MediaInfo ):QueueItem; @@ -584,10 +592,12 @@ declare module chrome.cast.media { startTime: number; } - /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest - */ interface QueueLoadRequest { + /** + * @param {!Array} items + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueLoadRequest + */ new( items: Array ):QueueLoadRequest; @@ -598,10 +608,12 @@ declare module chrome.cast.media { startIndex: number; } - /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest - */ interface QueueInsertItemsRequest { + /** + * @param {!Array} + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueInsertItemsRequest + */ new( itemsToInsert: Array ):QueueInsertItemsRequest; @@ -611,10 +623,12 @@ declare module chrome.cast.media { items: Array; } - /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest - */ interface QueueRemoveItemsRequest { + /** + * @param {!Array} + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueRemoveItemsRequest + */ new( itemIdsToRemove: Array ):QueueRemoveItemsRequest; @@ -623,10 +637,12 @@ declare module chrome.cast.media { itemIds: Array; } - /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest - */ interface QueueReorderItemsRequest { + /** + * @param {!Array} + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueReorderItemsRequest + */ new( itemIdsToReorder: Array ):QueueReorderItemsRequest; @@ -636,10 +652,12 @@ declare module chrome.cast.media { itemIds: Array; } - /** - * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest - */ interface QueueUpdateItemsRequest { + /** + * @param {!Array} + * @constructor + * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.QueueUpdateItemsRequest + */ new( itemsToUpdate: Array ):QueueUpdateItemsRequest; @@ -802,7 +820,7 @@ declare module chrome.cast.media { interface EditTracksInfoRequest { /** - * @param {Array.=} opt_activeTrackIds + * @param {Array=} opt_activeTrackIds * @param {chrome.cast.media.TextTrackStyle=} opt_textTrackStyle * @constructor * @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.EditTracksInfoRequest @@ -826,11 +844,11 @@ declare module chrome.cast.media { images: Array; metadataType: chrome.cast.media.MetadataType; releaseDate: string; + /** @deprecated. Use releaseDate instead. */ releaseYear: number; subtitle: string; title: string; - - /** Deprecated. Use metadataType instead. */ + /** @deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; } @@ -844,12 +862,12 @@ declare module chrome.cast.media { images: Array; metadataType: chrome.cast.media.MetadataType; releaseDate: string; + /** @deprecated. Use releaseDate instead. */ releaseYear: number; subtitle: string; title: string; studio: string; - - /** Deprecated. Use metadataType instead. */ + /** @deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; } @@ -868,11 +886,15 @@ declare module chrome.cast.media { images: Array; originalAirdate: string; - /** Deprecated. Use metadataType instead. */ + /** @deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; + /** @deprecated. Use title instead. */ episodeTitle: string; + /** @deprecated. Use season instead. */ seasonNumber: number; + /** @deprecated. Use episode instead. */ episodeNumber: number; + /** @deprecated. Use originalAirdate instead. */ releaseYear: number; } @@ -895,9 +917,11 @@ declare module chrome.cast.media { images: Array; releaseDate: string; - /** Deprecated. Use metadataType instead. */ + /** @deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; + /** @deprecated. Use artist instead. */ artistName: string; + /** @deprecated. Use releaseDate instead. */ releaseYear: number; } @@ -919,7 +943,7 @@ declare module chrome.cast.media { height: number; creationDateTime: string; - /** Deprecated. Use metadataType instead. */ + /** @deprecated. Use metadataType instead. */ type: chrome.cast.media.MetadataType; } @@ -973,7 +997,7 @@ declare module chrome.cast.media { supportedMediaCommands: Array; volume: chrome.cast.Volume; - /** Deprecated. Use getEstimatedTime instead */ + /** @deprecated. Use getEstimatedTime instead */ currentTime: number; /** From f00a559ddc36e8ec0b96063fbe7df9f532a21fc6 Mon Sep 17 00:00:00 2001 From: David Lipowicz Date: Wed, 17 Jun 2015 15:20:38 -0700 Subject: [PATCH 0175/2220] Adding in a few missing definitions for Dagre. --- dagre/dagre.d.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dagre/dagre.d.ts b/dagre/dagre.d.ts index ce389f2d7e..75d7e389a7 100644 --- a/dagre/dagre.d.ts +++ b/dagre/dagre.d.ts @@ -10,20 +10,24 @@ declare module Dagre{ interface Graph { new (): Graph; - edges(): string[]; - edge(id: string): any; + edges(): Edge[]; + edge(id: any): any; nodes(): string[]; - node(id: string): any; + node(id: any): any; setDefaultEdgeLabel(callback: () => void): Graph; setEdge(sourceId: string, targetId: string): Graph; setGraph(options: { [key: string]: any }): Graph; setNode(id: string, node: { [key: string]: any }): Graph; } + interface Edge { + v: string; + w: string; + } + interface GraphLib { Graph: Graph; } } -declare var dagre: Dagre.DagreFactory; - +declare var dagre: Dagre.DagreFactory; \ No newline at end of file From b0dcd5ebfbb5441252cb27439e441b07567c4710 Mon Sep 17 00:00:00 2001 From: David Lipowicz Date: Wed, 17 Jun 2015 15:20:56 -0700 Subject: [PATCH 0176/2220] Adding in some missing definitions for SigmaJs. --- sigmajs/sigmajs.d.ts | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/sigmajs/sigmajs.d.ts b/sigmajs/sigmajs.d.ts index 62bee1980d..985686ad45 100644 --- a/sigmajs/sigmajs.d.ts +++ b/sigmajs/sigmajs.d.ts @@ -15,10 +15,17 @@ declare module SigmaJs{ graphPosition(x: number, y:number): {x: number; y: number}; ratio: number; readPrefix: string; + settings(setting: string) : any; x: number; y: number; } + interface Canvas { + edges: {[renderType: string]: Function}; + labels: {[renderType: string]: Function}; + nodes: {[renderType: string]: Function}; + } + interface Classes { configurable: Configurable; graph: Graph; @@ -39,6 +46,7 @@ declare module SigmaJs{ } interface Edge { + [key : string] : any; color?: string; id: string; size?: number; @@ -74,6 +82,11 @@ declare module SigmaJs{ nodes(ids: string[]): Node[]; } + interface GraphData { + edges: Edge[]; + nodes: Node[]; + } + interface Image { clip?: number; scale?: number; @@ -87,6 +100,7 @@ declare module SigmaJs{ } interface Node { + [key : string] : any; color?: string; id: string; image?: any; @@ -149,7 +163,7 @@ declare module SigmaJs{ interface SigmaConfigs { container?: Element; - graph?: Graph; + graph?: GraphData; id?: string; renderers?: Renderer[]; settings?: { [index: string]: any }; @@ -160,10 +174,12 @@ declare module SigmaJs{ new(container: string): Sigma; new(container: Element): Sigma; new(configuration: SigmaConfigs): Sigma; + canvas: Canvas; classes:Classes; misc: Miscellaneous; parsers: Parsers; plugins: Plugins; + svg: SVG; } interface Settings { @@ -269,8 +285,19 @@ declare module SigmaJs{ // Animation settings animationsTime?: number; } + + interface SVG { + edges: {[renderType: string]: SVGObject}; + labels: {[renderType: string]: SVGObject}; + nodes: {[renderType: string]: SVGObject}; + } + + interface SVGObject { + create: (object: T, ...a:any[]) => Element; + update: (object: T, ...a:any[]) => void; + } } declare var sigma: SigmaJs.SigmaFactory; declare var CustomShapes: SigmaJs.CustomShapes; -declare var ShapeLibrary: SigmaJs.CustomShapes; +declare var ShapeLibrary: SigmaJs.CustomShapes; \ No newline at end of file From 35de88ab7d506af1fea5d02b69fbb69d8523153d Mon Sep 17 00:00:00 2001 From: David Lipowicz Date: Wed, 17 Jun 2015 16:33:12 -0700 Subject: [PATCH 0177/2220] Added a SigmaJs test. --- sigmajs/sigmajs-tests.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sigmajs/sigmajs-tests.ts b/sigmajs/sigmajs-tests.ts index 10c6ce0294..f28a9395bd 100644 --- a/sigmajs/sigmajs-tests.ts +++ b/sigmajs/sigmajs-tests.ts @@ -23,6 +23,10 @@ module SigmaJsTests { s.refresh(); }); + sigma.canvas.edges['def'] = function() {}; + sigma.svg.nodes['def'] = {create: (obj: SigmaJs.Node) => { return new Element(); }, + update: (obj: SigmaJs.Node) => { return; }}; + var N = 100; var E = 500; // Generate a random graph: From 83b571ed149c6b2b643ef1c696cce6d81f3b6ecc Mon Sep 17 00:00:00 2001 From: sourcebits-robertbiggs Date: Wed, 17 Jun 2015 21:25:53 -0700 Subject: [PATCH 0178/2220] Added declaration file and tests for ChocolateChipJS. --- chocolatechipjs/chocolatechipjs-tests.ts | 387 ++++++ chocolatechipjs/chocolatechipjs.d.ts | 1387 ++++++++++++++++++++++ 2 files changed, 1774 insertions(+) create mode 100644 chocolatechipjs/chocolatechipjs-tests.ts create mode 100644 chocolatechipjs/chocolatechipjs.d.ts diff --git a/chocolatechipjs/chocolatechipjs-tests.ts b/chocolatechipjs/chocolatechipjs-tests.ts new file mode 100644 index 0000000000..e0eec9c53a --- /dev/null +++ b/chocolatechipjs/chocolatechipjs-tests.ts @@ -0,0 +1,387 @@ +/// +// ChocolateChipStatic -- DOM creation, etc. +$(function() { + alert('Ready to do stuff!'); +}); +var docRoot = $(); +var divTag = $('div'); +var divClass = $('.div'); +var divID = $('#div'); +var divAttr = $('[name=div]'); +var documentElement = $(); +var divTag2 = $(divTag); +var nodeName = divTag2[0].nodeName; + +// Assorted properties and functions on ChocolateChipStatic: +var version = $.version; +var libraryName = $.libraryName; +var els = $('li'); +var listItems = $.slice(els); +var madeEls = $.make('

Stuff

'); +var moreEls = $.html('

Stuff

'); +var oldTag = $('#oldTag'); +var newTag = $('#newTag'); +$.replace(oldTag, newTag); +$.require('./scripts/myscript.js', function() { + $.noop; +}); +$.defer(function() { + console.log("This comes after Squawk!"); +}); +var concatenation = $.concat('This', ' ', 'is', ' ', 'a', ' ', 'string', '.'); +var arrayOfStringWords = $.w('This is a string'); + + +// Boolean tests: +$.isString('This is a string'); +$.isArray([1, 2, 3]); +$.isFunction($.noop); +$.isObject({ name: 'Me' }); +$.isObject(new Object()); +$.isEmptyObject({}); +$.isNumber(123); +$.isInteger(123); +$.isInteger(123.123); // should return false +$.isFloat(123.123); // should return true +var newUuid = $.makeUuid(); +$.each(['a', 'b', 'c'], function(ctx, idx) { + console.log(ctx); + console.log(idx); +}); + +// Plugin interface for ChocolateChipElementArray: +$.fn.extend({ + whateverProperty: "whatever", + whateverMethod: function() { + alert("Whatever!"); + } +}); + +// ChocolateChipElementArray extensions: +$('li').each(function(ctx, idx) { + console.log(ctx.nodeName); +}); +var uniqueElements = $('li').unique(); +var secondElement = $('li').eq(1); +var lastElement = $('li').eq(-1); +var whichIndex = $('li').index($('.selected')); +var whichListItemIndex = $('li').eq(3).index(); +$('.elems').is('div').each(function(ctx) { + console.log('This element is a div.'); +}); +$('.elems').isnt('p').each(function() { + console.log('This element is not a paragraph tag.'); +}); +$('li').has('p').each(function(ctx) { + console.log('This list item has a paragraph tag.') +}); +$('li').hasnt('p').each(function(ctx) { + console.log('This list item does not have a paragraph tag.') +}); +$('ul').find('li').each(function(ctx) { + console.log(ctx); +}); +$('li').css('color'); +$('li').css('color', 'red'); +$('li').css({ "color": "red", "background-color": "yellow" }); +var elemWidth = $('#header').width(); +var elemHeight = $('#header').height(); +var offset = $('h1').offset(); +console.log(offset.top); +console.log(offset.left); +console.log(offset.bottom); +console.log(offset.right); +$('li.selected').prependTo('#selectedItems'); +$('li.selected').appendTo('#selectedItems'); +$('ul').before("

Subtitle

"); +$('ul').after("

Footer stuff here.

"); +var h1Text = $('h1').text(); +$('h1').text('The New Title'); +$('ul').insert("
  • 1
  • 2
  • 3
  • ", "first"); +$('ul').insert("
  • 1
  • 2
  • 3
  • ", "last"); +$('ul').insert("
  • 1
  • 2
  • 3
  • ", 3); +$('ul').insert("
  • 1
  • 2
  • 3
  • "); +$('ul').html('
  • 1
  • <2/li>
  • 3
  • '); +$('ul').html(''); +$('ul').prepend('
  • The title
  • '); +$('ul').append('
  • The Last Item
  • '); +var inputName = $('input').attr('name'); +$('input').attr('name', 'wobba'); +var inputName = $('input').prop('name'); +$('input').prop('name', 'wobba'); +$('input').hasAttr('disabled').css('border', 'solid 1px red'); +$('input').removeAttr('disabled'); +$('article').hasClass('current').css('display', 'block'); +$('article').addClass('current'); +$('article').removeClass('current'); +$('article').toggleClass("current"); +$('h1').dataset('status', 'ready'); +var theStatus = $('h1').dataset('status'); +var theText = $('textarea').val(); +$('textarea').val('This is the new text.'); +$('input').disable(); +$('input').enable(); +$('ul').hide(); +$('ul').hide('slow'); +$('ul').hide('fast'); +$('ul').hide(1000); +$('ul').hide('fast', function() { + console.log('Finished hiding these.'); +}); +$('ul').show(); +$('ul').show('slow'); +$('ul').show('fast'); +$('ul').show(1000); +$('ul').show('fast', function() { + console.log('Finished hiding these.'); +}); +$('#list').prev().css('display', 'none'); +$('#list').next().css('display', 'none'); +$('ul').first().css('font-weight', 'bold'); +$('ul').last().css('font-style', 'italic'); +$('ul').children().css('display', 'block'); +$('li').parent().css('border', 'solid 2px green'); +$('#list').ancestor('article').css('margin', "20px"); +$('#list').ancestor(5).css('margin', "20px"); +$('#list').closest('article').css('margin', "20px"); +$('button').siblings().css('padding', "20px"); +$('button').siblings("p").css('padding', "20px"); +var cloned = $('#list').clone(); +$('#list').wrap('
    '); +$('#list').unwrap(); +$('#list').remove(); +$('#list').empty(); +var thePrice = $('#list').data('price'); +$('#list').data('price', '$1000'); +$('#list').removeData('price'); + +// Animate: +$('#list').animate({ + "transform": "rotate3d(30, 150, 200, 180deg) scale(3) translate3d(-50%, -30%, 140%)", + "opacity": .25, + "transform-style": "preserve-3d", + "perspective": 500 +}, + '2s', + "ease-in-out" + ); + +// Form to JSON: +$.form2JSON($('form')[0], '.'); + + +// Strings: +$.camelize("this-is-a-string"); // should return "thisIsAString" +$.deCamelize("thisIsAString"); // Should return "this-is-a-string" +$.capitalize("a string"); // Should return "A string" +$.capitalize("a string", true); // Should return "A STRING" + + +// Booleans: +var isiPhone = $.isiPhone; +var isiPad = $.isiPad; +var isiPod = $.isiPod; +var isiOS = $.isiOS; +var isAndroid = $.isAndroid; +var isWebOS = $.isWebOS; +var isBlackberry = $.isBlackberry; +var isTouchEnabled = $.isTouchEnabled; +var isOnline = $.isOnline; +var isStandalone = $.isStandalone; +var isiOS6 = $.isiOS6; +var isiOS7 = $.isiOS7; +var isWin = $.isWin; +var isWinPhone = $.isWinPhone; +var isIE10 = $.isIE10; +var isIE11 = $.isIE11; +var isWebkit = $.isWebkit; +var isMobile = $.isMobile; +var isDesktop = $.isDesktop; +var isSafari = $.isSafari; +var isNativeAndroid = $.isNativeAndroid; + + +// Events: +$('li').bind('click', function() { + $.noop; +}, false); +$('li').unbind('click', function() { + $.noop; +}, false); +$('ul').delegate('click', 'li', function() { + $.noop; +}, false); +$('ul').undelegate('click', 'li', function() { + $.noop; +}, false); +$('li').on('click', function() { + $.noop; +}) +$('ul').on('click', 'li', function() { + console.log($(this).text()) +}); +$('li').off('click'); +$('li').off('click', 'li'); +$('button').trigger('click'); + +$('.selected').data('selection', 'This is awesome!'); // set the value of data value to "This is Awesome!" +$('.selected').data('selection'); // return the data value of "selection" on ".selected" + +// Promises: +var myPromise = new Promise(function(resolve, reject) { + $.noop; +}); + +var myPromise = new Promise(function(resolve, reject) { + // Resolve the promise: + resolve('Success!'); + // or reject it: + // reject('Lost in Space!'); +}); +myPromise.then(function(value) { + // Success: + console.log(value); +}, + // Opps! There was a problem: + function(reason) { + console.log(reason); + }); + +// Ajax: +$.ajax({ + url: "announcement.html", + dataType: "html", + success: function(data) { + // Insert the fragment into the page: + $("#content").html(data); + }, + error: function(data) { + $("#content").html("

    There was an error while trying to get the file.

    "); + } +}); +$.ajax({ + url: "me.json", + success: function(data) { + // Before using a JSON object, you need to parse it. + // Here we parse it and assign it to a variable: + var me = JSON.parse(data); + // Here we access the properties of the JSON object: + $("#content").html(me.firstName + " " + me.lastName); + }, + error: function(data) { + $('#content').html("

    There was an error while trying to get the file.

    "); + } +}); +var myData = { + "name": "Bozo the Clown", + "occupation": "Clown" +}; +var mySuccessCallback = function() { + console.log('The post was a success!'); +}; +var myErrorCallback = function() { + console.log('Ooops! There was a problem posting this.'); +}; +$.ajax({ + url: "/path/to/controller", + method: 'POST', + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "async": true, + "Access-Control-Allow-Origin": "*", + "Accept": "text/plain" + }, + data: myData, + success: mySuccessCallback, + error: myErrorCallback +}); +$.get('http://my.com/data/stuff.html') + .then(function(response) { + console.log("Success!", response); + }, function(error) { + console.error("Failed!", error); + }); + +$.get('http://my.com/data/stuff.html') + .then(function(response) { + console.log("Success!", response); + }) + .catch(function(error) { + console.error("Failed!", error); + }); +$.get('story.json') + .then(JSON.parse) + .then(function(response) { + console.log("Yey JSON!", response); + }); +$.getJSON('/data/deserts.json', function(desserts: Array) { + desserts.forEach(function(dessert) { + $('#deserts').append('
  • ' + dessert.name + '
  • '); + }); +}); +$.post("updateUser.php", + { "name": "Joe", "time": "10PM" }, + function() { + console.log('The POST was successful.') + }, + "json" + ); +$.JSONP({ url: 'https://api.github.com/users/yui?callback=?' }) + .then(function(users) { + $('.list').append('
  • The name of the library

    ' + users.data.name + '

  • '); + }) + .catch(function(err) { + console.log('Unable to get data.') + }); + +$.JSONP({ + url: 'http://www.geonames.org/postalCodeLookupJSON?postalcode=94102&' +}) + .then(function(data) { + $('.list').append('
  • My Location

    ' + data.postalcodes[0].adminName2 + ', ' + data.postalcodes[0].adminName1 + '

  • '); + }) + .catch(function(err) { + console.log('Unable to get data.') + }); + +// Templates: +var myTemplate = '
  • Name: [[= data.name]]
  • '; +var userInfo = { + name: 'Wobba', + age: 100, + job: 'Rocket Scientist', + salary: '$1,000,000,000' +}; +var parsedTempl8 = $.template(myTemplate); +$('#user').html(parsedTempl8(userInfo)); + +// Output a simple array of data: +var simpleArray = ['One', 'Two', 'Three', 'Four', 'Five']; +var repeaterTmplate1 = '
  • [[= data ]]
  • '; +$.template.repeater($('#arrayList'), repeaterTmplate1, simpleArray); + +// Output an array of objects: +var luminaries = { + persons: + [ + { firstName: "Albert", lastName: "Einstein" }, + { firstName: "Steven", lastName: "Hawking" }, + { firstName: "Neil", lastName: "deGrasse Tyson" }, + { firstName: "Leonardo", lastName: "Da Vinci" }, + { firstName: "Nicholas", lastName: "Copernicus" } + ] +}; +var repeaterTmplate2 = '
  • [[= data.firstName ]], [[= data.lastName]]
  • '; +// Pass in the array of persons: +$.template.repeater($('#objectArrayList'), repeaterTmplate2, luminaries.persons); + +// Pub/Sub: +var arraySubscriber = function(topic: string, data: any) { + $('.list').append('
  • ' + topic + '

    ' + data + '

  • '); + var newsSubscription = $.subscribe('news/update', arraySubscriber); +}; +$.publish('news/update', 'The New York Stock Exchange rose an unprecedented 1000 points in just three minutes. Analysts and investors are confused and uncertain how to respond.'); +$.unsubscribe('news/update'); +// Due to being unsubscribed above, this does nothing: +$.publish('news/update', 'We have nothing further to comment at this time.'); + diff --git a/chocolatechipjs/chocolatechipjs.d.ts b/chocolatechipjs/chocolatechipjs.d.ts new file mode 100644 index 0000000000..269cb67904 --- /dev/null +++ b/chocolatechipjs/chocolatechipjs.d.ts @@ -0,0 +1,1387 @@ +// Type definitions for chocolatechip v3.8.11 +// Project: https://github.com/chocolatechipui/ChocolateChipJS +// Definitions by: Robert Biggs +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +/** + * Defines the base object namespace for ChocolateChipJS. + */ +declare var $chocolatechipjs: ChocolateChipStatic; +declare var $: ChocolateChipStatic; + +/** + * Static members of ChocolateChip (those on $ and ChocolateChipJS themselves) + */ +interface ChocolateChipStatic { + + /** + * Contains the version of ChocolateChipJS in use. + */ + version: string; + + /** + * Contains the name of the library (ChocolateChip). + */ + libraryName: string; + + /* + * This method takes an array-like object and returns its members as an array. + * + * @param arrayLikeObject Either the arguents object or an node collection. + */ + slice(arrayLikeObject: any): Array; + + /** + * Merge the contents of one object into the first object. If only one argument is provided, it is merged into ChocolateChipStatic. + * + * @param target An object that will receive the new properties if additional objects are passed in or that will extend the ChocolateChipStatic namespace if there is a single argument. + * @param object An object containing additional properties to merge in. + */ + extend(target: any, object?: any): any; + + /** + * Create a ChocolateChip collection object by creating elements from an HTML string. + * + * @param selector + * @return any + */ + make(selector: string): ChocolateChipElementArray; + + /** + * Create a ChocolateChip collection object by creating elements from an HTML string. This is an alias for $.make. + * + * @param selector + * @return any + */ + html(selector: string): ChocolateChipElementArray; + + /** + * Replace one element with another. + * + * @param new HTMLElement + * @param old HTMLElement + * @return HTMLElement[] + */ + replace(newElement: ChocolateChipElementArray, oldElement: ChocolateChipElementArray): void; + + /** + * Load a JavaScript file from a url, then execute it. + * + * @param url A string containing the URL where the script resides. + * @param callback A callback function that is executed after the script loads. + * @return void + */ + require(url: string, callback: Function): Function; + + /** + * Process JavaScript returned by Ajax request. An optional name can be used to create a custom variable name by which the data is exposed, otherwise it is exposed with the variable "data". + * + * @param url A string containing the URL where the script resides. + * @param callback A callback function that is executed after the script loads. + * @return Function + */ + processJSON(json: string, name?: string): any; + + /** + * This method will defer the execution of a function until the call stack is clear. + * + * @param callback A function to execute. + * @param duration The number of milliseconds to delay execution. + * @return any + */ + delay(callback: Function, duration?: number): any; + + /** + * The method will defer the execution of its callback until the call stack is clear. + * + * @param callback A callback to execute after a delay. + * @return Function. + */ + defer(callback: Function): Function; + + /** + * An empty function. + * + * @return any + */ + noop(): void; + + /** + * This method will concatenate strings or values as a cleaner alternative to using the '+' operator. + * + * @param string or number A comma separated series of strings to concatenate. + * @return string + */ + concat(...string: string[]): string; + + /** + * This method takes a space-delimited string of words and returns it as an array where the individual words are indices. + * + * @param string Any string with values separated by spaces. + * @return string[] + */ + w(string: string): string[]; + + /** + * Determine whether the argument is a string. + * + * @param obj Object to test whether or not it is a string. + * @return boolean + */ + isString(obj: any): boolean; + + /** + * Determine whether the argument is an array. + * + * @param obj Object to test whether or not it is an array. + * @return boolean + */ + isArray(obj: any): boolean; + + /** + * Determine whether the argument is a function. + * + * @param obj Object to test whether or not it is an function. + * @return boolean + */ + isFunction(obj: any): boolean; + + /** + * Determine whether the argument is an object. + * + * @param obj Object to test whether or not it is an object. + * @return boolean + */ + isObject(obj: any): boolean; + + /** + * Determine whether the argument is an empty object. + * + * @param obj Object to test whether or not it is an empty object. + * @return boolean + */ + isEmptyObject(obj: any): boolean; + + /** + * Determine whether the argument is an empty object. + * + * @param obj Object to test whether or not it is an empty object. + * @return boolean + */ + isEmptyObject(obj: any): boolean; + + /** + * Determine whether the argument is a number. + * + * @param obj Object to test whether or not it is a number. + * @return boolean + */ + isNumber(obj: any): boolean; + + /** + * Determine whether the argument is an integer. + * + * @param obj Object to test whether or not it is an integer. + * @return boolean + */ + isInteger(obj: any): boolean; + + /** + * Determine whether the argument is a float. + * + * @param obj Object to test whether or not it is a float. + * @return boolean + */ + isFloat(obj: any): boolean; + + /** + * Creates a Uuid and returns it as a string with the prefix: "chch_". + */ + makeUuid(): string; + + /** + * A generic iterator function, which can be used to seamlessly iterate over arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + * @return any + */ + each( + collection: any, + callback: (valueOfElement: any, indexInArray: number) => any + ): any; + + + /** + * This method converts a string of hyphenated tokens into a camel cased string. + * + * @param string A string of hyphenated tokens. + * @return string + */ + camelize(string: string): string; + + /** + * This method converts a camel case string into lowercase with hyphens. + * + * @param string A camel case string. + * @return string + */ + deCamelize(string: string): string; + + /** + * This method capitalizes the first letter of a string. + * + * @param string A string. + * @param boolean A boolean value. + * @return string + */ + capitalize(string: string, boolean?: boolean): string; + + /** + * Object used to store string templates and parsed templates. + * + * @param string A string defining the template. + * @param string A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]]. + * @return void + */ + templates: Object; + + /** + * This method returns a parsed template. + * + */ + template: ChocolateChipTemplate; + + + /** + * This is the base for the plugin "extend" interface, which allows you to add methods that can iterate over element collections. + */ + fn: ChocolateChipPlugin; + + /** + * Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed. + * + * param newContent The content to insert. May be an HTML string, DOM element, or an array of DOM elements. + * @return void + */ + replace(newELement: HTMLElement, oldElement: HTMLElement): void; + + /** + * Perform an asynchronous HTTP (Ajax) request. + */ + ajax(settings: ChocolateChipAjaxSettings): Promise; + + /** + * Load data from the server using a HTTP GET request. + * + * @param url A string containing the URL to which the request is sent. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. Default: Intelligent Guess (json, or html). + * @return Promise + */ + get(url: string, data?: any, success?: (data: any) => any, dataType?: string): Promise; + + /** + * Load data from the server using a HTTP POST request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @param dataType The type of data expected from the server. + * @return Promise + */ + post(url: string, data?: any, success?: () => any, dataType?: string): Promise; + + /** + * Load JSON-encoded data from the server using a GET HTTP request. + * + * @param url A string containing the URL to which the request is sent. + * @param data A plain object or string that is sent to the server with the request. + * @param success A callback function that is executed if the request succeeds. + * @return Promise + */ + //each(func: (ctx: any, idx: number) => any): void; + getJSON(url: string, data?: any, success?: (data: any) => any): Promise; + + /** + * Load JSON from a remote server using the JSONP technique. + * + * @param url A string + * @return Promise + */ + JSONP(options: ChocolateChipJSONP): Promise; + //JSONP({url: string, success?: (data: any), callbackType?: string, timeout?: number}): Promise; + + + + /** + * Specify a function to execute when the DOM is fully loaded. + * + * @param handler A function to execute after the DOM is ready. + * @return any + */ + ready(handler: () => any): void; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param selector A string containing a selector expression + * @param context A DOM HTMLElement to use as context + * @return HTMLElement[] + */ + (selector: string, context?: HTMLElement|ChocolateChipElementArray): ChocolateChipElementArray; + + /** + * Binds a function to be executed when the DOM has finished loading. + * + * @param callback A function to execute after the DOM is ready. + * @return void + */ + (callback: () => any): void; + + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param element A DOM element to wrap in an array. + * @return HTMLElement[] + */ + (element: HTMLElement): ChocolateChipElementArray; + + /** + * Accepts a string containing a CSS selector which is then used to match a set of elements. + * + * @param elementArray An array of DOM elements to convert into a ChocolateChip Collection. + * @return HTMLElement[] + */ + (elementArray: ChocolateChipElementArray): ChocolateChipElementArray; + + /** + * If no argument is provided, return the document as a ChocolateChipElementArray. + * @return Document[] + */ + (): Document[]; + + /** + * Subscribe to a publication. You provide the topic you want to subscribe to, as well as a callback to execute when a publication occurs. + * Any data passed by the publisher is exposed to the callback as its second parameter. The callback's first parameter is the published topic. + * + * @param topic string A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters. + * @data any You can receive any type: string, number, array, object, etc. + * @return any + */ + subscribe(topic: string, callback: (topic: string, data: any) => any):any; + + /** + * Unsubscribe from a topic. Pass this the topic you wish to unsubscribe from. The subscription will be terminated immediately. + * + * @param topic string The name of the topic to unsubscribe from. + * @return void + */ + unsubscribe(topic: string): void; + + /** + * Publish a topic with data for the topic's subscribers to receive. + * + * @param topic string The topic you wish to publish. + * @param data The data to send with the publication. This can be of any type: string, number, array, object, etc. + * @return void + */ + publish(topic: string, data: any): void; + + /** + * Whether device is iPhone. + */ + isiPhone: boolean; + + /** + * Whether device is iPad. + */ + isiPad: boolean; + + /** + * Whether device is iPod. + */ + isiPod: boolean; + + /** + * Whether OS is iOS. + */ + isiOS: boolean; + + /** + * Whether OS is Android + */ + isAndroid: boolean; + + /** + * Whether OS is WebOS. + */ + isWebOS: boolean; + + /** + * Whether OS is Blackberry. + */ + isBlackberry: boolean; + + /** + * Whether OS supports touch events. + */ + isTouchEnabled: boolean; + + /** + * Whether there is a network connection. + */ + isOnline: boolean; + + /** + * Whether app is running in stanalone mode. + */ + isStandalone: boolean; + + /** + * Whether OS is iOS 6. + */ + isiOS6: boolean; + + /** + * Whether OS i iOS 7. + */ + isiOS7: boolean; + + /** + * Whether OS is Windows. + */ + isWin: boolean; + + /** + * Whether device is Windows Phone. + */ + isWinPhone: boolean; + + /** + * Whether browser is IE10. + */ + isIE10: boolean; + + /** + * Whether browser is IE11. + */ + isIE11: boolean; + + /** + * Whether browser is Webkit based. + */ + isWebkit: boolean; + + /** + * Whether browser is running on mobile device. + */ + isMobile: boolean; + + /** + * Whether browser is running on desktop. + */ + isDesktop: boolean; + + /** + * Whether browser is Safari. + */ + isSafari: boolean; + + /** + * Whether browser is Chrome. + */ + isChrome: boolean; + + /** + * Is native Android browser (not mobile Chrome). + */ + isNativeAndroid: boolean; + + /** + * Grabs values from a form and converts them into a JSON object. + * + * @param rootNode: string|HTMLElement A form whose values you want to convert to JSON. + * @param delimiter string A delimiter to namespace your form values. The default is "." + * You use the form input's name to set up the namespace structure for your JSON, e.g. name="newUser.name.first". + */ + form2JSON(rootNode: string | HTMLElement, delimiter: string): Object; +} + +interface ChocolateChipPlugin { + /** + * This method extends ChocolateChipElementArray, enabling iteration over collection items. + * + * @param object Object literal of properties and values. Value can be strings, number, array, objects or functions. + * @return HTMLElement[] + */ + extend: (object: any) => ChocolateChipElementArray; +} + +interface ChocolateChipTemplate { + /** + * This method parses a string and an optoinal variable name and returns a parsed template in the form of a function. You can then pass this function data to get rendered nodes. + * + * @param template A string of markup to use as a template. + * @param variable An option name to use in the template. If it were "myData": [[= myData.name]]. Otherwise it defaults to "data": [[= data.name]]. + * @return A function. + */ + (template: string, variable?: string): Function; + + /** + * A method to repeated output a template. + * + * @param element The target container into which the content will be inserted. + * @param template A string of markup. + * @param data The iterable data the template will consume. + * @return void. + */ + repeater: (element: ChocolateChipElementArray, template: string, data: any) => void; +} + +/** + * Represents the completion of an asynchronous operation + */ +interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @return Promise A Promise for the completion of which ever callback is executed. + * @return Promise A new Promise + */ + then(onfulfilled?: (value: T) => TResult | Promise, onrejected?: (reason: any) => TResult | Promise): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * + * @param onrejected The callback to execute when the Promise is rejected. + * @return Promise A Promise for the completion of the callback. + * @return Promise A new Promise + */ + catch(onrejected?: (reason: any) => T | Promise): Promise; +} + +interface PromiseConstructor { + /** + * A reference to the prototype. + */ + prototype: Promise; + + /** + * Creates a new Promise. + * + * @param init A callback used to initialize the promise. This callback is passed two arguments: a resolve callback used resolve the promise with a value or the result of another promise, and a reject callback used to reject the promise with a provided reason or error. + * @return Promise A new Proimise + */ + new (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; + + (init: (resolve: (value?: T | Promise) => void, reject: (reason?: any) => void) => void): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected. + * + * @param values An array of Promises. + * @return Promise A new Promise. + */ + all(values: (T | Promise)[]): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises resolve, or rejected when any Promise is rejected. + * + * @param values An array of values. + * @returns A new Promise. + */ + all(values: Promise[]): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved or rejected. + * + * @param values An array of Promises. + * @return Promise A new Promise. + */ + race(values: (T | Promise)[]): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * + * @param reason The reason the promise was rejected. + * @return Promise A new rejected Promise. + */ + reject(reason: any): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * + * @param reason The reason the promise was rejected. + * @return void A Promise is rejected. + */ + reject(reason: any): Promise; + + /** + * Creates a new resolved promise for the provided value. + * + * @param value A promise. + * @return Promise A promise whose internal state matches the provided promise. + */ + resolve(value: T | Promise): Promise; + + /** + * Creates a new resolved promise. + * + * @return Promise A resolved promise. + */ + resolve(): Promise; +} + +declare var Promise: PromiseConstructor; + + +/** + * Interface for the Ajax setting that will configure the Ajax request. + */ +interface ChocolateChipAjaxSettings { + /** + * A string containing the URL to which the request is sent. + */ + url?: string; + + /** + * A username to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + user?: string; + + /** + * A password to be used with XMLHttpRequest in response to an HTTP access authentication request. + */ + password?: string; + + /** + * The type of data that you're expecting back from the server. If none is specified, ChocolateChipJS will + * infer it based on the MIME type of the response. + */ + dataType?: string; + + /** + * The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, + * such as PUT and DELETE, can also be used here, but they are not supported by all browsers. + */ + type?: string; + + /** + * A pre-request callback function that can be used to modify the XMLHTTPRequest object before it is sent. + * Use this to set custom headers, etc. This is an Ajax Event. Returning false in the beforeSend function will cancel the request. + * @return void + */ + beforeSend?: (xhr: XMLHttpRequest, settings: ChocolateChipAjaxSettings) => void; + + /** + * A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, + * formatted according to the dataType parameter; a string describing the status; and the XMLHttpRequest object. This is an Ajax Event. + * @return void + */ + success?: (data: any) => void; + + /** + * A function to be called if the request fails. The function receives three arguments: The XMLHttpRequest object, a string describing + * the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) + * are "timeout", "error", "abort", and "parsererror". When an HTTP error occurs, errorThrown receives the textual portion of the HTTP status, + * such as "Not Found" or "Internal Server Error." This is an Ajax Event. + */ + error?: (error: Error) => void; + + /** + * This object will be made the context of all Ajax-related callbacks. By default, the context is null. + */ + context?: any; + + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. + * Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the + * browser, disabling any actions while the request is active. + */ + async?: boolean; + + /** + * Set a timeout (in milliseconds) for the request. The timeout period starts at the point the $.ajax call is made; if several other requests are in progress + * and the browser has no connections available, it is possible for a request to time out before it can be sent. + */ + timeout?: number; + + /** + * An object of additional header key/value pairs to send along with requests using the XMLHttpRequest transport. The header X-Requested-With: XMLHttpRequest is always added, + * but its default XMLHttpRequest value can be changed here. Values in the headers setting can also be overwritten from within the beforeSend function. + */ + headers?: Object; + + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. Object must be Key/Value pairs. + */ + data?: any; +} + +interface ChocolateChipXHR { + ajax: (settings: ChocolateChipAjaxSettings) => PromiseConstructor; +} + +interface ChocolateChipJSONP { + url: string; + success?: (data: any) => Promise; + callbackType?: string; + timeout?: number; +} + +interface ChocolateChipElementArray extends Array { + /** + * Iterate over an Array object, executing a function for each matched element. + * + * @param Function + * @return void + */ + each(func: (ctx: any, idx: number) => any): void; + + /** + * Sorts an array and removes duplicates before returning it. + * + * @return Array + */ + unique(): T[]; + + /** + * This method returns the element at the position in the array indicated by the argument. This is a zero-based number. + * When dealing with document nodes, this allows you to cherry pick a node from its collection based on its + * position amongst its siblings. + * + * @param number Index value indicating the node you wish to access from a collection. This is zero-based. + * @return HTMLElement + */ + eq(index: number): ChocolateChipElementArray; + + /** + * Search for a given element from among the matched elements on a collection. + * This method returns the index value as an integer. + * + * @return number + */ + index(): number; + + /** + * Search for a given element from among the matched elements on a collection. + * This method returns the index value as an integer. + * + * @param selector A selector representing an element to look for in a collection of elements. + * @return number + */ + index(selector: string | HTMLElement[]): number; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + is(selector: string): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + * @ return HTMLElement[] + */ + is(element: any): ChocolateChipElementArray; + + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + isnt(selector: string): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + * @ return HTMLElement[] + */ + isnt(element: any): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + has(selector: string): ChocolateChipElementArray; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + * @ return HTMLElement[] + */ + has(contained: HTMLElement): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + hasnt(selector: string): ChocolateChipElementArray; + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param contained A DOM element to match elements against. + * @ return HTMLElement[] + */ + hasnt(contained: HTMLElement): ChocolateChipElementArray; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector or element. + * + * @param selector A string containing a selector expression to match elements against. + * @ return HTMLElement[] + */ + find(selector: string): ChocolateChipElementArray; + + /** + * Get the descendants of each element in the current set of matched elements, filtered by a selector or element. + * + * @param element An element to match elements against. + * @ return HTMLElement[] + */ + find(element: HTMLElement): ChocolateChipElementArray; + + /** + * Get the immediately preceding sibling of each element in the set of matched elements. + * + * @ return HTMLElement[] + */ + prev(): ChocolateChipElementArray; + + /** + * Get the immediately following sibling of each element in the set of matched elements. + * + * @ return HTMLElement[] + */ + next(): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to the first in the set. + */ + first(): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to the last in the set. + * + * @return HTMLElement[] + */ + last(): ChocolateChipElementArray; + + /** + * Get the children of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + children(selector?: string): ChocolateChipElementArray; + + /** + * Get the parent of each element in the current set of matched elements, optionally filtered by a selector. + * If multiple elements have the same parent, only one instance of the parent is returned. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + parent(selector?: string): ChocolateChipElementArray; + + /** + * For each element in the set, get the first element that matches the selector by testing the element + * itself and traversing up through its ancestors in the DOM tree, or, if a number is provided, + * retrieving that ancestor based on its distance from the element. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + ancestor(selector: string | number): ChocolateChipElementArray; + + /** + * For each element in the set, get the first element that matches the selector by testing the element + * itself and traversing up through its ancestors in the DOM tree. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + closest(selector: string | number): ChocolateChipElementArray; + + + /** + * Get the siblings of each element in the set of matched elements, optionally filtered by a selector. + * + * @param selector A string containing a selector expression to match elements against. + * @return HTMLElement[] + */ + siblings(selector?: string): ChocolateChipElementArray; + + /** + * Get the HTML contents of the first element in the set of matched elements. + * + * @return HTMLElement[] + */ + html(): ChocolateChipElementArray; + + /** + * Set the HTML contents of each element in the set of matched elements. + * + * @param htmlString A string of HTML to set as the content of each matched element. + * @return HTMLElement[] + */ + html(htmlString: string): ChocolateChipElementArray; + + + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + * @return string + */ + css(propertyName: string): string; + + /** + * Set one or more CSS properties for the set of matched elements using a quoted string. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + * @return HTMLElement[] + */ + css(propertyName: string, value: string): ChocolateChipElementArray; + + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + * @return HTMLElement[] + */ + css(properties: Object): ChocolateChipElementArray; + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + * @return string + */ + attr(attributeName: string): string; + + /** + * Set an attribute for the set of matched elements. + * + * @param attributeName A string indicating the attribute to set. + * @param value A string indicating the value to set the attribute to. + * @return HTMLElement[] + */ + attr(attributeName: string, value: string): ChocolateChipElementArray; + + /** + * Remove an attribute from a node. + * + * @param attributeName A string indicating the attribute to remove. + * @return HTMLElement[] + */ + removeAttr(attributeName: string): ChocolateChipElementArray; + + /** + * Return any of the matched elements that have the given attribute. + * + * @param className The class name to search for. + * @return HTMLElement[] + */ + hasAttr(attributeName: string): ChocolateChipElementArray; + + + /** + * Get the value of an attribute for the first element in the set of matched elements. + * + * @param attributeName The name of the attribute to get. + * @return string + */ + prop(attributeName: string): string; + + /** + * Set an property for the set of matched elements. + * + * @param propertyName A string indicating the property to set. + * @param value A string indicating the value to set the property to. + * @return HTMLElement[] + */ + prop(propertyName: string, value: string): ChocolateChipElementArray; + + /** + * Adds the specified class(es) to each of the set of matched elements. + * + * @param className One or more space-separated classes to be added to the class attribute of each matched element. + * @return HTMLElement[] + */ + addClass(className: string): ChocolateChipElementArray; + + /** + * Remove a single class or multiple classes from each element in the set of matched elements. + * + * @param className One or more space-separated classes to be removed from the class attribute of each matched element. + * @return HTMLElement[] + */ + removeClass(className?: string): ChocolateChipElementArray; + + /** + * Add or remove a classe from each element in the set of matched elements, depending on whether the class is present or not. + * + * @param className One or more class names (separated by spaces) to be toggled for each element in the matched set. + * @return HTMLElement[] + */ + toggleClass(className: string, swtch?: boolean): ChocolateChipElementArray; + + /** + * Return any of the matched elements that have the given class. + * + * @param className The class name to search for. + * @return HTMLElement[] + */ + hasClass(className: string): ChocolateChipElementArray; + + /** + * Store arbitrary data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + * @return HTMLElement[] + */ + data(key: string, value: any): ChocolateChipElementArray; + + /** + * Return the value at the named data store for the first element in the element collection, as set by + * data(name). + * + * @param key Name of the data stored. + * @return any + */ + data(key: string): any; + + /** + * Remove the value at the named data store for the first element in the element collection, as set by data(name, value). + * + * @param key Name of the data stored. + * @return any + */ + removeData(key: string): any; + + /** + * Store string data associated with the matched elements. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it must be a string. You can convert JSON into a string to use with this. + * @return HTMLElement[] + */ + dataset(key: string, value: any): ChocolateChipElementArray; + + /** + * Retrieve a dataset key's value for the first element in the element collection. + * + * @param key A string naming the piece of data to set. + * @return HTMLElement[] + */ + dataset(key: string): ChocolateChipElementArray; + + /** + * Return the value at the named data store for the first element in the element collection, as set by data(name, value). + * + * @param key Name of the data stored. + * @return any + */ + data(key: string): any; + + /** + * Store arbitrary data associated with the matched element. + * + * @param key A string naming the piece of data to set. + * @param value The new data value; it can be any Javascript type including Array or Object. + * @return HTMLElement[] + */ + data(key: string, value?: any): ChocolateChipElementArray; + + /** + * Get the current value of the first element in the set of matched elements. + */ + val(): any; + + /** + * Set the value of each element in the set of matched elements. + * + * @param value A string of text or an array of strings corresponding to the value of each matched element + * to set as selected/checked. + * @return any + */ + val(value: string): ChocolateChipElementArray; + + /** + * Set the property of an element to enabled by removing the "disabled" attribute. + * + * @return HTMLElement[] + */ + enable(): ChocolateChipElementArray; + + /** + * Set the property of an element to "disabled". + * + * @return HTMLElement[] + */ + disable(): ChocolateChipElementArray; + + /** + * Display the matched elements. + * + * @param speed A string or number determining how long the animation will run. + * @param callback A function to call once the animation is complete. + * @return HTMLElement[] + */ + show(duration?: number | string, callback?: Function): ChocolateChipElementArray; + + /** + * Hide the matched elements. + * + * @param duration A string or number determining how long the animation will run. + * @param callback A function to call once the animation is complete. + * @return HTMLElement[] + */ + hide(duration?: number | string, callback?: Function): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, before each element in the set of matched elements. + * + * @param content HTML string, DOM element, array of elements to insert before each element in the set of matched elements. + * @return HTMLElement[] + */ + before(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, after each element in the set of matched elements. + * + * @param content HTML string, DOM element, array of elements to insert after each element in the set of matched elements. + * @return HTMLElement[] + */ + after(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, to the end of each element in the set of matched elements. + * + * @param content DOM element, array of elements, or HTML string to insert at the end of each element in the set + * of matched elements. + * @return HTMLElement[] + */ + append(content: ChocolateChipElementArray|HTMLElement|Text|string): ChocolateChipElementArray; + + /** + * Insert content, specified by the parameter, at the beginning of each element in the set of matched elements. + * + * @param content DOM element, array of elements, or HTML string to insert at the beginning of each element in the set of matched elements. + * @return HTMLElement[] + */ + prepend(content: ChocolateChipElementArray|HTMLElement|Text|string): ChocolateChipElementArray; + + /** + * Insert every element in the set of matched elements to the beginning of the target. + * + * @param target A selector, element, or HTML string. The matched set of elements will be inserted at the beginning of the element specified by this parameter. + * @return HTMLElement[] + */ + prependTo(target: any[]|HTMLElement|string): ChocolateChipElementArray; + + /** + * Insert every element in the set of matched elements to the end of the target. + * + * @param target A selector, element, or HTML string. The matched set of elements will be inserted at the end of the element specified by this parameter. + * If no position value is provided it will simply append the content to the target. + * @return HTMLElement[] + */ + appendTo(target: any[]|HTMLElement|string): ChocolateChipElementArray; + + /** + * Insert element(s) into the target element. + * + * @return HTMLElement[] + */ + insert(content: string, position?: number | string): ChocolateChipElementArray; + + /** + * Create a copy of the set of matched elements. + * + * @param value A Boolean indicating whether to copy the element(s) with their children. A true value copies the children. + * @return HTMLElement[] + */ + clone(value?: boolean): ChocolateChipElementArray; + + /** + * Wrap an HTML structure around each element in the set of matched elements. + * + * @param wrappingElement A selector or HTML string specifying the structure to wrap around the matched elements. + * @return HTMLElement[] + */ + wrap(wrappingElement: string): ChocolateChipElementArray; + + /** + * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. + * + * @return HTMLElement[] + */ + unwrap(): ChocolateChipElementArray; + + /** + * Remove the set of matched elements from the DOM. If there are any attached events, this will remove them to prevent memory leaks. + * + * @param selector A selector expression that filters the set of matched elements to be removed. + * @return HTMLElement[] + */ + remove(selector?: string): ChocolateChipElementArray; + + /** + * Remove all child nodes of the set of matched elements from the DOM. + * + * @return HTMLElement[] + */ + empty(): ChocolateChipElementArray; + + /** + * Get an object of the current coordinates of the first element in the set of matched elements, relative to the document. + * These are: top, left, bottom and right. The values are numbers representing pixel values. + * @return Object + */ + offset(): ChocolateChipOffsetObject; + + /** + * Get the current computed width for the first element in the set of matched elements, + * including padding but excluding borders. + * + * @return number + */ + width(): number; + + /** + * Get the current computed height for the first element in the set of matched elements, + * including padding but excluding borders. + * + * @return number + */ + height(): number; + + /** + * Get the combined text contents of each element in the set of matched elements, including their descendants. + * + * @return string + */ + text(): string; + + /** + * Set the content of each element in the set of matched elements to the specified text. + * + * @param text The text to set as the content of each matched element. When Number is supplied, it will be converted to a String representation. To delete text, use ChocolateChipElementArray.empty() or ChocolateChipElementArray.remove(). + * @return HTMLElement + */ + text(text: string | number): HTMLElement; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + bind(eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Remove a handler for an event from the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + unbind(eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a delegated event to listen for the provided event on the descendant elements. + * + * @param selector A string defining the descendant elements to listen on for the designated event. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. The keyword "this" will refer + * to the element receiving the event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + delegate(selector: any, eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a delegated event to listen for the provided event on the descendant elements. + * + * @param selector A string defining the descendant elements are listening for the event. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + undelegate(selector: any, eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a handler to an event for elements. If a selector is provided as the second argument, this implements a delegated event. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param selector A string defining the descendant elements are listening for the event. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + on( eventType: string, selector: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; + + /** + * Remove a handler for an event from the elements. If the second argument is a selector, it tries to undelegate the event. + * If no arugments are provided, it removes all events from the element(s). + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param selector A string defining the descendant elements are listening for the event. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + * @return ChocolateChipStatic + */ + off( eventType?: string, selector?: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; + + /** + * + */ + trigger(eventType: string): void; + + /** + * A method to animate DOM nodes using CSS. This uses CSS transitions. + * + * @param options And object of key value pairs define the CSS properties and values to animate. + * @param duration A string representing the time. Should have a time identifier: "200s", "200ms", etc. + * @param easing A string indicating the easing for the animation, such as "ease-out", "ease-in", "ease-in-out". + * @return void + */ + animate(options: Object, duration?: string, easing?: string ): void; +} + +/** + * Interface for offset object. + */ +interface ChocolateChipOffsetObject { + top: number; + left: number; + bottom: number; + right: number; +} From 1e5786baeffd436ef5b9b912912b185d76d8410e Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Thu, 18 Jun 2015 14:17:16 +0200 Subject: [PATCH 0179/2220] Fix MapTypeStyle (elementType and featureType accept only string) --- googlemaps/google.maps.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 2250527c3a..fdd5eeaf2a 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -225,7 +225,7 @@ declare module google.maps { setStyle(style: Data.StylingFunction|Data.StyleOptions): void; toGeoJson(callback: (feature: Object) => void): void; } - + export module Data { export interface DataOptions { map?: Map; @@ -1204,8 +1204,8 @@ declare module google.maps { } export interface MapTypeStyle { - elementType?: MapTypeStyleElementType; - featureType?: MapTypeStyleFeatureType; + elementType?: string|MapTypeStyleElementType; + featureType?: string|MapTypeStyleFeatureType; stylers?: MapTypeStyler[]; } From 98c5ba0d560efae32b801ca47533ecfef932a94f Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Thu, 18 Jun 2015 02:59:04 +0200 Subject: [PATCH 0180/2220] Add missing semicolons --- googlemaps/google.maps.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index fdd5eeaf2a..1b0844f7bf 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -261,8 +261,8 @@ declare module google.maps { getProperty(name: string): any; removeProperty(name: string): void; setGeometry(newGeometry: Data.Geometry|LatLng): void; // TODO LatLngLiteral - setProperty(name: string, newValue: any): void - toGeoJson(callback: (feature: Object) => void): void + setProperty(name: string, newValue: any): void; + toGeoJson(callback: (feature: Object) => void): void; } export interface FeatureOptions { From 17f143452612e442dcbd36fb80e37673ca71a9c7 Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Thu, 18 Jun 2015 03:06:43 +0200 Subject: [PATCH 0181/2220] Fix PhpStorm lexical analysis --- googlemaps/google.maps.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/googlemaps/google.maps.d.ts b/googlemaps/google.maps.d.ts index 1b0844f7bf..9fa61ddab1 100644 --- a/googlemaps/google.maps.d.ts +++ b/googlemaps/google.maps.d.ts @@ -209,20 +209,20 @@ declare module google.maps { /***** Data *****/ export class Data extends MVCObject { - constructor(options?: Data.DataOptions); - add(feature: Data.Feature|Data.FeatureOptions): Data.Feature; - addGeoJson(geoJson: Object, options?: Data.GeoJsonOptions): Data.Feature[]; - contains(feature: Data.Feature): boolean; - forEach(callback: (feature: Data.Feature) => void): void; - getFeatureById(id: number|string): Data.Feature; + constructor(options?: google.maps.Data.DataOptions); + add(feature: google.maps.Data.Feature|google.maps.Data.FeatureOptions): google.maps.Data.Feature; + addGeoJson(geoJson: Object, options?: google.maps.Data.GeoJsonOptions): google.maps.Data.Feature[]; + contains(feature: google.maps.Data.Feature): boolean; + forEach(callback: (feature:google.maps.Data.Feature) => void): void; + getFeatureById(id: number|string): google.maps.Data.Feature; getMap(): Map; - getStyle(): Data.StylingFunction|Data.StyleOptions; - loadGeoJson(url: string, options?: Data.GeoJsonOptions, callback?: (features: Data.Feature[]) => void): void; - overrideStyle(feature: Data.Feature, style: Data.StyleOptions): void; - remove(feature: Data.Feature): void; - revertStyle(feature?: Data.Feature): void; + getStyle(): google.maps.Data.StylingFunction|google.maps.Data.StyleOptions; + loadGeoJson(url: string, options?: google.maps.Data.GeoJsonOptions, callback?: (features:google.maps.Data.Feature[]) => void): void; + overrideStyle(feature: google.maps.Data.Feature, style: google.maps.Data.StyleOptions): void; + remove(feature: google.maps.Data.Feature): void; + revertStyle(feature?: google.maps.Data.Feature): void; setMap(map: Map): void; - setStyle(style: Data.StylingFunction|Data.StyleOptions): void; + setStyle(style: google.maps.Data.StylingFunction|google.maps.Data.StyleOptions): void; toGeoJson(callback: (feature: Object) => void): void; } From 689ee644bbc032d226e646c881cfb76bda8fcffb Mon Sep 17 00:00:00 2001 From: Jan Trejbal Date: Thu, 18 Jun 2015 03:16:27 +0200 Subject: [PATCH 0182/2220] Add tests --- googlemaps/google.maps-tests.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/googlemaps/google.maps-tests.ts b/googlemaps/google.maps-tests.ts index 23931850db..9b10c40ad3 100644 --- a/googlemaps/google.maps-tests.ts +++ b/googlemaps/google.maps-tests.ts @@ -115,4 +115,28 @@ var icon: google.maps.Icon = { scaledSize: new google.maps.Size(32, 32), size: new google.maps.Size(32, 32), url: "dummy" -} \ No newline at end of file +}; + +/***** MapTypeStyle *****/ + +var mapTypeStyle: google.maps.MapTypeStyle ={ + featureType: 'all', +}; + +var mapTypeStyle: google.maps.MapTypeStyle ={ + featureType: 'administrative.country', + elementType: 'all', + stylers: [], +}; + +var mapTypeStyle: google.maps.MapTypeStyle ={ + featureType: 'landscape.natural', + elementType: 'geometry', + stylers: [], +}; + +var mapTypeStyle: google.maps.MapTypeStyle ={ + featureType: 'poi.school', + elementType: 'labels', + stylers: [], +}; From dea8dc1a00c12289fbb4f68e8103620e1bf176fb Mon Sep 17 00:00:00 2001 From: Ben Dixon Date: Thu, 18 Jun 2015 15:09:37 +0100 Subject: [PATCH 0183/2220] Add definitions for ScrollToFixed https://github.com/bigspotteddog/ScrollToFixed --- scrolltofixed/scrolltofixed-tests.ts | 35 ++++++++++++++++++++++ scrolltofixed/scrolltofixed.d.ts | 43 ++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 scrolltofixed/scrolltofixed-tests.ts create mode 100644 scrolltofixed/scrolltofixed.d.ts diff --git a/scrolltofixed/scrolltofixed-tests.ts b/scrolltofixed/scrolltofixed-tests.ts new file mode 100644 index 0000000000..23b7873048 --- /dev/null +++ b/scrolltofixed/scrolltofixed-tests.ts @@ -0,0 +1,35 @@ +/// + +$(document).ready(function() { + $('#mydiv').scrollToFixed(); +}); + +$(document).ready(function() { + $('.header').scrollToFixed({ + preFixed: function() { $(this).find('h1').css('color', 'blue'); }, + postFixed: function() { $(this).find('h1').css('color', ''); } + }); + + $('.footer').scrollToFixed( { + bottom: 0, + limit: $('.footer').offset().top, + preFixed: function() { $(this).find('h1').css('color', 'blue'); }, + postFixed: function() { $(this).find('h1').css('color', ''); } + }); + + // Order matters because our summary limit is based on the position + // of the footer. On window refresh, the summary needs to recalculate + // after the footer. + $('#summary').scrollToFixed({ + marginTop: $('.header').outerHeight() + 10, + limit: function() { + var limit = $('.footer').offset().top - $('#summary').outerHeight(true) - 10; + return limit; + }, + zIndex: 999, + preFixed: function() { $(this).find('.title').css('color', 'blue'); }, + preAbsolute: function() { $(this).find('.title').css('color', 'red'); }, + postFixed: function() { $(this).find('.title').css('color', ''); }, + postAbsolute: function() { $(this).find('.title').css('color', ''); } + }); +}); \ No newline at end of file diff --git a/scrolltofixed/scrolltofixed.d.ts b/scrolltofixed/scrolltofixed.d.ts new file mode 100644 index 0000000000..2a1ef70a8d --- /dev/null +++ b/scrolltofixed/scrolltofixed.d.ts @@ -0,0 +1,43 @@ +// Type definitions for ScrollToFixed +// Project: https://github.com/bigspotteddog/ScrollToFixed +// Definitions by: Ben Dixon +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module ScrollToFixed { + interface ScrollToFixedOptions { + marginTop? : number | (() => number); + limit? : number | (() => number); + bottom?: number; + zIndex? : number; + spacerClass? : string; + preFixed?: () => void; + fixed?: () => void; + postFixed?: () => void; + preUnfixed?: () => void; + unfixed?: () => void; + postUnfixed?: () => void; + preAbsolute?: () => void; + postAbsolute?: () => void; + offsets? : boolean; + minWidth? : number; + maxWidth? : number; + dontCheckForPositionFixedSupport? : boolean; + dontSetWidth? : boolean; + removeOffsets? : boolean; + } +} + +interface JQuery { + isScrollToFixed(el: Element) : JQuery; + isScrollToFixed(el: Element[]) : JQuery; + isScrollToFixed(el: {}) : JQuery; + isScrollToFixed(el: JQuery) : JQuery; + ScrollToFixed(el : Element, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; + ScrollToFixed(el: Element[], options : ScrollToFixed.ScrollToFixedOptions) : JQuery; + ScrollToFixed(el: {}, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; + ScrollToFixed(el: JQuery, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; + + scrollToFixed : (options? : ScrollToFixed.ScrollToFixedOptions) => JQuery[]; +} \ No newline at end of file From 018e116d13ec1ad7d571c7e313bda7773d32728d Mon Sep 17 00:00:00 2001 From: Ben Dixon Date: Thu, 18 Jun 2015 15:27:56 +0100 Subject: [PATCH 0184/2220] Update ScrollToFixed definitions --- scrolltofixed/scrolltofixed.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scrolltofixed/scrolltofixed.d.ts b/scrolltofixed/scrolltofixed.d.ts index 2a1ef70a8d..a4581a3684 100644 --- a/scrolltofixed/scrolltofixed.d.ts +++ b/scrolltofixed/scrolltofixed.d.ts @@ -13,10 +13,10 @@ declare module ScrollToFixed { zIndex? : number; spacerClass? : string; preFixed?: () => void; - fixed?: () => void; postFixed?: () => void; - preUnfixed?: () => void; + fixed?: () => void; unfixed?: () => void; + preUnfixed?: () => void; postUnfixed?: () => void; preAbsolute?: () => void; postAbsolute?: () => void; @@ -26,6 +26,8 @@ declare module ScrollToFixed { dontCheckForPositionFixedSupport? : boolean; dontSetWidth? : boolean; removeOffsets? : boolean; + baseClassName?: string; + className?: string; } } From b58db06e15c6e16bc029ce2ca750c2446726ea06 Mon Sep 17 00:00:00 2001 From: Maxime Fabre Date: Thu, 18 Jun 2015 17:14:16 +0200 Subject: [PATCH 0185/2220] Update Angular module in angular-resource --- angularjs/angular-resource.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts index 7f02a533ea..4688a9c6f5 100644 --- a/angularjs/angular-resource.d.ts +++ b/angularjs/angular-resource.d.ts @@ -147,7 +147,7 @@ declare module angular.resource { } // IResourceServiceProvider used to configure global settings - interface IResourceServiceProvider extends ng.IServiceProvider { + interface IResourceServiceProvider extends angular.IServiceProvider { defaults: IResourceOptions; } From 55e444180a0f37a8910c96250a3957c6c79607da Mon Sep 17 00:00:00 2001 From: Ben Dixon Date: Thu, 18 Jun 2015 16:51:47 +0100 Subject: [PATCH 0186/2220] Update ScrollToFixed definitions --- scrolltofixed/scrolltofixed-tests.ts | 7 +++---- scrolltofixed/scrolltofixed.d.ts | 12 ++++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scrolltofixed/scrolltofixed-tests.ts b/scrolltofixed/scrolltofixed-tests.ts index 23b7873048..80d67922f7 100644 --- a/scrolltofixed/scrolltofixed-tests.ts +++ b/scrolltofixed/scrolltofixed-tests.ts @@ -17,9 +17,6 @@ $(document).ready(function() { postFixed: function() { $(this).find('h1').css('color', ''); } }); - // Order matters because our summary limit is based on the position - // of the footer. On window refresh, the summary needs to recalculate - // after the footer. $('#summary').scrollToFixed({ marginTop: $('.header').outerHeight() + 10, limit: function() { @@ -32,4 +29,6 @@ $(document).ready(function() { postFixed: function() { $(this).find('.title').css('color', ''); }, postAbsolute: function() { $(this).find('.title').css('color', ''); } }); -}); \ No newline at end of file +}); + +var b = $.isScrollToFixed('.header'); \ No newline at end of file diff --git a/scrolltofixed/scrolltofixed.d.ts b/scrolltofixed/scrolltofixed.d.ts index a4581a3684..f9fed47c59 100644 --- a/scrolltofixed/scrolltofixed.d.ts +++ b/scrolltofixed/scrolltofixed.d.ts @@ -31,15 +31,19 @@ declare module ScrollToFixed { } } -interface JQuery { +interface JQuery { + scrollToFixed : (options? : ScrollToFixed.ScrollToFixedOptions) => JQuery[]; +} + +interface JQueryStatic { isScrollToFixed(el: Element) : JQuery; isScrollToFixed(el: Element[]) : JQuery; isScrollToFixed(el: {}) : JQuery; isScrollToFixed(el: JQuery) : JQuery; + + ScrollToFixed(el: Element, options: ScrollToFixed.ScrollToFixedOptions): void; ScrollToFixed(el : Element, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; ScrollToFixed(el: Element[], options : ScrollToFixed.ScrollToFixedOptions) : JQuery; ScrollToFixed(el: {}, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; - ScrollToFixed(el: JQuery, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; - - scrollToFixed : (options? : ScrollToFixed.ScrollToFixedOptions) => JQuery[]; + ScrollToFixed(el: JQuery, options : ScrollToFixed.ScrollToFixedOptions) : JQuery; } \ No newline at end of file From de9dee624b14808d2a7f16a42f9f810a89cb335d Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Thu, 18 Jun 2015 10:01:25 -0600 Subject: [PATCH 0187/2220] 'uniform.js' --- jquery.uniform/jquery.uniform-tests.ts | 76 ++++++++++++++++++++++++++ jquery.uniform/jquery.uniform.d.ts | 44 +++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 jquery.uniform/jquery.uniform-tests.ts create mode 100644 jquery.uniform/jquery.uniform.d.ts diff --git a/jquery.uniform/jquery.uniform-tests.ts b/jquery.uniform/jquery.uniform-tests.ts new file mode 100644 index 0000000000..2515fc53d0 --- /dev/null +++ b/jquery.uniform/jquery.uniform-tests.ts @@ -0,0 +1,76 @@ +/// elements +$("select").uniform(); +// Style everything +$("select, input, a.button, button").uniform(); +// Avoid styling some elements +$("select").not(".skip_these").uniform(); // Method 1 +$('select[class!="skip_these"]').uniform(); // Method 2 + +$("select").uniform({ + fileDefaultText: 'Keine Datei ausgewählt', + fileBtnText: 'Wählen Sie Datei', +}); + +$.uniform.defaults.checkedClass = "uniformCheckedClass"; +$.uniform.defaults.fileBtnHtml = "Pick a file"; + +$("select").uniform({activeClass: 'myActiveClass'}); + +$("input[type=button]").uniform({buttonClass: 'myBtnClass'}); + +$(":checkbox").uniform({checkboxClass: 'myCheckClass'}); + +$(":radio, :checkbox").uniform({checkedClass: 'myCheckedClass'}); + +$("select").uniform({disabledClass: 'myDisabledClass'}); + +$("select").uniform({eventNamespace: '.uniformEvents'}); + +$(":file").uniform({fileButtonClass: 'myFileBtnClass'}); + +$(":file").uniform({fileButtonHtml: 'Choose …'}); + +$(":file").uniform({fileClass: 'myFileClass'}); + +$(":file").uniform({fileDefaultHtml: 'Select a file please'}); + +$(":file").uniform({filenameClass: 'myFilenameClass'}); + +$("select").uniform({focusClass: 'myFocusClass'}); + +$("select").uniform({hoverClass: 'myHoverClass'}); + +$("select").uniform({idPrefix: 'container'}); + +$("input").uniform({inputAddTypeAsClass: true}); + +$("input").uniform({inputClass: "inputElement"}); + +$(":radio").uniform({radioClass: 'myRadioClass'}); + +$("input[type='reset']).uniform({resetDefaultHtml: "Clear"}); + +$("select").uniform({resetSelector: 'input[type="reset"]'}); + +$("select").uniform({selectClass: 'mySelectClass'}); + +$("select").uniform({selectMultiClass: 'myMultiSelectClass'}); + +$("input[type='submit']).uniform({resetDefaultHtml: "Submit Form"}); + +$("textarea").uniform({textareaClass: "myTextareaClass"}); + +$("select").uniform({useID: false}); + +$('input.blue').uniform({wrapperClass: "blueTheme"}); +$('input').uniform({wrapperClass: "defaultTheme"}); + +$.uniform.update("#myUpdatedCheckbox"); + +$.uniform.update(); + +$.uniform.restore("select"); + +var uniforms = $.uniform.elements; diff --git a/jquery.uniform/jquery.uniform.d.ts b/jquery.uniform/jquery.uniform.d.ts new file mode 100644 index 0000000000..8517bddb98 --- /dev/null +++ b/jquery.uniform/jquery.uniform.d.ts @@ -0,0 +1,44 @@ +// Type definitions for Uniform.js +// Project: https://github.com/pixelmatrix/uniform +// Definitions by: flyfishMT +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface UniformOptions { + activeClass?: string; + autoHide?: boolean; + buttonClass?: string; + checkboxClass?: string; + checkedClass?: string; + disabledClass?: string; + eventNamespace?: string; + fileButtonClass?: string; + fileButtonHtml?: string; + fileClass?: string; + fileDefaultHtml?: string; + filenameClass?: string; + focusClass?: string; + hoverClass?: string; + idPrefix?: string; + inputAddTypeAsClass?: boolean; + radioClass?: string; + resetDefaultHtml?: string; + resetSelector?: any; + selectAutoWidth?: boolean; + selectClass?: string; + selectMultiClass?: string; + submitDefaultHtml?: string; + textareaClass?: string; + useID?: boolean; + wrapperClass?: string; +} +interface Uniform { + (options?: UniformOptions): JQuery; + update(any?): void; + restore(any?): void; + elements: JQuery[]; +} +interface JQueryStatic { + uniform: Uniform; +} From f647477b32325d53783dd9e6ab9cedb245f1fa39 Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Thu, 18 Jun 2015 10:14:47 -0600 Subject: [PATCH 0188/2220] uniform.js --- jquery.uniform/jquery.uniform-tests.ts | 6 +++--- jquery.uniform/jquery.uniform.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jquery.uniform/jquery.uniform-tests.ts b/jquery.uniform/jquery.uniform-tests.ts index 2515fc53d0..130c51aab1 100644 --- a/jquery.uniform/jquery.uniform-tests.ts +++ b/jquery.uniform/jquery.uniform-tests.ts @@ -1,5 +1,5 @@ -/// elements $("select").uniform(); // Style everything @@ -50,7 +50,7 @@ $("input").uniform({inputClass: "inputElement"}); $(":radio").uniform({radioClass: 'myRadioClass'}); -$("input[type='reset']).uniform({resetDefaultHtml: "Clear"}); +$("input[type='reset']").uniform({resetDefaultHtml: "Clear"}); $("select").uniform({resetSelector: 'input[type="reset"]'}); diff --git a/jquery.uniform/jquery.uniform.d.ts b/jquery.uniform/jquery.uniform.d.ts index 8517bddb98..172fdc78c7 100644 --- a/jquery.uniform/jquery.uniform.d.ts +++ b/jquery.uniform/jquery.uniform.d.ts @@ -35,8 +35,8 @@ interface UniformOptions { } interface Uniform { (options?: UniformOptions): JQuery; - update(any?): void; - restore(any?): void; + update(elemOrSelector?: any): void; + restore(elemOrSelector?: any): void; elements: JQuery[]; } interface JQueryStatic { From 2a0415acb2e99c8077514f4cb3e0dddcc07d18ec Mon Sep 17 00:00:00 2001 From: flyfishMT Date: Thu, 18 Jun 2015 10:19:41 -0600 Subject: [PATCH 0189/2220] Uniform.js --- jquery.uniform/jquery.uniform-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.uniform/jquery.uniform-tests.ts b/jquery.uniform/jquery.uniform-tests.ts index 130c51aab1..0ffeed0314 100644 --- a/jquery.uniform/jquery.uniform-tests.ts +++ b/jquery.uniform/jquery.uniform-tests.ts @@ -1,4 +1,4 @@ -/// // Style all ')).toHaveValue('some text') */ - toHaveValue(value): boolean; + toHaveValue(value : string): boolean; /** * Check if DOM element has the given data. * This can only be applied for element on with jQuery data(key) can be called. * */ - toHaveData(key, expectedValue): boolean; + toHaveData(key : string, expectedValue : string): boolean; toBe(selector: JQuery): boolean; /** @@ -295,7 +295,7 @@ declare module jasmine { * @example * expect($form).toHandleWith("submit", yourSubmitCallback) */ - toHandleWith(eventName: string, eventHandler): boolean; + toHandleWith(eventName: string, eventHandler : JQueryCallback): boolean; /** * Checks if event was triggered. @@ -381,7 +381,7 @@ declare module jasmine { wasTriggeredWith(selector: string, eventName: string, expectedArgs: any, env: jasmine.Env): boolean; wasPrevented(selector: string, eventName: string): boolean; wasStopped(selector: string, eventName: string): boolean; - cleanUp(); + cleanUp() : void; } var JQuery: JasmineJQuery; From b53cbfb5b5dd9c471ad2f2220bd8c6adf8613288 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Mon, 22 Jun 2015 17:41:15 -0700 Subject: [PATCH 0217/2220] Add `xit` and `xdescribe` In Mocha you can comment out tests by changing their `it` or `describe` blocks to `xit` or `xdescribe`. This change will add support for those functions. --- mocha/mocha.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mocha/mocha.d.ts b/mocha/mocha.d.ts index fefd919466..1d57bc45ce 100644 --- a/mocha/mocha.d.ts +++ b/mocha/mocha.d.ts @@ -37,11 +37,13 @@ interface MochaDone { declare var mocha: Mocha; declare var describe: Mocha.IContextDefinition; +declare var xdescribe: Mocha.IContextDefinition; // alias for `describe` declare var context: Mocha.IContextDefinition; // alias for `describe` declare var suite: Mocha.IContextDefinition; declare var it: Mocha.ITestDefinition; +declare var xit: Mocha.ITestDefinition; // alias for `it` declare var test: Mocha.ITestDefinition; From 567c33f879c6bec49728d753623bc5b085040ad1 Mon Sep 17 00:00:00 2001 From: John Vilk Date: Mon, 22 Jun 2015 21:59:09 -0700 Subject: [PATCH 0218/2220] [decimal.js] Change module name to standard 'decimal.js'. --- decimal.js/decimal.js.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/decimal.js/decimal.js.d.ts b/decimal.js/decimal.js.d.ts index da2489a5f7..74910614e2 100644 --- a/decimal.js/decimal.js.d.ts +++ b/decimal.js/decimal.js.d.ts @@ -6,7 +6,7 @@ declare var Decimal: decimal.IDecimalStatic; // Support AMD require -declare module 'decimal' { +declare module 'decimal.js' { export = Decimal; } From 6f0bcac0caf998f1e943d43b7f9bf240c68ba13e Mon Sep 17 00:00:00 2001 From: Rodney Lorrimar Date: Tue, 23 Jun 2015 13:00:22 +0800 Subject: [PATCH 0219/2220] Revert "moment: Use type alias for moment-like parameters" This reverts commit 8f9ff607f0a79e5a976682d00ce156781f9efd19 which fails to compile on typescript@1.4.1 (however it compiles with typescript@1.5.0-beta). --- moment/moment-node.d.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/moment/moment-node.d.ts b/moment/moment-node.d.ts index f491833f9d..eaacb8855f 100644 --- a/moment/moment-node.d.ts +++ b/moment/moment-node.d.ts @@ -216,8 +216,8 @@ declare module moment { dayOfYear(): number; dayOfYear(d: number): Moment; - from(f: MomentLike, suffix?: boolean): string; - to(f: MomentLike, suffix?: boolean): string; + from(f: Moment|string|number|Date|number[], suffix?: boolean): string; + to(f: Moment|string|number|Date|number[], suffix?: boolean): string; diff(b: Moment): number; diff(b: Moment, unitOfTime: string): number; @@ -240,13 +240,13 @@ declare module moment { isDST(): boolean; isBefore(): boolean; - isBefore(b: MomentLike, granularity?: string): boolean; + isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean; isAfter(): boolean; - isAfter(b: MomentLike, granularity?: string): boolean; + isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean; - isSame(b: MomentLike, granularity?: string): boolean; - isBetween(a: MomentLike, b: MomentLike, granularity?: string): boolean; + isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean; + isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean; // Deprecated as of 2.8.0. lang(language: string): Moment; @@ -262,11 +262,11 @@ declare module moment { localeData(): MomentLanguage; // Deprecated as of 2.7.0. - max(date: MomentLike|any[]): Moment; + max(date: Moment|string|number|Date|any[]): Moment; max(date: string, format: string): Moment; // Deprecated as of 2.7.0. - min(date: MomentLike|any[]): Moment; + min(date: Moment|string|number|Date|any[]): Moment; min(date: string, format: string): Moment; get(unit: string): number; @@ -439,9 +439,6 @@ declare module moment { } - // Moment.js automatically converts datetime parameters from a number of types - type MomentLike = Moment | string | number | Date | number[]; - } declare module 'moment' { From 5ce0dfb57be2b3ceaec695003bfd4aa5ab0f6981 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Luk=C3=A1cs?= Date: Tue, 23 Jun 2015 11:07:10 +0200 Subject: [PATCH 0220/2220] definitions for angular-gettext v2.1.0 https://angular-gettext.rocketeer.be/ --- angular-gettext/angular-gettext-tests.ts | 55 +++++++++++++++++++ angular-gettext/angular-gettext.d.ts | 68 ++++++++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 angular-gettext/angular-gettext-tests.ts create mode 100644 angular-gettext/angular-gettext.d.ts diff --git a/angular-gettext/angular-gettext-tests.ts b/angular-gettext/angular-gettext-tests.ts new file mode 100644 index 0000000000..5500d914e2 --- /dev/null +++ b/angular-gettext/angular-gettext-tests.ts @@ -0,0 +1,55 @@ +/// + +module angular_gettext_tests { + var gettextCatalog: angular_gettext.gettextCatalog; + + + // Configuring angular-gettext + // https://angular-gettext.rocketeer.be/dev-guide/configure/ + //Setting the language + gettextCatalog.setCurrentLanguage('nl'); + + //Highlighting untranslated strings + gettextCatalog.debug = true; + + + + // Marking strings in JavaScript code as translatable. + // https://angular-gettext.rocketeer.be/dev-guide/annotate-js/ + var gettext = angular_gettext.gettext; + var myString = gettext("Hello"); + + //Translating directly in JavaScript. + angular.module("myApp").controller("helloController", function (gettextCatalog) { + var translated: string = gettextCatalog.getString("Hello"); + }); + + angular.module("myApp").controller("helloController", function (gettextCatalog) { + var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); + }); + + var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" }); + + + // Setting strings manually + // https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/ + + angular.module("myApp").run(function (gettextCatalog: angular_gettext.gettextCatalog) { + // Load the strings automatically during initialization. + gettextCatalog.setStrings("nl", { + "Hello": "Hallo", + "One boat": ["Een boot", "{{$count}} boats"] + }); + }); + + + // Lazy-loading languages + // https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ + angular.module("myApp").controller("helloController", function ($scope, gettextCatalog: angular_gettext.gettextCatalog) { + $scope.switchLanguage = function (lang: string) { + gettextCatalog.setCurrentLanguage(lang); + gettextCatalog.loadRemote("/languages/" + lang + ".json"); + }; + }); + +} \ No newline at end of file diff --git a/angular-gettext/angular-gettext.d.ts b/angular-gettext/angular-gettext.d.ts new file mode 100644 index 0000000000..01e4b070ea --- /dev/null +++ b/angular-gettext/angular-gettext.d.ts @@ -0,0 +1,68 @@ +// Type definitions for angular-gettext v2.1.0 +// Project: https://angular-gettext.rocketeer.be/ +// Definitions by: Ãkos Lukács https://github.com/AkosLukacs +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular_gettext { + interface gettextCatalog { + + ////////////// + /// Fields /// + ////////////// + + /** (default: false): Whether or not to prefix untranslated strings with [MISSING]: or a custom prefix. */ + debug: boolean; + /** (default: [MISSING]:): Custom prefix for untranslated strings. */ + debugPrefix: string; + /** (default: false): Whether or not to wrap all processed text with markers.Example output: [Welcome] */ + showTranslatedMarkers: boolean; + /** (default: [): Custom prefix to mark strings that have been run through angular-gettext. */ + translatedMarkerPrefix: string; + /** (default: ]): Custom suffix to mark strings that have been run through angular-gettext. */ + translatedMarkerSuffix: string; + /** An object of loaded translation strings.Shouldn't be used directly. */ + strings: {}; + /** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated */ + baseLanguage: string; + + + /////////////// + /// Methods /// + /////////////// + + /** Sets the current language and makes sure that all translations get updated correctly. */ + setCurrentLanguage(lang: string); + + /** Returns the current language. */ + getCurrentLanguage(): string; + + /** Processes an object of string definitions. More details https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/ + @param language A language code. + @param strings A dictionary of strings. The format of this dictionary is: + - Keys: Singular English strings (as defined in the source files) + - Values: Either a single string for signular-only strings or an array of plural forms. */ + setStrings(language: string, strings: { [key: string]: string|string[] }); + + /** Get the correct pluralized (but untranslated) string for the value of n. */ + getStringForm(string: string, n: number): string; + + /** Translate a string with the given context. Uses Angular.JS interpolation, so something like this will do what you expect: + * var hello = gettextCatalog.getString("Hello {{name}}!", { name: "Ruben" }); + * // var hello will be "Hallo Ruben!" in Dutch. + * The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster. + */ + getString(string: string, context?: any): string; + + /** Translate a plural string with the given context. */ + getPlural(n: number, string: string, stringPlural: string, context?: any): string; + + /** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */ + loadRemote(url: string); + } + + /** If you have text that should be translated in your JavaScript code, wrap it with a call to a function named gettext. This module provides an injectable function to do so */ + function gettext(dummyString: string): string; +} + From 7a37cdbfbcb3576021f7e19385a93a17a3ed2ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Luk=C3=A1cs?= Date: Tue, 23 Jun 2015 11:23:50 +0200 Subject: [PATCH 0221/2220] more type arguments + header format fix --- angular-gettext/angular-gettext-tests.ts | 13 +++++++------ angular-gettext/angular-gettext.d.ts | 12 +++++++----- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/angular-gettext/angular-gettext-tests.ts b/angular-gettext/angular-gettext-tests.ts index 5500d914e2..706fb67fe0 100644 --- a/angular-gettext/angular-gettext-tests.ts +++ b/angular-gettext/angular-gettext-tests.ts @@ -12,19 +12,18 @@ module angular_gettext_tests { //Highlighting untranslated strings gettextCatalog.debug = true; - - + // Marking strings in JavaScript code as translatable. // https://angular-gettext.rocketeer.be/dev-guide/annotate-js/ var gettext = angular_gettext.gettext; var myString = gettext("Hello"); //Translating directly in JavaScript. - angular.module("myApp").controller("helloController", function (gettextCatalog) { + angular.module("myApp").controller("helloController", function (gettextCatalog: angular_gettext.gettextCatalog) { var translated: string = gettextCatalog.getString("Hello"); }); - angular.module("myApp").controller("helloController", function (gettextCatalog) { + angular.module("myApp").controller("helloController", function (gettextCatalog: angular_gettext.gettextCatalog) { var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); }); @@ -43,13 +42,15 @@ module angular_gettext_tests { }); + interface helloControllerScope extends ng.IScope { + switchLanguage: (lang: string) => void; + } // Lazy-loading languages // https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ - angular.module("myApp").controller("helloController", function ($scope, gettextCatalog: angular_gettext.gettextCatalog) { + angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular_gettext.gettextCatalog) { $scope.switchLanguage = function (lang: string) { gettextCatalog.setCurrentLanguage(lang); gettextCatalog.loadRemote("/languages/" + lang + ".json"); }; }); - } \ No newline at end of file diff --git a/angular-gettext/angular-gettext.d.ts b/angular-gettext/angular-gettext.d.ts index 01e4b070ea..d226801dc4 100644 --- a/angular-gettext/angular-gettext.d.ts +++ b/angular-gettext/angular-gettext.d.ts @@ -1,6 +1,6 @@ // Type definitions for angular-gettext v2.1.0 // Project: https://angular-gettext.rocketeer.be/ -// Definitions by: Ãkos Lukács https://github.com/AkosLukacs +// Definitions by: Ãkos Lukács // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -24,7 +24,9 @@ declare module angular_gettext { translatedMarkerSuffix: string; /** An object of loaded translation strings.Shouldn't be used directly. */ strings: {}; - /** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated */ + /** The default language, in which you're application is written. This defaults to English and it's generally a bad idea to use anything else: if your language has different pluralization rules you'll end up with incorrect translations. Deprecated + * @deprecreated + */ baseLanguage: string; @@ -33,7 +35,7 @@ declare module angular_gettext { /////////////// /** Sets the current language and makes sure that all translations get updated correctly. */ - setCurrentLanguage(lang: string); + setCurrentLanguage(lang: string): void; /** Returns the current language. */ getCurrentLanguage(): string; @@ -43,7 +45,7 @@ declare module angular_gettext { @param strings A dictionary of strings. The format of this dictionary is: - Keys: Singular English strings (as defined in the source files) - Values: Either a single string for signular-only strings or an array of plural forms. */ - setStrings(language: string, strings: { [key: string]: string|string[] }); + setStrings(language: string, strings: { [key: string]: string|string[] }): void; /** Get the correct pluralized (but untranslated) string for the value of n. */ getStringForm(string: string, n: number): string; @@ -59,7 +61,7 @@ declare module angular_gettext { getPlural(n: number, string: string, stringPlural: string, context?: any): string; /** Load a set of translation strings from a given URL.This should be a JSON catalog generated with grunt-angular-gettext. More details https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ */ - loadRemote(url: string); + loadRemote(url: string): ng.IHttpPromise; } /** If you have text that should be translated in your JavaScript code, wrap it with a call to a function named gettext. This module provides an injectable function to do so */ From 979de8c421274ae0ba9481558c2e69fed4c2250a Mon Sep 17 00:00:00 2001 From: itokentr Date: Tue, 23 Jun 2015 19:38:39 +0900 Subject: [PATCH 0222/2220] node: Add methods Buffer.compare(), NodeBuffer.equals() and NodeBuffer.compare(). --- node/node.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index c4f778139b..2bbab98e3c 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -127,6 +127,10 @@ declare var Buffer: { * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. */ concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Buffer, buf2: Buffer): number; }; /************************************************ @@ -327,6 +331,8 @@ interface NodeBuffer { toString(encoding?: string, start?: number, end?: number): string; toJSON(): any; length: number; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer): number; copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; slice(start?: number, end?: number): Buffer; writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; From a44984a2d94a68cd388a5d2a1cdbdb370602cae9 Mon Sep 17 00:00:00 2001 From: itokentr Date: Tue, 23 Jun 2015 19:43:59 +0900 Subject: [PATCH 0223/2220] node: Add methods fs.access(), fs.accessSync and related constants. --- node/node.d.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 2bbab98e3c..0f7904fde7 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1264,6 +1264,19 @@ declare module "fs" { export function watch(filename: string, options: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher; export function exists(path: string, callback?: (exists: boolean) => void): void; export function existsSync(path: string): boolean; + /** Constant for fs.access(). File is visible to the calling process. */ + export var F_OK: number; + /** Constant for fs.access(). File can be read by the calling process. */ + export var R_OK: number; + /** Constant for fs.access(). File can be written by the calling process. */ + export var W_OK: number; + /** Constant for fs.access(). File can be executed by the calling process. */ + export var X_OK: number; + /** Tests a user's permissions for the file specified by path. */ + export function access(path: string, callback: (err: NodeJS.ErrnoException) => void): void; + export function access(path: string, mode: number, callback: (err: NodeJS.ErrnoException) => void): void; + /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */ + export function accessSync(path: string, mode ?: number): void; export function createReadStream(path: string, options?: { flags?: string; encoding?: string; From 324dfabbff0dadfde41b6a2154d4193006de466f Mon Sep 17 00:00:00 2001 From: itokentr Date: Tue, 23 Jun 2015 19:45:09 +0900 Subject: [PATCH 0224/2220] node: Add module "constants". --- node/node.d.ts | 224 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 224 insertions(+) diff --git a/node/node.d.ts b/node/node.d.ts index 0f7904fde7..0c6b42740d 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -1829,3 +1829,227 @@ declare module "domain" { export function create(): Domain; } + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var UV_UDP_REUSEADDR: number; +} From 098def61bc44ee29dae7e7a5c719873195086ac2 Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Jun 2015 21:38:32 +0900 Subject: [PATCH 0225/2220] separate mocha node.js definition --- mocha/mocha-node-tests.ts | 37 +++++++++++++++++++++++++++++++++++++ mocha/mocha-node.d.ts | 16 ++++++++++++++++ mocha/mocha-tests.ts | 34 ---------------------------------- mocha/mocha.d.ts | 18 ++++++++---------- 4 files changed, 61 insertions(+), 44 deletions(-) create mode 100644 mocha/mocha-node-tests.ts create mode 100644 mocha/mocha-node.d.ts diff --git a/mocha/mocha-node-tests.ts b/mocha/mocha-node-tests.ts new file mode 100644 index 0000000000..e27ec8e6d9 --- /dev/null +++ b/mocha/mocha-node-tests.ts @@ -0,0 +1,37 @@ +/// + +import MochaDef = require('mocha'); + +class CustomSpecReporter extends MochaDef.reporters.Spec { + constructor(runner: Mocha.IRunner) { + super(runner); + + runner.on('test', (test: Mocha.ITest) => { + console.log(test.parent.title + '/' + test.title); + }); + } +} + +class MyReporter extends MochaDef.reporters.Base { + passes: number = 0; + failures: number = 0; + + constructor(runner: Mocha.IRunner) { + super(runner); + + runner.on('pass', (test: Mocha.ITest) => { + this.passes++; + console.log('pass: %s', test.fullTitle()); + }); + + runner.on('fail', (test: Mocha.ITest, err: Error) => { + this.failures++; + console.log('fail: %s -- error: %s', test.fullTitle(), err.message); + }); + + runner.on('end', () => { + console.log('end: %d/%d', this.passes, this.passes + this.failures); + process.exit(this.failures); + }); + } +} diff --git a/mocha/mocha-node.d.ts b/mocha/mocha-node.d.ts new file mode 100644 index 0000000000..b0fa0a6ac7 --- /dev/null +++ b/mocha/mocha-node.d.ts @@ -0,0 +1,16 @@ +// Type definitions for mocha 2.2.5 +// Project: http://mochajs.org/ +// Definitions by: Vadim Macagon , vvakame +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module Mocha { + interface IRunnable extends NodeJS.EventEmitter { + } + interface ISuite extends NodeJS.EventEmitter { + } + interface IRunner extends NodeJS.EventEmitter { + } +} diff --git a/mocha/mocha-tests.ts b/mocha/mocha-tests.ts index a2e2b07961..f90fefaf96 100644 --- a/mocha/mocha-tests.ts +++ b/mocha/mocha-tests.ts @@ -249,37 +249,3 @@ function test_run_withOnComplete() { console.log(failures); }); } - -class CustomSpecReporter extends MochaDef.reporters.Spec { - constructor(runner: Mocha.IRunner) { - super(runner); - - runner.on('test', (test: Mocha.ITest) => { - console.log(test.parent.title + '/' + test.title); - }); - } -} - -class MyReporter extends MochaDef.reporters.Base { - passes: number = 0; - failures: number = 0; - - constructor(runner: Mocha.IRunner) { - super(runner); - - runner.on('pass', (test: Mocha.ITest) => { - this.passes++; - console.log('pass: %s', test.fullTitle()); - }); - - runner.on('fail', (test: Mocha.ITest, err: Error) => { - this.failures++; - console.log('fail: %s -- error: %s', test.fullTitle(), err.message); - }); - - runner.on('end', () => { - console.log('end: %d/%d', this.passes, this.passes + this.failures); - process.exit(this.failures); - }); - } -} diff --git a/mocha/mocha.d.ts b/mocha/mocha.d.ts index fefd919466..e3484bd72c 100644 --- a/mocha/mocha.d.ts +++ b/mocha/mocha.d.ts @@ -3,8 +3,6 @@ // Definitions by: Kazi Manzur Rashid , otiai10 , jt000 , Vadim Macagon // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// - interface MochaSetupOptions { //milliseconds to wait before considering a test slow slow?: number; @@ -30,7 +28,7 @@ interface MochaSetupOptions { // grep string or regexp to filter tests with grep?: any; } - + interface MochaDone { (error?: Error): void; } @@ -118,7 +116,7 @@ declare class Mocha { // merge the Mocha class declaration with a module declare module Mocha { /** Partial interface for Mocha's `Runnable` class. */ - interface IRunnable extends NodeJS.EventEmitter { + interface IRunnable { title: string; fn: Function; async: boolean; @@ -127,10 +125,10 @@ declare module Mocha { } /** Partial interface for Mocha's `Suite` class. */ - interface ISuite extends NodeJS.EventEmitter { + interface ISuite { parent: ISuite; title: string; - + fullTitle(): string; } @@ -138,12 +136,12 @@ declare module Mocha { interface ITest extends IRunnable { parent: ISuite; pending: boolean; - + fullTitle(): string; } /** Partial interface for Mocha's `Runner` class. */ - interface IRunner extends NodeJS.EventEmitter {} + interface IRunner {} interface IContextDefinition { (description: string, spec: () => void): ISuite; @@ -151,7 +149,7 @@ declare module Mocha { skip(description: string, spec: () => void): void; timeout(ms: number): void; } - + interface ITestDefinition { (expectation: string, assertion?: () => void): ITest; (expectation: string, assertion?: (done: MochaDone) => void): ITest; @@ -174,7 +172,7 @@ declare module Mocha { constructor(runner: IRunner); } - + export class Doc extends Base {} export class Dot extends Base {} export class HTML extends Base {} From 7bf24210432d20a4e52ab0975fe3afd2d1edadbe Mon Sep 17 00:00:00 2001 From: vvakame Date: Tue, 23 Jun 2015 22:00:50 +0900 Subject: [PATCH 0226/2220] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 125 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 101 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a41d225ecc..d0567940a8 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -12,7 +12,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](amcharts/AmCharts.d.ts) [amCharts](http://www.amcharts.com) by [aleksey-bykov](https://github.com/aleksey-bykov) * [:link:](amplifyjs/amplifyjs.d.ts) [AmplifyJs](http://amplifyjs.com) by [Jonas Eriksson](https://github.com/joeriks) * [:link:](amqp-rpc/amqp-rpc.d.ts) [amqp-rpc](https://github.com/demchenkoe/node-amqp-rpc) by [Wonshik Kim](https://github.com/wokim) -* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/angular-file-upload) by [John Reilly](https://github.com/johnnyreilly) +* [:link:](angular2/angular2.d.ts) [Angular](http://angular.io) by [angular team](https://github.com/angular) +* [:link:](angular-file-upload/angular-file-upload.d.ts) [Angular File Upload](https://github.com/danialfarid/ng-file-upload) by [John Reilly](https://github.com/johnnyreilly) * [:link:](angular-growl-v2/angular-growl-v2.d.ts) [Angular Growl 2 v.0.7.3](http://janstevens.github.io/angular-growl-2) by [Tadeusz Hucal](https://github.com/mkp05) * [:link:](angularjs/angular.d.ts) [Angular JS](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) * [:link:](angularjs/angular-animate.d.ts) [Angular JS (ngAnimate module)](http://angularjs.org) by [Michel Salib](https://github.com/michelsalib), [Adi Dahiya](https://github.com/adidahiya), [Raphael Schweizer](https://github.com/rasch) @@ -22,6 +23,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angularjs/angular-route.d.ts) [Angular JS (ngRoute module)](http://angularjs.org) by [Jonathan Park](https://github.com/park9140) * [:link:](angularjs/angular-sanitize.d.ts) [Angular JS (ngSanitize module)](http://angularjs.org) by [Diego Vilar](http://github.com/diegovilar) * [:link:](angular-ui-router/angular-ui-router.d.ts) [Angular JS (ui.router module)](https://github.com/angular-ui/ui-router) by [Michel Salib](https://github.com/michelsalib) +* [:link:](angular-meteor/angular-meteor.d.ts) [Angular JS Meteor (angular.meteor module)](https://github.com/Urigo/angular-meteor) by [Peter Grman](https://github.com/pgrm) * [:link:](angular-material/angular-material.d.ts) [Angular Material (angular.material module)](https://github.com/angular/material) by [Matt Traynham](https://github.com/mtraynham) * [:link:](angular-protractor/angular-protractor.d.ts) [Angular Protractor](https://github.com/angular/protractor) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](angular-scenario/angular-scenario.d.ts) [Angular Scenario Testing (ngScenario module)](http://angularjs.org) by [RomanoLindano](https://github.com/RomanoLindano) @@ -29,15 +31,20 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](angular-ui-bootstrap/angular-ui-bootstrap.d.ts) [Angular UI Bootstrap](https://github.com/angular-ui/bootstrap) by [Brian Surowiec](https://github.com/xt0rted) * [:link:](angular-wizard/angular-wizard.d.ts) [Angular Wizard](https://github.com/mgonto/angular-wizard) by [Marko Jurisic](https://github.com/mjurisic) * [:link:](angular-bootstrap-lightbox/angular-bootstrap-lightbox.d.ts) [angular-bootstrap-lightbox](https://github.com/compact/angular-bootstrap-lightbox) by [Roland Zwaga](https://github.com/rolandzwaga) +* [:link:](angular-dynamic-locale/angular-dynamic-locale.d.ts) [angular-dynamic-locale](https://github.com/lgalfaso/angular-dynamic-locale) by [Stephen Lautier](https://github.com/stephenlautier) * [:link:](angular-hotkeys/angular-hotkeys.d.ts) [angular-hotkeys](https://github.com/chieffancypants/angular-hotkeys) by [Jason Zhao](https://github.com/jlz27), [Stefan Steinhart](https://github.com/reppners) * [:link:](angular-http-auth/angular-http-auth.d.ts) [angular-http-auth](https://github.com/witoldsz/angular-http-auth) by [vvakame](https://github.com/vvakame) +* [:link:](angular-jwt/angular-jwt.d.ts) [angular-jwt](https://github.com/auth0/angular-jwt) by [Reto Rezzonico](https://github.com/rerezz) * [:link:](angular-local-storage/angular-local-storage.d.ts) [angular-local-storage](https://github.com/grevory/angular-local-storage) by [Ken Fukuyama](https://github.com/kenfdev) +* [:link:](angular-localForage/angular-localForage.d.ts) [angular-localForage](https://github.com/ocombe/angular-localForage) by [Stefan Steinhart](https://github.com/reppners) * [:link:](angular-notify/angular-notify.d.ts) [angular-notify](https://github.com/cgross/angular-notify) by [Suwato](https://github.com/Suwato/DefinitelyTyped) * [:link:](angular-scroll/angular-scroll.d.ts) [angular-scroll](https://github.com/oblador/angular-scroll) by [Sam Herrmann](https://github.com/samherrmann) * [:link:](angular-spinner/angular-spinner.d.ts) [angular-spinner.js](https://github.com/urish/angular-spinner) by [Marcin BiegaÅ‚a](https://github.com/Biegal) +* [:link:](angular-storage/angular-storage.d.ts) [angular-storage](https://github.com/auth0/angular-storage) by [Matthew DeKrey](https://github.com/mdekrey) * [:link:](angular-ui-sortable/angular-ui-sortable.d.ts) [angular.ui.sortable module](https://github.com/angular-ui/ui-sortable) by [Thodoris Greasidis](https://github.com/thgreasi) * [:link:](angular-agility/angular-agility.d.ts) [AngularAgility](https://github.com/AngularAgility/AngularAgility) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](angularfire/angularfire.d.ts) [AngularFire](http://angularfire.com) by [Dénes Harmath](http://github.com/thSoft) +* [:link:](angularjs-toaster/angularjs-toaster.d.ts) [angularjs-toaster](https://github.com/jirikavi/AngularJS-Toaster) by [Ben Tesser](https://github.com/btesser) * [:link:](angularLocalStorage/angularLocalStorage.d.ts) [AngularLocalStorage](https://github.com/agrublev/angularLocalStorage) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](animation-frame/animation-frame.d.ts) [animation-frame](https://github.com/kof/animation-frame) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](ansi-styles/ansi-styles.d.ts) [ansi-styles](https://github.com/sindresorhus/ansi-styles) by [bryn austin bellomy](https://github.com/brynbellomy) @@ -48,6 +55,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](cordova-plugin-email-composer/cordova-plugin-email-composer.d.ts) [Apache Cordova Email Composer plugin](https://github.com/katzer/cordova-plugin-email-composer) by [Dave Taylor](http://davetayls.me) * [:link:](polymer/polymer.app-router.d.ts) [app-router](https://github.com/erikringsmuth/app-router) by [Louis Grignon](https://github.com/lgrignon) * [:link:](appframework/appframework.d.ts) [AppFramework](http://app-framework-software.intel.com) by [kyo_ago](https://github.com/kyo-ago) +* [:link:](applicationinsights/applicationinsights.d.ts) [Application Insights](https://github.com/Microsoft/ApplicationInsights-node.js) by [Scott Southwood](https://github.com/scsouthw) * [:link:](arbiter/Arbiter.d.ts) [Arbiter.js](http://arbiterjs.com) by [Arash Shakery](https://github.com/arash16) * [:link:](arcgis-js-api/arcgis-js-api.d.ts) [ArcGIS API for JavaScript](http://js.arcgis.com) by [Esri](http://www.esri.com) * [:link:](archy/archy.d.ts) [archy](https://github.com/substack/node-archy) by [vvakame](https://github.com/vvakame) @@ -55,7 +63,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](aspnet-identity-pw/aspnet-identity-pw.d.ts) [aspnet-identity-pw](https://github.com/Syncbak-Git/aspnet-identity-pw) by [jt000](https://github.com/jt000) * [:link:](assert/assert.d.ts) [assert and power-assert](https://github.com/Jxck/assert) by [vvakame](https://github.com/vvakame) * [:link:](assertion-error/assertion-error.d.ts) [assertion-error](https://github.com/chaijs/assertion-error) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](async/async.d.ts) [Async](https://github.com/caolan/async) by [Boris Yankov](https://github.com/borisyankov), [Arseniy Maximov](https://github.com/kern0) * [:link:](asyncblock/asyncblock.d.ts) [asyncblock](https://github.com/scriby/asyncblock) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](atmosphere/atmosphere.d.ts) [Atmosphere](https://github.com/Atmosphere/atmosphere-javascript) by [Kai Toedter](https://github.com/toedter) * [:link:](atom/atom.d.ts) [Atom](https://atom.io) by [vvakame](https://github.com/vvakame) @@ -65,6 +73,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](auth0.lock/auth0.lock.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](auth0.widget/auth0.widget.d.ts) [Auth0Widget.js](http://auth0.com) by [Robert McLaws](https://github.com/advancedrei) * [:link:](autobahn/autobahn.d.ts) [AutobahnJS](http://autobahn.ws/js) by [Elad Zelingher](https://github.com/darkl) +* [:link:](autoprefixer-core/autoprefixer-core.d.ts) [Autoprefixer Core](https://github.com/postcss/autoprefixer-core) by [Asana](https://asana.com) * [:link:](aws-sdk/aws-sdk.d.ts) [aws-sdk](https://github.com/aws/aws-sdk-js) by [midknight41](https://github.com/midknight41) * [:link:](axios/axios.d.ts) [axios](https://github.com/mzabriskie/axios) by [Marcel Buesing](https://github.com/marcelbuesing) * [:link:](node-azure/azure.d.ts) [Azure SDK for Node](https://github.com/WindowsAzure/azure-sdk-for-node) by [Andrew Gaspar](https://github.com/AndrewGaspar), [Anti Veeranna](https://github.com/antiveeranna), [Maxime LUCE](https://github.com/SomaticIT) @@ -90,10 +99,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts) [Bootstrap datetimepicker v3](http://eonasdan.github.io/bootstrap-datetimepicker) by [Jesica N. Fera](https://github.com/bayitajesi) * [:link:](bootstrap-touchspin/bootstrap-touchspin.d.ts) [Bootstrap TouchSpin](http://www.virtuosoft.eu/code/bootstrap-touchspin) by [Albin Sunnanbo](https://github.com/albinsunnanbo) * [:link:](bootstrap-notify/bootstrap-notify.d.ts) [bootstrap-notify](https://github.com/Nijikokun/bootstrap-notify) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](bootstrap-slider/bootstrap-slider.d.ts) [bootstrap-slider.js](https://github.com/seiyria/bootstrap-slider) by [Daniel Beckwith](https://github.com/dbeckwith) * [:link:](bootstrap.datepicker/bootstrap.datepicker.d.ts) [bootstrap.datepicker](https://github.com/eternicode/bootstrap-datepicker) by [Boris Yankov](https://github.com/borisyankov) * [:link:](bootstrap.paginator/bootstrap.paginator.d.ts) [bootstrap.paginator](https://github.com/lyonlai/bootstrap-paginator) by [derikwhittaker](https://github.com/derikwhittaker) -* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) * [:link:](box2d/box2dweb.d.ts) [bootstrap.timepicker](http://code.google.com/p/box2dweb) by [jbaldwin](https://github.com/jbaldwin) +* [:link:](bootstrap.timepicker/bootstrap.timepicker.d.ts) [bootstrap.timepicker](https://github.com/jdewit/bootstrap-timepicker) by [derikwhittaker](https://github.com/derikwhittaker) * [:link:](breeze/breeze.d.ts) [Breeze 1.5.x](http://www.breezejs.com) by [Boris Yankov](https://github.com/borisyankov), [IdeaBlade](https://github.com/IdeaBlade/Breeze) * [:link:](browser-harness/browser-harness.d.ts) [Browser Harness](https://github.com/scriby/browser-harness) by [Chris Scribner](https://github.com/scriby) * [:link:](browser-sync/browser-sync.d.ts) [browser-sync](http://www.browsersync.io) by [Asana](https://asana.com) @@ -103,28 +113,31 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bl/bl.d.ts) [BufferList](https://github.com/rvagg/bl) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](buffers/buffers.d.ts) [buffers](https://github.com/substack/node-buffers) by [Robert Hencke](https://github.com/rhencke) * [:link:](bufferstream/bufferstream.d.ts) [bufferstream](https://github.com/dodo/node-bufferstream) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen) +* [:link:](bunyan-prettystream/bunyan-prettystream.d.ts) [bunyan-prettystream](https://www.npmjs.com/package/bunyan-prettystream) by [Jason Swearingen](https://github.com/jasonswearingen), [Vadim Macagon](https://github.com/enlight) * [:link:](business-rules-engine/business-rules-engine.d.ts) [business-rules-engine](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) * [:link:](byline/byline.d.ts) [byline](https://github.com/jahewson/node-byline) by [Stefan Steinhart](https://github.com/reppners) * [:link:](calq/calq.d.ts) [calq](https://calq.io/docs/client/javascript/reference) by [Eirik Hoem](https://github.com/eirikhm) * [:link:](camljs/camljs.d.ts) [camljs](http://camljs.codeplex.com) by [Andrey Markeev](http://markeev.com) * [:link:](canvasjs/canvasjs.d.ts) [CanvasJS](http://canvasjs.com) by [Mark Overholt](https://github.com/mover5) * [:link:](casperjs/casperjs.d.ts) [CasperJS](http://casperjs.org) by [Jed Mao](https://github.com/jedmao) -* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](chai/chai.d.ts) [chai](http://chaijs.com) by [Jed Mao](https://github.com/jedmao), [Bart van der Schoor](https://github.com/Bartvds), [Andrew Brown](https://github.com/AGBrown) * [:link:](chai-as-promised/chai-as-promised.d.ts) [chai-as-promised](https://github.com/domenic/chai-as-promised) by [jt000](https://github.com/jt000) * [:link:](chai-datetime/chai-datetime.d.ts) [chai-datetime](https://github.com/gaslight/chai-datetime.git) by [Cliff Burger](https://github.com/cliffburger) * [:link:](chai-fuzzy/chai-fuzzy.d.ts) [chai-fuzzy](http://chaijs.com/plugins/chai-fuzzy) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chai-http/chai-http.d.ts) [chai-http](https://github.com/chaijs/chai-http) by [Wim Looman](https://github.com/Nemo157) * [:link:](chai-jquery/chai-jquery.d.ts) [chai-jquery](https://github.com/chaijs/chai-jquery) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) +* [:link:](chai-subset/chai-subset.d.ts) [chai-subset](https://github.com/e-conomic/chai-subset) by [Sam Noedel](https://github.com/delta62), [Andrew Brown](https://github.com/AGBrown) * [:link:](chalk/chalk.d.ts) [chalk](https://github.com/sindresorhus/chalk) by [Diullei Gomes](https://github.com/Diullei), [Bart van der Schoor](https://github.com/Bartvds) * [:link:](chance/chance.d.ts) [Chance](http://chancejs.com) by [Chris Bowdon](https://github.com/cbowdon) * [:link:](change-case/change-case.d.ts) [change-case](https://github.com/blakeembrey/change-case) by [Asana](https://asana.com) * [:link:](chartjs/chart.d.ts) [Chart.js](https://github.com/nnnick/Chart.js) by [Steve Fenton](https://github.com/Steve-Fenton) * [:link:](checksum/checksum.d.ts) [checksum](https://github.com/dshaw/checksum) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](cheerio/cheerio.d.ts) [Cheerio](https://github.com/cheeriojs/cheerio) by [Bret Little](https://github.com/blittle), [VILIC VANE](http://vilic.info), [Wayne Maurer](https://github.com/wmaurer) +* [:link:](chocolatechipjs/chocolatechipjs.d.ts) [chocolatechip](https://github.com/chocolatechipui/ChocolateChipJS) by [Robert Biggs](http://chocolatechip-ui.com) * [:link:](chokidar/chokidar.d.ts) [chokidar](https://github.com/paulmillr/chokidar) by [Stefan Steinhart](https://github.com/reppners) * [:link:](chosen/chosen.jquery.d.ts) [Chosen.JQuery](http://harvesthq.github.com/chosen) by [Boris Yankov](https://github.com/borisyankov) * [:link:](chroma-js/chroma-js.d.ts) [Chroma.js](https://github.com/gka/chroma.js) by [Sebastian Brückner](https://github.com/invliD) +* [:link:](chrome/chrome-cast.d.ts) [Chrome Cast application development](https://developers.google.com/cast) by [Thomas Stig Jacobsen](https://github.com/eXeDK) * [:link:](chrome/chrome.d.ts) [Chrome extension development](http://developer.chrome.com/extensions) by [Matthew Kimber](https://github.com/matthewkimber), [otiai10](https://github.com/otiai10) * [:link:](chrome/chrome-app.d.ts) [Chrome packaged application development](http://developer.chrome.com/apps) by [Adam Lay](https://github.com/AdamLay), [MIZUNE Pine](https://github.com/pine613), [MIZUSHIMA Junki](https://github.com/mzsm) * [:link:](circular-json/circular-json.d.ts) [circular-json](https://github.com/WebReflection/circular-json) by [Jonathan Pevarnek](https://github.com/jpevarnek) @@ -160,11 +173,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](csv-stringify/csv-stringify.d.ts) [csv-stringify](https://github.com/wdavidw/node-csv-stringify) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](custom-error-generator/custom-error-generator.d.ts) [custom-error-generator](https://github.com/jproulx/node-custom-error) by [Thierry Miceli](https://github.com/thmiceli) * [:link:](md5/md5.d.ts) [CybozuLabs.MD5](http://labs.cybozu.co.jp/blog/mitsunari/2007/07/md5js_1.html) by [MIZUNE Pine](https://github.com/pine613) -* [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](d3/d3.d.ts) [d3JS](http://d3js.org) by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov) * [:link:](d3.cloud.layout/d3.cloud.layout.d.ts) [d3JS cloud layout plugin by Jason Davies](https://github.com/jasondavies/d3-cloud) by [hans windhoff](https://github.com/hansrwindhoff) * [:link:](dagre/dagre.d.ts) [dagre](https://github.com/cpettitt/dagre) by [Qinfeng Chen](https://github.com/qinfchen) * [:link:](dagre-d3/dagre-d3.d.ts) [dagre-d3.core.js](https://github.com/cpettitt/dagre-d3) by [Mark Wong Siang Kai](https://github.com/markwongsk) * [:link:](dat-gui/dat-gui.d.ts) [dat.GUI](https://github.com/dataarts/dat.gui) by [Satoru Kimura](https://github.com/gyohk) +* [:link:](DataStream.js/DataStream.js.d.ts) [DataStream.js](https://github.com/kig/DataStream.js) by [Tat](https://github.com/tatchx) * [:link:](date.format.js/date.format.d.ts) [Date Format](http://blog.stevenlevithan.com/archives/date-time-format) by [Rob Stutton](https://github.com/balrob) * [:link:](datejs/datejs.d.ts) [DateJS](http://www.datejs.com) by [David Khristepher Santos](http://github.com/rupertavery) * [:link:](dcjs/dc.d.ts) [DCJS](https://github.com/dc-js/dc.js) by [hans windhoff](https://github.com/hansrwindhoff), [matt traynham](https://github.com/mtraynham) @@ -183,7 +197,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](diff/diff.d.ts) [diff](https://github.com/kpdecker/jsdiff) by [vvakame](https://github.com/vvakame) * [:link:](docCookies/docCookies.d.ts) [docCookies](https://developer.mozilla.org/en-US/docs/Web/API/document.cookie) by [Jon Egerton](https://github.com/jonegerton) * [:link:](dock-spawn/dock-spawn.d.ts) [Dock Spawn](http://dockspawn.com) by [Drew Noakes](https://drewnoakes.com) -* [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams) +* [:link:](documentdb/documentdb.d.ts) [DocumentDB](https://github.com/Azure/azure-documentdb-node) by [Noel Abrahams](https://github.com/NoelAbrahams), [Brett Gutstein](https://github.com/brettferdosi) * [:link:](dojo/dojo.d.ts) [Dojo](http://dojotoolkit.org) by [Michael Van Sickle](https://github.com/vansimke) * [:link:](dompurify/dompurify.d.ts) [DOM Purify](https://github.com/cure53/DOMPurify) by [Dave Taylor](http://davetayls.me) * [:link:](domo/domo.d.ts) [Domo](http://domo-js.com) by [Steve Fenton](https://github.com/Steve-Fenton) @@ -198,6 +212,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](dsv/dsv.d.ts) [dsv](https://www.npmjs.com/package/dsv) by [Jason Swearingen](https://jasonswearingen.github.io) * [:link:](dts-bundle/dts-bundle.d.ts) [dts-bundle](https://github.com/TypeStrong/dts-bundle) by [Asana](https://asana.com) * [:link:](durandal/durandal.d.ts) [Durandal](http://durandaljs.com) by [Blue Spire](https://github.com/BlueSpire) +* [:link:](dymo-label-framework/dymo-label-framework.d.ts) [DYMO Label Framework](http://www.labelwriter.com/software/dls/sdk/docs/DYMOLabelFrameworkJavaScriptHelp/index.html) by [Thijs Kuipers](https://github.com/thijskuipers) * [:link:](easeljs/easeljs.d.ts) [EaselJS](http://www.createjs.com/#!/EaselJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) * [:link:](easy-session/easy-session.d.ts) [easy-session](https://github.com/DeadAlready/node-easy-session) by [Karl Düüna](https://github.com/DeadAlready) * [:link:](easy-table/easy-table.d.ts) [easy-table](https://github.com/eldargab/easy-table) by [Bart van der Schoor](https://github.com/Bartvds) @@ -205,6 +220,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](egg.js/egg.js.d.ts) [Egg.js](https://github.com/mikeflynn/egg.js) by [Markus Peloso](https://github.com/ToastHawaii) * [:link:](ejs-locals/ejs-locals.d.ts) [ejs-locals](https://github.com/randometc/ejs-locals) by [jt000](https://github.com/jt000) * [:link:](jquery.elang/jquery.elang.d.ts) [eLang](https://github.com/sumegizoltan/ELang) by [Zoltan Sumegi](https://github.com/sumegizoltan) +* [:link:](github-electron/github-electron.d.ts) [Electron (shared between main and rederer processes)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) * [:link:](element-resize-event/element-resize-event.d.ts) [element-resize-event](https://github.com/KyleAMathews/element-resize-event) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](elm/elm.d.ts) [Elm](http://elm-lang.org) by [Dénes Harmath](https://github.com/thSoft) * [:link:](ember/ember.d.ts) [Ember.js](http://emberjs.com) by [Jed Mao](https://github.com/jedmao) @@ -234,9 +250,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](extend/extend.d.ts) [extend](https://www.npmjs.com/package/extend) by [Stefan Steinhart](https://github.com/reppners) * [:link:](extjs/ExtJS.d.ts) [ExtJS](http://www.sencha.com/products/extjs) by [Brian Kotek](https://github.com/brian428) * [:link:](eyes/eyes.d.ts) [eyes](https://github.com/cloudhead/eyes.js) by [bryn austin bellomy](https://github.com/brynbellomy) -* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic) +* [:link:](fabricjs/fabricjs.d.ts) [FabricJS](http://fabricjs.com) by [Oliver Klemencic](https://github.com/oklemencic), [Joseph Livecchi](https://github.com/joewashear007) * [:link:](fbsdk/fbsdk.d.ts) [Facebook Javascript SDK](https://developers.facebook.com/docs/javascript) by [Joshua Strobl](https://github.com/JoshStrobl) * [:link:](fancybox/fancybox.d.ts) [fancyBox](https://github.com/fancyapps/fancyBox) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](farbtastic/farbtastic.d.ts) [Farbtastic: jQuery Color Wheel](http://mattfarina.github.io/farbtastic) by [Matt Brooks](https://github.com/EnableSoftware) * [:link:](fast-stats/fast-stats.d.ts) [fast-stats](https://github.com/bluesmoon/node-faststats) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](fastclick/fastclick.d.ts) [FastClick](https://github.com/ftlabs/fastclick) by [Shinnosuke Watanabe](https://github.com/shinnn) * [:link:](whatwg-fetch/whatwg-fetch.d.ts) [fetch API](https://github.com/github/fetch) by [Ryan Graham](https://github.com/ryan-codingintrigue) @@ -257,6 +274,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](flux/flux.d.ts) [Flux](http://facebook.github.io/flux) by [Steve Baker](https://github.com/stkb) * [:link:](fluxxor/fluxxor.d.ts) [Fluxxor](https://github.com/BinaryMuse/fluxxor) by [Yuichi Murata](https://github.com/mrk21) * [:link:](ion.rangeSlider/ion.rangeSlider.d.ts) [for Ion.RangeSlider](https://github.com/IonDen/ion.rangeSlider) by [Sixin Li](https://github.com/sixinli) +* [:link:](forge-di/forge-di.d.ts) [forge-di](https://github.com/nkohari/forge) by [Adam Carr](https://github.com/adamcarr) * [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157) * [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) @@ -287,10 +305,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](google.analytics/ga.d.ts) [Google Analytics (Classic and Universal)](https://developers.google.com/analytics/devguides/collection/gajs) by [Ronnie Haakon Hegelund](http://ronniehegelund.blogspot.dk), [Pat Kujawa](http://patkujawa.com) * [:link:](gapi/gapi.d.ts) [Google API Client](https://code.google.com/p/google-api-javascript-client) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.feeds/google.feed.api.d.ts) [Google Feed Apis](https://developers.google.com/feed) by [RodneyJT](https://github.com/RodneyJT) -* [:link:](googlemaps/google.maps.d.ts) [Google Geolocation](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk) * [:link:](google.geolocation/google.geolocation.d.ts) [Google Geolocation](https://code.google.com/p/geo-location-javascript) by [Vincent Bortone](https://github.com/vbortone) +* [:link:](googlemaps/google.maps.d.ts) [Google Maps JavaScript API](https://developers.google.com/maps) by [Folia A/S](http://www.folia.dk), [Chris Wrench](https://github.com/cgwrench) * [:link:](gapi.pagespeedonline/gapi.pagespeedonline.d.ts) [Google Page Speed Online Api](https://developers.google.com/speed/pagespeed) by [Frank M](https://github.com/sgtfrankieboy) * [:link:](google.picker/google.picker.d.ts) [Google Picker API](https://developers.google.com/picker) by [grapswiz](https://github.com/grapswiz) +* [:link:](google-drive-realtime-api/google-drive-realtime-api.d.ts) [Google Realtime API](https://developers.google.com/google-apps/realtime) by [Dustin Wehr](http://cs.toronto.edu/~wehr) * [:link:](recaptcha/recaptcha.d.ts) [Google Recaptcha](https://www.google.com/recaptcha) by [Brent Jenkins](https://github.com/brentj73) * [:link:](grecaptcha/grecaptcha.d.ts) [Google Recaptcha v2](https://www.google.com/recaptcha) by [Kristof Mattei](http://kristofmattei.be) * [:link:](gapi.translate/gapi.translate.d.ts) [Google Translate API](https://developers.google.com/translate) by [Frank M](https://github.com/sgtfrankieboy) @@ -302,8 +321,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](greensock/greensock.d.ts) [GreenSock Animation Platform](http://www.greensock.com/get-started-js) by [Robert S](https://github.com/codebelt) * [:link:](gridfs-stream/gridfs-stream.d.ts) [gridfs-stream](https://github.com/aheckmann/gridfs-stream) by [Lior Mualem](https://github.com/liorm) * [:link:](gruntjs/gruntjs.d.ts) [Grunt 0.4.x](http://gruntjs.com) by [Jeff May](https://github.com/jeffmay), [Basarat Ali Syed](https://github.com/basarat) -* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/Core.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) +* [:link:](gsap/Ease.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gsap/TweenLite.d.ts) [GSAP](http://greensock.com) by [VILIC VANE](https://vilic.github.io) * [:link:](gulp/gulp.d.ts) [Gulp v3.8.x](http://gulpjs.com) by [Drew Noakes](https://drewnoakes.com) * [:link:](gulp-autoprefixer/gulp-autoprefixer.d.ts) [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) by [Asana](https://asana.com) @@ -329,9 +348,11 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](handlebars/handlebars.d.ts) [Handlebars](http://handlebarsjs.com) by [Boris Yankov](https://github.com/borisyankov) * [:link:](hapi/hapi.d.ts) [hapi](http://github.com/spumko/hapi) by [Jason Swearingen](http://github.com/jasonswearingen) * [:link:](hasher/hasher.d.ts) [Hasher.js](https://github.com/millermedeiros/hasher) by [flyfishMT](https://github.com/flyfishMT) +* [:link:](hashids/hashids.d.ts) [Hashids.js 1.x](https://github.com/ivanakimov/hashids.node.js) by [Paulo Cesar](https://github.com/pocesar) * [:link:](hashmap/hashmap.d.ts) [HashMap](https://github.com/flesler/hashmap) by [RafaÅ‚ Wrzeszcz](http://wrzasq.pl) * [:link:](he/he.d.ts) [he](https://github.com/mathiasbynens/he) by [Simon Edwards](https://github.com/sedwards2009) * [:link:](Headroom/headroom.d.ts) [headroom.js](http://wicky.nillia.ms/headroom.js) by [Jakub Olek](https://github.com/hakubo) +* [:link:](heap/heap.d.ts) [heap](https://github.com/qiao/heap.js) by [Ryan McNamara](https://github.com/ryan10132) * [:link:](heatmap.js/heatmap.d.ts) [heatmap.js](https://github.com/pa7/heatmap.js) by [Yang Guan](https://github.com/lookuptable) * [:link:](hellojs/hellojs.d.ts) [hello.js](http://adodson.com/hello.js) by [Pavel Zika](https://github.com/PavelPZ) * [:link:](highcharts/highcharts.d.ts) [Highcharts](http://www.highcharts.com) by [Damiano Gambarotto](http://github.com/damianog) @@ -348,21 +369,23 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](humane/humane.d.ts) [Humane](http://wavded.github.com/humane-js) by [jmvrbanac](https://github.com/jmvrbanac) * [:link:](hypertext-application-language/hypertext-application-language.d.ts) [Hypertext Application Language Draft 6](https://tools.ietf.org/html/draft-kelly-json-hal-06) by [Maks3w](https://github.com/maks3w) * [:link:](i18n-node/i18n-node.d.ts) [i18n-node](https://github.com/mashpie/i18n-node) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](i18next/i18next.d.ts) [i18next](http://i18next.com) by [Maarten Docter](https://github.com/mdocter) +* [:link:](ng-i18next/ng-i18next.d.ts) [i18next](https://github.com/i18next/ng-i18next) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](iban/iban.d.ts) [iban.js](https://github.com/arhs/iban.js) by [Cyril Schumacher](https://github.com/cyrilschumacher) * [:link:](icheck/icheck.d.ts) [iCheck](http://damirfoy.com/iCheck) by [Dániel Tar](https://github.com/qcz) * [:link:](imagemagick/imagemagick.d.ts) [imagemagick](http://github.com/rsms/node-imagemagick) by [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](imagemagick-native/imagemagick-native.d.ts) [imagemagick-native](https://www.npmjs.org/package/imagemagick-native) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](imap/imap.d.ts) [imap](https://www.npmjs.com/package/imap) by [Peter Snider](https://github.com/psnider) * [:link:](imgur-rest-api/imgur-rest-api.d.ts) [Imgur REST API v3](https://api.imgur.com) by [Luke William Westby](http://github.com/lukewestby) * [:link:](impress/impress.d.ts) [Impress.js](https://github.com/bartaz/impress.js) by [Boris Yankov](https://github.com/borisyankov) * [:link:](inflection/inflection.d.ts) [inflection](https://github.com/dreamerslab/node.inflection) by [Shogo Iwano](https://github.com/shiwano) * [:link:](ini/ini.d.ts) [ini](https://github.com/isaacs/ini) by [Marcin PorÄ™bski](https://github.com/marcinporebski) * [:link:](insight/insight.d.ts) [insight](https://github.com/yeoman/insight) by [vvakame](http://github.com/vvakame) -* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya) +* [:link:](interactjs/interact.d.ts) [Interacting for interact.js](https://github.com/taye/interact.js) by [Douglas Eichelberger](https://github.com/dduugg), [Adi Dahiya](https://github.com/adidahiya), [Tom Hasner](https://github.com/thasner) * [:link:](intercomjs/intercom.d.ts) [intercom.js](https://github.com/diy/intercom.js) by [spencerwi](http://github.com/spencerwi) * [:link:](inversify/inversify.d.ts) [inversify](https://github.com/inversify/InversifyJS) by [inversify](https://github.com/inversify) * [:link:](cordova-ionic/cordova-ionic.d.ts) [Ionic Cordova plugins](https://github.com/driftyco) by [Hendrik Maus](https://github.com/hendrikmaus) +* [:link:](irc/irc.d.ts) [irc](https://github.com/martynsmith/node-irc) by [phillips1012](https://github.com/phillips1012) * [:link:](is_js/is_js.d.ts) [is.js](http://arasatasaygin.github.io/is.js) by [Rodrigo Cabral](https://github.com/cabralRodrigo) * [:link:](iscroll/iscroll.d.ts) [iScroll](http://cubiq.org/iscroll-4) by [Boris Yankov](https://github.com/borisyankov), [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](iscroll/iscroll-5.d.ts) [iScroll 5](http://cubiq.org/iscroll-5-ready-for-beta-test) by [Christiaan Rakowski](https://github.com/csrakowski) @@ -373,6 +396,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jake/jake.d.ts) [jake](https://github.com/mde/jake) by [Kon](http://phyzkit.net) * [:link:](jasmine/jasmine.d.ts) [Jasmine](http://jasmine.github.io) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb), [David Pärsson](https://github.com/davidparsson) * [:link:](jasmine-data_driven_tests/jasmine-data_driven_tests.d.ts) [Jasmine Data Driven Tests](https://github.com/gburghardt/jasmine-data_driven_tests) by [Anthony MacKinnon](https://github.com/AnthonyMacKinnon) +* [:link:](jasmine-ajax/jasmine-ajax.d.ts) [jasmine-ajax](https://github.com/jasmine/jasmine-ajax) by [Louis Grignon](https://github.com/lgrignon) * [:link:](jasmine-fixture/jasmine-fixture.d.ts) [Jasmine-fixture](https://github.com/searls/jasmine-fixture) by [Craig Brett](https://github.com/craigbrett17) * [:link:](jasmine-jquery/jasmine-jquery.d.ts) [Jasmine-JQuery](https://github.com/velesin/jasmine-jquery) by [Gregor Stamac](https://github.com/gstamac) * [:link:](jasmine-matchers/jasmine-matchers.d.ts) [jasmine-matchers](https://github.com/uxebu/jasmine-matchers) by [Bart van der Schoor](https://github.com/Bartvds) @@ -384,6 +408,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jest/jest.d.ts) [Jest](http://facebook.github.io/jest) by [Asana](https://asana.com) * [:link:](jjv/jjv.d.ts) [JJV](https://github.com/acornejo/jjv) by [Wim Looman](https://github.com/Nemo157) * [:link:](jjve/jjve.d.ts) [JJVE](https://github.com/silas/jjve) by [Wim Looman](https://github.com/Nemo157) +* [:link:](joData/joData.d.ts) [joData](https://github.com/mccow002/joData) by [Chris Wrench](https://github.com/cgwrench) * [:link:](johnny-five/johnny-five.d.ts) [johnny-five](https://github.com/rwaldron/johnny-five) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](joi/joi.d.ts) [joi](https://github.com/spumko/joi) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](jointjs/jointjs.d.ts) [Joint JS](http://www.jointjs.com) by [Aidan Reel](http://github.com/areel), [David Durman](http://github.com/DavidDurman), [Ewout Van Gossum](https://github.com/DenEwout) @@ -407,6 +432,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.rowGrid/jquery.rowGrid.d.ts) [jQuery rowGrid.js plugin (v1.0.2)](https://github.com/brunjo/rowGrid.js) by [Vinayak Garg](https://github.com/vinayak-garg) * [:link:](royalslider/royalslider.d.ts) [jQuery royal-slider](http://dimsemenov.com/plugins/royal-slider/documentation) by [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](jquery.simplePagination/jquery.simplePagination.d.ts) [jQuery simplePagination.js](https://github.com/flaviusmatis/simplePagination.js) by [Natan Vivo](https://github.com/nvivo) +* [:link:](jquery-sortable/jquery-sortable.d.ts) [jQuery Sortable](http://johnny.github.io/jquery-sortable) by [Nathan Pitman](https://github.com/Seltzer) +* [:link:](succinct/succinct.d.ts) [jQuery Succinct](http://mikeking.io/succinct) by [Matt Brooks](https://github.com/EnableSoftware) * [:link:](jquery.tagsmanager/jquery.tagsmanager.d.ts) [jQuery Tags Manager](http://welldonethings.com/tags/manager) by [Vincent Bortone](https://github.com/vbortone) * [:link:](jquery.tinycarousel/jquery.tinycarousel.d.ts) [jQuery tinycarousel](http://baijs.nl/tinycarousel) by [Christiaan Rakowski](https://github.com/csrakowski) * [:link:](jquery.tinyscrollbar/jquery.tinyscrollbar.d.ts) [jQuery tinyscrollbar](http://baijs.nl/tinyscrollbar) by [Christiaan Rakowski](https://github.com/csrakowski) @@ -439,7 +466,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.noty/jquery.noty.d.ts) [jQuery.noty](http://needim.github.io/noty) by [Aaron King](https://github.com/kingdango) * [:link:](jquery.payment/jquery.payment.d.ts) [jQuery.payment](https://github.com/stripe/jquery.payment) by [Eric J. Smith](https://github.com/ejsmith) * [:link:](jquery.pjax.falsandtru/jquery.pjax.d.ts) [jquery.pjax.ts by falsandtru](https://github.com/falsandtru/jquery.pjax.js) by [æ–°ã‚æœˆ NewNotMoon](http://new.not-moon.net) -* [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence) +* [:link:](jquery.placeholder/jquery.placeholder.d.ts) [jquery.placeholder.js](https://github.com/mathiasbynens/jquery-placeholder) by [Peter Gill](https://github.com/majorsilence), [Neil Culver](https://github.com/EnableSoftware) * [:link:](jquery.pnotify/jquery.pnotify.d.ts) [jquery.pnotify 2.x](https://github.com/sciactive/pnotify) by [David Sichau](https://github.com/DavidSichau) * [:link:](jquery.scrollTo/jquery.scrollTo.d.ts) [jQuery.scrollTo.js](https://github.com/flesler/jquery.scrollTo) by [Neil Stalker](https://github.com/nestalk) * [:link:](jquery.simulate/jquery.simulate.d.ts) [jquery.simulate.js](https://github.com/jquery/jquery-simulate) by [Derek Cicerone](https://github.com/derekcicerone) @@ -454,10 +481,13 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.timer/jquery.timer.d.ts) [jQueryTimer](https://github.com/jchavannes/jquery-timer) by [Joshua Strobl](https://github.com/JoshStrobl) * [:link:](jquery.total-storage/jquery.total-storage.d.ts) [jQueryTotalStorage](https://github.com/Upstatement/jquery-total-storage) by [Jeremy Brooks](https://github.com/JeremyCBrooks) * [:link:](jqueryui/jqueryui.d.ts) [jQueryUI](http://jqueryui.com) by [Boris Yankov](https://github.com/borisyankov), [John Reilly](https://github.com/johnnyreilly) +* [:link:](js-cookie/js-cookie.d.ts) [js-cookie](https://github.com/js-cookie/js-cookie) by [Theodore Brown](https://github.com/theodorejb) * [:link:](js-fixtures/fixtures.d.ts) [js-fixtures](https://github.com/badunk/js-fixtures) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid) * [:link:](js-git/js-git.d.ts) [js-git](https://github.com/creationix/js-git) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](js-signals/js-signals.d.ts) [JS-Signals](http://millermedeiros.github.io/js-signals) by [Diullei Gomes](https://github.com/diullei) * [:link:](js-yaml/js-yaml.d.ts) [js-yaml](https://github.com/nodeca/js-yaml) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](js-beautify/js-beautify.d.ts) [js_beautify](https://github.com/beautify-web/js-beautify) by [Josh Goldberg](https://github.com/JoshuaKGoldberg) +* [:link:](blocks/blocks.d.ts) [jsblocks](http://jsblocks.com) by [Krzysztof Åšmigiel](https://github.com/ksmigiel) * [:link:](jsbn/jsbn.d.ts) [jsbn](http://www-cs-students.stanford.edu/%7Etjw/jsbn) by [Eugene Chernyshov](https://github.com/Evgenus) * [:link:](jscrollpane/jscrollpane.d.ts) [jScrollPane](http://jscrollpane.kelvinluck.com) by [Dániel Tar](https://github.com/qcz) * [:link:](js-data/js-data.d.ts) [JSData](https://github.com/js-data/js-data) by [Stefan Steinhart](https://github.com/reppners) @@ -489,6 +519,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jwt-simple/jwt-simple.d.ts) [jwt-simple](https://github.com/hokaccha/node-jwt-simple) by [Ken Fukuyama](https://github.com/kenfdev) * [:link:](kafka-node/kafka-node.d.ts) [kafka-node](https://github.com/SOHU-Co/kafka-node) by [Daniel Imrie-Situnayake](https://github.com/dansitu) * [:link:](karma-jasmine/karma-jasmine.d.ts) [karma-jasmine plugin](https://github.com/karma-runner/karma-jasmine) by [Michel Salib](https://github.com/michelsalib) +* [:link:](kendo-ui/kendo-ui.d.ts) [Kendo UI Professional](http://www.telerik.com/kendo-ui) by [Telerik](https://github.com/telerik) * [:link:](keyboardjs/keyboardjs.d.ts) [KeyboardJS](https://github.com/RobertWHurst/KeyboardJS) by [Vincent Bortone](https://github.com/vbortone) * [:link:](keymaster/keymaster.d.ts) [keymaster](https://github.com/madrobby/keymaster) by [Martin W. Kirst](https://github.com/nitram509) * [:link:](keypress/keypress.d.ts) [Keypress](https://github.com/dmauro/Keypress) by [Roger Chen](https://github.com/rcchen) @@ -502,7 +533,9 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](knockout.amd.helpers/knockout-amd-helpers.d.ts) [knockout-amd-helpers](https://github.com/rniemeyer/knockout-amd-helpers) by [David Sichau](https://github.com/DavidSichau) * [:link:](knockout.editables/ko.editables.d.ts) [knockout-editables](http://romanych.github.com/ko.editables) by [Boris Yankov](https://github.com/borisyankov) * [:link:](knockout.es5/knockout.es5.d.ts) [Knockout-ES5](https://github.com/SteveSanderson/knockout-es5) by [Sebastián Galiano](https://github.com/sgaliano) +* [:link:](knockout-paging/knockout-paging.d.ts) [knockout-paging](https://github.com/ErikSchierboom/knockout-paging) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](knockout.postbox/knockout-postbox.d.ts) [knockout-postbox](https://github.com/rniemeyer/knockout-postbox) by [Judah Gabriel Himango](https://debuggerdotbreak.wordpress.com) +* [:link:](knockout-pre-rendered/knockout-pre-rendered.d.ts) [knockout-pre-rendered](https://github.com/ErikSchierboom/knockout-pre-rendered) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](knockout.projections/knockout.projections.d.ts) [knockout-projections](https://github.com/stevesanderson/knockout-projections) by [John Reilly](https://github.com/johnnyreilly) * [:link:](knockout-secure-binding/knockout-secure-binding.d.ts) [knockout-secure-binding](https://github.com/brianmhunt/knockout-secure-binding) by [Pine Mizune](https://github.com/pine613) * [:link:](knockout-transformations/knockout-transformations.d.ts) [knockout-transformations](https://github.com/One-com/knockout-transformations) by [John Reilly](https://github.com/johnnyreilly), [Wim Looman](https://github.com/Nemo157) @@ -536,14 +569,18 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](log4js/log4js.d.ts) [log4js](https://github.com/nomiddlename/log4js-node) by [Kentaro Okuno](http://github.com/armorik83) * [:link:](logg/logg.d.ts) [logg](https://github.com/dpup/node-logg) by [Bret Little](https://github.com/blittle) * [:link:](loggly/loggly.d.ts) [loggly](https://github.com/nodejitsu/node-loggly) by [Ray Martone](https://github.com/rmartone) +* [:link:](loglevel/loglevel.d.ts) [loglevel](https://github.com/pimterry/loglevel) by [Stefan Profanter](https://github.com/Pro) * [:link:](logrotate-stream/logrotate-stream.d.ts) [logrotate-stream](https://github.com/dstokes/logrotate-stream) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](lokijs/lokijs.d.ts) [lokijs](https://github.com/techfort/LokiJS) by [TeamworkGuy2](https://github.com/TeamworkGuy2) * [:link:](lolex/lolex.d.ts) [lolex](https://github.com/sinonjs/lolex) by [Wim Looman](https://github.com/Nemo157) * [:link:](long/long.d.ts) [Long.js](https://github.com/dcodeIO/Long.js) by [Toshihide Hara](https://github.com/kerug) * [:link:](lory.js/lory.js.d.ts) [lory](https://github.com/meandmax/lory) by [kubosho](https://github.com/kubosho) +* [:link:](lovefield/lovefield.d.ts) [Lovefield](http://google.github.io/lovefield) by [freshp86](https://github.com/freshp86) * [:link:](lru-cache/lru-cache.d.ts) [lru-cache](https://github.com/isaacs/node-lru-cache) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](lscache/lscache.d.ts) [lscache](https://github.com/pamelafox/lscache) by [Chris Martinez](https://github.com/Chris-Martinezz) * [:link:](lunr/lunr.d.ts) [lunr.js](https://github.com/olivernn/lunr.js) by [Sebastian Lenz](https://github.com/sebastian-lenz) * [:link:](lz-string/lz-string.d.ts) [lz-string](https://github.com/pieroxy/lz-string) by [Roman Nikitin](https://github.com/M0ns1gn0r) +* [:link:](magicsuggest/magicsuggest.d.ts) [MagicSuggest](http://nicolasbize.com/magicsuggest) by [Leonardo Chaia](http://github.com/leonardochaia) * [:link:](mailcheck/mailcheck.d.ts) [Mailcheck](https://github.com/mailcheck/mailcheck) by [Paulo Cesar](http://github.com/pocesar) * [:link:](main-bower-files/main-bower-files.d.ts) [main-bower-files](https://github.com/ck86/main-bower-files) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](mandrill-api/mandrill-api.d.ts) [Mandrill API 1.x](http://mandrill.com) by [Paulo Cesar](https://github.com/pocesar) @@ -552,6 +589,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mariasql/mariasql.d.ts) [mariasql](https://github.com/mscdex/node-mariasql) by [MichaelBennett](https://github.com/bennett000) * [:link:](marionette/marionette.d.ts) [Marionette](https://github.com/marionettejs) by [Zeeshan Hamid](https://github.com/zhamid), [Natan Vivo](https://github.com/nvivo), [Sven Tschui](https://github.com/sventschui) * [:link:](marked/marked.d.ts) [Marked](https://github.com/chjj/marked) by [William Orr](https://github.com/worr) +* [:link:](markerclustererplus/markerclustererplus.d.ts) [MarkerClustererPlus for Google Maps V3](http://github.com/mahnunchik/markerclustererplus) by [Mathias Rodriguez](http://github.com/enanox) * [:link:](maskedinput/maskedinput.d.ts) [Masked Input plugin for jQuery](http://digitalbush.com/projects/masked-input-plugin) by [Lokesh Peta](https://github.com/lokeshpeta) * [:link:](mathjax/mathjax.d.ts) [MathJax](https://github.com/mathjax/MathJax) by [Roland Zwaga](https://github.com/rolandzwaga) * [:link:](matter-js/matter-js.d.ts) [Matter.js](https://github.com/liabru/matter-js) by [Ivane Gegia](https://twitter.com/ivanegegia) @@ -586,28 +624,33 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](mixto/mixto.d.ts) [mixto](https://github.com/atom/mixto) by [vvakame](https://github.com/vvakame) * [:link:](mkdirp/mkdirp.d.ts) [mkdirp](http://github.com/substack/node-mkdirp) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](mkpath/mkpath.d.ts) [mkpath](https://www.npmjs.com/package/mkpath) by [Jared Klopper](https://github.com/optical) -* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000) +* [:link:](mobile-detect/mobile-detect.d.ts) [mobile-detect](http://hgoebl.github.io/mobile-detect.js) by [Martin McWhorter](https://github.com/martinmcwhorter) +* [:link:](mocha/mocha.d.ts) [mocha](http://mochajs.org) by [Kazi Manzur Rashid](https://github.com/kazimanzurrashid), [otiai10](https://github.com/otiai10), [jt000](https://github.com/jt000), [Vadim Macagon](https://github.com/enlight) * [:link:](mocha-phantomjs/mocha-phantomjs.d.ts) [mocha-phantomjs](http://metaskills.net/mocha-phantomjs) by [Erik Schierboom](https://github.com/ErikSchierboom) * [:link:](mock-fs/mock-fs.d.ts) [mock-fs](https://github.com/tschaub/mock-fs) by [Wim Looman](https://github.com/Nemo157) * [:link:](mockery/mockery.d.ts) [mockery](https://github.com/mfncooper/mockery) by [jt000](https://github.com/jt000) * [:link:](modernizr/modernizr.d.ts) [Modernizr](http://modernizr.com) by [Boris Yankov](https://github.com/borisyankov), [Theodore Brown](https://github.com/theodorejb) * [:link:](moment-timezone/moment-timezone.d.ts) [moment-timezone.js](http://momentjs.com/timezone) by [Michel Salib](https://github.com/michelsalib) +* [:link:](moment/moment-node.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya) * [:link:](moment/moment.d.ts) [Moment.js](https://github.com/timrwood/moment) by [Michael Lakerveld](https://github.com/Lakerfield), [Aaron King](https://github.com/kingdango), [Hiroki Horiuchi](https://github.com/horiuchi), [Dick van den Brink](https://github.com/DickvdBrink), [Adi Dahiya](https://github.com/adidahiya) * [:link:](mongodb/mongodb.d.ts) [MongoDB](https://github.com/mongodb/node-mongodb-native) by [Boris Yankov](https://github.com/borisyankov) * [:link:](mongoose/mongoose.d.ts) [Mongoose](http://mongoosejs.com) by [horiuchi](https://github.com/horiuchi) * [:link:](mongoose-mock/mongoose-mock.d.ts) [mongoose-mock](https://github.com/JohanObrink/mongoose-mock) by [jt000](https://github.com/jt000) * [:link:](morgan/morgan.d.ts) [morgan](https://github.com/expressjs/morgan) by [James Roland Cabresos](https://github.com/staticfunction) -* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz) * [:link:](mousetrap/mousetrap-global-bind.d.ts) [Mousetrap 1.4.6's global-bind extension](http://craig.is/killing/mice#extensions.global) by [Andrew Bradley](https://github.com/cspotcode) +* [:link:](mousetrap/mousetrap.d.ts) [Mousetrap 1.5.x](http://craig.is/killing/mice) by [Dániel Tar](https://github.com/qcz) * [:link:](moviedb/moviedb.d.ts) [MovieDB](https://github.com/danzajdband/moviedb) by [Basarat Ali Syed](https://github.com/basarat) * [:link:](firefox/firefox.d.ts) [Mozilla Web API](https://developer.mozilla.org/en-US/docs/Web/API) by [vvakame](https://github.com/vvakame) -* [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [david pichsenmeister](https://github.com/3x14159265) +* [:link:](localForage/localForage.d.ts) [Mozilla's localForage](https://github.com/mozilla/localforage) by [yuichi david pichsenmeister](https://github.com/3x14159265) +* [:link:](mpromise/mpromise.d.ts) [mpromise](https://github.com/aheckmann/mpromise) by [Seulgi Kim](https://github.com/sgkim126) * [:link:](msgpack/msgpack.d.ts) [msgpack.js - MessagePack JavaScript Implementation](https://github.com/uupaa/msgpack.js) by [Shinya Mochizuki](https://github.com/enrapt-mochizuki) * [:link:](msnodesql/msnodesql.d.ts) [msnodesql](https://github.com/WindowsAzure/node-sqlserver) by [Boris Yankov](https://github.com/borisyankov), [Maxime LUCE](https://github.com/SomaticIT) * [:link:](mssql/mssql.d.ts) [mssql](https://www.npmjs.com/package/mssql) by [COLSA Corporation](http://www.colsa.com) * [:link:](mu2/mu2.d.ts) [mu2](http://github.com/raycmorgan/mu) by [Jeff Goddard](https://github.com/jedigo) * [:link:](multer/multer.d.ts) [multer](https://github.com/expressjs/multer) by [jt000](https://github.com/jt000) +* [:link:](multiplexjs/multiplexjs.d.ts) [Multiplex.js](http://github.com/multiplex/multiplex.js) by [Kamyar Nazeri](http://github.com/KamyarNazeri) * [:link:](mustache/mustache.d.ts) [Mustache](https://github.com/janl/mustache.js) by [Mark Ashley Bell](https://github.com/markashleybell) +* [:link:](navigation/navigation.d.ts) [Navigation](http://grahammendick.github.io/navigation) by [Graham Mendick](https://github.com/grahammendick) * [:link:](nconf/nconf.d.ts) [nconf](https://github.com/flatiron/nconf) by [Jeff Goddard](https://github.com/jedigo), [Jean-Martin Thibault](https://github.com/jmthibault) * [:link:](ncp/ncp.d.ts) [ncp](https://github.com/AvianFlu/ncp) by [Bart van der Schoor](https://github.com/bartvds) * [:link:](nedb/nedb.d.ts) [NeDB](https://github.com/louischatriot/nedb) by [Stefan Steinhart](https://github.com/reppners) @@ -621,12 +664,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](noble/noble.d.ts) [noble](https://github.com/sandeepmistry/noble) by [Seon-Wook Park](https://github.com/swook) * [:link:](nock/nock.d.ts) [nock](https://github.com/pgte/nock) by [bonnici](https://github.com/bonnici) * [:link:](node-imap/imap.d.ts) [node imap](https://github.com/mscdex/node-imap) by [Steve Fenton](https://github.com/Steve-Fenton) +* [:link:](node-sass/node-sass.d.ts) [Node Sass](https://github.com/sass/node-sass) by [Asana](https://asana.com) * [:link:](bunyan/bunyan.d.ts) [node-bunyan](https://github.com/trentm/node-bunyan) by [Alex Mikhalev](https://github.com/amikhalev) * [:link:](bunyan-logentries/bunyan-logentries.d.ts) [node-bunyan-logentries](https://github.com/nemtsov/node-bunyan-logentries) by [Aymeric Beaumet](http://aymericbeaumet.me) +* [:link:](node-calendar/node-calendar.d.ts) [node-calendar](https://www.npmjs.com/package/node-calendar) by [Luzian Zagadinow](https://github.com/luzianz) * [:link:](convict/convict.d.ts) [node-convict](https://github.com/mozilla/node-convict) by [Wim Looman](https://github.com/Nemo157) * [:link:](node-ffi/node-ffi.d.ts) [node-ffi](https://github.com/rbranson/node-ffi) by [Paul Loyd](https://github.com/loyd) * [:link:](node-fibers/node-fibers.d.ts) [node-fibers](https://github.com/laverdet/node-fibers) by [Cary Haynie](https://github.com/caryhaynie) * [:link:](node-form/node-form.d.ts) [node-form](https://github.com/rsamec/form) by [Roman Samec](https://github.com/rsamec) +* [:link:](node-gcm/node-gcm.d.ts) [node-gcm](https://www.npmjs.org/package/node-gcm) by [Hiroki Horiuchi](https://github.com/horiuchi) * [:link:](node-git/node-git.d.ts) [node-git](https://github.com/christkv/node-git) by [vvakame](https://github.com/vvakame) * [:link:](ip/ip.d.ts) [node-ip](https://github.com/indutny/node-ip) by [Peter Harris](https://github.com/codeanimal) * [:link:](multiparty/multiparty.d.ts) [node-multiparty](https://github.com/andrewrk/node-multiparty) by [Ken Fukuyama](https://github.com/kenfdev) @@ -635,13 +681,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](node-polyglot/node-polyglot.d.ts) [node-polyglot](https://github.com/airbnb/polyglot.js) by [Tim Jackson-Kiely](https://github.com/timjk) * [:link:](promptly/promptly.d.ts) [node-promptly](https://github.com/IndigoUnited/node-promptly) by [Dan Spencer](https://github.com/danrspencer) * [:link:](radius/radius.d.ts) [node-radius](https://github.com/retailnext/node-radius) by [Peter Harris](https://github.com/codeanimal) +* [:link:](stack-trace/stack-trace.d.ts) [node-stack-trace](https://github.com/felixge/node-stack-trace) by [Exceptionless](https://github.com/exceptionless) * [:link:](node-uuid/node-uuid.d.ts) [node-uuid.js](https://github.com/broofa/node-uuid) by [Jeff May](https://github.com/jeffmay) * [:link:](node-webkit/node-webkit.d.ts) [node-webkit](https://github.com/rogerwang/node-webkit) by [Pedro Casaubon](https://github.com/xperiments) * [:link:](xml2js/xml2js.d.ts) [node-xml2js](https://github.com/Leonidas-from-XIV/node-xml2js) by [Michel Salib](https://github.com/michelsalib), [Jason McNeil](https://github.com/jasonrm) * [:link:](node/node.d.ts) [Node.js](http://nodejs.org) by [Microsoft TypeScript](http://typescriptlang.org), [DefinitelyTyped](https://github.com/borisyankov/DefinitelyTyped) * [:link:](restify/restify.d.ts) [node.js REST framework](https://github.com/mcavage/node-restify) by [Bret Little](https://github.com/blittle) -* [:link:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) * [:link:](acl/acl-redisBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) +* [:link:](acl/acl-mongodbBackend.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) * [:link:](acl/acl.d.ts) [node_acl](https://github.com/optimalbits/node_acl) by [Qubo](https://github.com/tkQubo) * [:link:](mdns/mdns.d.ts) [node_mdns](https://github.com/agnat/node_mdns) by [Stefan Steinhart](https://github.com/reppners) * [:link:](node_redis/node_redis.d.ts) [node_redis](https://github.com/mranney/node_redis) by [Boris Yankov](https://github.com/borisyankov) @@ -656,11 +703,12 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](nopt/nopt.d.ts) [nopt](https://github.com/npm/nopt) by [jbondc](https://github.com/jbondc) * [:link:](notify/notify.d.ts) [Notify.js](https://github.com/jpillora/notifyjs) by [Xiaohan Zhang](https://github.com/hellochar) * [:link:](notifyjs/notifyjs.d.ts) [notify.js](https://github.com/alexgibson/notify.js) by [soundTricker](https://github.com/soundTricker) -* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj) * [:link:](wnumb/wnumb.d.ts) [nouislider](https://github.com/leongersen/wnumb) by [Corey Jepperson](https://github.com/acoreyj) +* [:link:](nouislider/nouislider.d.ts) [nouislider](https://github.com/leongersen/noUiSlider) by [Corey Jepperson](https://github.com/acoreyj) * [:link:](noVNC/noVNC.d.ts) [noVNC](https://github.com/kanaka/noVNC) by [Ken Smith](https://github.com/smithkl42) * [:link:](npm/npm.d.ts) [npm](https://github.com/npm/npm) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](nprogress/NProgress.d.ts) [NProgress](https://github.com/rstacruz/nprogress) by [Judah Gabriel Himango](http://debuggerdotbreak.wordpress.com) +* [:link:](numbro/numbro.d.ts) [Numbro.js](https://github.com/foretagsplatsen/numbro) by [Vincent Bortone](https://github.com/vbortone) * [:link:](numeraljs/numeraljs.d.ts) [Numeral.js](https://github.com/adamwdraper/Numeral-js) by [Vincent Bortone](https://github.com/vbortone) * [:link:](object-hash/object-hash.d.ts) [object-hash](https://github.com/puleos/object-hash) by [Michael Zabka](https://github.com/misak113) * [:link:](object-path/object-path.d.ts) [objectPath v0.9.x](https://github.com/mariocasciaro/object-path) by [Paulo Cesar](https://github.com/pocesar) @@ -673,12 +721,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](opn/opn.d.ts) [opn](https://github.com/sindresorhus/opn) by [Shinnosuke Watanabe](https://github.com/shinnn) * [:link:](optimist/optimist.d.ts) [optimist](https://github.com/substack/node-optimist) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](page/page.d.ts) [page](http://visionmedia.github.io/page.js) by [Alan Norbauer](http://alan.norbauer.com) +* [:link:](papaparse/papaparse.d.ts) [PapaParse](https://github.com/mholt/PapaParse) by [Pedro Flemming](https://github.com/torpedro) * [:link:](parallel/parallel.d.ts) [parallel.js](http://adambom.github.io/parallel.js) by [Josh Baldwin](https://github.com/jbaldwin) * [:link:](parse/parse.d.ts) [Parse](https://parse.com) by [Ullisen Media Group](http://ullisenmedia.com) * [:link:](parsimmon/parsimmon.d.ts) [Parsimmon](https://github.com/jneen/parsimmon) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](passport/passport.d.ts) [Passport](http://passportjs.org) by [Horiuchi_H](https://github.com/horiuchi) * [:link:](passport-strategy/passport-strategy.d.ts) [Passport Strategy module](https://github.com/jaredhanson/passport-strategy) by [Lior Mualem](https://github.com/liorm) +* [:link:](passport-twitter/passport-twitter.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook/passport-facebook.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) +* [:link:](passport-google-oauth/passport-google-oauth.d.ts) [passport-facebook](https://github.com/jaredhanson/passport-facebook) by [James Roland Cabresos](https://github.com/staticfunction) * [:link:](passport-facebook-token/passport-facebook-token.d.ts) [passport-facebook-token](https://github.com/drudge/passport-facebook-token) by [Ray Martone](https://github.com/rmartone) * [:link:](passport-local/passport-local.d.ts) [passport-local](https://github.com/jaredhanson/passport-local) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](path-to-regexp/path-to-regexp.d.ts) [path-to-regexp](https://github.com/pillarjs/path-to-regexp) by [xica](https://github.com/xica) @@ -694,19 +745,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](phonegap/phonegap.d.ts) [PhoneGap](http://phonegap.com) by [Boris Yankov](https://github.com/borisyankov), [Dick van den Brink](https://github.com/DickvdBrink) * [:link:](photoswipe/photoswipe.d.ts) [PhotoSwipe](http://photoswipe.com) by [Xiaohan Zhang](https://github.com/hellochar) * [:link:](physijs/physijs.d.ts) [Physijs](http://chandlerprall.github.io/Physijs) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Adi Dahiya](https://github.com/adidahiya) +* [:link:](pickadate/pickadate.d.ts) [pickadate.js](https://github.com/amsul/pickadate.js) by [Theodore Brown](https://github.com/theodorejb) +* [:link:](pikaday/pikaday.d.ts) [pikaday](https://github.com/dbushell/Pikaday) by [Rudolph Gottesheim](http://midnight-design.at) +* [:link:](piwik-tracker/piwik-tracker.d.ts) [PiwikTracker](https://www.npmjs.com/package/piwik-tracker) by [Guilherme Bernal](https://github.com/lbguilherme) * [:link:](pixi/pixi.d.ts) [PIXI](https://github.com/GoodBoyDigital/pixi.js) by [xperiments](http://github.com/xperiments) * [:link:](platform/platform.d.ts) [Platform](https://github.com/bestiejs/platform.js) by [Jake Hickman](https://github.com/JakeH) * [:link:](playerframework/playerFramework.d.ts) [Player Framework (MMPPF)](https://playerframework.codeplex.com) by [Ricardo Sabino](https://github.com/ricardosabino) * [:link:](pleasejs/please.d.ts) [PleaseJS](http://www.checkman.io/please) by [Toshiya Nakakura](https://github.com/nakakura) +* [:link:](pluralize/pluralize.d.ts) [pluralize](https://www.npmjs.com/package/pluralize) by [Syu Kato](https://github.com/ukyo) * [:link:](png-async/png-async.d.ts) [png-async](https://github.com/kanreisa/node-png-async) by [Yuki KAN](https://github.com/kanreisa) * [:link:](podcast/podcast.d.ts) [podcast](http://github.com/maxnowack/node-podcast) by [Niklas Mollenhauer](https://github.com/nikeee) * [:link:](poly2tri/poly2tri.d.ts) [poly2tri](http://github.com/r3mi/poly2tri.js) by [Elemar Junior](https://github.com/elemarjr) * [:link:](polymer/polymer.d.ts) [polymer](https://github.com/polymer) by [Louis Grignon](https://github.com/lgrignon) * [:link:](polymer/polymer.paper-dialog.d.ts) [polymer's paper-dialog](https://github.com/Polymer/paper-dialog) by [Louis Grignon](https://github.com/lgrignon) +* [:link:](polymer/polymer.core-selector.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon) * [:link:](polymer/polymer.core-drawer-panel.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-drawer-panel) by [Louis Grignon](https://github.com/lgrignon) * [:link:](polymer/polymer.core-overlay.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon) -* [:link:](polymer/polymer.core-selector.d.ts) [polymer's paper-toast](https://github.com/Polymer/core-selector) by [Louis Grignon](https://github.com/lgrignon) * [:link:](polymer/polymer.paper-toast.d.ts) [polymer's paper-toast](https://github.com/Polymer/paper-toast) by [Louis Grignon](https://github.com/lgrignon) * [:link:](popcorn/popcorn.d.ts) [Popcorn](https://github.com/mozilla/popcorn-js) by [grapswiz](https://github.com/grapswiz) * [:link:](pouchDB/pouch.d.ts) [Pouch](http://pouchdb.com) by [Bill Sears](https://github.com/MrBigDog2U) @@ -720,6 +774,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](promises-a-plus/promises-a-plus.d.ts) [promises-a-plus](http://promisesaplus.com) by [Igor Oleinikov](https://github.com/Igorbek) * [:link:](protobufjs/protobufjs.d.ts) [ProtoBuf.js](https://github.com/dcodeIO/ProtoBuf.js) by [Panu Horsmalahti](https://github.com/panuhorsmalahti) * [:link:](proxyquire/proxyquire.d.ts) [Proxyquire](https://github.com/thlorenz/proxyquire) by [jt000](https://github.com/jt000) +* [:link:](pty.js/pty.js.d.ts) [pty.js 0.2.7-1](https://github.com/chjj/pty.js) by [Vadim Macagon](https://github.com/enlight) * [:link:](pubsubjs/pubsub.d.ts) [PubSubJS](https://github.com/mroderick/PubSubJS) by [Boris Yankov](https://github.com/borisyankov) * [:link:](purl/purl.d.ts) [Purl](https://github.com/allmarkedup/purl) by [Daniel Ferreira Monteiro Alves](https://github.com/danfma) * [:link:](q/Q.d.ts) [Q](https://github.com/kriskowal/q) by [Barrie Nemetchek](https://github.com/bnemetchek), [Andrew Gaspar](https://github.com/AndrewGaspar), [John Reilly](https://github.com/johnnyreilly) @@ -727,12 +782,14 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](q-retry/q-retry.d.ts) [q-retry](https://github.com/vilic/q-retry) by [VILIC VANE](https://github.com/vilic) * [:link:](qajax/qajax.d.ts) [Qajax](https://github.com/gre/qajax) by [Boltmade](https://github.com/Boltmade) * [:link:](qtip2/qtip2.d.ts) [qtip2](http://qtip2.com) by [Nathan Pitman](https://github.com/Seltzer) +* [:link:](quixote/quixote.d.ts) [quixote](http://quixote-css.com) by [Aleksandr Filatov](https://github.com/greybax) * [:link:](qunit/qunit.d.ts) [QUnit](http://qunitjs.com) by [Diullei Gomes](https://github.com/diullei) * [:link:](rabbit.js/rabbit.js.d.ts) [rabbit.js](https://github.com/squaremo/rabbit.js) by [Wonshik Kim](https://github.com/wokim) * [:link:](ractive/ractive.d.ts) [Ractive](http://ractivejs.org) by [Han Lin Yap](http://yap.nu) * [:link:](raphael/raphael.d.ts) [Raphael](http://raphaeljs.com) by [CheCoxshall](https://github.com/CheCoxshall) * [:link:](rappid/rappid.d.ts) [Rappid](http://jointjs.com/about-rappid) by [Ewout Van Gossum](https://github.com/DenEwout) * [:link:](ravenjs/ravenjs.d.ts) [Raven.js](https://github.com/getsentry/raven-js) by [Santi Albo](https://github.com/santialbo) +* [:link:](raygun4js/raygun4js.d.ts) [raygun4js](https://github.com/MindscapeHQ/raygun4js) by [Brian Surowiec](https://github.com/xt0rted) * [:link:](react/react.d.ts) [React (external module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) * [:link:](react/react-global.d.ts) [React (internal module)](http://facebook.github.io/react) by [Asana](https://asana.com), [AssureSign](http://www.assuresign.com) * [:link:](react-router/react-router.d.ts) [React Router](https://github.com/rackt/react-router) by [Yuichi Murata](https://github.com/mrk21) @@ -755,6 +812,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](rickshaw/rickshaw.d.ts) [Rickshaw](http://code.shutterstock.com/rickshaw) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](rimraf/rimraf.d.ts) [rimraf](https://github.com/isaacs/rimraf) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](riotjs/riotjs.d.ts) [riot.js](https://github.com/moot/riotjs) by [vvakame](https://github.com/vvakame) +* [:link:](rivets/rivets.d.ts) [rivets](http://rivetsjs.com) by [Trevor Baron](https://github.com/TrevorDev) * [:link:](routie/routie.d.ts) [routie](https://github.com/jgallen23/routie) by [Adilson](https://github.com/Adilson) * [:link:](rtree/rtree.d.ts) [rtree](https://github.com/leaflet-extras/RTree) by [Omede Firouz](https://github.com/oefirouz) * [:link:](run-sequence/run-sequence.d.ts) [run-sequence](https://github.com/OverZealous/run-sequence) by [Keita Kagurazaka](https://github.com/k-kagurazaka) @@ -779,14 +837,15 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sanitizer/sanitizer.d.ts) [Sanitizer](https://github.com/theSmaw/Caja-HTML-Sanitizer) by [Dave Taylor](http://davetayls.me) * [:link:](sax/sax.d.ts) [sax js](https://github.com/isaacs/sax-js) by [Asana](https://asana.com) * [:link:](screenfull/screenfull.d.ts) [screenfull.js](https://github.com/sindresorhus/screenfull.js) by [Ilia Choly](http://github.com/icholy) +* [:link:](scrolltofixed/scrolltofixed.d.ts) [ScrollToFixed](https://github.com/bigspotteddog/ScrollToFixed) by [Ben Dixon](https://github.com/bmdixon) * [:link:](select2/select2.d.ts) [Select2](http://ivaynberg.github.com/select2) by [Boris Yankov](https://github.com/borisyankov) * [:link:](selectize/selectize.d.ts) [Selectize](https://github.com/brianreavis/selectize.js) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](selenium-webdriver/selenium-webdriver.d.ts) [Selenium WebDriverJS](https://code.google.com/p/selenium) by [Bill Armstrong](https://github.com/BillArmstrong) * [:link:](semver/semver.d.ts) [semver](https://github.com/isaacs/node-semver) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](sendgrid/sendgrid.d.ts) [sendgrid](https://github.com/sendgrid/sendgrid-nodejs) by [Maxime LUCE](https://github.com/SomaticIT) * [:link:](sequelize/sequelize.d.ts) [Sequelize 2.0.0 dev13](http://sequelizejs.com) by [samuelneff](https://github.com/samuelneff), [Peter Harris](https://github.com/codeanimal) -* [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery) * [:link:](serve-favicon/serve-favicon.d.ts) [serve-favicon](https://github.com/expressjs/serve-favicon) by [Uros Smolnik](https://github.com/urossmolnik) +* [:link:](on-headers/on-headers.d.ts) [serve-favicon](https://github.com/jshttp/on-headers) by [John Jeffery](https://github.com/jjeffery) * [:link:](serve-static/serve-static.d.ts) [serve-static](https://github.com/expressjs/serve-static) by [Uros Smolnik](https://github.com/urossmolnik) * [:link:](sharedworker/SharedWorker.d.ts) [SharedWorker](http://www.w3.org/TR/workers) by [Toshiya Nakakura](https://github.com/nakakura) * [:link:](shelljs/shelljs.d.ts) [ShellJS](http://shelljs.org) by [Niklas Mollenhauer](https://github.com/nikeee) @@ -826,13 +885,17 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sqlite3/sqlite3.d.ts) [sqlite3](https://github.com/mapbox/node-sqlite3) by [Nick Malaguti](https://github.com/nmalaguti) * [:link:](squirejs/squirejs.d.ts) [Squire](https://github.com/iammerrick/Squire.js) by [Bradley Ayers](https://github.com/bradleyayers) * [:link:](stack-mapper/stack-mapper.d.ts) [stack-mapper](https://github.com/thlorenz/stack-mapper) by [Rogier Schouten](https://github.com/rogierschouten) +* [:link:](stacktrace-js/stacktrace-js.d.ts) [stacktrace.js](https://github.com/stacktracejs/stacktrace.js) by [Exceptionless](https://github.com/exceptionless) * [:link:](stampit/stampit.d.ts) [stampit](https://github.com/ericelliott/stampit) by [Vasyl Boroviak](https://github.com/koresar) * [:link:](stats/stats.d.ts) [Stats.js r12](http://github.com/mrdoob/stats.js) by [Gregory Dalton](https://github.com/gregolai) +* [:link:](statsd-client/statsd-client.d.ts) [statsd-client](https://github.com/msiebuhr/node-statsd-client) by [Peter Kooijmans](https://github.com/peterkooijmans) * [:link:](status-bar/status-bar.d.ts) [status-bar](https://github.com/atom/status-bar) by [vvakame](https://github.com/vvakame) * [:link:](storejs/storejs.d.ts) [store.js](https://github.com/marcuswestin/store.js) by [Vincent Bortone](https://github.com/vbortone) * [:link:](stream-series/stream-series.d.ts) [stream-series](https://github.com/rschmukler/stream-series) by [Keita Kagurazaka](https://github.com/k-kagurazaka) * [:link:](stream-to-array/stream-to-array.d.ts) [stream-to-array](https://github.com/stream-utils/stream-to-array) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](streamjs/streamjs.d.ts) [streamjs](http://winterbe.github.io/streamjs) by [Bence Eros](https://github.com/erosb) * [:link:](stripe/stripe.d.ts) [stripe](https://stripe.com) by [Eric J. Smith](https://github.com/ejsmith) +* [:link:](stripe-checkout/stripe-checkout.d.ts) [Stripe Checkout](https://stripe.com/checkout) by [Chris Wrench](https://github.com/cgwrench) * [:link:](stripe/stripe-node.d.ts) [stripe-node](https://github.com/stripe/stripe-node) by [William Johnston](https://github.com/wjohnsto) * [:link:](strophe/strophe.d.ts) [Strophe.js](http://strophe.im/strophejs) by [David Deutsch](https://github.com/DavidKDeutsch) * [:link:](stylus/stylus.d.ts) [stylus](https://github.com/LearnBoost/stylus) by [Maxime LUCE](https://github.com/SomaticIT) @@ -847,19 +910,22 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sweetalert/sweetalert.d.ts) [SweetAlert](https://github.com/t4t5/sweetalert) by [Markus Peloso](https://github.com/ToastHawaii) * [:link:](swfobject/swfobject.d.ts) [swfobject](https://code.google.com/p/swfobject) by [rou](https://github.com/rou) * [:link:](swig/swig.d.ts) [swig](http://github.com/paularmstrong/swig) by [Peter Harris](https://github.com/CodeAnimal), [Carlos Ballesteros Velasco](https://github.com/soywiz) +* [:link:](swipe/swipe.d.ts) [Swipe](https://github.com/thebird/Swipe) by [Andrey Kurdyumov](https://github.com/kant2002) * [:link:](swiper/swiper.d.ts) [Swiper](https://github.com/nolimits4web/Swiper) by [Sebastián Galiano](https://github.com/sgaliano) * [:link:](swipeview/swipeview.d.ts) [SwipeView](http://cubiq.org/swipeview) by [Boris Yankov](https://github.com/borisyankov) * [:link:](switchery/switchery.d.ts) [switchery](https://github.com/abpetkov/switchery) by [Bruno Grieder](https://github.com/bgrieder) * [:link:](swiz/swiz.d.ts) [swiz](https://github.com/racker/node-swiz) by [Jeff Goddard](https://github.com/jedigo) * [:link:](tape/tape.d.ts) [tape](https://github.com/substack/tape) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](tar/tar.d.ts) [tar](https://github.com/npm/node-tar) by [Maxime LUCE](https://github.com/SomaticIT) -* [:link:](tcomb/tcomb.d.ts) [tcomb](http://gcanti.github.io/tcomb/guide/index.html) by [Jed Mao](https://github.com/jedmao) +* [:link:](tcomb/tcomb.d.ts) [tcomb](http://gcanti.github.io/tcomb/guide/index.html) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](tedious/tedious.d.ts) [tedious](https://pekim.github.io/tedious) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](tedious-connection-pool/tedious-connection-pool.d.ts) [tedious-connection-pool](https://github.com/pekim/tedious-connection-pool) by [Cyprien Autexier](https://github.com/sandorfr) * [:link:](teechart/teechart.d.ts) [TeeChart](http://www.steema.com) by [Steema Software](https://steema.com) * [:link:](tether/tether.d.ts) [Tether](http://github.hubspot.com/tether) by [Adi Dahiya](https://github.com/adidahiya) * [:link:](text-buffer/text-buffer.d.ts) [text-buffer](https://github.com/atom/text-buffer) by [vvakame](https://github.com/vvakame) * [:link:](text-encoding/text-encoding.d.ts) [text-encoding](https://github.com/inexorabletash/text-encoding) by [MIZUNE Pine](https://github.com/pine613) +* [:link:](github-electron/github-electron-main.d.ts) [the Electron 0.25.2 main process](http://electron.atom.io) by [jedmao](https://github.com/jedmao) +* [:link:](github-electron/github-electron-renderer.d.ts) [the Electron 0.25.2 renderer process (web page)](http://electron.atom.io) by [jedmao](https://github.com/jedmao) * [:link:](threejs/three-canvasrenderer.d.ts) [three.js (CanvasRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-copyshader.d.ts) [three.js (CopyShader.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-css3drenderer.d.ts) [three.js (CSS3DRenderer.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CSS3DRenderer.js) by [Satoru Kimura](https://github.com/gyohk) @@ -871,7 +937,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](threejs/three-renderpass.d.ts) [three.js (RenderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-shaderpass.d.ts) [three.js (ShaderPass.js)](https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js) by [Satoru Kimura](https://github.com/gyohk) * [:link:](threejs/three-trackballcontrols.d.ts) [three.js (TrackballControls.js)](https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js) by [Satoru Kimura](https://github.com/gyohk) -* [:link:](threejs/three.d.ts) [three.js r70](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) +* [:link:](threejs/three.d.ts) [three.js r71](http://mrdoob.github.com/three.js) by [Kon](http://phyzkit.net), [Satoru Kimura](https://github.com/gyohk) * [:link:](through/through.d.ts) [through](https://github.com/dominictarr/through) by [Andrew Gaspar](https://github.com/AndrewGaspar) * [:link:](through2/through2.d.ts) [through2 v](https://github.com/rvagg/through2) by [Bart van der Schoor](https://github.com/Bartvds), [jedmao](https://github.com/jedmao) * [:link:](timelinejs/timelinejs.d.ts) [timelinejs](https://github.com/NUKnightLab/TimelineJS) by [Roland Zwaga](https://github.com/rolandzwaga) @@ -885,6 +951,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](sencha_touch/SenchaTouch.d.ts) [Touch](http://www.sencha.com/products/touch) by [Brian Kotek](https://github.com/brian428) * [:link:](traceback/traceback.d.ts) [Traceback](http://github.com/iriscouch/traceback) by [Michael Zabka](https://github.com/misak113) * [:link:](trunk8/trunk8.d.ts) [trunk8](https://github.com/rviscomi/trunk8) by [Blake Niemyjski](https://github.com/niemyjski) +* [:link:](tsmonad/tsmonad.d.ts) [TsMonad](https://github.com/cbowdon/TsMonad) by [Chris Bowdon](https://github.com/cbowdon) * [:link:](tspromise/tspromise.d.ts) [tspromise](https://github.com/soywiz/tspromise) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](tween.js/tween.js.d.ts) [tween.js r12](https://github.com/sole/tween.js) by [sunetos](https://github.com/sunetos), [jzarnikov](https://github.com/jzarnikov) * [:link:](tweenjs/tweenjs.d.ts) [TweenJS](http://www.createjs.com/#!/TweenJS) by [Pedro Ferreira](https://bitbucket.org/drk4), [Chris Smith](https://github.com/evilangelist) @@ -892,6 +959,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](twitter/twitter.d.ts) [Twitter for Websites](https://dev.twitter.com/web) by [Chitoku](https://github.com/chitoku-k) * [:link:](jquery.bootstrap.wizard/jquery.bootstrap.wizard.d.ts) [twitter-bootstrap-wizard](https://github.com/VinceG/twitter-bootstrap-wizard) by [Blake Niemyjski](https://github.com/niemyjski) * [:link:](twix/twix.d.ts) [twix.js](https://github.com/icambron/twix.js) by [j3ko](https://github.com/j3ko) +* [:link:](type-check/type-check.d.ts) [type-check](https://github.com/gkz/type-check) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](type-detect/type-detect.d.ts) [type-detect](https://github.com/chaijs/type-detect) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](type-name/type-name.d.ts) [type-name](https://github.com/twada/type-name) by [OKUNOKENTARO](https://github.com/armorik83) * [:link:](typeahead/typeahead.d.ts) [typeahead.js](http://twitter.github.io/typeahead.js) by [Ivaylo Gochkov](https://github.com/igochkov), [Gidon Junge](https://github.com/gjunge) @@ -902,13 +970,16 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](underscore/underscore.d.ts) [Underscore](http://underscorejs.org) by [Boris Yankov](https://github.com/borisyankov), [Josh Baldwin](https://github.com/jbaldwin) * [:link:](underscore-ko/underscore-ko.d.ts) [Underscore-ko 1.2.2 with underscore](https://github.com/kamranayub/UnderscoreKO) by [Maurits Elbers](https://github.com/MagicMau) * [:link:](underscore.string/underscore.string.d.ts) [underscore.string](https://github.com/epeli/underscore.string) by [Ry Racherbaumer](http://github.com/rygine) +* [:link:](jquery.uniform/jquery.uniform.d.ts) [Uniform.js](https://github.com/pixelmatrix/uniform) by [flyfishMT](https://github.com/flyfishMT) * [:link:](uniq/uniq.d.ts) [uniq](https://www.npmjs.com/package/uniq) by [Hans Windhoff](https://github.com/hansrwindhoff) * [:link:](universal-analytics/universal-analytics.d.ts) [universal-analytics](https://github.com/peaksandpies/universal-analytics) by [Bart van der Schoor](https://github.com/Bartvds) +* [:link:](unorm/unorm.d.ts) [unorm](https://github.com/walling/unorm) by [Christopher Brown](https://github.com/chbrown) * [:link:](update-notifier/update-notifier.d.ts) [update-notifier](https://github.com/yeoman/update-notifier) by [vvakame](https://github.com/vvakame) * [:link:](uri-templates/uri-templates.d.ts) [uri-templates](https://github.com/geraintluff/uri-templates) by [Bart van der Schoor](https://github.com/Bartvds) -* [:link:](urijs/URI.d.ts) [URI.js](https://github.com/medialize/URI.js) by [RodneyJT](https://github.com/RodneyJT) +* [:link:](urijs/URIjs.d.ts) [URI.js](https://github.com/medialize/URI.js) by [RodneyJT](https://github.com/RodneyJT), [Brian Surowiec](https://github.com/xt0rted) * [:link:](js-url/js-url.d.ts) [url](https://github.com/websanova/js-url) by [MIZUNE Pine](https://github.com/pine613) * [:link:](urlrouter/urlrouter.d.ts) [urlrouter](https://github.com/fengmk2/urlrouter) by [soywiz](https://github.com/soywiz) +* [:link:](urlsafe-base64/urlsafe-base64.d.ts) [urlsafe-base64](https://github.com/RGBboy/urlsafe-base64) by [Tanguy Krotoff](https://github.com/tkrotoff) * [:link:](UUID/UUID.d.ts) [UUID.js core](https://github.com/LiosK/UUID.js) by [Jason Jarrett](https://github.com/staxmanade) * [:link:](valerie/valerie.d.ts) [valerie](https://github.com/davewatts/valerie) by [Howard Richards](https://github.com/conficient) * [:link:](validator/validator.d.ts) [validator.js](https://github.com/chriso/validator.js) by [tgfjt](https://github.com/tgfjt) @@ -921,6 +992,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](vinyl/vinyl.d.ts) [vinyl](https://github.com/wearefractal/vinyl) by [vvakame](https://github.com/vvakame), [jedmao](https://github.com/jedmao) * [:link:](vinyl-fs/vinyl-fs.d.ts) [vinyl-fs](https://github.com/wearefractal/vinyl-fs) by [vvakame](https://github.com/vvakame) * [:link:](vinyl-source-stream/vinyl-source-stream.d.ts) [vinyl-source-stream](https://github.com/hughsk/vinyl-source-stream) by [Asana](https://asana.com) +* [:link:](virtual-dom/virtual-dom.d.ts) [virtual-dom](https://github.com/Matt-Esch/virtual-dom) by [Christopher Brown](https://github.com/chbrown) +* [:link:](vortex-web-client/vortex-web-client.d.ts) [Vortex Web 1.2.0p1](http://www.prismtech.com/vortex/vortex-web) by [Stefan Profanter](https://github.com/Pro) * [:link:](vue/vue.d.ts) [vuejs](https://github.com/yyx990803/vue) by [odangosan](https://github.com/odangosan) * [:link:](watch/watch.d.ts) [watch](https://github.com/mikeal/watch) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](jquery.watermark/jquery.watermark.d.ts) [Watermark plugin for jQuery](http://jquery-watermark.googlecode.com) by [Anwar Javed](https://github.com/anwarjaved) @@ -947,7 +1020,10 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](ws/ws.d.ts) [ws](https://github.com/einaros/ws) by [Paul Loyd](https://github.com/loyd) * [:link:](x-editable/x-editable.d.ts) [X-Editable](http://vitalets.github.io/x-editable/index.html) by [Chris Kirby](https://github.com/sirkirby) * [:link:](x2js/xml2json.d.ts) [x2js](https://code.google.com/p/x2js) by [Horiuchi_H](https://github.com/horiuchi) +* [:link:](xdate/xdate.d.ts) [XDate](http://arshaw.com/xdate) by [yamada28go](https://github.com/yamada28go) * [:link:](jsfl/xJSFL.d.ts) [xJSFL](http://www.xjsfl.com) by [soywiz](https://github.com/soywiz) +* [:link:](xlsx/xlsx.d.ts) [xlsx](https://github.com/SheetJS/js-xlsx) by [themauveavenger](https://github.com/themauveavenger) +* [:link:](xmlbuilder/xmlbuilder.d.ts) [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) by [Wallymathieu](http://github.com/wallymathieu) * [:link:](xpath/xpath.d.ts) [xpath](https://github.com/goto100/xpath) by [Andrew Bradley](https://github.com/cspotcode) * [:link:](xregexp/xregexp.d.ts) [XRegExp](http://xregexp.com) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](xsockets/XSockets.d.ts) [XSockets.NET](http://xsockets.net) by [Jeffery Grajkowski](https://github.com/pushplay) @@ -966,5 +1042,6 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](zip.js/zip.js.d.ts) [zip.js 2.x](https://github.com/gildas-lormeau/zip.js) by [Louis Grignon](https://github.com/lgrignon) * [:link:](scroller/easyscroller.d.ts) [Zynga EasyScroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) * [:link:](scroller/scroller.d.ts) [Zynga Scroller](https://github.com/zynga/scroller) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](zynga-scroller/zynga-scroller.d.ts) [Zynga Scroller](http://zynga.github.com/scroller) by [Marcelo Haskell Camargo](https://github.com/haskellcamargo) * [:link:](viewporter/viewporter.d.ts) [Zynga Viewporter](https://github.com/zynga/viewporter) by [Boris Yankov](https://github.com/borisyankov) From 9a7fd63e89244da016ca14f4522b60714a445094 Mon Sep 17 00:00:00 2001 From: Craig Brett Date: Tue, 23 Jun 2015 14:47:50 +0100 Subject: [PATCH 0227/2220] Handling case sensativity --- .../backbone-associations-tests.ts | 0 .../backbone-associations-tests.ts.tscparams | 0 .../backbone-associations.d.ts | 0 .../backbone-associations.d.ts.tscparams | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {Backbone-Associations => backbone-associations}/backbone-associations-tests.ts (100%) rename {Backbone-Associations => backbone-associations}/backbone-associations-tests.ts.tscparams (100%) rename {Backbone-Associations => backbone-associations}/backbone-associations.d.ts (100%) rename {Backbone-Associations => backbone-associations}/backbone-associations.d.ts.tscparams (100%) diff --git a/Backbone-Associations/backbone-associations-tests.ts b/backbone-associations/backbone-associations-tests.ts similarity index 100% rename from Backbone-Associations/backbone-associations-tests.ts rename to backbone-associations/backbone-associations-tests.ts diff --git a/Backbone-Associations/backbone-associations-tests.ts.tscparams b/backbone-associations/backbone-associations-tests.ts.tscparams similarity index 100% rename from Backbone-Associations/backbone-associations-tests.ts.tscparams rename to backbone-associations/backbone-associations-tests.ts.tscparams diff --git a/Backbone-Associations/backbone-associations.d.ts b/backbone-associations/backbone-associations.d.ts similarity index 100% rename from Backbone-Associations/backbone-associations.d.ts rename to backbone-associations/backbone-associations.d.ts diff --git a/Backbone-Associations/backbone-associations.d.ts.tscparams b/backbone-associations/backbone-associations.d.ts.tscparams similarity index 100% rename from Backbone-Associations/backbone-associations.d.ts.tscparams rename to backbone-associations/backbone-associations.d.ts.tscparams From 15c8ddaa001be3234a56f246ca0e2e5edcbf772f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81kos=20Luk=C3=A1cs?= Date: Tue, 23 Jun 2015 16:32:40 +0200 Subject: [PATCH 0228/2220] rename module from angular_gettext to angular.gettext + some whitespace cleanup --- angular-gettext/angular-gettext-tests.ts | 31 ++++++++++++++---------- angular-gettext/angular-gettext.d.ts | 23 ++++++++++-------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/angular-gettext/angular-gettext-tests.ts b/angular-gettext/angular-gettext-tests.ts index 706fb67fe0..9a10f1062f 100644 --- a/angular-gettext/angular-gettext-tests.ts +++ b/angular-gettext/angular-gettext-tests.ts @@ -1,39 +1,44 @@ /// module angular_gettext_tests { - var gettextCatalog: angular_gettext.gettextCatalog; - + // Configuring angular-gettext // https://angular-gettext.rocketeer.be/dev-guide/configure/ //Setting the language - gettextCatalog.setCurrentLanguage('nl'); + angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) { + gettextCatalog.setCurrentLanguage('nl'); + }); //Highlighting untranslated strings - gettextCatalog.debug = true; + angular.module('myApp').run(function (gettextCatalog: angular.gettext.gettextCatalog) { + gettextCatalog.debug = true; + }); // Marking strings in JavaScript code as translatable. - // https://angular-gettext.rocketeer.be/dev-guide/annotate-js/ - var gettext = angular_gettext.gettext; - var myString = gettext("Hello"); + // https://angular-gettext.rocketeer.be/dev-guide/annotate-js/ + angular.module("myApp").controller("helloController", function (gettext: angular.gettext.gettextFunction) { + var myString = gettext("Hello"); + }); //Translating directly in JavaScript. - angular.module("myApp").controller("helloController", function (gettextCatalog: angular_gettext.gettextCatalog) { + angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { var translated: string = gettextCatalog.getString("Hello"); }); - angular.module("myApp").controller("helloController", function (gettextCatalog: angular_gettext.gettextCatalog) { + angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { var myString2: string = gettextCatalog.getPlural(3, "Bird", "Birds"); }); - var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" }); - + angular.module("myApp").controller("helloController", function (gettextCatalog: angular.gettext.gettextCatalog) { + var translated: string = gettextCatalog.getString("Hello {{name}}", { name: "Ruben" }); + }); // Setting strings manually // https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/ - angular.module("myApp").run(function (gettextCatalog: angular_gettext.gettextCatalog) { + angular.module("myApp").run(function (gettextCatalog: angular.gettext.gettextCatalog) { // Load the strings automatically during initialization. gettextCatalog.setStrings("nl", { "Hello": "Hallo", @@ -47,7 +52,7 @@ module angular_gettext_tests { } // Lazy-loading languages // https://angular-gettext.rocketeer.be/dev-guide/lazy-loading/ - angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular_gettext.gettextCatalog) { + angular.module("myApp").controller("helloController", function ($scope: helloControllerScope, gettextCatalog: angular.gettext.gettextCatalog) { $scope.switchLanguage = function (lang: string) { gettextCatalog.setCurrentLanguage(lang); gettextCatalog.loadRemote("/languages/" + lang + ".json"); diff --git a/angular-gettext/angular-gettext.d.ts b/angular-gettext/angular-gettext.d.ts index d226801dc4..1a88ef1641 100644 --- a/angular-gettext/angular-gettext.d.ts +++ b/angular-gettext/angular-gettext.d.ts @@ -5,13 +5,13 @@ /// -declare module angular_gettext { +declare module angular.gettext { interface gettextCatalog { - + ////////////// /// Fields /// ////////////// - + /** (default: false): Whether or not to prefix untranslated strings with [MISSING]: or a custom prefix. */ debug: boolean; /** (default: [MISSING]:): Custom prefix for untranslated strings. */ @@ -33,7 +33,7 @@ declare module angular_gettext { /////////////// /// Methods /// /////////////// - + /** Sets the current language and makes sure that all translations get updated correctly. */ setCurrentLanguage(lang: string): void; @@ -41,10 +41,11 @@ declare module angular_gettext { getCurrentLanguage(): string; /** Processes an object of string definitions. More details https://angular-gettext.rocketeer.be/dev-guide/manual-setstrings/ - @param language A language code. - @param strings A dictionary of strings. The format of this dictionary is: - - Keys: Singular English strings (as defined in the source files) - - Values: Either a single string for signular-only strings or an array of plural forms. */ + * @param language A language code. + * @param strings A dictionary of strings. The format of this dictionary is: + * - Keys: Singular English strings (as defined in the source files) + * - Values: Either a single string for signular-only strings or an array of plural forms. + */ setStrings(language: string, strings: { [key: string]: string|string[] }): void; /** Get the correct pluralized (but untranslated) string for the value of n. */ @@ -56,7 +57,7 @@ declare module angular_gettext { * The context parameter is optional: pass null (or don't pass anything) if you're not using it: this skips interpolation and is a lot faster. */ getString(string: string, context?: any): string; - + /** Translate a plural string with the given context. */ getPlural(n: number, string: string, stringPlural: string, context?: any): string; @@ -65,6 +66,8 @@ declare module angular_gettext { } /** If you have text that should be translated in your JavaScript code, wrap it with a call to a function named gettext. This module provides an injectable function to do so */ - function gettext(dummyString: string): string; + interface gettextFunction { + (dummyString: string): string; + } } From 2d07596b6f407239307f1292b4a2c63abfda653e Mon Sep 17 00:00:00 2001 From: Arseniy Maximov Date: Tue, 23 Jun 2015 17:45:29 +0300 Subject: [PATCH 0229/2220] Create declaration file for Polyline --- polyline/polyline-tests.ts | 16 ++++++++++++++++ polyline/polyline.d.ts | 22 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 polyline/polyline-tests.ts create mode 100644 polyline/polyline.d.ts diff --git a/polyline/polyline-tests.ts b/polyline/polyline-tests.ts new file mode 100644 index 0000000000..888d15f91a --- /dev/null +++ b/polyline/polyline-tests.ts @@ -0,0 +1,16 @@ +/// + +// returns an array of lat, lon pairs +polyline.decode('_p~iF~ps|U_ulLnnqC_mqNvxq`@'); + +// returns a string-encoded polyline +polyline.encode([[38.5, -120.2], [40.7, -120.95], [43.252, -126.453]]); + +// returns a string-encoded polyline from a GeoJSON LineString +polyline.fromGeoJSON({ "type": "Feature", + "geometry": { + "type": "LineString", + "coordinates": [[-120.2, 38.5], [-120.95, 40.7], [-126.453, 43.252]] + }, + "properties": {} +}); \ No newline at end of file diff --git a/polyline/polyline.d.ts b/polyline/polyline.d.ts new file mode 100644 index 0000000000..5663fac491 --- /dev/null +++ b/polyline/polyline.d.ts @@ -0,0 +1,22 @@ +// Type definitions for Polyline 0.1.0 +// Project: https://github.com/mapbox/polyline +// Definitions by: Arseniy Maximov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface NumberArray { + [index: number]: number; +} + +interface Polyline { + decode(string: string, precision?: number): NumberArray[]; + encode(coordinate: NumberArray[], precision?: number): string; + fromGeoJSON(geojson: GeoJSON.GeoJsonObject, precision?: number): string; +} + +declare var polyline: Polyline; + +declare module "polyline" { + export = polyline; +} \ No newline at end of file From b56e56736a54393e3ff3c08d9cebd0d697f8bd10 Mon Sep 17 00:00:00 2001 From: Arseniy Maximov Date: Tue, 23 Jun 2015 18:36:36 +0300 Subject: [PATCH 0230/2220] we don't need NumberArray, omg. --- polyline/polyline.d.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/polyline/polyline.d.ts b/polyline/polyline.d.ts index 5663fac491..0f220e1d30 100644 --- a/polyline/polyline.d.ts +++ b/polyline/polyline.d.ts @@ -5,13 +5,9 @@ /// -interface NumberArray { - [index: number]: number; -} - interface Polyline { - decode(string: string, precision?: number): NumberArray[]; - encode(coordinate: NumberArray[], precision?: number): string; + decode(string: string, precision?: number): number[][]; + encode(coordinate: number[][], precision?: number): string; fromGeoJSON(geojson: GeoJSON.GeoJsonObject, precision?: number): string; } From 8833ceece1ed48b36b00b53ed7d66acc8aedfde5 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 23 Jun 2015 09:42:37 -0700 Subject: [PATCH 0231/2220] Combine internal/external React .d.ts files and prepare for TS JSX support --- react/react-addons-global.d.ts | 2 +- react/react-global.d.ts | 781 --------------------------------- react/react-jsx.d.ts | 147 +++++++ react/react.d.ts | 12 +- 4 files changed, 158 insertions(+), 784 deletions(-) delete mode 100644 react/react-global.d.ts create mode 100644 react/react-jsx.d.ts diff --git a/react/react-addons-global.d.ts b/react/react-addons-global.d.ts index 508ae05225..ed6096fa6f 100644 --- a/react/react-addons-global.d.ts +++ b/react/react-addons-global.d.ts @@ -2,7 +2,7 @@ // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped -/// +/// declare module React { // diff --git a/react/react-global.d.ts b/react/react-global.d.ts deleted file mode 100644 index 5a4893862f..0000000000 --- a/react/react-global.d.ts +++ /dev/null @@ -1,781 +0,0 @@ -// Type definitions for React v0.13.1 (internal module) -// Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module React { - // - // React Elements - // ---------------------------------------------------------------------- - - type ReactType = ComponentClass | string; - - interface ReactElement

    { - type: string | ComponentClass

    ; - props: P; - key: string | number; - ref: string | ((component: Component) => any); - } - - interface ClassicElement

    extends ReactElement

    { - type: string | ClassicComponentClass

    ; - ref: string | ((component: ClassicComponent) => any); - } - - interface DOMElement

    extends ClassicElement

    { - type: string; - ref: string | ((component: DOMComponent

    ) => any); - } - - type HTMLElement = DOMElement; - type SVGElement = DOMElement; - - // - // Factories - // ---------------------------------------------------------------------- - - interface Factory

    { - (props?: P, ...children: ReactNode[]): ReactElement

    ; - } - - interface ClassicFactory

    extends Factory

    { - (props?: P, ...children: ReactNode[]): ClassicElement

    ; - } - - interface DOMFactory

    extends ClassicFactory

    { - (props?: P, ...children: ReactNode[]): DOMElement

    ; - } - - type HTMLFactory = DOMFactory; - type SVGFactory = DOMFactory; - - // - // React Nodes - // http://facebook.github.io/react/docs/glossary.html - // ---------------------------------------------------------------------- - - type ReactText = string | number; - type ReactChild = ReactElement | ReactText; - - // Should be Array but type aliases cannot be recursive - type ReactFragment = {} | Array; - type ReactNode = ReactChild | ReactFragment | boolean; - - // - // Top Level API - // ---------------------------------------------------------------------- - - function createClass(spec: ComponentSpec): ClassicComponentClass

    ; - - function createFactory

    (type: string): DOMFactory

    ; - function createFactory

    (type: ClassicComponentClass

    | string): ClassicFactory

    ; - function createFactory

    (type: ComponentClass

    ): Factory

    ; - - function createElement

    ( - type: string, - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function createElement

    ( - type: ClassicComponentClass

    | string, - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function createElement

    ( - type: ComponentClass

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function cloneElement

    ( - element: DOMElement

    , - props?: P, - ...children: ReactNode[]): DOMElement

    ; - function cloneElement

    ( - element: ClassicElement

    , - props?: P, - ...children: ReactNode[]): ClassicElement

    ; - function cloneElement

    ( - element: ReactElement

    , - props?: P, - ...children: ReactNode[]): ReactElement

    ; - - function render

    ( - element: DOMElement

    , - container: Element, - callback?: () => any): DOMComponent

    ; - function render( - element: ClassicElement

    , - container: Element, - callback?: () => any): ClassicComponent; - function render( - element: ReactElement

    , - container: Element, - callback?: () => any): Component; - - function unmountComponentAtNode(container: Element): boolean; - function renderToString(element: ReactElement): string; - function renderToStaticMarkup(element: ReactElement): string; - function isValidElement(object: {}): boolean; - function initializeTouchEvents(shouldUseTouch: boolean): void; - - function findDOMNode( - componentOrElement: Component | Element): TElement; - function findDOMNode( - componentOrElement: Component | Element): Element; - - var DOM: ReactDOM; - var PropTypes: ReactPropTypes; - var Children: ReactChildren; - - // - // Component API - // ---------------------------------------------------------------------- - - // Base component for plain JS classes - class Component implements ComponentLifecycle { - constructor(props?: P, context?: any); - setState(f: (prevState: S, props: P) => S, callback?: () => any): void; - setState(state: S, callback?: () => any): void; - forceUpdate(): void; - props: P; - state: S; - context: any; - refs: { - [key: string]: Component - }; - } - - interface ClassicComponent extends Component { - replaceState(nextState: S, callback?: () => any): void; - getDOMNode(): TElement; - getDOMNode(): Element; - isMounted(): boolean; - getInitialState?(): S; - setProps(nextProps: P, callback?: () => any): void; - replaceProps(nextProps: P, callback?: () => any): void; - } - - interface DOMComponent

    extends ClassicComponent { - tagName: string; - } - - type HTMLComponent = DOMComponent; - type SVGComponent = DOMComponent; - - interface ChildContextProvider { - getChildContext(): CC; - } - - // - // Class Interfaces - // ---------------------------------------------------------------------- - - interface ComponentClass

    { - new(props?: P, context?: any): Component; - propTypes?: ValidationMap

    ; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap; - defaultProps?: P; - } - - interface ClassicComponentClass

    extends ComponentClass

    { - new(props?: P, context?: any): ClassicComponent; - getDefaultProps?(): P; - displayName?: string; - } - - // - // Component Specs and Lifecycle - // ---------------------------------------------------------------------- - - interface ComponentLifecycle { - componentWillMount?(): void; - componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; - componentWillUnmount?(): void; - } - - interface Mixin extends ComponentLifecycle { - mixins?: Mixin; - statics?: { - [key: string]: any; - }; - - displayName?: string; - propTypes?: ValidationMap; - contextTypes?: ValidationMap; - childContextTypes?: ValidationMap - - getDefaultProps?(): P; - getInitialState?(): S; - } - - interface ComponentSpec extends Mixin { - render(): ReactElement; - } - - // - // Event System - // ---------------------------------------------------------------------- - - interface SyntheticEvent { - bubbles: boolean; - cancelable: boolean; - currentTarget: EventTarget; - defaultPrevented: boolean; - eventPhase: number; - isTrusted: boolean; - nativeEvent: Event; - preventDefault(): void; - stopPropagation(): void; - target: EventTarget; - timeStamp: Date; - type: string; - } - - interface DragEvent extends SyntheticEvent { - dataTransfer: DataTransfer; - } - - interface ClipboardEvent extends SyntheticEvent { - clipboardData: DataTransfer; - } - - interface KeyboardEvent extends SyntheticEvent { - altKey: boolean; - charCode: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - key: string; - keyCode: number; - locale: string; - location: number; - metaKey: boolean; - repeat: boolean; - shiftKey: boolean; - which: number; - } - - interface FocusEvent extends SyntheticEvent { - relatedTarget: EventTarget; - } - - interface FormEvent extends SyntheticEvent { - } - - interface MouseEvent extends SyntheticEvent { - altKey: boolean; - button: number; - buttons: number; - clientX: number; - clientY: number; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - pageX: number; - pageY: number; - relatedTarget: EventTarget; - screenX: number; - screenY: number; - shiftKey: boolean; - } - - interface TouchEvent extends SyntheticEvent { - altKey: boolean; - changedTouches: TouchList; - ctrlKey: boolean; - getModifierState(key: string): boolean; - metaKey: boolean; - shiftKey: boolean; - targetTouches: TouchList; - touches: TouchList; - } - - interface UIEvent extends SyntheticEvent { - detail: number; - view: AbstractView; - } - - interface WheelEvent extends SyntheticEvent { - deltaMode: number; - deltaX: number; - deltaY: number; - deltaZ: number; - } - - // - // Event Handler Types - // ---------------------------------------------------------------------- - - interface EventHandler { - (event: E): void; - } - - interface DragEventHandler extends EventHandler {} - interface ClipboardEventHandler extends EventHandler {} - interface KeyboardEventHandler extends EventHandler {} - interface FocusEventHandler extends EventHandler {} - interface FormEventHandler extends EventHandler {} - interface MouseEventHandler extends EventHandler {} - interface TouchEventHandler extends EventHandler {} - interface UIEventHandler extends EventHandler {} - interface WheelEventHandler extends EventHandler {} - - // - // Props / DOM Attributes - // ---------------------------------------------------------------------- - - interface Props { - children?: ReactNode; - key?: string | number; - ref?: string | ((component: T) => any); - } - - interface DOMAttributes extends Props> { - onCopy?: ClipboardEventHandler; - onCut?: ClipboardEventHandler; - onPaste?: ClipboardEventHandler; - onKeyDown?: KeyboardEventHandler; - onKeyPress?: KeyboardEventHandler; - onKeyUp?: KeyboardEventHandler; - onFocus?: FocusEventHandler; - onBlur?: FocusEventHandler; - onChange?: FormEventHandler; - onInput?: FormEventHandler; - onSubmit?: FormEventHandler; - onClick?: MouseEventHandler; - onDoubleClick?: MouseEventHandler; - onDrag?: DragEventHandler; - onDragEnd?: DragEventHandler; - onDragEnter?: DragEventHandler; - onDragExit?: DragEventHandler; - onDragLeave?: DragEventHandler; - onDragOver?: DragEventHandler; - onDragStart?: DragEventHandler; - onDrop?: DragEventHandler; - onMouseDown?: MouseEventHandler; - onMouseEnter?: MouseEventHandler; - onMouseLeave?: MouseEventHandler; - onMouseMove?: MouseEventHandler; - onMouseOut?: MouseEventHandler; - onMouseOver?: MouseEventHandler; - onMouseUp?: MouseEventHandler; - onTouchCancel?: TouchEventHandler; - onTouchEnd?: TouchEventHandler; - onTouchMove?: TouchEventHandler; - onTouchStart?: TouchEventHandler; - onScroll?: UIEventHandler; - onWheel?: WheelEventHandler; - - dangerouslySetInnerHTML?: { - __html: string; - }; - } - - // This interface is not complete. Only properties accepting - // unitless numbers are listed here (see CSSProperty.js in React) - interface CSSProperties { - boxFlex?: number; - boxFlexGroup?: number; - columnCount?: number; - flex?: number | string; - flexGrow?: number; - flexShrink?: number; - fontWeight?: number | string; - lineClamp?: number; - lineHeight?: number | string; - opacity?: number; - order?: number; - orphans?: number; - widows?: number; - zIndex?: number; - zoom?: number; - - // SVG-related properties - fillOpacity?: number; - strokeOpacity?: number; - strokeWidth?: number; - } - - interface HTMLAttributes extends DOMAttributes { - ref?: string | ((component: HTMLComponent) => void); - - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - async?: boolean; - autoComplete?: boolean; - autoFocus?: boolean; - autoPlay?: boolean; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - checked?: boolean; - classID?: string; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: any; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - defer?: boolean; - dir?: string; - disabled?: boolean; - download?: any; - draggable?: boolean; - encType?: string; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - htmlFor?: string; - httpEquiv?: string; - icon?: string; - id?: string; - label?: string; - lang?: string; - list?: string; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - multiple?: boolean; - muted?: boolean; - name?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - poster?: string; - preload?: string; - radioGroup?: string; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - span?: number; - spellCheck?: boolean; - src?: string; - srcDoc?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: CSSProperties; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string; - width?: number | string; - wmode?: string; - - // Non-standard Attributes - autoCapitalize?: boolean; - autoCorrect?: boolean; - property?: string; - itemProp?: string; - itemScope?: boolean; - itemType?: string; - unselectable?: boolean; - } - - interface SVGAttributes extends DOMAttributes { - ref?: string | ((component: SVGComponent) => void); - - cx?: number | string; - cy?: number | string; - d?: string; - dx?: number | string; - dy?: number | string; - fill?: string; - fillOpacity?: number | string; - fontFamily?: string; - fontSize?: number | string; - fx?: number | string; - fy?: number | string; - gradientTransform?: string; - gradientUnits?: string; - markerEnd?: string; - markerMid?: string; - markerStart?: string; - offset?: number | string; - opacity?: number | string; - patternContentUnits?: string; - patternUnits?: string; - points?: string; - preserveAspectRatio?: string; - r?: number | string; - rx?: number | string; - ry?: number | string; - spreadMethod?: string; - stopColor?: string; - stopOpacity?: number | string; - stroke?: string; - strokeDasharray?: string; - strokeLinecap?: string; - strokeOpacity?: number | string; - strokeWidth?: number | string; - textAnchor?: string; - transform?: string; - version?: string; - viewBox?: string; - x1?: number | string; - x2?: number | string; - x?: number | string; - y1?: number | string; - y2?: number | string - y?: number | string; - } - - // - // React.DOM - // ---------------------------------------------------------------------- - - interface ReactDOM { - // HTML - a: HTMLFactory; - abbr: HTMLFactory; - address: HTMLFactory; - area: HTMLFactory; - article: HTMLFactory; - aside: HTMLFactory; - audio: HTMLFactory; - b: HTMLFactory; - base: HTMLFactory; - bdi: HTMLFactory; - bdo: HTMLFactory; - big: HTMLFactory; - blockquote: HTMLFactory; - body: HTMLFactory; - br: HTMLFactory; - button: HTMLFactory; - canvas: HTMLFactory; - caption: HTMLFactory; - cite: HTMLFactory; - code: HTMLFactory; - col: HTMLFactory; - colgroup: HTMLFactory; - data: HTMLFactory; - datalist: HTMLFactory; - dd: HTMLFactory; - del: HTMLFactory; - details: HTMLFactory; - dfn: HTMLFactory; - dialog: HTMLFactory; - div: HTMLFactory; - dl: HTMLFactory; - dt: HTMLFactory; - em: HTMLFactory; - embed: HTMLFactory; - fieldset: HTMLFactory; - figcaption: HTMLFactory; - figure: HTMLFactory; - footer: HTMLFactory; - form: HTMLFactory; - h1: HTMLFactory; - h2: HTMLFactory; - h3: HTMLFactory; - h4: HTMLFactory; - h5: HTMLFactory; - h6: HTMLFactory; - head: HTMLFactory; - header: HTMLFactory; - hr: HTMLFactory; - html: HTMLFactory; - i: HTMLFactory; - iframe: HTMLFactory; - img: HTMLFactory; - input: HTMLFactory; - ins: HTMLFactory; - kbd: HTMLFactory; - keygen: HTMLFactory; - label: HTMLFactory; - legend: HTMLFactory; - li: HTMLFactory; - link: HTMLFactory; - main: HTMLFactory; - map: HTMLFactory; - mark: HTMLFactory; - menu: HTMLFactory; - menuitem: HTMLFactory; - meta: HTMLFactory; - meter: HTMLFactory; - nav: HTMLFactory; - noscript: HTMLFactory; - object: HTMLFactory; - ol: HTMLFactory; - optgroup: HTMLFactory; - option: HTMLFactory; - output: HTMLFactory; - p: HTMLFactory; - param: HTMLFactory; - picture: HTMLFactory; - pre: HTMLFactory; - progress: HTMLFactory; - q: HTMLFactory; - rp: HTMLFactory; - rt: HTMLFactory; - ruby: HTMLFactory; - s: HTMLFactory; - samp: HTMLFactory; - script: HTMLFactory; - section: HTMLFactory; - select: HTMLFactory; - small: HTMLFactory; - source: HTMLFactory; - span: HTMLFactory; - strong: HTMLFactory; - style: HTMLFactory; - sub: HTMLFactory; - summary: HTMLFactory; - sup: HTMLFactory; - table: HTMLFactory; - tbody: HTMLFactory; - td: HTMLFactory; - textarea: HTMLFactory; - tfoot: HTMLFactory; - th: HTMLFactory; - thead: HTMLFactory; - time: HTMLFactory; - title: HTMLFactory; - tr: HTMLFactory; - track: HTMLFactory; - u: HTMLFactory; - ul: HTMLFactory; - "var": HTMLFactory; - video: HTMLFactory; - wbr: HTMLFactory; - - // SVG - circle: SVGFactory; - defs: SVGFactory; - ellipse: SVGFactory; - g: SVGFactory; - line: SVGFactory; - linearGradient: SVGFactory; - mask: SVGFactory; - path: SVGFactory; - pattern: SVGFactory; - polygon: SVGFactory; - polyline: SVGFactory; - radialGradient: SVGFactory; - rect: SVGFactory; - stop: SVGFactory; - svg: SVGFactory; - text: SVGFactory; - tspan: SVGFactory; - } - - // - // React.PropTypes - // ---------------------------------------------------------------------- - - interface Validator { - (object: T, key: string, componentName: string): Error; - } - - interface Requireable extends Validator { - isRequired: Validator; - } - - interface ValidationMap { - [key: string]: Validator; - } - - interface ReactPropTypes { - any: Requireable; - array: Requireable; - bool: Requireable; - func: Requireable; - number: Requireable; - object: Requireable; - string: Requireable; - node: Requireable; - element: Requireable; - instanceOf(expectedClass: {}): Requireable; - oneOf(types: any[]): Requireable; - oneOfType(types: Validator[]): Requireable; - arrayOf(type: Validator): Requireable; - objectOf(type: Validator): Requireable; - shape(type: ValidationMap): Requireable; - } - - // - // React.Children - // ---------------------------------------------------------------------- - - interface ReactChildren { - map(children: ReactNode, fn: (child: ReactChild) => T): { [key:string]: T }; - forEach(children: ReactNode, fn: (child: ReactChild) => any): void; - count(children: ReactNode): number; - only(children: ReactNode): ReactChild; - } - - // - // Browser Interfaces - // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts - // ---------------------------------------------------------------------- - - interface AbstractView { - styleMedia: StyleMedia; - document: Document; - } - - interface Touch { - identifier: number; - target: EventTarget; - screenX: number; - screenY: number; - clientX: number; - clientY: number; - pageX: number; - pageY: number; - } - - interface TouchList { - [index: number]: Touch; - length: number; - item(index: number): Touch; - identifiedTouch(identifier: number): Touch; - } -} - diff --git a/react/react-jsx.d.ts b/react/react-jsx.d.ts new file mode 100644 index 0000000000..25070734f1 --- /dev/null +++ b/react/react-jsx.d.ts @@ -0,0 +1,147 @@ +// Type definitions for React v0.13.1 (JSX support) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped +/// + +declare module JSX { + interface Element extends React.ReactElement { } + interface ElementClass extends React.Component { } + interface ElementAttributesProperty { props: {}; } + + interface IntrinsicElements { + // HTML + a: React.HTMLAttributes; + abbr: React.HTMLAttributes; + address: React.HTMLAttributes; + area: React.HTMLAttributes; + article: React.HTMLAttributes; + aside: React.HTMLAttributes; + audio: React.HTMLAttributes; + b: React.HTMLAttributes; + base: React.HTMLAttributes; + bdi: React.HTMLAttributes; + bdo: React.HTMLAttributes; + big: React.HTMLAttributes; + blockquote: React.HTMLAttributes; + body: React.HTMLAttributes; + br: React.HTMLAttributes; + button: React.HTMLAttributes; + canvas: React.HTMLAttributes; + caption: React.HTMLAttributes; + cite: React.HTMLAttributes; + code: React.HTMLAttributes; + col: React.HTMLAttributes; + colgroup: React.HTMLAttributes; + data: React.HTMLAttributes; + datalist: React.HTMLAttributes; + dd: React.HTMLAttributes; + del: React.HTMLAttributes; + details: React.HTMLAttributes; + dfn: React.HTMLAttributes; + dialog: React.HTMLAttributes; + div: React.HTMLAttributes; + dl: React.HTMLAttributes; + dt: React.HTMLAttributes; + em: React.HTMLAttributes; + embed: React.HTMLAttributes; + fieldset: React.HTMLAttributes; + figcaption: React.HTMLAttributes; + figure: React.HTMLAttributes; + footer: React.HTMLAttributes; + form: React.HTMLAttributes; + h1: React.HTMLAttributes; + h2: React.HTMLAttributes; + h3: React.HTMLAttributes; + h4: React.HTMLAttributes; + h5: React.HTMLAttributes; + h6: React.HTMLAttributes; + head: React.HTMLAttributes; + header: React.HTMLAttributes; + hr: React.HTMLAttributes; + html: React.HTMLAttributes; + i: React.HTMLAttributes; + iframe: React.HTMLAttributes; + img: React.HTMLAttributes; + input: React.HTMLAttributes; + ins: React.HTMLAttributes; + kbd: React.HTMLAttributes; + keygen: React.HTMLAttributes; + label: React.HTMLAttributes; + legend: React.HTMLAttributes; + li: React.HTMLAttributes; + link: React.HTMLAttributes; + main: React.HTMLAttributes; + map: React.HTMLAttributes; + mark: React.HTMLAttributes; + menu: React.HTMLAttributes; + menuitem: React.HTMLAttributes; + meta: React.HTMLAttributes; + meter: React.HTMLAttributes; + nav: React.HTMLAttributes; + noscript: React.HTMLAttributes; + object: React.HTMLAttributes; + ol: React.HTMLAttributes; + optgroup: React.HTMLAttributes; + option: React.HTMLAttributes; + output: React.HTMLAttributes; + p: React.HTMLAttributes; + param: React.HTMLAttributes; + picture: React.HTMLAttributes; + pre: React.HTMLAttributes; + progress: React.HTMLAttributes; + q: React.HTMLAttributes; + rp: React.HTMLAttributes; + rt: React.HTMLAttributes; + ruby: React.HTMLAttributes; + s: React.HTMLAttributes; + samp: React.HTMLAttributes; + script: React.HTMLAttributes; + section: React.HTMLAttributes; + select: React.HTMLAttributes; + small: React.HTMLAttributes; + source: React.HTMLAttributes; + span: React.HTMLAttributes; + strong: React.HTMLAttributes; + style: React.HTMLAttributes; + sub: React.HTMLAttributes; + summary: React.HTMLAttributes; + sup: React.HTMLAttributes; + table: React.HTMLAttributes; + tbody: React.HTMLAttributes; + td: React.HTMLAttributes; + textarea: React.HTMLAttributes; + tfoot: React.HTMLAttributes; + th: React.HTMLAttributes; + thead: React.HTMLAttributes; + time: React.HTMLAttributes; + title: React.HTMLAttributes; + tr: React.HTMLAttributes; + track: React.HTMLAttributes; + u: React.HTMLAttributes; + ul: React.HTMLAttributes; + "var": React.HTMLAttributes; + video: React.HTMLAttributes; + wbr: React.HTMLAttributes; + + // SVG + svg: React.SVGElementAttributes; + + circle: React.SVGAttributes; + defs: React.SVGAttributes; + ellipse: React.SVGAttributes; + g: React.SVGAttributes; + line: React.SVGAttributes; + linearGradient: React.SVGAttributes; + mask: React.SVGAttributes; + path: React.SVGAttributes; + pattern: React.SVGAttributes; + polygon: React.SVGAttributes; + polyline: React.SVGAttributes; + radialGradient: React.SVGAttributes; + rect: React.SVGAttributes; + stop: React.SVGAttributes; + text: React.SVGAttributes; + tspan: React.SVGAttributes; + } +} diff --git a/react/react.d.ts b/react/react.d.ts index 0b202f20e8..b23a8240ea 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -1,9 +1,9 @@ -// Type definitions for React v0.13.1 (external module) +// Type definitions for React v0.13.1 (internal and external module) // Project: http://facebook.github.io/react/ // Definitions by: Asana , AssureSign // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module "react" { +declare module React { // // React Elements // ---------------------------------------------------------------------- @@ -518,6 +518,11 @@ declare module "react" { unselectable?: boolean; } + interface SVGElementAttributes extends HTMLAttributes { + viewBox?: string; + preserveAspectRatio?: string; + } + interface SVGAttributes extends DOMAttributes { ref?: string | ((component: SVGComponent) => void); @@ -779,3 +784,6 @@ declare module "react" { } } +declare module "react" { + export = React; +} From 95ddb113e8111ff5ad5af31778e2ccf302c1e1df Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Jun 2015 19:16:35 +0200 Subject: [PATCH 0232/2220] added eqjs definitions --- eqjs/eqjs.d.ts | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 eqjs/eqjs.d.ts diff --git a/eqjs/eqjs.d.ts b/eqjs/eqjs.d.ts new file mode 100644 index 0000000000..b9a39856ec --- /dev/null +++ b/eqjs/eqjs.d.ts @@ -0,0 +1,66 @@ +// Type definitions for eq.js +// Project: https://github.com/Snugug/eq.js +// Definitions by: Stephen Lautier +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare var eqjs: eqjs.EqjsStatic; + + // Support AMD require +declare module 'eqjs' { + export = eqjs; +} + +declare module eqjs { + + interface EqjsStatic { + + /** + * List of all nodes. + */ + nodes: EqjsNodesTable; + + /** + * Number of nodes in eqjs.nodes. + */ + nodesLength: number; + + /** + * Runs through all nodes and finds their widths and points + * @param nodes + * @param callback function to use as a callback once query and nodeWrites have finished + */ + query(nodes: HTMLElement[]|JQuery, callback?: Function): void; + + /** + * Refreshes the list of nodes for eqjs to work with + */ + refreshNodes(): void; + + /** + * Sorts a simple object (key: value) by value and returns a sorted object. + * @param obj e.g. "small: 380, medium: 490, large: 600" + * @returns {} + */ + sortObj(obj: string): EqjsKeyValuePair; + + /** + * Runs through all nodes and writes their eq status. + * @param nodes An array or NodeList of nodes to query + * @returns {} + */ + nodeWrites(nodes?: HTMLElement[]|JQuery); + } + + interface EqjsKeyValuePair { + key: string; + value: number; + } + + interface EqjsNodesTable { + [key: string]: HTMLElement; + } + +} + +// Support jQuery selectors. +interface JQuery { } \ No newline at end of file From 432d6563a69fa1a71e3305394dbc629d7cfd95d5 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 23 Jun 2015 10:23:54 -0700 Subject: [PATCH 0233/2220] Update angular-translate to return module name. --- angular-translate/angular-translate.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index 87a75439b2..1abb13ae81 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -5,6 +5,11 @@ /// +declare module "angular-translate" { + var _: string; + export = _; +} + declare module angular.translate { interface ITranslationTable { From 75e849a4e07d17f44e15f00d2d251260b352df53 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 23 Jun 2015 11:30:21 -0700 Subject: [PATCH 0234/2220] Add Microsoft attribute URL --- react/react-jsx.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/react-jsx.d.ts b/react/react-jsx.d.ts index 25070734f1..26ee4b2201 100644 --- a/react/react-jsx.d.ts +++ b/react/react-jsx.d.ts @@ -1,6 +1,6 @@ // Type definitions for React v0.13.1 (JSX support) // Project: http://facebook.github.io/react/ -// Definitions by: Asana , AssureSign , Microsoft +// Definitions by: Asana , AssureSign , Microsoft // Definitions: https://github.com/borisyankov/DefinitelyTyped /// From ab1501ff39245a2193ce00ada980170321404ce3 Mon Sep 17 00:00:00 2001 From: slozier Date: Tue, 23 Jun 2015 15:57:21 -0400 Subject: [PATCH 0235/2220] Make getRenderedRange arguments optional The getRenderedRange arguments are optional. https://github.com/mleibman/SlickGrid/wiki/Slick.Grid#getRenderedRange --- slickgrid/SlickGrid.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slickgrid/SlickGrid.d.ts b/slickgrid/SlickGrid.d.ts index 904e4f1271..cfdd3c690a 100644 --- a/slickgrid/SlickGrid.d.ts +++ b/slickgrid/SlickGrid.d.ts @@ -1172,7 +1172,7 @@ declare module Slick { public updateCell(row: number, cell: number): void; public updateRow(row: number): void; public getViewport(viewportTop?: number, viewportLeft?: number): Viewport; - public getRenderedRange(viewportTop: number, viewportLeft: number): Viewport; + public getRenderedRange(viewportTop?: number, viewportLeft?: number): Viewport; public resizeCanvas(): void; public updateRowCount(): void; public scrollRowIntoView(row: number, doPaging: boolean): void; From f7803b5aac1e082f2555dac477016629cc394693 Mon Sep 17 00:00:00 2001 From: David Lipowicz Date: Tue, 23 Jun 2015 14:30:08 -0700 Subject: [PATCH 0236/2220] Made a few small changes to address merge feedback. --- sigmajs/sigmajs.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sigmajs/sigmajs.d.ts b/sigmajs/sigmajs.d.ts index 985686ad45..fbc9bf45dd 100644 --- a/sigmajs/sigmajs.d.ts +++ b/sigmajs/sigmajs.d.ts @@ -21,9 +21,9 @@ declare module SigmaJs{ } interface Canvas { - edges: {[renderType: string]: Function}; - labels: {[renderType: string]: Function}; - nodes: {[renderType: string]: Function}; + edges: {[renderType: string]: (edge: Edge, source: Node, target: Node, ...a:any[]) => void}; + labels: {[renderType: string]: (node: Node, ...a:any[]) => void}; + nodes: {[renderType: string]: (node: Node, ...a:any[]) => void}; } interface Classes { From 78aab4f0cb9001f86fae64f284276ab783912135 Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 24 Jun 2015 01:14:36 +0200 Subject: [PATCH 0237/2220] added tests + several refinements --- eqjs/eqjs.d.ts | 13 +++++++------ eqjs/eqjs.tests.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 eqjs/eqjs.tests.ts diff --git a/eqjs/eqjs.d.ts b/eqjs/eqjs.d.ts index b9a39856ec..9ff2d34683 100644 --- a/eqjs/eqjs.d.ts +++ b/eqjs/eqjs.d.ts @@ -5,12 +5,13 @@ declare var eqjs: eqjs.EqjsStatic; - // Support AMD require +// Support AMD require declare module 'eqjs' { export = eqjs; } declare module eqjs { + type AvailableElementType = HTMLElement|HTMLElement[]|NodeList|JQuery; interface EqjsStatic { @@ -29,7 +30,7 @@ declare module eqjs { * @param nodes * @param callback function to use as a callback once query and nodeWrites have finished */ - query(nodes: HTMLElement[]|JQuery, callback?: Function): void; + query(nodes: AvailableElementType, callback?: Function): void; /** * Refreshes the list of nodes for eqjs to work with @@ -41,14 +42,14 @@ declare module eqjs { * @param obj e.g. "small: 380, medium: 490, large: 600" * @returns {} */ - sortObj(obj: string): EqjsKeyValuePair; + sortObj(obj: string): EqjsKeyValuePair[]; /** * Runs through all nodes and writes their eq status. * @param nodes An array or NodeList of nodes to query * @returns {} */ - nodeWrites(nodes?: HTMLElement[]|JQuery); + nodeWrites(nodes?: AvailableElementType): void; } interface EqjsKeyValuePair { @@ -57,9 +58,9 @@ declare module eqjs { } interface EqjsNodesTable { - [key: string]: HTMLElement; + [index: number]: HTMLElement; } - + } // Support jQuery selectors. diff --git a/eqjs/eqjs.tests.ts b/eqjs/eqjs.tests.ts new file mode 100644 index 0000000000..1113604f22 --- /dev/null +++ b/eqjs/eqjs.tests.ts @@ -0,0 +1,28 @@ +/// +/// + +var nodes = document.getElementsByClassName(".test-container"); +var node = document.getElementById("#test-container"); +var $nodes = $(".selector"); + +eqjs.query(node); +eqjs.query(node, () => { }); +eqjs.query(nodes); +eqjs.query($nodes); + +var nodesCount: number = eqjs.nodesLength; + +eqjs.refreshNodes(); + +eqjs.nodeWrites(); +eqjs.nodeWrites(node); +eqjs.nodeWrites(nodes); +eqjs.nodeWrites($nodes); + +var sortMap = eqjs.sortObj("small: 380, medium: 490, large: 600"); +var sortFirstKey = sortMap[0].key; +var sortFirstValue = sortMap[0].value; + +var nodesMap = eqjs.nodes; + +var ele: HTMLElement = nodesMap[1]; From 16fc716b851e3b841c6fde1d9397c3ff146eff8c Mon Sep 17 00:00:00 2001 From: sourcebits-robertbiggs Date: Tue, 23 Jun 2015 16:35:02 -0700 Subject: [PATCH 0238/2220] Added declaration file and tests for ChUI. This declaration file is for chui at https://www.npmjs.com/package/chui --- chui/chui-tests.ts | 97 ++++ chui/chui.d.ts | 1262 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1359 insertions(+) create mode 100644 chui/chui-tests.ts create mode 100644 chui/chui.d.ts diff --git a/chui/chui-tests.ts b/chui/chui-tests.ts new file mode 100644 index 0000000000..60cbe5afd6 --- /dev/null +++ b/chui/chui-tests.ts @@ -0,0 +1,97 @@ +/// +/// + +$(function() { + + /** + * Test static methods: + */ + var concatenatedText = $.concat("This", "is", "text", "to", "contatenate."); + $.forEach([1,2,3], function(ctx) { + return ctx; + }); + $.forEach([1,2,3], function(ctx, idx) { + return idx; + }); + + var isiPhone = $.isiPhone; + var isAndroid = $.isAndroid; + var isWinPhone = $.isWinPhone; + + $('li').on($.eventStart, function(){ + return; + }); + $('li').on($.eventEnd, function(){ + return; + }); + $('li').on($.eventMove, function(){ + return; + }); + $('li').on($.eventCancel, function(){ + return; + }); + + var browserVersion = $.browserVersion(); + $.UIHideNavBar(); + $.UIShowNavBar(); + $.UIGoToArticle("#main"); + $.UIGoBack(); + $.UIGoBackToArticle("#main"); + $.UIBlock(); + $.UIBlock(.5); + $.UIUnblock(); + $.UIPopup({id: "myPopup", message: 'Hello!!!'}); + $.UIPopup({message: 'Hello!!!', title: "Whatever", callback: $.noop}); + $.UIPopup({message: 'Hello!!!', cancleButton: "Forget It!", continueButton: "OK"}); + $.UIPopover({id: "myPopover"}); + $.UIPopover({callback: function() {}}); + $.UIPopover({title: "Whatever"}); + $.UIPopover({id: "myPopover", callback: function() {}, title: "Whatever"}); + $.UIPopoverClose(); + $.UICreateSegmented({id: "mySegmentedControl", labels : ['first','second','third'], selected: 0, className: "special"}); + $.UIPaging(); + $.UISheet({id: "mySheet", listClass: "specialList", background: 'red', handle: false}); + $.UIShowSheet("#mySheet"); + $.UIHideSheet(); + $.UISlideout({position: "right", dynamic: false, callback: $.noop}); + var myStepper = $('#myStepper'); + $.UIResetStepper(myStepper); + $.UICreateSwitch({id: "mySwitch", value: 5, checked: "true", callback: $.noop}); + $.UITabbar({tabs: 3, labels: ["one", "two", "three"], selected: 2}); + $.UISearch({articleId: "#main", placehold: "Looking?", results: 10}); + var carouselPanels = $('li'); + $.UISetupCarousel({target: "#carousel", panels: carouselPanels}); + $.UIBindData(); + $.UIBindData("#myBoundData"); + $.UIUnBindData(); + $.UIUnBindData("#myBoundData"); + + /** + * Test plugin methods: + */ + $("li").forEach(function(ctx, idx) { + console.log(ctx.nodeName + ": " + idx); + }); + $('li').iz(".selected").hide(); + $('li').iznt(".selected").show(); + $('li').haz("span").hide(); + $('li').haznt("span").show(); + $('li').hazClass(".selected").hide(); + $('li').hazntClass(".selected").show(); + $('li').hazAttr("disabled").hide(); + $('li').hazntAttr("disabled").show(); + $('#main').bind("singletap", function() { + return; + }); + $('#main').UICenter(); + $('#main').UIBusy({size: "120px", color: "red", duration: "5000ms"}); + $('#myPopup').UIPopupClose(); + $('#mySegementedControl').UISegmented({selected: 2, callback: $.noop}); + $("#panelToggler").UIPanelToggle("#togglePanels", $.noop); + $('#editList').UIEditList({callback: $.noop, deletable: false, movable: true}); + $('#mySelectList').UISelectList(); + $('#myStepper').UIStepper({start: 1, end: 10, defautValue: 5}); + $('#mySwitch').UISwitch(); + $('#myRangeControl').UIRange(); + +}); \ No newline at end of file diff --git a/chui/chui.d.ts b/chui/chui.d.ts new file mode 100644 index 0000000000..3b8fe70c27 --- /dev/null +++ b/chui/chui.d.ts @@ -0,0 +1,1262 @@ + +// Type definitions for chui v3.8.9 +// Project: https://github.com/chocolatechipui/chocolatechip-ui +// Definitions by: Robert Biggs +// Definitions: https://github.com/borisyankov/DefinitelyTyped +/** + These TypeScript delcarations for ChocolateChip-UI contain interfaces for both jQuery and ChocolateChipJS. Depending on which library you are using, you will get the type interfaces appropriate for it. +*/ +/** + * Interface for ChocolateChipJS. + */ +interface ChocolateChipStatic extends ChuiDetectors { + /** + * This method will concatenate strings or values as a cleaner alternative to using the '+' operator. + * + * @param string or number A comma separated series of strings to concatenate. + * @return string + */ + concat(...string: string[]): string; + + + /** + * This function replicates normal array iteration with the context first, followed by the index. + * Usage: $.forEach([1,2,3], function(ctx, idx) { console.log(ctx + "is: " + (idx + 1)) }); + * + * @param obj An array-like object. This will usually be an array of HTML elements. + * @param callback A callback to execute with each iteration of the object. + * @param args Any extra arguments you wish to pass. + * @return void + */ + forEach(obj: T[], callback: (ctx: T, idx?: number) => any, args?: any): any; + + /** + * Alias for cross-platform events: pointerdown, MSPointerDown, touchstart and mousedown. + */ + eventStart: ChUIEventInterface; + + /** + * Alias for cross-platform events: pointerup, MSPointerUp, touchend and mouseup. + */ + eventEnd: ChUIEventInterface; + + /** + * Alias for cross-platform events: pointermove, MSPointerMove, touchmove and mousemove. + */ + eventMove: ChUIEventInterface; + + /** + * Alias for cross-platform events: pointercancel, MSPointerCancel, touchcancel and mouseout. + */ + eventCancel: ChUIEventInterface; + + + /** + * Return the version of the current browser. + * + * @return string The current browser version. + */ + browserVersion(): number; + + /** + * Hide the navigation bar, raising up the content below it. + */ + UIHideNavBar(): void; + + /** + * If the navigation bar is hidden, show it, pushing down the content to make room. + */ + UIShowNavBar(): void; + + /** + * Determine whether navigation is in progress or not. + */ + isNavigating: boolean; + + /** + * Navigate to the article indicated by the provided destination ID. This enters the destination into the navigation history array. + * + * param destination An id for the article to navigate to. + */ + UIGoToArticle(destination: string): void; + + /** + * Go back to the previous article from whence you came. This resets the navigation history array. + */ + UIGoBack(): void; + + /** + * Go back to the article indicated by the provided ID. This is for non-linear back navigation. This will reset the navigation history array to match the current state. + */ + UIGoBackToArticle(articleID: string): void; + + /** + * Display a transparent screen over the UI. This takes an optional, decimal-based number for opacity: .5 for 50%. + * + * @param opacity The percentage of opacity for the screen. + */ + UIBlock(opacity?: number): void; + + /** + * Remove the transparent screen covering the UI. + */ + UIUnblock(): void; + + /** + * Create and show a Popup with title and message. Possible options: {id: "#myPopup", title: "My Popup", + * message: "Woohoo!", cancelButton: "Forget It!", contiueButton: "Whatever", callback: function() {console.log('Blah!');}, empty: false }. + * + * param options UIPopupOptions + */ + UIPopup(options: UIPopupOptions): void; + + /** + * Create and show a Popover. Options: {id: "#myPopover", title: "Whatever", callback: function() {console.log('Blah!');}}. + * + * param options UIPopoverOptions + */ + UIPopover(options: UIPopoverOptions): void; + + /** + * Close any currently visible popovers. + */ + UIPopoverClose(): void; + + /** + * Create a segmented control: {id: "mySegments", className: "seggie", labels: ["one", "two","three"], selected: 1} + * + * param: options UICreateSegmentedOptions + */ + UICreateSegmented(options: UICreateSegmentedOptions): ChocolateChipElementArray; + + /** + * Initialize a horiontal or vertical paging control. This uses a segmented control in the navigation bar with a class + * like "segmented paging horizontal" or "segmented paging vertical". It uses a single article with multiple sections to paginate. + */ + UIPaging(): void; + + /** + * Creates a sheet. Minimum option is an id: {id : 'starTrek', listClass :'enterprise', background: 'transparent', handle: false } + */ + UISheet(options: UISheetOptions): void; + + /** + * Show a sheet by passing this its ID. + */ + UIShowSheet(id?: string): void; + + /** + * Hide any currently displayed sheets. + */ + UIHideSheet(): void; + + /** + * The body tag wrapped and ready to use: $.body.css('background-color','orange') + */ + body: ChocolateChipElementArray; + + /** + * An array of the navigation history. Do not manipulate this. For examination only. This is used by navigation lists, etc. + */ + UINavigationHistory: string[]; + + /** + * Creates and initializes a slide out menu. Possible options: {dynamic: true, callback: function() { alert("Woohoo!");}} + */ + UISlideout: UISlideoutInterface; + + /** + * Reset the value of the stepper to its defaults at initialization. Pass it a reference to the stepper to reset. It takes a stepper element: $("#myStepper"). + * + * @param stepper A stepper to reset. + */ + UIResetStepper(stepper: ChocolateChipElementArray): void; + + /** + * Create a switch control. Possible options: { id: '#myId', name: 'fruit.mango', state: 'on', value: 'Mango', checked: 'on', style: 'traditional', callback: function() { alert('hi');}} + */ + UICreateSwitch(options: UICreateSwitchOptions): void; + + /** + * Creates a tabbar. On iOS this is at the bottom of the screen. On Android and Windows, it is at the top. + * Options: {id: 'mySpecialTabbar', tabs: 4, labels: ["Refresh", "Add", "Info", "Downloads", "Favorite"], icons: ["refresh", "add", "info", "downloads", "favorite"], selected: 2 } + */ + UITabbar(options: UITabbarOptions): void; + + /** + * Create a search bar for an article. Options: { articleId: '#products', id: 'productSearch', placeholder: 'Find a product', results: 5 } + */ + UISearch(options: UISearchOptions): void; + + /** + * Create and initialize a swipable carousel. Options: {target : '#myCarousel', panels: ['

    stuff

    ','

    more

    '], loop: true, pagination: true } + */ + UISetupCarousel(options: UISetupCarouselOptions): void; + + /** + * Bind the values of data-models to elements with data-controllers:

    . + * You can bind a single model to its controller by providing its name as the argument: $.UIBindData('input-value'); + * + * @param controller A string indicating the controller whose value a model is bound to. + */ + UIBindData(controller?: string): void; + + /** + * Unbind the values of data-models from their data-controllers. + * If you provide a controller name as the argument, only that controller will be unbound. + * + * @param controller A controller to unbind. + */ + UIUnBindData(controller?: string): void; + +} + +/** + * Interface for ChocolateChipJS Element Array. + */ +interface ChocolateChipElementArray { + + /** + * Iterate over an Array object, executing a function for each matched element. + */ + + forEach(func: (ctx: any, idx: number) => void): void; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + iz(selector: string): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + iz(element: any): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + iznt(selector: string): ChocolateChipElementArray; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + iznt(element: any): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + haz(selector: string): ChocolateChipElementArray; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param element A DOM element to match elements against. + */ + haz(element: Element): ChocolateChipElementArray; + + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + haznt(selector: string): ChocolateChipElementArray; + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param element A DOM element to match elements against. + */ + haznt(element: Element): ChocolateChipElementArray; + + /** + * Return any of the matched elements that have the given class. + * + * @param className The class name to search for. + */ + hazClass(className: string): ChocolateChipElementArray; + + /** + * Return any of the matched elements that do not have the given class. + * + * @param className The class name to search for. + */ + hazntClass(className: string): ChocolateChipElementArray; + + + /** + * Return any of the matched elements that have the given attribute. + * + * @param className The class name to search for. + */ + hazAttr(attributeName: string): ChocolateChipElementArray; + + /** + * Return any of the matched elements that do not have the given attribute. + * + * @param className The class name to search for. + */ + hazntAttr(attributeName: string): ChocolateChipElementArray; + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + */ + bind(eventType: string | ChUIEventInterface, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Remove a handler for an event from the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + */ + unbind(eventType: string | ChUIEventInterface, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a delegated event to listen for the provided event on the descendant elements. + * + * @param selector A string defining the descendant elements to listen on for the designated event. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. The keyword "this" will refer + * to the element receiving the event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + */ + delegate(selector: any, eventType: string | ChUIEventInterface, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a delegated event to listen for the provided event on the descendant elements. + * + * @param selector A string defining the descendant elements are listening for the event. + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + */ + undelegate(selector: any, eventType: string | ChUIEventInterface, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic; + + /** + * Add a handler to an event for elements. If a selector is provided as the second argument, this implements a delegated event. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param selector A string defining the descendant elements are listening for the event. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + */ + on( eventType: string | ChUIEventInterface, selector: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; + + /** + * Remove a handler for an event from the elements. If the second argument is a selector, it tries to undelegate the event. + * If no arugments are provided, it removes all events from the element(s). + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param selector A string defining the descendant elements are listening for the event. + * @param handler A function handler assigned to this event. + * @param useCapture Setting the third argument to true will trigger event bubbling. The default is false. + */ + off( eventType?: string | ChUIEventInterface, selector?: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic; + + /** + * + */ + trigger(eventType: string | ChUIEventInterface): void; + + /** + * Center an element to the screen. + */ + UICenter(): void; + + /** + * Display a busy indicator. Posible options: {size: "100px", color: "#ff0000", position: "align-flush", duration: "2s"}. + * + * @param size The size as a string with length identifier: "40px". + * @param color The color for the busy indicator: "#ff0000". + * @param position Optional positioning, such as "align-flush". + * @param duration The time for the busy indicator to display: "500ms". + */ + UIBusy(options: UIBusyOptions): void; + + /** + * Close the currently displayed Popup. This is executed on the popup: $('#myPopup').UIPopupClose(). + */ + UIPopupClose(): void; + + /** + * Initialize a segmented control. Options: {selected: 2, callback: function() {console.log('Blah');}} + */ + UISegmented(options: UISegmentedOptions): void; + + /** + * This method allows the user to use a segmented control to toggle a set of panels. It is executed on the segmented control. + * The options id is the contain of the panels. The options callback is to execute when the user toggles a panel. + */ + UIPanelToggle(panelsContainer: string, callback: () => any): void; + + /** + * Make a list editable. This can be enabling changing the order of list items, or deleting them, or both. Options: {editLabel: "Edit", doneLabel: "Done", + * deleteLabel: "Delete", callback: function() {alert('Bye bye!');}, deletable: true, movable: true}. + */ + UIEditList(options: UIEditListOptions): void; + + /** + * Convert a simple list into a selection list. This converts the list into a radio button group, meaning only one can be selected at any time. + * You can name the radios buttons using the options name. Options: {name: "selectedNamesGroup", selected: 2, callback: function() {alert('hi');}} + */ + UISelectList(): void; + + /** + * Create a stepper control by executing it on a span with the class "stepper". Possible options: {start: 0, end: 10, defaultValue: 3}. + */ + UIStepper(options: UIStepperOptions): void; + + /** + * Initialize any existing switch controls: $('.switch').UISwitch(); + */ + UISwitch(): void; + + /** + * Execute this on a range control to initialize it. + */ + UIRange(): void; +} + +/** + * Interface for jQuery + */ + +interface JQueryStatic extends ChuiDetectors { + /** + * This method will concatenate strings or values as a cleaner alternative to using the '+' operator. + * + * @param string or number A comma separated series of strings to concatenate. + * @return string + */ + concat(...string: string[]): string; + + /** + * This function replicates normal array iteration with the context first, followed by the index. + * Usage: $.forEach([1,2,3], function(ctx, idx) { console.log(ctx + "is: " + (idx + 1)) }); + * + * @param obj An array-like object. This will usually be an array of HTML elements. + * @param callback A callback to execute with each iteration of the object. + * @param args Any extra arguments you wish to pass. + * @return void + */ + forEach(obj: T[], callback: (ctx: T, idx?: number) => any, args?: any): any; + + /** + * Alias for cross-platform events: pointerdown, MSPointerDown, touchstart and mousedown. + */ + eventStart: ChUIEventInterface; + + /** + * Alias for cross-platform events: pointerup, MSPointerUp, touchend and mouseup. + */ + eventEnd: ChUIEventInterface; + + /** + * Alias for cross-platform events: pointermove, MSPointerMove, touchmove and mousemove. + */ + eventMove: ChUIEventInterface; + + /** + * Alias for cross-platform events: pointercancel, MSPointerCancel, touchcancel and mouseout. + */ + eventCancel: ChUIEventInterface; + + /** + * Return the version of the current browser. + */ + browserVersion(): number; + + /** + * Hide the navigation bar, raising up the content below it. + */ + UIHideNavBar(): void; + + /** + * If the navigation bar is hidden, show it, pushing down the content to make room. + */ + UIShowNavBar(): void; + + /** + * Determine whether navigation is in progress or not. + */ + isNavigating: boolean; + + /** + * Navigate to the article indicated by the provided destination ID. This enters the destination into the navigation history array. + * + * param destination An id for the article to navigate to. + */ + UIGoToArticle(destination: string): void; + + /** + * Go back to the previous article from whence you came. This resets the navigation history array. + */ + UIGoBack(): void; + + /** + * Go back to the article indicated by the provided ID. This is for non-linear back navigation. This will reset the navigation history array to match the current state. + */ + UIGoBackToArticle(articleID: string): void; + + /** + * Display a transparent screen over the UI. This takes an optional, decimal-based number for opacity: .5 for 50%. + * + * @param opacity The percentage of opacity for the screen. + */ + UIBlock(opacity?: number): void; + + /** + * Remove the transparent screen covering the UI. + */ + UIUnblock(): void; + + /** + * Create and show a Popup with title and message. Possible options: {id: "#myPopup", title: "My Popup", + * message: "Woohoo!", cancelButton: "Forget It!", contiueButton: "Whatever", callback: function() {console.log('Blah!');}, empty: false }. + * + * param options UIPopupOptions + */ + UIPopup(options: UIPopupOptions): void; + + /** + * Create and show a Popover. Options: {id: "#myPopover", title: "Whatever", callback: function() {console.log('Blah!');}}. + * + * param options UIPopoverOptions + */ + UIPopover(options: UIPopoverOptions): void; + + /** + * Close any currently visible popovers. + */ + UIPopoverClose(): void; + + /** + * Create a segmented control: {id: "mySegments", className: "seggie", labels: ["one", "two","three"], selected: 1} + * + * param: options UICreateSegmentedOptions + */ + UICreateSegmented(options: UICreateSegmentedOptions): JQuery; + + /** + * Initialize a horiontal or vertical paging control. This uses a segmented control in the navigation bar with a class + * like "segmented paging horizontal" or "segmented paging vertical". It uses a single article with multiple sections to paginate. + */ + UIPaging(): void; + + /** + * Creates a sheet. Minimum option is an id: {id : 'starTrek', listClass :'enterprise', background: 'transparent', handle: false } + */ + UISheet(options: UISheetOptions): void; + + /** + * Show a sheet by passing this its ID. + */ + UIShowSheet(id: string): void; + + /** + * Hide any currently displayed sheets. + */ + UIHideSheet(): void; + + /** + * The body tag wrapped and ready to use: $.body.css('background-color','orange') + */ + body: JQuery; + + /** + * An array of the navigation history. Do not manipulate this. For examination only. This is used by navigation lists, etc. + */ + UINavigationHistory: string[]; + + /** + * Creates and initializes a slide out menu. Possible options: {dynamic: true, callback: function() { alert("Woohoo!");}} + */ + UISlideout: UISlideoutInterface; + + /** + * Reset the value of the stepper to its defaults at initialization. Pass it a reference to the stepper to reset. + */ + UIResetStepper(stepper: JQuery): void; + + /** + * Create a switch control. Possible options: { id: '#myId', name: 'fruit.mango', state: 'on', value: 'Mango', checked: 'on', style: 'traditional', callback: function() { alert('hi');}} + */ + UICreateSwitch(options: UICreateSwitchOptions): void; + + /** + * Creates a tabbar. On iOS this is at the bottom of the screen. On Android and Windows, it is at the top. + * Options: {id: 'mySpecialTabbar', tabs: 4, labels: ["Refresh", "Add", "Info", "Downloads", "Favorite"], icons: ["refresh", "add", "info", "downloads", "favorite"], selected: 2 } + */ + UITabbar(options: UITabbarOptions): void; + + /** + * Create a search bar for an article. Options: { articleId: '#products', id: 'productSearch', placeholder: 'Find a product', results: 5 } + */ + UISearch(options: UISearchOptions): void; + + /** + * Create and initialize a swipable carousel. Options: {target : '#myCarousel', panels: ['

    stuff

    ','

    more

    '], loop: true, pagination: true } + */ + UISetupCarousel(options: UISetupCarouselOptions): void; + + /** + * Bind the values of data-models to elements with data-controllers:

    . + * You can bind a single model to its controller by providing its name as the argument: $.UIBindData('input-value'); + * + * @param controller A string indicating the controller whose value a model is bound to. + */ + UIBindData(controller?: string): void; + + /** + * Unbind the values of data-models from their data-controllers. + * If you provide a controller name as the argument, only that controller will be unbound. + * + * @param controller A controller to unbind. + */ + UIUnBindData(controller?: string): void; + +} + +/** + * Interface for jQuery + */ +interface JQuery { + + /** + * Iterate over an Array object, executing a function for each matched element. + */ + //forEach(func: (ctx: any, idx: number) => void, JQuery: any): void; + forEach(callback: (ctx: Element, idx: number) => any): JQuery; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + iz(selector: string): JQuery; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it matches the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + iz(element: any): JQuery; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param selector A string containing a selector expression to match elements against. + */ + iznt(selector: string): JQuery; + + /** + * Check the current matched set of elements against a selector or element and return it + * if it does not match the given arguments. + * + * @param elements One or more elements to match the current set of elements against. + */ + iznt(element: any): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + haz(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ + haz(contained: Element): JQuery; + + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param selector A string containing a selector expression to match elements against. + */ + haznt(selector: string): JQuery; + /** + * Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element. + * + * @param contained A DOM element to match elements against. + */ + haznt(contained: Element): JQuery; + + /** + * Return any of the matched elements that have the given class. + * + * @param className The class name to search for. + */ + hazClass(className: string): JQuery; + + /** + * Return any of the matched elements that do not have the given class. + * + * @param className The class name to search for. + */ + hazntClass(className: string): JQuery; + + + /** + * Return any of the matched elements that have the given attribute. + * + * @param className The class name to search for. + */ + hazAttr(attributeName: string): JQuery; + + /** + * Return any of the matched elements that do not have the given attribute. + * + * @param className The class name to search for. + */ + hazntAttr(attributeName: string): JQuery; + + /** + * Center an element to the screen. + */ + UICenter(): void; + + /** + * Display a busy indicator. Posible options: {size: "100px", color: "#ff0000", position: "align-flush", duration: "2s"}. + * + * @param size The size as a string with length identifier: "40px". + * @param color The color for the busy indicator: "#ff0000". + * @param position Optional positioning, such as "align-flush". + * @param duration The time for the busy indicator to display: "500ms". + */ + UIBusy(options: UIBusyOptions): void; + + /** + * Close the currently displayed Popup. This is executed on the popup: $('#myPopup').UIPopupClose(). + */ + UIPopupClose(): void; + + /** + * Initialize a segmented control. Options: {selected: 2, callback: function() {console.log('Blah');}} + */ + UISegmented(options: UISegmentedOptions): void; + + /** + * This method allows the user to use a segmented control to toggle a set of panels. It is executed on the segmented control. + * The options id is the contain of the panels. The options callback is to execute when the user toggles a panel. + */ + UIPanelToggle(panelsContainer: string, callback: () => any): void; + + /** + * Make a list editable. This can be enabling changing the order of list items, or deleting them, or both. Options: {editLabel: "Edit", doneLabel: "Done", + * deleteLabel: "Delete", callback: function() {alert('Bye bye!');}, deletable: true, movable: true}. + */ + UIEditList(options: UIEditListOptions): void; + + /** + * Convert a simple list into a selection list. This converts the list into a radio button group, meaning only one can be selected at any time. + * You can name the radios buttons using the options name. Options: {name: "selectedNamesGroup", selected: 2, callback: function() {alert('hi');}} + */ + UISelectList(): void; + + /** + * Create a stepper control by executing it on a span with the class "stepper". Possible options: {start: 0, end: 10, defaultValue: 3}. + */ + UIStepper(options: UIStepperOptions): void; + + /** + * Initialize any existing switch controls: $('.switch').UISwitch(); + */ + UISwitch(): void; + + /** + * Execute this on a range control to initialize it. + */ + UIRange(): void; + + + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string | ChUIEventInterface, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute each time the event is triggered. + */ + bind(eventType: string | ChUIEventInterface, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param eventData An object containing data that will be passed to the event handler. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string | ChUIEventInterface, eventData: any, preventBubble: boolean): JQuery; + /** + * Attach a handler to an event for the elements. + * + * @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names. + * @param preventBubble Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true. + */ + bind(eventType: string | ChUIEventInterface, preventBubble: boolean): JQuery; + + + delegate(selector: any, eventType: string | ChUIEventInterface, handler: (eventObject: JQueryEventObject) => any): JQuery; + delegate(selector: any, eventType: string | ChUIEventInterface, eventData: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param selector A selector which should match the one originally passed to .on() when attaching event handlers. + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string | ChUIEventInterface, selector?: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove an event handler. + * + * @param events One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin". + * @param handler A handler function previously attached for the event(s), or the special value false. + */ + off(events: string | ChUIEventInterface, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. Rest parameter args is for optional parameters passed to jQuery.trigger(). Note that the actual parameters on the event handler function must be marked as optional (? syntax). + */ + on(events: string | ChUIEventInterface, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string | ChUIEventInterface, data : any, handler: (eventObject: JQueryEventObject, ...args: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string | ChUIEventInterface, selector: string, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + /** + * Attach an event handler function for one or more events to the selected elements. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + on(events: string | ChUIEventInterface, selector: string, data: any, handler: (eventObject: JQueryEventObject, ...eventData: any[]) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string | ChUIEventInterface, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names. + * @param data An object containing data that will be passed to the event handler. + * @param handler A function to execute at the time the event is triggered. + */ + one(events: string | ChUIEventInterface, data: Object, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string | ChUIEventInterface, selector: string, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Attach a handler to an event for the elements. The handler is executed at most once per element per event type. + * + * @param events One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin". + * @param selector A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element. + * @param data Data to be passed to the handler in event.data when an event is triggered. + * @param handler A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false. + */ + one(events: string | ChUIEventInterface, selector: string, data: any, handler: (eventObject: JQueryEventObject) => any): JQuery; + + /** + * Execute all handlers and behaviors attached to the matched elements for the given event type. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters Additional parameters to pass along to the event handler. + */ + trigger(eventType: string | ChUIEventInterface, extraParameters?: any[]|Object): JQuery; + + /** + * Execute all handlers attached to an element for an event. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param extraParameters An array of additional parameters to pass along to the event handler. + */ + triggerHandler(eventType: string | ChUIEventInterface, ...extraParameters: any[]): Object; + + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param handler The function that is to be no longer executed. + */ + unbind(eventType?: string | ChUIEventInterface, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a previously-attached event handler from the elements. + * + * @param eventType A string containing a JavaScript event type, such as click or submit. + * @param fls Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ). + */ + unbind(eventType: string | ChUIEventInterface, fls: boolean): JQuery; + + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param eventType A string containing a JavaScript event type, such as "click" or "keydown" + * @param handler A function to execute at the time the event is triggered. + */ + undelegate(selector: string | ChUIEventInterface, eventType: string, handler?: (eventObject: JQueryEventObject) => any): JQuery; + /** + * Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements. + * + * @param selector A selector which will be used to filter the event results. + * @param events An object of one or more event types and previously bound functions to unbind from them. + */ + undelegate(selector: string | ChUIEventInterface, events: Object): JQuery; +} + +interface UISetupCarouselOptions { + target: string; + panels: HTMLElement[] | JQuery; + loop?: boolean; + pagination?: boolean; +} + +interface UISearchOptions { + articleId?: string; + id?: string; + placeholder?: string; + results?: number; +} + +interface UITabbarOptions { + id?: string; + tabs: number; + labels: string[]; + icons?: string[]; + selected?: number; +} + +interface UICreateSwitchOptions { + id?: string; + name?: string; + state?: string; + value?: string | number; + checked?: string; + style?: string; + callback?: () => any; +} + +/** + * Interface for UISlideout. + */ +interface UISlideoutInterface { + /** + * Creates and initializes a slide out menu. Possible options: {dynamic: true, callback: function() { alert("Woohoo!");}} + */ + (options: UISlideoutOptions): void; + + /** + * Populates a slideout menu. + */ + populate(array: Object[]): void; +} + +interface UIStepperOptions { + start: number; + end: number; + defaultValue?: number; +} + +interface ChUIEventInterface { + eventStart: string; + eventEnd: string; + eventMove: string; + eventCancel: string; +} + +interface UIBusyOptions { + size?: string; + color?: string; + position?: string | boolean; + duration?: string; +} + +interface UIPopupOptions { + id?: string; + title?: string; + message?: string; + cancelButton?: string; + continueButton?: string; + callback?: Function; + empty?: boolean; +} + +interface UIPopoverOptions { + id?: string; + callback?: Function; + title?: string; +} + +interface UICreateSegmentedOptions { + id?: string; + className?: string; + labels?: string[]; + selected?: number +} + +interface UISegmentedOptions { + selected?: number; + callback?: Function; +} + +interface UIEditListOptions { + editLabel?: string; + doneLabel?: string; + deleteLabel?: string; + callback?: Function; + deletable?: boolean; + movable?: boolean; +} + +interface UISelectListOptions { + name?: string; + selected?: number; + callback?: Function; +} + +interface UISheetOptions { + id?: string; + listClass?: string; + background?: string; + handle?: boolean; +} + +interface UISlideoutOptions { + dynamic?: boolean; + callback?: Function; + position?: string; +} + + +/** + * The interface used to construct jQuery events (with $.Event). It is + * defined separately instead of inline in JQueryStatic to allow + * overriding the construction function with specific strings + * returning specific event objects. + */ +interface JQueryEventConstructor { + (name: string, eventProperties?: any): JQueryEventObject; + new (name: string, eventProperties?: any): JQueryEventObject; +} + +interface JQueryEventInterface { + Event: JQueryEventConstructor; +} + +/** + * Interface of the JQuery extension of the W3C event object + */ +interface BaseJQueryEventObject extends Event { + +} +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { +} + +/** + * Interface of the JQuery extension of the W3C event object + */ +interface BaseJQueryEventObject extends Event { + +} + +interface JQueryInputEventObject extends BaseJQueryEventObject { + +} + +interface JQueryMouseEventObject extends JQueryInputEventObject { + +} + +interface JQueryKeyEventObject extends JQueryInputEventObject { + +} + +interface JQueryEventObject extends BaseJQueryEventObject, JQueryInputEventObject, JQueryMouseEventObject, JQueryKeyEventObject { +} + +/** + * Interface for detectors. + */ + interface ChuiDetectors { + + /** + * Whether device is iPhone. + */ + isiPhone: boolean; + + /** + * Whether device is iPad. + */ + isiPad: boolean; + + /** + * Whether device is iPod. + */ + isiPod: boolean; + + /** + * Whether OS is iOS. + */ + isiOS: boolean; + + /** + * Whether OS is Android + */ + isAndroid: boolean; + + /** + * Whether OS is WebOS. + */ + isWebOS: boolean; + + /** + * Whether OS is Blackberry. + */ + isBlackberry: boolean; + + /** + * Whether OS supports touch events. + */ + isTouchEnabled: boolean; + + /** + * Whether there is a network connection. + */ + isOnline: boolean; + + /** + * Whether app is running in stanalone mode. + */ + isStandalone: boolean; + + /** + * Whether OS i iOS 7. + */ + isiOS7: boolean; + + /** + * Whether OS i iOS 7. + */ + isiOS8: boolean; + + /** + * Whether OS i iOS 7. + */ + isiOS9: boolean; + + /** + * Whether OS is Windows. + */ + isWin: boolean; + + /** + * Whether device is Windows Phone. + */ + isWinPhone: boolean; + + /** + * Whether browser is IE10. + */ + isIE10: boolean; + + /** + * Whether browser is IE11. + */ + isIE11: boolean; + /** + * Whether browser is Microsoft Edge or not. + */ + isIEEdge: boolean; + + /** + * Whether browser is Webkit based. + */ + isWebkit: boolean; + + /** + * Whether browser is running on mobile device. + */ + isMobile: boolean; + + /** + * Whether browser is running on desktop. + */ + isDesktop: boolean; + + /** + * Whether browser is Safari. + */ + isSafari: boolean; + + /** + * Whether browser is Chrome. + */ + isChrome: boolean; + + /** + * Is native Android browser (not mobile Chrome). + */ + isNativeAndroid: boolean; + + /** + * Whether screen is at least 960 pixels wide. + */ + isWideScreen: boolean; + + /** + * Whether screen is at least 960 pixels wide and in portrait orientation. + */ + isWideScreenPortrait: boolean; + } \ No newline at end of file From 064c4ac050b6ed78cd4bebcb3ea63eee8a42087b Mon Sep 17 00:00:00 2001 From: sourcebits-robertbiggs Date: Tue, 23 Jun 2015 16:40:06 -0700 Subject: [PATCH 0239/2220] Fixed syntax error. --- chui/chui.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chui/chui.d.ts b/chui/chui.d.ts index 3b8fe70c27..614b9bb8bb 100644 --- a/chui/chui.d.ts +++ b/chui/chui.d.ts @@ -1,5 +1,4 @@ - -// Type definitions for chui v3.8.9 +// Type definitions for chui v3.8.10 // Project: https://github.com/chocolatechipui/chocolatechip-ui // Definitions by: Robert Biggs // Definitions: https://github.com/borisyankov/DefinitelyTyped From 48c7e15a9ff9cce45bb87e5a118d943d467d7eef Mon Sep 17 00:00:00 2001 From: "stephen.lautier" Date: Wed, 24 Jun 2015 01:45:21 +0200 Subject: [PATCH 0240/2220] renamed module from eqjs to eq due to unit tests failing error TS2300: Duplicate identifier 'eqjs' --- eqjs/eqjs.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eqjs/eqjs.d.ts b/eqjs/eqjs.d.ts index 9ff2d34683..198fee0f90 100644 --- a/eqjs/eqjs.d.ts +++ b/eqjs/eqjs.d.ts @@ -3,14 +3,14 @@ // Definitions by: Stephen Lautier // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare var eqjs: eqjs.EqjsStatic; +declare var eqjs: eq.EqjsStatic; // Support AMD require declare module 'eqjs' { export = eqjs; } -declare module eqjs { +declare module eq { type AvailableElementType = HTMLElement|HTMLElement[]|NodeList|JQuery; interface EqjsStatic { From eff6f5ec54ec73d7b9ad2cc2f7af7495958a12ee Mon Sep 17 00:00:00 2001 From: Trevor Baron Date: Tue, 23 Jun 2015 20:48:31 -0400 Subject: [PATCH 0241/2220] change fromEvent to allow element of any type this function can take a wide range of types for element as seen from docs: https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/fromevent.md "element (Any): The DOMElement, NodeList, jQuery element, Zepto Element, Angular element, Ember.js element or EventEmitter to attach a listener. For Backbone.Marionette this would be the application or an EventAggregator object." --- rx/rx.async-lite.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rx/rx.async-lite.d.ts b/rx/rx.async-lite.d.ts index f86dc326f3..94eb398007 100644 --- a/rx/rx.async-lite.d.ts +++ b/rx/rx.async-lite.d.ts @@ -65,8 +65,7 @@ declare module Rx { (func: Function, context?: any): (...args: any[]) => Observable; }; - fromEvent(element: NodeList, eventName: string, selector?: (arguments: any[]) => T): Observable; - fromEvent(element: Node, eventName: string, selector?: (arguments: any[]) => T): Observable; + fromEvent(element: any, eventName: string, selector?: (arguments: any[]) => T): Observable; fromEventPattern(addHandler: (handler: Function) => void, removeHandler: (handler: Function) => void, selector?: (arguments: any[])=>T): Observable; } } From 1740c40614e1c9480a801c9aba69c4a032b4208d Mon Sep 17 00:00:00 2001 From: Gildor Date: Tue, 23 Jun 2015 18:03:16 -0700 Subject: [PATCH 0242/2220] fix d3 bisector type signature --- d3/d3.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d3/d3.d.ts b/d3/d3.d.ts index be329db811..e6e1941c94 100644 --- a/d3/d3.d.ts +++ b/d3/d3.d.ts @@ -1090,8 +1090,8 @@ declare module d3 { export function bisectRight(array: T[], x: T, lo?: number, hi?: number): number; export function bisector(accessor: (x: T) => U): { - left: (array: T[], x: T, lo?: number, hi?: number) => number; - right: (array: T[], x: T, lo?: number, hi?: number) => number; + left: (array: T[], x: U, lo?: number, hi?: number) => number; + right: (array: T[], x: U, lo?: number, hi?: number) => number; } export function bisector(comparator: (a: T, b: U) => number): { From a14d724826174d1669d4df04c80f4838b7e71fdf Mon Sep 17 00:00:00 2001 From: itokentr Date: Wed, 24 Jun 2015 15:32:49 +0900 Subject: [PATCH 0243/2220] glob: Update to 5.0.10 --- glob/glob.d.ts | 123 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 82 insertions(+), 41 deletions(-) diff --git a/glob/glob.d.ts b/glob/glob.d.ts index a15417f72c..6e97143758 100644 --- a/glob/glob.d.ts +++ b/glob/glob.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Glob +// Type definitions for Glob 5.0.10 // Project: https://github.com/isaacs/node-glob // Definitions by: vvakame // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -9,63 +9,104 @@ declare module "glob" { import events = require("events"); + import fs = require('fs'); import minimatch = require("minimatch"); - function G(pattern:string, cb:(err:Error, matches:string[])=>void):void; - - function G(pattern:string, options:G.IOptions, cb:(err:Error, matches:string[])=>void):void; + function G(pattern: string, cb: (err: Error, matches: string[]) => void): void; + function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void; module G { - function sync(pattern:string, options?:IOptions):string[]; + function sync(pattern: string, options?: IOptions): string[]; - var Glob:IGlobStatic; + function hasMagic(pattern: string, options?: IOptions): boolean; + + var Glob: IGlobStatic; + var GlobSync: IGlobSyncStatic; interface IOptions extends minimatch.IOptions { cwd?: string; - sync?: boolean; + root?: string; + dot?: boolean; nomount?: boolean; - matchBase?:any; - noglobstar?:any; + mark?: boolean; + nosort?: boolean; + stat?: boolean; + silent?: boolean; strict?: boolean; - dot?:boolean; - mark?:boolean; - nounique?:boolean; - nonull?:boolean; - nosort?:boolean; - nocase?:boolean; - stat?:boolean; - debug?:boolean; - globDebug?:boolean; - silent?:boolean; + cache?: { [path: string]: any /* boolean | string | string[] */ }; + statCache?: { [path: string]: fs.Stats }; + symlinks?: any; + sync?: boolean; + nounique?: boolean; + nonull?: boolean; + debug?: boolean; + nobrace?: boolean; + noglobstar?: boolean; + noext?: boolean; + nocase?: boolean; + matchBase?: any; + nodir?: boolean; + ignore?: any; /* string | string[] */ + follow?: boolean; + realpath?: boolean; + nonegate?: boolean; + nocomment?: boolean; + + /** Deprecated. */ + globDebug?: boolean; } interface IGlobStatic extends events.EventEmitter { - new (pattern:string, cb?:(err:Error, matches:string[])=>void):IGlob; - new (pattern:string, options:any, cb?:(err:Error, matches:string[])=>void):IGlob; + new (pattern: string, cb?: (err: Error, matches: string[]) => void): IGlob; + new (pattern: string, options: IOptions, cb?: (err: Error, matches: string[]) => void): IGlob; + prototype: IGlob; } - interface IGlob { - EOF:any; - paused:boolean; - maxDepth:number; - maxLength:number; - cache:any; - statCache:any; - changedCwd:boolean; - cwd: string; - root: string; - error: any; - aborted: boolean; - minimatch: minimatch.IMinimatch; - matches:string[]; + interface IGlobSyncStatic { + new (pattern: string, options?: IOptions): IGlobBase + prototype: IGlobBase; + } - log(...args:any[]):void; - abort():void; - pause():void; - resume():void; - emitMatch(m:any):void; + interface IGlobBase { + minimatch: minimatch.IMinimatch; + options: IOptions; + aborted: boolean; + cache: { [path: string]: any /* boolean | string | string[] */ }; + statCache: { [path: string]: fs.Stats }; + symlinks: { [path: string]: boolean }; + realpathCache: { [path: string]: string }; + found: string[]; + } + + interface IGlob extends IGlobBase, events.EventEmitter { + pause(): void; + resume(): void; + abort(): void; + + /** Deprecated. */ + EOF: any; + /** Deprecated. */ + paused: boolean; + /** Deprecated. */ + maxDepth: number; + /** Deprecated. */ + maxLength: number; + /** Deprecated. */ + changedCwd: boolean; + /** Deprecated. */ + cwd: string; + /** Deprecated. */ + root: string; + /** Deprecated. */ + error: any; + /** Deprecated. */ + matches: string[]; + /** Deprecated. */ + log(...args: any[]): void; + /** Deprecated. */ + emitMatch(m: any): void; } } -export = G; + export = G; } From 53b3ea17dbef2e6ba4567a56f30a1ba7bc709948 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Jun 2015 09:46:13 +0200 Subject: [PATCH 0244/2220] renamed eqjs to eq.js to match bower name as per review changes --- eqjs/eqjs.d.ts => eq.js/eq.js.d.ts | 0 eqjs/eqjs.tests.ts => eq.js/eq.js.tests.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename eqjs/eqjs.d.ts => eq.js/eq.js.d.ts (100%) rename eqjs/eqjs.tests.ts => eq.js/eq.js.tests.ts (100%) diff --git a/eqjs/eqjs.d.ts b/eq.js/eq.js.d.ts similarity index 100% rename from eqjs/eqjs.d.ts rename to eq.js/eq.js.d.ts diff --git a/eqjs/eqjs.tests.ts b/eq.js/eq.js.tests.ts similarity index 100% rename from eqjs/eqjs.tests.ts rename to eq.js/eq.js.tests.ts From 9a5e66cbe6729f2d0d3e167448b7c0980fe2ce20 Mon Sep 17 00:00:00 2001 From: vojtechhabarta Date: Wed, 24 Jun 2015 15:42:18 +0200 Subject: [PATCH 0245/2220] added definition for tabtab node module --- tabtab/tabtab-tests.ts | 31 ++++++++++++++ tabtab/tabtab.d.ts | 91 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 tabtab/tabtab-tests.ts create mode 100644 tabtab/tabtab.d.ts diff --git a/tabtab/tabtab-tests.ts b/tabtab/tabtab-tests.ts new file mode 100644 index 0000000000..3204b7a05f --- /dev/null +++ b/tabtab/tabtab-tests.ts @@ -0,0 +1,31 @@ + +/// +/// + +import tabtab = require('tabtab'); +import child_process = require('child_process'); +import string_decoder = require('string_decoder'); + +if (process.argv.slice(2)[0] === 'completion') { + tabtab.complete('pkgname', function(err, data) { + if (err || !data) return; + if (/^--\w?/.test(data.last)) return tabtab.log(['help', 'version'], data, '--'); + if (/^-\w?/.test(data.last)) return tabtab.log(['n', 'o', 'd', 'e'], data, '-'); + tabtab.log(['list', 'of', 'commands'], data); + + child_process.exec('rake -H', function(err, stdout, stderr) { + if (err) return; + var decoder = new string_decoder.StringDecoder('utf8'); + var parsed = tabtab.parseOut(decoder.write(stdout)); + if (/^--\w?/.test(data.last)) return tabtab.log(parsed.longs, data, '--'); + if (/^-\w?/.test(data.last)) return tabtab.log(parsed.shorts, data, '-'); + }); + + child_process.exec('cake', function(err, stdout, stderr) { + if (err) return; + var decoder = new string_decoder.StringDecoder('utf8'); + var tasks = tabtab.parseTasks(decoder.write(stdout), 'cake'); + tabtab.log(tasks, data); + }); + }); +} diff --git a/tabtab/tabtab.d.ts b/tabtab/tabtab.d.ts new file mode 100644 index 0000000000..a744904acc --- /dev/null +++ b/tabtab/tabtab.d.ts @@ -0,0 +1,91 @@ +// Type definitions for tabtab 0.0.4 +// Project: https://github.com/mklabs/node-tabtab +// Definitions by: Vojtěch Habarta +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "tabtab" { + + /** + * Main completion method, has support for installation and actual completion. + * @param name Name of the command to complete. + * @param cb Get called when a tab-completion command happens. + */ + export function complete(name: string, cb: CallBack): void; + + /** + * Main completion method, has support for installation and actual completion. + * @param name Name of the command to complete. + * @param completer Name of the command to call on completion. + * @param cb Get called when a tab-completion command happens. + */ + export function complete(name: string, completer: string, cb: CallBack): void; + + /** + * Simple helper function to know if the script is run in the context of a completion command. + */ + export function isComplete(): boolean; + + /** + * Helper to return the list of short and long options, parsed from the usual --help output of a command (cake/rake -H, vagrant, commander -h, optimist.help(), ...). + */ + export function parseOut(str: string): { shorts: string[]; longs: string[] }; + + /** + * Same purpose as parseOut, but for parsing tasks from an help command (cake/rake -T, vagrant, etc.). + */ + export function parseTasks(str: string, prefix: string, reg?: RegExp|string): string[]; + + /** + * Helper to return completion output and log to standard output. + * @param values Array of values to complete against. + * @param data The data object returned by the complete callback, used mainly to filter results accordingly upon the text that is supplied by the user. + * @param prefix A prefix to add to the completion results, useful for options to add dashes (eg. - or --). + */ + export function log(values: string[], data: Data, prefix?: string): void; + + interface CallBack { + (error?: Error, data?: Data, text?: string): any; + } + + /** + * Holds interesting values to drive the output of the completion. + */ + interface Data { + + /** + * full command being completed + */ + line: string; + + /** + * number of words + */ + words: number; + + /** + * cursor position + */ + point: number; + + /** + * tabing in the middle of a word: foo bar baz bar foobarrrrrrr + */ + partial: string; + + /** + * last word of the line + */ + last: string; + + /** + * last partial of the line + */ + lastPartial: string; + + /** + * the previous word + */ + prev: string; + } + +} From 1ad082faf4e6211484cc79275c7ca15ae684125f Mon Sep 17 00:00:00 2001 From: Peter Kooijmans Date: Wed, 24 Jun 2015 15:51:37 +0200 Subject: [PATCH 0246/2220] Update long.js typing to version 2.2.5. --- long/long-tests.ts | 87 +++++++++++++++++++++------ long/long.d.ts | 142 +++++++++++++++++++++------------------------ 2 files changed, 135 insertions(+), 94 deletions(-) diff --git a/long/long-tests.ts b/long/long-tests.ts index c1a05f576b..928cc94530 100644 --- a/long/long-tests.ts +++ b/long/long-tests.ts @@ -1,68 +1,117 @@ /// -// --- commonjs --- import Long = require("long"); -// --- browser --- -//var Long = dcodeIO.Long; -var val:dcodeIO.Long; -var n:number; -var b:boolean; -var s:string; +var val: Long; +var n: number = 42; +var b: boolean = true; +var s: string = "1337"; +val = new Long(0xFFFFFFFF, 0x7FFFFFFF, true); val = new Long(0xFFFFFFFF, 0x7FFFFFFF); +val = new Long(0xFFFFFFFF); -val = Long.from28Bits(0xFFFFFFF, 0xFFFFFFF, 0xFF); - -val = Long.fromInt(-1, true); n = val.low; n = val.high; b = val.unsigned; -s = val.toString(); val = val.add(val); +val = val.add(n); +val = val.add(s); + val = val.and(val); -val = val.clone(); +val = val.and(n); +val = val.and(s); + n = val.compare(val); +n = val.compare(n); +n = val.compare(s); + val = val.div(val); +val = val.div(n); +val = val.div(s); + b = val.equals(val); +b = val.equals(n); +b = val.equals(s); + n = val.getHighBits(); n = val.getHighBitsUnsigned(); n = val.getLowBits(); n = val.getLowBitsUnsigned(); n = val.getNumBitsAbs(); + b = val.greaterThan(val); +b = val.greaterThan(n); +b = val.greaterThan(s); + b = val.greaterThanOrEqual(val); +b = val.greaterThanOrEqual(n); +b = val.greaterThanOrEqual(s); + b = val.isEven(); b = val.isNegative(); b = val.isOdd(); +b = val.isPositive(); b = val.isZero(); + b = val.lessThan(val); +b = val.lessThan(n); +b = val.lessThan(s); + b = val.lessThanOrEqual(val); +b = val.lessThanOrEqual(n); +b = val.lessThanOrEqual(s); + val = val.modulo(val); +val = val.modulo(n); +val = val.modulo(s); + val = val.multiply(val); +val = val.multiply(n); +val = val.multiply(s); + val = val.negate(); val = val.not(); + b = val.notEquals(val); +b = val.notEquals(n); +b = val.notEquals(s); + val = val.or(val); +val = val.or(n); +val = val.or(s); + val = val.shiftLeft(2); +val = val.shiftLeft(val); + val = val.shiftRight(1); +val = val.shiftRight(val); + val = val.shiftRightUnsigned(1); +val = val.shiftRightUnsigned(val); + val = val.subtract(val); +val = val.subtract(n); +val = val.subtract(s); + n = val.toInt(); n = val.toNumber(); val = val.toSigned(); -val = val.toUnsigned(); -val = val.xor(val); -val = Long.MAX_SIGNED_VALUE; +s = val.toString(); +s = val.toString(n); + +val = val.toUnsigned(); + +val = val.xor(val); +val = val.xor(n); +val = val.xor(s); + val = Long.MAX_UNSIGNED_VALUE; val = Long.MAX_VALUE; -val = Long.MIN_SIGNED_VALUE; -val = Long.MIN_UNSIGNED_VALUE; val = Long.MIN_VALUE; val = Long.NEG_ONE; val = Long.ONE; +val = Long.UZERO; val = Long.ZERO; - - diff --git a/long/long.d.ts b/long/long.d.ts index 3d6554017e..5c3704a816 100644 --- a/long/long.d.ts +++ b/long/long.d.ts @@ -1,80 +1,72 @@ -// Type definitions for Long.js 1.1.2 +// Type definitions for Long.js v2.2.5 // Project: https://github.com/dcodeIO/Long.js -// Definitions by: Toshihide Hara +// Definitions by: Peter Kooijmans // Definitions: https://github.com/borisyankov/DefinitelyTyped -declare module dcodeIO { - - interface LongStatic { - new(low:number, high:number, unsigned?:boolean):Long; - - MAX_SIGNED_VALUE:Long; - MAX_UNSIGNED_VALUE:Long; - MAX_VALUE:Long; - MIN_SIGNED_VALUE:Long; - MIN_UNSIGNED_VALUE:Long; - MIN_VALUE:Long; - NEG_ONE:Long; - ONE:Long; - ZERO:Long; - - from28Bits(part0:number, part1:number, part2:number, unsigned?:boolean):Long; - fromBits(lowBits:number, highBits:number, unsigned?:boolean):Long; - fromInt(value:number, unsigned?:boolean):Long; - fromNumber(value:number, unsigned?:boolean):Long; - fromString(str:string, unsigned?:boolean, radix?:number):Long; - fromString(str:string, unsigned?:number, radix?:number):Long; - fromString(str:string, unsigned?:any, radix?:number):Long; - } - - interface Long { - high:number; - low:number; - unsigned:boolean; - - add(other:Long):Long; - and(other:Long):Long; - clone():Long; - compare(other:Long):number; - div(other:Long):Long; - equals(other:Long):boolean; - getHighBits():number; - getHighBitsUnsigned():number; - getLowBits():number; - getLowBitsUnsigned():number; - getNumBitsAbs():number; - greaterThan(other:Long):boolean; - greaterThanOrEqual(other:Long):boolean; - isEven():boolean; - isNegative():boolean; - isOdd():boolean; - isZero():boolean; - lessThan(other:Long):boolean; - lessThanOrEqual(other:Long):boolean; - modulo(other:Long):Long; - multiply(other:Long):Long; - negate():Long; - not():Long; - notEquals(other:Long):boolean; - or(other:Long):Long; - shiftLeft(numBits:number):Long; - shiftRight(numBits:number):Long; - shiftRightUnsigned(numBits:number):Long; - subtract(other:Long):Long; - toInt():number; - toNumber():number; - toSigned():Long; - toString(radix?:number):string; - toUnsigned():Long; - xor(other:Long):Long; - } - - // for browser - export var Long:LongStatic; -} - -// for node, commonjs declare module "long" { - var Long:dcodeIO.LongStatic; - export = Long; + + module Long { + export var MAX_UNSIGNED_VALUE: Long; + export var MAX_VALUE: Long; + export var MIN_VALUE: Long; + export var NEG_ONE: Long; + export var ONE: Long; + export var UONE: Long; + export var UZERO: Long; + export var ZERO: Long; + + export function fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long; + export function fromInt(value: number, unsigned?: boolean): Long; + export function fromNumber(value: number, unsigned?: boolean): Long; + export function fromString(str: string, unsigned?: boolean | number, radix?: number): Long; + export function fromValue(val: Long | number | string): Long; + + export function isLong(obj: any): boolean; + } + + class Long { + high: number; + low: number; + unsigned :boolean; + + constructor(low: number, high?: number, unsigned?:boolean); + + add(other: Long | number | string): Long; + and(other: Long | number | string): Long; + compare(other: Long | number | string): number; + div(divisor: Long | number | string): Long; + equals(other: Long | number | string): boolean; + getHighBits(): number; + getHighBitsUnsigned(): number; + getLowBits(): number; + getLowBitsUnsigned(): number; + getNumBitsAbs(): number; + greaterThan(other: Long | number | string): boolean; + greaterThanOrEqual(other: Long | number | string): boolean; + isEven(): boolean; + isNegative(): boolean; + isOdd(): boolean; + isPositive(): boolean; + isZero(): boolean; + lessThan(other: Long | number | string): boolean; + lessThanOrEqual(other: Long | number | string): boolean; + modulo(divisor: Long | number | string): Long; + multiply(multiplier: Long | number | string): Long; + negate(): Long; + not(): Long; + notEquals(other: Long | number | string): boolean; + or(other: Long | number | string): Long; + shiftLeft(numBits: number | Long): Long; + shiftRight(numBits: number | Long): Long; + shiftRightUnsigned(numBits: number | Long): Long; + subtract(other: Long | number | string): Long; + toInt(): number; + toNumber(): number; + toSigned(): Long; + toString(radix?: number): string; + toUnsigned(): Long; + xor(other: Long | number | string): Long; + } + + export = Long; } From a3900b896f7b3361b79f9b503224777619907d53 Mon Sep 17 00:00:00 2001 From: itokentr Date: Wed, 24 Jun 2015 15:32:59 +0900 Subject: [PATCH 0247/2220] minimatch: Update to v2.0.8 --- minimatch/minimatch-tests.ts | 2 +- minimatch/minimatch.d.ts | 71 ++++++++++++++++++++++-------------- 2 files changed, 45 insertions(+), 28 deletions(-) diff --git a/minimatch/minimatch-tests.ts b/minimatch/minimatch-tests.ts index 382a2c0a8f..38c699e0f0 100644 --- a/minimatch/minimatch-tests.ts +++ b/minimatch/minimatch-tests.ts @@ -12,7 +12,7 @@ var r = m.makeRe(); var f = ["test.ts"]; mm.match(f, pattern, options); -mm.filter('foo')('bar'); +f.filter(mm.filter(pattern, options)); var s: string = "hello"; var b: boolean = mm(s, pattern, options); diff --git a/minimatch/minimatch.d.ts b/minimatch/minimatch.d.ts index 697f9e21fc..a79c6ff114 100644 --- a/minimatch/minimatch.d.ts +++ b/minimatch/minimatch.d.ts @@ -1,47 +1,64 @@ -// Type definitions for Minimatch 1.0.0 +// Type definitions for Minimatch 2.0.8 // Project: https://github.com/isaacs/minimatch // Definitions by: vvakame // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module "minimatch" { - function M(target:string, pattern:string, options?:M.IOptions): boolean; + function M(target: string, pattern: string, options?: M.IOptions): boolean; module M { - function match(filenames:string[], pattern:string, options?:IOptions):string[]; - function filter(pattern:string, options?:IOptions): (target: string) => boolean; - - var Minimatch:IMinimatchStatic; + function match(list: string[], pattern: string, options?: IOptions): string[]; + function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: string[]) => boolean; + function makeRe(pattern: string, options?: IOptions): RegExp; + var Minimatch: IMinimatchStatic; + interface IOptions { - debug?:boolean; - nobrace?:boolean; - noglobstar?:boolean; - dot?:boolean; - noext?:boolean; - nocase?:boolean; - nonull?:boolean; - matchBase?:boolean; - nocomment?:boolean; - nonegate?:boolean; - flipNegate?:boolean; + debug?: boolean; + nobrace?: boolean; + noglobstar?: boolean; + dot?: boolean; + noext?: boolean; + nocase?: boolean; + nonull?: boolean; + matchBase?: boolean; + nocomment?: boolean; + nonegate?: boolean; + flipNegate?: boolean; } interface IMinimatchStatic { - new (pattern:string, options?:IOptions):IMinimatch; + new (pattern: string, options?: IOptions): IMinimatch; + prototype: IMinimatch; } interface IMinimatch { - debug():void; - make():void; - parseNegate():void; - braceExpand(pattern:string, options:IOptions):void; - parse(pattern:string, isSub?:boolean):void; - makeRe():RegExp; // regexp or boolean - match(file:string):boolean; - matchOne(files:string[], pattern:string[], partial:any):boolean; + pattern: string; + options: IOptions; + /** 2-dimensional array of regexp or string expressions. */ + set: any[][]; // (RegExp | string)[][] + regexp: RegExp; + negate: boolean; + comment: boolean; + empty: boolean; + + makeRe(): RegExp; // regexp or boolean + match(fname: string): boolean; + matchOne(files: string[], pattern: string[], partial: boolean): boolean; + + /** Deprecated. For internal use. */ + debug(): void; + /** Deprecated. For internal use. */ + make(): void; + /** Deprecated. For internal use. */ + parseNegate(): void; + /** Deprecated. For internal use. */ + braceExpand(pattern: string, options: IOptions): void; + /** Deprecated. For internal use. */ + parse(pattern: string, isSub?: boolean): void; } } -export = M; + export = M; } From 159edfacefca154b92f9a5c623538b4c95e81c28 Mon Sep 17 00:00:00 2001 From: Shearerbeard Date: Wed, 17 Jun 2015 19:36:40 -0600 Subject: [PATCH 0248/2220] typings for altjs flux library --- alt/alt.d.ts | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 alt/alt.d.ts diff --git a/alt/alt.d.ts b/alt/alt.d.ts new file mode 100644 index 0000000000..15bbc8e8e0 --- /dev/null +++ b/alt/alt.d.ts @@ -0,0 +1,158 @@ +// Type definitions for Alt 0.16.7 +// Project: https://github.com/goatslacker/alt +// Definitions by: Michael Shearer +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + + +declare module AltJS { + + export interface StoreModel { + bindActions?( ...actions:Array); + exportPublicMethods?(exportConfig:M):void; + getState?():S; + exportAsync?(source:Source); + waitFor?(store:AltStore):void; + } + + export type Source = {[name:string]:() => SourceModel}; + + export interface SourceModel { + local( ...args:Array); + remote( ...args:Array); + shouldFetch?(state:Object, ...args:Array); + loading: ( ...args:Array) => void; + success:( ...args:Array) => void; + error:( ...args:Array) => void; + interceptResponse?(response:Object, action:AltJS.Action, ...args:Array); + } + + export interface AltStore { + getState():S; + listen(handler:(state:S) => any):() => void; + unlisten(handler:(state:S) => any):void; + emitChange():void; + getEventEmitter():EventEmitter3.EventEmitter; + } + + export enum lifeCycleEvents { + bootstrap, + snapshot, + init, + rollback, + error + } + + export type Actions = {[action:string]:Action}; + + export interface Action { + (T); + defer(data:any):void; + } + + export interface ActionsClass { + generateActions?( ...action:Array); + dispatch( ...payload:Array); + actions?:Actions; + } +} + +declare module "alt/utils/chromeDebug" { + function chromeDebug(alt:any):void; + export = chromeDebug; +} + +declare module "alt/AltContainer" { + + import * as React from "react"; + + interface ContainerProps { + store:AltJS.AltStore + } + + class AltContainer extends React.Component { + } + + export = AltContainer; +} + +declare module "alt" { + + import {Dispatcher} from "flux"; + + type StateTransform = (store:StoreModel) => AltJS.AltStore; + + interface AltConfig { + dispatcher?:Dispatcher; + serialize?:(data:Object) => string; + deserialize?:(serialized:string) => Object; + storeTransforms?:Array; + batchingFunction?:(callback:( ...data:Array) => any) => void; + } + + class Alt { + constructor(config?:AltConfig); + actions:AltJS.Actions; + bootstrap(data:string); + takeSnapshot( ...storeNames:Array):string; + flush():Object; + recycle( ...store:Array>); + rollback(); + dispatch(action?:AltJS.Action, data?:Object, details?:any); + addActions(actionsName:string, actions:AltJS.ActionsClass); + addStore(name:string, store:StoreModel, saveStore?:boolean); + getStore(name:string):AltJS.AltStore; + getActions(actionsName:string):AltJS.Actions; + createAction(name:string, implementation:AltJS.ActionsClass):AltJS.Action; + createAction(name:string, implementation:AltJS.ActionsClass, ...args:Array):AltJS.Action; + createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object):T; + createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object, ...constructorArgs:Array):T; + generateActions( ...action:Array):T; + createStore(store:StoreModel, name?:string):AltJS.AltStore; + } + + type ActionsClassConstructor = new (alt:Alt) => AltJS.ActionsClass; + + type ActionHandler = ( ...data:Array) => any; + type ExportConfig = {[key:string]:( ...args:Array) => any}; + + interface StoreReduce { + action:any; + data: any; + } + + interface StoreModel extends AltJS.StoreModel { + setState?(currentState:Object, nextState:Object):Object; + getState?():S; + onSerialize?(data:any):void; + onDeserialize?(data:any):void; + on?(event:AltJS.lifeCycleEvents, callback:() => any):void; + bindActions?(action:AltJS.Action, method:ActionHandler):void; + bindListeners?(config:{string: AltJS.Action | AltJS.Actions}); + waitFor?(dispatcherSource:any):void; + exportPublicMethods?(exportConfig:ExportConfig):void; + getInstance?():AltJS.AltStore; + emitChange?():void; + dispatcher?:Dispatcher; + alt?:Alt; + displayName?:string; + otherwise?(data:any, action:AltJS.Action); + reduce?(state:any, config:StoreReduce):Object; + preventDefault?(); + observe?(alt:Alt):any; + registerAsync?(datasource:AltJS.Source); + beforeEach?(payload:Object, state:Object); + afterEach?(payload:Object, state:Object); + unlisten?(); + } + + type StoreModelConstructor = (alt:Alt) => StoreModel; + + interface AltFactory { + new(config?:AltConfig):Alt; + } + + export = Alt; +} From bfd9f256783c15000d5a3e957ef06323650ea8db Mon Sep 17 00:00:00 2001 From: Shearerbeard Date: Wed, 24 Jun 2015 08:59:31 -0600 Subject: [PATCH 0249/2220] committing revisions to keep in sync with alt 0.16.10/0.17.0 --- alt/alt.d.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/alt/alt.d.ts b/alt/alt.d.ts index 15bbc8e8e0..7f74b069e0 100644 --- a/alt/alt.d.ts +++ b/alt/alt.d.ts @@ -1,10 +1,9 @@ -// Type definitions for Alt 0.16.7 +// Type definitions for Alt 0.16.10 // Project: https://github.com/goatslacker/alt // Definitions by: Michael Shearer // Definitions: https://github.com/borisyankov/DefinitelyTyped /// -/// declare module AltJS { @@ -34,7 +33,6 @@ declare module AltJS { listen(handler:(state:S) => any):() => void; unlisten(handler:(state:S) => any):void; emitChange():void; - getEventEmitter():EventEmitter3.EventEmitter; } export enum lifeCycleEvents { @@ -74,7 +72,7 @@ declare module "alt/AltContainer" { class AltContainer extends React.Component { } - + export = AltContainer; } From 458b73bddd5bd6306390b312dfc02bd17360b46d Mon Sep 17 00:00:00 2001 From: Christopher Glantschnig Date: Wed, 24 Jun 2015 20:37:49 +0200 Subject: [PATCH 0250/2220] added definitions for request-promise --- request-promise/request-promise.d.ts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 request-promise/request-promise.d.ts diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts new file mode 100644 index 0000000000..b2a6f2da2b --- /dev/null +++ b/request-promise/request-promise.d.ts @@ -0,0 +1,28 @@ +// Type definitions for request-promise (v0.4.2) +// Definitions by: Christopher Glantschnig + +/// +/// +/// +/// + +declare module 'request-promise' { + import request = require('request'); + import stream = require('stream'); + import http = require('http'); + import FormData = require('form-data'); + + export = RequestPromiseAPI; + + function RequestPromiseAPI(uri: string, options?: RequestPromiseAPI.Options): Promise; + function RequestPromiseAPI(uri: string): Promise; + function RequestPromiseAPI(options: RequestPromiseAPI.Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): request.Request; + + module RequestPromiseAPI { + export interface Options extends request.Options { + simple?: boolean; + transform?: (body: any, response: http.IncomingMessage) => number; + resolveWithFullResponse?: boolean; + } + } +} From a619d54c4fb4b0dde0d578f071a719c1ddf196d9 Mon Sep 17 00:00:00 2001 From: Christopher Glantschnig Date: Wed, 24 Jun 2015 20:57:15 +0200 Subject: [PATCH 0251/2220] added tests and updated header according to contribution guidelines --- request-promise/request-promise-tests.ts | 17 +++++++++++++++++ request-promise/request-promise.d.ts | 9 +++++---- 2 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 request-promise/request-promise-tests.ts diff --git a/request-promise/request-promise-tests.ts b/request-promise/request-promise-tests.ts new file mode 100644 index 0000000000..41a5eb80d3 --- /dev/null +++ b/request-promise/request-promise-tests.ts @@ -0,0 +1,17 @@ +/// + +import rp = require('request-promise'); + +rp('http://www.google.com') + .then(console.dir) + .catch(console.error); + +var options: rp.Options = { + uri : 'http://posttestserver.com/post.php', + method : 'POST' +}; + +rp(options) + .then(console.dir) + .catch(console.error); + diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts index b2a6f2da2b..bdc2764a2d 100644 --- a/request-promise/request-promise.d.ts +++ b/request-promise/request-promise.d.ts @@ -1,5 +1,7 @@ -// Type definitions for request-promise (v0.4.2) -// Definitions by: Christopher Glantschnig +// Type definitions for request-promise v0.4.2 +// Project: https://www.npmjs.com/package/request-promise +// Definitions by: Christopher Glantschnig +// Definitions: https://github.com/borisyankov/DefinitelyTyped /// /// @@ -14,9 +16,8 @@ declare module 'request-promise' { export = RequestPromiseAPI; - function RequestPromiseAPI(uri: string, options?: RequestPromiseAPI.Options): Promise; + function RequestPromiseAPI(options: RequestPromiseAPI.Options): request.Request; function RequestPromiseAPI(uri: string): Promise; - function RequestPromiseAPI(options: RequestPromiseAPI.Options, callback?: (error: any, response: http.IncomingMessage, body: any) => void): request.Request; module RequestPromiseAPI { export interface Options extends request.Options { From d0e842e2f96893b86a2ea2d1e0a4dc504379cd69 Mon Sep 17 00:00:00 2001 From: Marc Sallin Date: Thu, 25 Jun 2015 00:21:40 +0200 Subject: [PATCH 0252/2220] Q: Support for the Q.noConflict() method. --- q/Q.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/q/Q.d.ts b/q/Q.d.ts index 2a239dc18e..8453d5e73d 100644 --- a/q/Q.d.ts +++ b/q/Q.d.ts @@ -316,6 +316,13 @@ declare module Q { * Calling resolve with a non-promise value causes promise to be fulfilled with that value. */ export function resolve(object: T): Promise; + + /** + * Resets the global "Q" variable to the value it has before Q was loaded. + * This will either be undefined if there was no version or the version of Q which was already loaded before. + * @returns { The last version of Q. } + */ + export function noConflict(): typeof Q; } declare module "q" { From 39293fc55d77b5089cf1bdc57b61d9c8a975975a Mon Sep 17 00:00:00 2001 From: shaban Date: Thu, 25 Jun 2015 01:48:44 +0200 Subject: [PATCH 0253/2220] Update ace.d.ts Add isClean and markClean methods. Reference https://github.com/ajaxorg/ace/issues/324 --- ace/ace.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ace/ace.d.ts b/ace/ace.d.ts index 4758b59e96..f0668da3c4 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -2609,6 +2609,16 @@ declare module AceAjax { * Returns `true` if there are redo operations left to perform. **/ hasRedo(): boolean; + + /** + * Returns `true` if the dirty counter is 0 + **/ + isClean(): boolean; + + /** + * Sets dirty counter to 0 + **/ + markClean(): void; } var UndoManager: { From 78b83e0c238c7da99d4ac88994f877d2d718a181 Mon Sep 17 00:00:00 2001 From: heycalmdown Date: Thu, 25 Jun 2015 09:12:31 +0900 Subject: [PATCH 0254/2220] lodash: Add _.matchesProperty style to _.find --- lodash/lodash-tests.ts | 10 +-- lodash/lodash.d.ts | 171 +++++++++++++---------------------------- 2 files changed, 58 insertions(+), 123 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 633c4ed0d4..193f87c08c 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -403,15 +403,13 @@ result = _([1, 2, 3, 4, 5, 6]).select(function (num) { return num % 2 result = _(foodsCombined).select('organic').value(); result = _(foodsCombined).select({ 'type': 'fruit' }).value(); -result = _.find([1, 2, 3, 4], function (num) { - return num % 2 == 0; -}); +result = _.find([1, 2, 3, 4], num => num % 2 == 0); result = _.find(foodsCombined, { 'type': 'vegetable' }); +result = _.find(foodsCombined, 'type', 'vegetable'); result = _.find(foodsCombined, 'organic'); -result = _([1, 2, 3, 4]).find(function (num) { - return num % 2 == 0; -}); +result = _([1, 2, 3, 4]).find(num => num % 2 == 0); result = _(foodsCombined).find({ 'type': 'vegetable' }); +result = _(foodsCombined).find('type', 'vegetable'); result = _(foodsCombined).find('organic'); result = _.detect([1, 2, 3, 4], function (num) { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 9cb55485d9..faf921c57c 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -2710,15 +2710,19 @@ declare module _ { //_.find interface LoDashStatic { /** - * Iterates over elements of a collection, returning the first element that the callback - * returns truey for. The callback is bound to thisArg and invoked with three arguments; - * (value, index|key, collection). + * Iterates over elements of collection, returning the first element predicate returns + * truthy for. The predicate is bound to thisArg and invoked with three arguments: + * (value, index|key, collection). * - * If a property name is provided for callback the created "_.pluck" style callback will - * return the property value of the given element. + * If a property name is provided for predicate the created _.property style callback + * returns the property value of the given element. * - * If an object is provided for callback the created "_.where" style callback will return + * If a value is also provided for thisArg the created _.matchesProperty style callback + * returns true for elements that have a matching property value, else false. + * + * If an object is provided for predicate the created _.matches style callback returns * true for elements that have the properties of the given object, else false. + * * @param collection Searches for a value in this list. * @param callback The function called per iteration. * @param thisArg The this binding of callback. @@ -2728,6 +2732,10 @@ declare module _ { collection: Array, callback: ListIterator, thisArg?: any): T; + detect( + collection: Array, + callback: ListIterator, + thisArg?: any): T; /** * @see _.find @@ -2736,6 +2744,10 @@ declare module _ { collection: List, callback: ListIterator, thisArg?: any): T; + detect( + collection: List, + callback: ListIterator, + thisArg?: any): T; /** * @see _.find @@ -2744,74 +2756,6 @@ declare module _ { collection: Dictionary, callback: DictionaryIterator, thisArg?: any): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - find( - collection: Array, - whereValue: W): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - find( - collection: List, - whereValue: W): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - find( - collection: Dictionary, - whereValue: W): T; - - /** - * @see _.find - * @param _.where style callback - **/ - find( - collection: Array, - pluckValue: string): T; - - /** - * @see _.find - * @param _.where style callback - **/ - find( - collection: List, - pluckValue: string): T; - - /** - * @see _.find - * @param _.where style callback - **/ - find( - collection: Dictionary, - pluckValue: string): T; - - /** - * @see _.find - **/ - detect( - collection: Array, - callback: ListIterator, - thisArg?: any): T; - - /** - * @see _.find - **/ - detect( - collection: List, - callback: ListIterator, - thisArg?: any): T; - - /** - * @see _.find - **/ detect( collection: Dictionary, callback: DictionaryIterator, @@ -2819,50 +2763,37 @@ declare module _ { /** * @see _.find - * @param _.pluck style callback + * @param _.matches style callback **/ + find( + collection: Array|List|Dictionary, + whereValue: W): T; detect( - collection: Array, + collection: Array|List|Dictionary, whereValue: W): T; /** * @see _.find - * @param _.pluck style callback - **/ - detect( - collection: List, - whereValue: W): T; - - /** - * @see _.find - * @param _.pluck style callback - **/ - detect( - collection: Dictionary, - whereValue: W): T; - - /** - * @see _.find - * @param _.where style callback + * @param _.matchesProperty style callback **/ + find( + collection: Array|List|Dictionary, + path: string, + srcValue: any): T; detect( - collection: Array, + collection: Array|List|Dictionary, + path: string, + srcValue: any): T; + + /** + * @see _.find + * @param _.property style callback + **/ + find( + collection: Array|List|Dictionary, pluckValue: string): T; - - /** - * @see _.find - * @param _.where style callback - **/ detect( - collection: List, - pluckValue: string): T; - - /** - * @see _.find - * @param _.where style callback - **/ - detect( - collection: Dictionary, + collection: Array|List|Dictionary, pluckValue: string): T; /** @@ -2891,7 +2822,7 @@ declare module _ { /** * @see _.find - * @param _.pluck style callback + * @param _.matches style callback **/ findWhere( collection: Array, @@ -2899,7 +2830,7 @@ declare module _ { /** * @see _.find - * @param _.pluck style callback + * @param _.matches style callback **/ findWhere( collection: List, @@ -2907,7 +2838,7 @@ declare module _ { /** * @see _.find - * @param _.pluck style callback + * @param _.matches style callback **/ findWhere( collection: Dictionary, @@ -2915,7 +2846,7 @@ declare module _ { /** * @see _.find - * @param _.where style callback + * @param _.property style callback **/ findWhere( collection: Array, @@ -2923,7 +2854,7 @@ declare module _ { /** * @see _.find - * @param _.where style callback + * @param _.property style callback **/ findWhere( collection: List, @@ -2931,7 +2862,7 @@ declare module _ { /** * @see _.find - * @param _.where style callback + * @param _.property style callback **/ findWhere( collection: Dictionary, @@ -2947,14 +2878,20 @@ declare module _ { thisArg?: any): T; /** * @see _.find - * @param _.where style callback + * @param _.matches style callback */ find( whereValue: W): T; - /** * @see _.find - * @param _.where style callback + * @param _.matchesProperty style callback + */ + find( + path: string, + srcValue: any): T; + /** + * @see _.find + * @param _.property style callback */ find( pluckValue: string): T; From 661e01689612eeb784e931e4f5274d4ea5d588b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Jun 2015 10:17:24 +0300 Subject: [PATCH 0255/2220] Update for karma-jasmine 0.3.3+ --- karma-jasmine/karma-jasmine-tests.ts | 4 ++-- karma-jasmine/karma-jasmine.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/karma-jasmine/karma-jasmine-tests.ts b/karma-jasmine/karma-jasmine-tests.ts index 6e7a8db9fa..19e5436129 100644 --- a/karma-jasmine/karma-jasmine-tests.ts +++ b/karma-jasmine/karma-jasmine-tests.ts @@ -1,7 +1,7 @@ /// -ddescribe("A suite", () => { - iit("contains spec with an expectation", () => { +fdescribe("A suite", () => { + fit("contains spec with an expectation", () => { expect(true).toBe(true); }); }); diff --git a/karma-jasmine/karma-jasmine.d.ts b/karma-jasmine/karma-jasmine.d.ts index e4cdc5a816..6f61ca26e8 100644 --- a/karma-jasmine/karma-jasmine.d.ts +++ b/karma-jasmine/karma-jasmine.d.ts @@ -5,5 +5,5 @@ /// -declare function ddescribe(description: string, specDefinitions: () => void): void; -declare function iit(expectation: string, assertion: () => void): void; +declare function fdescribe(description: string, specDefinitions: () => void): void; +declare function fit(expectation: string, assertion: () => void): void; From dbd0c4066421c223535ec003e564a02b7f3b8367 Mon Sep 17 00:00:00 2001 From: woutergd Date: Thu, 25 Jun 2015 15:29:26 +0200 Subject: [PATCH 0256/2220] Added animation and default controls --- openlayers3/openlayers3.d.ts | 193 +++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts index d89c65ecca..7703a2d5ea 100644 --- a/openlayers3/openlayers3.d.ts +++ b/openlayers3/openlayers3.d.ts @@ -1413,13 +1413,206 @@ declare module ol { } // NAMESPACES + + /** + * The animation static methods are designed to be used with the ol.Map#beforeRender method. + */ module animation { + + /** + * Generate an animated transition that will "bounce" the resolution as it approaches the final value. + * @param options Bounce options. + */ + //TODO: return ol.PreRenderFunction + function bounce(options: AnimationBounceOptions): any; + interface AnimationBounceOptions { + + /** + * The resolution to start the bounce from, typically map.getView().getResolution(). + */ + resolution: number; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + /** + * Generate an animated transition while updating the view center. + * @param options Pan options. + */ + //TODO: return ol.PreRenderFunction + function pan(options: AnimationPanOptions): any; + interface AnimationPanOptions { + + /** + * The resolution to start the bounce from, typically map.getView().getResolution(). + */ + source: ol.Coordinate; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + /** + * Generate an animated transition while updating the view rotation. + * @param options Rotate options. + */ + //TODO: return ol.PreRenderFunction + function rotate(options: AnimationRotateOptions): any; + interface AnimationRotateOptions { + + /** + * The rotation value (in radians) to begin rotating from, typically map.getView().getRotation(). If undefined then 0 is assumed. + */ + rotation?: number; + + /** + * The rotation center/anchor. The map rotates around the center of the view if unspecified. + */ + anchor?: ol.Coordinate; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + /** + * Generate an animated transition while updating the view resolution. + * @param options Zoom options. + */ + function pan(options: AnimationZoomOptions): any; + interface AnimationZoomOptions { + + /** + * The resolution to begin zooming from, typically map.getView().getResolution(). + */ + resolution: number; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } } + /** + * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified. + */ module color { + + /** + * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified. + * @param color Color. + */ + function asArray(color: ol.Color): ol.Color; + function asArray(color: string): ol.Color; + + /** + * Return the color as an rgba string. + * @param color Color. + */ + function asString(color: ol.Color): string; + function asString(color: string): string; } module control { + + /** + * Set of controls included in maps by default. Unless configured otherwise, this returns a collection containing an instance of each of the following controls: ol.control.Zoom, ol.control.Rotate, ol.control.Attribution + * @param options Defaults options + * @returns Control.s + */ + function defaults(opt_options: ControlDefaultsOptions): ol.Collection; + interface ControlDefaultsOptions { + + /** + * Attribution. Default is true. + */ + attribution?: boolean; + + /** + * Attribution options. + */ + //TODO: Replace with olx.control.AttributionOptions + attributionOptions?: any; + + /** + * Rotate. Default is true; + */ + rotate?: boolean; + + /** + * Rotate options + */ + //TODO: Replace with olx.control.RotateOptions + rotateOptions?: any; + + /** + * Zoom. Default is true + */ + zoom?: boolean; + + /** + * + */ + //TODO: Replace with olx.control.ZoomOptions + zoomOptions?: any; + } + + /** + * Units for the scale line. Supported values are 'degrees', 'imperial', 'nautical', 'metric', 'us'. + */ + interface ScaleLineUnits extends String { } + class Attribution { } From 986e1ea0cbc079999f5941ee7660c29a0b1bfc63 Mon Sep 17 00:00:00 2001 From: mariusfilipowski Date: Thu, 25 Jun 2015 16:08:48 +0200 Subject: [PATCH 0257/2220] Support for Deactivating Compiler Option "Allow implicit any" --- amplifyjs/amplifyjs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amplifyjs/amplifyjs.d.ts b/amplifyjs/amplifyjs.d.ts index 364845f3c4..30e8272943 100644 --- a/amplifyjs/amplifyjs.d.ts +++ b/amplifyjs/amplifyjs.d.ts @@ -50,7 +50,7 @@ interface amplifyRequest { * success (optional): Function to invoke on success. * error (optional): Function to invoke on error. */ - (settings: amplifyRequestSettings); + (settings: amplifyRequestSettings): any; /*** * Define a resource. From f06b7f6d022ce286e6438019fbb1100e04f585ba Mon Sep 17 00:00:00 2001 From: woutergd Date: Thu, 25 Jun 2015 17:28:10 +0200 Subject: [PATCH 0258/2220] Added ol.layer.* definitions --- openlayers3/openlayers3.d.ts | 467 ++++++++++++++++++++++++++++++++++- 1 file changed, 459 insertions(+), 8 deletions(-) diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts index 7703a2d5ea..9f06166dab 100644 --- a/openlayers3/openlayers3.d.ts +++ b/openlayers3/openlayers3.d.ts @@ -1843,26 +1843,477 @@ declare module ol { module layer { - class Base { + /** + * Abstract base class; normally only used for creating subclasses and not instantiated in apps. Note that with ol.layer.Base and all its subclasses, any property set in the options is set as a ol.Object property on the layer object, so is observable, and has get/set accessors. + */ + class Base extends ol.Object { + + /** + * @constructor + * @param options Layer options. + */ + constructor(options?: BaseOptions); + + /** + * Return the brightness of the layer. + * @returns The brightness of the layer. + */ + getBrightness(): number; + + /** + * Return the contrast of the layer. + * @returns The contrast of the layer. + */ + getContrast(): number; + + /** + * Return the extent of the layer or undefined if it will be visible regardless of extent. + * @returns The layer extent. + */ + getExtent(): ol.Extent; + + /** + * Return the hue of the layer. + * @returns The hue of the layer + */ + getHue(): number; + + /** + * Return the maximum resolution of the layer. + * @returns The maximum resolution of the layer + */ + getMaxResolution(): number; + + /** + * Return the minimum resolution of the layer. + * @returns The minimum resolution of the layer. + */ + getMinResolution(): number; + + /** + * Return the opacity of the layer (between 0 and 1). + * @returns The opacity of the layer. + */ + getOpacity(): number; + + /** + * Return the saturation of the layer. + * @returns The saturation of the layer. + */ + getSaturation(): number; + + /** + * Return the visibility of the layer (true or false). + * The visibility of the layer + */ + getVisible(): boolean; + + /** + * Adjust the layer brightness. A value of -1 will render the layer completely black. A value of 0 will leave the brightness unchanged. A value of 1 will render the layer completely white. Other values are linear multipliers on the effect (values are clamped between -1 and 1). + * @param brightness The brightness of the layer + */ + setBrightness(brigthness: number): void; + + /** + * Adjust the layer contrast. A value of 0 will render the layer completely grey. A value of 1 will leave the contrast unchanged. Other values are linear multipliers on the effect (and values over 1 are permitted). + * @param contrast The contrast of the layer + */ + setContrast(contrast: number): void; + + /** + * Set the extent at which the layer is visible. If undefined, the layer will be visible at all extents. + * @param extent The extent of the layer + */ + setExtent(extent?: ol.Extent): void; + + /** + * Apply a hue-rotation to the layer. A value of 0 will leave the hue unchanged. Other values are radians around the color circle. + * @param hue The hue of the layer + */ + setHue(hue: number): void; + + /** + * Set the maximum resolution at which the layer is visible. + * @param maxResolution The maximum resolution of the layer. + */ + setMaxResolution(maxResolution: number): void; + + /** + * Set the minimum resolution at which the layer is visible. + * @param minResolution The minimum resolution of the layer. + */ + setMinResolution(minResolution: number): void; + + /** + * Set the opacity of the layer, allowed values range from 0 to 1. + * @param opactity The opacity of the layer. + */ + setOpacity(opacity: number): void; + + /** + * Adjust layer saturation. A value of 0 will render the layer completely unsaturated. A value of 1 will leave the saturation unchanged. Other values are linear multipliers of the effect (and values over 1 are permitted). + * @param saturation The saturation of the layer. + */ + setSaturation(saturation: number): void; + + /** + * Set the visibility of the layer (true or false). + * @param visible The visibility of the layer. + */ + setVisible(visible: boolean): void; } - class Group { + /** + * A ol.Collection of layers that are handled together. + */ + class Group extends ol.layer.Base { + + /** + * @constructor + * @param options Layer options. + */ + constructor(options?: GroupOptions); + + /** + * Returns the collection of layers in this group. + * @returns Collection of layers that are part of this group. + */ + getLayers(): ol.Collection; + + /** + * Set the collection of layers in this group. + * @param layers Collection of layers that are part of this group. + */ + setLayers(layers: ol.Collection): void; } - class Heatmap { + /** + * Layer for rendering vector data as a heatmap. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors. + */ + class Heatmap extends ol.layer.Vector { + + /** + * @constructor + * @param options Options + */ + constructor(options?: HeatmapOptions); + + /** + * Return the blur size in pixels. + * @returns Blur size in pixels + */ + getBlur(): number; + + /** + * Return the gradient colors as array of strings. + * @returns Colors + */ + getGradient(): Array; + + /** + * Return the size of the radius in pixels. + * @returns Radius size in pixel + */ + getRadius(): number; + + /** + * Set the blur size in pixels. + * @param blur Blur size in pixels + */ + setBlur(blur: number): void; + + /** + * Set the gradient colors as array of strings. + * @param colors Gradient + */ + setGradient(colors: Array): void; + + /** + * Set the size of the radius in pixels. + * @param radius Radius size in pixels + */ + setRadius(radius: number): void; } - class Image { + /** + * Server-rendered images that are available for arbitrary extents and resolutions. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors. + */ + class Image extends ol.layer.Layer { + + /** + * @constructor + * @param options Layer options + */ + constructor(options?: ImageOptions); + + /** + * Return the associated source of the image layer. + * @returns Source. + */ + getSource(): ol.source.Image; } - class Layer { + /** + * Abstract base class; normally only used for creating subclasses and not instantiated in apps. A visual representation of raster or vector map data. Layers group together those properties that pertain to how the data is to be displayed, irrespective of the source of that data. + */ + class Layer extends ol.layer.Base { + + /** + * @constructor + * @param options Layer options + */ + constructor(options?: LayerOptions); + + /** + * Get the layer source. + * @returns The layer source (or null if not yet set) + */ + getSource(): ol.source.Source; + + /** + * Set the layer source. + * @param source The layer source. + */ + setSource(source: ol.source.Source): void; + } + + /** + * For layer sources that provide pre-rendered, tiled images in grids that are organized by zoom levels for specific resolutions. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors. + */ + class Tile extends ol.layer.Layer { + + /** + * @constructor + * @param options Tile layer options. + */ + constructor(options?: TileOptions); + + /** + * Return the level as number to which we will preload tiles up to. + * @retruns The level to preload tiled up to. + */ + getPreload(): number; + + /** + * Return the associated tilesource of the layer. + * @returns Source + */ + getSource(): ol.source.Tile; + + /** + * Whether we use interim tiles on error. + * @returns Use interim tiles on error. + */ + getUseInterimTilesOnError(): boolean; + + /** + * Set the level as number to which we will preload tiles up to. + * @param preload The level to preload tiled up to + */ + setPreload(preload: number): void; + + /** + * Set whether we use interim tiles on error. + * @param useInterimTilesOnError Use interim tiles on error. + */ + setUseInterimTilesOnError(useInterimTilesOnError: boolean): void; } - class Tile { - constructor(options: any); + /** + * Vector data that is rendered client-side. Note that any property set in the options is set as a ol.Object property on the layer object; for example, setting title: 'My Title' in the options means that title is observable, and has get/set accessors. + */ + class Vector extends ol.layer.Layer { + + /** + * @constructor + * @param options Options + */ + constructor(options?: VectorOptions); + + /** + * Return the associated vectorsource of the layer. + * @returns Source. + */ + getSource(): ol.source.Vector; + + /** + * Get the style for features. This returns whatever was passed to the style option at construction or to the setStyle method. + */ + // TODO: Replace returntype any with ol.style.StyleFunction + getStyle(): ol.style.Style | Array | any; + + /** + * Get the style function. + * @returns Layer style function + */ + // TODO: Replace returntype any with ol.style.StyleFunction + getStyleFunction(): any; + + /** + * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. + */ + setStyle(); + + /** + * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. + * @param layer Layer style + */ + setStyle(style: ol.style.Style); + + /** + * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. + * @param layer Layer style + */ + setStyle(style: Array); + + /** + * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. + * @param Layer style + */ + // TODO: Replace 'any' with ol.style.StyleFunction + setStyle(style: any); } - class Vector { + interface BaseOptions { + + /** + * Brightness. Default is 0. + */ + brightness?: number; + + /** + * Contrast. Default is 1. + */ + contrast?: number; + + /** + * Hue. Default is 0. + */ + hue?: number; + + /** + * Opacity (0, 1). Default is 1. + */ + opacity?: number; + + /** + * Saturation. Default is 1. + */ + saturation?: number; + + /** + * Visibility. Default is true. + */ + visible?: boolean; + + /** + * The bounding extent for layer rendering. The layer will not be rendered outside of this extent. + */ + extent?: ol.Extent; + + /** + * The minimum resolution (inclusive) at which this layer will be visible. + */ + minResolution?: number; + + /** + * The maximum resolution (exclusive) below which this layer will be visible. + */ + maxResolution?: number; + } + + interface LayerOptions extends BaseOptions { + + /** + * The layer source (or null if not yet set). + */ + source?: ol.source.Source; + } + + interface GroupOptions extends BaseOptions { + + /** + * Child layers + */ + layers?: Array | ol.Collection; + } + + interface TileOptions extends LayerOptions { + + /** + * Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. + */ + preload?: number; + + /** + * Source for this layer. + */ + source?: ol.source.Tile; + + /** + * Use interim tiles on error. Default is true. + */ + useInterimTilesOnError?: boolean; + } + + interface ImageOptions extends LayerOptions { + } + + interface VectorOptions extends LayerOptions { + + /** + * When set to true, feature batches will be recreated during animations. This means that no vectors will be shown clipped, but the setting will have a performance impact for large amounts of vector data. When set to false, batches will be recreated when no animation is active. Default is false. + */ + updateWhileAnimating?: boolean; + + /** + * When set to true, feature batches will be recreated during interactions. See also updateWhileInteracting. Default is false. + */ + updateWhileInteracting?: boolean; + + /** + * Render order. Function to be used when sorting features before rendering. By default features are drawn in the order that they are created. Use null to avoid the sort, but get an undefined draw order. + */ + // TODO: replace any with the expected function, unclear in documentation what the parameters are + renderOrder?: any; + + /** + * The buffer around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection. Recommended value: the size of the largest symbol, line width or label. Default is 100 pixels. + */ + renderBuffer?: number; + + /** + * Source. + */ + source?: ol.source.Vector; + + /** + * Layer style. See ol.style for default style which will be used if this is not defined. + */ + style?: ol.style.Style | Array | any; + } + + interface HeatmapOptions extends VectorOptions { + + /** + * The color gradient of the heatmap, specified as an array of CSS color strings. Default is ['#00f', '#0ff', '#0f0', '#ff0', '#f00']. + */ + gradient?: Array; + + /** + * Radius size in pixels. Default is 8. + */ + radius?: number; + + /** + * Blur size in pixels. Default is 15. + */ + blur?: number; + + /** + * Shadow size in pixels. Default is 250. + */ + shadow?: number; } } From 0673d97c2eb0956ed5fe833fdd3d99f91fb09284 Mon Sep 17 00:00:00 2001 From: woutergd Date: Thu, 25 Jun 2015 18:19:40 +0200 Subject: [PATCH 0259/2220] Resolve build errors --- openlayers3/openlayers3.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts index 9f06166dab..28050055d7 100644 --- a/openlayers3/openlayers3.d.ts +++ b/openlayers3/openlayers3.d.ts @@ -2152,26 +2152,26 @@ declare module ol { /** * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. */ - setStyle(); + setStyle(): void; /** * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. * @param layer Layer style */ - setStyle(style: ol.style.Style); + setStyle(style: ol.style.Style): void; /** * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. * @param layer Layer style */ - setStyle(style: Array); + setStyle(style: Array): void; /** * Set the style for features. This can be a single style object, an array of styles, or a function that takes a feature and resolution and returns an array of styles. If it is undefined the default style is used. If it is null the layer has no style (a null style), so only features that have their own styles will be rendered in the layer. See ol.style for information on the default style. * @param Layer style */ // TODO: Replace 'any' with ol.style.StyleFunction - setStyle(style: any); + setStyle(style: any): void; } interface BaseOptions { From 9e69de89d1124ddf1a07874dc383fcbb2a0b64b2 Mon Sep 17 00:00:00 2001 From: Christopher Glantschnig Date: Thu, 25 Jun 2015 18:29:57 +0200 Subject: [PATCH 0260/2220] fixed return type according to the tests --- request-promise/request-promise.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request-promise/request-promise.d.ts b/request-promise/request-promise.d.ts index bdc2764a2d..9cee53eee6 100644 --- a/request-promise/request-promise.d.ts +++ b/request-promise/request-promise.d.ts @@ -16,7 +16,7 @@ declare module 'request-promise' { export = RequestPromiseAPI; - function RequestPromiseAPI(options: RequestPromiseAPI.Options): request.Request; + function RequestPromiseAPI(options: RequestPromiseAPI.Options): Promise; function RequestPromiseAPI(uri: string): Promise; module RequestPromiseAPI { From 996fd283e0af7c4b50915c8284fcf5f8f83cc7b3 Mon Sep 17 00:00:00 2001 From: woutergd Date: Thu, 25 Jun 2015 19:00:25 +0200 Subject: [PATCH 0261/2220] Added ol.tilegrid.* definitions --- openlayers3/openlayers3.d.ts | 228 ++++++++++++++++++++++++++++++++++- 1 file changed, 226 insertions(+), 2 deletions(-) diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts index 28050055d7..63ef200825 100644 --- a/openlayers3/openlayers3.d.ts +++ b/openlayers3/openlayers3.d.ts @@ -2549,13 +2549,237 @@ declare module ol { module tilegrid { + /** + * Base class for setting the grid pattern for sources accessing tiled-image servers. + */ class TileGrid { + + /** + * @constructor + * @param options Tile grid options + */ + constructor(options?: TileGridOptions); + + /** + * Creates a TileCoord transform function for use with this tile grid. Transforms the internal tile coordinates with bottom-left origin to the tile coordinates used by the ol.TileUrlFunction. The returned function expects an ol.TileCoord as first and an ol.proj.Projection as second argument and returns a transformed ol.TileCoord. + */ + // TODO: Check if this is correct, unclear in documentation + createTileCoordTransform(): any; + + /** + * Get the maximum zoom level for the grid. + * @returns Max zoom + */ + getMaxZoom(): number; + + /** + * Get the minimum zoom level for the grid. + * @returns Min zoom + */ + getMinZoom(): number; + + /** + * Get the origin for the grid at the given zoom level. + * @param z Z + * @returns Origin + */ + getOrigin(z: number): ol.Coordinate; + + /** + * Get the list of resolutions for the tile grid. + * @param z Z + * @returns Resolution + */ + getResolution(z: number): number; + + /** + * Get the list of resolutions for the tile grid. + * @returns Resolutions + */ + getResolutions(): Array; + + /** + * Get the tile coordinate for the given map coordinate and resolution. This method considers that coordinates that intersect tile boundaries should be assigned the higher tile coordinate. + * @param coordinate Coordinate + * @param resolution Resolution + * @param tileCoord Destination ol.TileCoord object. + * @returns Tile coordinate + */ + getTileCoordForCoordAndResolution(coordinate: ol.Coordinate, resolution: number, tileCoord?: ol.TileCoord): ol.TileCoord; + + /** + * Get a tile coordinate given a map coordinate and zoom level. + * @param coordinate Coordinate + * @param z Zoom level + * @param tileCoord Destination ol.TileCoord object + * @returns Tile coordinate + */ + getTileCoordForCoordAndZ(coordinate: ol.Coordinate, z: number, tileCoord?: ol.TileCoord): ol.TileCoord; + + /** + * Get the tile size for a zoom level. The type of the return value matches the tileSize or tileSizes that the tile grid was configured with. To always get an ol.Size, run the result through ol.size.toSize(). + * @param z Z + * @returns Tile size + */ + getTileSize(z: number): number | ol.Size; + } + interface TileGridOptions { + + /** + * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.Tile sources. When no origin or origins are configured, the origin will be set to the bottom-left corner of the extent. When no sizes are configured, they will be calculated from the extent. + */ + extent?: ol.Extent; + + /** + * Minimum zoom. Default is 0. + */ + minZoom?: number; + + /** + * Origin, i.e. the bottom-left corner of the grid. Default is null. + */ + origin?: ol.Coordinate; + + /** + * Origins, i.e. the bottom-left corners of the grid for each zoom level. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different origin. + */ + origins?: Array; + + /** + * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1. + */ + resolutions?: Array; + + /** + * Tile size. Default is [256, 256]. + */ + tileSize?: number | ol.Size; + + /** + * Tile sizes. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different tile size. + */ + tileSizes?: Array; } - class WMTS { + /** + * Set the grid pattern for sources accessing WMTS tiled-image servers. + */ + class WMTS extends TileGrid { + + /** + * @constructor + * @param options WMTS options + */ + constructor(options: WMTSOptions); + + /** + * Create a tile grid from a WMTS capabilities matrix set. + * @param matrixSet An object representing a matrixSet in the capabilities document. + * @param extent An optional extent to restrict the tile ranges the server provides. + * @returns WMTS tilegrid instance + */ + createFromCapabilitiesMatrixSet(matrixSet: any, extent: ol.Extent): ol.tilegrid.WMTS; + + /** + * Get the list of matrix identifiers. + * @returns MatrixIds + */ + getMatrixIds(): Array; + } + interface WMTSOptions { + + /** + * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.WMTS sources. When no origin or origins are configured, the origin will be calculated from the extent. When no sizes are configured, they will be calculated from the extent. + */ + extent?: ol.Extent; + + /** + * Origin, i.e. the top-left corner of the grid. + */ + origin?: ol.Coordinate; + + /** + * Origins, i.e. the top-left corners of the grid for each zoom level. The length of this array needs to match the length of the resolutions array. + */ + origins?: Array; + + /** + * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1 + */ + resolutions?: Array; + + /** + * matrix IDs. The length of this array needs to match the length of the resolutions array. + */ + matrixIds?: Array; + + /** + * Number of tile rows and columns of the grid for each zoom level. The values here are the TileMatrixWidth and TileMatrixHeight advertised in the GetCapabilities response of the WMTS, and define the grid's extent together with the origin. An extent can be configured in addition, and will further limit the extent for which tile requests are made by sources. + */ + sizes?: Array; + + /** + * Tile size. + */ + tileSize?: number | ol.Size; + + /** + * Tile sizes. The length of this array needs to match the length of the resolutions array. + */ + tileSizes?: Array; + + /** + * Number of tile columns that cover the grid's extent for each zoom level. Only required when used with a source that has wrapX set to true, and only when the grid's origin differs from the one of the projection's extent. The array length has to match the length of the resolutions array, i.e. each resolution will have a matching entry here. + */ + widths?: Array; } - class Zoomify { + /** + * Set the grid pattern for sources accessing Zoomify tiled-image servers. + */ + class Zoomify extends TileGrid { + + /** + * @constructor + * @param options Options + */ + constructor(options?: ZoomifyOptions); + } + interface ZoomifyOptions { + + /** + * Resolutions + */ + resolutions: Array; + } + + /** + * Creates a tile grid with a standard XYZ tiling scheme. + * @param options Tile grid options. + * @returns The grid instance + */ + function createXYZ(options: CreateXYZOptions): ol.tilegrid.TileGrid; + interface CreateXYZOptions { + + /** + * Extent for the tile grid. The origin for an XYZ tile grid is the top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the provided extent. If not provided, the extent of the EPSG:3857 projection is used. + */ + extent?: ol.Extent; + + /** + * Maximum zoom. The default is ol.DEFAULT_MAX_ZOOM. This determines the number of levels in the grid set. For example, a maxZoom of 21 means there are 22 levels in the grid set. + */ + maxZoom?: number; + + /** + * Minimum zoom. Default is 0. + */ + minZoom?: number; + + /** + * Tile size in pixels. Default is [256, 256]. + */ + tileSize?: number | ol.Size; } } From 293fa7a6529461ff0d8cc4e15d3f4c055c0ef4be Mon Sep 17 00:00:00 2001 From: woutergd Date: Thu, 25 Jun 2015 19:34:30 +0200 Subject: [PATCH 0262/2220] Moved all options definition typings into the olx-module as defined in the docs of openlayers --- openlayers3/openlayers3.d.ts | 1316 +++++++++++++++++----------------- 1 file changed, 676 insertions(+), 640 deletions(-) diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts index 63ef200825..7b3b16c7be 100644 --- a/openlayers3/openlayers3.d.ts +++ b/openlayers3/openlayers3.d.ts @@ -3,6 +3,647 @@ // Definitions by: Wouter Goedhart // Definitions: https://github.com/borisyankov/DefinitelyTyped +declare module olx { + + interface AttributionOptions { + + /** HTML markup for this attribution. */ + html: string; + } + + interface DeviceOrientationOptions { + + /** + * Start tracking. Default is false. + */ + tracking?: boolean; + } + + interface FeatureOverlayOptions { + + /** + * Features + */ + // TODO: implement stylefunction + features?: Array | ol.Collection | any; + + /** + * Map + */ + map: ol.Map; + + /** + * Style + */ + style: ol.style.Style | Array; + } + + interface GeolocationOptions { + + /** + * Start Tracking. Default is false. + */ + tracking?: boolean; + + /** + * Tracking options. See http://www.w3.org/TR/geolocation-API/#position_options_interface. + */ + trackingOptions?: PositionOptions; + + /** + * The projection the position is reported in. + */ + projection?: ol.proj.ProjectionLike; + } + + interface GraticuleOptions { + + /** Reference to an ol.Map object. */ + map?: ol.Map; + + /** The maximum number of meridians and parallels from the center of the map. The default value is 100, which means that at most 200 meridians and 200 parallels will be displayed. The default value is appropriate for conformal projections like Spherical Mercator. If you increase the value more lines will be drawn and the drawing performance will decrease. */ + maxLines?: number; + + /** The stroke style to use for drawing the graticule. If not provided, the lines will be drawn with rgba(0,0,0,0.2), a not fully opaque black. */ + strokeStyle?: ol.style.Stroke; + + /** The target size of the graticule cells, in pixels. Default value is 100 pixels. */ + targetSize?: number; + } + + interface MapOptions { + + /** Controls initially added to the map. If not specified, ol.control.defaults() is used. */ + controls?: any; + + /** The ratio between physical pixels and device-independent pixels (dips) on the device. If undefined then it gets set by using window.devicePixelRatio. */ + pixelRatio?: number; + + /** Interactions that are initially added to the map. If not specified, ol.interaction.defaults() is used. */ + interactions?: any; + + /** The element to listen to keyboard events on. This determines when the KeyboardPan and KeyboardZoom interactions trigger. For example, if this option is set to document the keyboard interactions will always trigger. If this option is not specified, the element the library listens to keyboard events on is the map target (i.e. the user-provided div for the map). If this is not document the target element needs to be focused for key events to be emitted, requiring that the target element has a tabindex attribute. */ + keyboardEventTarget?: any; + + /** Layers. If this is not defined, a map with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer. */ + layers?: Array + + /** When set to true, tiles will be loaded during animations. This may improve the user experience, but can also make animations stutter on devices with slow memory. Default is false. */ + loadTilesWhileAnimating?: boolean; + + /** When set to true, tiles will be loaded while interacting with the map. This may improve the user experience, but can also make map panning and zooming choppy on devices with slow memory. Default is false. */ + loadTilesWhileInteracting?: boolean; + + /** The map logo. A logo to be displayed on the map at all times. If a string is provided, it will be set as the image source of the logo. If an object is provided, the src property should be the URL for an image and the href property should be a URL for creating a link. To disable the map logo, set the option to false. By default, the OpenLayers 3 logo is shown. */ + logo?: any; + + /** Overlays initially added to the map. By default, no overlays are added. */ + overlays?: any; + + /** Renderer. By default, Canvas, DOM and WebGL renderers are tested for support in that order, and the first supported used. Specify a ol.RendererType here to use a specific renderer. Note that at present only the Canvas renderer supports vector data. */ + renderer?: any; + + /** The container for the map, either the element itself or the id of the element. If not specified at construction time, ol.Map#setTarget must be called for the map to be rendered. */ + target?: any; + + /** The map's view. No layer sources will be fetched unless this is specified at construction time or through ol.Map#setView. */ + view?: ViewOptions; + } + + interface OverlayOptions { + + /** + * The overlay element. + */ + element?: Element; + + /** + * Offsets in pixels used when positioning the overlay. The fist element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is [0, 0]. + */ + offset?: Array; + + /** + * The overlay position in map projection. + */ + position?: ol.Coordinate; + + /** + * Defines how the overlay is actually positioned with respect to its position property. Possible values are 'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', and 'top-right'. Default is 'top-left'. + */ + positioning?: ol.OverlayPositioning; + + /** + * Whether event propagation to the map viewport should be stopped. Default is true. If true the overlay is placed in the same container as that of the controls (CSS class name ol-overlaycontainer-stopevent); if false it is placed in the container with CSS class name ol-overlaycontainer. + */ + stopEvent?: boolean; + + /** + * Whether the overlay is inserted first in the overlay container, or appended. Default is true. If the overlay is placed in the same container as that of the controls (see the stopEvent option) you will probably set insertFirst to true so the overlay is displayed below the controls. + */ + insertFirst?: boolean; + + /** + * If set to true the map is panned when calling setPosition, so that the overlay is entirely visible in the current viewport. The default is false. + */ + autoPan?: boolean; + + /** + * The options used to create a ol.animation.pan animation. This animation is only used when autoPan is enabled. By default the default options for ol.animation.pan are used. If set to null the panning is not animated. + */ + //TODO: replace with olx.animation.PanOptions + autoPanAnimation?: any; + + /** + * The margin (in pixels) between the overlay and the borders of the map when autopanning. The default is 20. + */ + autoPanMargin?: number; + } + + interface ViewOptions { + + /** The initial center for the view. The coordinate system for the center is specified with the projection option. Default is undefined, and layer sources will not be fetched if this is not set. */ + center?: ol.Coordinate; + + /** Rotation constraint. false means no constraint. true means no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example, 4 will constrain the rotation to 0, 90, 180, and 270 degrees. The default is true. */ + constrainRotation?: boolean; + + /** Enable rotation. Default is true. If false a rotation constraint that always sets the rotation to zero is used. The constrainRotation option has no effect if enableRotation is false. */ + enableRotation?: boolean; + + /**The extent that constrains the center, in other words, center cannot be set outside this extent. Default is undefined. */ + extent?: ol.Extent; + + /** The maximum resolution used to determine the resolution constraint. It is used together with minResolution (or maxZoom) and zoomFactor. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) then maxResolution defaults to 40075016.68557849 / 256 = 156543.03392804097. */ + maxResolution?: number; + + /** The minimum resolution used to determine the resolution constraint. It is used together with maxResolution (or minZoom) and zoomFactor. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) then minResolution defaults to 40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253. */ + minResolution?: number; + + /** The maximum zoom level used to determine the resolution constraint. It is used together with minZoom (or maxResolution) and zoomFactor. Default is 28. Note that if minResolution is also provided, it is given precedence over maxZoom. */ + maxZoom?: number; + + /** The minimum zoom level used to determine the resolution constraint. It is used together with maxZoom (or minResolution) and zoomFactor. Default is 0. Note that if maxResolution is also provided, it is given precedence over minZoom. */ + minZoom?: number; + + /** The projection. Default is EPSG:3857 (Spherical Mercator). */ + projection?: ol.proj.ProjectionLike; + + /** The initial resolution for the view. The units are projection units per pixel (e.g. meters per pixel). An alternative to setting this is to set zoom. Default is undefined, and layer sources will not be fetched if neither this nor zoom are defined. */ + resolution?: number; + + /** Resolutions to determine the resolution constraint. If set the maxResolution, minResolution, minZoom, maxZoom, and zoomFactor options are ignored. */ + resolutions?: Array; + + /** The initial rotation for the view in radians (positive rotation clockwise). Default is 0. */ + rotation?: number; + + /** Only used if resolution is not defined. Zoom level used to calculate the initial resolution for the view. The initial resolution is determined using the ol.View#constrainResolution method. */ + zoom?: number; + + /** The zoom factor used to determine the resolution constraint. Default is 2. */ + zoomFactor?: number; + } + + module animation { + + interface BounceOptions { + + /** + * The resolution to start the bounce from, typically map.getView().getResolution(). + */ + resolution: number; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + interface PanOptions { + + /** + * The resolution to start the bounce from, typically map.getView().getResolution(). + */ + source: ol.Coordinate; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + interface RotateOptions { + + /** + * The rotation value (in radians) to begin rotating from, typically map.getView().getRotation(). If undefined then 0 is assumed. + */ + rotation?: number; + + /** + * The rotation center/anchor. The map rotates around the center of the view if unspecified. + */ + anchor?: ol.Coordinate; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + interface ZoomOptions { + + /** + * The resolution to begin zooming from, typically map.getView().getResolution(). + */ + resolution: number; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + } + + module control { + + interface DefaultsOptions { + + /** + * Attribution. Default is true. + */ + attribution?: boolean; + + /** + * Attribution options. + */ + //TODO: Replace with olx.control.AttributionOptions + attributionOptions?: any; + + /** + * Rotate. Default is true; + */ + rotate?: boolean; + + /** + * Rotate options + */ + //TODO: Replace with olx.control.RotateOptions + rotateOptions?: any; + + /** + * Zoom. Default is true + */ + zoom?: boolean; + + /** + * + */ + //TODO: Replace with olx.control.ZoomOptions + zoomOptions?: any; + } + } + + module layer { + + interface BaseOptions { + + /** + * Brightness. Default is 0. + */ + brightness?: number; + + /** + * Contrast. Default is 1. + */ + contrast?: number; + + /** + * Hue. Default is 0. + */ + hue?: number; + + /** + * Opacity (0, 1). Default is 1. + */ + opacity?: number; + + /** + * Saturation. Default is 1. + */ + saturation?: number; + + /** + * Visibility. Default is true. + */ + visible?: boolean; + + /** + * The bounding extent for layer rendering. The layer will not be rendered outside of this extent. + */ + extent?: ol.Extent; + + /** + * The minimum resolution (inclusive) at which this layer will be visible. + */ + minResolution?: number; + + /** + * The maximum resolution (exclusive) below which this layer will be visible. + */ + maxResolution?: number; + } + + interface GroupOptions extends BaseOptions { + + /** + * Child layers + */ + layers?: Array | ol.Collection; + } + + interface HeatmapOptions extends VectorOptions { + + /** + * The color gradient of the heatmap, specified as an array of CSS color strings. Default is ['#00f', '#0ff', '#0f0', '#ff0', '#f00']. + */ + gradient?: Array; + + /** + * Radius size in pixels. Default is 8. + */ + radius?: number; + + /** + * Blur size in pixels. Default is 15. + */ + blur?: number; + + /** + * Shadow size in pixels. Default is 250. + */ + shadow?: number; + } + + interface ImageOptions extends LayerOptions { + } + + interface LayerOptions extends BaseOptions { + + /** + * The layer source (or null if not yet set). + */ + source?: ol.source.Source; + } + + interface TileOptions extends LayerOptions { + + /** + * Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. + */ + preload?: number; + + /** + * Source for this layer. + */ + source?: ol.source.Tile; + + /** + * Use interim tiles on error. Default is true. + */ + useInterimTilesOnError?: boolean; + } + + interface VectorOptions extends LayerOptions { + + /** + * When set to true, feature batches will be recreated during animations. This means that no vectors will be shown clipped, but the setting will have a performance impact for large amounts of vector data. When set to false, batches will be recreated when no animation is active. Default is false. + */ + updateWhileAnimating?: boolean; + + /** + * When set to true, feature batches will be recreated during interactions. See also updateWhileInteracting. Default is false. + */ + updateWhileInteracting?: boolean; + + /** + * Render order. Function to be used when sorting features before rendering. By default features are drawn in the order that they are created. Use null to avoid the sort, but get an undefined draw order. + */ + // TODO: replace any with the expected function, unclear in documentation what the parameters are + renderOrder?: any; + + /** + * The buffer around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection. Recommended value: the size of the largest symbol, line width or label. Default is 100 pixels. + */ + renderBuffer?: number; + + /** + * Source. + */ + source?: ol.source.Vector; + + /** + * Layer style. See ol.style for default style which will be used if this is not defined. + */ + style?: ol.style.Style | Array | any; + } + } + + module tilegrid { + + interface TileGridOptions { + + /** + * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.Tile sources. When no origin or origins are configured, the origin will be set to the bottom-left corner of the extent. When no sizes are configured, they will be calculated from the extent. + */ + extent?: ol.Extent; + + /** + * Minimum zoom. Default is 0. + */ + minZoom?: number; + + /** + * Origin, i.e. the bottom-left corner of the grid. Default is null. + */ + origin?: ol.Coordinate; + + /** + * Origins, i.e. the bottom-left corners of the grid for each zoom level. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different origin. + */ + origins?: Array; + + /** + * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1. + */ + resolutions?: Array; + + /** + * Tile size. Default is [256, 256]. + */ + tileSize?: number | ol.Size; + + /** + * Tile sizes. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different tile size. + */ + tileSizes?: Array; + } + + interface WMTSOptions { + + /** + * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.WMTS sources. When no origin or origins are configured, the origin will be calculated from the extent. When no sizes are configured, they will be calculated from the extent. + */ + extent?: ol.Extent; + + /** + * Origin, i.e. the top-left corner of the grid. + */ + origin?: ol.Coordinate; + + /** + * Origins, i.e. the top-left corners of the grid for each zoom level. The length of this array needs to match the length of the resolutions array. + */ + origins?: Array; + + /** + * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1 + */ + resolutions?: Array; + + /** + * matrix IDs. The length of this array needs to match the length of the resolutions array. + */ + matrixIds?: Array; + + /** + * Number of tile rows and columns of the grid for each zoom level. The values here are the TileMatrixWidth and TileMatrixHeight advertised in the GetCapabilities response of the WMTS, and define the grid's extent together with the origin. An extent can be configured in addition, and will further limit the extent for which tile requests are made by sources. + */ + sizes?: Array; + + /** + * Tile size. + */ + tileSize?: number | ol.Size; + + /** + * Tile sizes. The length of this array needs to match the length of the resolutions array. + */ + tileSizes?: Array; + + /** + * Number of tile columns that cover the grid's extent for each zoom level. Only required when used with a source that has wrapX set to true, and only when the grid's origin differs from the one of the projection's extent. The array length has to match the length of the resolutions array, i.e. each resolution will have a matching entry here. + */ + widths?: Array; + } + + interface XYZOptions { + + /** + * Extent for the tile grid. The origin for an XYZ tile grid is the top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the provided extent. If not provided, the extent of the EPSG:3857 projection is used. + */ + extent?: ol.Extent; + + /** + * Maximum zoom. The default is ol.DEFAULT_MAX_ZOOM. This determines the number of levels in the grid set. For example, a maxZoom of 21 means there are 22 levels in the grid set. + */ + maxZoom?: number; + + /** + * Minimum zoom. Default is 0. + */ + minZoom?: number; + + /** + * Tile size in pixels. Default is [256, 256]. + */ + tileSize?: number | ol.Size; + } + + interface ZoomifyOptions { + + /** + * Resolutions + */ + resolutions: Array; + } + } + + module view { + + interface FitGeometryOptions { + + /** + * Padding (in pixels) to be cleared inside the view. Values in the array are top, right, bottom and left padding. Default is [0, 0, 0, 0]. + */ + padding?: Array; + + /** + * Constrain the resolution. Default is true. + */ + constrainResolution?: boolean; + + /** + * Get the nearest extent. Default is false. + */ + nearest?: boolean; + + /** + * Minimum resolution that we zoom to. Default is 0. + */ + minResolution?: number; + + /** + * Maximum zoom level that we zoom to. If minResolution is given, this property is ignored. + */ + maxZoom?: number; + } + } +} + /** * A high-performance, feature-packed library for all your mapping needs. */ @@ -16,7 +657,7 @@ declare module ol { * @constructor * @param options Attribution options. */ - constructor(options: AttributionOptions); + constructor(options: olx.AttributionOptions); /** * Get the attribution markup. @@ -24,12 +665,7 @@ declare module ol { */ getHTML(): string; } - interface AttributionOptions { - - /** HTML markup for this attribution. */ - html: string; - } - + /** * An expanded version of standard JS Array, adding convenience methods for manipulation. Add and remove changes to the Collection trigger a Collection event. Note that this does not cover changes to the objects within the Collection; they trigger events on the appropriate object, not on the Collection as a whole. */ @@ -141,7 +777,7 @@ declare module ol { * @constructor * @param options Options. */ - constructor(options: DeviceOrientationOptions); + constructor(options?: olx.DeviceOrientationOptions); /** * Rotation around the device z-axis (in radians). @@ -179,14 +815,7 @@ declare module ol { */ setTracking(tracking: boolean): void; } - interface DeviceOrientationOptions { - - /** - * Start tracking. Default is false. - */ - tracking?: boolean; - } - + /** * Events emitted by ol.interaction.DragBox instances are instances of this type. */ @@ -284,7 +913,7 @@ declare module ol { * @constructor * @param options Options. */ - constructor(options: FeatureOverlayOptions); + constructor(options?: olx.FeatureOverlayOptions); /** * Add a feature to the overlay. @@ -344,24 +973,6 @@ declare module ol { setStyle(style: Array): void; setStyle(style: any): void; } - interface FeatureOverlayOptions { - - /** - * Features - */ - // TODO: implement stylefunction - features?: Array | Collection | any; - - /** - * Map - */ - map: Map; - - /** - * Style - */ - style: style.Style | Array; - } /** * Helper class for providing HTML5 Geolocation capabilities. The Geolocation API is used to locate a user's position. @@ -372,7 +983,7 @@ declare module ol { * @constructor * @param options Options. */ - constructor(options: GeolocationOptions); + constructor(options?: olx.GeolocationOptions); /** * Get the accuracy of the position in meters. @@ -452,23 +1063,6 @@ declare module ol { */ setTrackingOptions(options: PositionOptions): void; } - interface GeolocationOptions { - - /** - * Start Tracking. Default is false. - */ - tracking?: boolean; - - /** - * Tracking options. See http://www.w3.org/TR/geolocation-API/#position_options_interface. - */ - trackingOptions?: PositionOptions; - - /** - * The projection the position is reported in. - */ - projection?: ol.proj.ProjectionLike; - } /** * Render a grid for a coordinate system on a map. @@ -478,7 +1072,7 @@ declare module ol { * @constructor * @param options Options. */ - constructor(options: GraticuleOptions); + constructor(options?: olx.GraticuleOptions); /** * Get the map associated with this graticule. @@ -504,21 +1098,7 @@ declare module ol { */ setMap(map: Map): void; } - interface GraticuleOptions { - - /** Reference to an ol.Map object. */ - map?: Map; - - /** The maximum number of meridians and parallels from the center of the map. The default value is 100, which means that at most 200 meridians and 200 parallels will be displayed. The default value is appropriate for conformal projections like Spherical Mercator. If you increase the value more lines will be drawn and the drawing performance will decrease. */ - maxLines?: number; - - /** The stroke style to use for drawing the graticule. If not provided, the lines will be drawn with rgba(0,0,0,0.2), a not fully opaque black. */ - strokeStyle?: style.Stroke; - - /** The target size of the graticule cells, in pixels. Default value is 100 pixels. */ - targetSize?: number; - } - + /** * */ @@ -574,7 +1154,7 @@ declare module ol { * @constructor * @params options Options. */ - constructor(options: MapOptions); + constructor(options: olx.MapOptions); /** * Add the given control to the map. @@ -794,45 +1374,7 @@ declare module ol { * */ updateSize(): void; } - interface MapOptions { - - /** Controls initially added to the map. If not specified, ol.control.defaults() is used. */ - controls?: any; - - /** The ratio between physical pixels and device-independent pixels (dips) on the device. If undefined then it gets set by using window.devicePixelRatio. */ - pixelRatio?: number; - - /** Interactions that are initially added to the map. If not specified, ol.interaction.defaults() is used. */ - interactions?: any; - - /** The element to listen to keyboard events on. This determines when the KeyboardPan and KeyboardZoom interactions trigger. For example, if this option is set to document the keyboard interactions will always trigger. If this option is not specified, the element the library listens to keyboard events on is the map target (i.e. the user-provided div for the map). If this is not document the target element needs to be focused for key events to be emitted, requiring that the target element has a tabindex attribute. */ - keyboardEventTarget?: any; - - /** Layers. If this is not defined, a map with no layers will be rendered. Note that layers are rendered in the order supplied, so if you want, for example, a vector layer to appear on top of a tile layer, it must come after the tile layer. */ - layers?: Array - - /** When set to true, tiles will be loaded during animations. This may improve the user experience, but can also make animations stutter on devices with slow memory. Default is false. */ - loadTilesWhileAnimating?: boolean; - - /** When set to true, tiles will be loaded while interacting with the map. This may improve the user experience, but can also make map panning and zooming choppy on devices with slow memory. Default is false. */ - loadTilesWhileInteracting?: boolean; - - /** The map logo. A logo to be displayed on the map at all times. If a string is provided, it will be set as the image source of the logo. If an object is provided, the src property should be the URL for an image and the href property should be a URL for creating a link. To disable the map logo, set the option to false. By default, the OpenLayers 3 logo is shown. */ - logo?: any; - - /** Overlays initially added to the map. By default, no overlays are added. */ - overlays?: any; - - /** Renderer. By default, Canvas, DOM and WebGL renderers are tested for support in that order, and the first supported used. Specify a ol.RendererType here to use a specific renderer. Note that at present only the Canvas renderer supports vector data. */ - renderer?: any; - - /** The container for the map, either the element itself or the id of the element. If not specified at construction time, ol.Map#setTarget must be called for the map to be rendered. */ - target?: any; - - /** The map's view. No layer sources will be fetched unless this is specified at construction time or through ol.Map#setView. */ - view?: ViewOptions; - } - + /** * Events emitted as map browser events are instances of this type. See ol.Map for which events trigger a map browser event. */ @@ -1051,7 +1593,7 @@ declare module ol { * @constructor * @param options Overlay options. */ - constructor(options: OverlayOptions); + constructor(options: olx.OverlayOptions); /** * Get the DOM element of this overlay. @@ -1113,55 +1655,7 @@ declare module ol { */ setPositioning(positioning: ol.OverlayPositioning): void; } - interface OverlayOptions { - - /** - * The overlay element. - */ - element?: Element; - - /** - * Offsets in pixels used when positioning the overlay. The fist element in the array is the horizontal offset. A positive value shifts the overlay right. The second element in the array is the vertical offset. A positive value shifts the overlay down. Default is [0, 0]. - */ - offset?: Array; - - /** - * The overlay position in map projection. - */ - position?: ol.Coordinate; - - /** - * Defines how the overlay is actually positioned with respect to its position property. Possible values are 'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', and 'top-right'. Default is 'top-left'. - */ - positioning?: ol.OverlayPositioning; - - /** - * Whether event propagation to the map viewport should be stopped. Default is true. If true the overlay is placed in the same container as that of the controls (CSS class name ol-overlaycontainer-stopevent); if false it is placed in the container with CSS class name ol-overlaycontainer. - */ - stopEvent?: boolean; - - /** - * Whether the overlay is inserted first in the overlay container, or appended. Default is true. If the overlay is placed in the same container as that of the controls (see the stopEvent option) you will probably set insertFirst to true so the overlay is displayed below the controls. - */ - insertFirst?: boolean; - - /** - * If set to true the map is panned when calling setPosition, so that the overlay is entirely visible in the current viewport. The default is false. - */ - autoPan?: boolean; - - /** - * The options used to create a ol.animation.pan animation. This animation is only used when autoPan is enabled. By default the default options for ol.animation.pan are used. If set to null the panning is not animated. - */ - //TODO: replace with olx.animation.PanOptions - autoPanAnimation?: any; - - /** - * The margin (in pixels) between the overlay and the borders of the map when autopanning. The default is 20. - */ - autoPanMargin?: number; - } - + /** * Events emitted by ol.interaction.Select instances are instances of this type. */ @@ -1231,7 +1725,7 @@ declare module ol { * @constructor * @param options Options. */ - constructor(options: ViewOptions); + constructor(options?: olx.ViewOptions); /** * Calculate the extent for the current view state and the passed size. The size is the pixel dimensions of the box into which the calculated extent should fit. In most cases you want to get the extent of the entire map, that is map.getSize(). @@ -1277,7 +1771,7 @@ declare module ol { * @param size Box pixel size. * @param options Options */ - fitGeometry(geometry: ol.geom.SimpleGeometry, size: ol.Size, options?: ViewFitGeometryOptions): void; + fitGeometry(geometry: ol.geom.SimpleGeometry, size: ol.Size, options?: olx.view.FitGeometryOptions): void; /** * Get the view center. @@ -1340,78 +1834,7 @@ declare module ol { */ setZoom(zoom: number): void; } - interface ViewOptions { - - /** The initial center for the view. The coordinate system for the center is specified with the projection option. Default is undefined, and layer sources will not be fetched if this is not set. */ - center?: Coordinate; - - /** Rotation constraint. false means no constraint. true means no constraint, but snap to zero near zero. A number constrains the rotation to that number of values. For example, 4 will constrain the rotation to 0, 90, 180, and 270 degrees. The default is true. */ - constrainRotation?: boolean; - - /** Enable rotation. Default is true. If false a rotation constraint that always sets the rotation to zero is used. The constrainRotation option has no effect if enableRotation is false. */ - enableRotation?: boolean; - - /**The extent that constrains the center, in other words, center cannot be set outside this extent. Default is undefined. */ - extent?: Extent; - - /** The maximum resolution used to determine the resolution constraint. It is used together with minResolution (or maxZoom) and zoomFactor. If unspecified it is calculated in such a way that the projection's validity extent fits in a 256x256 px tile. If the projection is Spherical Mercator (the default) then maxResolution defaults to 40075016.68557849 / 256 = 156543.03392804097. */ - maxResolution?: number; - - /** The minimum resolution used to determine the resolution constraint. It is used together with maxResolution (or minZoom) and zoomFactor. If unspecified it is calculated assuming 29 zoom levels (with a factor of 2). If the projection is Spherical Mercator (the default) then minResolution defaults to 40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253. */ - minResolution?: number; - - /** The maximum zoom level used to determine the resolution constraint. It is used together with minZoom (or maxResolution) and zoomFactor. Default is 28. Note that if minResolution is also provided, it is given precedence over maxZoom. */ - maxZoom?: number; - - /** The minimum zoom level used to determine the resolution constraint. It is used together with maxZoom (or minResolution) and zoomFactor. Default is 0. Note that if maxResolution is also provided, it is given precedence over minZoom. */ - minZoom?: number; - - /** The projection. Default is EPSG:3857 (Spherical Mercator). */ - projection?: any; - - /** The initial resolution for the view. The units are projection units per pixel (e.g. meters per pixel). An alternative to setting this is to set zoom. Default is undefined, and layer sources will not be fetched if neither this nor zoom are defined. */ - resolution?: number; - - /** Resolutions to determine the resolution constraint. If set the maxResolution, minResolution, minZoom, maxZoom, and zoomFactor options are ignored. */ - resolutions?: Array; - - /** The initial rotation for the view in radians (positive rotation clockwise). Default is 0. */ - rotation?: number; - - /** Only used if resolution is not defined. Zoom level used to calculate the initial resolution for the view. The initial resolution is determined using the ol.View#constrainResolution method. */ - zoom?: number; - - /** The zoom factor used to determine the resolution constraint. Default is 2. */ - zoomFactor?: number; - } - interface ViewFitGeometryOptions { - - /** - * Padding (in pixels) to be cleared inside the view. Values in the array are top, right, bottom and left padding. Default is [0, 0, 0, 0]. - */ - padding?: Array; - - /** - * Constrain the resolution. Default is true. - */ - constrainResolution?: boolean; - - /** - * Get the nearest extent. Default is false. - */ - nearest?: boolean; - - /** - * Minimum resolution that we zoom to. Default is 0. - */ - minResolution?: number; - - /** - * Maximum zoom level that we zoom to. If minResolution is given, this property is ignored. - */ - maxZoom?: number; - } - + // NAMESPACES /** @@ -1424,124 +1847,27 @@ declare module ol { * @param options Bounce options. */ //TODO: return ol.PreRenderFunction - function bounce(options: AnimationBounceOptions): any; - interface AnimationBounceOptions { - - /** - * The resolution to start the bounce from, typically map.getView().getResolution(). - */ - resolution: number; - - /** - * The start time of the animation. Default is immediately. - */ - start?: number; - - /** - * The duration of the animation in milliseconds. Default is 1000. - */ - duration?: number; - - /** - * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. - */ - // TODO: Check if it is an ol.easing function - easing: () => void; - } - + function bounce(options: olx.animation.BounceOptions): any; + /** * Generate an animated transition while updating the view center. * @param options Pan options. */ //TODO: return ol.PreRenderFunction - function pan(options: AnimationPanOptions): any; - interface AnimationPanOptions { - - /** - * The resolution to start the bounce from, typically map.getView().getResolution(). - */ - source: ol.Coordinate; - - /** - * The start time of the animation. Default is immediately. - */ - start?: number; - - /** - * The duration of the animation in milliseconds. Default is 1000. - */ - duration?: number; - - /** - * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. - */ - // TODO: Check if it is an ol.easing function - easing: () => void; - } + function pan(options: olx.animation.PanOptions): any; /** * Generate an animated transition while updating the view rotation. * @param options Rotate options. */ //TODO: return ol.PreRenderFunction - function rotate(options: AnimationRotateOptions): any; - interface AnimationRotateOptions { - - /** - * The rotation value (in radians) to begin rotating from, typically map.getView().getRotation(). If undefined then 0 is assumed. - */ - rotation?: number; - - /** - * The rotation center/anchor. The map rotates around the center of the view if unspecified. - */ - anchor?: ol.Coordinate; - - /** - * The start time of the animation. Default is immediately. - */ - start?: number; - - /** - * The duration of the animation in milliseconds. Default is 1000. - */ - duration?: number; - - /** - * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. - */ - // TODO: Check if it is an ol.easing function - easing: () => void; - } + function rotate(options: olx.animation.RotateOptions): any; /** * Generate an animated transition while updating the view resolution. * @param options Zoom options. */ - function pan(options: AnimationZoomOptions): any; - interface AnimationZoomOptions { - - /** - * The resolution to begin zooming from, typically map.getView().getResolution(). - */ - resolution: number; - - /** - * The start time of the animation. Default is immediately. - */ - start?: number; - - /** - * The duration of the animation in milliseconds. Default is 1000. - */ - duration?: number; - - /** - * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. - */ - // TODO: Check if it is an ol.easing function - easing: () => void; - } + function pan(options: olx.animation.PanOptions): any; } /** @@ -1571,43 +1897,8 @@ declare module ol { * @param options Defaults options * @returns Control.s */ - function defaults(opt_options: ControlDefaultsOptions): ol.Collection; - interface ControlDefaultsOptions { - - /** - * Attribution. Default is true. - */ - attribution?: boolean; - - /** - * Attribution options. - */ - //TODO: Replace with olx.control.AttributionOptions - attributionOptions?: any; - - /** - * Rotate. Default is true; - */ - rotate?: boolean; - - /** - * Rotate options - */ - //TODO: Replace with olx.control.RotateOptions - rotateOptions?: any; - - /** - * Zoom. Default is true - */ - zoom?: boolean; - - /** - * - */ - //TODO: Replace with olx.control.ZoomOptions - zoomOptions?: any; - } - + function defaults(options?: olx.control.DefaultsOptions): ol.Collection; + /** * Units for the scale line. Supported values are 'degrees', 'imperial', 'nautical', 'metric', 'us'. */ @@ -1852,7 +2143,7 @@ declare module ol { * @constructor * @param options Layer options. */ - constructor(options?: BaseOptions); + constructor(options?: olx.layer.BaseOptions); /** * Return the brightness of the layer. @@ -1972,7 +2263,7 @@ declare module ol { * @constructor * @param options Layer options. */ - constructor(options?: GroupOptions); + constructor(options?: olx.layer.GroupOptions); /** * Returns the collection of layers in this group. @@ -1996,7 +2287,7 @@ declare module ol { * @constructor * @param options Options */ - constructor(options?: HeatmapOptions); + constructor(options?: olx.layer.HeatmapOptions); /** * Return the blur size in pixels. @@ -2044,7 +2335,7 @@ declare module ol { * @constructor * @param options Layer options */ - constructor(options?: ImageOptions); + constructor(options?: olx.layer.ImageOptions); /** * Return the associated source of the image layer. @@ -2062,7 +2353,7 @@ declare module ol { * @constructor * @param options Layer options */ - constructor(options?: LayerOptions); + constructor(options?: olx.layer.LayerOptions); /** * Get the layer source. @@ -2086,7 +2377,7 @@ declare module ol { * @constructor * @param options Tile layer options. */ - constructor(options?: TileOptions); + constructor(options?: olx.layer.TileOptions); /** * Return the level as number to which we will preload tiles up to. @@ -2128,7 +2419,7 @@ declare module ol { * @constructor * @param options Options */ - constructor(options?: VectorOptions); + constructor(options?: olx.layer.VectorOptions); /** * Return the associated vectorsource of the layer. @@ -2173,148 +2464,6 @@ declare module ol { // TODO: Replace 'any' with ol.style.StyleFunction setStyle(style: any): void; } - - interface BaseOptions { - - /** - * Brightness. Default is 0. - */ - brightness?: number; - - /** - * Contrast. Default is 1. - */ - contrast?: number; - - /** - * Hue. Default is 0. - */ - hue?: number; - - /** - * Opacity (0, 1). Default is 1. - */ - opacity?: number; - - /** - * Saturation. Default is 1. - */ - saturation?: number; - - /** - * Visibility. Default is true. - */ - visible?: boolean; - - /** - * The bounding extent for layer rendering. The layer will not be rendered outside of this extent. - */ - extent?: ol.Extent; - - /** - * The minimum resolution (inclusive) at which this layer will be visible. - */ - minResolution?: number; - - /** - * The maximum resolution (exclusive) below which this layer will be visible. - */ - maxResolution?: number; - } - - interface LayerOptions extends BaseOptions { - - /** - * The layer source (or null if not yet set). - */ - source?: ol.source.Source; - } - - interface GroupOptions extends BaseOptions { - - /** - * Child layers - */ - layers?: Array | ol.Collection; - } - - interface TileOptions extends LayerOptions { - - /** - * Preload. Load low-resolution tiles up to preload levels. By default preload is 0, which means no preloading. - */ - preload?: number; - - /** - * Source for this layer. - */ - source?: ol.source.Tile; - - /** - * Use interim tiles on error. Default is true. - */ - useInterimTilesOnError?: boolean; - } - - interface ImageOptions extends LayerOptions { - } - - interface VectorOptions extends LayerOptions { - - /** - * When set to true, feature batches will be recreated during animations. This means that no vectors will be shown clipped, but the setting will have a performance impact for large amounts of vector data. When set to false, batches will be recreated when no animation is active. Default is false. - */ - updateWhileAnimating?: boolean; - - /** - * When set to true, feature batches will be recreated during interactions. See also updateWhileInteracting. Default is false. - */ - updateWhileInteracting?: boolean; - - /** - * Render order. Function to be used when sorting features before rendering. By default features are drawn in the order that they are created. Use null to avoid the sort, but get an undefined draw order. - */ - // TODO: replace any with the expected function, unclear in documentation what the parameters are - renderOrder?: any; - - /** - * The buffer around the viewport extent used by the renderer when getting features from the vector source for the rendering or hit-detection. Recommended value: the size of the largest symbol, line width or label. Default is 100 pixels. - */ - renderBuffer?: number; - - /** - * Source. - */ - source?: ol.source.Vector; - - /** - * Layer style. See ol.style for default style which will be used if this is not defined. - */ - style?: ol.style.Style | Array | any; - } - - interface HeatmapOptions extends VectorOptions { - - /** - * The color gradient of the heatmap, specified as an array of CSS color strings. Default is ['#00f', '#0ff', '#0f0', '#ff0', '#f00']. - */ - gradient?: Array; - - /** - * Radius size in pixels. Default is 8. - */ - radius?: number; - - /** - * Blur size in pixels. Default is 15. - */ - blur?: number; - - /** - * Shadow size in pixels. Default is 250. - */ - shadow?: number; - } } module loadingstrategy { @@ -2558,7 +2707,7 @@ declare module ol { * @constructor * @param options Tile grid options */ - constructor(options?: TileGridOptions); + constructor(options: olx.tilegrid.TileGridOptions); /** * Creates a TileCoord transform function for use with this tile grid. Transforms the internal tile coordinates with bottom-left origin to the tile coordinates used by the ol.TileUrlFunction. The returned function expects an ol.TileCoord as first and an ol.proj.Projection as second argument and returns a transformed ol.TileCoord. @@ -2623,44 +2772,7 @@ declare module ol { */ getTileSize(z: number): number | ol.Size; } - interface TileGridOptions { - - /** - * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.Tile sources. When no origin or origins are configured, the origin will be set to the bottom-left corner of the extent. When no sizes are configured, they will be calculated from the extent. - */ - extent?: ol.Extent; - - /** - * Minimum zoom. Default is 0. - */ - minZoom?: number; - - /** - * Origin, i.e. the bottom-left corner of the grid. Default is null. - */ - origin?: ol.Coordinate; - - /** - * Origins, i.e. the bottom-left corners of the grid for each zoom level. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different origin. - */ - origins?: Array; - - /** - * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1. - */ - resolutions?: Array; - - /** - * Tile size. Default is [256, 256]. - */ - tileSize?: number | ol.Size; - - /** - * Tile sizes. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different tile size. - */ - tileSizes?: Array; - } - + /** * Set the grid pattern for sources accessing WMTS tiled-image servers. */ @@ -2670,7 +2782,7 @@ declare module ol { * @constructor * @param options WMTS options */ - constructor(options: WMTSOptions); + constructor(options: olx.tilegrid.WMTSOptions); /** * Create a tile grid from a WMTS capabilities matrix set. @@ -2686,54 +2798,7 @@ declare module ol { */ getMatrixIds(): Array; } - interface WMTSOptions { - - /** - * Extent for the tile grid. No tiles outside this extent will be requested by ol.source.WMTS sources. When no origin or origins are configured, the origin will be calculated from the extent. When no sizes are configured, they will be calculated from the extent. - */ - extent?: ol.Extent; - - /** - * Origin, i.e. the top-left corner of the grid. - */ - origin?: ol.Coordinate; - - /** - * Origins, i.e. the top-left corners of the grid for each zoom level. The length of this array needs to match the length of the resolutions array. - */ - origins?: Array; - - /** - * Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1 - */ - resolutions?: Array; - - /** - * matrix IDs. The length of this array needs to match the length of the resolutions array. - */ - matrixIds?: Array; - - /** - * Number of tile rows and columns of the grid for each zoom level. The values here are the TileMatrixWidth and TileMatrixHeight advertised in the GetCapabilities response of the WMTS, and define the grid's extent together with the origin. An extent can be configured in addition, and will further limit the extent for which tile requests are made by sources. - */ - sizes?: Array; - - /** - * Tile size. - */ - tileSize?: number | ol.Size; - - /** - * Tile sizes. The length of this array needs to match the length of the resolutions array. - */ - tileSizes?: Array; - - /** - * Number of tile columns that cover the grid's extent for each zoom level. Only required when used with a source that has wrapX set to true, and only when the grid's origin differs from the one of the projection's extent. The array length has to match the length of the resolutions array, i.e. each resolution will have a matching entry here. - */ - widths?: Array; - } - + /** * Set the grid pattern for sources accessing Zoomify tiled-image servers. */ @@ -2743,14 +2808,7 @@ declare module ol { * @constructor * @param options Options */ - constructor(options?: ZoomifyOptions); - } - interface ZoomifyOptions { - - /** - * Resolutions - */ - resolutions: Array; + constructor(options?: olx.tilegrid.ZoomifyOptions); } /** @@ -2758,29 +2816,7 @@ declare module ol { * @param options Tile grid options. * @returns The grid instance */ - function createXYZ(options: CreateXYZOptions): ol.tilegrid.TileGrid; - interface CreateXYZOptions { - - /** - * Extent for the tile grid. The origin for an XYZ tile grid is the top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the provided extent. If not provided, the extent of the EPSG:3857 projection is used. - */ - extent?: ol.Extent; - - /** - * Maximum zoom. The default is ol.DEFAULT_MAX_ZOOM. This determines the number of levels in the grid set. For example, a maxZoom of 21 means there are 22 levels in the grid set. - */ - maxZoom?: number; - - /** - * Minimum zoom. Default is 0. - */ - minZoom?: number; - - /** - * Tile size in pixels. Default is [256, 256]. - */ - tileSize?: number | ol.Size; - } + function createXYZ(options?: olx.tilegrid.XYZOptions): ol.tilegrid.TileGrid; } module webgl { From c70200ca8f04479d969903e9f37f37726f3fadda Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 24 Jun 2015 17:20:37 -0700 Subject: [PATCH 0263/2220] Update angular2 typings for alpha.28. --- angular2/angular2-2.0.0-alpha.26.d.ts | 4624 +++++++++++++++++ angular2/angular2-2.0.0-alpha.28.d.ts | 6162 ++++++++++++++++++++++ angular2/angular2.d.ts | 6833 +++++++++++++++---------- 3 files changed, 14971 insertions(+), 2648 deletions(-) create mode 100644 angular2/angular2-2.0.0-alpha.26.d.ts create mode 100644 angular2/angular2-2.0.0-alpha.28.d.ts diff --git a/angular2/angular2-2.0.0-alpha.26.d.ts b/angular2/angular2-2.0.0-alpha.26.d.ts new file mode 100644 index 0000000000..a527b13cab --- /dev/null +++ b/angular2/angular2-2.0.0-alpha.26.d.ts @@ -0,0 +1,4624 @@ +// Type definitions for Angular v2.0.0-alpha.26 +// Project: http://angular.io/ +// Definitions by: angular team +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// *********************************************************** +// This file is generated by the Angular build process. +// Please do not create manual edits or send pull requests +// modifying this file. +// *********************************************************** + +// Angular depends transitively on these libraries. +// If you don't have them installed you can run +// $ tsd query es6-promise rx rx-lite --action install --save +/// +/// + +interface List extends Array {} +interface Map {} +interface StringMap {} +interface Type {} + +declare module "angular2/angular2" { + type SetterFn = typeof Function; + type int = number; + + // See https://github.com/Microsoft/TypeScript/issues/1168 + class BaseException /* extends Error */ { + message: any; + stack: any; + toString(): string; + } +} + + +declare module "angular2/angular2" { + class AbstractChangeDetector extends ChangeDetector { + addChild(cd: ChangeDetector): any; + addShadowDomChild(cd: ChangeDetector): any; + callOnAllChangesDone(): any; + checkNoChanges(): any; + detectChanges(): any; + detectChangesInRecords(throwOnChange: boolean): any; + lightDomChildren: List; + markAsCheckOnce(): any; + markPathToRootAsCheckOnce(): any; + mode: string; + parent: ChangeDetector; + ref: ChangeDetectorRef; + remove(): any; + removeChild(cd: ChangeDetector): any; + removeShadowDomChild(cd: ChangeDetector): any; + shadowDomChildren: List; + } + + class ProtoRecord { + args: List; + bindingRecord: BindingRecord; + contextIndex: number; + directiveIndex: DirectiveIndex; + expressionAsString: string; + fixedArgs: List; + funcOrValue: any; + isLifeCycleRecord(): boolean; + isPipeRecord(): boolean; + isPureFunction(): boolean; + lastInBinding: boolean; + lastInDirective: boolean; + mode: number; + name: string; + selfIndex: number; + } + + class LifecycleEvent { + name: string; + } + + interface FormDirective { + addControl(dir: ControlDirective): void; + addControlGroup(dir: ControlGroupDirective): void; + getControl(dir: ControlDirective): Control; + removeControl(dir: ControlDirective): void; + removeControlGroup(dir: ControlGroupDirective): void; + updateModel(dir: ControlDirective, value: any): void; + } + + + /** + * A directive that contains a group of [ControlDirective]. + * + * @exportedAs angular2/forms + */ + class ControlContainerDirective { + formDirective: FormDirective; + name: string; + path: List; + } + + + /** + * A marker annotation that marks a class as available to `Injector` for creation. Used by tooling + * for generating constructor stubs. + * + * ``` + * class NeedsService { + * constructor(svc:UsefulService) {} + * } + * + * @Injectable + * class UsefulService {} + * ``` + * @exportedAs angular2/di_annotations + */ + class Injectable { + } + + + /** + * Injectable Objects that contains a live list of child directives in the light Dom of a directive. + * The directives are kept in depth-first pre-order traversal of the DOM. + * + * In the future this class will implement an Observable interface. + * For now it uses a plain list of observable callbacks. + * + * @exportedAs angular2/view + */ + class BaseQueryList { + add(obj: any): any; + fireCallbacks(): any; + onChange(callback: any): any; + removeCallback(callback: any): any; + reset(newList: any): any; + } + + class AppProtoView { + bindElement(parent: ElementBinder, distanceToParent: int, protoElementInjector: ProtoElementInjector, componentDirective?: DirectiveBinding): ElementBinder; + + /** + * Adds an event binding for the last created ElementBinder via bindElement. + * + * If the directive index is a positive integer, the event is evaluated in the context of + * the given directive. + * + * If the directive index is -1, the event is evaluated in the context of the enclosing view. + * + * @param {string} eventName + * @param {AST} expression + * @param {int} directiveIndex The directive index in the binder or -1 when the event is not bound + * to a directive + */ + bindEvent(eventBindings: List, boundElementIndex: number, directiveIndex?: int): void; + elementBinders: List; + protoChangeDetector: ProtoChangeDetector; + protoLocals: Map; + render: RenderProtoViewRef; + variableBindings: Map; + } + + + /** + * Const of making objects: http://jsperf.com/instantiate-size-of-object + */ + class AppView implements ChangeDispatcher, EventDispatcher { + callAction(elementIndex: number, actionExpression: string, action: Object): any; + changeDetector: ChangeDetector; + componentChildViews: List; + + /** + * The context against which data-binding expressions in this view are evaluated against. + * This is always a component instance. + */ + context: any; + dispatchEvent(elementIndex: number, eventName: string, locals: Map): boolean; + elementInjectors: List; + freeHostViews: List; + getDetectorFor(directive: DirectiveIndex): any; + getDirectiveFor(directive: DirectiveIndex): any; + hydrated(): boolean; + init(changeDetector: ChangeDetector, elementInjectors: List, rootElementInjectors: List, preBuiltObjects: List, componentChildViews: List): any; + + /** + * Variables, local to this view, that can be used in binding expressions (in addition to the + * context). This is used for thing like `