From b3ebf8a9934841796bdaabe8d3cde6ee9052ca0b Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Tue, 24 May 2016 13:24:57 -0400 Subject: [PATCH 01/33] Fix component router breakage --- angularjs/angular-component-router.d.ts | 51 +++++++++++++++++++++++++ angularjs/angular.d.ts | 44 --------------------- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/angularjs/angular-component-router.d.ts b/angularjs/angular-component-router.d.ts index 228db1e017..6406736873 100644 --- a/angularjs/angular-component-router.d.ts +++ b/angularjs/angular-component-router.d.ts @@ -429,4 +429,55 @@ declare module angular { interface OnReuse { $routerOnReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; } + + /** + * Runtime representation a type that a Component or other object is instances of. + * + * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by + * the `MyCustomComponent` constructor function. + */ + interface Type extends Function { + } + + /** + * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. + * + * Supported keys: + * - `path` or `aux` (requires exactly one of these) + * - `component`, `loader`, `redirectTo` (requires exactly one of these) + * - `name` or `as` (optional) (requires exactly one of these) + * - `data` (optional) + * + * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. + */ + interface RouteDefinition { + path?: string; + aux?: string; + component?: Type | ComponentDefinition | string; + loader?: Function; + redirectTo?: any[]; + as?: string; + name?: string; + data?: any; + useAsDefault?: boolean; + } + + /** + * Represents either a component type (`type` is `component`) or a loader function + * (`type` is `loader`). + * + * See also {@link RouteDefinition}. + */ + interface ComponentDefinition { + type: string; + loader?: Function; + component?: Type; + } + + // Supplement IComponentOptions from angular.d.ts with router-specific + // fields. + interface IComponentOptions { + $canActivate?: () => boolean; + $routeConfig?: RouteDefinition[]; + } } diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index d1197dec16..7c3019a001 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -1632,50 +1632,6 @@ declare module angular { // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ /////////////////////////////////////////////////////////////////////////// - /** - * Runtime representation a type that a Component or other object is instances of. - * - * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by - * the `MyCustomComponent` constructor function. - */ - interface Type extends Function { - } - - /** - * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. - * - * Supported keys: - * - `path` or `aux` (requires exactly one of these) - * - `component`, `loader`, `redirectTo` (requires exactly one of these) - * - `name` or `as` (optional) (requires exactly one of these) - * - `data` (optional) - * - * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. - */ - interface RouteDefinition { - path?: string; - aux?: string; - component?: Type | ComponentDefinition | string; - loader?: Function; - redirectTo?: any[]; - as?: string; - name?: string; - data?: any; - useAsDefault?: boolean; - } - - /** - * Represents either a component type (`type` is `component`) or a loader function - * (`type` is `loader`). - * - * See also {@link RouteDefinition}. - */ - interface ComponentDefinition { - type: string; - loader?: Function; - component?: Type; - } - /** * Component definition object (a simplified directive definition object) */ From 9afce5b53134e3a4119f790db459ab7ef2798ccc Mon Sep 17 00:00:00 2001 From: Brian Hinken Date: Wed, 25 Jan 2017 10:54:20 -0500 Subject: [PATCH 02/33] angular-bootstrap-ui: Add missing configuration options & tests for ITooltipOptions --- angular-ui-bootstrap/angular-ui-bootstrap-tests.ts | 1 + angular-ui-bootstrap/index.d.ts | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts index b14af506b6..15f0f2b661 100644 --- a/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts +++ b/angular-ui-bootstrap/angular-ui-bootstrap-tests.ts @@ -155,6 +155,7 @@ testApp.config(( placement: 'bottom', animation: false, popupDelay: 1000, + popupCloseDelay: 1000, appendToBody: true, trigger: 'mouseenter hover', useContentExp: true, diff --git a/angular-ui-bootstrap/index.d.ts b/angular-ui-bootstrap/index.d.ts index b5b4e1a5e6..bc80d96b5a 100644 --- a/angular-ui-bootstrap/index.d.ts +++ b/angular-ui-bootstrap/index.d.ts @@ -161,7 +161,7 @@ declare module 'angular' { /** * Defines the initial date, when no model value is specified. - * + * * @default null */ initDate?: any; @@ -834,12 +834,19 @@ declare module 'angular' { animation?: boolean; /** - * For how long should the user have to have the mouse over the element before the tooltip shows (in milliseconds)? + * Popup delay in milliseconds until it opens. * * @default 0 */ popupDelay?: number; + /** + * For how long should the tooltip remain open after the close trigger event? + * + * @default 0 + */ + popupCloseDelay?: number; + /** * Should the tooltip be appended to `$body` instead of the parent element? * From 9fb51ac8c352d8d7a4371fe333f19e9b4e634a95 Mon Sep 17 00:00:00 2001 From: Sukhdeep Singh Date: Mon, 30 Jan 2017 20:45:31 -0500 Subject: [PATCH 03/33] V0.98.0 changes added --- materialize-css/index.d.ts | 189 ++++++++++++----- materialize-css/materialize-css-tests.ts | 257 ++++++++++++----------- 2 files changed, 265 insertions(+), 181 deletions(-) diff --git a/materialize-css/index.d.ts b/materialize-css/index.d.ts index ea844d959f..4d49ac38e7 100644 --- a/materialize-css/index.d.ts +++ b/materialize-css/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for materialize-css v0.97.5 +// Type definitions for materialize-css v0.98.0 // Project: http://materializecss.com/ -// Definitions by: Erik Lieben , Leon Yu +// Definitions by: Erik Lieben , Leon Yu , Sukhdeep Singh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -15,7 +15,7 @@ declare namespace Materialize { /** * A setting that changes the collapsible behavior to expandable instead of the default accordion style */ - accordion: boolean; + accordion?: boolean; /** * Callback for Collapsible section close. @@ -34,7 +34,23 @@ declare namespace Materialize { /** * The delay before the tooltip shows (in milliseconds) */ - delay:number; + delay: number; + /** + * Tooltip text. Can use custom HTML if you set the html option + */ + tooltip?: string; + /** + * Set the direction of the tooltip. 'top', 'right', 'bottom', 'left'. + * + * (Default: 'bottom') + */ + position?: string; + /** + * Allow custom html inside the tooltip. + * + * (Default: false) + */ + html?: boolean; } /** @@ -46,43 +62,49 @@ declare namespace Materialize { * The duration of the transition enter in milliseconds. * Default: 300 */ - inDuration?:number; + inDuration?: number; /** * The duration of the transition out in milliseconds. * Default: 225 */ - outDuration?:number; + outDuration?: number; - // TODO: constrain_width + /** * If true, constrainWidth to the size of the dropdown activator. * Default: true */ - constrain_width?:boolean; + constrainWidth?: boolean; /** * If true, the dropdown will open on hover. * Default: false */ - hover?:boolean; + hover?: boolean; /** * This defines the spacing from the aligned edge. * Default: 0 */ - gutter?:number; + gutter?: number; /** * If true, the dropdown will show below the activator. * Default: false */ - belowOrigin?:boolean; + belowOrigin?: boolean; /** * Defines the edge the menu is aligned to. * Default: 'left' */ - alignment?:string; + alignment?: string; + /** + * If true, stops the event propagating from the dropdown origin click handler. + * + * Default: false + */ + stopPropagation?: boolean } /** @@ -120,10 +142,10 @@ declare namespace Materialize { */ interface CarouselOptions { /** - * Transition time. + * Transition duration in milliseconds * Default: 200 */ - time_constant?: number; + duration?: number; /** * Perspective zoom. If 0, all items are the same size. @@ -147,13 +169,25 @@ declare namespace Materialize { * Set the width of the carousel. * Default: false */ - full_width?: boolean; + fullWidth?: boolean; + /** + * Set to true to show indicators. + * + * Default: false + */ + indicators?: boolean; + /** + * Don't wrap around and cycle through items. + * + * Default: false + */ + noWrap?: boolean; } /** - * The lean modal options + * The modal options */ - interface LeanModalOptions { + interface ModalOptions { /** * Modal can be dismissed by clicking outside of the modal. @@ -171,13 +205,23 @@ declare namespace Materialize { * Transition in duration. * Default: 300 */ - in_duration?: number; + inDuration?: number; /** * Transition out duration. * Default: 200 */ - out_duration?: number; + outDuration?: number; + /** + * Starting top style attribute + * Default: `4%` + */ + startingTop?: string; + /** + * Ending top style attribute + * Default : `10%` + */ + endingTop?: string; /** * Callback for Modal open. @@ -201,19 +245,19 @@ declare namespace Materialize { * The distance in pixels from the top of the page where the element becomes fixed. * Default: 0 */ - top?:number; + top?: number; /** * The distance in pixels from the top of the page where the elements stops being fixed. * Default: Infinity */ - bottom?:number; + bottom?: number; /** * The offset from the top the element will be fixed at. * Default: 0 */ - offset?:number; + offset?: number; } /** @@ -273,44 +317,68 @@ declare namespace Materialize { * It will only be called once. * Example: 'console.log("hello, world!")'; */ - callback?: string; + callback?: Function; } + interface TabOptions { /** + * Execute a callback function when the tab is changed. + * + * The callback provides a parameter which refers to the current tab being shown. + */ + onShow?: Function; + + /** + * Set to true to enable swipeable tabs. This also uses the responsiveThreshold option. + * + * Default: false + */ + swipeable?: boolean; + + /** + * The maximum width of the screen, in pixels, where the swipeable functionality initializes. + * + * Default: Infinity + */ + responsiveThreshold?: number; + } + + + /** * The Materialize object */ interface Materialize { /** - * Displays a toast message on screen - * - * @name message The message to display on screen - * @name displayLength The duration in milliseconds to display the message on screen - * @name className The className to use to format the message to display - * @name completeCallback Callback function to call when the messages completes/hides. - */ - toast(message:string|JQuery, displayLength:number, className?:string, completeCallback?:Function): void; + * Displays a toast message on screen + * + * @name message The message to display on screen + * @name displayLength The duration in milliseconds to display the message on screen + * @name className The className to use to format the message to display + * @name completeCallback Callback function to call when the messages completes/hides. + */ + toast(message: string | JQuery, displayLength: number, className?: string, completeCallback?: Function): void; /** * Fires an event when the page is scrolled to a certain area * * @name options optional parameter with scroll fire options */ - scrollFire(options?:ScrollFireOptions): void; + scrollFire(options?: ScrollFireOptions): void; /** * A staggered reveal effect for any UL Tag with list items * * @name selector the selector for the list to show in staggered fasion */ - showStaggeredList(selector:string): void; + showStaggeredList(selector: string): void; /** * Fade in images. It also animates grayscale and brightness to give it a unique effect. * * @name selector the selector for the image to fade in */ - fadeInImage(selector:string): void; + fadeInImage(selector: string): void; /** * Update all text field to reinitialize all the Materialize labels on the page if dynamically adding inputs @@ -319,7 +387,7 @@ declare namespace Materialize { } } -declare var Materialize : Materialize.Materialize; +declare var Materialize: Materialize.Materialize; interface JQuery { @@ -365,7 +433,7 @@ interface JQuery { * * @name options the tooltip options or the string "remove" to remove the tooltip function */ - tooltip(options?: Materialize.TooltipOptions|string): JQuery; + tooltip(options?: Materialize.TooltipOptions | string): JQuery; /** * Add a dropdown list to any button. @@ -414,28 +482,32 @@ interface JQuery { * * @name method the methods to pause, start, move to next and move to previous slide. */ - carousel(method: string, count: [number]): JQuery; + carousel(method: string, count?: number): JQuery; /** - * Modal for dialog boxes, confirmation messages, or other content that can be called up. + * Modal for dialog boxes, confirmation messages, or other content that can be called up. + * + * For Initialization. + */ + modal(): JQuery; + + /** + * Modal for dialog boxes, confirmation messages, or other content that can be called up. + * + * For opening and closing modals programatically. + * + * @name string action action to do (`open` or `close) + */ + modal(action: string): void; + + /** + * Modal for dialog boxes, confirmation messages, or other content that can be called up. + * + * To customize the behaviour of a modal * * @name options the lean modal options */ - leanModal(options?: Materialize.LeanModalOptions): JQuery; - - /** - * Open a modal programatically - * - * @name options the lean modal options - */ - openModal(options?: Materialize.LeanModalOptions): void; - - /** - * Close a modal programatically - * - * @name options the lean modal options - */ - closeModal(options?: Materialize.LeanModalOptions): void; + modal(options: Materialize.ModalOptions): void; /** * Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling. @@ -461,12 +533,19 @@ interface JQuery { * * @params methodOrOptions the slide navigation options or a string with "show" to reveal or "hide" to hide the menu */ - sideNav(methodOrOptions?: Materialize.SideNavOptions|string): void; + sideNav(methodOrOptions?: Materialize.SideNavOptions | string): void; /** * Programmatically trigger the tab change event * * @name method, the method to call (always "select_tab") and a param containing the id of the tab to open */ - tabs(method?:string, tab?:string): JQuery; + tabs(method?: string, tab?: string): JQuery; + + /** + * Tab Initialization with options + * + * @name TabOptions options jQuery plugin options + */ + tabs(options?: Materialize.TabOptions): JQuery; } diff --git a/materialize-css/materialize-css-tests.ts b/materialize-css/materialize-css-tests.ts index 15189e1b8f..625d555398 100644 --- a/materialize-css/materialize-css-tests.ts +++ b/materialize-css/materialize-css-tests.ts @@ -22,7 +22,7 @@ $('input#input_text, textarea#textarea1').characterCounter(); // Navbar $(".dropdown-button").dropdown(); -$(".dropdown-button").dropdown({hover: false}); +$(".dropdown-button").dropdown({ hover: false }); $(".button-collapse").sideNav(); @@ -30,22 +30,22 @@ $(".button-collapse").sideNav(); // Collapsible var collapseHtml = '
    ' + - '
  • ' + - '
    filter_dramaFirst
    ' + - '

    Lorem ipsum dolor sit amet.

    ' + - '
  • ' + - '
  • ' + - '
    placeSecond
    ' + - '

    Lorem ipsum dolor sit amet.

    ' + - '
  • ' + - '
  • ' + - '
    whatshotThird
    ' + - '

    Lorem ipsum dolor sit amet.

    ' + - '
  • ' + + '
  • ' + + '
    filter_dramaFirst
    ' + + '

    Lorem ipsum dolor sit amet.

    ' + + '
  • ' + + '
  • ' + + '
    placeSecond
    ' + + '

    Lorem ipsum dolor sit amet.

    ' + + '
  • ' + + '
  • ' + + '
    whatshotThird
    ' + + '

    Lorem ipsum dolor sit amet.

    ' + + '
  • ' + '
'; -$(collapseHtml).collapsible({ accordion : false, onClose : function() { alert('Closed'); } }); -$(collapseHtml).collapsible({ accordion : true, onOpen : function() { alert('Opened'); } }); +$(collapseHtml).collapsible({ accordion: false, onClose: function () { alert('Closed'); } }); +$(collapseHtml).collapsible({ accordion: true, onOpen: function () { alert('Opened'); } }); // Dialogs - Toasts Materialize.toast('I am a toast!', 4000); @@ -57,19 +57,21 @@ Materialize.toast($toastContent, 5000); // Dialogs - Tooltip var tooltipHtml = 'Hover me!'; $(tooltipHtml).tooltip(); -$(tooltipHtml).tooltip({delay: 100}); +$(tooltipHtml).tooltip({ delay: 100 }); $(tooltipHtml).tooltip('remove'); // DropDown var dropDownHtml = 'Drop Me!'; $(dropDownHtml).dropdown({ - inDuration: 300, - outDuration: 225, - constrain_width: false, - hover: true, - gutter: 0, - belowOrigin: false, - alignment: 'left' + inDuration: 300, + outDuration: 225, + constrainWidth: false, // Does not change width of dropdown to that of the activator + hover: true, // Activate on hover + gutter: 0, // Spacing from edge + belowOrigin: false, // Displays dropdown below the button + alignment: 'left', // Displays dropdown with edge aligned to the left of button + stopPropagation: false // Stops event propagation + }); $(dropDownHtml).dropdown({}); @@ -79,136 +81,138 @@ $(materialboxHtml).materialbox(); // Media - slider var sliderHtml = '
' + - '
    ' + - '
  • ' + - ' ' + - '
    ' + - '

    This is our big Tagline!

    ' + - '
    Here\'s our small slogan.
    ' + - '
    ' + - '
  • ' + - '
  • ' + - ' ' + - '
    ' + - '

    Left Aligned Caption

    ' + - '
    Here\'s our small slogan.
    ' + - '
    ' + - '
  • ' + - '
  • ' + - ' ' + - '
    ' + - '

    Right Aligned Caption

    ' + - '
    Here\'s our small slogan.
    ' + - '
    ' + - '
  • ' + - '
  • ' + - ' ' + - '
    ' + - '

    This is our big Tagline!

    ' + - '
    Here\'s our small slogan.
    ' + - '
    ' + - '
  • ' + - '
' + + '
    ' + + '
  • ' + + ' ' + + '
    ' + + '

    This is our big Tagline!

    ' + + '
    Here\'s our small slogan.
    ' + + '
    ' + + '
  • ' + + '
  • ' + + ' ' + + '
    ' + + '

    Left Aligned Caption

    ' + + '
    Here\'s our small slogan.
    ' + + '
    ' + + '
  • ' + + '
  • ' + + ' ' + + '
    ' + + '

    Right Aligned Caption

    ' + + '
    Here\'s our small slogan.
    ' + + '
    ' + + '
  • ' + + '
  • ' + + ' ' + + '
    ' + + '

    This is our big Tagline!

    ' + + '
    Here\'s our small slogan.
    ' + + '
    ' + + '
  • ' + + '
' + '
'; - $(sliderHtml).slider(); - $(sliderHtml).slider({}); - $(sliderHtml).slider({ indicators: true }); - $(sliderHtml).slider({ indicators: true, height: 5 }); - $(sliderHtml).slider({ indicators: true, height: 5, transition: 4 }); - $(sliderHtml).slider({ indicators: true, height: 5, transition: 4, interval: 5 }); +$(sliderHtml).slider(); +$(sliderHtml).slider({}); +$(sliderHtml).slider({ indicators: true }); +$(sliderHtml).slider({ indicators: true, height: 5 }); +$(sliderHtml).slider({ indicators: true, height: 5, transition: 4 }); +$(sliderHtml).slider({ indicators: true, height: 5, transition: 4, interval: 5 }); // Carousel $('.carousel').carousel(); $('.carousel').carousel({}); -$('.carousel').carousel({ time_constant: 200, dist: -100, shift: 500, padding: 6000, full_width: true }); +$('.carousel').carousel({ duration: 200, dist: -100, shift: 500, padding: 6000, fullWidth: true, indicators: false, noWrap: false }); // Next slide $('.carousel').carousel('next'); -$('.carousel').carousel('next', [3]); // Move next n times. +$('.carousel').carousel('next', 3); // Move next n times. // Previous slide $('.carousel').carousel('prev'); -$('.carousel').carousel('prev', [4]); // Move prev n times. +$('.carousel').carousel('prev', 4); // Move prev n times. // Modals var modalhtml = ''; -$(modalhtml).openModal(); -$(modalhtml).closeModal(); +$(modalhtml).modal('open'); +$(modalhtml).modal('close'); var modalTriggerHtml = ''; -$(modalTriggerHtml).leanModal(); -$(modalTriggerHtml).leanModal({}); -$(modalTriggerHtml).leanModal({ dismissible: true }); -$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1 }); -$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100 }); -$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100, out_duration: 100 }); -$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100, out_duration: 100, ready: () => console.log('ready') }); -$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100, out_duration: 100, ready: () => console.log('ready'), complete: () => console.log('complete')}); +$(modalTriggerHtml).modal(); +$(modalTriggerHtml).modal({}); +$(modalTriggerHtml).modal({ dismissible: true }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1 }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100 }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100 }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%" }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%" }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%", ready: () => console.log('ready') }); +$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%", ready: () => console.log('ready'), complete: () => console.log('complete') }); // Parallax var parallaxHtml = '
' + - '
' + - '
'; - $(parallaxHtml).parallax(); + '
' + + ''; +$(parallaxHtml).parallax(); - // PushPin - $('
').pushpin(); - $('
').pushpin({ top: 1 }); - $('
').pushpin({ top: 1, bottom: 1 }); - $('
').pushpin({ top: 1, bottom: 1, offset: 2 }); +// PushPin +$('
').pushpin(); +$('
').pushpin({ top: 1 }); +$('
').pushpin({ top: 1, bottom: 1 }); +$('
').pushpin({ top: 1, bottom: 1, offset: 2 }); // ScrollFire var options = [ - {selector: '.class', offset: 200, callback: 'console.log(".class")' }, - {selector: '.other-class', offset: 200, callback: 'console.log(".other-class")' }, + { selector: '.class', offset: 200, callback: 'console.log(".class")' }, + { selector: '.other-class', offset: 200, callback: 'console.log(".other-class")' }, ]; Materialize.scrollFire(options); // ScrollSpy var scrollSpyHtml = '
' + - '
' + - '
' + - '

Content

' + - '
' + - '
' + - '

Content

' + - '
' + - '
' + - '

Content

' + - '
' + - '
' + - '
' + - '' + - '
' + + '
' + + '
' + + '

Content

' + + '
' + + '
' + + '

Content

' + + '
' + + '
' + + '

Content

' + + '
' + + '
' + + '
' + + '' + + '
' + '
'; $(scrollSpyHtml, ".scrollspy").scrollSpy(); // Side-Nav var sideNavHtml = ''; + ''; $(sideNavHtml).sideNav(); $(sideNavHtml).sideNav({}); $(sideNavHtml).sideNav({ menuWidth: 100 }); @@ -220,22 +224,23 @@ $(sideNavHtml).sideNav("hide"); // Tabs var tabsHtml = '
' + - '
' + - '' + - '
' + - '
Test 1
' + - '
Test 2
' + - '
Test 3
' + - '
Test 4
' + + '
' + + '' + + '
' + + '
Test 1
' + + '
Test 2
' + + '
Test 3
' + + '
Test 4
' + '
'; - $(tabsHtml).tabs(); - $(tabsHtml).tabs('select_tab', 'test1'); +$(tabsHtml).tabs(); +$(tabsHtml).tabs('select_tab', 'test1'); +$(tabsHtml).tabs({ onShow: (currentTab: any) => { console.log(currentTab) }, swipeable: false, responsiveThreshold: 5000 }); // Transitions Materialize.showStaggeredList('#staggered-test'); From 24c5a18d44b9811f74d2a2afb16fe5ade3258d41 Mon Sep 17 00:00:00 2001 From: Sukhdeep Singh Date: Mon, 30 Jan 2017 22:17:52 -0500 Subject: [PATCH 04/33] Chip Javascript plugin usage added --- materialize-css/index.d.ts | 45 +++++++++++++++++++++++- materialize-css/materialize-css-tests.ts | 32 ++++++++++++++++- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/materialize-css/index.d.ts b/materialize-css/index.d.ts index 4d49ac38e7..8b4c610e13 100644 --- a/materialize-css/index.d.ts +++ b/materialize-css/index.d.ts @@ -70,7 +70,7 @@ declare namespace Materialize { */ outDuration?: number; - + /** * If true, constrainWidth to the size of the dropdown activator. * Default: true @@ -343,6 +343,35 @@ declare namespace Materialize { responsiveThreshold?: number; } + interface ChipDataObject { + tag: string, + image?: string, + id?: number + } + + interface ChipOptions { + /** + * Set the chip data + */ + data?: Materialize.ChipDataObject[]; + /** + * Set first placeholder when there are no tags + */ + placeholder?: string; + /** + * Set second placeholder when adding additional tags. + */ + secondaryPlaceholder?: string; + /** + * Set autocomplete data. + */ + autocompleteData?: any; + /** + * Set autocomplete limit. + */ + autocompleteLimit?: number; + } + /** * The Materialize object @@ -548,4 +577,18 @@ interface JQuery { * @name TabOptions options jQuery plugin options */ tabs(options?: Materialize.TabOptions): JQuery; + + /** + * Chip Initialization + * + * @name ChipOptions options Material chip options + */ + material_chip(options?: Materialize.ChipOptions): JQuery; + + /** + * To access chip data + * + * @name string method name of the method to invoke + */ + material_chip(method: string): Materialize.ChipDataObject[] | Materialize.ChipDataObject; } diff --git a/materialize-css/materialize-css-tests.ts b/materialize-css/materialize-css-tests.ts index 625d555398..9c7d7d1ea2 100644 --- a/materialize-css/materialize-css-tests.ts +++ b/materialize-css/materialize-css-tests.ts @@ -245,4 +245,34 @@ $(tabsHtml).tabs({ onShow: (currentTab: any) => { console.log(currentTab) }, swi // Transitions Materialize.showStaggeredList('#staggered-test'); -Materialize.updateTextFields(); \ No newline at end of file +Materialize.updateTextFields(); + +let chipsHTML = '
' + + '
' + + '
' + + '
'; + +$(chipsHTML).material_chip(); +$(chipsHTML).material_chip({ + data: [{ + tag: 'Apple', + }, { + tag: 'Microsoft', + }, { + tag: 'Google', + }], +}); + +$('.chips-placeholder').material_chip({ + placeholder: 'Enter a tag', + secondaryPlaceholder: '+Tag', +}); +$('.chips-autocomplete').material_chip({ + autocompleteData: { + 'Apple': null, + 'Microsoft': null, + 'Google': null + } +}); + +let chipData: Materialize.ChipDataObject | Materialize.ChipDataObject[] = $('.chips-initial').material_chip('data'); \ No newline at end of file From 5aad433978f54c05ed5cfce1e65808829c2329d3 Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Thu, 9 Feb 2017 17:51:38 -0600 Subject: [PATCH 05/33] [cordova_app_version_plugin] new definitions, v1.0 Added cordova_app_version_plugin definitions --- cordova_app_version_plugin/README.md | 8 ++++++ .../cordova_app_version_plugin-tests.ts | 3 +++ cordova_app_version_plugin/index.d.ts | 26 +++++++++++++++++++ cordova_app_version_plugin/tsconfig.json | 23 ++++++++++++++++ 4 files changed, 60 insertions(+) create mode 100644 cordova_app_version_plugin/README.md create mode 100644 cordova_app_version_plugin/cordova_app_version_plugin-tests.ts create mode 100644 cordova_app_version_plugin/index.d.ts create mode 100644 cordova_app_version_plugin/tsconfig.json diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md new file mode 100644 index 0000000000..17e7e72ad3 --- /dev/null +++ b/cordova_app_version_plugin/README.md @@ -0,0 +1,8 @@ +# Installation +> `npm install --save @types/cordova_app_version_plugin` + +# Summary +This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin) + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cordova_app_version_plugin diff --git a/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts new file mode 100644 index 0000000000..5e4eb16e66 --- /dev/null +++ b/cordova_app_version_plugin/cordova_app_version_plugin-tests.ts @@ -0,0 +1,3 @@ +/// + +var appVersion = window.cordova.plugins.version.getAppVersion(); // e.g. "1.5.0" diff --git a/cordova_app_version_plugin/index.d.ts b/cordova_app_version_plugin/index.d.ts new file mode 100644 index 0000000000..b8a70216a6 --- /dev/null +++ b/cordova_app_version_plugin/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for cordova_app_version_plugin v0.2.6 +// Project: https://www.npmjs.com/package/cordova_app_version_plugin +// Definitions by: Larry Bahr +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// +// Licensed under the MIT license. + +interface CordovaPlugins { + /** + * cordova_app_version_plugin interface + */ + version: CordovaAppVersionPlugin.CordovaAppVersionPlugin; +} + +/** + * Keep the type global namespace clean by using a module + */ +declare module CordovaAppVersionPlugin { + interface CordovaAppVersionPlugin { + /** + * App version from config.xml's version (e.g. ) + * @example window.cordova.plugins.version.getAppVersion() // e.g: "1.5.0" + */ + getAppVersion(): string; + } +} \ No newline at end of file diff --git a/cordova_app_version_plugin/tsconfig.json b/cordova_app_version_plugin/tsconfig.json new file mode 100644 index 0000000000..62f656037c --- /dev/null +++ b/cordova_app_version_plugin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "cordova_app_version_plugin-tests.ts" + ] +} \ No newline at end of file From f08afcf32b8f96b21a08207b8f029d2e8ada9643 Mon Sep 17 00:00:00 2001 From: sweetkat Date: Fri, 10 Feb 2017 15:50:53 +1000 Subject: [PATCH 06/33] [react-notification-system] added missing clearNotifications() v0.2.11 --- react-notification-system/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/react-notification-system/index.d.ts b/react-notification-system/index.d.ts index fcf5f41120..bf76875f3a 100644 --- a/react-notification-system/index.d.ts +++ b/react-notification-system/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for React Notification System v0.2.10 +// Type definitions for React Notification System v0.2.11 // Project: https://www.npmjs.com/package/react-notification-system // Definitions by: Giedrius Grabauskas , Deividas Bakanas , Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,6 +12,7 @@ declare namespace NotificationSystem { addNotification(notification: Notification): Notification; removeNotification(notification: Notification): void; removeNotification(uid: number | string): void; + clearNotifications(): void; } export type CallBackFunction = (notification: Notification) => void; From 4bc6697721ed0066ea3eb2f1c108887ec634bbaf Mon Sep 17 00:00:00 2001 From: Ruslan Shashkov Date: Fri, 10 Feb 2017 14:48:54 +0200 Subject: [PATCH 07/33] react-custom-scrollbars added --- react-custom-scrollbars/index.d.ts | 58 +++++++++++++++++++ .../react-custom-scrollbars-tests.tsx | 10 ++++ react-custom-scrollbars/tsconfig.json | 24 ++++++++ 3 files changed, 92 insertions(+) create mode 100644 react-custom-scrollbars/index.d.ts create mode 100644 react-custom-scrollbars/react-custom-scrollbars-tests.tsx create mode 100644 react-custom-scrollbars/tsconfig.json diff --git a/react-custom-scrollbars/index.d.ts b/react-custom-scrollbars/index.d.ts new file mode 100644 index 0000000000..cf9410f81d --- /dev/null +++ b/react-custom-scrollbars/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for react-css-transition-replace 2.0.1 +// Project: https://github.com/malte-wessel/react-custom-scrollbars +// Definitions by: David-LeBlanc-git +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from "react"; + +declare module "react-custom-scrollbars" { + export interface positionValues { + top: number; + left: number; + clientWidth: number; + clientHeight: number; + scrollWidth: number; + scrollHeight: number; + scrollLeft: number; + scrollTop: number; + } + + export interface ScrollbarProps extends React.HTMLProps { + onScroll?: React.UIEventHandler; + onScrollFrame?: (values: positionValues) => void; + onScrollStart?: () => void; + onScrollStop?: () => void; + onUpdate?: (values: positionValues) => void; + + renderView?: React.StatelessComponent; + renderTrackHorizontal?: React.StatelessComponent; + renderTrackVertical?: React.StatelessComponent; + renderThumbHorizontal?: React.StatelessComponent; + renderThumbVertical?: React.StatelessComponent; + + autoHide?: boolean; + autoHideTimeout?: number; + autoHideDuration?: number; + + thumbSize?: number; + thumbMinSize?: number; + universal?: boolean; + } + + export default class Scrollbars extends React.Component { + scrollTop(top: number): void; + scrollLeft(left: number): void; + scrollToTop(): void; + scrollToBottom(): void; + scrollToLeft(): void; + scrollToRight(): void; + getScrollLeft(): number; + getScrollTop(): number; + getScrollWidth(): number; + getScrollHeight(): number; + getWidth(): number; + getHeight(): number; + getValues(): positionValues; + } +} \ No newline at end of file diff --git a/react-custom-scrollbars/react-custom-scrollbars-tests.tsx b/react-custom-scrollbars/react-custom-scrollbars-tests.tsx new file mode 100644 index 0000000000..240061eada --- /dev/null +++ b/react-custom-scrollbars/react-custom-scrollbars-tests.tsx @@ -0,0 +1,10 @@ +import * as React from "react" +import { render } from 'react-dom'; +import Scrollbars from "react-custom-scrollbars" + +render( + +
Test
+
, + document.getElementById("main") +) diff --git a/react-custom-scrollbars/tsconfig.json b/react-custom-scrollbars/tsconfig.json new file mode 100644 index 0000000000..0b25f24bde --- /dev/null +++ b/react-custom-scrollbars/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-custom-scrollbars-tests.tsx" + ] +} \ No newline at end of file From df42ce87e9094053d38d1cca5b1ec95f86c5b5d6 Mon Sep 17 00:00:00 2001 From: Saqib Rokadia Date: Fri, 10 Feb 2017 13:08:45 -0800 Subject: [PATCH 08/33] Clean up based on tsc errors, and add dependencies for auth0-js. --- auth0-js/auth0-js-tests.ts | 2 +- auth0-js/index.d.ts | 6 +++--- auth0-js/tsconfig.json | 2 +- auth0-js/v7/auth0-js-tests.ts | 3 ++- auth0-js/v7/index.d.ts | 14 +++++++------- auth0-js/v7/tsconfig.json | 9 ++++----- auth0-lock/auth0-lock-tests.ts | 4 ++-- auth0-lock/package.json | 5 +++++ auth0-lock/tsconfig.json | 2 +- auth0.widget/auth0.widget-tests.ts | 3 +-- auth0.widget/index.d.ts | 1 - auth0.widget/package.json | 5 +++++ auth0.widget/tsconfig.json | 2 +- 13 files changed, 33 insertions(+), 25 deletions(-) create mode 100644 auth0-lock/package.json create mode 100644 auth0.widget/package.json diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts index 68d4e1797b..7c910d1765 100644 --- a/auth0-js/auth0-js-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -1,4 +1,4 @@ -/// +import 'auth0-js'; let webAuth = new auth0.WebAuth({ domain: 'mine.auth0.com', diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 0a0e004303..11cf16a3ed 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js v8.1.3 +// Type definitions for Auth0.js 8.1 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -409,7 +409,7 @@ declare namespace auth0 { interface Auth0Error { error: any; - errorDescription: string + errorDescription: string; } interface Auth0DecodedHash { @@ -442,7 +442,7 @@ declare namespace auth0 { connection: string; send: string; phoneNumber?: string; - email?: string, + email?: string; authParams?: any; } diff --git a/auth0-js/tsconfig.json b/auth0-js/tsconfig.json index a2e16e19e0..62bab1e208 100644 --- a/auth0-js/tsconfig.json +++ b/auth0-js/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "auth0-js-tests.ts" ] -} \ No newline at end of file +} diff --git a/auth0-js/v7/auth0-js-tests.ts b/auth0-js/v7/auth0-js-tests.ts index d5ca0250d4..a68b17cb69 100644 --- a/auth0-js/v7/auth0-js-tests.ts +++ b/auth0-js/v7/auth0-js-tests.ts @@ -1,4 +1,5 @@ -/// +import 'auth0-js'; + var auth0 = new Auth0({ domain: 'mine.auth0.com', clientID: 'dsa7d77dsa7d7', diff --git a/auth0-js/v7/index.d.ts b/auth0-js/v7/index.d.ts index ee834d5c61..a93e979f2b 100644 --- a/auth0-js/v7/index.d.ts +++ b/auth0-js/v7/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js v7.x +// Type definitions for Auth0.js 7.0 // Project: https://github.com/auth0/auth0.js // Definitions by: Robert McLaws // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,20 +13,20 @@ interface Window { interface Auth0Static { new(options: Auth0ClientOptions): Auth0Static; - changePassword(options: any, callback?: Function): void; + changePassword(options: any, callback?: (error?: Auth0Error, valid?: any) => void): void; decodeJwt(jwt: string): any; login(options: any, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void; loginWithPopup(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void; loginWithResourceOwner(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: any) => any): void; loginWithUsernamePassword(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void; logout(query: string): void; - getConnections(callback?: Function): void; + getConnections(callback?: (error?: Auth0Error, valid?: any) => void): void; refreshToken(refreshToken: string, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; getDelegationToken(options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void; - getProfile(id_token: string, callback?: Function): Auth0UserProfile; - getSSOData(withActiveDirectories: any, callback?: Function): void; + getProfile(id_token: string, callback?: (error?: Auth0Error, valid?: any) => void): Auth0UserProfile; + getSSOData(withActiveDirectories: any, callback?: (error?: Auth0Error, valid?: any) => void): void; parseHash(hash: string): Auth0DecodedHash; - signup(options: Auth0SignupOptions, callback: Function): void; + signup(options: Auth0SignupOptions, callback: (error?: Auth0Error, valid?: any) => void): void; validateUser(options: any, callback: (error?: Auth0Error, valid?: any) => any): void; } @@ -132,5 +132,5 @@ interface Auth0DelegationToken { declare const Auth0: Auth0Static; declare module "auth0-js" { - export = Auth0 + export = Auth0; } diff --git a/auth0-js/v7/tsconfig.json b/auth0-js/v7/tsconfig.json index 7413e97f44..bdabf7ef7f 100644 --- a/auth0-js/v7/tsconfig.json +++ b/auth0-js/v7/tsconfig.json @@ -12,12 +12,11 @@ "typeRoots": [ "../../" ], - "paths": { - "auth0-js": [ - "auth0-js/v7" - ] - }, "types": [], + "paths": { + "auth0-js": ["auth0-js/v7"], + "auth0-js/*": ["auth0-js/v7/*"] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/auth0-lock/auth0-lock-tests.ts b/auth0-lock/auth0-lock-tests.ts index 4b72edcfa1..8045386586 100644 --- a/auth0-lock/auth0-lock-tests.ts +++ b/auth0-lock/auth0-lock-tests.ts @@ -1,5 +1,5 @@ -/// -/// +import 'auth0-js/v7'; +import Auth0Lock from 'auth0-lock'; const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID"; const DOMAIN = "YOUR_DOMAIN_AT.auth0.com"; diff --git a/auth0-lock/package.json b/auth0-lock/package.json new file mode 100644 index 0000000000..2d730992af --- /dev/null +++ b/auth0-lock/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@types/auth0-js": "latest" + } +} diff --git a/auth0-lock/tsconfig.json b/auth0-lock/tsconfig.json index 367445041e..09c9f8233c 100644 --- a/auth0-lock/tsconfig.json +++ b/auth0-lock/tsconfig.json @@ -20,4 +20,4 @@ "index.d.ts", "auth0-lock-tests.ts" ] -} \ No newline at end of file +} diff --git a/auth0.widget/auth0.widget-tests.ts b/auth0.widget/auth0.widget-tests.ts index 6277d4cc3a..f2ddda2146 100644 --- a/auth0.widget/auth0.widget-tests.ts +++ b/auth0.widget/auth0.widget-tests.ts @@ -1,5 +1,4 @@ -/// - +import 'auth0-js/v7'; var widget: Auth0WidgetStatic = new Auth0Widget({ domain: 'mine.auth0.com', diff --git a/auth0.widget/index.d.ts b/auth0.widget/index.d.ts index cdefd9e0fd..36d99c9009 100644 --- a/auth0.widget/index.d.ts +++ b/auth0.widget/index.d.ts @@ -5,7 +5,6 @@ /// - interface Auth0WidgetStatic { new(params: Auth0Constructor): Auth0WidgetStatic; diff --git a/auth0.widget/package.json b/auth0.widget/package.json new file mode 100644 index 0000000000..2d730992af --- /dev/null +++ b/auth0.widget/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@types/auth0-js": "latest" + } +} diff --git a/auth0.widget/tsconfig.json b/auth0.widget/tsconfig.json index 7bba7e763f..8ceb7b3d73 100644 --- a/auth0.widget/tsconfig.json +++ b/auth0.widget/tsconfig.json @@ -19,4 +19,4 @@ "index.d.ts", "auth0.widget-tests.ts" ] -} \ No newline at end of file +} From 255287863032d944257e5ecb38ac20a8d0da412e Mon Sep 17 00:00:00 2001 From: Larry Bahr Date: Fri, 10 Feb 2017 15:36:25 -0600 Subject: [PATCH 09/33] --save changed to --save-dev --save changed to --save-dev as requested by aozgaa --- cordova_app_version_plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cordova_app_version_plugin/README.md b/cordova_app_version_plugin/README.md index 17e7e72ad3..a12ccb5267 100644 --- a/cordova_app_version_plugin/README.md +++ b/cordova_app_version_plugin/README.md @@ -1,5 +1,5 @@ # Installation -> `npm install --save @types/cordova_app_version_plugin` +> `npm install --save-dev @types/cordova_app_version_plugin` # Summary This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin) From 56826fe3d177bd37a6395a481aa3611de3da123e Mon Sep 17 00:00:00 2001 From: Ken Howard Date: Fri, 10 Feb 2017 16:24:43 -0800 Subject: [PATCH 10/33] allow arguments passed to controller constructor --- hapi-decorators/hapi-decorators-tests.ts | 15 +++++++++++++++ hapi-decorators/index.d.ts | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hapi-decorators/hapi-decorators-tests.ts b/hapi-decorators/hapi-decorators-tests.ts index 2a05f67e4d..49a112152a 100644 --- a/hapi-decorators/hapi-decorators-tests.ts +++ b/hapi-decorators/hapi-decorators-tests.ts @@ -39,3 +39,18 @@ class TestController implements Controller { const server = new hapi.Server(); server.route(new TestController().routes()); + +@controller('/test') +class SimpleTestController implements Controller { + + foo: string; + + constructor(foo: string) { + this.foo = foo; + } + + baseUrl: string; + routes: () => hapi.IRouteConfiguration[]; +} + +server.route(new SimpleTestController('bar').routes()); diff --git a/hapi-decorators/index.d.ts b/hapi-decorators/index.d.ts index c58a1a6052..fc32ae8ad5 100644 --- a/hapi-decorators/index.d.ts +++ b/hapi-decorators/index.d.ts @@ -5,7 +5,7 @@ import * as hapi from 'hapi'; interface ControllerStatic { - new (): Controller; + new (...args: any[]): Controller; } export interface Controller { baseUrl: string; From c75e250a935d0dfdbd4834f27a2de65d6239e176 Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Sat, 11 Feb 2017 23:57:30 -0500 Subject: [PATCH 11/33] Remove old files --- angularjs/angular-component-router.d.ts | 482 ------ angularjs/angular.d.ts | 1915 ----------------------- 2 files changed, 2397 deletions(-) delete mode 100644 angularjs/angular-component-router.d.ts delete mode 100644 angularjs/angular.d.ts diff --git a/angularjs/angular-component-router.d.ts b/angularjs/angular-component-router.d.ts deleted file mode 100644 index 3b037b58b1..0000000000 --- a/angularjs/angular-component-router.d.ts +++ /dev/null @@ -1,482 +0,0 @@ -// Type definitions for Angular JS 1.5 component router -// Project: http://angularjs.org -// Definitions by: David Reher -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - -declare namespace angular { - /** - * `Instruction` is a tree of {@link ComponentInstruction}s with all the information needed - * to transition each component in the app to a given route, including all auxiliary routes. - * - * `Instruction`s can be created using {@link Router#generate}, and can be used to - * perform route changes with {@link Router#navigateByInstruction}. - * - * ### Example - * - * ``` - * import {Component} from 'angular2/core'; - * import {bootstrap} from 'angular2/platform/browser'; - * import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from 'angular2/router'; - * - * @Component({directives: [ROUTER_DIRECTIVES]}) - * @RouteConfig([ - * {...}, - * ]) - * class AppCmp { - * constructor(router: Router) { - * var instruction = router.generate(['/MyRoute']); - * router.navigateByInstruction(instruction); - * } - * } - * - * bootstrap(AppCmp, ROUTER_PROVIDERS); - * ``` - */ - interface Instruction { - component: ComponentInstruction; - child: Instruction; - auxInstruction: {[key: string]: Instruction}; - - urlPath(): string; - - urlParams(): string[]; - - specificity(): number; - - resolveComponent(): IPromise; - - /** - * converts the instruction into a URL string - */ - toRootUrl(): string; - - toUrlQuery(): string; - - /** - * Returns a new instruction that shares the state of the existing instruction, but with - * the given child {@link Instruction} replacing the existing child. - */ - replaceChild(child: Instruction): Instruction; - - /** - * If the final URL for the instruction is `` - */ - toUrlPath(): string; - - /** - * default instructions override these - */ - toLinkUrl(): string; - } - - /** - * A router outlet is a placeholder that Angular dynamically fills based on the application's route. - * - * ## Use - * - * ``` - * - * ``` - */ - interface RouterOutlet { - name: string; - - /** - * Called by the Router to instantiate a new component during the commit phase of a navigation. - * This method in turn is responsible for calling the `routerOnActivate` hook of its child. - */ - activate(nextInstruction: ComponentInstruction): IPromise; - - /** - * Called by the {@link Router} during the commit phase of a navigation when an outlet - * reuses a component between different routes. - * This method in turn is responsible for calling the `routerOnReuse` hook of its child. - */ - reuse(nextInstruction: ComponentInstruction): IPromise; - - /** - * Called by the {@link Router} when an outlet disposes of a component's contents. - * This method in turn is responsible for calling the `routerOnDeactivate` hook of its child. - */ - deactivate(nextInstruction: ComponentInstruction): IPromise; - - /** - * Called by the {@link Router} during recognition phase of a navigation. - * - * If this resolves to `false`, the given navigation is cancelled. - * - * This method delegates to the child component's `routerCanDeactivate` hook if it exists, - * and otherwise resolves to true. - */ - routerCanDeactivate(nextInstruction: ComponentInstruction): IPromise; - - /** - * Called by the {@link Router} during recognition phase of a navigation. - * - * If the new child component has a different Type than the existing child component, - * this will resolve to `false`. You can't reuse an old component when the new component - * is of a different Type. - * - * Otherwise, this method delegates to the child component's `routerCanReuse` hook if it exists, - * or resolves to true if the hook is not present. - */ - routerCanReuse(nextInstruction: ComponentInstruction): IPromise; - } - - interface RouteRegistry { - /** - * Given a component and a configuration object, add the route to this registry - */ - config(parentComponent: any, config: RouteDefinition): void; - - /** - * Reads the annotations of a component and configures the registry based on them - */ - configFromComponent(component: any): void; - - /** - * Given a URL and a parent component, return the most specific instruction for navigating - * the application into the state specified by the url - */ - recognize(url: string, ancestorInstructions: Instruction[]): IPromise; - - /** - * Given a normalized list with component names and params like: `['user', {id: 3 }]` - * generates a url with a leading slash relative to the provided `parentComponent`. - * - * If the optional param `_aux` is `true`, then we generate starting at an auxiliary - * route boundary. - */ - generate(linkParams: any[], ancestorInstructions: Instruction[], _aux?: boolean): Instruction; - - hasRoute(name: string, parentComponent: any): boolean; - - generateDefault(componentCursor: any): Instruction; - } - - /** - * The `Router` is responsible for mapping URLs to components. - * - * You can see the state of the router by inspecting the read-only field `router.navigating`. - * This may be useful for showing a spinner, for instance. - * - * ## Concepts - * - * Routers and component instances have a 1:1 correspondence. - * - * The router holds reference to a number of {@link RouterOutlet}. - * An outlet is a placeholder that the router dynamically fills in depending on the current URL. - * - * When the router navigates from a URL, it must first recognize it and serialize it into an - * `Instruction`. - * The router uses the `RouteRegistry` to get an `Instruction`. - */ - interface Router { - navigating: boolean; - lastNavigationAttempt: string; - registry: RouteRegistry; - parent: Router; - hostComponent: any; - - /** - * Constructs a child router. You probably don't need to use this unless you're writing a reusable - * component. - */ - childRouter(hostComponent: any): Router; - - /** - * Constructs a child router. You probably don't need to use this unless you're writing a reusable - * component. - */ - auxRouter(hostComponent: any): Router; - - /** - * Register an outlet to be notified of primary route changes. - * - * You probably don't need to use this unless you're writing a reusable component. - */ - registerPrimaryOutlet(outlet: RouterOutlet): IPromise; - - /** - * Register an outlet to notified of auxiliary route changes. - * - * You probably don't need to use this unless you're writing a reusable component. - */ - registerAuxOutlet(outlet: RouterOutlet): IPromise; - - /** - * Given an instruction, returns `true` if the instruction is currently active, - * otherwise `false`. - */ - isRouteActive(instruction: Instruction): boolean; - - /** - * Dynamically update the routing configuration and trigger a navigation. - * - * ### Usage - * - * ``` - * router.config([ - * { 'path': '/', 'component': IndexComp }, - * { 'path': '/user/:id', 'component': UserComp }, - * ]); - * ``` - */ - config(definitions: RouteDefinition[]): IPromise; - - /** - * Navigate based on the provided Route Link DSL. It's preferred to navigate with this method - * over `navigateByUrl`. - * - * ### Usage - * - * This method takes an array representing the Route Link DSL: - * ``` - * ['./MyCmp', {param: 3}] - * ``` - * See the {@link RouterLink} directive for more. - */ - navigate(linkParams: any[]): IPromise; - - /** - * Navigate to a URL. Returns a promise that resolves when navigation is complete. - * It's preferred to navigate with `navigate` instead of this method, since URLs are more brittle. - * - * If the given URL begins with a `/`, router will navigate absolutely. - * If the given URL does not begin with `/`, the router will navigate relative to this component. - */ - navigateByUrl(url: string, _skipLocationChange?: boolean): IPromise; - - /** - * Navigate via the provided instruction. Returns a promise that resolves when navigation is - * complete. - */ - navigateByInstruction(instruction: Instruction, - _skipLocationChange?: boolean): IPromise; - - /** - * Updates this router and all descendant routers according to the given instruction - */ - commit(instruction: Instruction, _skipLocationChange?: boolean): IPromise; - - /** - * Subscribe to URL updates from the router - */ - subscribe(onNext: (value: any) => void): Object; - - /** - * Removes the contents of this router's outlet and all descendant outlets - */ - deactivate(instruction: Instruction): IPromise; - - /** - * Given a URL, returns an instruction representing the component graph - */ - recognize(url: string): IPromise; - - /** - * Navigates to either the last URL successfully navigated to, or the last URL requested if the - * router has yet to successfully navigate. - */ - renavigate(): IPromise; - - /** - * Generate an `Instruction` based on the provided Route Link DSL. - */ - generate(linkParams: any[]): Instruction; - } - - /** - * RouteData is an immutable map of additional data you can configure in your Route. - * You can inject RouteData into the constructor of a component to use it. - */ - interface RouteData { - data: {[key: string]: any}; - get(key: string): any; - } - - /** - * A `ComponentInstruction` represents the route state for a single component. An `Instruction` is - * composed of a tree of these `ComponentInstruction`s. - * - * `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed - * to route lifecycle hooks, like {@link CanActivate}. - * - * `ComponentInstruction`s are [https://en.wikipedia.org/wiki/Hash_consing](hash consed). You should - * never construct one yourself with "new." Instead, rely on {@link Router/RouteRecognizer} to - * construct `ComponentInstruction`s. - * - * You should not modify this object. It should be treated as immutable. - */ - interface ComponentInstruction { - reuse: boolean; - routeData: RouteData; - urlPath: string; - urlParams: string[]; - data: RouteData; - componentType: any; - terminal: boolean; - specificity: number; - params: {[key: string]: any}; - } - - /** - * Defines route lifecycle method `routerOnActivate`, which is called by the router at the end of a - * successful route navigation. - * - * For a single component's navigation, only one of either {@link OnActivate} or {@link OnReuse} - * will be called depending on the result of {@link CanReuse}. - * - * The `routerOnActivate` hook is called with two {@link ComponentInstruction}s as parameters, the - * first - * representing the current route being navigated to, and the second parameter representing the - * previous route or `null`. - * - * If `routerOnActivate` returns a promise, the route change will wait until the promise settles to - * instantiate and activate child components. - * - * ### Example - * {@example router/ts/on_activate/on_activate_example.ts region='routerOnActivate'} - */ - interface OnActivate { - $routerOnActivate(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; - } - - /** - * Defines route lifecycle method `routerCanDeactivate`, which is called by the router to determine - * if a component can be removed as part of a navigation. - * - * The `routerCanDeactivate` hook is called with two {@link ComponentInstruction}s as parameters, - * the - * first representing the current route being navigated to, and the second parameter - * representing the previous route. - * - * If `routerCanDeactivate` returns or resolves to `false`, the navigation is cancelled. If it - * returns or - * resolves to `true`, then the navigation continues, and the component will be deactivated - * (the {@link OnDeactivate} hook will be run) and removed. - * - * If `routerCanDeactivate` throws or rejects, the navigation is also cancelled. - * - * ### Example - * {@example router/ts/can_deactivate/can_deactivate_example.ts region='routerCanDeactivate'} - */ - interface CanDeactivate { - $routerCanDeactivate(next?: ComponentInstruction, prev?: ComponentInstruction): boolean | IPromise; - } - - /** - * Defines route lifecycle method `routerOnDeactivate`, which is called by the router before - * destroying - * a component as part of a route change. - * - * The `routerOnDeactivate` hook is called with two {@link ComponentInstruction}s as parameters, the - * first - * representing the current route being navigated to, and the second parameter representing the - * previous route. - * - * If `routerOnDeactivate` returns a promise, the route change will wait until the promise settles. - * - * ### Example - * {@example router/ts/on_deactivate/on_deactivate_example.ts region='routerOnDeactivate'} - */ - interface OnDeactivate { - $routerOnDeactivate(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; - } - - /** - * Defines route lifecycle method `routerCanReuse`, which is called by the router to determine - * whether a - * component should be reused across routes, or whether to destroy and instantiate a new component. - * - * The `routerCanReuse` hook is called with two {@link ComponentInstruction}s as parameters, the - * first - * representing the current route being navigated to, and the second parameter representing the - * previous route. - * - * If `routerCanReuse` returns or resolves to `true`, the component instance will be reused and the - * {@link OnDeactivate} hook will be run. If `routerCanReuse` returns or resolves to `false`, a new - * component will be instantiated, and the existing component will be deactivated and removed as - * part of the navigation. - * - * If `routerCanReuse` throws or rejects, the navigation will be cancelled. - * - * ### Example - * {@example router/ts/reuse/reuse_example.ts region='reuseCmp'} - */ - interface CanReuse { - $routerCanReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): boolean | IPromise; - } - - /** - * Defines route lifecycle method `routerOnReuse`, which is called by the router at the end of a - * successful route navigation when {@link CanReuse} is implemented and returns or resolves to true. - * - * For a single component's navigation, only one of either {@link OnActivate} or {@link OnReuse} - * will be called, depending on the result of {@link CanReuse}. - * - * The `routerOnReuse` hook is called with two {@link ComponentInstruction}s as parameters, the - * first - * representing the current route being navigated to, and the second parameter representing the - * previous route or `null`. - * - * ### Example - * {@example router/ts/reuse/reuse_example.ts region='reuseCmp'} - */ - interface OnReuse { - $routerOnReuse(next?: angular.ComponentInstruction, prev?: angular.ComponentInstruction): any; - } - - /** - * Runtime representation a type that a Component or other object is instances of. - * - * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by - * the `MyCustomComponent` constructor function. - */ - interface Type extends Function { - } - - /** - * `RouteDefinition` defines a route within a {@link RouteConfig} decorator. - * - * Supported keys: - * - `path` or `aux` (requires exactly one of these) - * - `component`, `loader`, `redirectTo` (requires exactly one of these) - * - `name` or `as` (optional) (requires exactly one of these) - * - `data` (optional) - * - * See also {@link Route}, {@link AsyncRoute}, {@link AuxRoute}, and {@link Redirect}. - */ - interface RouteDefinition { - path?: string; - aux?: string; - component?: Type | ComponentDefinition | string; - loader?: Function; - redirectTo?: any[]; - as?: string; - name?: string; - data?: any; - useAsDefault?: boolean; - } - - /** - * Represents either a component type (`type` is `component`) or a loader function - * (`type` is `loader`). - * - * See also {@link RouteDefinition}. - */ - interface ComponentDefinition { - type: string; - loader?: Function; - component?: Type; - } - - // Supplement IComponentOptions from angular.d.ts with router-specific - // fields. - interface IComponentOptions { - $canActivate?: () => boolean; - $routeConfig?: RouteDefinition[]; - } -} diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts deleted file mode 100644 index 983c0ca799..0000000000 --- a/angularjs/angular.d.ts +++ /dev/null @@ -1,1915 +0,0 @@ -// Type definitions for Angular JS 1.5 -// Project: http://angularjs.org -// Definitions by: Diego Vilar -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -/// - -declare var angular: angular.IAngularStatic; - -// Support for painless dependency injection -interface Function { - $inject?: string[]; -} - -// Collapse angular into ng -import ng = angular; -// Support AMD require -declare module 'angular' { - export = angular; -} - -/////////////////////////////////////////////////////////////////////////////// -// ng module (angular.js) -/////////////////////////////////////////////////////////////////////////////// -declare namespace angular { - - // not directly implemented, but ensures that constructed class implements $get - interface IServiceProviderClass { - new (...args: any[]): IServiceProvider; - } - - interface IServiceProviderFactory { - (...args: any[]): IServiceProvider; - } - - // All service providers extend this interface - interface IServiceProvider { - $get: any; - } - - interface IAngularBootstrapConfig { - strictDi?: boolean; - debugInfoEnabled?: boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // AngularStatic - // see http://docs.angularjs.org/api - /////////////////////////////////////////////////////////////////////////// - interface IAngularStatic { - bind(context: any, fn: Function, ...args: any[]): Function; - - /** - * Use this function to manually start up angular application. - * - * @param element DOM element which is the root of angular application. - * @param modules An array of modules to load into the application. - * Each item in the array should be the name of a predefined module or a (DI annotated) - * function that will be invoked by the injector as a config block. - * @param config an object for defining configuration options for the application. The following keys are supported: - * - `strictDi`: disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. - */ - bootstrap(element: string|Element|JQuery|Document, modules?: (string|Function|any[])[], config?: IAngularBootstrapConfig): auto.IInjectorService; - - /** - * Creates a deep copy of source, which should be an object or an array. - * - * - If no destination is supplied, a copy of the object or array is created. - * - If a destination is provided, all of its elements (for array) or properties (for objects) are deleted and then all elements/properties from the source are copied to it. - * - If source is not an object or array (inc. null and undefined), source is returned. - * - If source is identical to 'destination' an exception will be thrown. - * - * @param source The source that will be used to make a copy. Can be any type, including primitives, null, and undefined. - * @param destination Destination into which the source is copied. If provided, must be of the same type as source. - */ - copy(source: T, destination?: T): T; - - /** - * Wraps a raw DOM element or HTML string as a jQuery element. - * - * If jQuery is available, angular.element is an alias for the jQuery function. If jQuery is not available, angular.element delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite." - */ - element: IAugmentedJQueryStatic; - equals(value1: any, value2: any): boolean; - extend(destination: any, ...sources: any[]): any; - - /** - * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. - * - * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. - * - * @param obj Object to iterate over. - * @param iterator Iterator function. - * @param context Object to become context (this) for the iterator function. - */ - forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any; - /** - * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. - * - * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. - * - * @param obj Object to iterate over. - * @param iterator Iterator function. - * @param context Object to become context (this) for the iterator function. - */ - forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any; - /** - * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. - * - * It is worth noting that .forEach does not iterate over inherited properties because it filters using the hasOwnProperty method. - * - * @param obj Object to iterate over. - * @param iterator Iterator function. - * @param context Object to become context (this) for the iterator function. - */ - forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any; - - fromJson(json: string): any; - identity(arg?: T): T; - injector(modules?: any[], strictDi?: boolean): auto.IInjectorService; - isArray(value: any): boolean; - isDate(value: any): boolean; - isDefined(value: any): boolean; - isElement(value: any): boolean; - isFunction(value: any): boolean; - isNumber(value: any): boolean; - isObject(value: any): boolean; - isString(value: any): boolean; - isUndefined(value: any): boolean; - lowercase(str: string): string; - - /** - * Deeply extends the destination object dst by copying own enumerable properties from the src object(s) to dst. You can specify multiple src objects. If you want to preserve original objects, you can do so by passing an empty object as the target: var object = angular.merge({}, object1, object2). - * - * Unlike extend(), merge() recursively descends into object properties of source objects, performing a deep copy. - * - * @param dst Destination object. - * @param src Source object(s). - */ - merge(dst: any, ...src: any[]): any; - - /** - * The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism. - * - * When passed two or more arguments, a new module is created. If passed only one argument, an existing module (the name passed as the first argument to module) is retrieved. - * - * @param name The name of the module to create or retrieve. - * @param requires The names of modules this module depends on. If specified then new module is being created. If unspecified then the module is being retrieved for further configuration. - * @param configFn Optional configuration function for the module. - */ - module( - name: string, - requires?: string[], - configFn?: Function): IModule; - - noop(...args: any[]): void; - reloadWithDebugInfo(): void; - toJson(obj: any, pretty?: boolean): string; - uppercase(str: string): string; - version: { - full: string; - major: number; - minor: number; - dot: number; - codeName: string; - }; - - /** - * If window.name contains prefix NG_DEFER_BOOTSTRAP! when angular.bootstrap is called, the bootstrap process will be paused until angular.resumeBootstrap() is called. - * @param extraModules An optional array of modules that should be added to the original list of modules that the app was about to be bootstrapped with. - */ - resumeBootstrap?(extraModules?: string[]): ng.auto.IInjectorService; - } - - /////////////////////////////////////////////////////////////////////////// - // Module - // see http://docs.angularjs.org/api/angular.Module - /////////////////////////////////////////////////////////////////////////// - interface IModule { - /** - * Use this method to register a component. - * - * @param name The name of the component. - * @param options A definition object passed into the component. - */ - component(name: string, options: IComponentOptions): IModule; - /** - * Use this method to register work which needs to be performed on module loading. - * - * @param configFn Execute this function on module load. Useful for service configuration. - */ - config(configFn: Function): IModule; - /** - * Use this method to register work which needs to be performed on module loading. - * - * @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration. - */ - config(inlineAnnotatedFunction: any[]): IModule; - config(object: Object): IModule; - /** - * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. - * - * @param name The name of the constant. - * @param value The constant value. - */ - constant(name: string, value: T): IModule; - constant(object: Object): IModule; - /** - * The $controller service is used by Angular to create new controllers. - * - * This provider allows controller registration via the register method. - * - * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. - * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). - */ - controller(name: string, controllerConstructor: Function): IModule; - /** - * The $controller service is used by Angular to create new controllers. - * - * This provider allows controller registration via the register method. - * - * @param name Controller name, or an object map of controllers where the keys are the names and the values are the constructors. - * @param controllerConstructor Controller constructor fn (optionally decorated with DI annotations in the array notation). - */ - controller(name: string, inlineAnnotatedConstructor: any[]): IModule; - controller(object: Object): IModule; - /** - * Register a new directive with the compiler. - * - * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) - * @param directiveFactory An injectable directive factory function. - */ - directive(name: string, directiveFactory: IDirectiveFactory): IModule; - /** - * Register a new directive with the compiler. - * - * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) - * @param directiveFactory An injectable directive factory function. - */ - directive(name: string, inlineAnnotatedFunction: any[]): IModule; - directive(object: Object): IModule; - /** - * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. - * - * @param name The name of the instance. - * @param $getFn The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). - */ - factory(name: string, $getFn: Function): IModule; - /** - * Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider. - * - * @param name The name of the instance. - * @param inlineAnnotatedFunction The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}). - */ - factory(name: string, inlineAnnotatedFunction: any[]): IModule; - factory(object: Object): IModule; - filter(name: string, filterFactoryFunction: Function): IModule; - filter(name: string, inlineAnnotatedFunction: any[]): IModule; - filter(object: Object): IModule; - provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule; - provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule; - provider(name: string, inlineAnnotatedConstructor: any[]): IModule; - provider(name: string, providerObject: IServiceProvider): IModule; - provider(object: Object): IModule; - /** - * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. - */ - run(initializationFunction: Function): IModule; - /** - * Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the service have been configured and the injector has been created. Run blocks typically contain code which is hard to unit-test, and for this reason should be declared in isolated modules, so that they can be ignored in the unit-tests. - */ - run(inlineAnnotatedFunction: any[]): IModule; - /** - * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. - * - * @param name The name of the instance. - * @param serviceConstructor An injectable class (constructor function) that will be instantiated. - */ - service(name: string, serviceConstructor: Function): IModule; - /** - * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. - * - * @param name The name of the instance. - * @param inlineAnnotatedConstructor An injectable class (constructor function) that will be instantiated. - */ - service(name: string, inlineAnnotatedConstructor: any[]): IModule; - service(object: Object): IModule; - /** - * Register a value service with the $injector, such as a string, a number, an array, an object or a function. This is short for registering a service where its provider's $get property is a factory function that takes no arguments and returns the value service. - - Value services are similar to constant services, except that they cannot be injected into a module configuration function (see config) but they can be overridden by an Angular decorator. - * - * @param name The name of the instance. - * @param value The value. - */ - value(name: string, value: T): IModule; - value(object: Object): IModule; - - /** - * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. - * @param name The name of the service to decorate - * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. - */ - decorator(name:string, decoratorConstructor: Function): IModule; - decorator(name:string, inlineAnnotatedConstructor: any[]): IModule; - - // Properties - name: string; - requires: string[]; - } - - /////////////////////////////////////////////////////////////////////////// - // Attributes - // see http://docs.angularjs.org/api/ng.$compile.directive.Attributes - /////////////////////////////////////////////////////////////////////////// - interface IAttributes { - /** - * this is necessary to be able to access the scoped attributes. it's not very elegant - * because you have to use attrs['foo'] instead of attrs.foo but I don't know of a better way - * this should really be limited to return string but it creates this problem: http://stackoverflow.com/q/17201854/165656 - */ - [name: string]: any; - - /** - * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with x- or data-) to its normalized, camelCase form. - * - * Also there is special case for Moz prefix starting with upper case letter. - * - * For further information check out the guide on @see https://docs.angularjs.org/guide/directive#matching-directives - */ - $normalize(name: string): string; - - /** - * Adds the CSS class value specified by the classVal parameter to the - * element. If animations are enabled then an animation will be triggered - * for the class addition. - */ - $addClass(classVal: string): void; - - /** - * Removes the CSS class value specified by the classVal parameter from the - * element. If animations are enabled then an animation will be triggered for - * the class removal. - */ - $removeClass(classVal: string): void; - - /** - * Adds and removes the appropriate CSS class values to the element based on the difference between - * the new and old CSS class values (specified as newClasses and oldClasses). - */ - $updateClass(newClasses: string, oldClasses: string): void; - - /** - * Set DOM element attribute value. - */ - $set(key: string, value: any): void; - - /** - * Observes an interpolated attribute. - * The observer function will be invoked once during the next $digest - * following compilation. The observer is then invoked whenever the - * interpolated value changes. - */ - $observe(name: string, fn: (value?: T) => any): Function; - - /** - * A map of DOM element attribute names to the normalized name. This is needed - * to do reverse lookup from normalized name back to actual name. - */ - $attr: Object; - } - - /** - * form.FormController - type in module ng - * see https://docs.angularjs.org/api/ng/type/form.FormController - */ - interface IFormController { - - /** - * Indexer which should return ng.INgModelController for most properties but cannot because of "All named properties must be assignable to string indexer type" constraint - see https://github.com/Microsoft/TypeScript/issues/272 - */ - [name: string]: any; - - $pristine: boolean; - $dirty: boolean; - $valid: boolean; - $invalid: boolean; - $submitted: boolean; - $error: any; - $pending: any; - $addControl(control: INgModelController | IFormController): void; - $removeControl(control: INgModelController | IFormController): void; - $setValidity(validationErrorKey: string, isValid: boolean, control: INgModelController | IFormController): void; - $setDirty(): void; - $setPristine(): void; - $commitViewValue(): void; - $rollbackViewValue(): void; - $setSubmitted(): void; - $setUntouched(): void; - } - - /////////////////////////////////////////////////////////////////////////// - // NgModelController - // see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController - /////////////////////////////////////////////////////////////////////////// - interface INgModelController { - $render(): void; - $setValidity(validationErrorKey: string, isValid: boolean): void; - // Documentation states viewValue and modelValue to be a string but other - // types do work and it's common to use them. - $setViewValue(value: any, trigger?: string): void; - $setPristine(): void; - $setDirty(): void; - $validate(): void; - $setTouched(): void; - $setUntouched(): void; - $rollbackViewValue(): void; - $commitViewValue(): void; - $isEmpty(value: any): boolean; - - $viewValue: any; - - $modelValue: any; - - $parsers: IModelParser[]; - $formatters: IModelFormatter[]; - $viewChangeListeners: IModelViewChangeListener[]; - $error: any; - $name: string; - - $touched: boolean; - $untouched: boolean; - - $validators: IModelValidators; - $asyncValidators: IAsyncModelValidators; - - $pending: any; - $pristine: boolean; - $dirty: boolean; - $valid: boolean; - $invalid: boolean; - } - - //Allows tuning how model updates are done. - //https://docs.angularjs.org/api/ng/directive/ngModelOptions - interface INgModelOptions { - updateOn?: string; - debounce?: any; - allowInvalid?: boolean; - getterSetter?: boolean; - timezone?: string; - } - - interface IModelValidators { - /** - * viewValue is any because it can be an object that is called in the view like $viewValue.name:$viewValue.subName - */ - [index: string]: (modelValue: any, viewValue: any) => boolean; - } - - interface IAsyncModelValidators { - [index: string]: (modelValue: any, viewValue: any) => IPromise; - } - - interface IModelParser { - (value: any): any; - } - - interface IModelFormatter { - (value: any): any; - } - - interface IModelViewChangeListener { - (): void; - } - - /** - * $rootScope - $rootScopeProvider - service in module ng - * see https://docs.angularjs.org/api/ng/type/$rootScope.Scope and https://docs.angularjs.org/api/ng/service/$rootScope - */ - interface IRootScopeService { - [index: string]: any; - - $apply(): any; - $apply(exp: string): any; - $apply(exp: (scope: IScope) => any): any; - - $applyAsync(): any; - $applyAsync(exp: string): any; - $applyAsync(exp: (scope: IScope) => any): any; - - /** - * Dispatches an event name downwards to all child scopes (and their children) notifying the registered $rootScope.Scope listeners. - * - * The event life cycle starts at the scope on which $broadcast was called. All listeners listening for name event on this scope get notified. Afterwards, the event propagates to all direct and indirect scopes of the current scope and calls all registered listeners along the way. The event cannot be canceled. - * - * Any exception emitted from the listeners will be passed onto the $exceptionHandler service. - * - * @param name Event name to broadcast. - * @param args Optional one or more arguments which will be passed onto the event listeners. - */ - $broadcast(name: string, ...args: any[]): IAngularEvent; - $destroy(): void; - $digest(): void; - /** - * Dispatches an event name upwards through the scope hierarchy notifying the registered $rootScope.Scope listeners. - * - * The event life cycle starts at the scope on which $emit was called. All listeners listening for name event on this scope get notified. Afterwards, the event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it. - * - * Any exception emitted from the listeners will be passed onto the $exceptionHandler service. - * - * @param name Event name to emit. - * @param args Optional one or more arguments which will be passed onto the event listeners. - */ - $emit(name: string, ...args: any[]): IAngularEvent; - - $eval(): any; - $eval(expression: string, locals?: Object): any; - $eval(expression: (scope: IScope) => any, locals?: Object): any; - - $evalAsync(): void; - $evalAsync(expression: string): void; - $evalAsync(expression: (scope: IScope) => any): void; - - // Defaults to false by the implementation checking strategy - $new(isolate?: boolean, parent?: IScope): IScope; - - /** - * Listens on events of a given type. See $emit for discussion of event life cycle. - * - * The event listener function format is: function(event, args...). - * - * @param name Event name to listen on. - * @param listener Function to call when the event is emitted. - */ - $on(name: string, listener: (event: IAngularEvent, ...args: any[]) => any): () => void; - - $watch(watchExpression: string, listener?: string, objectEquality?: boolean): () => void; - $watch(watchExpression: string, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; - $watch(watchExpression: (scope: IScope) => any, listener?: string, objectEquality?: boolean): () => void; - $watch(watchExpression: (scope: IScope) => T, listener?: (newValue: T, oldValue: T, scope: IScope) => any, objectEquality?: boolean): () => void; - - $watchCollection(watchExpression: string, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; - $watchCollection(watchExpression: (scope: IScope) => T, listener: (newValue: T, oldValue: T, scope: IScope) => any): () => void; - - $watchGroup(watchExpressions: any[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; - $watchGroup(watchExpressions: { (scope: IScope): any }[], listener: (newValue: any, oldValue: any, scope: IScope) => any): () => void; - - $parent: IScope; - $root: IRootScopeService; - $id: number; - - // Hidden members - $$isolateBindings: any; - $$phase: any; - } - - interface IScope extends IRootScopeService { } - - /** - * $scope for ngRepeat directive. - * see https://docs.angularjs.org/api/ng/directive/ngRepeat - */ - interface IRepeatScope extends IScope { - - /** - * iterator offset of the repeated element (0..length-1). - */ - $index: number; - - /** - * true if the repeated element is first in the iterator. - */ - $first: boolean; - - /** - * true if the repeated element is between the first and last in the iterator. - */ - $middle: boolean; - - /** - * true if the repeated element is last in the iterator. - */ - $last: boolean; - - /** - * true if the iterator position $index is even (otherwise false). - */ - $even: boolean; - - /** - * true if the iterator position $index is odd (otherwise false). - */ - $odd: boolean; - - } - - interface IAngularEvent { - /** - * the scope on which the event was $emit-ed or $broadcast-ed. - */ - targetScope: IScope; - /** - * the scope that is currently handling the event. Once the event propagates through the scope hierarchy, this property is set to null. - */ - currentScope: IScope; - /** - * name of the event. - */ - name: string; - /** - * calling stopPropagation function will cancel further event propagation (available only for events that were $emit-ed). - */ - stopPropagation?: Function; - /** - * calling preventDefault sets defaultPrevented flag to true. - */ - preventDefault: Function; - /** - * true if preventDefault was called. - */ - defaultPrevented: boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // WindowService - // see http://docs.angularjs.org/api/ng.$window - /////////////////////////////////////////////////////////////////////////// - interface IWindowService extends Window { - [key: string]: any; - } - - /////////////////////////////////////////////////////////////////////////// - // TimeoutService - // see http://docs.angularjs.org/api/ng.$timeout - /////////////////////////////////////////////////////////////////////////// - interface ITimeoutService { - (delay?: number, invokeApply?: boolean): IPromise; - (fn: (...args: any[]) => T, delay?: number, invokeApply?: boolean, ...args: any[]): IPromise; - cancel(promise?: IPromise): boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // IntervalService - // see http://docs.angularjs.org/api/ng.$interval - /////////////////////////////////////////////////////////////////////////// - interface IIntervalService { - (func: Function, delay: number, count?: number, invokeApply?: boolean, ...args: any[]): IPromise; - cancel(promise: IPromise): boolean; - } - - /** - * $filter - $filterProvider - service in module ng - * - * Filters are used for formatting data displayed to the user. - * - * see https://docs.angularjs.org/api/ng/service/$filter - */ - interface IFilterService { - (name: 'filter'): IFilterFilter; - (name: 'currency'): IFilterCurrency; - (name: 'number'): IFilterNumber; - (name: 'date'): IFilterDate; - (name: 'json'): IFilterJson; - (name: 'lowercase'): IFilterLowercase; - (name: 'uppercase'): IFilterUppercase; - (name: 'limitTo'): IFilterLimitTo; - (name: 'orderBy'): IFilterOrderBy; - /** - * Usage: - * $filter(name); - * - * @param name Name of the filter function to retrieve - */ - (name: string): T; - } - - interface IFilterFilter { - (array: T[], expression: string | IFilterFilterPatternObject | IFilterFilterPredicateFunc, comparator?: IFilterFilterComparatorFunc|boolean): T[]; - } - - interface IFilterFilterPatternObject { - [name: string]: any; - } - - interface IFilterFilterPredicateFunc { - (value: T, index: number, array: T[]): boolean; - } - - interface IFilterFilterComparatorFunc { - (actual: T, expected: T): boolean; - } - - interface IFilterCurrency { - /** - * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used. - * @param amount Input to filter. - * @param symbol Currency symbol or identifier to be displayed. - * @param fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale - * @return Formatted number - */ - (amount: number, symbol?: string, fractionSize?: number): string; - } - - interface IFilterNumber { - /** - * Formats a number as text. - * @param number Number to format. - * @param fractionSize Number of decimal places to round the number to. If this is not provided then the fraction size is computed from the current locale's number formatting pattern. In the case of the default locale, it will be 3. - * @return Number rounded to decimalPlaces and places a “,” after each third digit. - */ - (value: number|string, fractionSize?: number|string): string; - } - - interface IFilterDate { - /** - * Formats date to a string based on the requested format. - * - * @param date Date to format either as Date object, milliseconds (string or number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is specified in the string input, the time is considered to be in the local timezone. - * @param format Formatting rules (see Description). If not specified, mediumDate is used. - * @param timezone Timezone to be used for formatting. It understands UTC/GMT and the continental US time zone abbreviations, but for general use, use a time zone offset, for example, '+0430' (4 hours, 30 minutes east of the Greenwich meridian) If not specified, the timezone of the browser will be used. - * @return Formatted string or the input if input is not recognized as date/millis. - */ - (date: Date | number | string, format?: string, timezone?: string): string; - } - - interface IFilterJson { - /** - * Allows you to convert a JavaScript object into JSON string. - * @param object Any JavaScript object (including arrays and primitive types) to filter. - * @param spacing The number of spaces to use per indentation, defaults to 2. - * @return JSON string. - */ - (object: any, spacing?: number): string; - } - - interface IFilterLowercase { - /** - * Converts string to lowercase. - */ - (value: string): string; - } - - interface IFilterUppercase { - /** - * Converts string to uppercase. - */ - (value: string): string; - } - - interface IFilterLimitTo { - /** - * Creates a new array containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string or number, as specified by the value and sign (positive or negative) of limit. - * @param input Source array to be limited. - * @param limit The length of the returned array. If the limit number is positive, limit number of items from the beginning of the source array/string are copied. If the number is negative, limit number of items from the end of the source array are copied. The limit will be trimmed if it exceeds array.length. If limit is undefined, the input will be returned unchanged. - * @param begin Index at which to begin limitation. As a negative index, begin indicates an offset from the end of input. Defaults to 0. - * @return A new sub-array of length limit or less if input array had less than limit elements. - */ - (input: T[], limit: string|number, begin?: string|number): T[]; - /** - * Creates a new string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source string or number, as specified by the value and sign (positive or negative) of limit. If a number is used as input, it is converted to a string. - * @param input Source string or number to be limited. - * @param limit The length of the returned string. If the limit number is positive, limit number of items from the beginning of the source string are copied. If the number is negative, limit number of items from the end of the source string are copied. The limit will be trimmed if it exceeds input.length. If limit is undefined, the input will be returned unchanged. - * @param begin Index at which to begin limitation. As a negative index, begin indicates an offset from the end of input. Defaults to 0. - * @return A new substring of length limit or less if input had less than limit elements. - */ - (input: string|number, limit: string|number, begin?: string|number): string; - } - - interface IFilterOrderBy { - /** - * Orders a specified array by the expression predicate. It is ordered alphabetically for strings and numerically for numbers. Note: if you notice numbers are not being sorted as expected, make sure they are actually being saved as numbers and not strings. - * @param array The array to sort. - * @param expression A predicate to be used by the comparator to determine the order of elements. - * @param reverse Reverse the order of the array. - * @return Reverse the order of the array. - */ - (array: T[], expression: string|((value: T) => any)|(((value: T) => any)|string)[], reverse?: boolean): T[]; - } - - /** - * $filterProvider - $filter - provider in module ng - * - * Filters are just functions which transform input to an output. However filters need to be Dependency Injected. To achieve this a filter definition consists of a factory function which is annotated with dependencies and is responsible for creating a filter function. - * - * see https://docs.angularjs.org/api/ng/provider/$filterProvider - */ - interface IFilterProvider extends IServiceProvider { - /** - * register(name); - * - * @param name Name of the filter function, or an object map of filters where the keys are the filter names and the values are the filter factories. Note: Filter names must be valid angular Expressions identifiers, such as uppercase or orderBy. Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace your filters, then you can use capitalization (myappSubsectionFilterx) or underscores (myapp_subsection_filterx). - */ - register(name: string | {}): IServiceProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // LocaleService - // see http://docs.angularjs.org/api/ng.$locale - /////////////////////////////////////////////////////////////////////////// - interface ILocaleService { - id: string; - - // These are not documented - // Check angular's i18n files for exemples - NUMBER_FORMATS: ILocaleNumberFormatDescriptor; - DATETIME_FORMATS: ILocaleDateTimeFormatDescriptor; - pluralCat: (num: any) => string; - } - - interface ILocaleNumberFormatDescriptor { - DECIMAL_SEP: string; - GROUP_SEP: string; - PATTERNS: ILocaleNumberPatternDescriptor[]; - CURRENCY_SYM: string; - } - - interface ILocaleNumberPatternDescriptor { - minInt: number; - minFrac: number; - maxFrac: number; - posPre: string; - posSuf: string; - negPre: string; - negSuf: string; - gSize: number; - lgSize: number; - } - - interface ILocaleDateTimeFormatDescriptor { - MONTH: string[]; - SHORTMONTH: string[]; - DAY: string[]; - SHORTDAY: string[]; - AMPMS: string[]; - medium: string; - short: string; - fullDate: string; - longDate: string; - mediumDate: string; - shortDate: string; - mediumTime: string; - shortTime: string; - } - - /////////////////////////////////////////////////////////////////////////// - // LogService - // see http://docs.angularjs.org/api/ng.$log - // see http://docs.angularjs.org/api/ng.$logProvider - /////////////////////////////////////////////////////////////////////////// - interface ILogService { - debug: ILogCall; - error: ILogCall; - info: ILogCall; - log: ILogCall; - warn: ILogCall; - } - - interface ILogProvider extends IServiceProvider { - debugEnabled(): boolean; - debugEnabled(enabled: boolean): ILogProvider; - } - - // We define this as separate interface so we can reopen it later for - // the ngMock module. - interface ILogCall { - (...args: any[]): void; - } - - /////////////////////////////////////////////////////////////////////////// - // ParseService - // see http://docs.angularjs.org/api/ng.$parse - // see http://docs.angularjs.org/api/ng.$parseProvider - /////////////////////////////////////////////////////////////////////////// - interface IParseService { - (expression: string): ICompiledExpression; - } - - interface IParseProvider { - logPromiseWarnings(): boolean; - logPromiseWarnings(value: boolean): IParseProvider; - - unwrapPromises(): boolean; - unwrapPromises(value: boolean): IParseProvider; - } - - interface ICompiledExpression { - (context: any, locals?: any): any; - - literal: boolean; - constant: boolean; - - // If value is not provided, undefined is gonna be used since the implementation - // does not check the parameter. Let's force a value for consistency. If consumer - // whants to undefine it, pass the undefined value explicitly. - assign(context: any, value: any): any; - } - - /** - * $location - $locationProvider - service in module ng - * see https://docs.angularjs.org/api/ng/service/$location - */ - interface ILocationService { - absUrl(): string; - hash(): string; - hash(newHash: string): ILocationService; - host(): string; - - /** - * Return path of current url - */ - path(): string; - - /** - * Change path when called with parameter and return $location. - * Note: Path should always begin with forward slash (/), this method will add the forward slash if it is missing. - * - * @param path New path - */ - path(path: string): ILocationService; - - port(): number; - protocol(): string; - replace(): ILocationService; - - /** - * Return search part (as object) of current url - */ - search(): any; - - /** - * Change search part when called with parameter and return $location. - * - * @param search When called with a single argument the method acts as a setter, setting the search component of $location to the specified value. - * - * If the argument is a hash object containing an array of values, these values will be encoded as duplicate search parameters in the url. - */ - search(search: any): ILocationService; - - /** - * Change search part when called with parameter and return $location. - * - * @param search New search params - * @param paramValue If search is a string or a Number, then paramValue will override only a single search property. If paramValue is null, the property specified via the first argument will be deleted. If paramValue is an array, it will override the property of the search component of $location specified via the first argument. If paramValue is true, the property specified via the first argument will be added with no value nor trailing equal sign. - */ - search(search: string, paramValue: string|number|string[]|boolean): ILocationService; - - state(): any; - state(state: any): ILocationService; - url(): string; - url(url: string): ILocationService; - } - - interface ILocationProvider extends IServiceProvider { - hashPrefix(): string; - hashPrefix(prefix: string): ILocationProvider; - html5Mode(): boolean; - - // Documentation states that parameter is string, but - // implementation tests it as boolean, which makes more sense - // since this is a toggler - html5Mode(active: boolean): ILocationProvider; - html5Mode(mode: { enabled?: boolean; requireBase?: boolean; rewriteLinks?: boolean; }): ILocationProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // DocumentService - // see http://docs.angularjs.org/api/ng.$document - /////////////////////////////////////////////////////////////////////////// - interface IDocumentService extends IAugmentedJQuery {} - - /////////////////////////////////////////////////////////////////////////// - // ExceptionHandlerService - // see http://docs.angularjs.org/api/ng.$exceptionHandler - /////////////////////////////////////////////////////////////////////////// - interface IExceptionHandlerService { - (exception: Error, cause?: string): void; - } - - /////////////////////////////////////////////////////////////////////////// - // RootElementService - // see http://docs.angularjs.org/api/ng.$rootElement - /////////////////////////////////////////////////////////////////////////// - interface IRootElementService extends JQuery {} - - interface IQResolveReject { - (): void; - (value: T): void; - } - /** - * $q - service in module ng - * A promise/deferred implementation inspired by Kris Kowal's Q. - * See http://docs.angularjs.org/api/ng/service/$q - */ - interface IQService { - new (resolver: (resolve: IQResolveReject) => any): IPromise; - new (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; - (resolver: (resolve: IQResolveReject) => any): IPromise; - (resolver: (resolve: IQResolveReject, reject: IQResolveReject) => any): IPromise; - - /** - * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. - * - * Returns a single promise that will be resolved with an array of values, each value corresponding to the promise at the same index in the promises array. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. - * - * @param promises An array of promises. - */ - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise, T10 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise, T9 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise, T8 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise, T7 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise, T6 | IPromise]): IPromise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise , T5 | IPromise]): IPromise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise, T4 | IPromise ]): IPromise<[T1, T2, T3, T4]>; - all(values: [T1 | IPromise, T2 | IPromise, T3 | IPromise]): IPromise<[T1, T2, T3]>; - all(values: [T1 | IPromise, T2 | IPromise]): IPromise<[T1, T2]>; - all(promises: IPromise[]): IPromise; - /** - * Combines multiple promises into a single promise that is resolved when all of the input promises are resolved. - * - * Returns a single promise that will be resolved with a hash of values, each value corresponding to the promise at the same key in the promises hash. If any of the promises is resolved with a rejection, this resulting promise will be rejected with the same rejection value. - * - * @param promises A hash of promises. - */ - all(promises: { [id: string]: IPromise; }): IPromise<{ [id: string]: any; }>; - all(promises: { [id: string]: IPromise; }): IPromise; - /** - * Creates a Deferred object which represents a task which will finish in the future. - */ - defer(): IDeferred; - /** - * Creates a promise that is resolved as rejected with the specified reason. This api should be used to forward rejection in a chain of promises. If you are dealing with the last promise in a promise chain, you don't need to worry about it. - * - * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of reject as the throw keyword in JavaScript. This also means that if you "catch" an error via a promise error callback and you want to forward the error to the promise derived from the current promise, you have to "rethrow" the error by returning a rejection constructed via reject. - * - * @param reason Constant, message, exception or an object representing the rejection reason. - */ - reject(reason?: any): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - * - * @param value Value or a promise - */ - resolve(value: IPromise|T): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - */ - resolve(): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - * - * @param value Value or a promise - */ - when(value: IPromise|T): IPromise; - /** - * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. - */ - when(): IPromise; - } - - interface IPromise { - /** - * Regardless of when the promise was or will be resolved or rejected, then calls one of the success or error callbacks asynchronously as soon as the result is available. The callbacks are called with a single argument: the result or rejection reason. Additionally, the notify callback may be called zero or more times to provide a progress indication, before the promise is resolved or rejected. - * The successCallBack may return IPromise for when a $q.reject() needs to be returned - * This method returns a new promise which is resolved or rejected via the return value of the successCallback, errorCallback. It also notifies via the return value of the notifyCallback method. The promise can not be resolved or rejected from the notifyCallback method. - */ - then(successCallback: (promiseValue: T) => IPromise|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise; - - /** - * Shorthand for promise.then(null, errorCallback) - */ - catch(onRejected: (reason: any) => IPromise|TResult): IPromise; - - /** - * Allows you to observe either the fulfillment or rejection of a promise, but to do so without modifying the final value. This is useful to release resources or do some clean-up that needs to be done whether the promise was rejected or resolved. See the full specification for more information. - * - * Because finally is a reserved word in JavaScript and reserved keywords are not supported as property names by ES3, you'll need to invoke the method like promise['finally'](callback) to make your code IE8 and Android 2.x compatible. - */ - finally(finallyCallback: () => any): IPromise; - } - - interface IDeferred { - resolve(value?: T|IPromise): void; - reject(reason?: any): void; - notify(state?: any): void; - promise: IPromise; - } - - /////////////////////////////////////////////////////////////////////////// - // AnchorScrollService - // see http://docs.angularjs.org/api/ng.$anchorScroll - /////////////////////////////////////////////////////////////////////////// - interface IAnchorScrollService { - (): void; - (hash: string): void; - yOffset: any; - } - - interface IAnchorScrollProvider extends IServiceProvider { - disableAutoScrolling(): void; - } - - /** - * $cacheFactory - service in module ng - * - * Factory that constructs Cache objects and gives access to them. - * - * see https://docs.angularjs.org/api/ng/service/$cacheFactory - */ - interface ICacheFactoryService { - /** - * Factory that constructs Cache objects and gives access to them. - * - * @param cacheId Name or id of the newly created cache. - * @param optionsMap Options object that specifies the cache behavior. Properties: - * - * capacity — turns the cache into LRU cache. - */ - (cacheId: string, optionsMap?: { capacity?: number; }): ICacheObject; - - /** - * Get information about all the caches that have been created. - * @returns key-value map of cacheId to the result of calling cache#info - */ - info(): any; - - /** - * Get access to a cache object by the cacheId used when it was created. - * - * @param cacheId Name or id of a cache to access. - */ - get(cacheId: string): ICacheObject; - } - - /** - * $cacheFactory.Cache - type in module ng - * - * A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data. - * - * see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache - */ - interface ICacheObject { - /** - * Retrieve information regarding a particular Cache. - */ - info(): { - /** - * the id of the cache instance - */ - id: string; - - /** - * the number of entries kept in the cache instance - */ - size: number; - - //...: any additional properties from the options object when creating the cache. - }; - - /** - * Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set. - * - * It will not insert undefined values into the cache. - * - * @param key the key under which the cached data is stored. - * @param value the value to store alongside the key. If it is undefined, the key will not be stored. - */ - put(key: string, value?: T): T; - - /** - * Retrieves named data stored in the Cache object. - * - * @param key the key of the data to be retrieved - */ - get(key: string): T; - - /** - * Removes an entry from the Cache object. - * - * @param key the key of the entry to be removed - */ - remove(key: string): void; - - /** - * Clears the cache object of any entries. - */ - removeAll(): void; - - /** - * Destroys the Cache object entirely, removing it from the $cacheFactory set. - */ - destroy(): void; - } - - /////////////////////////////////////////////////////////////////////////// - // CompileService - // see http://docs.angularjs.org/api/ng.$compile - // see http://docs.angularjs.org/api/ng.$compileProvider - /////////////////////////////////////////////////////////////////////////// - interface ICompileService { - (element: string, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; - (element: Element, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; - (element: JQuery, transclude?: ITranscludeFunction, maxPriority?: number): ITemplateLinkingFunction; - } - - interface ICompileProvider extends IServiceProvider { - directive(name: string, directiveFactory: Function): ICompileProvider; - directive(directivesMap: Object, directiveFactory: Function): ICompileProvider; - directive(name: string, inlineAnnotatedFunction: any[]): ICompileProvider; - directive(directivesMap: Object, inlineAnnotatedFunction: any[]): ICompileProvider; - - // Undocumented, but it is there... - directive(directivesMap: any): ICompileProvider; - - component(name: string, options: IComponentOptions): ICompileProvider; - - aHrefSanitizationWhitelist(): RegExp; - aHrefSanitizationWhitelist(regexp: RegExp): ICompileProvider; - - imgSrcSanitizationWhitelist(): RegExp; - imgSrcSanitizationWhitelist(regexp: RegExp): ICompileProvider; - - debugInfoEnabled(enabled?: boolean): any; - } - - interface ICloneAttachFunction { - // Let's hint but not force cloneAttachFn's signature - (clonedElement?: JQuery, scope?: IScope): any; - } - - // This corresponds to the "publicLinkFn" returned by $compile. - interface ITemplateLinkingFunction { - (scope: IScope, cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; - } - - // This corresponds to $transclude (and also the transclude function passed to link). - interface ITranscludeFunction { - // If the scope is provided, then the cloneAttachFn must be as well. - (scope: IScope, cloneAttachFn: ICloneAttachFunction): IAugmentedJQuery; - // If one argument is provided, then it's assumed to be the cloneAttachFn. - (cloneAttachFn?: ICloneAttachFunction): IAugmentedJQuery; - } - - /////////////////////////////////////////////////////////////////////////// - // ControllerService - // see http://docs.angularjs.org/api/ng.$controller - // see http://docs.angularjs.org/api/ng.$controllerProvider - /////////////////////////////////////////////////////////////////////////// - interface IControllerService { - // Although the documentation doesn't state this, locals are optional - (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; - (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; - (controllerName: string, locals?: any, later?: boolean, ident?: string): T; - } - - interface IControllerProvider extends IServiceProvider { - register(name: string, controllerConstructor: Function): void; - register(name: string, dependencyAnnotatedConstructor: any[]): void; - allowGlobals(): void; - } - - /** - * xhrFactory - * Replace or decorate this service to create your own custom XMLHttpRequest objects. - * see https://docs.angularjs.org/api/ng/service/$xhrFactory - */ - interface IXhrFactory { - (method: string, url: string): T; - } - - /** - * HttpService - * see http://docs.angularjs.org/api/ng/service/$http - */ - interface IHttpService { - /** - * Object describing the request to be made and how it should be processed. - */ - (config: IRequestConfig): IHttpPromise; - - /** - * Shortcut method to perform GET request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - get(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform DELETE request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - delete(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform HEAD request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - head(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform JSONP request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param config Optional configuration object - */ - jsonp(url: string, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform POST request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param data Request content - * @param config Optional configuration object - */ - post(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform PUT request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param data Request content - * @param config Optional configuration object - */ - put(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Shortcut method to perform PATCH request. - * - * @param url Relative or absolute URL specifying the destination of the request - * @param data Request content - * @param config Optional configuration object - */ - patch(url: string, data: any, config?: IRequestShortcutConfig): IHttpPromise; - - /** - * Runtime equivalent of the $httpProvider.defaults property. Allows configuration of default headers, withCredentials as well as request and response transformations. - */ - defaults: IHttpProviderDefaults; - - /** - * Array of config objects for currently pending requests. This is primarily meant to be used for debugging purposes. - */ - pendingRequests: IRequestConfig[]; - } - - /** - * Object describing the request to be made and how it should be processed. - * see http://docs.angularjs.org/api/ng/service/$http#usage - */ - interface IRequestShortcutConfig extends IHttpProviderDefaults { - /** - * {Object.} - * Map of strings or objects which will be turned to ?key1=value1&key2=value2 after the url. If the value is not a string, it will be JSONified. - */ - params?: any; - - /** - * {string|Object} - * Data to be sent as the request message data. - */ - data?: any; - - /** - * Timeout in milliseconds, or promise that should abort the request when resolved. - */ - timeout?: number|IPromise; - - /** - * See [XMLHttpRequest.responseType]https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype - */ - responseType?: string; - } - - /** - * Object describing the request to be made and how it should be processed. - * see http://docs.angularjs.org/api/ng/service/$http#usage - */ - interface IRequestConfig extends IRequestShortcutConfig { - /** - * HTTP method (e.g. 'GET', 'POST', etc) - */ - method: string; - /** - * Absolute or relative URL of the resource that is being requested. - */ - url: string; - } - - interface IHttpHeadersGetter { - (): { [name: string]: string; }; - (headerName: string): string; - } - - interface IHttpPromiseCallback { - (data: T, status: number, headers: IHttpHeadersGetter, config: IRequestConfig): void; - } - - interface IHttpPromiseCallbackArg { - data?: T; - status?: number; - headers?: IHttpHeadersGetter; - config?: IRequestConfig; - statusText?: string; - } - - interface IHttpPromise extends IPromise> { - /** - * The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. - * If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error. - * @deprecated - */ - success?(callback: IHttpPromiseCallback): IHttpPromise; - /** - * The $http legacy promise methods success and error have been deprecated. Use the standard then method instead. - * If $httpProvider.useLegacyPromiseExtensions is set to false then these methods will throw $http/legacy error. - * @deprecated - */ - error?(callback: IHttpPromiseCallback): IHttpPromise; - } - - // See the jsdoc for transformData() at https://github.com/angular/angular.js/blob/master/src/ng/http.js#L228 - interface IHttpRequestTransformer { - (data: any, headersGetter: IHttpHeadersGetter): any; - } - - // The definition of fields are the same as IHttpPromiseCallbackArg - interface IHttpResponseTransformer { - (data: any, headersGetter: IHttpHeadersGetter, status: number): any; - } - - type HttpHeaderType = {[requestType: string]:string|((config:IRequestConfig) => string)}; - - interface IHttpRequestConfigHeaders { - [requestType: string]: any; - common?: any; - get?: any; - post?: any; - put?: any; - patch?: any; - } - - /** - * Object that controls the defaults for $http provider. Not all fields of IRequestShortcutConfig can be configured - * via defaults and the docs do not say which. The following is based on the inspection of the source code. - * https://docs.angularjs.org/api/ng/service/$http#defaults - * https://docs.angularjs.org/api/ng/service/$http#usage - * https://docs.angularjs.org/api/ng/provider/$httpProvider The properties section - */ - interface IHttpProviderDefaults { - /** - * {boolean|Cache} - * If true, a default $http cache will be used to cache the GET request, otherwise if a cache instance built with $cacheFactory, this cache will be used for caching. - */ - cache?: any; - - /** - * Transform function or an array of such functions. The transform function takes the http request body and - * headers and returns its transformed (typically serialized) version. - * @see {@link https://docs.angularjs.org/api/ng/service/$http#transforming-requests-and-responses} - */ - transformRequest?: IHttpRequestTransformer |IHttpRequestTransformer[]; - - /** - * Transform function or an array of such functions. The transform function takes the http response body and - * headers and returns its transformed (typically deserialized) version. - */ - transformResponse?: IHttpResponseTransformer | IHttpResponseTransformer[]; - - /** - * Map of strings or functions which return strings representing HTTP headers to send to the server. If the - * return value of a function is null, the header will not be sent. - * The key of the map is the request verb in lower case. The "common" key applies to all requests. - * @see {@link https://docs.angularjs.org/api/ng/service/$http#setting-http-headers} - */ - headers?: IHttpRequestConfigHeaders; - - /** Name of HTTP header to populate with the XSRF token. */ - xsrfHeaderName?: string; - - /** Name of cookie containing the XSRF token. */ - xsrfCookieName?: string; - - /** - * whether to to set the withCredentials flag on the XHR object. See [requests with credentials]https://developer.mozilla.org/en/http_access_control#section_5 for more information. - */ - withCredentials?: boolean; - - /** - * A function used to the prepare string representation of request parameters (specified as an object). If - * specified as string, it is interpreted as a function registered with the $injector. Defaults to - * $httpParamSerializer. - */ - paramSerializer?: string | ((obj: any) => string); - } - - interface IHttpInterceptor { - request?: (config: IRequestConfig) => IRequestConfig|IPromise; - requestError?: (rejection: any) => any; - response?: (response: IHttpPromiseCallbackArg) => IPromise>|IHttpPromiseCallbackArg; - responseError?: (rejection: any) => any; - } - - interface IHttpInterceptorFactory { - (...args: any[]): IHttpInterceptor; - } - - interface IHttpProvider extends IServiceProvider { - defaults: IHttpProviderDefaults; - - /** - * Register service factories (names or implementations) for interceptors which are called before and after - * each request. - */ - interceptors: (string|IHttpInterceptorFactory|(string|IHttpInterceptorFactory)[])[]; - useApplyAsync(): boolean; - useApplyAsync(value: boolean): IHttpProvider; - - /** - * - * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods. - * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining. - * otherwise, returns the current configured value. - */ - useLegacyPromiseExtensions(value:boolean) : boolean | IHttpProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // HttpBackendService - // see http://docs.angularjs.org/api/ng.$httpBackend - // You should never need to use this service directly. - /////////////////////////////////////////////////////////////////////////// - interface IHttpBackendService { - // XXX Perhaps define callback signature in the future - (method: string, url: string, post?: any, callback?: Function, headers?: any, timeout?: number, withCredentials?: boolean): void; - } - - /////////////////////////////////////////////////////////////////////////// - // InterpolateService - // see http://docs.angularjs.org/api/ng.$interpolate - // see http://docs.angularjs.org/api/ng.$interpolateProvider - /////////////////////////////////////////////////////////////////////////// - interface IInterpolateService { - (text: string, mustHaveExpression?: boolean, trustedContext?: string, allOrNothing?: boolean): IInterpolationFunction; - endSymbol(): string; - startSymbol(): string; - } - - interface IInterpolationFunction { - (context: any): string; - } - - interface IInterpolateProvider extends IServiceProvider { - startSymbol(): string; - startSymbol(value: string): IInterpolateProvider; - endSymbol(): string; - endSymbol(value: string): IInterpolateProvider; - } - - /////////////////////////////////////////////////////////////////////////// - // TemplateCacheService - // see http://docs.angularjs.org/api/ng.$templateCache - /////////////////////////////////////////////////////////////////////////// - interface ITemplateCacheService extends ICacheObject {} - - /////////////////////////////////////////////////////////////////////////// - // SCEService - // see http://docs.angularjs.org/api/ng.$sce - /////////////////////////////////////////////////////////////////////////// - interface ISCEService { - getTrusted(type: string, mayBeTrusted: any): any; - getTrustedCss(value: any): any; - getTrustedHtml(value: any): any; - getTrustedJs(value: any): any; - getTrustedResourceUrl(value: any): any; - getTrustedUrl(value: any): any; - parse(type: string, expression: string): (context: any, locals: any) => any; - parseAsCss(expression: string): (context: any, locals: any) => any; - parseAsHtml(expression: string): (context: any, locals: any) => any; - parseAsJs(expression: string): (context: any, locals: any) => any; - parseAsResourceUrl(expression: string): (context: any, locals: any) => any; - parseAsUrl(expression: string): (context: any, locals: any) => any; - trustAs(type: string, value: any): any; - trustAsHtml(value: any): any; - trustAsJs(value: any): any; - trustAsResourceUrl(value: any): any; - trustAsUrl(value: any): any; - isEnabled(): boolean; - } - - /////////////////////////////////////////////////////////////////////////// - // SCEProvider - // see http://docs.angularjs.org/api/ng.$sceProvider - /////////////////////////////////////////////////////////////////////////// - interface ISCEProvider extends IServiceProvider { - enabled(value: boolean): void; - } - - /////////////////////////////////////////////////////////////////////////// - // SCEDelegateService - // see http://docs.angularjs.org/api/ng.$sceDelegate - /////////////////////////////////////////////////////////////////////////// - interface ISCEDelegateService { - getTrusted(type: string, mayBeTrusted: any): any; - trustAs(type: string, value: any): any; - valueOf(value: any): any; - } - - - /////////////////////////////////////////////////////////////////////////// - // SCEDelegateProvider - // see http://docs.angularjs.org/api/ng.$sceDelegateProvider - /////////////////////////////////////////////////////////////////////////// - interface ISCEDelegateProvider extends IServiceProvider { - resourceUrlBlacklist(blacklist: any[]): void; - resourceUrlWhitelist(whitelist: any[]): void; - resourceUrlBlacklist(): any[]; - resourceUrlWhitelist(): any[]; - } - - /** - * $templateRequest service - * see http://docs.angularjs.org/api/ng/service/$templateRequest - */ - interface ITemplateRequestService { - /** - * Downloads a template using $http and, upon success, stores the - * contents inside of $templateCache. - * - * If the HTTP request fails or the response data of the HTTP request is - * empty then a $compile error will be thrown (unless - * {ignoreRequestError} is set to true). - * - * @param tpl The template URL. - * @param ignoreRequestError Whether or not to ignore the exception - * when the request fails or the template is - * empty. - * - * @return A promise whose value is the template content. - */ - (tpl: string, ignoreRequestError?: boolean): IPromise; - /** - * total amount of pending template requests being downloaded. - * @type {number} - */ - totalPendingRequests: number; - } - - /////////////////////////////////////////////////////////////////////////// - // Component - // see http://angularjs.blogspot.com.br/2015/11/angularjs-15-beta2-and-14-releases.html - // and http://toddmotto.com/exploring-the-angular-1-5-component-method/ - /////////////////////////////////////////////////////////////////////////// - /** - * Component definition object (a simplified directive definition object) - */ - interface IComponentOptions { - /** - * Controller constructor function that should be associated with newly created scope or the name of a registered - * controller if passed as a string. Empty function by default. - * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) - */ - controller?: string | Function | (string | Function)[]; - /** - * An identifier name for a reference to the controller. If present, the controller will be published to scope under - * the controllerAs name. If not present, this will default to be the same as the component name. - * @default "$ctrl" - */ - controllerAs?: string; - /** - * html template as a string or a function that returns an html template as a string which should be used as the - * contents of this component. Empty string by default. - * If template is a function, then it is injected with the following locals: - * $element - Current element - * $attrs - Current attributes object for the element - * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) - */ - template?: string | Function | (string | Function)[]; - /** - * path or function that returns a path to an html template that should be used as the contents of this component. - * If templateUrl is a function, then it is injected with the following locals: - * $element - Current element - * $attrs - Current attributes object for the element - * Use the array form to define dependencies (necessary if strictDi is enabled and you require dependency injection) - */ - templateUrl?: string | Function | (string | Function)[]; - /** - * Define DOM attribute binding to component properties. Component properties are always bound to the component - * controller and not to the scope. - */ - bindings?: {[binding: string]: string}; - /** - * Whether transclusion is enabled. Enabled by default. - */ - transclude?: boolean | string | {[slot: string]: string}; - require?: string | string[] | {[controller: string]: string}; - } - - interface IComponentTemplateFn { - ( $element?: IAugmentedJQuery, $attrs?: IAttributes ): string; - } - - /////////////////////////////////////////////////////////////////////////// - // Directive - // see http://docs.angularjs.org/api/ng.$compileProvider#directive - // and http://docs.angularjs.org/guide/directive - /////////////////////////////////////////////////////////////////////////// - - interface IDirectiveFactory { - (...args: any[]): IDirective; - } - - interface IDirectiveLinkFn { - ( - scope: IScope, - instanceElement: IAugmentedJQuery, - instanceAttributes: IAttributes, - controller: {}, - transclude: ITranscludeFunction - ): void; - } - - interface IDirectivePrePost { - pre?: IDirectiveLinkFn; - post?: IDirectiveLinkFn; - } - - interface IDirectiveCompileFn { - ( - templateElement: IAugmentedJQuery, - templateAttributes: IAttributes, - /** - * @deprecated - * Note: The transclude function that is passed to the compile function is deprecated, - * as it e.g. does not know about the right outer scope. Please use the transclude function - * that is passed to the link function instead. - */ - transclude: ITranscludeFunction - ): IDirectivePrePost; - } - - interface IDirective { - compile?: IDirectiveCompileFn; - controller?: any; - controllerAs?: string; - /** - * @deprecated - * Deprecation warning: although bindings for non-ES6 class controllers are currently bound to this before - * the controller constructor is called, this use is now deprecated. Please place initialization code that - * relies upon bindings inside a $onInit method on the controller, instead. - */ - bindToController?: boolean | Object; - link?: IDirectiveLinkFn | IDirectivePrePost; - multiElement?: boolean; - name?: string; - priority?: number; - /** - * @deprecated - */ - replace?: boolean; - require?: string | string[] | {[controller: string]: string}; - restrict?: string; - scope?: boolean | Object; - template?: string | Function; - templateNamespace?: string; - templateUrl?: string | Function; - terminal?: boolean; - transclude?: boolean | string | {[slot: string]: string}; - } - - /** - * angular.element - * when calling angular.element, angular returns a jQuery object, - * augmented with additional methods like e.g. scope. - * see: http://docs.angularjs.org/api/angular.element - */ - interface IAugmentedJQueryStatic extends JQueryStatic { - (selector: string, context?: any): IAugmentedJQuery; - (element: Element): IAugmentedJQuery; - (object: {}): IAugmentedJQuery; - (elementArray: Element[]): IAugmentedJQuery; - (object: JQuery): IAugmentedJQuery; - (func: Function): IAugmentedJQuery; - (array: any[]): IAugmentedJQuery; - (): IAugmentedJQuery; - } - - interface IAugmentedJQuery extends JQuery { - // TODO: events, how to define? - //$destroy - - find(selector: string): IAugmentedJQuery; - find(element: any): IAugmentedJQuery; - find(obj: JQuery): IAugmentedJQuery; - controller(): any; - controller(name: string): any; - injector(): any; - scope(): IScope; - - /** - * Overload for custom scope interfaces - */ - scope(): T; - isolateScope(): IScope; - - inheritedData(key: string, value: any): JQuery; - inheritedData(obj: { [key: string]: any; }): JQuery; - inheritedData(key?: string): any; - } - - /////////////////////////////////////////////////////////////////////////// - // AUTO module (angular.js) - /////////////////////////////////////////////////////////////////////////// - export module auto { - - /////////////////////////////////////////////////////////////////////// - // InjectorService - // see http://docs.angularjs.org/api/AUTO.$injector - /////////////////////////////////////////////////////////////////////// - interface IInjectorService { - annotate(fn: Function, strictDi?: boolean): string[]; - annotate(inlineAnnotatedFunction: any[]): string[]; - get(name: string, caller?: string): T; - get(name: '$anchorScroll'): IAnchorScrollService - get(name: '$cacheFactory'): ICacheFactoryService - get(name: '$compile'): ICompileService - get(name: '$controller'): IControllerService - get(name: '$document'): IDocumentService - get(name: '$exceptionHandler'): IExceptionHandlerService - get(name: '$filter'): IFilterService - get(name: '$http'): IHttpService - get(name: '$httpBackend'): IHttpBackendService - get(name: '$httpParamSerializer'): IHttpParamSerializer - get(name: '$httpParamSerializerJQLike'): IHttpParamSerializer - get(name: '$interpolate'): IInterpolateService - get(name: '$interval'): IIntervalService - get(name: '$locale'): ILocaleService - get(name: '$location'): ILocationService - get(name: '$log'): ILogService - get(name: '$parse'): IParseService - get(name: '$q'): IQService - get(name: '$rootElement'): IRootElementService - get(name: '$rootScope'): IRootScopeService - get(name: '$sce'): ISCEService - get(name: '$sceDelegate'): ISCEDelegateService - get(name: '$templateCache'): ITemplateCacheService - get(name: '$templateRequest'): ITemplateRequestService - get(name: '$timeout'): ITimeoutService - get(name: '$window'): IWindowService - get(name: '$xhrFactory'): IXhrFactory - has(name: string): boolean; - instantiate(typeConstructor: Function, locals?: any): T; - invoke(inlineAnnotatedFunction: any[]): any; - invoke(func: Function, context?: any, locals?: any): any; - strictDi: boolean; - } - - /////////////////////////////////////////////////////////////////////// - // ProvideService - // see http://docs.angularjs.org/api/AUTO.$provide - /////////////////////////////////////////////////////////////////////// - interface IProvideService { - // Documentation says it returns the registered instance, but actual - // implementation does not return anything. - // constant(name: string, value: any): any; - /** - * Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator. - * - * @param name The name of the constant. - * @param value The constant value. - */ - constant(name: string, value: any): void; - - /** - * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. - * - * @param name The name of the service to decorate. - * @param decorator This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: - * - * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. - */ - decorator(name: string, decorator: Function): void; - /** - * Register a service decorator with the $injector. A service decorator intercepts the creation of a service, allowing it to override or modify the behaviour of the service. The object returned by the decorator may be the original service, or a new service object which replaces or wraps and delegates to the original service. - * - * @param name The name of the service to decorate. - * @param inlineAnnotatedFunction This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: - * - * $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to. - */ - decorator(name: string, inlineAnnotatedFunction: any[]): void; - factory(name: string, serviceFactoryFunction: Function): IServiceProvider; - factory(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; - provider(name: string, provider: IServiceProvider): IServiceProvider; - provider(name: string, serviceProviderConstructor: Function): IServiceProvider; - service(name: string, constructor: Function): IServiceProvider; - service(name: string, inlineAnnotatedFunction: any[]): IServiceProvider; - value(name: string, value: any): IServiceProvider; - } - - } - - /** - * $http params serializer that converts objects to strings - * see https://docs.angularjs.org/api/ng/service/$httpParamSerializer - */ - interface IHttpParamSerializer { - (obj: Object): string; - } -} From fdb294a80f987302fd14217bd58e42a03d276c49 Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Sun, 12 Feb 2017 00:06:11 -0500 Subject: [PATCH 12/33] Update Pako typings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Properly support {to: ‘string’} and the default return types for pack functions * Codify options a bit * Add a type alias to simplify a repeated type * Add new tests for new {to: ‘string’} functionality --- pako/index.d.ts | 61 +++++++++++++++++++++++++++++++--------------- pako/pako-tests.ts | 15 +++++++++--- 2 files changed, 53 insertions(+), 23 deletions(-) diff --git a/pako/index.d.ts b/pako/index.d.ts index 2838272dbf..4c59661031 100644 --- a/pako/index.d.ts +++ b/pako/index.d.ts @@ -7,55 +7,78 @@ export = Pako; export as namespace pako; declare namespace Pako { + export interface DeflateOptions { + level?: number; + windowBits?: number; + memLevel?: number; + strategy?: number; + dictionary?: any; + raw?: boolean; + to?: 'string'; + } + + export interface InflateOptions { + windowBits?: number; + raw?: boolean; + to?: 'string'; + } + + export type Data = Uint8Array | Array | string; + /** * Compress data with deflate algorithm and options. */ - export function deflate( data: Uint8Array | Array | string, options?: any ): string; + export function deflate( data: Data, options: DeflateOptions & {to: 'string'} ): string; + export function deflate( data: Data, options?: DeflateOptions ): Uint8Array; + /** * The same as deflate, but creates raw data, without wrapper (header and adler32 crc). */ - export function deflateRaw( data: Uint8Array | Array | string, options?: any ): string; + export function deflateRaw( data: Data, options: DeflateOptions & {to: 'string'} ): string; + export function deflateRaw( data: Data, options?: DeflateOptions ): Uint8Array; + /** * The same as deflate, but create gzip wrapper instead of deflate one. */ - export function gzip( data: Uint8Array | Array | string, options?: any ): string; + export function gzip( data: Data, options: DeflateOptions & {to: 'string'} ): string; + export function gzip( data: Data, options?: DeflateOptions ): Uint8Array; + /** * Decompress data with inflate/ungzip and options. Autodetect format via wrapper header * by default. That's why we don't provide separate ungzip method. */ - export function inflate( data: Uint8Array | Array | string, options?: any ): Uint8Array; - export function inflate( data: Uint8Array | Array | string, options?: any ): Array; - export function inflate( data: Uint8Array | Array | string, options?: any ): String; + export function inflate( data: Data, options: InflateOptions & {to: 'string'} ): string; + export function inflate( data: Data, options?: InflateOptions ): Uint8Array; + /** * The same as inflate, but creates raw data, without wrapper (header and adler32 crc). */ - export function inflateRaw( data: Uint8Array | Array | string, options?: any ): Uint8Array; - export function inflateRaw( data: Uint8Array | Array | string, options?: any ): Array; - export function inflateRaw( data: Uint8Array | Array | string, options?: any ): string; + export function inflateRaw( data: Data, options: InflateOptions & {to: 'string'} ): string; + export function inflateRaw( data: Data, options?: InflateOptions ): Uint8Array; + /** * Just shortcut to inflate, because it autodetects format by header.content. Done for convenience. */ - export function ungzip( data: Uint8Array | Array | string, options?: any ): Uint8Array; - export function ungzip( data: Uint8Array | Array | string, options?: any ): Array; - export function ungzip( data: Uint8Array | Array | string, options?: any ): string; + export function ungzip( data: Data, options: InflateOptions & {to: 'string'} ): string; + export function ungzip( data: Data, options?: InflateOptions ): Uint8Array; export class Deflate { - constructor( options?: any ); + constructor( options?: DeflateOptions ); err: number; msg: string; result: Uint8Array | Array; - onData( chunk: Uint8Array | Array | string ): void; + onData( chunk: Data ): void; onEnd( status: number ): void; - push( data: Uint8Array | Array | ArrayBuffer | string, mode?: number | boolean ): boolean; + push( data: Data | ArrayBuffer, mode?: number | boolean ): boolean; } export class Inflate { - constructor( options?: any ); + constructor( options?: InflateOptions ); err: number; msg: string; - result: Uint8Array | Array | string; - onData( chunk: Uint8Array | Array | string ): void; + result: Data; + onData( chunk: Data ): void; onEnd( status: number ): void; - push( data: Uint8Array | Array | ArrayBuffer | string, mode?: number | boolean ): boolean; + push( data: Data | ArrayBuffer, mode?: number | boolean ): boolean; } } diff --git a/pako/pako-tests.ts b/pako/pako-tests.ts index e928fba9dc..5e5a6c3eef 100644 --- a/pako/pako-tests.ts +++ b/pako/pako-tests.ts @@ -5,13 +5,20 @@ import pako = require("pako"); var chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9]) var chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]); -var deflate = new pako.Deflate({ level: 3}); +var deflate = new pako.Deflate({ level: 3 }); deflate.push(chunk1, false); deflate.push(chunk2, true); // true -> last chunk -if (deflate.err) { - throw new Error( deflate.err.toString() ); +if (deflate.err) { + throw new Error( deflate.err.toString() ); } -console.log(deflate.result); \ No newline at end of file +console.log(deflate.result); + +let str: string = pako.deflate('1234', {to: 'string'}); +let arr: Uint8Array = pako.deflate('1234'); + +let str2: string = pako.inflate('1234', {to: 'string'}); +let arr2: Uint8Array = pako.inflate('1234'); + From e9f5b8921c76b1e00f910244a854a87ce3126c25 Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Sun, 12 Feb 2017 00:11:49 -0500 Subject: [PATCH 13/33] Update version number and add author --- pako/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pako/index.d.ts b/pako/index.d.ts index 4c59661031..dd86b3aaa1 100644 --- a/pako/index.d.ts +++ b/pako/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for pako 0.2.8 +// Type definitions for pako 0.1.4 // Project: https://github.com/nodeca/pako -// Definitions by: Denis Cappellin +// Definitions by: Denis Cappellin , Caleb Eggensperger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = Pako; From af5c97f0fee472940ab2aa200e1df8bc389d1f99 Mon Sep 17 00:00:00 2001 From: Thomas Hourlier Date: Sun, 12 Feb 2017 11:17:42 +0100 Subject: [PATCH 14/33] [nock]: support options method --- nock/index.d.ts | 1 + nock/nock-tests.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/nock/index.d.ts b/nock/index.d.ts index 447c591803..ef8afa86ac 100644 --- a/nock/index.d.ts +++ b/nock/index.d.ts @@ -48,6 +48,7 @@ declare namespace nock { patch: InterceptFunction; merge: InterceptFunction; delete: InterceptFunction; + options: InterceptFunction; intercept: ( uri: string | RegExp | { (uri: string): boolean; }, diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index 0d1b11159f..e2c28d3311 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -22,6 +22,9 @@ inst = scope.head(str); inst = scope.get(str); inst = scope.get(str, data); +inst = scope.options(str); +inst = scope.options(str, data); + inst = scope.patch(str); inst = scope.patch(str, str); inst = scope.patch(str, obj); From 1f63c32e00b9f87ba4522b78dd61bbcb7d81acde Mon Sep 17 00:00:00 2001 From: nutstick Date: Sun, 12 Feb 2017 17:22:59 +0700 Subject: [PATCH 15/33] Add passReqToCallback to IStrategyOption --- passport-facebook/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/passport-facebook/index.d.ts b/passport-facebook/index.d.ts index 7b6cedeac5..4e84b4996b 100644 --- a/passport-facebook/index.d.ts +++ b/passport-facebook/index.d.ts @@ -31,6 +31,7 @@ interface IStrategyOption { scopeSeparator?: string; enableProof?: boolean; profileFields?: string[]; + passReqToCallback?: boolean; } declare class Strategy implements passport.Strategy { From f80e883dedaa2c3595d5c8626606dbd4e93bd9e2 Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Sun, 12 Feb 2017 11:53:40 -0500 Subject: [PATCH 16/33] Fix version number --- pako/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pako/index.d.ts b/pako/index.d.ts index dd86b3aaa1..bb3580454d 100644 --- a/pako/index.d.ts +++ b/pako/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pako 0.1.4 +// Type definitions for pako 1.0.4 // Project: https://github.com/nodeca/pako // Definitions by: Denis Cappellin , Caleb Eggensperger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From b5d7793ebf9c434a548e6adb19bd4df047488eb2 Mon Sep 17 00:00:00 2001 From: Kevin Drouvin Date: Sun, 12 Feb 2017 19:27:53 +0200 Subject: [PATCH 17/33] Add new method to define custom worlds. Introduced in cucumber.js v2.0.0-rc.4 --- cucumber/cucumber-tests.ts | 6 ++++++ cucumber/index.d.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index dd92ee7c19..87089671ae 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -9,6 +9,12 @@ function StepSample() { var step = this; var hook = this; + hook.setWorldConstructor(function() { + this.visit = function(url: string, callback: Callback) { + callback(null, 'pending'); + } + }) + hook.Before(function(scenario: HookScenario, callback: Callback){ scenario.isFailed() && callback.pending(); }); diff --git a/cucumber/index.d.ts b/cucumber/index.d.ts index 154e6707cc..8c56e3aae4 100644 --- a/cucumber/index.d.ts +++ b/cucumber/index.d.ts @@ -69,6 +69,7 @@ declare namespace cucumber { After(code: HookCode): void; Around(code: AroundCode):void; setDefaultTimeout(time:number): void; + setWorldConstructor(world: () => void): void; registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void; registerListener(listener: EventListener): void; } From 515644f394c04e0c324146ce37efae895fbc1880 Mon Sep 17 00:00:00 2001 From: xaviergonz Date: Sun, 12 Feb 2017 19:00:50 +0100 Subject: [PATCH 18/33] adding missing secondaryTextColor it is present as can be seen here: https://github.com/callemall/material-ui/blob/master/src/styles/baseThemes/lightBaseTheme.js --- material-ui/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index a2661455f8..c399116482 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -130,6 +130,7 @@ declare namespace __MaterialUI { accent2Color?: string; accent3Color?: string; textColor?: string; + secondaryTextColor?: string; alternateTextColor?: string; canvasColor?: string; borderColor?: string; From b1b3b5eb25627744e67239fb9d6617c40b5ddc24 Mon Sep 17 00:00:00 2001 From: Dean Martinez Date: Sun, 12 Feb 2017 10:04:40 -0800 Subject: [PATCH 19/33] add interval to arc --- bezier-js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/bezier-js/index.d.ts b/bezier-js/index.d.ts index ff07e67f16..7706a46472 100644 --- a/bezier-js/index.d.ts +++ b/bezier-js/index.d.ts @@ -51,6 +51,7 @@ declare namespace BezierJs { e: number; r: number; s: number; + interval: { start: number; end: number; }; } interface Shape { startcap: BezierCap; From e39766cddc9d949c93216cae2e75f781bdf4d196 Mon Sep 17 00:00:00 2001 From: Dean Martinez Date: Sun, 12 Feb 2017 10:05:23 -0800 Subject: [PATCH 20/33] add interval to arc --- bezier-js/bezier-js-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bezier-js/bezier-js-tests.ts b/bezier-js/bezier-js-tests.ts index 5776ffd307..f5fba4d947 100644 --- a/bezier-js/bezier-js-tests.ts +++ b/bezier-js/bezier-js-tests.ts @@ -10,7 +10,7 @@ function test() { var utils = bezier.getUtils(); var line: BezierJs.Line = { p1: { x: 0, y: 0 }, p2: { x: 1, y: 1 } }; var abc: BezierJs.ABC = { A: null, B: null, C: null }; - var arc: BezierJs.Arc = { e: 0, s: 0, x: 0, y: 0, r: 1 }; + var arc: BezierJs.Arc = { e: 0, s: 0, x: 0, y: 0, r: 1, interval:{ start: 0, end: 1 } }; var bbox: BezierJs.BBox = bezier.bbox(); var closest: BezierJs.Closest = { mdist: 1, mpos: 0 }; var inflection: BezierJs.Inflection = { values: null, x: [0], y: [0], z: [0] }; @@ -95,4 +95,4 @@ function test() { utils.round(.999, .001); utils.shapeintersections(shape, bbox, shape, bbox); -} \ No newline at end of file +} From 01a2d0ed1f239af889e8f43e0a3c5acc8d9f15cc Mon Sep 17 00:00:00 2001 From: Martin Zagora Date: Mon, 13 Feb 2017 14:55:36 +1100 Subject: [PATCH 21/33] fix FindOrInitializeOptions and FindCreateFindOptions --- sequelize/index.d.ts | 23 +++++------------------ sequelize/sequelize-tests.ts | 2 +- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index 6ff2c3e6df..85283ff468 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -3319,38 +3319,25 @@ declare namespace sequelize { /** * Options for Model.findOrInitialize method */ - interface FindOrInitializeOptions extends LoggingOptions { - - /** - * A hash of search attributes. - */ - where: string | WhereOptions; + interface FindOrInitializeOptions extends FindOptions { /** * Default values to use if building a new instance */ defaults?: TAttributes; - /** - * Transaction to run query under - */ - transaction?: Transaction; } /** - * Options for Model.findOrInitialize method + * Options for Model.findOrInitialize method */ - interface FindCreateFindOptions { + interface FindCreateFindOptions extends FindOptions { /** - * A hash of search attributes. - */ - where: string | WhereOptions; - - /** - * Default values to use if building a new instance + * Default values to use if building a new instance */ defaults?: TAttributes; + } /** diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 973f98076c..9a54ea6d64 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -977,6 +977,7 @@ let findOrRetVal: Promise<[AnyInstance, boolean]>; findOrRetVal = User.findOrInitialize( { where : { username : 'foo' } } ); findOrRetVal = User.findOrInitialize( { where : { username : 'foo' }, transaction : t } ); findOrRetVal = User.findOrInitialize( { where : { username : 'foo' }, defaults : { foo : 'asd' }, transaction : t } ); +findOrRetVal = User.findOrInitialize( { where : { username : 'foo' }, defaults : { foo : 'asd' }, paranoid : false } ); findOrRetVal = User.findOrCreate( { where : { a : 'b' }, defaults : { json : { a : { b : 'c' }, d : [1, 2, 3] } } } ); findOrRetVal = User.findOrCreate( { where : { a : 'b' }, defaults : { json : 'a', data : 'b' } } ); @@ -989,7 +990,6 @@ findOrRetVal = User.findOrCreate( { where : { objectId : 'asdasdasd' }, defaults findOrRetVal = User.findOrCreate( { where : { id : undefined }, defaults : { name : Math.random().toString() } } ); findOrRetVal = User.findOrCreate( { where : { email : 'unique.email.@d.com', companyId : Math.floor( Math.random() * 5 ) } } ); findOrRetVal = User.findOrCreate( { where : { objectId : 1 }, defaults : { bool : false } } ); -findOrRetVal = User.findOrCreate( { where : 'c', defaults : {} } ); User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } ); From 763671753f546576a90cee689a6d930687dbf550 Mon Sep 17 00:00:00 2001 From: Homa Wong Date: Sun, 12 Feb 2017 22:16:22 -0800 Subject: [PATCH 22/33] Update index.d.ts --- jsdom/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsdom/index.d.ts b/jsdom/index.d.ts index a7d8e1d58b..0f272a7c35 100644 --- a/jsdom/index.d.ts +++ b/jsdom/index.d.ts @@ -89,7 +89,7 @@ export interface DocumentWithParentWindow extends Document { * equivalent to what a browser will give if you open up an empty .html file. * @param options see the explanation of the config object above. */ -export declare function jsdom(markup: string, config?: Config): DocumentWithParentWindow; +export declare function jsdom(markup?: string, config?: Config): DocumentWithParentWindow; /** * Before creating any documents, you can modify the defaults for all future documents: From 9b396a5a42900511092b65d7f3cecde1ff8d32dd Mon Sep 17 00:00:00 2001 From: mudkip Date: Mon, 13 Feb 2017 19:29:55 +0800 Subject: [PATCH 23/33] Fix type declaration of koa-hbs --- koa-hbs/index.d.ts | 61 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/koa-hbs/index.d.ts b/koa-hbs/index.d.ts index 8adfeaf20f..0b800418e7 100644 --- a/koa-hbs/index.d.ts +++ b/koa-hbs/index.d.ts @@ -1,22 +1,21 @@ -// Type definitions for koa-favicon v2.x +// Type definitions for koa-hbs v1.x // Project: https://github.com/gilt/koa-hbs // Definitions by: Jacob Malone // Definitions: https://github.com/jcbmln/DefinitelyTyped /* =================== USAGE =================== - import * as Hbs from "koa-hbs"; import * as Koa from "koa"; +....import hbs = require("koa-hbs"); - var hbs = new Hbs(); var app = new Koa(); app.use(hbs.middleware({ viewPath: __dirname + '/views' })); - app.use(function *() { - yield this.render('main', { + app.use(async (ctx, next) => { + await ctx.render('main', { title: 'koa-hbs' }); }); @@ -25,31 +24,33 @@ /// -declare module "koa-hbs" { +import * as Koa from "koa"; - import * as Koa from "koa"; - - namespace Hbs { - export interface Middleware { - viewPath: Array | string, - handlebars?: Function, - templateOptions?: {}, - extname?: string, - partialsPath?: Array | string, - defaultLayout?: string, - layoutsPath?: string, - contentHelperName?: string, - blockHelperName?: string, - disableCache?: boolean - } +declare namespace Hbs { + export interface Middleware { + viewPath: Array | string, + handlebars?: Function, + templateOptions?: {}, + extname?: string, + partialsPath?: Array | string, + defaultLayout?: string, + layoutsPath?: string, + contentHelperName?: string, + blockHelperName?: string, + disableCache?: boolean } - - class Hbs { - constructor(); - - middleware(opts: Hbs.Middleware): any; - } - - namespace Hbs {} - export = Hbs; } + +declare class Hbs { + constructor(); + middleware(opts: Hbs.Middleware): any; +} + +declare const hbs: Hbs; +export = hbs; + +declare module "koa" { + export interface Context extends Request, Response { + render(tpl: string, locals?: {[key: string]: any}): Promise; + } +} \ No newline at end of file From 9d697c95a22d31d4a163b37628f5809a362f6938 Mon Sep 17 00:00:00 2001 From: mudkip Date: Mon, 13 Feb 2017 19:49:34 +0800 Subject: [PATCH 24/33] Update koa-hbs test file --- koa-hbs/koa-hbs-tests.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/koa-hbs/koa-hbs-tests.ts b/koa-hbs/koa-hbs-tests.ts index 647eee7f22..43c708b581 100644 --- a/koa-hbs/koa-hbs-tests.ts +++ b/koa-hbs/koa-hbs-tests.ts @@ -1,16 +1,15 @@ -import * as Hbs from 'koa-hbs'; import * as Koa from 'koa'; +import hbs = require("koa-hbs"); import * as Path from 'path'; const app = new Koa(); -const hbs = new Hbs(); app.use(hbs.middleware({ viewPath: Path.join(__dirname, './views') })); -app.use(function *(next: any) { - yield this.render('index', { +app.use(async (ctx, next) => { + await this.render('index', { title: 'Hello World!' }); }); From c8e9da26290e17b609b12540a780049baac74ec8 Mon Sep 17 00:00:00 2001 From: Victor Widell Date: Mon, 13 Feb 2017 14:31:58 +0100 Subject: [PATCH 25/33] Removed Express dependency. This module has nothing to do with Express. Even the the example code uses plain `http.IncomingMessage`, not `Express.Request`. https://github.com/jshttp/basic-auth --- basic-auth/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic-auth/index.d.ts b/basic-auth/index.d.ts index 3dc19b3046..96e50232c7 100644 --- a/basic-auth/index.d.ts +++ b/basic-auth/index.d.ts @@ -3,9 +3,9 @@ // Definitions by: Clément Bourgeois // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import * as Express from 'express'; +import * as http from 'http'; -declare function auth(req: Express.Request): auth.BasicAuthResult; +declare function auth(req: http.IncomingMessage): auth.BasicAuthResult; declare namespace auth { interface BasicAuthResult { From b5973859aa90fae85a297dc4b099b16276b3448c Mon Sep 17 00:00:00 2001 From: Curtis Warren Date: Mon, 13 Feb 2017 10:47:07 -0600 Subject: [PATCH 26/33] make parameters optional for react-sticky component --- react-sticky/index.d.ts | 16 ++++++++-------- react-sticky/react-sticky-tests.tsx | 9 ++++++++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/react-sticky/index.d.ts b/react-sticky/index.d.ts index b3070b046a..2126d582ef 100644 --- a/react-sticky/index.d.ts +++ b/react-sticky/index.d.ts @@ -11,14 +11,14 @@ declare module "react-sticky" { export var StickyContainer: React.ComponentClass>; export interface StickyProps { - isActive: boolean; - className: string; - style: any; - stickyClassName: string; - stickyStyle: any; - topOffset: number; - bottomOffset: number; - onStickyStateChange: (isSticky: boolean) => void; + isActive?: boolean; + className?: string; + style?: any; + stickyClassName?: string; + stickyStyle?: any; + topOffset?: number; + bottomOffset?: number; + onStickyStateChange?: (isSticky: boolean) => void; } export var Sticky: React.ComponentClass; diff --git a/react-sticky/react-sticky-tests.tsx b/react-sticky/react-sticky-tests.tsx index 7ab99bf0c7..6eb9d0e0d0 100644 --- a/react-sticky/react-sticky-tests.tsx +++ b/react-sticky/react-sticky-tests.tsx @@ -1,9 +1,16 @@ import {Sticky, StickyContainer} from "react-sticky"; import * as React from "react"; -const StickyComponent: JSX.Element = +const StickyAllOptions: JSX.Element = undefined}> +
; +const StickyNoOptions: JSX.Element = + + +
+ + ; From 4d0bbd9260ab338ac24b427fe941681263599215 Mon Sep 17 00:00:00 2001 From: Caleb Eggensperger Date: Mon, 13 Feb 2017 14:29:03 -0500 Subject: [PATCH 27/33] space -> tab --- pako/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pako/index.d.ts b/pako/index.d.ts index bb3580454d..7f9b31f2b9 100644 --- a/pako/index.d.ts +++ b/pako/index.d.ts @@ -17,7 +17,7 @@ declare namespace Pako { to?: 'string'; } - export interface InflateOptions { + export interface InflateOptions { windowBits?: number; raw?: boolean; to?: 'string'; From 33c940d29d16e8fc559f56f7b0caaa443047b7cf Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 13 Feb 2017 12:36:11 -0800 Subject: [PATCH 28/33] Use dts-gen to generate new packages (#13405) --- README.md | 4 +- package.json | 5 +- scripts/new-package.js | 121 ------------------------------------- scripts/new-package.ts | 131 ----------------------------------------- 4 files changed, 6 insertions(+), 255 deletions(-) delete mode 100644 scripts/new-package.js delete mode 100644 scripts/new-package.ts diff --git a/README.md b/README.md index fd34c4ae33..a822c69c47 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,9 @@ Your package should have this structure: | tsconfig.json | This allows you to run `tsc` within the package. | | tslint.json | Enables linting. | -Generate these by running `npm run new-package -- new-package-name`. +Generate these by running `npm run new-package -- --name my-package-name --template module`. +(Other templates are `module-class`, `module-function`, `module-plugin`, `global`, `global-plugin`, and `global-modifying-module`. +This just wraps [dts-gen](https://github.com/Microsoft/dts-gen), so it supports all options from that.) You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option. diff --git a/package.json b/package.json index a9b9625069..1dad46394d 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,13 @@ }, "scripts": { "compile-scripts": "tsc -p scripts", - "new-package": "node scripts/new-package.js", + "new-package": "dts-gen --dt", "not-needed": "node scripts/not-needed.js", "lint": "node scripts/lint.js", "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 1" }, "devDependencies": { - "types-publisher": "Microsoft/types-publisher#production" + "types-publisher": "Microsoft/types-publisher#production", + "dts-gen": "latest" } } diff --git a/scripts/new-package.js b/scripts/new-package.js deleted file mode 100644 index 360fdff85f..0000000000 --- a/scripts/new-package.js +++ /dev/null @@ -1,121 +0,0 @@ -/// -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -const http_1 = require("http"); -const fs_1 = require("fs"); -const path = require("path"); -const newPackageName = process.argv[2]; -if (!newPackageName) { - throw new Error("Usage: node scripts/new-package.js new-package-name"); -} -run().catch(e => { - console.error(e); - process.exit(1); -}); -function run() { - return __awaiter(this, void 0, void 0, function* () { - const files = [ - ["index.d.ts", yield getIndex()], - [`${newPackageName}-tests.ts`, ""], - ["tsconfig.json", `${JSON.stringify(getTSConfig(), undefined, 4)}\n`], - ["tslint.json", '{ "extends": "../tslint.json" }\n'], - ]; - try { - yield pify1(fs_1.mkdir, newPackageName); - yield Promise.all(files.map(([name, text]) => write(name, text))); - } - catch (e) { - if (e.code === "EEXIST") { - console.warn(`Module “${newPackageName}” already exists!`); - } - else { - console.error(`Error creating module files: ${e}\nCleaning Up.`); - yield Promise.all(files.map(([name]) => rm(name))); - yield pify1(fs_1.rmdir, newPackageName); - } - process.exit(1); - } - }); -} -function getIndex() { - return __awaiter(this, void 0, void 0, function* () { - let version = "x.x"; - let project = "https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)"; - try { - const reg = JSON.parse(yield loadString(`http://registry.npmjs.org/${newPackageName}`)); - const { latest } = reg["dist-tags"]; - const { homepage } = reg.versions[latest]; - version = latest.split(".").slice(0, 2).join("."); - if (homepage !== undefined) - project = homepage; - } - catch (e) { - console.warn(`Warning: could not retrieve version/homepage information: ${e.message}`); - } - return `// Type definitions for ${newPackageName} ${version} -// Project: ${project} -// Definitions by: My Self -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -Fill the header in! -`; - }); -} -function getTSConfig() { - return { - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - `${newPackageName}-tests.ts` - ] - }; -} -function write(name, content) { - return new Promise((resolve, reject) => { - fs_1.writeFile(path.join(newPackageName, name), content, err => err ? reject(err) : resolve()); - }); -} -function rm(name) { - return pify1(fs_1.unlink, path.join(newPackageName, name)).catch((e) => { - if (e.code === "ENOENT") - return; - throw e; - }); -} -function pify1(fn, arg) { - return new Promise((resolve, reject) => { - fn(arg, err => err ? reject(err) : resolve()); - }); -} -function loadString(url) { - return new Promise((resolve, reject) => { - http_1.get(url, (res) => { - if (res.statusCode !== 200) { - return reject(new Error(`HTTP Error ${res.statusCode}: ${http_1.STATUS_CODES[res.statusCode || 500]} for ${url}`)); - } - let rawData = ""; - res.on("data", chunk => rawData += chunk); - res.on("end", () => resolve(rawData)); - }).on("error", e => reject(e)); - }); -} diff --git a/scripts/new-package.ts b/scripts/new-package.ts deleted file mode 100644 index 6e9384c896..0000000000 --- a/scripts/new-package.ts +++ /dev/null @@ -1,131 +0,0 @@ -/// - -import { get, STATUS_CODES } from "http" -import { mkdir, writeFile, unlink, rmdir } from "fs" -import * as path from "path" - -interface Package { - name: string - description: string - version: string - homepage?: string -} - -interface Registry { - name: string - description: string - "dist-tags": { latest: string } - versions: { [version: string]: Package } -} - -const newPackageName = process.argv[2] -if (!newPackageName) { - throw new Error("Usage: node scripts/new-package.js new-package-name") -} - -run().catch(e => { - console.error(e) - process.exit(1) -}) - -async function run() { - const files: [string, string][] = [ - ["index.d.ts", await getIndex()], - [`${newPackageName}-tests.ts`, ""], - ["tsconfig.json", `${JSON.stringify(getTSConfig(), undefined, 4)}\n`], - ["tslint.json", '{ "extends": "../tslint.json" }\n'], - ] - - try { - await pify1(mkdir, newPackageName) - await Promise.all(files.map(([name, text]) => write(name, text))) - } catch (e) { - if (e.code === "EEXIST") { - console.warn(`Module “${newPackageName}” already exists!`) - } else { - console.error(`Error creating module files: ${e}\nCleaning Up.`) - await Promise.all(files.map(([name]) => rm(name))) - await pify1(rmdir, newPackageName) - } - process.exit(1) - } -} - -async function getIndex() { - let version = "x.x" - let project = "https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)" - try { - const reg: Registry = JSON.parse(await loadString(`http://registry.npmjs.org/${newPackageName}`)) - - const { latest } = reg["dist-tags"] - const { homepage } = reg.versions[latest] - - version = latest.split(".").slice(0, 2).join(".") - if (homepage !== undefined) project = homepage - } catch (e) { - console.warn(`Warning: could not retrieve version/homepage information: ${e.message}`) - } - - return `// Type definitions for ${newPackageName} ${version} -// Project: ${project} -// Definitions by: My Self -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -Fill the header in! -` -} - -function getTSConfig() { - return { - "compilerOptions": { - "module": "commonjs", - "lib": ["es6"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - `${newPackageName}-tests.ts` - ] - } -} - -function write(name: string, content: string) { - return new Promise((resolve, reject) => { - writeFile(path.join(newPackageName, name), content, err => err ? reject(err): resolve()) - }) -} - -function rm(name: string) { - return pify1(unlink, path.join(newPackageName, name)).catch((e: NodeJS.ErrnoException) => { - if (e.code === "ENOENT") return - throw e - }) -} - -function pify1 void) => void, A>(fn: F, arg: A) { - return new Promise((resolve, reject) => { - fn(arg, err => err ? reject(err): resolve()) - }) -} - -function loadString(url: string): Promise { - return new Promise((resolve, reject) => { - get(url, (res) => { - if (res.statusCode !== 200) { - return reject(new Error(`HTTP Error ${res.statusCode}: ${STATUS_CODES[res.statusCode || 500]} for ${url}`)) - } - let rawData = "" - res.on("data", chunk => rawData += chunk) - res.on("end", () => resolve(rawData)) - }).on("error", e => reject(e)) - }) -} From b50151bbb6de8d616663369cf59f125ada1f4ed0 Mon Sep 17 00:00:00 2001 From: Thomas Hourlier Date: Mon, 13 Feb 2017 22:59:26 +0100 Subject: [PATCH 29/33] [nock]: support third parameter of intercept fn --- nock/index.d.ts | 3 ++- nock/nock-tests.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/nock/index.d.ts b/nock/index.d.ts index ef8afa86ac..180100a33f 100644 --- a/nock/index.d.ts +++ b/nock/index.d.ts @@ -34,7 +34,8 @@ declare namespace nock { type HttpHeaders = { [key: string]: string | { (req: any, res: any, body: string): any; }; }; type InterceptFunction = ( uri: string | RegExp | { (uri: string): boolean; }, - requestBody?: string | RegExp | { (body: any): boolean; } | any + requestBody?: string | RegExp | { (body: any): boolean; } | any, + interceptorOptions?: Options ) => Interceptor; export type ReplyCallback = (err: any, result: ReplyCallbackResult) => void; type ReplyCallbackResult = string | [number, string | any] | [number, string | any, HttpHeaders] | any; diff --git a/nock/nock-tests.ts b/nock/nock-tests.ts index e2c28d3311..8c2d48e736 100644 --- a/nock/nock-tests.ts +++ b/nock/nock-tests.ts @@ -21,32 +21,39 @@ inst = scope.head(str); inst = scope.get(str); inst = scope.get(str, data); +inst = scope.get(str, data, options); inst = scope.options(str); inst = scope.options(str, data); +inst = scope.options(str, data, options); inst = scope.patch(str); inst = scope.patch(str, str); inst = scope.patch(str, obj); +inst = scope.patch(str, obj, options); inst = scope.patch(str, regex); inst = scope.post(str); inst = scope.post(str, data); +inst = scope.post(str, data, options); inst = scope.post(str, obj); inst = scope.post(str, regex); inst = scope.put(str); inst = scope.put(str, data); +inst = scope.put(str, data, options); inst = scope.put(str, obj); inst = scope.put(str, regex); inst = scope.delete(str); inst = scope.delete(str, data); +inst = scope.delete(str, data, options); inst = scope.delete(str, obj); inst = scope.delete(str, regex); inst = scope.merge(str); inst = scope.merge(str, data); +inst = scope.merge(str, data, options); inst = scope.merge(str, obj); inst = scope.merge(str, regex); From 25fef3a37b9cd808b9b4d6a68148dcfd50f927ba Mon Sep 17 00:00:00 2001 From: mudkip Date: Tue, 14 Feb 2017 10:12:50 +0800 Subject: [PATCH 30/33] Fix koa-hbs-tests.ts --- koa-hbs/index.d.ts | 2 +- koa-hbs/koa-hbs-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koa-hbs/index.d.ts b/koa-hbs/index.d.ts index 0b800418e7..51c609e296 100644 --- a/koa-hbs/index.d.ts +++ b/koa-hbs/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for koa-hbs v1.x // Project: https://github.com/gilt/koa-hbs -// Definitions by: Jacob Malone +// Definitions by: Jacob Malone , Mudkip // Definitions: https://github.com/jcbmln/DefinitelyTyped /* =================== USAGE =================== diff --git a/koa-hbs/koa-hbs-tests.ts b/koa-hbs/koa-hbs-tests.ts index 43c708b581..3c86a51cad 100644 --- a/koa-hbs/koa-hbs-tests.ts +++ b/koa-hbs/koa-hbs-tests.ts @@ -9,7 +9,7 @@ app.use(hbs.middleware({ })); app.use(async (ctx, next) => { - await this.render('index', { + await ctx.render('index', { title: 'Hello World!' }); }); From 282fc7e05bc42559c5f84730a51c685974a882fc Mon Sep 17 00:00:00 2001 From: Kulshekhar Kabra Date: Tue, 14 Feb 2017 15:36:33 +0530 Subject: [PATCH 31/33] Add 'shape' property to the Matrix class --- vectorious/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vectorious/index.d.ts b/vectorious/index.d.ts index 63b53d20bf..c68e87236c 100644 --- a/vectorious/index.d.ts +++ b/vectorious/index.d.ts @@ -269,6 +269,8 @@ export class Vector { export class Matrix { T: Matrix; + + shape: number[]; /** * @method constructor @@ -586,4 +588,4 @@ export class Matrix { public toArray (): number[][]; } -export class BLAS {} \ No newline at end of file +export class BLAS {} From 15f95bdfc111d215523689183c942ecf975efe18 Mon Sep 17 00:00:00 2001 From: Victor Widell Date: Tue, 14 Feb 2017 18:24:56 +0100 Subject: [PATCH 32/33] Added reference to node. --- basic-auth/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/basic-auth/index.d.ts b/basic-auth/index.d.ts index 96e50232c7..51ada3b0c7 100644 --- a/basic-auth/index.d.ts +++ b/basic-auth/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Clément Bourgeois // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + import * as http from 'http'; declare function auth(req: http.IncomingMessage): auth.BasicAuthResult; From 6e3878446bab47d14f6f61c5e24e8e95984538e7 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 14 Feb 2017 19:55:22 +0100 Subject: [PATCH 33/33] added typescript 2.1.0 as a dependency, because of using keyof feature --- jasmine/package.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 jasmine/package.json diff --git a/jasmine/package.json b/jasmine/package.json new file mode 100644 index 0000000000..7e47d54c61 --- /dev/null +++ b/jasmine/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "typescript": ">=2.1.4" + } +} \ No newline at end of file