diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d0567940a8..43654ba600 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -277,7 +277,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](forge-di/forge-di.d.ts) [forge-di](https://github.com/nkohari/forge) by [Adam Carr](https://github.com/adamcarr) * [:link:](form-data/form-data.d.ts) [form-data](https://github.com/felixge/node-form-data) by [Carlos Ballesteros Velasco](https://github.com/soywiz) * [:link:](formidable/formidable.d.ts) [Formidable](https://github.com/felixge/node-formidable) by [Wim Looman](https://github.com/Nemo157) -* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov) +* [:link:](foundation/foundation.d.ts) [Foundation](http://foundation.zurb.com) by [Boris Yankov](https://github.com/borisyankov), [George Marshall](https://github.com/georgemarshall), [Boltmade](https://github.com/Boltmade) * [:link:](fpsmeter/FPSMeter.d.ts) [FPSmeter](http://darsa.in/fpsmeter) by [Aaron Lampros](http://github.com/alampros) * [:link:](from/from.d.ts) [from](https://github.com/dominictarr/from) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](fs-extra/fs-extra.d.ts) [fs-extra](https://github.com/jprichardson/node-fs-extra) by [midknight41](https://github.com/midknight41) diff --git a/ace/ace.d.ts b/ace/ace.d.ts index 4758b59e96..f0668da3c4 100644 --- a/ace/ace.d.ts +++ b/ace/ace.d.ts @@ -2609,6 +2609,16 @@ declare module AceAjax { * Returns `true` if there are redo operations left to perform. **/ hasRedo(): boolean; + + /** + * Returns `true` if the dirty counter is 0 + **/ + isClean(): boolean; + + /** + * Sets dirty counter to 0 + **/ + markClean(): void; } var UndoManager: { diff --git a/alt/alt-tests.ts b/alt/alt-tests.ts new file mode 100644 index 0000000000..403c9d99ae --- /dev/null +++ b/alt/alt-tests.ts @@ -0,0 +1,143 @@ +/** + * Created by shearerbeard on 6/28/15. + */ +/// +/// + +import Alt = require("alt"); +import Promise = require("es6-promise"); + +//New alt instance +var alt = new Alt(); + +//Interfaces for our Action Types +interface TestActionsGenerate { + notifyTest(str:string):void; +} + +interface TestActionsExplicit { + doTest(str:string):void; + success():void; + error():void; + loading():void; +} + +//Create abstracts to inherit ghost methods +class AbstractActions implements AltJS.ActionsClass { + constructor( alt:AltJS.Alt){} + actions:any; + dispatch: ( ...payload:Array) => void; + generateActions:( ...actions:Array) => void; +} + +class AbstractStoreModel implements AltJS.StoreModel { + bindActions:( ...actions:Array) => void; + bindAction:( ...args:Array) => void; + bindListeners:(obj:any)=> void; + exportPublicMethods:(config:{[key:string]:(...args:Array) => any}) => any; + exportAsync:( source:any) => void; + waitFor:any; + exportConfig:any; + getState:() => S; +} + +class GenerateActionsClass extends AbstractActions { + constructor(config:AltJS.Alt) { + this.generateActions("notifyTest"); + super(config); + } +} + +class ExplicitActionsClass extends AbstractActions { + doTest(str:string) { + this.dispatch(str); + } + success() { + this.dispatch(); + } + error() { + this.dispatch(); + } + loading() { + this.dispatch(); + } +} + +var generatedActions = alt.createActions(GenerateActionsClass); +var explicitActions = alt.createActions(ExplicitActionsClass); + +interface AltTestState { + hello:string; +} + +var testSource:AltJS.Source = { + fakeLoad():AltJS.SourceModel { + return { + remote() { + return new Promise.Promise((res:any, rej:any) => { + setTimeout(() => { + if(true) { + res("stuff"); + } else { + rej("Things have broken"); + } + }, 250) + }); + }, + local() { + return "local"; + }, + success: explicitActions.success, + error: explicitActions.error, + loading:explicitActions.loading + }; + } +}; + +class TestStore extends AbstractStoreModel implements AltTestState { + hello:string = "world"; + constructor() { + super(); + this.bindAction(generatedActions.notifyTest, this.onTest); + this.bindActions(explicitActions); + this.exportAsync(testSource); + this.exportPublicMethods({ + split: this.split + }); + } + onTest(str:string) { + this.hello = str; + } + + onDoTest(str:string) { + this.hello = str; + } + + split():string[] { + return this.hello.split(""); + } +} + +interface ExtendedTestStore extends AltJS.AltStore { + fakeLoad():string; + split():Array; +} + +var testStore = alt.createStore(TestStore); + +function testCallback(state:AltTestState) { + console.log(state); +} + +//Listen allows a typed state callback +testStore.listen(testCallback); +testStore.unlisten(testCallback); + +//State generic passes to derived store +var name:string = testStore.getState().hello; +var nameChars:Array = testStore.split(); + +generatedActions.notifyTest("types"); +explicitActions.doTest("more types"); + +export var result = testStore.getState(); diff --git a/alt/alt.d.ts b/alt/alt.d.ts new file mode 100644 index 0000000000..0e0b40d8fb --- /dev/null +++ b/alt/alt.d.ts @@ -0,0 +1,167 @@ +// Type definitions for Alt 0.16.10 +// Project: https://github.com/goatslacker/alt +// Definitions by: Michael Shearer +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module AltJS { + + interface StoreReduce { + action:any; + data: any; + } + + export interface StoreModel { + //Actions + bindAction?( action:Action, handler:ActionHandler):void; + bindActions?(actions:ActionsClass):void; + + //Methods/Listeners + exportPublicMethods?(exportConfig:any):void; + bindListeners?(config:{[methodName:string]:Action | Actions}):void; + exportAsync?(source:Source):void; + registerAsync?(datasource:Source):void; + + //state + setState?(state:S):void; + setState?(stateFn:(currentState:S, nextState:S) => S):void; + getState?():S; + waitFor?(store:AltStore):void; + + //events + onSerialize?(fn:(data:any) => any):void; + onDeserialize?(fn:(data:any) => any):void; + on?(event:AltJS.lifeCycleEvents, callback:() => any):void; + emitChange?():void; + waitFor?(storeOrStores:AltStore | Array>):void; + otherwise?(data:any, action:AltJS.Action):void; + observe?(alt:Alt):any; + reduce?(state:any, config:StoreReduce):Object; + preventDefault?():void; + afterEach?(payload:Object, state:Object):void; + beforeEach?(payload:Object, state:Object):void; + // TODO: Embed dispatcher interface in def + dispatcher?:any; + + //instance + getInstance?():AltJS.AltStore; + alt?:Alt; + displayName?:string; + } + + export type Source = {[name:string]: () => SourceModel}; + + export interface SourceModel { + local(state:any):any; + remote(state:any):Promise; + shouldFetch?(fetchFn:(...args:Array) => boolean):void; + loading?:(args:any) => void; + success?:(state:S) => void; + error?:(args:any) => void; + interceptResponse?(response:any, action:Action, ...args:Array):any; + } + + export interface AltStore { + getState():S; + listen(handler:(state:S) => any):() => void; + unlisten(handler:(state:S) => any):void; + emitChange():void; + } + + export enum lifeCycleEvents { + bootstrap, + snapshot, + init, + rollback, + error + } + + export type Actions = {[action:string]:Action}; + + export interface Action { + ( args:T):void; + defer(data:any):void; + } + + export interface ActionsClass { + generateActions?( ...action:Array):void; + dispatch( ...payload:Array):void; + actions?:Actions; + } + + type StateTransform = (store:StoreModel) => AltJS.AltStore; + + interface AltConfig { + dispatcher?:any; + serialize?:(serializeFn:(data:Object) => string) => void; + deserialize?:(deserializeFn:(serialData:string) => Object) => void; + storeTransforms?:Array; + batchingFunction?:(callback:( ...data:Array) => any) => void; + } + + class Alt { + constructor(config?:AltConfig); + actions:Actions; + bootstrap(jsonData:string):void; + takeSnapshot( ...storeNames:Array):string; + flush():Object; + recycle( ...stores:Array>):void; + rollback():void; + dispatch(action?:AltJS.Action, data?:Object, details?:any):void; + + //Actions methods + addActions(actionsName:string, ActionsClass: ActionsClassConstructor):void; + createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object):T; + createActions(ActionsClass: ActionsClassConstructor, exportObj?: Object, ...constructorArgs:Array):T; + generateActions( ...actions:Array):T; + getActions(actionsName:string):AltJS.Actions; + + //Stores methods + addStore(name:string, store:StoreModel, saveStore?:boolean):void; + createStore(store:StoreModel, name?:string):AltJS.AltStore; + getStore(name:string):AltJS.AltStore; + } + + export interface AltFactory { + new(config?:AltConfig):Alt; + } + + type ActionsClassConstructor = new (alt:Alt) => AltJS.ActionsClass; + + type ActionHandler = ( ...data:Array) => any; + type ExportConfig = {[key:string]:(...args:Array) => any}; +} + +declare module "alt/utils/chromeDebug" { + function chromeDebug(alt:AltJS.Alt):void; + export = chromeDebug; +} + +declare module "alt/AltContainer" { + + import React = require("react"); + + interface ContainerProps { + store?:AltJS.AltStore; + stores?:Array>; + inject?:{[key:string]:any}; + actions?:{[key:string]:Object}; + render?:(...props:Array) => React.ReactElement; + flux?:AltJS.Alt; + transform?:(store:AltJS.AltStore, actions:any) => any; + shouldComponentUpdate?:(props:any) => boolean; + component?:React.Component; + } + + type AltContainer = React.ReactElement; + var AltContainer:React.ComponentClass; + + export = AltContainer; +} + +declare module "alt" { + var alt:AltJS.AltFactory; + export = alt; +} diff --git a/amplifyjs/amplifyjs.d.ts b/amplifyjs/amplifyjs.d.ts index 364845f3c4..30e8272943 100644 --- a/amplifyjs/amplifyjs.d.ts +++ b/amplifyjs/amplifyjs.d.ts @@ -50,7 +50,7 @@ interface amplifyRequest { * success (optional): Function to invoke on success. * error (optional): Function to invoke on error. */ - (settings: amplifyRequestSettings); + (settings: amplifyRequestSettings): any; /*** * Define a resource. diff --git a/angular-local-storage/angular-local-storage.d.ts b/angular-local-storage/angular-local-storage.d.ts index f0500a96f6..ae027527a4 100644 --- a/angular-local-storage/angular-local-storage.d.ts +++ b/angular-local-storage/angular-local-storage.d.ts @@ -6,7 +6,7 @@ /// declare module angular.local.storage { - interface ILocalStorageServiceProvider extends IServiceProvider { + interface ILocalStorageServiceProvider extends angular.IServiceProvider { /** * Setter for the prefix * You should set a prefix to avoid overwriting any local storage variables from the rest of your app diff --git a/angular-material/angular-material-0.9.0.d.ts b/angular-material/angular-material-0.9.0.d.ts new file mode 100644 index 0000000000..1383b0beb5 --- /dev/null +++ b/angular-material/angular-material-0.9.0.d.ts @@ -0,0 +1,204 @@ +// Type definitions for Angular Material 0.9.0-rc1+ (angular.material module) +// Project: https://github.com/angular/material +// Definitions by: Matt Traynham +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +declare module angular.material { + + interface MDBottomSheetOptions { + templateUrl?: string; + template?: string; + scope?: angular.IScope; // default: new child scope + preserveScope?: boolean; // default: false + controller?: string|Function; + locals?: {[index: string]: any}; + targetEvent?: MouseEvent; + resolve?: {[index: string]: angular.IPromise} + controllerAs?: string; + parent?: string|Element|JQuery; // default: root node + disableParentScroll?: boolean; // default: true + } + + interface MDBottomSheetService { + show(options: MDBottomSheetOptions): angular.IPromise; + hide(response?: any): void; + cancel(response?: any): void; + } + + interface MDPresetDialog { + title(title: string): T; + content(content: string): T; + ok(ok: string): T; + theme(theme: string): T; + } + + interface MDAlertDialog extends MDPresetDialog { + } + + interface MDConfirmDialog extends MDPresetDialog { + cancel(cancel: string): MDConfirmDialog; + } + + interface MDDialogOptions { + templateUrl?: string; + template?: string; + targetEvent?: MouseEvent; + scope?: angular.IScope; // default: new child scope + preserveScope?: boolean; // default: false + disableParentScroll?: boolean; // default: true + hasBackdrop?: boolean // default: true + clickOutsideToClose?: boolean; // default: false + escapeToClose?: boolean; // default: true + focusOnOpen?: boolean; // default: true + controller?: string|Function; + locals?: {[index: string]: any}; + bindToController?: boolean; // default: false + resolve?: {[index: string]: angular.IPromise} + controllerAs?: string; + parent?: string|Element|JQuery; // default: root node + onComplete?: Function; + } + + interface MDDialogService { + show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise; + confirm(): MDConfirmDialog; + alert(): MDAlertDialog; + hide(response?: any): void; + cancel(response?: any): void; + } + + interface MDIcon { + (id: string): angular.IPromise; // id is a unique ID or URL + } + + interface MDIconProvider { + icon(id: string, url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px' + iconSet(id: string, url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px' + defaultIconSet(url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px' + defaultIconSize(iconSize: string): MDIconProvider; // default: '24px' + } + + interface MDMedia { + (media: string): boolean; + } + + interface MDSidenavObject { + toggle(): angular.IPromise; + open(): angular.IPromise; + close(): angular.IPromise; + isOpen(): boolean; + isLockedOpen(): boolean; + } + + interface MDSidenavService { + (component: string): MDSidenavObject; + } + + interface MDToastPreset { + content(content: string): T; + action(action: string): T; + highlightAction(highlightAction: boolean): T; + capsule(capsule: boolean): T; + theme(theme: string): T; + hideDelay(delay: number): T; + position(position: string): T; + } + + interface MDSimpleToastPreset extends MDToastPreset { + } + + interface MDToastOptions { + templateUrl?: string; + template?: string; + scope?: angular.IScope; // default: new child scope + preserveScope?: boolean; // default: false + hideDelay?: number; // default (ms): 3000 + position?: string; // any combination of 'bottom'/'left'/'top'/'right'/'fit'; default: 'bottom left' + controller?: string|Function; + locals?: {[index: string]: any}; + bindToController?: boolean; // default: false + resolve?: {[index: string]: angular.IPromise} + controllerAs?: string; + parent?: string|Element|JQuery; // default: root node + } + + interface MDToastService { + show(optionsOrPreset: MDToastOptions|MDToastPreset): angular.IPromise; + showSimple(): angular.IPromise; + simple(): MDSimpleToastPreset; + build(): MDToastPreset; + updateContent(): void; + hide(response?: any): void; + cancel(response?: any): void; + } + + interface MDPalette { + 0?: string; + 50?: string; + 100?: string; + 200?: string; + 300?: string; + 400?: string; + 500?: string; + 600?: string; + 700?: string; + 800?: string; + 900?: string; + A100?: string; + A200?: string; + A400?: string; + A700?: string; + contrastDefaultColor?: string; + contrastDarkColors?: string|string[]; + contrastLightColors?: string|string[]; + } + + interface MDThemeHues { + default?: string; + 'hue-1'?: string; + 'hue-2'?: string; + 'hue-3'?: string; + } + + interface MDThemePalette { + name: string; + hues: MDThemeHues; + } + + interface MDThemeColors { + accent: MDThemePalette; + background: MDThemePalette; + primary: MDThemePalette; + warn: MDThemePalette; + } + + interface MDThemeGrayScalePalette { + 1: string; + 2: string; + 3: string; + 4: string; + name: string; + } + + interface MDTheme { + name: string; + isDark: boolean; + colors: MDThemeColors; + foregroundPalette: MDThemeGrayScalePalette; + foregroundShadow: string; + accentPalette(name: string, hues?: MDThemeHues): MDTheme; + primaryPalette(name: string, hues?: MDThemeHues): MDTheme; + warnPalette(name: string, hues?: MDThemeHues): MDTheme; + backgroundPalette(name: string, hues?: MDThemeHues): MDTheme; + dark(isDark?: boolean): MDTheme; + } + + interface MDThemingProvider { + theme(name: string, inheritFrom?: string): MDTheme; + definePalette(name: string, palette: MDPalette): MDThemingProvider; + extendPalette(name: string, palette: MDPalette): MDPalette; + setDefaultTheme(theme: string): void; + alwaysWatchTheme(alwaysWatch: boolean): void; + } +} diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts index ae091c8057..238d906db6 100644 --- a/angular-material/angular-material-tests.ts +++ b/angular-material/angular-material-tests.ts @@ -3,11 +3,11 @@ var myApp = angular.module('testModule', ['ngMaterial']); myApp.config(( - $mdThemingProvider: ng.material.MDThemingProvider, - $mdIconProvider: ng.material.MDIconProvider) => { + $mdThemingProvider: ng.material.IThemingProvider, + $mdIconProvider: ng.material.IIconProvider) => { $mdThemingProvider.alwaysWatchTheme(true); - var neonRedMap: ng.material.MDPalette = $mdThemingProvider.extendPalette('red', { + var neonRedMap: ng.material.IPalette = $mdThemingProvider.extendPalette('red', { '500': 'ff0000' }); // Register the new color palette map with the name neonRed @@ -27,7 +27,7 @@ myApp.config(( .icon('work:chair', 'my/app/chair.svg'); // Register icon in a specific set }); -myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.MDBottomSheetService) => { +myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng.material.IBottomSheetService) => { $scope['openBottomSheet'] = () => { $mdBottomSheet.show({ template: 'Hello!' @@ -37,7 +37,7 @@ myApp.controller('BottomSheetController', ($scope: ng.IScope, $mdBottomSheet: ng $scope['cancelBottomSheet'] = $mdBottomSheet.cancel.bind($mdBottomSheet, 'cancel'); }); -myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.MDDialogService) => { +myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material.IDialogService) => { $scope['openDialog'] = () => { $mdDialog.show({ template: 'Hello!' @@ -55,8 +55,8 @@ myApp.controller('DialogController', ($scope: ng.IScope, $mdDialog: ng.material. class IconDirective implements ng.IDirective { - private $mdIcon: ng.material.MDIcon; - constructor($mdIcon: ng.material.MDIcon) { + private $mdIcon: ng.material.IIcon; + constructor($mdIcon: ng.material.IIcon) { this.$mdIcon = $mdIcon; } @@ -69,9 +69,9 @@ class IconDirective implements ng.IDirective { }); } } -myApp.directive('icon-directive', ($mdIcon: ng.material.MDIcon) => new IconDirective($mdIcon)); +myApp.directive('icon-directive', ($mdIcon: ng.material.IIcon) => new IconDirective($mdIcon)); -myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.MDMedia) => { +myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.IMedia) => { $scope.$watch(() => $mdMedia('lg'), (big: boolean) => { $scope['bigScreen'] = big; }); @@ -80,7 +80,7 @@ myApp.controller('MediaController', ($scope: ng.IScope, $mdMedia: ng.material.MD $scope['anotherCustom'] = $mdMedia('max-width: 300px'); }); -myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.MDSidenavService) => { +myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.material.ISidenavService) => { var componentId = 'left'; $scope['toggle'] = () => $mdSidenav(componentId).toggle(); $scope['open'] = () => $mdSidenav(componentId).open(); @@ -89,6 +89,6 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia $scope['isLockedOpen'] = $mdSidenav(componentId).isLockedOpen(); }); -myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.MDToastService) => { +myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => { $scope['openToast'] = () => $mdToast.show($mdToast.simple().content('Hello!')); }); \ No newline at end of file diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts index 1383b0beb5..aba83a86f8 100644 --- a/angular-material/angular-material.d.ts +++ b/angular-material/angular-material.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Angular Material 0.9.0-rc1+ (angular.material module) +// Type definitions for Angular Material 0.10.1-rc1+ (angular.material module) // Project: https://github.com/angular/material // Definitions by: Matt Traynham // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -6,7 +6,7 @@ /// declare module angular.material { - interface MDBottomSheetOptions { + interface IBottomSheetOptions { templateUrl?: string; template?: string; scope?: angular.IScope; // default: new child scope @@ -20,27 +20,45 @@ declare module angular.material { disableParentScroll?: boolean; // default: true } - interface MDBottomSheetService { - show(options: MDBottomSheetOptions): angular.IPromise; + interface IBottomSheetService { + show(options: IBottomSheetOptions): angular.IPromise; hide(response?: any): void; cancel(response?: any): void; } - interface MDPresetDialog { + interface IPresetDialog { title(title: string): T; content(content: string): T; ok(ok: string): T; theme(theme: string): T; + templateUrl(templateUrl?: string): T; + template(template?: string): T; + targetEvent(targetEvent?: MouseEvent): T; + scope(scope?: angular.IScope): T; // default: new child scope + preserveScope(preserveScope?: boolean): T; // default: false + disableParentScroll(disableParentScroll?: boolean): T; // default: true + hasBackdrop(hasBackdrop?: boolean): T; // default: true + clickOutsideToClose(clickOutsideToClose?: boolean): T; // default: false + escapeToClose(escapeToClose?: boolean): T; // default: true + focusOnOpen(focusOnOpen?: boolean): T; // default: true + controller(controller?: string|Function): T; + locals(locals?: {[index: string]: any}): T; + bindToController(bindToController?: boolean): T; // default: false + resolve(resolve?: {[index: string]: angular.IPromise}): T; + controllerAs(controllerAs?: string): T; + parent(parent?: string|Element|JQuery): T; // default: root node + onComplete(onComplete?: Function): T; + ariaLabel(ariaLabel: string): T; } - interface MDAlertDialog extends MDPresetDialog { + interface IAlertDialog extends IPresetDialog { } - interface MDConfirmDialog extends MDPresetDialog { - cancel(cancel: string): MDConfirmDialog; + interface IConfirmDialog extends IPresetDialog { + cancel(cancel: string): IConfirmDialog; } - interface MDDialogOptions { + interface IDialogOptions { templateUrl?: string; template?: string; targetEvent?: MouseEvent; @@ -60,30 +78,31 @@ declare module angular.material { onComplete?: Function; } - interface MDDialogService { - show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise; - confirm(): MDConfirmDialog; - alert(): MDAlertDialog; + interface IDialogService { + show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise; + confirm(): IConfirmDialog; + alert(): IAlertDialog; hide(response?: any): void; cancel(response?: any): void; } - interface MDIcon { + interface IIcon { (id: string): angular.IPromise; // id is a unique ID or URL } - interface MDIconProvider { - icon(id: string, url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px' - iconSet(id: string, url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px' - defaultIconSet(url: string, iconSize?: string): MDIconProvider; // iconSize default: '24px' - defaultIconSize(iconSize: string): MDIconProvider; // default: '24px' + interface IIconProvider { + icon(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24 + iconSet(id: string, url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24 + defaultIconSet(url: string, viewBoxSize?: number): IIconProvider; // viewBoxSize default: 24 + defaultViewBoxSize(viewBoxSize: number): IIconProvider; // default: 24 + defaultFontSet(name: string): IIconProvider; } - interface MDMedia { + interface IMedia { (media: string): boolean; } - interface MDSidenavObject { + interface ISidenavObject { toggle(): angular.IPromise; open(): angular.IPromise; close(): angular.IPromise; @@ -91,11 +110,11 @@ declare module angular.material { isLockedOpen(): boolean; } - interface MDSidenavService { - (component: string): MDSidenavObject; + interface ISidenavService { + (component: string): ISidenavObject; } - interface MDToastPreset { + interface IToastPreset { content(content: string): T; action(action: string): T; highlightAction(highlightAction: boolean): T; @@ -105,10 +124,10 @@ declare module angular.material { position(position: string): T; } - interface MDSimpleToastPreset extends MDToastPreset { + interface ISimpleToastPreset extends IToastPreset { } - interface MDToastOptions { + interface IToastOptions { templateUrl?: string; template?: string; scope?: angular.IScope; // default: new child scope @@ -123,17 +142,17 @@ declare module angular.material { parent?: string|Element|JQuery; // default: root node } - interface MDToastService { - show(optionsOrPreset: MDToastOptions|MDToastPreset): angular.IPromise; - showSimple(): angular.IPromise; - simple(): MDSimpleToastPreset; - build(): MDToastPreset; + interface IToastService { + show(optionsOrPreset: IToastOptions|IToastPreset): angular.IPromise; + showSimple(content: string): angular.IPromise; + simple(): ISimpleToastPreset; + build(): IToastPreset; updateContent(): void; hide(response?: any): void; cancel(response?: any): void; } - interface MDPalette { + interface IPalette { 0?: string; 50?: string; 100?: string; @@ -154,26 +173,26 @@ declare module angular.material { contrastLightColors?: string|string[]; } - interface MDThemeHues { + interface IThemeHues { default?: string; 'hue-1'?: string; 'hue-2'?: string; 'hue-3'?: string; } - interface MDThemePalette { + interface IThemePalette { name: string; - hues: MDThemeHues; + hues: IThemeHues; } - interface MDThemeColors { - accent: MDThemePalette; - background: MDThemePalette; - primary: MDThemePalette; - warn: MDThemePalette; + interface IThemeColors { + accent: IThemePalette; + background: IThemePalette; + primary: IThemePalette; + warn: IThemePalette; } - interface MDThemeGrayScalePalette { + interface IThemeGrayScalePalette { 1: string; 2: string; 3: string; @@ -181,23 +200,23 @@ declare module angular.material { name: string; } - interface MDTheme { + interface ITheme { name: string; isDark: boolean; - colors: MDThemeColors; - foregroundPalette: MDThemeGrayScalePalette; + colors: IThemeColors; + foregroundPalette: IThemeGrayScalePalette; foregroundShadow: string; - accentPalette(name: string, hues?: MDThemeHues): MDTheme; - primaryPalette(name: string, hues?: MDThemeHues): MDTheme; - warnPalette(name: string, hues?: MDThemeHues): MDTheme; - backgroundPalette(name: string, hues?: MDThemeHues): MDTheme; - dark(isDark?: boolean): MDTheme; + accentPalette(name: string, hues?: IThemeHues): ITheme; + primaryPalette(name: string, hues?: IThemeHues): ITheme; + warnPalette(name: string, hues?: IThemeHues): ITheme; + backgroundPalette(name: string, hues?: IThemeHues): ITheme; + dark(isDark?: boolean): ITheme; } - interface MDThemingProvider { - theme(name: string, inheritFrom?: string): MDTheme; - definePalette(name: string, palette: MDPalette): MDThemingProvider; - extendPalette(name: string, palette: MDPalette): MDPalette; + interface IThemingProvider { + theme(name: string, inheritFrom?: string): ITheme; + definePalette(name: string, palette: IPalette): IThemingProvider; + extendPalette(name: string, palette: IPalette): IPalette; setDefaultTheme(theme: string): void; alwaysWatchTheme(alwaysWatch: boolean): void; } diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts index 87a75439b2..1abb13ae81 100644 --- a/angular-translate/angular-translate.d.ts +++ b/angular-translate/angular-translate.d.ts @@ -5,6 +5,11 @@ /// +declare module "angular-translate" { + var _: string; + export = _; +} + declare module angular.translate { interface ITranslationTable { diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts index acc9342d92..ed2f36ccfc 100644 --- a/angular-ui-router/angular-ui-router.d.ts +++ b/angular-ui-router/angular-ui-router.d.ts @@ -20,7 +20,7 @@ declare module angular.ui { /** * Function, returns HTML content string */ - templateProvider?: Function; + templateProvider?: Function | Array; /** * A controller paired to the state. Function OR name as String */ @@ -41,7 +41,7 @@ declare module angular.ui { /** * A url with optional parameters. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. */ - url?: string; + url?: string | IUrlMatcher; /** * A map which optionally configures parameters declared in the url, or defines additional non-url parameters. Only use this within a state if you are not using url. Otherwise you can specify your parameters within the url. When a state is navigated or transitioned to, the $stateParams service will be populated with any parameters that were passed. */ @@ -88,6 +88,9 @@ declare module angular.ui { compile(pattern: string): IUrlMatcher; isMatcher(o: any): boolean; type(name: string, definition: any, definitionFn?: any): any; + caseInsensitive(value: boolean): void; + defaultSquashPolicy(value: string): void; + strictMode(value: boolean): void; } interface IUrlRouterProvider extends angular.IServiceProvider { diff --git a/angular.throttle/angular.throttle-tests.ts b/angular.throttle/angular.throttle-tests.ts new file mode 100644 index 0000000000..2234adbc37 --- /dev/null +++ b/angular.throttle/angular.throttle-tests.ts @@ -0,0 +1,8 @@ +/// +/// + +var throttledFn = angular.throttle(function (someArg:any) { + return someArg; +}, 100); + +var result = throttledFn(10); diff --git a/angular.throttle/angular.throttle.d.ts b/angular.throttle/angular.throttle.d.ts new file mode 100644 index 0000000000..0a3033e67a --- /dev/null +++ b/angular.throttle/angular.throttle.d.ts @@ -0,0 +1,12 @@ +// Type definitions for angular.throttle +// Project: https://github.com/BaggersIO/angular.throttle +// Definitions by: Stefan Steinhart +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular { + interface IAngularStatic { + throttle:( fn:Function, throttle:number, options?:{leading?:boolean; trailing?:boolean;} ) => Function; + } +} diff --git a/angular2/angular2-2.0.0-alpha.26.d.ts b/angular2/angular2-2.0.0-alpha.26.d.ts new file mode 100644 index 0000000000..a527b13cab --- /dev/null +++ b/angular2/angular2-2.0.0-alpha.26.d.ts @@ -0,0 +1,4624 @@ +// Type definitions for Angular v2.0.0-alpha.26 +// Project: http://angular.io/ +// Definitions by: angular team +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +// *********************************************************** +// This file is generated by the Angular build process. +// Please do not create manual edits or send pull requests +// modifying this file. +// *********************************************************** + +// Angular depends transitively on these libraries. +// If you don't have them installed you can run +// $ tsd query es6-promise rx rx-lite --action install --save +/// +/// + +interface List extends Array {} +interface Map {} +interface StringMap {} +interface Type {} + +declare module "angular2/angular2" { + type SetterFn = typeof Function; + type int = number; + + // See https://github.com/Microsoft/TypeScript/issues/1168 + class BaseException /* extends Error */ { + message: any; + stack: any; + toString(): string; + } +} + + +declare module "angular2/angular2" { + class AbstractChangeDetector extends ChangeDetector { + addChild(cd: ChangeDetector): any; + addShadowDomChild(cd: ChangeDetector): any; + callOnAllChangesDone(): any; + checkNoChanges(): any; + detectChanges(): any; + detectChangesInRecords(throwOnChange: boolean): any; + lightDomChildren: List; + markAsCheckOnce(): any; + markPathToRootAsCheckOnce(): any; + mode: string; + parent: ChangeDetector; + ref: ChangeDetectorRef; + remove(): any; + removeChild(cd: ChangeDetector): any; + removeShadowDomChild(cd: ChangeDetector): any; + shadowDomChildren: List; + } + + class ProtoRecord { + args: List; + bindingRecord: BindingRecord; + contextIndex: number; + directiveIndex: DirectiveIndex; + expressionAsString: string; + fixedArgs: List; + funcOrValue: any; + isLifeCycleRecord(): boolean; + isPipeRecord(): boolean; + isPureFunction(): boolean; + lastInBinding: boolean; + lastInDirective: boolean; + mode: number; + name: string; + selfIndex: number; + } + + class LifecycleEvent { + name: string; + } + + interface FormDirective { + addControl(dir: ControlDirective): void; + addControlGroup(dir: ControlGroupDirective): void; + getControl(dir: ControlDirective): Control; + removeControl(dir: ControlDirective): void; + removeControlGroup(dir: ControlGroupDirective): void; + updateModel(dir: ControlDirective, value: any): void; + } + + + /** + * A directive that contains a group of [ControlDirective]. + * + * @exportedAs angular2/forms + */ + class ControlContainerDirective { + formDirective: FormDirective; + name: string; + path: List; + } + + + /** + * A marker annotation that marks a class as available to `Injector` for creation. Used by tooling + * for generating constructor stubs. + * + * ``` + * class NeedsService { + * constructor(svc:UsefulService) {} + * } + * + * @Injectable + * class UsefulService {} + * ``` + * @exportedAs angular2/di_annotations + */ + class Injectable { + } + + + /** + * Injectable Objects that contains a live list of child directives in the light Dom of a directive. + * The directives are kept in depth-first pre-order traversal of the DOM. + * + * In the future this class will implement an Observable interface. + * For now it uses a plain list of observable callbacks. + * + * @exportedAs angular2/view + */ + class BaseQueryList { + add(obj: any): any; + fireCallbacks(): any; + onChange(callback: any): any; + removeCallback(callback: any): any; + reset(newList: any): any; + } + + class AppProtoView { + bindElement(parent: ElementBinder, distanceToParent: int, protoElementInjector: ProtoElementInjector, componentDirective?: DirectiveBinding): ElementBinder; + + /** + * Adds an event binding for the last created ElementBinder via bindElement. + * + * If the directive index is a positive integer, the event is evaluated in the context of + * the given directive. + * + * If the directive index is -1, the event is evaluated in the context of the enclosing view. + * + * @param {string} eventName + * @param {AST} expression + * @param {int} directiveIndex The directive index in the binder or -1 when the event is not bound + * to a directive + */ + bindEvent(eventBindings: List, boundElementIndex: number, directiveIndex?: int): void; + elementBinders: List; + protoChangeDetector: ProtoChangeDetector; + protoLocals: Map; + render: RenderProtoViewRef; + variableBindings: Map; + } + + + /** + * Const of making objects: http://jsperf.com/instantiate-size-of-object + */ + class AppView implements ChangeDispatcher, EventDispatcher { + callAction(elementIndex: number, actionExpression: string, action: Object): any; + changeDetector: ChangeDetector; + componentChildViews: List; + + /** + * The context against which data-binding expressions in this view are evaluated against. + * This is always a component instance. + */ + context: any; + dispatchEvent(elementIndex: number, eventName: string, locals: Map): boolean; + elementInjectors: List; + freeHostViews: List; + getDetectorFor(directive: DirectiveIndex): any; + getDirectiveFor(directive: DirectiveIndex): any; + hydrated(): boolean; + init(changeDetector: ChangeDetector, elementInjectors: List, rootElementInjectors: List, preBuiltObjects: List, componentChildViews: List): any; + + /** + * Variables, local to this view, that can be used in binding expressions (in addition to the + * context). This is used for thing like `