From 1b718961940d46754115ef6015607fe29a30b521 Mon Sep 17 00:00:00 2001 From: Justin Filip Date: Tue, 3 Mar 2015 16:35:24 -0500 Subject: [PATCH 001/338] 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 d74e954e6..326574ff4 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 002/338] 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 88905c88a..da416132c 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 f64c83483..c95b54a5b 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 326574ff4..a531a051e 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 003/338] 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 a531a051e..0f4ef3be1 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 004/338] 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 c95b54a5b..062fcc04b 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 0f4ef3be1..ad3696f01 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 005/338] 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 062fcc04b..9706fbf97 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 ad3696f01..c2dc4fc24 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 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 006/338] 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 41b352af3..fa335e934 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 58ec9069a..c02892ffe 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 3e467db265658e0dbc80de8c1be71e4531a52530 Mon Sep 17 00:00:00 2001 From: Chris Wrench Date: Wed, 27 May 2015 17:24:46 +0100 Subject: [PATCH 007/338] 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 fe4e7459c..f5d197773 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 eb5f7c2d2a1ee0de72fe9d8b40c9d33ec2612e63 Mon Sep 17 00:00:00 2001 From: Michael Nahkies Date: Wed, 10 Jun 2015 16:38:16 +1200 Subject: [PATCH 008/338] 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 61b688a03..7f365b4cc 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 be5e25f15..ab44901de 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 009/338] 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 61b688a03..602a2867e 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 be5e25f15..cd99d2a9a 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 ce644f3dd330e22fa0e5b7eb43a728618d3fd41b Mon Sep 17 00:00:00 2001 From: vilicvane Date: Thu, 11 Jun 2015 18:00:48 +0800 Subject: [PATCH 010/338] 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 b188c22ae..7e152894f 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 011/338] 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 0bd42b82f..c5c623c9b 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 012/338] 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 7e152894f..fdde44b54 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 b1192f0e1571397a03137b0df39652047d03c1db Mon Sep 17 00:00:00 2001 From: Kristof Mattei Date: Sat, 13 Jun 2015 16:21:22 +0200 Subject: [PATCH 013/338] 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 f0500a96f..940874d23 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 7da2851ffc22ac4b875d0d91584232e03a79c25b Mon Sep 17 00:00:00 2001 From: nfantone Date: Sun, 14 Jun 2015 17:38:54 -0300 Subject: [PATCH 014/338] 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 633c4ed0d..e0f2b8226 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 9cb55485d..a906b907f 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 f9c3edf6c6c32726e7e424fc3690da5ff1b0eef6 Mon Sep 17 00:00:00 2001 From: Haskell Camargo Date: Sun, 14 Jun 2015 23:21:47 -0300 Subject: [PATCH 015/338] 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 b6e50e225..8c37a1e71 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 848077c82..0de28f63a 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 016/338] 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 8c37a1e71..080f40afb 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 0de28f63a..f72db0180 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 017/338] 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 080f40afb..d3d5fcd4d 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 f72db0180..fde6ed157 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 018/338] 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 d3d5fcd4d..5bc034bc4 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 019/338] 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 5bc034bc4..c04fb2277 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 fde6ed157..26c1890d4 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 020/338] 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 c04fb2277..a92c3c424 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 26c1890d4..053ed53a4 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 021/338] 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 a92c3c424..e21893e52 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 022/338] 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 e21893e52..bea29403b 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 023/338] (;) 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 bea29403b..dc36e9913 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 024/338] 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 940874d23..ae027527a 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 6bae89e51d9b28d4792dc29da55b969c4ec4ad4f Mon Sep 17 00:00:00 2001 From: yiting Date: Mon, 15 Jun 2015 10:52:38 -0700 Subject: [PATCH 025/338] 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 bd831d5b0..f3eada39d 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 026/338] 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 dd5739500..ac3d4c8ff 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 1b37e4ae9b7f74fd81434cb62e4e86f697095c36 Mon Sep 17 00:00:00 2001 From: Brett Date: Mon, 15 Jun 2015 18:49:48 -0700 Subject: [PATCH 027/338] 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 13927cd93..31f50624c 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 581543508..6d064ef31 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 f00a559ddc36e8ec0b96063fbe7df9f532a21fc6 Mon Sep 17 00:00:00 2001 From: David Lipowicz Date: Wed, 17 Jun 2015 15:20:38 -0700 Subject: [PATCH 028/338] 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 ce389f2d7..75d7e389a 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 029/338] 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 62bee1980..985686ad4 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 030/338] 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 10c6ce029..f28a9395b 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 031/338] 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 000000000..e0eec9c53 --- /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 000000000..269cb6790 --- /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 b58db06e15c6e16bc029ce2ca750c2446726ea06 Mon Sep 17 00:00:00 2001 From: Maxime Fabre Date: Thu, 18 Jun 2015 17:14:16 +0200 Subject: [PATCH 032/338] 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 7f02a533e..4688a9c6f 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 539eb90acee5f0ed479d0a6feaae829e1a763ebb Mon Sep 17 00:00:00 2001 From: Mateusz Warkocki Date: Thu, 18 Jun 2015 18:47:03 +0200 Subject: [PATCH 033/338] fix argument typing for Mixin.create in ember.d.ts `Mixin.create` can take not one, but multiple arguments like e.g. `Component.extend` to extend other mixins. Ember code: https://github.com/emberjs/ember.js/blob/master/packages/ember-metal/lib/mixin.js#L589 This method in action: http://jsbin.com/kipenaxowe/edit?html,js,console --- ember/ember.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index cd1ef6079..691178d79 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -1418,9 +1418,9 @@ declare module Ember { apply(obj: any): any; /** Creates an instance of the class. - @param arguments A hash containing values with which to initialize the newly instantiated object. + @param args A hash containing values with which to initialize the newly instantiated object. **/ - static create(args: {}): T; + static create(...args: []): T; detect(obj: any): boolean; reopen(args?: {}): T; } From 4185303285505795fada9aa0c8292dfcbc929f59 Mon Sep 17 00:00:00 2001 From: Mateusz Warkocki Date: Thu, 18 Jun 2015 19:01:33 +0200 Subject: [PATCH 034/338] type of argument list elements for Mixin.create --- ember/ember.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 691178d79..94a3d1cbb 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -1418,9 +1418,9 @@ declare module Ember { apply(obj: any): any; /** Creates an instance of the class. - @param args A hash containing values with which to initialize the newly instantiated object. + @param arguments A hash containing values with which to initialize the newly instantiated object. **/ - static create(...args: []): T; + static create(...arguments: []): T; detect(obj: any): boolean; reopen(args?: {}): T; } From f7ac2d7969f437f1fb1d9285afd193617ebae07d Mon Sep 17 00:00:00 2001 From: Mateusz Warkocki Date: Thu, 18 Jun 2015 19:03:38 +0200 Subject: [PATCH 035/338] type of argument list elements for Mixin.create --- ember/ember.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ember/ember.d.ts b/ember/ember.d.ts index 94a3d1cbb..a1b829ddf 100644 --- a/ember/ember.d.ts +++ b/ember/ember.d.ts @@ -1420,7 +1420,7 @@ declare module Ember { Creates an instance of the class. @param arguments A hash containing values with which to initialize the newly instantiated object. **/ - static create(...arguments: []): T; + static create(...arguments: CoreObjectArguments[]): T; detect(obj: any): boolean; reopen(args?: {}): T; } From 469065e77d52587f92558a3a5ae15d7e1e00c984 Mon Sep 17 00:00:00 2001 From: Ole Rehmsen Date: Thu, 18 Jun 2015 19:19:53 +0200 Subject: [PATCH 036/338] Import type definitions for express.static from serve-static instead of only supporting the call signature. Express exposes serve-static as express.static: https://github.com/strongloop/express/blob/master/lib/express.js#L60 Prior to this change, the type definitions would only consist of the call signature of serve-static, but serve static also has member variables. By importing the entire type definition from serve-static and using it for express.static, both the call signature and the members can be used. --- express/express-tests.ts | 3 +++ express/express.d.ts | 28 +++------------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/express/express-tests.ts b/express/express-tests.ts index 76fa4da0d..22ae73e72 100644 --- a/express/express-tests.ts +++ b/express/express-tests.ts @@ -6,6 +6,9 @@ var app = express(); app.engine('jade', require('jade').__express); app.engine('html', require('ejs').renderFile); +express.static.mime.define({ + 'application/fx': ['fx'] +}); app.use('/static', express.static(__dirname + '/public')); // simple logger diff --git a/express/express.d.ts b/express/express.d.ts index 0bd42b82f..f6e692861 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -11,6 +11,7 @@ =============================================== */ /// +/// declare module Express { @@ -24,6 +25,7 @@ declare module Express { declare module "express" { import http = require('http'); + import serveStatic = require('serve-static'); function e(): e.Express; @@ -1067,31 +1069,7 @@ declare module "express" { response: Response; } - /** - * Static: - * - * Static file server with the given `root` path. - * - * Examples: - * - * var oneDay = 86400000; - * - * connect() - * .use(connect.static(__dirname + '/public')) - * - * connect() - * .use(connect.static(__dirname + '/public', { maxAge: oneDay })) - * - * Options: - * - * - `maxAge` Browser cache maxAge in milliseconds. defaults to 0 - * - `hidden` Allow transfer of hidden files. defaults to false - * - `redirect` Redirect to trailing "/" when the pathname is a dir. defaults to true - * - * @param root - * @param options - */ - function static(root: string, options?: any): RequestHandler; + var static: typeof serveStatic; } export = e; From 6594eb994543acd6068f6bf518cb61523594e349 Mon Sep 17 00:00:00 2001 From: ValentinTrinque Date: Fri, 19 Jun 2015 15:09:51 +0200 Subject: [PATCH 037/338] add tsmonad --- tsmonad/tsmonad.d.ts | 641 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 641 insertions(+) create mode 100644 tsmonad/tsmonad.d.ts diff --git a/tsmonad/tsmonad.d.ts b/tsmonad/tsmonad.d.ts new file mode 100644 index 000000000..a717dbc3e --- /dev/null +++ b/tsmonad/tsmonad.d.ts @@ -0,0 +1,641 @@ +// Type definitions for TsMonad +// Project: https://github.com/cbowdon/TsMonad +// Definitions by: Chris Bowdon +// Definitions by: Valentin Trinque +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module TsMonad { + /** + * @name EitherType + * @description Enumerate the different types contained by an Either object. + */ + enum EitherType { + Left = 0, + Right = 1, + } + /** + * @name EitherPatterns + * @description Define a contract to unwrap Either object using callbacks + * for Left and Right. + * @see Either# + */ + interface EitherPatterns { + /** + * @name left + * @description Function to handle the Left. + * @type {(l: L) => T} + */ + left: (l: L) => T; + /** + * @name right + * @description Function to handle the Right. + * @type {(r: R) => T} + */ + right: (r: R) => T; + } + /** + * @name either + * @description Build an Either object. + * @function + * @param l The object as a Left (optional). + * @param r The object as a Right (optional). + * @returns {Either} Either object containing the input. + * @throws {TypeError} If there are both or none of left and right + * parameter. + * @see Either# + */ + function either(l?: L, r?: R): Either; + /** + * @name Either + * @class Either has exactly two sub types, Left (L) and Right (R). If an + * Either object contains an instance of L, then the Either is a + * Left. Otherwise it contains an instance of R and is a Right. By + * convention, the Left constructor is used to hold an error value and + * the Right constructor is used to hold a correct value. + */ + class Either implements Monad, Functor, Eq> { + private type; + private l; + private r; + /** + * @description Build an Either object. For internal use only. + * @constructor + * @methodOf Either# + * @param {EitherType} type Indicates if the Either content is a Left or a Right. + * @param {L} l The Left value (optional). + * @param {R} l The Right value (optional). + */ + constructor(type: EitherType, l?: L, r?: R); + /** + * @name left + * @description Helper function to build an Either with a Left. + * @methodOf Either# + * @static + * @param {L} l The Left value. + * @returns {Either} Either object containing a Left. + */ + static left(l: L): Either; + /** + * @name right + * @description Helper function to build an Either with a Right. + * @methodOf Either# + * @static + * @param {R} r The Right value. + * @returns {Either} Either object containing a Right. + */ + static right(r: R): Either; + /** + * @name unit + * @description Wrap a value inside an Either Right object. + * @methodOf Either# + * @public + * @param {T} t + * @returns {Either} Either object containing a Right. + * @see Monad#unit + */ + public unit(t: T): Either; + /** + * @name bind + * @description Apply the function passed as parameter on the object. + * @methodOf Either# + * @public + * @param {(r: R) => Either} f Function applied on the Right. + * @returns {Either} The result of the function f wrapped inside + * an Either object. + * @see Monad#bind + */ + public bind(f: (r: R) => Either): Either; + /** + * @name of + * @description Alias for unit. + * @methodOf Either# + * @public + * @see Either#unit + * @see Monad#of + */ + public of: (t: T) => Either; + /** + * @name chain + * @description Alias for bind. + * @methodOf Either# + * @public + * @see Either#bind + * @see Monad#chain + */ + public chain: (f: (r: R) => Either) => Either; + /** + * @name fmap + * @description Apply the function passed as parameter on the object. + * @methodOf Either# + * @public + * @param {(r: R) => T} f Function applied on the Right. + * @returns {Either} The result of the function f wrapped inside + * an Either object. + * @see Functor#fmap + */ + public fmap(f: (r: R) => T): Either; + /** + * @name lift + * @description Alias for fmap. + * @methodOf Either# + * @public + * @see Either#fmap + * @see Functor#lift + */ + public lift: (f: (r: R) => T) => Either; + /** + * @name map + * @description Alias for fmap. + * @methodOf Either# + * @public + * @see Either#fmap + * @see Functor#map + */ + public map: (f: (r: R) => T) => Either; + /** + * @name caseOf + * @description Execute a function depending on the Either content. + * It allows to unwrap the object for Left or Right types. + * @methodOf Either# + * @public + * @param {EitherPatterns} pattern Object containing the + * functions to applied on each Either types. + * @return {T} The returned value of the functions specified in the + * EitherPatterns interface. + * @see EitherPatterns# + */ + public caseOf(pattern: EitherPatterns): T; + /** + * @name equals + * @description Compare the type and the content of two Either + * objects. + * @methodOf Either# + * @public + * @param {Either} other The Either to compare with. + * @return {boolean} True if the type and content value are equals, + * false otherwise. + * @see Eq#equals + */ + public equals(other: Either): any; + } +} +declare module TsMonad { + /** + * @name eq + * @description Compare two objects : + * 1. if objects implement Eq, defer to their .equals + * 2. if are arrays, iterate and recur + * @function + * @param {any} a Any object. + * @param {any} b Any object. + * @returns {boolean} In case 1, the `.equals()` function returned value. + * In case 2, true if each elements are equals, false otherwise. + */ + function eq(a: any, b: any): any; + /** + * @name Eq + * @description Define a contract to compare (in)equalities between + * objects. + */ + interface Eq { + /** + * @name equals + * @description Determine if two objects are equals. + * @methodOf Eq + * @public + * @param {T} The object to compare with. + * @returns {boolean} True if the objects are equals, false otherwise. + */ + equals(t: T): boolean; + } + interface Monad { + /** + * @name unit + * @description Wrap an object inside a monad. + * @methodOf Monad# + * @public + * @param {U} t The object to wrap. + * @returns {Monad} A Monad with the value wrapped inside. + */ + unit(t: U): Monad; + /** + * @name bind + * @description Apply the function passed as parameter on the object. + * @methodOf Monad# + * @public + * @param {(t: T) => Monad} f Function applied on the Monad content. + * @returns {Monad} The result of the function f wrapped inside + * a Monad object. + */ + bind(f: (t: T) => Monad): Monad; + /** + * @name of + * @description Alias for unit. Fantasy Land Monad conformance. + * @methodOf Monad# + * @public + * @see Monad#unit + */ + of(t: U): Monad; + /** + * @name chain + * @description Alias for bind. Fantasy Land Monad conformance. + * @methodOf Monad# + * @public + * @see Monad#bind + */ + chain(f: (t: T) => Monad): Monad; + } + /** + * @name Functor + * @description Define a contract to add basic functor functions to an + * object. + */ + interface Functor { + /** + * @name fmap + * @description Apply the function passed as parameter on the object. + * @methodOf Functor# + * @public + * @param {(t: T) => U} f Function applied on the functor content. + * @returns {Functor} The result of the function f wrapped inside + * an Functor object. + * @see Functor#fmap + */ + fmap(f: (t: T) => U): Functor; + /** + * @name lift + * @description Alias for fmap. + * @methodOf Functor# + * @public + * @see Functor#fmap + */ + lift(f: (t: T) => U): Functor; + /** + * @name map + * @description Alias for fmap. Fantasy Land Monad conformance. + * @methodOf Functor# + * @public + * @see Functor#fmap + */ + map(f: (t: T) => U): Functor; + } +} +declare module TsMonad { + /** + * @name MaybeType + * @description Enumerate the different types contained by an Maybe object. + * @see Maybe# + */ + enum MaybeType { + Nothing = 0, + Just = 1, + } + /** + * @name MaybePatterns + * @description Define a contract to unwrap Maybe object using callbacks + * for Just and Nothing. + * @see Maybe# + */ + interface MaybePatterns { + /** + * @name just + * @description Function to handle the Just. + * @type {(t: T) => U} + */ + just: (t: T) => U; + /** + * @name nothing + * @description Function to handle the Nothing. + * @type {() => U} + */ + nothing: () => U; + } + /** + * @name maybe + * @description Build a Maybe object. + * @function + * @param {T} t The object to wrap. + * @returns {Maybe} A Maybe object containing the input. If t is null + * or undefined, the Maybe object is filled with Nothing. + * @see Maybe# + */ + function maybe(t: T): Maybe; + /** + * @name Maybe + * @class Encapsulates an optional value. A value of type Maybe a either + * contains a value of type a (represented as Just a), or it is empty + * (represented as Nothing). + */ + class Maybe implements Monad, Functor, Eq> { + private type; + private value; + /** + * @description Build a Maybe object. For internal use only. + * @constructor + * @methodOf Maybe# + * @param {MaybeType} type Indicates if the Maybe content is a Just or a Nothing. + * @param {T} value The value to wrap (optional). + */ + constructor(type: MaybeType, value?: T); + /** + * @name maybe + * @description Helper function to build a Maybe object. + * @methodOf Maybe# + * @static + * @param {T} t The value to wrap. + * @returns {Maybe} A Maybe object containing the value passed in input. If t is null + * or undefined, the Maybe object is filled with Nothing. + */ + static maybe(t: T): Maybe; + /** + * @name just + * @description Helper function to build a Maybe object filled with a + * Just type. + * @methodOf Maybe# + * @static + * @param {T} t The value to wrap. + * @returns {Maybe} A Maybe object containing the value passed in input. + * @throws {TypeError} If t is null or undefined. + */ + static just(t: T): Maybe; + /** + * @name nothing + * @description Helper function to build a Maybe object filled with a + * Nothing type. + * @methodOf Maybe# + * @static + * @returns {Maybe} A Maybe with a Nothing type. + */ + static nothing(): Maybe; + /** + * @name unit + * @description Wrap an object inside a Maybe. + * @public + * @methodOf Maybe# + * @param {U} u The object to wrap. + * @returns {Monad} A Monad with the value wrapped inside. + * @see Monad#unit + */ + public unit(u: U): Maybe; + /** + * @name bind + * @description Apply the function passed as parameter on the object. + * @methodOf Maybe# + * @public + * @param {(t: T) => Maybe} f Function applied on the Maybe content. + * @returns {Maybe} The result of the function f wrapped inside + * a Maybe object. + * @see Monad#bind + */ + public bind(f: (t: T) => Maybe): Maybe; + /** + * @name of + * @description Alias for unit. + * @methodOf Maybe# + * @public + * @see Maybe#unit + * @see Monad#of + */ + public of: (u: U) => Maybe; + /** + * @name chain + * @description Alias for bind. + * @methodOf Maybe# + * @public + * @see Maybe#unit + * @see Monad#of + */ + public chain: (f: (t: T) => Maybe) => Maybe; + /** + * @name fmap + * @description Apply the function passed as parameter on the object. + * @methodOf Maybe# + * @public + * @param {(t: T) => U} f Function applied on the Maybe content. + * @returns {Maybe} The result of the function f wrapped inside + * an Maybe object. + * @see Functor#fmap + */ + public fmap(f: (t: T) => U): Maybe; + /** + * @name lift + * @description Alias for fmap. + * @methodOf Maybe# + * @public + * @see Maybe#fmap + * @see Monad#of + */ + public lift: (f: (t: T) => U) => Maybe; + /** + * @name map + * @description Alias for fmap. + * @methodOf Maybe# + * @public + * @see Maybe#fmap + * @see Monad#of + */ + public map: (f: (t: T) => U) => Maybe; + /** + * @name caseOf + * @description Execute a function depending on the Maybe content. It + * allows to unwrap the object for Just or Nothing types. + * @methodOf Maybe# + * @public + * @param {MaybePatterns} pattern Object containing the + * functions to applied on each Maybe types. + * @return {U} The returned value of the functions specified in the + * MaybePatterns interface. + * @see MaybePatterns# + */ + public caseOf(patterns: MaybePatterns): U; + /** + * @name equals + * @description Compare the type and the content of two Maybe + * objects. + * @methodOf Maybe# + * @public + * @param {Maybe} other The Maybe to compare with. + * @return {boolean} True if the type and content value are equals, + * false otherwise. + * @see Eq#equals + */ + public equals(other: Maybe): any; + } +} +declare module TsMonad { + /** + * @name WriterPatterns + * @description Define a contract to unwrap Writer object using a + * callback. + * @see Writer# + */ + interface WriterPatterns { + /** + * @name writer + * @description Function to handle the Writer content. + * @type {(story: S[], value: T) => U} + */ + writer: (story: S[], value: T) => U; + } + /** + * @name writer + * @description Build a Writer object. + * @function + * @param {S[]} story The collection to store logs. + * @param {T} value The object to wrap. + * @returns {Writer} A Writer object containing the log collection + * and the wrapped value. + * @see Writer# + */ + function writer(story: S[], value: T): Writer; + /** + * @name Writer + * @class Allow to do computations while making sure that all the log + * values are combined into one log value that then gets attached to + * the result. + */ + class Writer implements Monad, Eq> { + private story; + private value; + /** + * @description Build a Writer object. For internal use only. + * @constructor + * @methodOf Writer# + * @param {S[]} story The collection of logs. + * @param {T} value The object to wrap. + */ + constructor(story: S[], value: T); + /** + * @name writer + * @description Helper function to build a Writer object. + * @methodOf Writer# + * @static + * @param {S[]} story The collection of logs. + * @param {T} value The object to wrap. + * @returns {Writer} A Writer object containing the collection of logs + * and the wrapped value. + */ + static writer(story: S[], value: T): Writer; + /** + * @name writer + * @description Helper function to build a Writer object with the log + * passed in input only. + * @methodOf Writer# + * @static + * @param {S} s A log to store. + * @returns {Writer} A Writer object containing the collection of logs + * and a zeroed value. + */ + static tell(s: S): Writer; + /** + * @name unit + * @description Wrap an object inside a Writer. + * @public + * @methodOf Writer# + * @param {U} u The object to wrap. + * @returns {Monad} A Writer with the value wrapped inside and an + * empty collection of logs. + * @see Monad#unit + */ + public unit(u: U): Writer; + /** + * @name bind + * @description Apply the function passed as parameter on the object. + * @methodOf Writer# + * @public + * @param {(t: T) => Writer} f Function applied on the Writer content. + * @returns {Writer} The result of the function f append to the + * Writer object. + * @see Monad#bind + */ + public bind(f: (t: T) => Writer): Writer; + /** + * @name of + * @description Alias for unit. + * @methodOf Writer# + * @public + * @see Writer#unit + * @see Monad#of + */ + public of: (u: U) => Writer; + /** + * @name chain + * @description Alias for bind + * @methodOf Writer# + * @public + * @see Writer#unit + * @see Monad#of + */ + public chain: (f: (t: T) => Writer) => Writer; + /** + * @name fmap + * @description Apply the function passed as parameter on the object. + * @methodOf Writer# + * @public + * @param {(t: T) => U} f Function applied on the wrapped value. + * @returns {Writer} The result of the function f wrapped inside + * an Writer object. It has an empty collection of logs. + * @see Functor#fmap + */ + public fmap(f: (t: T) => U): Writer; + /** + * @name lift + * @description Alias for fmap + * @methodOf Writer# + * @public + * @see Writer#fmap + * @see Monad#of + */ + public lift: (f: (t: T) => U) => Writer; + /** + * @name map + * @description Alias for fmap + * @methodOf Writer# + * @public + * @see Writer#fmap + * @see Monad#of + */ + public map: (f: (t: T) => U) => Writer; + /** + * @name caseOf + * @description Execute a function on the Writer content. It allows to + * unwrap the object. + * @methodOf Writer# + * @public + * @param {WriterPatterns} pattern Object containing the + * functions to applied on the Writer content. + * @return {U} The returned value of the function specified in the + * WriterPatterns interface. + * @see WriterPatterns# + */ + public caseOf(patterns: WriterPatterns): U; + /** + * @name equals + * @description Compare the type and the content of two Writer + * objects. + * @methodOf Writer# + * @public + * @param {Writer} other The Writer to compare with. + * @return {boolean} True if the collection of logs and content value + * are equals, false otherwise. + * @see Eq#equals + */ + public equals(other: Writer): boolean; + } +} +declare var module: { + exports: any; + require(id: string): any; + id: string; + filename: string; + loaded: boolean; + parent: any; + children: any[]; +}; +/** +* @name tsmonad +* @namespace Hold functionalities related to TsMonad library. +*/ +declare module 'tsmonad' { + export = TsMonad; +} From a24112740904688bc2635ded719dad0178995218 Mon Sep 17 00:00:00 2001 From: Craig Brett Date: Fri, 19 Jun 2015 15:43:08 +0100 Subject: [PATCH 038/338] Added d.ts files for Backbone-Associations --- .../backbone-associations-tests.ts | 79 +++++++++++++++++++ .../backbone-associations-tests.ts.tscparams | 1 + .../backbone-associations.d.ts | 75 ++++++++++++++++++ .../backbone-associations.d.ts.tscparams | 1 + 4 files changed, 156 insertions(+) create mode 100644 Backbone-Associations/backbone-associations-tests.ts create mode 100644 Backbone-Associations/backbone-associations-tests.ts.tscparams create mode 100644 Backbone-Associations/backbone-associations.d.ts create mode 100644 Backbone-Associations/backbone-associations.d.ts.tscparams diff --git a/Backbone-Associations/backbone-associations-tests.ts b/Backbone-Associations/backbone-associations-tests.ts new file mode 100644 index 000000000..d25ddf17e --- /dev/null +++ b/Backbone-Associations/backbone-associations-tests.ts @@ -0,0 +1,79 @@ +/// +/// + +// borrowed from the Backbone.Associations tutorials +// separated out into modules to avoid namespace clashes +module Backbone.Associations.Tests { + module OneToOne { + class EmployeeWithManager extends Backbone.AssociatedModel { + constructor(options?) { + this.relations = [ + { + type: Backbone.One, //nature of the relationship + key: 'manager', // attribute of Employee + relatedModel: 'Employee' //AssociatedModel for attribute key + } + ]; + super(options); + } + + defaults() { + return { + age: 0, + fname: "", + lname: "", + manager: null + }; + } + } + } + + module OneToMany { + class Location extends Backbone.AssociatedModel { + defaults() { + return { + add1: "", + add2: null, + zip: "", + state: "" + }; + } + } + + class Locations extends Backbone.Collection { + comparator(c: Backbone.Model) { + return c.get("Number"); + } + } + + class Project extends Backbone.AssociatedModel { + constructor(options?) { + this.relations = [ + { + type: Backbone.Many, //nature of the relation + key: 'locations', //attribute of Project + collectionType: Locations, //Collection to be used. + relatedModel: Location //Optional + } + ]; + super(options); + } + + defaults() { + return { + name: "", + number: 0, + locations: [] + } + } + } + + function reverseAssociationTest() { + var local = new Location({ state: "Hertfordshire" }); + var project = new Project({ name: "The Old Pond Project" }); + local.set("oddRelationTo", project); + var parents = project.parents; + } + } + +} \ No newline at end of file diff --git a/Backbone-Associations/backbone-associations-tests.ts.tscparams b/Backbone-Associations/backbone-associations-tests.ts.tscparams new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/Backbone-Associations/backbone-associations-tests.ts.tscparams @@ -0,0 +1 @@ + diff --git a/Backbone-Associations/backbone-associations.d.ts b/Backbone-Associations/backbone-associations.d.ts new file mode 100644 index 000000000..2a9ecf779 --- /dev/null +++ b/Backbone-Associations/backbone-associations.d.ts @@ -0,0 +1,75 @@ +// Type definitions for Backbone-associations 0.6.4 +// Project: https://github.com/dhruvaray/backbone-associations/ +// Definitions by: Craig Brett +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module Backbone { + export module Associations { + /** Defines a 1:Many relationship type */ + export var Many: string; + /** Defines a 1:1 relationship type */ + export var One: string; + /** Defines a special relationship to itself */ + export var Self: string; + + // these seem to be used internally, but can't see a reason not to include them just in case + export var SEPARATOR: string; + export function getSeparator(): any; + export function setSeparator(value: any): void; + export var EVENTS_BUBBLE: boolean; + export var EVENTS_WILDCARD: boolean; + export var EVENTS_NC: boolean; + + interface IRelation { + /** The type of model for this relationship */ + relatedModel: string|typeof Backbone.Associations.AssociatedModel; + /** The key for this relationship on this model */ + key: string; + // meh, no string enums in TS. Just have to trust the user not to be a fool + /** The cardinality of this relationship. */ + type: string; + /** Determines the type of collection used. If used, the relatedModel property is ignored */ + collectionType?: typeof Backbone.Collection|string; + /** If set to true, then the attribute will not be serialized in toJSON() calls. Defaults to false */ + isTransient?: boolean; + /** Specify remoteKey to serialize the key to a different key name in toJSON() calls. Useful in ROR nested-attributes like scenarios. */ + remoteKey?: string; + /** the attributes to serialize when calling toJSON */ + serialize?: string[]; + /** A transformation function to convert the value before it is assigned to the key on the relatedModel */ + map?: (...args: any[]) => any; + } + + /** A Backbone model with special provision for handling relations to other models */ + export class AssociatedModel extends Backbone.Model { + /** Relations with their associated model */ + relations: IRelation[]; + _proxyCalls: any; + /** Reverse association lookup for objects that contain this object */ + parents: any[]; + /** Cleans up any parent relations on other AssociatedModels */ + cleanup(): void; + } + } + // copies of properties also put onto the Backbone scope + /** Defines a 1:Many relationship type */ + export var Many: string; + /** Defines a 1:1 relationship type */ + export var One: string; + /** Defines a special relationship to itself */ + export var Self: string; + + // I'm sure this should be doable with imports or type aliases, but doesn't seem to work + /** A Backbone model with special provision for handling relations to other models */ + export class AssociatedModel extends Backbone.Model { + /** Relations with their associated model */ + relations: Associations.IRelation[]; + _proxyCalls: any; + /** Reverse association lookup for objects that contain this object */ + parents: any[]; + /** Cleans up any parent relations on other AssociatedModels */ + cleanup(): void; + } +} \ No newline at end of file diff --git a/Backbone-Associations/backbone-associations.d.ts.tscparams b/Backbone-Associations/backbone-associations.d.ts.tscparams new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/Backbone-Associations/backbone-associations.d.ts.tscparams @@ -0,0 +1 @@ + From b43985c211aec309b7cbb34959838e668734c5a5 Mon Sep 17 00:00:00 2001 From: ValentinTrinque Date: Fri, 19 Jun 2015 18:37:18 +0200 Subject: [PATCH 039/338] add tsmonad --- tsmonad/tests/either-tests.ts | 45 +++++++++++++++++++++++++++++++++++ tsmonad/tests/maybe-tests.ts | 20 ++++++++++++++++ tsmonad/tests/writer-tests.ts | 8 +++++++ tsmonad/tsmonad-tests.ts | 3 +++ tsmonad/tsmonad.d.ts | 1 - 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 tsmonad/tests/either-tests.ts create mode 100644 tsmonad/tests/maybe-tests.ts create mode 100644 tsmonad/tests/writer-tests.ts create mode 100644 tsmonad/tsmonad-tests.ts diff --git a/tsmonad/tests/either-tests.ts b/tsmonad/tests/either-tests.ts new file mode 100644 index 000000000..1530562be --- /dev/null +++ b/tsmonad/tests/either-tests.ts @@ -0,0 +1,45 @@ +/// + +class User { + + private age: number; + + constructor(age?: number) { + this.age = age ? age : 0; + } + + public getAge(): TsMonad.Either { + if (this.age > 0) { + return TsMonad.Either.right(this.age); + } else { + return TsMonad.Either.left('Information withheld'); + } + } +} + +module Station { + + export class BusPass { + + public isValidForRoute(route: string): boolean { + return true; + } + } + + export function getBusPass(age: number): TsMonad.Either { + if (age > 18) { + return TsMonad.Either.right(new BusPass()); + } else { + return TsMonad.Either.left('Too young for a bus pass'); + } + } +} + +var user = new User(42) + +var canRideForFree = user.getAge() + .bind(age => Station.getBusPass(age)) + .caseOf({ + right: busPass => busPass.isValidForRoute('Weston'), + left: errorMessage => { console.log(errorMessage); return false; } + }); diff --git a/tsmonad/tests/maybe-tests.ts b/tsmonad/tests/maybe-tests.ts new file mode 100644 index 000000000..76f0a7256 --- /dev/null +++ b/tsmonad/tests/maybe-tests.ts @@ -0,0 +1,20 @@ +/// + +var turns_out_to_be_100 = TsMonad.Maybe.just(10) + .caseOf({ + just: n => n * n, + nothing: () => -1 + }); + +var turns_out_to_be_nothing = TsMonad.Maybe.nothing() + .caseOf({ + just: n => n * n, + nothing: () => -1 + }); + +var turns_out_to_be_true = TsMonad.Maybe.just(123) + .lift(n => n * 2) + .caseOf({ + just: n => n === 246, + nothing: () => false + }); \ No newline at end of file diff --git a/tsmonad/tests/writer-tests.ts b/tsmonad/tests/writer-tests.ts new file mode 100644 index 000000000..fd8200aeb --- /dev/null +++ b/tsmonad/tests/writer-tests.ts @@ -0,0 +1,8 @@ +/// + +var is_true = TsMonad.Writer.writer(['Started with 0'], 0) + .bind(x => TsMonad.Writer.writer(['+ 8'], x + 8)) + .bind(x => TsMonad.Writer.writer(['- 6', '* 8'], 8 * (x - 6))) + .caseOf({ + writer: (s, v) => v === 16 && s.join(', ') === 'Started with 0, + 8, - 6, * 8' + }); \ No newline at end of file diff --git a/tsmonad/tsmonad-tests.ts b/tsmonad/tsmonad-tests.ts new file mode 100644 index 000000000..8959950d9 --- /dev/null +++ b/tsmonad/tsmonad-tests.ts @@ -0,0 +1,3 @@ +/// +/// +/// diff --git a/tsmonad/tsmonad.d.ts b/tsmonad/tsmonad.d.ts index a717dbc3e..081c446c3 100644 --- a/tsmonad/tsmonad.d.ts +++ b/tsmonad/tsmonad.d.ts @@ -1,7 +1,6 @@ // Type definitions for TsMonad // Project: https://github.com/cbowdon/TsMonad // Definitions by: Chris Bowdon -// Definitions by: Valentin Trinque // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module TsMonad { From 70a17401f6388a2121a9ccaa195dbef586f071b0 Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Fri, 19 Jun 2015 12:27:58 -0500 Subject: [PATCH 040/338] Reflect actual Argv#check() usage in check() type declaration --- yargs/yargs.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yargs/yargs.d.ts b/yargs/yargs.d.ts index 6a6adebe8..0e42090fc 100644 --- a/yargs/yargs.d.ts +++ b/yargs/yargs.d.ts @@ -57,8 +57,7 @@ declare module "yargs" { example(command: string, description: string): Argv; - check(func: (argv: { [key: string]: any }, aliases: { [alias: string]: string }) => boolean): Argv; - check(func: (argv: { [key: string]: any }, aliases: { [alias: string]: string }) => string): Argv; + check(func: (argv: any, aliases: { [alias: string]: string }) => any): Argv; boolean(key: string): Argv; boolean(keys: string[]): Argv; From 60ce6cc53bbc1a41c1a5c952c640439306b73905 Mon Sep 17 00:00:00 2001 From: Matt Traynham Date: Fri, 19 Jun 2015 16:08:14 -0400 Subject: [PATCH 041/338] Fixes LineChart subclass --- 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 9a7cda23a..850d1abec 100644 --- a/dcjs/dc.d.ts +++ b/dcjs/dc.d.ts @@ -263,7 +263,7 @@ declare module DC { radius: number; } - export interface LineChart extends StackMixin, CoordinateGridMixin { + export interface LineChart extends StackMixin, CoordinateGridMixin { interpolate: IGetSet; tension: IGetSet; defined: IGetSet, LineChart>; From e70762aec49996264caaba4091ca3cde29a8e5d5 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 20 Jun 2015 12:00:28 -0700 Subject: [PATCH 042/338] fix sqlparameter value type and tests --- documentdb/documentdb-tests.ts | 4 ++-- documentdb/documentdb.d.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentdb/documentdb-tests.ts b/documentdb/documentdb-tests.ts index 31f50624c..4e6f10e66 100644 --- a/documentdb/documentdb-tests.ts +++ b/documentdb/documentdb-tests.ts @@ -13,7 +13,7 @@ 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'}]} +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) { @@ -75,7 +75,7 @@ docDBClient.createTrigger('collection', trigger, undefined, (error, result) => { } }); -var triggerQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM trigger t WHERE t.id = @id', parameters: [{name: 'id', value: 'trigger-foo'}]} +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) { diff --git a/documentdb/documentdb.d.ts b/documentdb/documentdb.d.ts index 6d064ef31..e7ffd1f5a 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 , Brett Gutstein +// Definitions by: Noel Abrahams // Definitions: https://github.com/borisyankov/DefinitelyTyped/documentdb declare module 'documentdb' { @@ -59,7 +59,7 @@ declare module 'documentdb' { name: string; /** The value of the parameter. */ - value: string; + value: any; } /** The Sql query specification. */ @@ -412,4 +412,4 @@ declare module 'documentdb' { */ public replaceStoredProcedure(procedureLink: string, procedure: Procedure, options: RequestOptions, callback: RequestCallback): void; } -} +} \ No newline at end of file From 043c3d11baa7db8de8454b6b31842be0f4b50966 Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 20 Jun 2015 12:12:26 -0700 Subject: [PATCH 043/338] add test for sqlparameter values and some semicolons to test file --- documentdb/documentdb-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentdb/documentdb-tests.ts b/documentdb/documentdb-tests.ts index 4e6f10e66..f88570a88 100644 --- a/documentdb/documentdb-tests.ts +++ b/documentdb/documentdb-tests.ts @@ -13,7 +13,7 @@ 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'}]} +var dbQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM d WHERE d.meta = @meta', parameters: [{name: '@meta', value: {creator: 'John Smith', type: 'documentdb'}}]}; docDBClient.queryDatabases(dbQuerySpec).toArray((error, result) => { if (error) { @@ -27,7 +27,7 @@ docDBClient.queryDatabases(dbQuerySpec).toArray((error, result) => { console.log('Found database: ' + result[0].id); } } -}) +}); docDBClient.createCollection('database', { id: 'foo' }, undefined, (error, result) => { @@ -63,7 +63,7 @@ var trigger: docDB.Trigger = { }, triggerType: 'pre', triggerOperation: 'all' -} +}; docDBClient.createTrigger('collection', trigger, undefined, (error, result) => { @@ -75,7 +75,7 @@ docDBClient.createTrigger('collection', trigger, undefined, (error, result) => { } }); -var triggerQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM trigger t WHERE t.id = @id', parameters: [{name: '@id', value: 'trigger-foo'}]} +var triggerQuerySpec: docDB.SqlQuerySpec = {query: 'SELECT * FROM t WHERE t.id = @id', parameters: [{name: '@id', value: 'trigger-foo'}]}; docDBClient.queryTriggers('collection', triggerQuerySpec).toArray((error, result) => { if (error) { From e3462a9f4911091c5188b600136dfa2bcc41a3dd Mon Sep 17 00:00:00 2001 From: Brett Date: Sat, 20 Jun 2015 12:24:40 -0700 Subject: [PATCH 044/338] accidentally removed credit --- documentdb/documentdb-tests.ts | 3 +-- documentdb/documentdb.d.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/documentdb/documentdb-tests.ts b/documentdb/documentdb-tests.ts index f88570a88..ae0c66b89 100644 --- a/documentdb/documentdb-tests.ts +++ b/documentdb/documentdb-tests.ts @@ -123,5 +123,4 @@ docDBClient.executeStoredProcedure('procedure', [10, 'foo'], (error, result) => else { console.log('Procedure result: ' + result); } -}); - +}); \ No newline at end of file diff --git a/documentdb/documentdb.d.ts b/documentdb/documentdb.d.ts index e7ffd1f5a..01cc49342 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' { From 623fca4e98243496e54e2d54a129d0452a1d7e30 Mon Sep 17 00:00:00 2001 From: bryn austin bellomy Date: Sun, 21 Jun 2015 06:23:41 -0500 Subject: [PATCH 045/338] Fix for eyes module API --- eyes/eyes-tests.ts | 7 ++++++- eyes/eyes.d.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/eyes/eyes-tests.ts b/eyes/eyes-tests.ts index 3182195dd..156054ba1 100644 --- a/eyes/eyes-tests.ts +++ b/eyes/eyes-tests.ts @@ -26,4 +26,9 @@ var options = { hideFunctions: true, stream: process.stdout, maxLength: 120 -} \ No newline at end of file +} + +var result = eyes.inspector(testObj) + + + diff --git a/eyes/eyes.d.ts b/eyes/eyes.d.ts index 091916821..8c731513a 100644 --- a/eyes/eyes.d.ts +++ b/eyes/eyes.d.ts @@ -13,7 +13,7 @@ declare module "eyes" export function inspect(thing:any, label?:string): void; export interface InspectorFunction { - (thing:any, label?:string): void; + (thing:any, label?:string): string; } export interface EyesOptions From 732a73c1b1f675f64d4a56ccc0030a7d7b6737ab Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Sun, 21 Jun 2015 14:26:24 -0400 Subject: [PATCH 046/338] callback on check should pass isLocked boolean --- lockfile/lockfile.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lockfile/lockfile.d.ts b/lockfile/lockfile.d.ts index 99dfbe28d..1f3acdebc 100644 --- a/lockfile/lockfile.d.ts +++ b/lockfile/lockfile.d.ts @@ -18,7 +18,7 @@ declare module 'lockfile' { export function unlock(path: string, callback: (err: Error) => void): void; export function unlockSync(path: string):void; - export function check(path: string, opts: Options, callback: (err: Error) => void): void; - export function check(path: string, callback: (err: Error) => void): void; + export function check(path: string, opts: Options, callback: (err: Error, isLocked: boolean) => void): void; + export function check(path: string, callback: (err: Error, isLocked: boolean) => void): void; export function checkSync(path: string, opts: Options): boolean; } From 7ff4d6f0c5d8ebe7546ecaa40de885f1652f4c1d Mon Sep 17 00:00:00 2001 From: Daniel Beckwith Date: Sun, 21 Jun 2015 14:28:30 -0400 Subject: [PATCH 047/338] adds test for check callback --- lockfile/lockfile-tests.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lockfile/lockfile-tests.ts b/lockfile/lockfile-tests.ts index 49aa423d9..9ebb956da 100644 --- a/lockfile/lockfile-tests.ts +++ b/lockfile/lockfile-tests.ts @@ -9,6 +9,9 @@ var path: string; var opts: lockfile.Options; var callback: (err: Error) => { +}; +var callback2: (err: Error, isLocked: boolean) => { + }; opts = { @@ -25,7 +28,7 @@ lockfile.lockSync(path, opts); lockfile.unlock(path, callback);; lockfile.unlockSync(path); -lockfile.check(path, opts, callback); -lockfile.check(path, callback); +lockfile.check(path, opts, callback2); +lockfile.check(path, callback2); bool = lockfile.checkSync(path, opts); From a81e731a5a8cee6b8e30762b2d02c9d63b22a550 Mon Sep 17 00:00:00 2001 From: woutergd Date: Sun, 21 Jun 2015 21:48:09 +0200 Subject: [PATCH 048/338] First type definitions for openlayers 3, all base classes implemented --- openlayers3/openlayers3.d.ts | 2002 ++++++++++++++++++++++++++++++++++ 1 file changed, 2002 insertions(+) create mode 100644 openlayers3/openlayers3.d.ts diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts new file mode 100644 index 000000000..d89c65ecc --- /dev/null +++ b/openlayers3/openlayers3.d.ts @@ -0,0 +1,2002 @@ +// Type definitions for OpenLayers v3.6.0 +// Project: http://openlayers.org/ +// Definitions by: Wouter Goedhart +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/** + * A high-performance, feature-packed library for all your mapping needs. + */ +declare module ol { + + /** + * An attribution for a layer source. + */ + class Attribution { + /** + * @constructor + * @param options Attribution options. + */ + constructor(options: AttributionOptions); + + /** + * Get the attribution markup. + * @returns The attribution HTML. + */ + 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. + */ + class Collection extends ol.Object { + + /** + * @constructor + * @param values Array. + */ + constructor(values: Array) + + /** + * Remove all elements from the collection. + */ + clear(): void; + + /** + * Add elements to the collection. This pushes each item in the provided array to the end of the collection. + * @param arr Array. + * @returns This collection. + */ + extend(arr: Array): Collection; + + /** + * Iterate over each element, calling the provided callback. + * @param f The function to call for every element. This function takes 3 arguments (the element, the index and the array). + * @param ref The object to use as this in f. + */ + forEach(f: (element: T, index: number, array: Array) => void, ref?: any): void; + + /** + * Get a reference to the underlying Array object. Warning: if the array is mutated, no events will be dispatched by the collection, and the collection's "length" property won't be in sync with the actual length of the array. + * @returns Array. + */ + getArray(): Array; + + /** + * Get the length of this collection. + * @returns The length of the array. + */ + getLength(): number; + + /** + * Insert an element at the provided index. + * @param index Index. + * @param elem Element. + */ + insertAt(index: number, elem: T): void; + + /** + * Get the element at the provided index. + * @param index Index. + * @returns Element. + */ + item(index: number): T; + + /** + * Remove the last element of the collection and return it. Return undefined if the collection is empty. + * @returns Element + */ + pop(): T; + + /** + * Insert the provided element at the end of the collection. + * @param Element. + * @returns Length. + */ + push(elem: T): number; + + /** + * Remove the first occurrence of an element from the collection. + * @param elem Element. + * @returns The removed element or undefined if none found. + */ + remove(elem: T): T; + + /** + * Remove the element at the provided index and return it. Return undefined if the collection does not contain this index. + * @param index Index. + * @returns Value. + */ + removeAt(index: number): T; + + /** + * Set the element at the provided index. + * @param index Index. + * @param elem Element. + */ + setAt(index: number, elem: T): void; + } + + /** + * Events emitted by ol.Collection instances are instances of this type. + */ + class CollectionEvent { + + /** + * The element that is added to or removed from the collection. + */ + element: T; + } + + /** + * The ol.DeviceOrientation class provides access to information from DeviceOrientation events. + */ + class DeviceOrientation extends ol.Object { + + /** + * @constructor + * @param options Options. + */ + constructor(options: DeviceOrientationOptions); + + /** + * Rotation around the device z-axis (in radians). + * @returns The euler angle in radians of the device from the standard Z axis. + */ + getAlpha(): number; + + /** + * Rotation around the device x-axis (in radians). + * @returns The euler angle in radians of the device from the planar X axis. + */ + getBeta(): number; + + /** + * Rotation around the device y-axis (in radians). + * @returns The euler angle in radians of the device from the planar Y axis. + */ + getGamma(): number; + + /** + * The heading of the device relative to north (in radians). + * @returns The heading of the device relative to north, in radians, normalizing for different browser behavior. + */ + getHeading(): number; + + /** + * Determine if orientation is being tracked. + * @returns Changes in device orientation are being tracked. + */ + getTracking(): boolean; + + /** + * Enable or disable tracking of device orientation events. + * @param tracking The status of tracking changes to alpha, beta and gamma. If true, changes are tracked and reported immediately. + */ + 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. + */ + class DragBoxEvent { + + /** + * The coordinate of the drag event. + */ + coordinate: ol.Coordinate; + } + + /** + * A vector object for geographic features with a geometry and other attribute properties, similar to the features in vector file formats like GeoJSON. + */ + class Feature extends ol.Object { + + /** + * @constructor + * @param geometry Geometry. + */ + constructor(geometry: ol.geom.Geometry); + + /** + * Clone this feature. If the original feature has a geometry it is also cloned. The feature id is not set in the clone. + * @returns The clone. + */ + clone(): Feature; + + /** + * Get the feature's default geometry. A feature may have any number of named geometries. The "default" geometry (the one that is rendered by default) is set when calling ol.Feature#setGeometry. + * @returns The default geometry for the feature. + */ + getGeometry(): ol.geom.Geometry; + + /** + * Get the name of the feature's default geometry. By default, the default geometry is named geometry. + * @returns Get the property name associated with the default geometry for this feature. + */ + getGeometryName(): string; + + /** + * @returns Id. + */ + getId(): string; + + /** + * Get the feature's style. This return for this method depends on what was provided to the ol.Feature#setStyle method. + * The feature style. + */ + // TODO: Implement FeatureStyleFunction + getStyle(): ol.style.Style | Array | any; + + /** + * Get the feature's style function. + * @returns Return a function representing the current style of this feature. + */ + // TODO: Implement FeatureStyleFunction + getStyleFunction(): any; + + /** + * Set the default geometry for the feature. This will update the property with the name returned by ol.Feature#getGeometryName. + * @param geometry The new geometry. + */ + setGeometry(geometry: ol.geom.Geometry): void; + + /** + * Set the property name to be used when getting the feature's default geometry. When calling ol.Feature#getGeometry, the value of the property with this name will be returned. + * @param name The property name of the default geometry. + */ + setGeometryName(name: string): void; + + /** + * Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the ol.source.Vector#getFeatureById method. + * @param id The feature id. + */ + setId(id: number): void; + setId(id: string): void; + + /** + * Set the style for the feature. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. If it is null the feature has no style (a null style). + * @param style Style for this feature. + */ + // TODO: Implement FeatureStyleFunction + setStyle(style: ol.style.Style): void; + setStyle(style: Array): void; + setStyle(style: any): void; + } + + /** + * A mechanism for changing the style of a small number of features on a temporary basis, for example highlighting. + */ + class FeatureOverlay { + + /** + * @constructor + * @param options Options. + */ + constructor(options: FeatureOverlayOptions); + + /** + * Add a feature to the overlay. + * @param feature Feature. + */ + addFeature(feature: ol.Feature): void; + + /** + * Get the features on the overlay. + * @returns Features collection. + */ + getFeatures: ol.Collection; + + /** + * Get the map associated with the overlay. + * @returns The map with which this feature overlay is associated. + */ + getMap(): ol.Map; + + /** + * Get the style for features. This returns whatever was passed to the style option at construction or to the setStyle method. + * @returns Overlay style. + */ + // TODO: implement stylefunction + getStyle(): ol.style.Style | Array | any; + + /** + * Get the style function + * @returns Style function + */ + getStyleFunction(): any; + + /** + * Remove a feature from the overlay. + * @param feature The feature to be removed. + */ + removeFeature(feature: ol.Feature): void; + + /** + * Set the features for the overlay. + * @param features Features collection. + */ + setFeatures(features: ol.Collection): void; + + /** + * Set the map for the overlay. + * @param map Map. + */ + setMap(map: ol.Map): 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. + * @param style Overlay style + */ + // TODO: implement stylefunction + setStyle(style: ol.style.Style): void; + 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. + */ + class Geolocation extends ol.Object { + + /** + * @constructor + * @param options Options. + */ + constructor(options: GeolocationOptions); + + /** + * Get the accuracy of the position in meters. + * @returns The accuracy of the position measurement in meters. + */ + getAccuracy(): number; + + /** + * Get a geometry of the position accuracy. + * @returns A geometry of the position accuracy. + */ + getAccuracyGeometry(): ol.geom.Geometry; + + /** + * Get the altitude associated with the position. + * @returns The altitude of the position in meters above mean sea level. + */ + getAltitude(): number; + + /** + * Get the altitude accuracy of the position. + * @returns The accuracy of the altitude measurement in meters. + */ + getAltitudeAccuracy(): number; + + /** + * Get the heading as radians clockwise from North. + * @returns The heading of the device in radians from north. + */ + getHeading(): number; + + /** + * Get the position of the device. + * @returns The current position of the device reported in the current projection. + */ + getPosition(): ol.Coordinate; + + /** + * Get the projection associated with the position. + * @returns The projection the position is reported in. + */ + getProjection(): ol.proj.Projection; + + /** + * Get the speed in meters per second. + * @returns The instantaneous speed of the device in meters per second. + */ + getSpeed(): number; + + /** + * Determine if the device location is being tracked. + * @returns The device location is being tracked. + */ + getTracking(): boolean; + + /** + * Get the tracking options. + * @returns PositionOptions as defined by the HTML5 Geolocation spec. + */ + getTrackingOptions(): PositionOptions; + + /** + * Set the projection to use for transforming the coordinates. + * @param projection The projection the position is reported in. + */ + setProjection(projection: ol.proj.Projection): void; + + /** + * Enable or disable tracking. + * @param tracking Enable tracking + */ + setTracking(tracking: boolean): void; + + /** + * Set the tracking options. + * @param PositionOptions as defined by the HTML5 Geolocation spec. + */ + 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. + */ + class Graticule { + /** + * @constructor + * @param options Options. + */ + constructor(options: GraticuleOptions); + + /** + * Get the map associated with this graticule. + * @returns The map. + */ + getMap(): Map; + + /** + * Get the list of meridians. Meridians are lines of equal longitude. + * @returns The meridians. + */ + getMeridians(): Array; + + /** + * Get the list of parallels. Pallels are lines of equal latitude. + * @returns The parallels. + */ + getParallels(): Array; + + /** + * Set the map for this graticule.The graticule will be rendered on the provided map. + * @param map Map + */ + 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; + } + + /** + * + */ + class Image extends ol.ImageBase { + + /** + * Get the HTML image element (may be a Canvas, Image, or Video). + * @param context Object. + * @returns Image. + */ + getImage(context: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement): Image; + } + + /** + * + */ + class ImageBase { + } + + /** + * + */ + class ImageTile extends ol.Tile { + + /** + * Get the HTML image element for this tile (may be a Canvas, Image, or Video). + * @param context Object. + * @returns Image. + */ + getImage(context: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement): Image; + } + + /** + * Implementation of inertial deceleration for map movement. + */ + class Kinetic { + + /** + * @constructor + * @param decay Rate of decay (must be negative). + * @param Minimum velocity (pixels/millisecond). + * @param Delay to consider to calculate the kinetic initial values (milliseconds). + */ + constructor(decay: number, minVelocity: number, delay: number); + } + + /** + * The map is the core component of OpenLayers. For a map to render, a view, one or more layers, and a target container are needed. + */ + class Map extends ol.Object { + + /** + * @constructor + * @params options Options. + */ + constructor(options: MapOptions); + + /** + * Add the given control to the map. + * @param control Control. + */ + addControl(control: ol.control.Control): void; + + /** + * Add the given interaction to the map. + * @param interaction Interaction to add. + */ + addInteraction(interaction: ol.interaction.Interaction): void; + + /** + * Adds the given layer to the top of this map. If you want to add a layer elsewhere in the stack, use getLayers() and the methods available on ol.Collection. + * @param Layer. + */ + addLayer(layer: ol.layer.Base): void; + + /** + * Add the given overlay to the map. + * @param overlay Overlay. + */ + addOverlay(overlay: ol.Overlay): void; + + /** + * Add functions to be called before rendering. This can be used for attaching animations before updating the map's view. The ol.animation namespace provides several static methods for creating prerender functions. + * @param var_args Any number of pre-render functions. + */ + // TODO: Implement PreRenderFunction + beforeRender(var_args: any): void; + + /** + * Detect features that intersect a pixel on the viewport, and execute a callback with each intersecting feature. Layers included in the detection can be configured through opt_layerFilter. Feature overlays will always be included in the detection. + * @param pixel Pixel. + * @param callback Feature callback. The callback will be called with two arguments. The first argument is one feature at the pixel, the second is the layer of the feature. If the detected feature is not on a layer, but on a ol.FeatureOverlay, then the second argument to this function will be null. To stop detection, callback functions can return a truthy value. + * @param ref Value to use as this when executing callback. + * @param layerFilter Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested. Feature overlays will always be tested. + * @param ref2 Value to use as this when executing layerFilter. + * @returns Callback result, i.e. the return value of last callback execution, or the first truthy callback return value. + */ + forEachFeatureAtPixel(pixel: ol.Pixel, callback: (feature: ol.Feature, layer: ol.layer.Layer) => any, ref?: any, layerFilter?: (layerCandidate: ol.layer.Layer) => boolean, ref2?: any): void; + + /** + * Detect layers that have a color value at a pixel on the viewport, and execute a callback with each matching layer. Layers included in the detection can be configured through opt_layerFilter. Feature overlays will always be included in the detection. + * @param pixel Pixel. + * @param callback Layer callback. Will receive one argument, the layer that contains the color pixel. If the detected color value is not from a layer, but from a ol.FeatureOverlay, then the argument to this function will be null. To stop detection, callback functions can return a truthy value. + * @param ref Value to use as this when executing callback. + * @param layerFilter Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested. Feature overlays will always be tested. + * @param ref2 Value to use as this when executing layerFilter. + * @returns Callback result, i.e. the return value of last callback execution, or the first truthy callback return value. + */ + forEachLayerAtPixel(pixel: ol.Pixel, callback: (layer: ol.layer.Layer) => any, ref?: any, layerFilter?: (layerCandidate: ol.layer.Layer) => boolean, ref2?: any): void; + + /** + * Get the map controls. Modifying this collection changes the controls associated with the map. + * @returns Controls. + */ + getControls(): ol.Collection; + + /** + * Get the coordinate for a given pixel. This returns a coordinate in the map view projection. + * @param pixel Pixel position in the map viewport. + * @returns The coordinate for the pixel position. + */ + getCoordinateFromPixel(pixel: ol.Pixel): ol.Coordinate; + + /** + * Returns the geographical coordinate for a browser event. + * @param event Event. + * @returns Coordinate. + */ + getEventCoordinate(event: Event): ol.Coordinate; + + /** + * Returns the map pixel position for a browser event relative to the viewport. + * @param event Event. + * @returns Pixel. + */ + getEventPixel(event: Event): ol.Pixel; + + /** + * Get the map interactions. Modifying this collection changes the interactions associated with the map. + * @returns Interactions + */ + getInteractions(): ol.Collection; + + /** + * Get the layergroup associated with this map. + * @returns A layer group containing the layers in this map. + */ + getLayerGroup(): ol.layer.Group; + + /** + * Get the collection of layers associated with this map. + * @returns Layers. + */ + getLayers(): ol.Collection; + + /** + * Get the map overlays. Modifying this collection changes the overlays associated with the map. + * @returns Overlays. + */ + getOverlays(): ol.Collection; + + /** + * Get the pixel for a coordinate. This takes a coordinate in the map view projection and returns the corresponding pixel. + * @param coordinate A map coordinate. + * @returns A pixel position in the map viewport. + */ + getPixelFromCoordinate(coordinate: ol.Coordinate): ol.Pixel; + + /** + * Get the size of this map. + * @returns The size in pixels of the map in the DOM. + */ + getSize(): ol.Size; + + /** + * Get the target in which this map is rendered. Note that this returns what is entered as an option or in setTarget: if that was an element, it returns an element; if a string, it returns that. + * @returns The Element or id of the Element that the map is rendered in. + */ + getTarget(): Element | string; + + /** + * Get the DOM element into which this map is rendered. In contrast to getTarget this method always return an Element, or null if the map has no target. + * @returns The element that the map is rendered in. + */ + getTargetElement(): Element; + + /** + * Get the view associated with this map. A view manages properties such as center and resolution. + * @returns The view that controls this map. + */ + getView(): View; + + /** + * Get the element that serves as the map viewport. + * @returns Viewport. + */ + getViewport(): Element; + + /** + * Detect if features intersect a pixel on the viewport. Layers included in the detection can be configured through opt_layerFilter. Feature overlays will always be included in the detection. + * @param pixel Pixel. + * @param layerFilter Layer filter function. The filter function will receive one argument, the layer-candidate and it should return a boolean value. Only layers which are visible and for which this function returns true will be tested for features. By default, all visible layers will be tested. Feature overlays will always be tested. + * @param ref Value to use as this when executing layerFilter. + * @returns Is there a feature at the given pixel? + */ + hasFeatureAtPixel(pixel: ol.Pixel, layerFilter?: (layer: ol.layer.Layer) => boolean, ref?: any): boolean; + + /** + * Remove the given control from the map. + * @param Control. + * @returns The removed control (or undefined if the control was not found). + */ + removeControl(control: ol.control.Control): ol.control.Control; + + /** + * Remove the given interaction from the map. + * @param interaction Interaction to remove. + * @returns The removed interaction (or undefined if the interaction was not found). + */ + removeInteraction(interaction: ol.interaction.Interaction): ol.interaction.Interaction; + + /** + * Removes the given layer from the map. + * @param Layer. + * @returns The removed layer (or undefined if the layer was not found). + */ + removeLayer(layer: ol.layer.Base): ol.layer.Base; + + /** + * Remove the given overlay from the map. + * @param Overlay. + * @returns The removed overlay (or undefined if the overlay was not found). + */ + removeOverlay(overlay: ol.Overlay): ol.Overlay; + + /** + * Request a map rendering (at the next animation frame). + */ + render(): void; + + /** + * Requests an immediate render in a synchronous manner. + */ + renderSync(): void; + + /** + * Sets the layergroup of this map. + * @param layerGroup A layer group containing the layers in this map. + */ + setLayerGroup(layerGroup: ol.layer.Group): void; + + /** + * Set the size of this map. + * @param size The size in pixels of the map in the DOM. + */ + setSize(size: ol.Size): void; + + /** + * Set the target element to render this map into. + * @param target The Element or id of the Element that the map is rendered in. + */ + setTarget(target: Element): void; + setTarget(target: string): void; + + /** + * Set the view for this map. + * @param view The view that controls this map. + */ + setView(view: View): void; + + /** + * Force a recalculation of the map viewport size. This should be called when third-party code changes the size of the map viewport. + * */ + 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. + */ + class MapBrowserEvent extends MapEvent { + + /** + * The coordinate of the original browser event + */ + coordinate: Coordinate; + + /** + * Indicates if the map is currently being dragged. Only set for POINTERDRAG and POINTERMOVE events. Default is false. + */ + dragging: boolean; + + /** + * The frame state at the time of the event + */ + // TODO: Replace with olx.FrameState + frameState: any; + + /** + * The map where the event occured + */ + map: Map; + + /** + * The original browser event + */ + originalEvent: Event; + + /** + * The pixel of the original browser event. + */ + pixel: Pixel; + + + // Methods + + /** + * Prevents the default browser action. + */ + preventDefault(): void; + + /** + * Prevents further propagation of the current event. + */ + stopPropagation(): void; + } + + /** + * Events emitted as map events are instances of this type. See ol.Map for which events trigger a map event. + */ + class MapEvent { + + /** + * The frame state at the time of the event. + */ + // TODO: Replace with olx.FrameState + frameState: any; + + /** + * The map where the event occurred. + */ + map: Map; + } + + /** + * Abstract base class; normally only used for creating subclasses and not instantiated in apps. Most non-trivial classes inherit from this. + */ + class Object extends Observable { + + /** + * @constructor + * @param values An object with key-value pairs. + */ + constructor(values?: Object); + + /** + * Gets a value. + * @param key Key name. + * @returns Value. + */ + get(key: string): any; + + /** + * Get a list of object property names. + * @returns List of property names. + */ + getKeys(): Array; + + /** + * Get an object of all property names and values. + * @returns Object. + */ + getProperties(): Object; + + /** + * @returns Revision. + */ + getRevision(): number; + + /** + * Sets a value. + * @param key Key name. + * @param value Value. + */ + set(key: string, value: any): void; + + /** + * Sets a collection of key-value pairs. Note that this changes any existing properties and adds new ones (it does not remove any existing properties). + * @param Values. + */ + setProperties(values: Object): void; + + /** + * Unsets a property. + */ + unset(key: string): void; + } + + /** + * Events emitted by ol.Object instances are instances of this type. + */ + class ObjectEvent { + + /** + * The name of the property whose value is changing. + */ + key: string; + + /** + * The old value. To get the new value use e.target.get(e.key) where e is the event object. + */ + oldValue: any; + } + + /** + * Abstract base class; normally only used for creating subclasses and not instantiated in apps. An event target providing convenient methods for listener registration and unregistration. A generic change event is always available through ol.Observable#changed. + */ + class Observable { + + /** + * Removes an event listener using the key returned by on() or once(). + */ + unByKey(key: any): void; + + /** + * Increases the revision counter and dispatches a 'change' event. + */ + changed(): void; + + /** + * @returns Revision. + */ + getRevision(): number; + + /** + * Listen for a certain type of event. + * @param type The event type. + * @param listener The listener function. + * @param ref The object to use as this in listener. + * @returns Unique key for the listener. + */ + on(type: string, listener: (event: MapBrowserEvent) => void, ref?: any): any; + + /** + * Listen for a certain type of event. + * @param type The array of event types. + * @param listener The listener function. + * @param ref The object to use as this in listener. + * @returns Unique key for the listener. + */ + on(type: Array, listener: (event: MapBrowserEvent) => void, ref?: any): any; + + /** + * Listen once for a certain type of event. + * @param type The event type. + * @param listener The listener function. + * @param ref The object to use as this in listener. + * @returns Unique key for the listener. + */ + once(type: string, listener: (event: MapBrowserEvent) => void, ref?: any): any; + + /** + * Listen once for a certain type of event. + * @param type The array of event types. + * @param listener The listener function. + * @param ref The object to use as this in listener. + * @returns Unique key for the listener. + */ + once(type: Array, listener: (event: MapBrowserEvent) => void, ref?: any): any; + + /** + * Unlisten for a certain type of event. + * @param type The array of event types. + * @param listener The listener function. + * @param ref The object to use as this in listener. + * @returns Unique key for the listener. + */ + un(type: Array, listener: (event: MapBrowserEvent) => void, ref?: any): any; + + /** + * Removes an event listener using the key returned by on() or once(). Note that using the ol.Observable.unByKey static function is to be preferred. + * @param key The key returned by on() or once() + */ + unByKey(key: any): void; + } + + /** + * An element to be displayed over the map and attached to a single map location. + */ + class Overlay extends ol.Object { + + /** + * @constructor + * @param options Overlay options. + */ + constructor(options: OverlayOptions); + + /** + * Get the DOM element of this overlay. + * @returns The Element containing the overlay. + */ + getElement(): Element; + + /** + * Get the map associated with this overlay. + * @returns The map that the overlay is part of. + */ + getMap(): ol.Map; + + /** + * Get the offset of this overlay. + * @returns The offset. + */ + getOffset(): Array; + + /** + * Get the current position of this overlay. + * @returns The spatial point that the overlay is anchored at. + */ + getPosition(): ol.Coordinate; + + /** + * Get the current positioning of this overlay. + * @returns How the overlay is positioned relative to its point on the map. + */ + getPositioning(): ol.OverlayPositioning; + + /** + * Set the DOM element to be associated with this overlay. + * @param element The element containing the overlay. + */ + setElement(element: Element): void; + + /** + * Set the map to be associated with this overlay. + * @param map The map that the overlay is part of. + */ + setMap(map: Map): void; + + /** + * Set the offset for this overlay. + * @param offset Offset. + */ + setOffset(offset: Array): void; + + /** + * Set the position for this overlay. If the position is undefined the overlay is hidden. + * @param position The spatial point that the overlay is anchored at. + */ + setPosition(position: ol.Coordinate): void; + + /** + * Set the positioning for this overlay. + * @param How the overlay is positioned relative to its point on the map. + */ + 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. + */ + class SelectEvent { + + /** + * Deselected features array. + */ + deselected: Array; + + /** + * Associated ol.MapBrowserEvent; + */ + mapBrowserEvent: ol.MapBrowserEvent; + + /** + * Selected features array. + */ + selected: Array + } + + /** + * Class to create objects that can be used with ol.geom.Polygon.circular. + */ + class Sphere { + + /** + * @constructor + * @param radius Radius. + */ + constructor(radius: number); + + /** + * Returns the geodesic area for a list of coordinates. + * @param coordinates List of coordinates of a linear ring. If the ring is oriented clockwise, the area will be positive, otherwise it will be negative. + * @returns Area. + */ + geodesicArea(coordinates: Array): number; + + /** + * Returns the distance from c1 to c2 using the haversine formula. + * @param c1 Coordinate 1. + * @param c2 Coordinate 2. + * @returns Haversine distance. + */ + haversineDistance(c1: ol.Coordinate, c2: ol.Coordinate): number; + } + + /** + * Base class for tiles. + */ + class Tile { + + /** + * Get the tile coordinate for this tile. + * @returns TileCoord. + */ + getTileCoord(): ol.TileCoord; + } + + /** + * An ol.View object represents a simple 2D view of the map. + */ + class View extends ol.Object { + + /** + * @constructor + * @param options Options. + */ + constructor(options: 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(). + * @param size Box pixel size + * @returns Extent. + */ + calculateExtent(size: ol.Size): ol.Extent; + + /** + * Center on coordinate and view position. + * @param coordinate Coordinate. + * @param size Box pixel size + * @param position Position on the view to center on + */ + centerOn(coordinate: ol.Coordinate, size: ol.Size, position: ol.Pixel): void; + + /** + * Get the constrained center of this view. + * @param center Center. + * @returns Constrained center. + */ + constrainCenter(center: ol.Coordinate): ol.Coordinate; + + /** + * Get the constrained resolution of this view. + * @param resolution: Resolution. + * @param delta Delta. Default is 0. + * @param direction Direction. Default is 0. + * @returns Constrained resolution + */ + constrainResolution(resolution: number, delta?: number, direction?: number): number; + + /** + * Fit the map view to the passed extent and size. The size is pixel dimensions of the box to fit the extent into. In most cases you will want to use the map size, that is map.getSize(). + * @param extent Extent. + * @param size Box pixel size. + */ + fitExtent(extent: ol.Extent, size: ol.Size): void; + + /** + * Fit the given geometry into the view based on the given map size and border. + * @param geometry Geometry. + * @param size Box pixel size. + * @param options Options + */ + fitGeometry(geometry: ol.geom.SimpleGeometry, size: ol.Size, options?: ViewFitGeometryOptions): void; + + /** + * Get the view center. + * @returns The center of the view. + */ + getCenter(): ol.Coordinate; + + /** + * Get the view projection + * @returns The projection of the view. + */ + getProjection(): ol.proj.Projection; + + /** + * Get the view resolution + * @returns The resolution of the view. + */ + getResolution(): number; + + /** + * Get the view rotation + * @returns The rotation of the view in radians + */ + getRotation(): number; + + /** + * Get the current zoom level. Return undefined if the current resolution is undefined or not a "constrained resolution". + * @returns Zoom. + */ + getZoom(): number; + + /** + * Rotate the view around a given coordinate. + * @param rotation New rotation value for the view. + * @param anchor The rotation center. + */ + rotate(rotation: number, anchor: ol.Coordinate): void; + + /** + * Set the center of the current view. + * @param center The center of the view. + */ + setCenter(center: ol.Coordinate): void; + + /** + * Set the resolution for this view. + * @param resolution The resolution of the view. + */ + setResolution(resolution: number): void; + + /** + * Set the rotation for this view. + * @param rotation The rotation of the view in radians. + */ + setRotation(rotation: number): void; + + /** + * Zoom to a specific zoom level. + * @param zoom Zoom level. + */ + 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 + module animation { + } + + module color { + } + + module control { + class Attribution { + } + + class Control { + } + + class FullScreen { + } + + class MousePosition { + } + + class OverviewMap { + } + + class Rotate { + } + + class ScaleLine { + } + + class Zoom { + } + + class ZoomSlider { + } + + class ZoomToExtent { + } + } + + module coordinate { + } + + module easing { + } + + module events { + module condition { + } + } + + module extent { + } + + module featureloader { + } + + module format { + + // Type definitions + interface IGCZ extends String { } + + // Classes + class EsriJSON { + } + + class Feature { + } + + class GeoJSON { + } + + class GML { + } + + class GML2 { + } + + class GML3 { + } + + class GMLBase { + } + + class GPX { + } + + class IGC { + } + + class JSONFeature { + } + + class KML { + } + + class OSMXML { + } + + class Polyline { + } + + class TextFeature { + } + + class TopoJSON { + } + + class WFS { + } + + class WKT { + } + + class WMSCapabilities { + } + + class WMSGetFeatureInfo { + } + + class WMTSCapabilities { + } + + class XML { + } + + class XMLFeature { + } + } + + module geom { + + // Type definitions + interface GeometryLayout extends String { } + interface GeometryType extends String { } + + class Circle { + } + + class Geometry { + } + + class GeometryCollection { + } + + class LinearRing { + } + + class LineString { + new(): LineString; + } + + class MultiLineString { + } + + class MultiPoint { + } + + class MultiPolygon { + } + + class Point { + } + + class Polygon { + } + + class SimpleGeometry { + } + } + + module has { + } + + module interaction { + + class DoubleClickZoom { + } + + class DragAndDrop { + } + + class DragAndDropEvent { + } + + class DragBox { + } + + class DragPan { + } + + class DragRotate { + } + + class DragRotateAndZoom { + } + + class DragZoom { + } + + class Draw { + } + + class DrawEvent { + } + + class Interaction { + } + + class KeyboardPan { + } + + class KeyboardZoom { + } + + class Modify { + } + + class MouseWheelZoom { + } + + class PinchRotate { + } + + class PinchZoom { + } + + class Pointer { + } + + class Select { + } + + class Snap { + } + } + + module layer { + + class Base { + } + + class Group { + } + + class Heatmap { + } + + class Image { + } + + class Layer { + } + + class Tile { + constructor(options: any); + } + + class Vector { + } + } + + module loadingstrategy { + } + + module proj { + + // Type definitions + interface ProjectionLike extends String { } + interface Units extends String { } + + // Methods + + /** + * Meters per unit lookup table. + */ + //TODO: validate! + var METERS_PER_UNIT: Object; + + /** + * Registers coordinate transform functions to convert coordinates between the source projection and the destination projection. The forward and inverse functions convert coordinate pairs; this function converts these into the functions used internally which also handle extents and coordinate arrays. + * @param source Source projection + * @param destination Destination projection + * @param forward The forward transform function (that is, from the source projection to the destination projection) that takes a ol.Coordinate as argument and returns the transformed ol.Coordinate. + * @param inverse The inverse transform function (that is, from the destination projection to the source projection) that takes a ol.Coordinate as argument and returns the transformed ol.Coordinate. + */ + function addCoordinateTransforms(source: ProjectionLike, destination: ProjectionLike, forward: (coordinate: Coordinate) => Coordinate, inverse: (coordinate: Coordinate) => Coordinate): void; + + /** + * Registers transformation functions that don't alter coordinates. Those allow to transform between projections with equal meaning. + * @param projections Projections. + */ + function addEquivalentProjections(projections: Array): void; + + /** + * Add a Projection object to the list of supported projections that can be looked up by their code. + * @param projection Projection instance. + */ + function addProjection(projection: Projection): void; + + /** + * Transforms a coordinate from longitude/latitude to a different projection. + * @param coordinate Coordinate as longitude and latitude, i.e. an array with longitude as 1st and latitude as 2nd element. + * @param projection Target projection. The default is Web Mercator, i.e. 'EPSG:3857'. + */ + function fromLonLat(coordinate: Coordinate, opt_projection: ProjectionLike): Coordinate; + + /** + * Fetches a Projection object for the code specified. + * @param projectionLike Either a code string which is a combination of authority and identifier such as "EPSG:4326", or an existing projection object, or undefined. + * @returns Projection object, or null if not in list. + */ + function get(projectionLike: ProjectionLike): Projection; + + /** + * Given the projection-like objects, searches for a transformation function to convert a coordinates array from the source projection to the destination projection. + * @param source Source. + * @param destination Destination. + * @returns Transform function. + */ + // TODO: Transformfunction + function getTransform(source: ProjectionLike, destination: ProjectionLike): any; + + /** + * Transforms a coordinate to longitude/latitude. + * @param coordinate Projected coordinate. + * @param projection Projection of the coordinate. The default is Web Mercator, i.e. 'EPSG:3857'. + * @returns Coordinate as longitude and latitude, i.e. an array with longitude as 1st and latitude as 2nd element. + */ + function toLonLat(coordinate: Coordinate, projection: ProjectionLike): Coordinate; + + /** + * Transforms a coordinate from source projection to destination projection. This returns a new coordinate (and does not modify the original). + * @param coordinate Coordinate. + * @param source Source projection-like. + * @param destination Destination projection-like. + * @returns Coordinate. + */ + function transform(coordinate: Coordinate, source: ProjectionLike, destination: ProjectionLike): Coordinate; + + /** + * Transforms an extent from source projection to destination projection. This returns a new extent (and does not modify the original). + * @param extent The extent to transform. + * @param source Source projection-like. + * @param destination Destination projection-like. + * @returns The transformed extent. + */ + function transformExtent(extent: Extent, source: ProjectionLike, destination: ProjectionLike): Extent; + + interface Projection { + } + } + + module render { + + class Event { + } + + class VectorContext { + } + + module canvas { + class Immediate { + } + } + } + + module source { + + class BingMaps { + } + + class Cluster { + } + + class Image { + } + + class ImageCanvas { + } + + class ImageEvent { + } + + class ImageMapGuide { + } + + class ImageStatic { + } + + class ImageVector { + } + + class ImageWMS { + } + + class MapQuest { + constructor(options: any); + } + + class OSM { + } + + class Source { + } + + class Stamen { + } + + class Tile { + } + + class TileArcGISRest { + } + + class TileDebug { + } + + class TileEvent { + } + + class TileImage { + } + + class TileJSON { + } + + class TileUTFGrid { + } + + class TileVector { + } + + class TileWMS { + } + + class Vector { + } + + class VectorEvent { + } + + class WMTS { + } + + class XYZ { + } + + class Zoomify { + } + + // Namespaces + module wms { + interface ServerType extends String { } + } + + // Type definitions + interface State extends String { } + interface WMTSRequestEncoding extends String { } + } + + module style { + + class AtlasManager { + } + + class Circle { + } + + class Fill { + } + + class Icon { + } + + class Image { + } + + class RegularShape { + } + + class Stroke { + constructor(); + } + + class Style { + } + + class Text { + } + } + + module tilegrid { + + class TileGrid { + } + + class WMTS { + } + + class Zoomify { + } + } + + module webgl { + + class Context { + new(canvas: HTMLCanvasElement, gl: WebGLRenderingContext): Context; + + /** + Get the WebGL rendering context + @returns The rendering context. + */ + getGL(): WebGLRenderingContext; + + /** + * Get the frame buffer for hit detection. + * @returns The hit detection frame buffer. + */ + getHitDetectionFramebuffer(): WebGLFramebuffer; + + /** + * Use a program. If the program is already in use, this will return false. + * @param program Program. + * @returns Changed. + */ + useProgram(program: WebGLProgram): boolean; + } + } + + // Type definitions + + /** + * A function returning the canvas element ({HTMLCanvasElement}) used by the source as an image. The arguments passed to the function are: ol.Extent the image extent, {number} the image resolution, {number} the device pixel ratio, ol.Size the image size, and ol.proj.Projection the image projection. The canvas returned by this function is cached by the source. The this keyword inside the function references the ol.source.ImageCanvas. + */ + function CanvasFunctionType(extent: Extent, resolution: number, pixelRatio: number, size: Size, projection: proj.Projection): HTMLCanvasElement; + + /** + * A color represented as a short array [red, green, blue, alpha]. red, green, and blue should be integers in the range 0..255 inclusive. alpha should be a float in the range 0..1 inclusive. + */ + interface Color extends Array { } + + /** + * An array of numbers representing an xy coordinate. Example: [16, 48]. + */ + interface Coordinate extends Array { } + + /** + * A function that takes a ol.Coordinate and transforms it into a {string}. + */ + function CoordinateFormatType(coordinate?: Coordinate): string; + + /** + * An array of numbers representing an extent: [minx, miny, maxx, maxy]. + */ + interface Extent extends Array { } + + /** + * Overlay position: 'bottom-left', 'bottom-center', 'bottom-right', 'center-left', 'center-center', 'center-right', 'top-left', 'top-center', 'top-right' + */ + interface OverlayPositioning extends String { } + + /** + * An array with two elements, representing a pixel. The first element is the x-coordinate, the second the y-coordinate of the pixel. + */ + interface Pixel extends Array { } + + /** + * Available renderers: 'canvas', 'dom' or 'webgl'. + */ + interface RendererType extends String { } + + /** + * An array of numbers representing a size: [width, height]. + */ + interface Size extends Array { } + + /** + * An array of three numbers representing the location of a tile in a tile grid. The order is z, x, and y. z is the zoom level. + */ + interface TileCoord extends Array { } + + // Functions + + /** + * A transform function accepts an array of input coordinate values, an optional output array, and an optional dimension (default should be 2). The function transforms the input coordinate values, populates the output array, and returns the output array. + */ + function TransformFunction(input: Array, output?: Array, dimension?: number): Array; +} \ No newline at end of file From 19fc8fa756b484511662028f48af923c24116b13 Mon Sep 17 00:00:00 2001 From: shaban Date: Sun, 21 Jun 2015 22:45:11 +0200 Subject: [PATCH 049/338] Update ace.d.ts add config functions, reference https://github.com/ajaxorg/ace/wiki/Configuring-Ace also support $blockscrolling variable; reference https://github.com/ajaxorg/ace/issues/2499 --- ace/ace.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ace/ace.d.ts b/ace/ace.d.ts index 72fefbc6e..4758b59e9 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -1063,6 +1063,31 @@ declare module AceAjax { onChangeMode(e?); execCommand(command:string, args?: any); + + /** + * Sets a Configuration Option + **/ + setOption(optionName: any, optionValue: any); + + /** + * Sets Configuration Options + **/ + setOptions(keyValueTuples: any); + + /** + * Get a Configuration Option + **/ + getOption(name: any):any; + + /** + * Get Configuration Options + **/ + getOptions():any; + + /** + * Get rid of console warning by setting this to Infinity + **/ + $blockScrolling:number; /** * Sets a new key handler, such as "vim" or "windows". From 45610fcf75796001c0cd326d7fec48a4294e208b Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Wed, 17 Jun 2015 22:49:03 -0500 Subject: [PATCH 050/338] Add definitions for js-cookie 2.0 --- js-cookie/js-cookie-tests.ts | 68 +++++++++++++++++++++++++++++++++ js-cookie/js-cookie.d.ts | 73 ++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 js-cookie/js-cookie-tests.ts create mode 100644 js-cookie/js-cookie.d.ts diff --git a/js-cookie/js-cookie-tests.ts b/js-cookie/js-cookie-tests.ts new file mode 100644 index 000000000..819f42903 --- /dev/null +++ b/js-cookie/js-cookie-tests.ts @@ -0,0 +1,68 @@ +/// + +// Create a cookie, valid across the entire site +Cookies.set('name', 'value'); + +// Create a cookie that expires 7 days from now, valid across the entire site +Cookies.set('name', 'value', { expires: 7 }); + +// Create an expiring cookie, valid to the path of the current page +Cookies.set('name', 'value', { expires: 7, path: '' }); + +// Read cookie +Cookies.get('name'); // => 'value' +Cookies.get('nothing'); // => undefined + +// Read all available cookies +Cookies.get(); // => { name: 'value' } + +// Delete cookie +Cookies.remove('name'); + +// Delete a cookie valid to the path of the current page +Cookies.set('name', 'value', { path: '' }); +Cookies.remove('name'); // fail! +Cookies.remove('name', { path: '' }); // removed! + +// Assign the js-cookie api to a different variable +// and restore the original "window.Cookies" +var Cookies2 = Cookies.noConflict(); +Cookies2.set('name', 'value'); + +// When creating a cookie you can pass an Array or Object Literal +// instead of a string in the value. If you do so, js-cookie will +// store the string representation of the object according to JSON.stringify +Cookies.set('name', { foo: 'bar' }); + +// When reading a cookie with the Cookies.getJSON api, you receive +// the parsed representation of the string stored in the cookie +// according to JSON.parse +Cookies.getJSON('name'); // => { foo: 'bar' } + +// Define the domain where the cookie is available +Cookies.set('name', 'value', { domain: 'sub.domain.com' }); +Cookies.get('name'); // => undefined (need to read at 'sub.domain.com') + +// Indicate that the cookie transmission requires (https) +Cookies.set('name', 'value', { secure: true }); +Cookies.get('name'); // => 'value' +Cookies.remove('name', { secure: true }); + +document.cookie = 'escaped=%u5317'; +document.cookie = 'default=%E5%8C%97'; +var cookies = Cookies.withConverter(function (value, name) { + if ( name === 'escaped' ) { + return decodeURIComponent(value); + } +}); + +cookies.get('escaped'); // 北 +cookies.get('default'); // 北 +cookies.get(); // { escaped: '北', default: '北' } + +// To remove, set or declare defaults to the path of the +// current page, you just need to declare it as empty: +Cookies.defaults.path = ''; + +// Deleting the property will fallback to the path: / internally: +delete Cookies.defaults.path; diff --git a/js-cookie/js-cookie.d.ts b/js-cookie/js-cookie.d.ts new file mode 100644 index 000000000..e8b8098c8 --- /dev/null +++ b/js-cookie/js-cookie.d.ts @@ -0,0 +1,73 @@ +// Type definitions for js-cookie v2.0 +// Project: https://github.com/js-cookie/js-cookie +// Definitions by: Theodore Brown +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module Cookies { + interface CookieOptions { + expires?: number | Date; + path?: string; + domain?: string; + secure?: boolean; + } + + interface CookiesStatic { + /** + * Allows default cookie options to be accessed, changed, or reset + */ + defaults: CookieOptions; + + /** + * Create a cookie + */ + set(name: string, value: string | any, options?: CookieOptions): void; + + /** + * Read cookie + */ + get(name: string): string; + + /** + * Read all available cookies + */ + get(): {[key: string]: string}; + + /** + * Returns the parsed representation of the string + * stored in the cookie according to JSON.parse + */ + getJSON(name: string): any; + + /** + * Returns the parsed representation of + * all cookies according to JSON.parse + */ + getJSON(): {[key: string]: any}; + + /** + * Delete cookie + */ + remove(name: string, options?: CookieOptions): void; + + /** + * If there is any danger of a conflict with the namespace Cookies, + * the noConflict method will allow you to define a new namespace + * and preserve the original one. This is especially useful when + * running the script on third party sites e.g. as part of a widget + * or SDK. Note: The noConflict method is not necessary when using + * AMD or CommonJS, thus it is not exposed in those environments. + */ + noConflict(): CookiesStatic; + + /** + * Create a new instance of the api that overrides the default + * decoding implementation. All methods that rely in a proper + * decoding to work, such as Cookies.remove() and Cookies.get(), + * will run the converter first for each cookie. The returned + * string will be used as the cookie value. + */ + withConverter(converter: (value: string, name: string) => string): CookiesStatic; + } +} + +declare var Cookies: Cookies.CookiesStatic; From 28314f78489242a804b608a2e9d784e728b29cc3 Mon Sep 17 00:00:00 2001 From: Matt DeKrey Date: Mon, 22 Jun 2015 09:19:15 -0400 Subject: [PATCH 051/338] Add angular-storage definition file --- angular-storage/angular-storage-tests.ts | 43 +++++++++++++++++++ angular-storage/angular-storage.d.ts | 53 ++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 angular-storage/angular-storage-tests.ts create mode 100644 angular-storage/angular-storage.d.ts diff --git a/angular-storage/angular-storage-tests.ts b/angular-storage/angular-storage-tests.ts new file mode 100644 index 000000000..1455bbd64 --- /dev/null +++ b/angular-storage/angular-storage-tests.ts @@ -0,0 +1,43 @@ +/// +/// + +// Samples taken from the a0-angular-storage Readme.md + +var app = angular.module('angular-storage-tests', ['angular-storage']); + +angular.module('angular-storage-tests') +.controller('StoreController', function(store: angular.a0.storage.IStoreService) { + var myObj = { + name: 'mgonto' + }; + + store.set('obj', myObj); + + var myNewObject = store.get('obj'); + + console.log('Should be true: ', angular.equals(myNewObject, myObj)); + + store.remove('obj'); + + store.set('number', 2); + + console.log('Should be true: ', typeof(store.get('number')) === 'number'); +}) +.factory('Auth0Store', function(store: angular.a0.storage.IStoreService) { + return store.getNamespacedStore('auth0'); +}) +.controller('NamespacedStoreController', function(Auth0Store: angular.a0.storage.INamespacedStoreService) { + + var myObj = { + name: 'mgonto' + }; + + // This will be saved in localStorage as auth0.obj + Auth0Store.set('obj', myObj); + + // This will look for auth0.obj + var myNewObject = Auth0Store.get('obj'); + + console.log('Should be true: ', angular.equals(myNewObject, myObj)); +});; + diff --git a/angular-storage/angular-storage.d.ts b/angular-storage/angular-storage.d.ts new file mode 100644 index 000000000..3e442e669 --- /dev/null +++ b/angular-storage/angular-storage.d.ts @@ -0,0 +1,53 @@ +// Type definitions for angular-storage v0.0.11 +// Project: https://github.com/auth0/angular-storage +// Definitions by: Matthew DeKrey +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module angular.a0.storage { + interface IStoreService extends INamespacedStoreService { + /** + * Returns a namespaced store + * + * @param {String} namespace - The namespace + * @param {String} storage - The name of the storage service. Defaults to local storage. + * @param {String} delimiter - The delimiter to use to separate the namespace and the keys. + * @returns {INamespacedStoreService} + */ + getNamespacedStore(namespace: string, storage?: string, delimiter?: string): INamespacedStoreService; + } + + interface INamespacedStoreService { + /** + * Sets a new value to the storage with the key name. It can be any object. + * + * @param {String} name - The key name for the location of the value + * @param value - The value to store + */ + set(name: string, value: any): void; + + /** + * Returns the saved value with they key name. + * + * @param {String} name - The key name for the location of the value + * @returns The saved value; if you saved an object, you get an object + */ + get(name: string): any; + + /** + * Deletes the saved value with the key name + * + * @param {String} name - The key name for the location of the value to remove + */ + remove(name: string): void; + } + + interface IStoreProvider { + + /** + * Sets the storage. + * + * @param {String} storage - The storage name + */ + setStore(storage: string): void; + } +} \ No newline at end of file From fb0a1c14aedb900b405a9b2706116b087579cdc9 Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Mon, 22 Jun 2015 15:39:47 +0200 Subject: [PATCH 052/338] Added definition for loglevel (https://github.com/pimterry/loglevel) --- loglevel/loglevel-tests.ts | 20 ++++++++ loglevel/loglevel.d.ts | 98 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 loglevel/loglevel-tests.ts create mode 100644 loglevel/loglevel.d.ts diff --git a/loglevel/loglevel-tests.ts b/loglevel/loglevel-tests.ts new file mode 100644 index 000000000..8284134f3 --- /dev/null +++ b/loglevel/loglevel-tests.ts @@ -0,0 +1,20 @@ +/// + +log.trace("Trace message"); +log.debug("Debug message"); +log.info("Info message"); +log.warn("Warn message"); +log.error("Error message"); + +log.setLevel(0); +log.setLevel(0, false); + +log.setLevel("error"); +log.setLevel("error", false); + +log.setLevel(log.levels.WARN); +log.setLevel(log.levels.WARN, false); + +var logging = log.noConflict(); + +logging.error("still pretty easy"); diff --git a/loglevel/loglevel.d.ts b/loglevel/loglevel.d.ts new file mode 100644 index 000000000..6644d026c --- /dev/null +++ b/loglevel/loglevel.d.ts @@ -0,0 +1,98 @@ +// Type definitions for loglevel 1.3.1 +// Project: https://github.com/pimterry/loglevel +// Definitions by: Stefan Profanter +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module loglevel { + + /** + * Log levels + */ + export enum levels { + TRACE = 0, + DEBUG = 1, + INFO = 2, + WARN = 3, + ERROR = 4, + SILENT = 5 + } + + /** + * Output trace message to console. + * This will also include a full stack trace + * + * @param msg the message to print + */ + export function trace(msg:string):void; + + /** + * Output debug message to console including appropriate icons + * @param msg the message to print + */ + export function debug(msg:string):void; + + /** + * Output info message to console including appropriate icons + * @param msg the message to print + */ + export function info(msg:string):void; + + /** + * Output warn message to console including appropriate icons + * @param msg the message to print + */ + export function warn(msg:string):void; + + /** + * Output error message to console including appropriate icons + * @param msg the message to print + */ + export function error(msg:string):void; + + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level 0=trace to 5=silent + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling back + * to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + export function setLevel(level:number, persist?:boolean):void; + + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level as a string, like 'error' (case-insensitive) + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling back + * to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + export function setLevel(level:string, persist?:boolean):void; + + + /** + * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") + * or log.error("something") will output messages, but log.info("something") will not. + * + * @param level as the value from the enum + * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling back + * to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass + * false as the optional 'persist' second argument, persistence will be skipped. + */ + export function setLevel(level:levels, persist?:boolean):void; + + /** + * If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel. + * Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded + * onto the page. This resets to 'log' global to its value before loglevel was loaded (typically undefined), and + * returns the loglevel object, which you can then bind to another name yourself. + */ + export function noConflict():any; +} + +declare +var log:typeof loglevel; From 625232f072d61739c765a8d9c794c301e86858dd Mon Sep 17 00:00:00 2001 From: Stefan Profanter Date: Mon, 22 Jun 2015 16:01:44 +0200 Subject: [PATCH 053/338] Changed message type to any --- loglevel/loglevel-tests.ts | 1 + loglevel/loglevel.d.ts | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/loglevel/loglevel-tests.ts b/loglevel/loglevel-tests.ts index 8284134f3..2c4f89733 100644 --- a/loglevel/loglevel-tests.ts +++ b/loglevel/loglevel-tests.ts @@ -5,6 +5,7 @@ log.debug("Debug message"); log.info("Info message"); log.warn("Warn message"); log.error("Error message"); +log.debug(["Hello", "world", 42]); log.setLevel(0); log.setLevel(0, false); diff --git a/loglevel/loglevel.d.ts b/loglevel/loglevel.d.ts index 6644d026c..01b80b722 100644 --- a/loglevel/loglevel.d.ts +++ b/loglevel/loglevel.d.ts @@ -21,33 +21,37 @@ declare module loglevel { * Output trace message to console. * This will also include a full stack trace * - * @param msg the message to print + * @param msg any data to log to the console */ - export function trace(msg:string):void; + export function trace(msg:any):void; /** * Output debug message to console including appropriate icons - * @param msg the message to print + * + * @param msg any data to log to the console */ - export function debug(msg:string):void; + export function debug(msg:any):void; /** * Output info message to console including appropriate icons - * @param msg the message to print + * + * @param msg any data to log to the console */ - export function info(msg:string):void; + export function info(msg:any):void; /** * Output warn message to console including appropriate icons - * @param msg the message to print + * + * @param msg any data to log to the console */ - export function warn(msg:string):void; + export function warn(msg:any):void; /** * Output error message to console including appropriate icons - * @param msg the message to print + * + * @param msg any data to log to the console */ - export function error(msg:string):void; + export function error(msg:any):void; /** From cdcdc7b95f6c08e81a1350aa5adf74e88188b448 Mon Sep 17 00:00:00 2001 From: Chris Wrench Date: Mon, 22 Jun 2015 17:32:51 +0100 Subject: [PATCH 054/338] Add joData definitions Fixes #4696. --- joData/joData-tests.ts | 192 ++++++++++++++++++++++++++++++++++ joData/joData.d.ts | 229 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 421 insertions(+) create mode 100644 joData/joData-tests.ts create mode 100644 joData/joData.d.ts diff --git a/joData/joData-tests.ts b/joData/joData-tests.ts new file mode 100644 index 000000000..62dd1569c --- /dev/null +++ b/joData/joData-tests.ts @@ -0,0 +1,192 @@ +/// + +var query = new jo('http://test.com'); + +// Base URI +query.baseUri; + +// To string +query.toString(); + +// Order by +query.orderBy('PropertyName'); +query.orderBy('PropertyName').asc(); +query.orderBy('PropertyName').desc(); +query.orderBy('PropertyName').asc().desc(); +query.resetOrderBy(); +query.setOrderByDefault('PropertyName'); +query.toggleOrderBy('CustomerId'); // TODO Example with callback. + +query + .setOrderByDefault('p1', 'desc') + .orderBy('p2') + .asc(); + +// Top +query.top(10); +query.resetTop(); +query.setTopDefault(5); +query + .setTopDefault(5) + .top(10); + +// Skip +query.skip(5); +query.resetSkip(); +query.setSkipDefault(5); +query + .setSkipDefault(5) + .skip(10); + +// Select +query.select(['Property1', 'Property2']); +query.resetSelect(); +query.setSelectDefault(['CustomerId', 'CustomerName']); +query + .setSelectDefault(['CustomerId', 'CustomerName']) + .select(['CustomerId', 'CustomerName', 'Address']); + +// Expand +query.expand('Customer'); +query.resetExpand(); +query.setExpandDefault('Customer'); +query + .setExpandDefault('Customer') + .expand('Product'); + +// Format +query.format().atom(); +query.format().xml(); +query.format().json(); +query.format().custom('text/csv'); + +query.formatDefault().atom(); + +query + .formatDefault() + .atom() + .format() + .json(); + +query.resetFormat(); + +// Inlinecount +query.inlineCount().allPages(); +query.inlineCount().none(); + +query.inlineCountDefault().allPages(); + +query + .inlineCountDefault() + .allPages() + .inlineCount() + .none(); + +query.resetInlineCount(); + +// Filter +var clause = new jo.FilterClause('PropertyName'); +clause.eq(5); +query.filter(clause); + +query + .andFilter(new jo.FilterClause('Property1').eq(5)) + .andFilter(new jo.FilterClause('Property2').eq(10)); + +query + .orFilter(new jo.FilterClause('Property1').eq(5)) + .orFilter(new jo.FilterClause('Property2').eq(10)); + +query + .filter(new jo.FilterClause('p1').eq(1)) + .andFilter(new jo.FilterClause('p2').eq(5)) + .orFilter(new jo.FilterClause('p3').eq(10)); + +query.removeFilter('CustomerName'); + +var clause = new jo.FilterClause('CustomerId'); +clause.isEmpty(); + +var clause = new jo.FilterClause('CustomerId').eq(1); +clause.isEmpty(); + +query.andFilter(new jo.FilterClause('Status').eq('Pending')); +query.captureFilter(); +query.resetToCapturedFilter(); +query.resetFilter(); + +// Casts +query.filter(new jo.FilterClause('DateAdded').eq(jo.datetime('2013-03-01'))); +query.filter(new jo.FilterClause('CustomerId').eq(jo.guid('3F2504E0-4F89-11D3-9A0C-0305E82C3301'))); +query.filter(new jo.FilterClause('Price').eq(jo.decimal(24.97))); +query.filter(new jo.FilterClause('Price').eq(jo.single(24.97))); +query.filter(new jo.FilterClause('Price').eq(jo.double(24.97))); + +// Logical Operators +query.filter(new jo.FilterClause('PropertyName').eq('test')); +query.filter(new jo.FilterClause('PropertyName').eq(10)); +query.filter(new jo.FilterClause('CustomerName').not().eq('bob')); +query.filter(new jo.FilterClause('CustomerName').not().endswith('bob')); + +// Precedence Groups +var group = new jo.PrecedenceGroup(new jo.FilterClause('Name').eq('Bob')); +query.filter(group); + +var group2 = new jo.PrecedenceGroup(new jo.FilterClause('Name').eq('Bob')).orFilter(new jo.FilterClause('Name').eq('George')); +query.filter(group2); + +query + .filter(new jo.FilterClause('Id').eq(1)) + .andFilter(new jo.PrecedenceGroup(new jo.FilterClause('Name').startswith('a').eq(true)) + .orFilter(new jo.FilterClause('Name').startswith('b').eq(true))); + +// Setting filter defaults +query.defaultFilter(new jo.FilterClause('Id').eq(1)); +query + .defaultFilter(new jo.FilterClause('Id').eq(1)) + .filter(new jo.FilterClause('Name').eq('bob')); +query + .defaultFilter(new jo.FilterClause('Id').eq(1)) + .filter(new jo.FilterClause('Name').eq('bob')); +query.resetFilter(); + +// Arithmetic Methods +query.filter(new jo.FilterClause('PropertyName').add(5).eq(10)); + +// String Functions +query.filter(new jo.FilterClause('PropertyName').substringof('test').eq(true)); +query.filter(new jo.FilterClause('PropertyName').toLower().substringof('test').eq(true)); +query.filter(new jo.FilterClause('PropertyName').endswith('test').eq(true)); +query.filter(new jo.FilterClause('PropertyName').startswith('test').eq(true)); +query.filter(new jo.FilterClause('PropertyName').length().eq(10)); +query.filter(new jo.FilterClause('PropertyName').indexof('test').eq(1)); +query.filter(new jo.FilterClause('PropertyName').replace('test', 'bob').eq('bob')); +query.filter(new jo.FilterClause('PropertyName').substring(1).eq('test')); +query.filter(new jo.FilterClause('PropertyName').substring(1,2).eq('test')); +query.filter(new jo.FilterClause('PropertyName').toLower().eq('test')); +query.filter(new jo.FilterClause('PropertyName').toUpper().eq('TEST')); +query.filter(new jo.FilterClause('PropertyName').trim().eq('test')); + +// Concat +query.filter(new jo.FilterClause().Concat(new jo.Concat('FirstName', 'LastName')).eq('BobSmith')); +query.filter(new jo.FilterClause().Concat(new jo.Concat(new jo.Concat('City', jo.literal(', ')), 'State')).eq('Birmingham, Alabama')); + +// Date Functions +query.filter(new jo.FilterClause('Birthday').day().eq(2)); +query.filter(new jo.FilterClause('Birthday').hour().eq(2)); +query.filter(new jo.FilterClause('Birthday').minute().eq(2)); +query.filter(new jo.FilterClause('Birthday').month().eq(2)); +query.filter(new jo.FilterClause('Birthday').second().eq(2)); +query.filter(new jo.FilterClause('Birthday').year().eq(2)); + +// Math Functions +query.filter(new jo.FilterClause('Price').round().eq(2)); +query.filter(new jo.FilterClause('Price').floor().eq(2)); +query.filter(new jo.FilterClause('Price').ceiling().eq(2)); + +// Saving Local +query.saveLocal(); +jo.loadLocal(); + +query.saveLocal("key"); +jo.loadLocal("key"); \ No newline at end of file diff --git a/joData/joData.d.ts b/joData/joData.d.ts new file mode 100644 index 000000000..f2d6ce412 --- /dev/null +++ b/joData/joData.d.ts @@ -0,0 +1,229 @@ +// Type definitions for joData v1.1 +// Project: https://github.com/mccow002/joData +// Definitions by: Chris Wrench +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare class jo +{ + constructor(baseUri: string); + + baseUri: string; + ExpandSettings: jo.ExpandSettings; + FilterSettings: jo.InlineCountSettings; + FormatSettings: jo.FormatSettings; + InlineCountSettings: jo.InlineCountSettings; + OrderBySettings: jo.OrderBySettings; + SelectSettings: jo.SelectSettings; + SkipSettings: jo.SkipSettings; + TopSettings: jo.TopSettings; + + currentHashRoute: string; + updateHashRoute: (hashRoute: string) => void; + + // Order by + setOrderByDefault(property: string, order?: string): jo; + toggleOrderBy(property: string, callback?: Function): jo; + orderBy(property: string): jo; + desc(): jo; + asc(): jo; + resetOrderBy(): jo; + + // Top + setTopDefault(top: number): jo; + top(top: number): jo; + resetTop(): jo; + + // Skip + setSkipDefault(skip: number): jo; + skip(skip: number): jo; + resetSkip(): jo; + + // Select + setSelectDefault(select: string[]): jo; + select(select: string[]): jo; + resetSelect(): jo; + + // Expand + setExpandDefault(expand: string): jo; + expand(expand: string): jo; + resetExpand(): jo; + + // Format + format(): jo.FormatOptions; + formatDefault(): jo.FormatOptions; + resetFormat(): void; + + // Inline count + inlineCount(): jo.InlineCountOptions; + inlineCountDefault(): jo.InlineCountOptions; + resetInlineCount(): void; + + // Filter + filter(filterClause: jo.FilterClause|jo.PrecedenceGroup): jo; + andFilter(filterClause: jo.FilterClause|jo.PrecedenceGroup): jo; + orFilter(filterClause: jo.FilterClause|jo.PrecedenceGroup): jo; + removeFilter(property: string): jo; + captureFilter(): void; + resetFilter(): jo; + resetToCapturedFilter(): jo; + defaultFilter(filterClause: jo.FilterClause): jo; + defaultAndFilter(filterClause: jo.FilterClause): jo; + defaultOrFilter(filterClause: jo.FilterClause): jo; + + // Casts + static literal: (stringLiteral: string) => string; + static datetime: (stringLiteral: string) => string; + static guid: (stringLiteral: string) => string; + static decimal: (stringLiteral: number) => string; + static double: (stringLiteral: number) => string; + static single: (stringLiteral: number) => string; + + toString: () => string; + toJson: () => string; + saveLocal: (key?: string) => void; + + static loadLocal: (key?: string) => jo; +} + +declare module jo { + interface FormatOptions { + atom(): jo; + custom(value: string): jo; + json(): jo; + xml(): jo; + } + + interface InlineCountOptions { + allPages(): jo; + none(): jo; + } + + export class FilterClause { + constructor(); + constructor(property: string); + + toString(): string; + isEmpty(): Boolean; + + Property: string; + Components: string[]; + IsClauseEmpty: Boolean; + PropertyIncluded: Boolean; + UsingNot: Boolean; + Value: any; + FuncReturnType: any; + transformFunc: Function; + + // Logical operators + eq(value: string|number|boolean): jo.FilterClause; + ne(value: string|number|boolean): jo.FilterClause; + gt(value: string|number|boolean): jo.FilterClause; + ge(value: string|number|boolean): jo.FilterClause; + lt(value: string|number|boolean): jo.FilterClause; + le(value: string|number|boolean): jo.FilterClause; + not(): jo.FilterClause; + + // Arithmetic methods + add(amount: number): jo.FilterClause; + sub(amount: number): jo.FilterClause; + mul(amount: number): jo.FilterClause; + div(amount: number): jo.FilterClause; + mod(amount: number): jo.FilterClause; + + // String functions + substringof(value: string): jo.FilterClause; + substring(position: number, length?: number): jo.FilterClause; + toLower(): jo.FilterClause; + toUpper(): jo.FilterClause; + trim(): jo.FilterClause; + endswith(value: string): jo.FilterClause; + startswith(value: string): jo.FilterClause; + length(): jo.FilterClause; + indexof(value: string): jo.FilterClause; + replace(find: string, replace: string): jo.FilterClause; + + // Concat + Concat(concat: jo.Concat): jo.FilterClause; + + // Date functions + day(): jo.FilterClause; + hour(): jo.FilterClause; + minute(): jo.FilterClause; + month(): jo.FilterClause; + second(): jo.FilterClause; + year(): jo.FilterClause; + + // Math functions + round(): jo.FilterClause; + floor(): jo.FilterClause; + ceiling() : jo.FilterClause; + } + + // Precedence groups + export class PrecedenceGroup { + constructor(filterClause: jo.FilterClause) + andFilter(filterClause: jo.FilterClause): jo.FilterClause; + orFilter(filterClause: jo.FilterClause): jo.FilterClause; + } + + // Concat + export class Concat { + constructor(value1: string|jo.Concat, value2: string|jo.Concat) + LeftSide: string|jo.Concat; + RightSide: string|jo.Concat; + toString(): string; + } + + // TODO What is the most appropriate place for these interfaces? + // They are only required by the `jo` class. + interface ISettings { + toString: () => string; + reset: () => void; + isSet: () => Boolean; + } + + interface OrderBySettings extends ISettings { + Property: string; + Order: string; + DefaultProperty:string; + DefaultOrder: string; + } + + interface TopSettings extends ISettings { + Top: number; + DefaultTop: number; + } + + interface SkipSettings extends ISettings { + Skip: number; + DefaultSkip: number; + } + + interface SelectSettings extends ISettings { + Select: string[]; + DefaultSelect: string[]; + } + + interface ExpandSettings extends ISettings { + Expand: string; + DefaultExpand: string; + } + + interface FormatSettings extends ISettings { + Format: string; + DefaultFormat: string; + } + + interface InlineCountSettings extends ISettings { + InlineCount: string; + DefaultInlineCount: string; + } + + interface FilterSettings extends ISettings { + Filters: FilterClause[]; + DefaultFilters: FilterClause[]; + CapturedFilter: FilterClause[]; + fullReset: () => void; + loadFromJson: (filterSettings: any) => void; + } +} From 92d2e42c07696c80961984ec7327a9bec660b01d Mon Sep 17 00:00:00 2001 From: Rene Eichhorn Date: Mon, 22 Jun 2015 19:57:04 +0200 Subject: [PATCH 055/338] added continue for hapi IReply --- hapi/hapi.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index de8dba6b8..8d3da2620 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -241,10 +241,9 @@ declare module "hapi" { /** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */ (result: string|number|boolean|Buffer|stream.Stream | Promise | T): Response; - //////// Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. - ////// - ////// The data argument is only used for passing back authentication data and is ignored elsewhere. - ////////continue(credentialData?: any): void; + /** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200. + * The data argument is only used for passing back authentication data and is ignored elsewhere. */ + continue(credentialData?: any): void; /** Transmits a file from the file system. The 'Content-Type' header defaults to the matching mime type based on filename extension. The response flow control rules do not apply. */ file( From 05c5e9f7f61d236cbb34b325ab0033b8d29341ca Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Mon, 22 Jun 2015 15:20:56 -0500 Subject: [PATCH 056/338] Rename CookieOptions to CookieAttributes, and document each attribute --- js-cookie/js-cookie.d.ts | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/js-cookie/js-cookie.d.ts b/js-cookie/js-cookie.d.ts index e8b8098c8..fc3e95c02 100644 --- a/js-cookie/js-cookie.d.ts +++ b/js-cookie/js-cookie.d.ts @@ -4,23 +4,42 @@ // Definitions: https://github.com/borisyankov/DefinitelyTyped declare module Cookies { - interface CookieOptions { + interface CookieAttributes { + /** + * Define when the cookie will be removed. Value can be a Number + * which will be interpreted as days from time of creation or a + * Date instance. If omitted, the cookie becomes a session cookie. + */ expires?: number | Date; + + /** + * Define the path where the cookie is available. Defaults to '/' + */ path?: string; + + /** + * Define the domain where the cookie is available. Defaults to + * the domain of the page where the cookie was created. + */ domain?: string; + + /** + * A Boolean indicating if the cookie transmission requires a + * secure protocol (https). Defaults to false. + */ secure?: boolean; } interface CookiesStatic { /** - * Allows default cookie options to be accessed, changed, or reset + * Allows default cookie attributes to be accessed, changed, or reset */ - defaults: CookieOptions; + defaults: CookieAttributes; /** * Create a cookie */ - set(name: string, value: string | any, options?: CookieOptions): void; + set(name: string, value: string | any, options?: CookieAttributes): void; /** * Read cookie @@ -47,7 +66,7 @@ declare module Cookies { /** * Delete cookie */ - remove(name: string, options?: CookieOptions): void; + remove(name: string, options?: CookieAttributes): void; /** * If there is any danger of a conflict with the namespace Cookies, From 84b0146bd7b506a5fe640b56c4495d56707d1d04 Mon Sep 17 00:00:00 2001 From: Stefan Mohr Date: Mon, 22 Jun 2015 13:44:51 -0700 Subject: [PATCH 057/338] Added explicit parameter and method return types --- jasmine-jquery/jasmine-jquery.d.ts | 78 +++++++++++++++--------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/jasmine-jquery/jasmine-jquery.d.ts b/jasmine-jquery/jasmine-jquery.d.ts index dcff2d12c..903e3f7e2 100644 --- a/jasmine-jquery/jasmine-jquery.d.ts +++ b/jasmine-jquery/jasmine-jquery.d.ts @@ -9,17 +9,17 @@ declare function sandbox(attributes?: any): string; declare function readFixtures(...uls: string[]): string; -declare function preloadFixtures(...uls: string[]); -declare function loadFixtures(...uls: string[]); -declare function appendLoadFixtures(...uls: string[]); +declare function preloadFixtures(...uls: string[]) : void; +declare function loadFixtures(...uls: string[]): void; +declare function appendLoadFixtures(...uls: string[]): void; declare function setFixtures(html: string): string; -declare function appendSetFixtures(html: string); +declare function appendSetFixtures(html: string) : void; -declare function preloadStyleFixtures(...uls: string[]); -declare function loadStyleFixtures(...uls: string[]); -declare function appendLoadStyleFixtures(...uls: string[]); -declare function setStyleFixtures(html: string); -declare function appendSetStyleFixtures(html: string); +declare function preloadStyleFixtures(...uls: string[]) : void; +declare function loadStyleFixtures(...uls: string[]) : void; +declare function appendLoadStyleFixtures(...uls: string[]) : void; +declare function setStyleFixtures(html: string) : void; +declare function appendSetStyleFixtures(html: string) : void; declare function loadJSONFixtures(...uls: string[]): jasmine.JSONFixtures; declare function getJSONFixture(url: string): any; @@ -37,47 +37,47 @@ declare module jasmine { fixturesPath: string; containerId: string; set(html: string): string; - appendSet(html: string); - preload(...uls: string[]); - load(...uls: string[]); - appendLoad(...uls: string[]); + appendSet(html: string): void; + preload(...uls: string[]): void; + load(...uls: string[]): void; + appendLoad(...uls: string[]): void; read(...uls: string[]): string; - clearCache(); - cleanUp(); + clearCache(): void; + cleanUp(): void; sandbox(attributes?: any): string; - createContainer_(html: string); - addToContainer_(html: string); + createContainer_(html: string) : string; + addToContainer_(html: string): void; getFixtureHtml_(url: string): string; - loadFixtureIntoCache_(relativeUrl: string); + loadFixtureIntoCache_(relativeUrl: string): void; makeFixtureUrl_(relativeUrl: string): string; - proxyCallTo_(methodName: string, passedArguments): any; + proxyCallTo_(methodName: string, passedArguments: any): any; } interface StyleFixtures { fixturesPath: string; set(html: string): string; - appendSet(html: string); - preload(...uls: string[]); - load(...uls: string[]); - appendLoad(...uls: string[]); + appendSet(html: string): void; + preload(...uls: string[]) : void; + load(...uls: string[]) : void; + appendLoad(...uls: string[]) : void; read_(...uls: string[]): string; - clearCache(); - cleanUp(); - createStyle_(html: string); + clearCache() : void; + cleanUp() : void; + createStyle_(html: string) : void; getFixtureHtml_(url: string): string; - loadFixtureIntoCache_(relativeUrl: string); + loadFixtureIntoCache_(relativeUrl: string) : void; makeFixtureUrl_(relativeUrl: string): string; - proxyCallTo_(methodName: string, passedArguments): any; + proxyCallTo_(methodName: string, passedArguments: any): any; } interface JSONFixtures { fixturesPath: string; - load(...uls: string[]); + load(...uls: string[]): void; read(...uls: string[]): string; - clearCache(); + clearCache(): void; getFixtureData_(url: string): any; - loadFixtureIntoCache_(relativeUrl: string); - proxyCallTo_(methodName: string, passedArguments): any; + loadFixtureIntoCache_(relativeUrl: string): void; + proxyCallTo_(methodName: string, passedArguments: any): any; } interface Matchers { @@ -105,7 +105,7 @@ declare module jasmine { * // returns true * expect($('
    ')).toHaveCss({margin: "10px"}) */ - toHaveCss(css: Object): boolean; + toHaveCss(css: any): boolean; /** * Checks if DOM element is visible. @@ -162,7 +162,7 @@ declare module jasmine { * @param attributeName Name of the attribute to check * @param expectedAttributeValue Expected attribute value */ - toHaveAttr(attributeName: string, expectedAttributeValue?): boolean; + toHaveAttr(attributeName: string, expectedAttributeValue? : any): boolean; /** * Check if DOM element contains a property and, optionally, if the value of the property is equal to the expected one. @@ -170,7 +170,7 @@ declare module jasmine { * @param propertyName Property name to check * @param expectedPropertyValue Expected property value */ - toHaveProp(propertyName: string, expectedPropertyValue?): boolean; + toHaveProp(propertyName: string, expectedPropertyValue? : any): boolean; /** * Check if DOM element has the given Id @@ -223,14 +223,14 @@ declare module jasmine { * // returns true * expect($('')).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 058/338] 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 fefd91946..1d57bc45c 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 059/338] [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 da2489a5f..74910614e 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 979de8c421274ae0ba9481558c2e69fed4c2250a Mon Sep 17 00:00:00 2001 From: itokentr Date: Tue, 23 Jun 2015 19:38:39 +0900 Subject: [PATCH 060/338] 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 c4f778139..2bbab98e3 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 061/338] 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 2bbab98e3..0f7904fde 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 062/338] 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 0f7904fde..0c6b42740 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 063/338] 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 000000000..e27ec8e6d --- /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 000000000..b0fa0a6ac --- /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 a2e2b0796..f90fefaf9 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 fefd91946..e3484bd72 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 064/338] update CONTRIBUTORS.md --- CONTRIBUTORS.md | 125 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 101 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a41d225ec..d0567940a 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 065/338] 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 2d07596b6f407239307f1292b4a2c63abfda653e Mon Sep 17 00:00:00 2001 From: Arseniy Maximov Date: Tue, 23 Jun 2015 17:45:29 +0300 Subject: [PATCH 066/338] 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 000000000..888d15f91 --- /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 000000000..5663fac49 --- /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 067/338] 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 5663fac49..0f220e1d3 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 068/338] 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 508ae0522..ed6096fa6 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 5a4893862..000000000 --- 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 000000000..25070734f --- /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 0b202f20e..b23a8240e 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 069/338] 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 000000000..b9a39856e --- /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 070/338] 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 87a75439b..1abb13ae8 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 071/338] 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 25070734f..26ee4b220 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 072/338] 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 904e4f127..cfdd3c690 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 073/338] 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 985686ad4..fbc9bf45d 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 074/338] 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 b9a39856e..9ff2d3468 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 000000000..1113604f2 --- /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 075/338] 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 000000000..60cbe5afd --- /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 000000000..3b8fe70c2 --- /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 076/338] 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 3b8fe70c2..614b9bb8b 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 077/338] 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 9ff2d3468..198fee0f9 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 078/338] 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 f86dc326f..94eb39800 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 079/338] 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 be329db81..e6e1941c9 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 080/338] 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 a15417f72..6e9714375 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 081/338] 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 082/338] 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 000000000..3204b7a05 --- /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 000000000..a744904ac --- /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 083/338] 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 c1a05f576..928cc9453 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 3d6554017..5c3704a81 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 084/338] 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 382a2c0a8..38c699e0f 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 697f9e21f..a79c6ff11 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 085/338] 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 000000000..15bbc8e8e --- /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 086/338] 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 15bbc8e8e..7f74b069e 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 087/338] 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 000000000..b2a6f2da2 --- /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 088/338] 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 000000000..41a5eb80d --- /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 b2a6f2da2..bdc2764a2 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 089/338] 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 2a239dc18..8453d5e73 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 090/338] 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 4758b59e9..f0668da3c 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 091/338] 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 633c4ed0d..193f87c08 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 9cb55485d..faf921c57 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 092/338] 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 6e7a8db9f..19e543612 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 e4cdc5a81..6f61ca26e 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 093/338] 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 d89c65ecc..7703a2d5e 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 094/338] 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 364845f3c..30e827294 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 095/338] 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 7703a2d5e..9f06166da 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 096/338] 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 9f06166da..28050055d 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 097/338] 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 bdc2764a2..9cee53eee 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 098/338] 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 28050055d..63ef20082 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 099/338] 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 63ef20082..7b3b16c7b 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 100/338] 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 000000000..a527b13ca --- /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 `