Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Raphael ATALLAH
2015-07-17 16:23:55 -07:00
276 changed files with 261310 additions and 15971 deletions

View File

@@ -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)

10
ace/ace.d.ts vendored
View File

@@ -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: {

143
alt/alt-tests.ts Normal file
View File

@@ -0,0 +1,143 @@
/**
* Created by shearerbeard on 6/28/15.
*/
///<reference path="alt.d.ts"/>
///<reference path="../es6-promise/es6-promise.d.ts" />
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<any>) => void;
generateActions:( ...actions:Array<string>) => void;
}
class AbstractStoreModel<S> implements AltJS.StoreModel<S> {
bindActions:( ...actions:Array<Object>) => void;
bindAction:( ...args:Array<any>) => void;
bindListeners:(obj:any)=> void;
exportPublicMethods:(config:{[key:string]:(...args:Array<any>) => 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<TestActionsGenerate>(GenerateActionsClass);
var explicitActions = alt.createActions<ExplicitActionsClass>(ExplicitActionsClass);
interface AltTestState {
hello:string;
}
var testSource:AltJS.Source = {
fakeLoad():AltJS.SourceModel<string> {
return {
remote() {
return new Promise.Promise<string>((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<AltTestState> 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<AltTestState> {
fakeLoad():string;
split():Array<string>;
}
var testStore = <ExtendedTestStore>alt.createStore<AltTestState>(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<string> = testStore.split();
generatedActions.notifyTest("types");
explicitActions.doTest("more types");
export var result = testStore.getState();

167
alt/alt.d.ts vendored Normal file
View File

@@ -0,0 +1,167 @@
// Type definitions for Alt 0.16.10
// Project: https://github.com/goatslacker/alt
// Definitions by: Michael Shearer <https://github.com/Shearerbeard>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../react/react.d.ts"/>
///<reference path="../es6-promise/es6-promise.d.ts" />
declare module AltJS {
interface StoreReduce {
action:any;
data: any;
}
export interface StoreModel<S> {
//Actions
bindAction?( action:Action<any>, handler:ActionHandler):void;
bindActions?(actions:ActionsClass):void;
//Methods/Listeners
exportPublicMethods?(exportConfig:any):void;
bindListeners?(config:{[methodName:string]:Action<any> | 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<any>):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<any> | Array<AltStore<any>>):void;
otherwise?(data:any, action:AltJS.Action<any>):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<S>;
alt?:Alt;
displayName?:string;
}
export type Source = {[name:string]: () => SourceModel<any>};
export interface SourceModel<S> {
local(state:any):any;
remote(state:any):Promise<S>;
shouldFetch?(fetchFn:(...args:Array<any>) => boolean):void;
loading?:(args:any) => void;
success?:(state:S) => void;
error?:(args:any) => void;
interceptResponse?(response:any, action:Action<any>, ...args:Array<any>):any;
}
export interface AltStore<S> {
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<any>};
export interface Action<T> {
( args:T):void;
defer(data:any):void;
}
export interface ActionsClass {
generateActions?( ...action:Array<string>):void;
dispatch( ...payload:Array<any>):void;
actions?:Actions;
}
type StateTransform = (store:StoreModel<any>) => AltJS.AltStore<any>;
interface AltConfig {
dispatcher?:any;
serialize?:(serializeFn:(data:Object) => string) => void;
deserialize?:(deserializeFn:(serialData:string) => Object) => void;
storeTransforms?:Array<StateTransform>;
batchingFunction?:(callback:( ...data:Array<any>) => any) => void;
}
class Alt {
constructor(config?:AltConfig);
actions:Actions;
bootstrap(jsonData:string):void;
takeSnapshot( ...storeNames:Array<string>):string;
flush():Object;
recycle( ...stores:Array<AltJS.AltStore<any>>):void;
rollback():void;
dispatch(action?:AltJS.Action<any>, data?:Object, details?:any):void;
//Actions methods
addActions(actionsName:string, ActionsClass: ActionsClassConstructor):void;
createActions<T>(ActionsClass: ActionsClassConstructor, exportObj?: Object):T;
createActions<T>(ActionsClass: ActionsClassConstructor, exportObj?: Object, ...constructorArgs:Array<any>):T;
generateActions<T>( ...actions:Array<string>):T;
getActions(actionsName:string):AltJS.Actions;
//Stores methods
addStore(name:string, store:StoreModel<any>, saveStore?:boolean):void;
createStore<S>(store:StoreModel<S>, name?:string):AltJS.AltStore<S>;
getStore(name:string):AltJS.AltStore<any>;
}
export interface AltFactory {
new(config?:AltConfig):Alt;
}
type ActionsClassConstructor = new (alt:Alt) => AltJS.ActionsClass;
type ActionHandler = ( ...data:Array<any>) => any;
type ExportConfig = {[key:string]:(...args:Array<any>) => 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<any>;
stores?:Array<AltJS.AltStore<any>>;
inject?:{[key:string]:any};
actions?:{[key:string]:Object};
render?:(...props:Array<any>) => React.ReactElement<any>;
flux?:AltJS.Alt;
transform?:(store:AltJS.AltStore<any>, actions:any) => any;
shouldComponentUpdate?:(props:any) => boolean;
component?:React.Component<any, any>;
}
type AltContainer = React.ReactElement<ContainerProps>;
var AltContainer:React.ComponentClass<ContainerProps>;
export = AltContainer;
}
declare module "alt" {
var alt:AltJS.AltFactory;
export = alt;
}

View File

@@ -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.

View File

@@ -6,7 +6,7 @@
/// <reference path='../angularjs/angular.d.ts' />
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

View File

@@ -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 <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../angularjs/angular.d.ts" />
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<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
disableParentScroll?: boolean; // default: true
}
interface MDBottomSheetService {
show(options: MDBottomSheetOptions): angular.IPromise<any>;
hide(response?: any): void;
cancel(response?: any): void;
}
interface MDPresetDialog<T> {
title(title: string): T;
content(content: string): T;
ok(ok: string): T;
theme(theme: string): T;
}
interface MDAlertDialog extends MDPresetDialog<MDAlertDialog> {
}
interface MDConfirmDialog extends MDPresetDialog<MDConfirmDialog> {
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<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
onComplete?: Function;
}
interface MDDialogService {
show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise<any>;
confirm(): MDConfirmDialog;
alert(): MDAlertDialog;
hide(response?: any): void;
cancel(response?: any): void;
}
interface MDIcon {
(id: string): angular.IPromise<Element>; // 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<void>;
open(): angular.IPromise<void>;
close(): angular.IPromise<void>;
isOpen(): boolean;
isLockedOpen(): boolean;
}
interface MDSidenavService {
(component: string): MDSidenavObject;
}
interface MDToastPreset<T> {
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<MDSimpleToastPreset> {
}
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<any>}
controllerAs?: string;
parent?: string|Element|JQuery; // default: root node
}
interface MDToastService {
show(optionsOrPreset: MDToastOptions|MDToastPreset<any>): angular.IPromise<any>;
showSimple(): angular.IPromise<any>;
simple(): MDSimpleToastPreset;
build(): MDToastPreset<any>;
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;
}
}

View File

@@ -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 <code>neonRed</code>
@@ -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: '<md-bottom-sheet>Hello!</md-bottom-sheet>'
@@ -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: '<md-dialog>Hello!</md-dialog>'
@@ -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!'));
});

View File

@@ -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 <https://github.com/mtraynham>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -6,7 +6,7 @@
/// <reference path="../angularjs/angular.d.ts" />
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<any>;
interface IBottomSheetService {
show(options: IBottomSheetOptions): angular.IPromise<any>;
hide(response?: any): void;
cancel(response?: any): void;
}
interface MDPresetDialog<T> {
interface IPresetDialog<T> {
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<any>}): 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<MDAlertDialog> {
interface IAlertDialog extends IPresetDialog<IAlertDialog> {
}
interface MDConfirmDialog extends MDPresetDialog<MDConfirmDialog> {
cancel(cancel: string): MDConfirmDialog;
interface IConfirmDialog extends IPresetDialog<IConfirmDialog> {
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<any>;
confirm(): MDConfirmDialog;
alert(): MDAlertDialog;
interface IDialogService {
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise<any>;
confirm(): IConfirmDialog;
alert(): IAlertDialog;
hide(response?: any): void;
cancel(response?: any): void;
}
interface MDIcon {
interface IIcon {
(id: string): angular.IPromise<Element>; // 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<void>;
open(): angular.IPromise<void>;
close(): angular.IPromise<void>;
@@ -91,11 +110,11 @@ declare module angular.material {
isLockedOpen(): boolean;
}
interface MDSidenavService {
(component: string): MDSidenavObject;
interface ISidenavService {
(component: string): ISidenavObject;
}
interface MDToastPreset<T> {
interface IToastPreset<T> {
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<MDSimpleToastPreset> {
interface ISimpleToastPreset extends IToastPreset<ISimpleToastPreset> {
}
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<any>): angular.IPromise<any>;
showSimple(): angular.IPromise<any>;
simple(): MDSimpleToastPreset;
build(): MDToastPreset<any>;
interface IToastService {
show(optionsOrPreset: IToastOptions|IToastPreset<any>): angular.IPromise<any>;
showSimple(content: string): angular.IPromise<any>;
simple(): ISimpleToastPreset;
build(): IToastPreset<any>;
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;
}

View File

@@ -5,6 +5,11 @@
/// <reference path="../angularjs/angular.d.ts" />
declare module "angular-translate" {
var _: string;
export = _;
}
declare module angular.translate {
interface ITranslationTable {

View File

@@ -20,7 +20,7 @@ declare module angular.ui {
/**
* Function, returns HTML content string
*/
templateProvider?: Function;
templateProvider?: Function | Array<any>;
/**
* 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 {

View File

@@ -0,0 +1,8 @@
/// <reference path="angular.throttle.d.ts" />
/// <reference path='../angularjs/angular.d.ts' />
var throttledFn = angular.throttle(function (someArg:any) {
return someArg;
}, 100);
var result = throttledFn(10);

12
angular.throttle/angular.throttle.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// Type definitions for angular.throttle
// Project: https://github.com/BaggersIO/angular.throttle
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare module angular {
interface IAngularStatic {
throttle:( fn:Function, throttle:number, options?:{leading?:boolean; trailing?:boolean;} ) => Function;
}
}

4624
angular2/angular2-2.0.0-alpha.26.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

6162
angular2/angular2-2.0.0-alpha.28.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

6875
angular2/angular2-2.0.0-alpha.30.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

6137
angular2/angular2-2.0.0-alpha.31.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,5 @@
/// <reference path="angular2.d.ts"/>
/// <reference path="router.d.ts"/>
// Use Typescript 1.4 style imports
import ng = require("angular2/angular2");

8876
angular2/angular2.d.ts vendored

File diff suppressed because it is too large Load Diff

352
angular2/router-2.0.0-alpha.30.d.ts vendored Normal file
View File

@@ -0,0 +1,352 @@
// Type definitions for Angular v2.0.0-alpha.30
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// 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.
// ***********************************************************
///<reference path="./angular2-2.0.0-alpha.30.d.ts"/>
/**
* @module
* @public
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
/**
* # Router
* 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 "outlets." 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 recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*
* @exportedAs angular2/router
*/
class Router {
navigating: boolean;
lastNavigationAttempt: string;
previousUrl: 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;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
* # Usage
*
* ```
* router.config({ 'path': '/', 'component': IndexCmp});
* ```
*
* Or:
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
* { 'path': '/user/:id', 'component': UserComp },
* ]);
* ```
*/
config(config: StringMap<string, any>| List<StringMap<string, any>>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
* 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.
*/
navigate(url: string): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: any): void;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction): Promise<any>;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): string;
}
class RootRouter extends Router {
commit(instruction: any): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
* ## Use
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
/**
* Given an instruction, update the contents of this outlet.
*/
activate(instruction: Instruction): Promise<any>;
deactivate(): Promise<any>;
canDeactivate(instruction: Instruction): Promise<boolean>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
* Consider the following route configuration:
*
* ```
* @RouteConfig({
* path: '/user', component: UserCmp, as: 'user'
* });
* class MyComp {}
* ```
*
* When linking to this `user` route, you can write:
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
* children for the route. And if the route begins with `../`, the router will look at the
* current component's parent.
*
* @exportedAs angular2/router
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: StringMap<string, any>): 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, parentComponent: any): Promise<Instruction>;
/**
* 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`.
*/
generate(linkParams: List<any>, parentComponent: any): string;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: any, onThrow?: any, onReturn?: any): void;
}
var appBaseHrefToken : OpaqueToken ;
class Instruction {
reuseComponentsFrom(oldInstruction: Instruction): void;
params(): StringMap<string, string>;
hasChild(): boolean;
}
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
var routerDirectives : List<any> ;
var routerInjectables : List<any> ;
var RouteConfig:any;
}
declare module "angular2/router" {
export = ng;
}

459
angular2/router-2.0.0-alpha.31.d.ts vendored Normal file
View File

@@ -0,0 +1,459 @@
// Type definitions for Angular v2.0.0-alpha.31
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// 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.
// ***********************************************************
///<reference path="./angular2.d.ts"/>
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
interface List<T> extends Array<T> {}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
export class Instruction {
// "capturedUrl" is the part of the URL captured by this instruction
// "accumulatedUrl" is the part of the URL captured by this instruction and all children
accumulatedUrl: string;
reuse: boolean;
specificity: number;
private _params: StringMap<string, string>;
constructor (component: any, capturedUrl: string,
_recognizer: PathRecognizer, child: Instruction);
params(): StringMap<string, string>;
}
class TouchMap {
map: StringMap<string, string>;
keys: StringMap<string, boolean>;
constructor(map: StringMap<string, any>);
get(key: string): string;
getUnused(): StringMap<string, any>;
}
export class Segment {
name: string;
regex: string;
generate(params: TouchMap): string;
}
export class PathRecognizer {
segments: List<Segment>;
regex: RegExp;
specificity: number;
terminal: boolean;
path: string;
handler: RouteHandler;
constructor(path: string, handler: RouteHandler);
parseParams(url: string): StringMap<string, string>;
generate(params: StringMap<string, any>): string;
resolveComponentType(): Promise<any>;
}
export interface RouteHandler {
componentType: Function;
resolveComponentType(): Promise<any>;
}
/**
* # Router
* 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 "outlets." 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 recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class 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;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
* # Usage
*
* ```
* router.config({ 'path': '/', 'component': IndexCmp});
* ```
*
* Or:
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
* { 'path': '/user/:id', 'component': UserComp },
* ]);
* ```
*/
config(config: StringMap<string, any>| List<StringMap<string, any>>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
* 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.
*/
navigate(url: string): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: any): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): string;
}
class RootRouter extends Router {
commit(instruction: any): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
* ## Use
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
* Consider the following route configuration:
*
* ```
* @RouteConfig({
* path: '/user', component: UserCmp, as: 'user'
* });
* class MyComp {}
* ```
*
* When linking to this `user` route, you can write:
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
* children for the route. And if the route begins with `../`, the router will look at the
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: StringMap<string, any>): 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, parentComponent: any): Promise<Instruction>;
/**
* 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`.
*/
generate(linkParams: List<any>, parentComponent: any): string;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: any, onThrow?: any, onReturn?: any): void;
}
var appBaseHrefToken : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate]
*/
interface OnActivate {
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onDeactivate]
*/
interface OnDeactivate {
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onReuse]
*/
interface OnReuse {
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canDeactivate]
*/
interface CanDeactivate {
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canReuse]
*/
interface CanReuse {
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
var CanActivate:any;
var routerDirectives : List<any> ;
var routerInjectables : List<any> ;
var RouteConfig:any;
}
declare module "angular2/router" {
export = ng;
}

459
angular2/router.d.ts vendored Normal file
View File

@@ -0,0 +1,459 @@
// Type definitions for Angular v2.0.0-alpha.31
// Project: http://angular.io/
// Definitions by: angular team <https://github.com/angular/>
// 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.
// ***********************************************************
///<reference path="./angular2.d.ts"/>
/**
* @module
* @description
* Maps application URLs into application states, to support deep-linking and navigation.
*/
declare module ng {
interface List<T> extends Array<T> {}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
export class Instruction {
// "capturedUrl" is the part of the URL captured by this instruction
// "accumulatedUrl" is the part of the URL captured by this instruction and all children
accumulatedUrl: string;
reuse: boolean;
specificity: number;
private _params: StringMap<string, string>;
constructor (component: any, capturedUrl: string,
_recognizer: PathRecognizer, child: Instruction);
params(): StringMap<string, string>;
}
class TouchMap {
map: StringMap<string, string>;
keys: StringMap<string, boolean>;
constructor(map: StringMap<string, any>);
get(key: string): string;
getUnused(): StringMap<string, any>;
}
export class Segment {
name: string;
regex: string;
generate(params: TouchMap): string;
}
export class PathRecognizer {
segments: List<Segment>;
regex: RegExp;
specificity: number;
terminal: boolean;
path: string;
handler: RouteHandler;
constructor(path: string, handler: RouteHandler);
parseParams(url: string): StringMap<string, string>;
generate(params: StringMap<string, any>): string;
resolveComponentType(): Promise<any>;
}
export interface RouteHandler {
componentType: Function;
resolveComponentType(): Promise<any>;
}
/**
* # Router
* 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 "outlets." 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 recognizes it and serialize it into an
* `Instruction`.
* The router uses the `RouteRegistry` to get an `Instruction`.
*/
class 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;
/**
* Register an object to notify of route changes. You probably don't need to use this unless
* you're writing a reusable component.
*/
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
/**
* Dynamically update the routing configuration and trigger a navigation.
*
* # Usage
*
* ```
* router.config({ 'path': '/', 'component': IndexCmp});
* ```
*
* Or:
*
* ```
* router.config([
* { 'path': '/', 'component': IndexComp },
* { 'path': '/user/:id', 'component': UserComp },
* ]);
* ```
*/
config(config: StringMap<string, any>| List<StringMap<string, any>>): Promise<any>;
/**
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
*
* 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.
*/
navigate(url: string): Promise<any>;
/**
* Updates this router and all descendant routers according to the given instruction
*/
commit(instruction: Instruction): Promise<any>;
/**
* Subscribe to URL updates from the router
*/
subscribe(onNext: any): void;
/**
* Removes the contents of this router's outlet and all descendant outlets
*/
deactivate(instruction: Instruction): Promise<any>;
/**
* Given a URL, returns an instruction representing the component graph
*/
recognize(url: string): Promise<Instruction>;
/**
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
* router has yet to successfully navigate.
*/
renavigate(): Promise<any>;
/**
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
* app's base href.
*/
generate(linkParams: List<any>): string;
}
class RootRouter extends Router {
commit(instruction: any): Promise<any>;
}
/**
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
*
* ## Use
*
* ```
* <router-outlet></router-outlet>
* ```
*/
class RouterOutlet {
childRouter: Router;
/**
* Given an instruction, update the contents of this outlet.
*/
commit(instruction: Instruction): Promise<any>;
/**
* Called by Router during recognition phase
*/
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
/**
* Called by Router during recognition phase
*/
canReuse(nextInstruction: Instruction): Promise<boolean>;
deactivate(nextInstruction: Instruction): Promise<any>;
}
/**
* The RouterLink directive lets you link to specific parts of your app.
*
* Consider the following route configuration:
*
* ```
* @RouteConfig({
* path: '/user', component: UserCmp, as: 'user'
* });
* class MyComp {}
* ```
*
* When linking to this `user` route, you can write:
*
* ```
* <a [router-link]="['./user']">link to user component</a>
* ```
*
* RouterLink expects the value to be an array of route names, followed by the params
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
* and with a child route `user` with params `{userId: 2}`.
*
* The first route name should be prepended with `/`, `./`, or `../`.
* If the route begins with `/`, the router will look up the route from the root of the app.
* If the route begins with `./`, the router will instead look in the current component's
* children for the route. And if the route begins with `../`, the router will look at the
* current component's parent.
*/
class RouterLink {
visibleHref: string;
routeParams: void;
onClick(): boolean;
}
class RouteParams {
params: StringMap<string, string>;
get(param: string): string;
}
/**
* The RouteRegistry holds route configurations for each component in an Angular app.
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
* parameters.
*/
class RouteRegistry {
/**
* Given a component and a configuration object, add the route to this registry
*/
config(parentComponent: any, config: StringMap<string, any>): 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, parentComponent: any): Promise<Instruction>;
/**
* 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`.
*/
generate(linkParams: List<any>, parentComponent: any): string;
}
class LocationStrategy {
path(): string;
pushState(ctx: any, title: string, url: string): void;
forward(): void;
back(): void;
onPopState(fn: any): void;
getBaseHref(): string;
}
class HashLocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
class HTML5LocationStrategy extends LocationStrategy {
onPopState(fn: EventListener): void;
getBaseHref(): string;
path(): string;
pushState(state: any, title: string, url: string): void;
forward(): void;
back(): void;
}
/**
* This is the service that an application developer will directly interact with.
*
* Responsible for normalizing the URL against the application's base href.
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
* trailing slash:
* - `/my/app/user/123` is normalized
* - `my/app/user/123` **is not** normalized
* - `/my/app/user/123/` **is not** normalized
*/
class Location {
path(): string;
normalize(url: string): string;
normalizeAbsolutely(url: string): string;
go(url: string): void;
forward(): void;
back(): void;
subscribe(onNext: any, onThrow?: any, onReturn?: any): void;
}
var appBaseHrefToken : OpaqueToken ;
/**
* Responsible for performing each step of navigation.
* "Steps" are conceptually similar to "middleware"
*/
class Pipeline {
steps: List<Function>;
process(instruction: Instruction): Promise<any>;
}
/**
* Defines route lifecycle method [onActivate]
*/
interface OnActivate {
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onDeactivate]
*/
interface OnDeactivate {
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [onReuse]
*/
interface OnReuse {
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canDeactivate]
*/
interface CanDeactivate {
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
/**
* Defines route lifecycle method [canReuse]
*/
interface CanReuse {
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
}
var CanActivate:any;
var routerDirectives : List<any> ;
var routerInjectables : List<any> ;
var RouteConfig:any;
}
declare module "angular2/router" {
export = ng;
}

View File

@@ -1,6 +1,6 @@
// Type definitions for Angular JS 1.3 (ngAnimate module)
// Project: http://angularjs.org
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>, Raphael Schweizer <https://github.com/rasch>
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>, Raphael Schweizer <https://github.com/rasch>, Cody Schaaf <https://github.com/codyschaaf>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular.d.ts" />
@@ -10,15 +10,22 @@ declare module "angular-animate" {
export = _;
}
///////////////////////////////////////////////////////////////////////////////
// ngAnimate module (angular-animate.js)
///////////////////////////////////////////////////////////////////////////////
/**
* ngAnimate module (angular-animate.js)
*/
declare module angular.animate {
interface IAnimateFactory extends Function {
enter?: (element: ng.IAugmentedJQuery, doneFn: Function) => IAnimateCssRunner|void;
leave?: (element: ng.IAugmentedJQuery, doneFn: Function) => IAnimateCssRunner|void;
addClass?: (element: ng.IAugmentedJQuery, className: string, doneFn: Function) => IAnimateCssRunner|void;
removeClass?: (element: ng.IAugmentedJQuery, className: string, doneFn: Function) => IAnimateCssRunner|void;
setClass?: (element: ng.IAugmentedJQuery, className: string, doneFn: Function) => IAnimateCssRunner|void;
}
///////////////////////////////////////////////////////////////////////////
// AnimateService
// see http://docs.angularjs.org/api/ngAnimate/service/$animate
///////////////////////////////////////////////////////////////////////////
/**
* AnimateService
* see http://docs.angularjs.org/api/ngAnimate/service/$animate
*/
interface IAnimateService extends angular.IAnimateService {
/**
* Globally enables / disables animations.
@@ -113,10 +120,10 @@ declare module angular.animate {
cancel(animationPromise: IPromise<void>): void;
}
///////////////////////////////////////////////////////////////////////////
// AngularProvider
// see http://docs.angularjs.org/api/ngAnimate/provider/$animateProvider
///////////////////////////////////////////////////////////////////////////
/**
* AngularProvider
* see http://docs.angularjs.org/api/ngAnimate/provider/$animateProvider
*/
interface IAnimateProvider {
/**
* Registers a new injectable animation factory function.
@@ -135,12 +142,120 @@ declare module angular.animate {
classNameFilter(expression?: RegExp): RegExp;
}
///////////////////////////////////////////////////////////////////////////
// Angular Animation Options
// see https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation
///////////////////////////////////////////////////////////////////////////
interface IAnimationOptions {
to?: Object;
from?: Object;
}
/**
* Angular Animation Options
* see https://docs.angularjs.org/api/ngAnimate/#applying-directive-specific-styles-to-an-animation
*/
interface IAnimationOptions {
/**
* The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.
*/
to?: Object;
/**
* The starting CSS styles (a key/value object) that will be applied at the start of the animation.
*/
from?: Object;
/**
* The DOM event (e.g. enter, leave, move). When used, a generated CSS class of ng-EVENT and
* ng-EVENT-active will be applied to the element during the animation. Multiple events can be provided when
* spaces are used as a separator. (Note that this will not perform any DOM operation.)
*/
event?: string;
/**
* The CSS easing value that will be applied to the transition or keyframe animation (or both).
*/
easing?: string;
/**
* The raw CSS transition style that will be used (e.g. 1s linear all).
*/
transition?: string;
/**
* The raw CSS keyframe animation style that will be used (e.g. 1s my_animation linear).
*/
keyframe?: string;
/**
* A space separated list of CSS classes that will be added to the element and spread across the animation.
*/
addClass?: string;
/**
* A space separated list of CSS classes that will be removed from the element and spread across
* the animation.
*/
removeClass?: string;
/**
* A number value representing the total duration of the transition and/or keyframe (note that a value
* of 1 is 1000ms). If a value of 0 is provided then the animation will be skipped entirely.
*/
duration?: number;
/**
* A number value representing the total delay of the transition and/or keyframe (note that a value of
* 1 is 1000ms). If a value of true is used then whatever delay value is detected from the CSS classes will be
* mirrored on the elements styles (e.g. by setting delay true then the style value of the element will be
* transition-delay: DETECTED_VALUE). Using true is useful when you want the CSS classes and inline styles to
* all share the same CSS delay value.
*/
delay?: number;
/**
* A numeric time value representing the delay between successively animated elements (Click here to
* learn how CSS-based staggering works in ngAnimate.)
*/
stagger?: number;
/**
* The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item
* in the stagger; therefore when a stagger option value of 0.1 is used then there will be a stagger delay of 600ms)
* applyClassesEarly - Whether or not the classes being added or removed will be used when detecting the animation.
* This is set by $animate when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time.
* (Note that this will prevent any transitions from occuring on the classes being added and removed.)
*/
staggerIndex?: number;
}
interface IAnimateCssRunner {
/**
* Starts the animation
*
* @returns The animation runner with a done function for supplying a callback.
*/
start(): IAnimateCssRunnerStart;
/**
* Ends (aborts) the animation
*/
end(): void;
}
interface IAnimateCssRunnerStart extends IPromise<void> {
/**
* Allows you to add done callbacks to the running animation
*
* @param callbackFn: the callback function to be run
*/
done(callbackFn: (animationFinished: boolean) => void): void;
}
/**
* AnimateCssService
* see http://docs.angularjs.org/api/ngAnimate/service/$animateCss
*/
interface IAnimateCssService {
(element: JQuery, animateCssOptions: IAnimationOptions): IAnimateCssRunner;
}
}
declare module angular {
interface IModule {
animate(cssSelector: string, animateFactory: angular.animate.IAnimateFactory): IModule;
}
}

View File

@@ -11,23 +11,23 @@ declare module "angular-cookies" {
export = _;
}
///////////////////////////////////////////////////////////////////////////////
// ngCookies module (angular-cookies.js)
///////////////////////////////////////////////////////////////////////////////
/**
* ngCookies module (angular-cookies.js)
*/
declare module angular.cookies {
///////////////////////////////////////////////////////////////////////////
// CookieService
// see http://docs.angularjs.org/api/ngCookies.$cookies
///////////////////////////////////////////////////////////////////////////
/**
* CookieService
* see http://docs.angularjs.org/api/ngCookies.$cookies
*/
interface ICookiesService {
[index: string]: any;
}
///////////////////////////////////////////////////////////////////////////
// CookieStoreService
// see http://docs.angularjs.org/api/ngCookies.$cookieStore
///////////////////////////////////////////////////////////////////////////
/**
* CookieStoreService
* see http://docs.angularjs.org/api/ngCookies.$cookieStore
*/
interface ICookiesService {
get(key: string): string;
getObject(key: string): any;
@@ -37,4 +37,27 @@ declare module angular.cookies {
remove(key: string, options?: any): void;
}
/**
* CookieStoreService DEPRECATED
* see https://code.angularjs.org/1.2.26/docs/api/ngCookies/service/$cookieStore
*/
interface ICookieStoreService {
/**
* Returns the value of given cookie key
* @param key Id to use for lookup
*/
get(key: string): any;
/**
* Sets a value for given cookie key
* @param key Id for the value
* @param value Value to be stored
*/
put(key: string, value: any): void;
/**
* Remove given cookie
* @param key Id of the key-value pair to delete
*/
remove(key: string): void;
}
}

View File

@@ -15,12 +15,6 @@ declare module "angular-mocks/ngAnimateMock" {
export = _;
}
///////////////////////////////////////////////////////////////////////////////
// functions attached to global object (window)
///////////////////////////////////////////////////////////////////////////////
declare var module: (...modules: any[]) => any;
declare var inject: (...fns: Function[]) => any;
///////////////////////////////////////////////////////////////////////////////
// ngMock module (angular-mocks.js)
///////////////////////////////////////////////////////////////////////////////
@@ -33,30 +27,32 @@ declare module angular {
interface IAngularStatic {
mock: IMockStatic;
}
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.inject
interface IInjectStatic {
(...fns: Function[]): any;
(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
strictDi(val?: boolean): void;
}
interface IMockStatic {
// see http://docs.angularjs.org/api/angular.mock.dump
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.dump
dump(obj: any): string;
// see http://docs.angularjs.org/api/angular.mock.inject
inject: {
(...fns: Function[]): any;
(...inlineAnnotatedConstructor: any[]): any; // this overload is undocumented, but works
strictDi(val?: boolean): void;
}
inject: IInjectStatic
// see http://docs.angularjs.org/api/angular.mock.module
// see https://docs.angularjs.org/api/ngMock/function/angular.mock.module
module(...modules: any[]): any;
// see http://docs.angularjs.org/api/angular.mock.TzDate
// see https://docs.angularjs.org/api/ngMock/type/angular.mock.TzDate
TzDate(offset: number, timestamp: number): Date;
TzDate(offset: number, timestamp: string): Date;
}
///////////////////////////////////////////////////////////////////////////
// ExceptionHandlerService
// see http://docs.angularjs.org/api/ngMock.$exceptionHandler
// see http://docs.angularjs.org/api/ngMock.$exceptionHandlerProvider
// see https://docs.angularjs.org/api/ngMock/service/$exceptionHandler
// see https://docs.angularjs.org/api/ngMock/provider/$exceptionHandlerProvider
///////////////////////////////////////////////////////////////////////////
interface IExceptionHandlerProvider extends IServiceProvider {
mode(mode: string): void;
@@ -64,7 +60,7 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
// TimeoutService
// see http://docs.angularjs.org/api/ngMock.$timeout
// see https://docs.angularjs.org/api/ngMock/service/$timeout
// Augments the original service
///////////////////////////////////////////////////////////////////////////
interface ITimeoutService {
@@ -75,7 +71,7 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
// IntervalService
// see http://docs.angularjs.org/api/ngMock.$interval
// see https://docs.angularjs.org/api/ngMock/service/$interval
// Augments the original service
///////////////////////////////////////////////////////////////////////////
interface IIntervalService {
@@ -84,7 +80,7 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
// LogService
// see http://docs.angularjs.org/api/ngMock.$log
// see https://docs.angularjs.org/api/ngMock/service/$log
// Augments the original service
///////////////////////////////////////////////////////////////////////////
interface ILogService {
@@ -98,7 +94,7 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
// HttpBackendService
// see http://docs.angularjs.org/api/ngMock.$httpBackend
// see https://docs.angularjs.org/api/ngMock/service/$httpBackend
///////////////////////////////////////////////////////////////////////////
interface IHttpBackendService {
flush(count?: number): void;
@@ -237,3 +233,9 @@ declare module angular {
}
}
///////////////////////////////////////////////////////////////////////////////
// functions attached to global object (window)
///////////////////////////////////////////////////////////////////////////////
declare var module: (...modules: any[]) => any;
declare var inject: angular.IInjectStatic;

View File

@@ -281,6 +281,7 @@ function test_IAttributes(attributes: ng.IAttributes){
}
test_IAttributes({
$normalize: function (classVal){},
$addClass: function (classVal){},
$removeClass: function(classVal){},
$set: function(key, value){},

View File

@@ -249,12 +249,12 @@ declare module angular {
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).
*/
@@ -419,6 +419,15 @@ declare module angular {
*/
[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): void;
/**
* Adds the CSS class value specified by the classVal parameter to the
* element. If animations are enabled then an animation will be triggered
@@ -524,11 +533,14 @@ declare module angular {
}
interface IModelValidators {
[index: string]: (modelValue: any, viewValue: string) => boolean;
/**
* 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: string) => IPromise<any>;
[index: string]: (modelValue: any, viewValue: any) => IPromise<any>;
}
interface IModelParser {
@@ -560,11 +572,11 @@ declare module angular {
/**
* 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.
*/
@@ -577,7 +589,7 @@ declare module angular {
* 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.
*/
@@ -757,16 +769,16 @@ declare module angular {
/**
* $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 {
/**
* Usage:
* $filter(name);
*
*
* @param name Name of the filter function to retrieve
*/
(name: string): Function;
@@ -774,15 +786,15 @@ declare module angular {
/**
* $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;
@@ -1033,10 +1045,10 @@ declare module angular {
interface IPromise<T> {
/**
* 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<void> 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<TResult>(successCallback: (promiseValue: T) => IHttpPromise<TResult>|IPromise<TResult>|TResult, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
then<TResult>(successCallback: (promiseValue: T) => IHttpPromise<TResult>|IPromise<TResult>|TResult|IPromise<void>, errorCallback?: (reason: any) => any, notifyCallback?: (state: any) => any): IPromise<TResult>;
/**
* Shorthand for promise.then(null, errorCallback)
@@ -1064,6 +1076,7 @@ declare module angular {
///////////////////////////////////////////////////////////////////////////
interface IAnchorScrollService {
(): void;
(hash: string): void;
yOffset: any;
}
@@ -1073,31 +1086,31 @@ declare module angular {
/**
* $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.
* 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;
@@ -1105,9 +1118,9 @@ declare module angular {
/**
* $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 {
@@ -1130,9 +1143,9 @@ declare module angular {
/**
* 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.
*/
@@ -1140,14 +1153,14 @@ declare module angular {
/**
* Retrieves named data stored in the Cache object.
*
*
* @param key the key of the data to be retrieved
*/
get(key: string): any;
/**
* Removes an entry from the Cache object.
*
*
* @param key the key of the entry to be removed
*/
remove(key: string): void;
@@ -1162,7 +1175,7 @@ declare module angular {
*/
destroy(): void;
}
///////////////////////////////////////////////////////////////////////////
// CompileService
// see http://docs.angularjs.org/api/ng.$compile
@@ -1414,6 +1427,12 @@ declare module angular {
* https://docs.angularjs.org/api/ng/service/$http#defaults
*/
interface IHttpProviderDefaults {
cache?: boolean;
/**
* 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.
*/
transformRequest?: ((data: any, headersGetter?: any) => any)|((data: any, headersGetter?: any) => any)[];
xsrfCookieName?: string;
xsrfHeaderName?: string;
withCredentials?: boolean;

View File

@@ -0,0 +1,11 @@
/// <reference path="api-error-handler.d.ts" />
import errorHandler = require('api-error-handler');
import express = require('express');
var api = express.Router();
api.get('/users/:userid', function (req, res, next) {
});
api.use(errorHandler());

View File

@@ -0,0 +1,14 @@
// Type definitions for api-error-handler v1.0.0
// Project: https://github.com/expressjs/api-error-handler
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module 'api-error-handler' {
import express = require('express');
function apiErrorHandler(options?: any): express.ErrorRequestHandler;
export = apiErrorHandler;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
[*.ts]
indent_style = tab
indent_size = 4

View File

@@ -0,0 +1,24 @@
/// <reference path="./atom-keymap.d.ts" />
import atomKeymap = require('atom-keymap');
var KeymapManager = atomKeymap.KeymapManager;
type ICompleteMatchEvent = AtomKeymap.ICompleteMatchEvent;
// The import and type aliasing above can be done more concisely in TypeScript 1.5+:
//import { KeymapManager, ICompleteMatchEvent } from "atom-keymap";
var manager = new KeymapManager();
manager.add('some/unique/path', {
'.workspace': {
'ctrl-x': 'package:do-something',
'ctrl-y': 'package:do-something-else'
},
'.mini.editor': {
'enter': 'core:confirm'
}
});
manager.onDidMatchBinding((event: ICompleteMatchEvent): void => {
console.log(event.binding.command);
})
manager.destroy();

135
atom-keymap/atom-keymap.d.ts vendored Normal file
View File

@@ -0,0 +1,135 @@
// Type definitions for atom-keymap v5.1.5
// Project: https://github.com/atom/atom-keymap/
// Definitions by: Vadim Macagon <https://github.com/enlight/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../event-kit/event-kit.d.ts" />
declare module AtomKeymap {
type Disposable = AtomEventKit.Disposable;
/** Instance side of KeyBinding class. */
interface KeyBinding {
enabled: boolean;
source: string;
command: string;
keystrokes: string;
keystrokeCount: number;
selector: string;
specificity: number;
matches(keystroke: string): boolean;
compare(keyBinding: KeyBinding): number;
}
interface ICompleteMatchEvent {
/** Keystrokes that matched the binding. */
keystrokes: string;
/** Binding that was matched to the keystrokes. */
binding: KeyBinding;
/** DOM element that was the target of the most recent `KeyboardEvent`. */
keyboardEventTarget: Element;
}
interface IPartialMatchEvent {
/** Keystrokes that matched the binding. */
keystrokes: string;
/** Bindings that were partially matched to the keystrokes. */
partiallyMatchedBindings: KeyBinding[];
/** DOM element that was the target of the most recent `KeyboardEvent`. */
keyboardEventTarget: Element;
}
interface IFailedMatchEvent {
/** Keystrokes that failed to match a binding. */
keystrokes: string;
/** DOM element that was the target of the most recent `KeyboardEvent`. */
keyboardEventTarget: Element;
}
interface IKeymapLoadEvent {
/** Path to a keymap file. */
path: string;
}
/** Static side of KeymapManager class. */
interface KeymapManagerStatic {
prototype: KeymapManager;
new (options?: { defaultTarget?: Element }): KeymapManager;
}
/** Instance side of KeymapManager class. */
interface KeymapManager {
constructor: KeymapManagerStatic;
/** Unwatches all watched paths. */
destroy(): void;
// Event Subscription
/** Sets callback to invoke when one or more keystrokes completely match a key binding. */
onDidMatchBinding(callback: (event: ICompleteMatchEvent) => void): Disposable;
/** Sets callback to invoke when one or more keystrokes partially match a binding. */
onDidPartiallyMatchBindings(callback: (event: IPartialMatchEvent) => void): Disposable;
/** Sets callback to invoke when one or more keystrokes fail to match any bindings. */
onDidFailToMatchBinding(callback: (event: IFailedMatchEvent) => void): Disposable;
/** Sets callback to invoke when a keymap file is reloaded. */
onDidReloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable;
/** Sets callback to invoke when a keymap file is unloaded. */
onDidUnloadKeymap(callback: (event: IKeymapLoadEvent) => void): Disposable;
/** Sets callback to invoke when a keymap file could not to be loaded. */
onDidFailToReadFile(callback: (error: Error) => void): Disposable;
// Adding and Removing Bindings
/** Adds sets of key bindings grouped by CSS selector. */
add(source: string, keyBindingsBySelector: any): Disposable;
// Accessing Bindings
getKeyBindings(): KeyBinding[];
findKeyBindings(params?: {
keystrokes: string; // e.g. 'ctrl-x ctrl-s'
command: string; // e.g. 'editor:backspace'
target?: Element;
}): KeyBinding[];
// Managing Keymap Files
/**
* Loads the key bindings from the given path.
*
* @param bindingsPath A path to a file or a directory. If the path is a directory all files
* inside it will be loaded.
*/
loadKeymap(bindingsPath: string, options?: { watch: boolean }): void;
/**
* Starts watching the given file/directory for changes, reloading any keymaps at that location
* when changes are detected.
*
* @param filePath A path to a file or a directory.
*/
watchKeymap(filePath: string): void;
// Managing Keyboard Events
/**
* Dispatches a custom event associated with the matching key binding for the given
* `KeyboardEvent` if one can be found.
*/
handleKeyboardEvent(event: KeyboardEvent): void;
/** Translates a keydown event to a keystroke string. */
keystrokeForKeyboardEvent(event: KeyboardEvent): string;
/**
* @return The number of milliseconds allowed before pending states caused by partial matches of
* multi-keystroke bindings are terminated.
*/
getPartialMatchTimeout(): number;
}
/** Allows commands to be associated with keystrokes in a context-sensitive way.*/
var KeymapManager: KeymapManagerStatic;
}
declare module 'atom-keymap' {
export = AtomKeymap;
}

153
atom/atom.d.ts vendored
View File

@@ -25,15 +25,36 @@ interface Window {
declare module AtomCore {
// https://atom.io/docs/v0.84.0/advanced/view-system
// https://atom.io/docs/v0.84.0/advanced/view-system
interface IWorkspaceViewStatic {
new ():IWorkspaceView;
version: number;
configDefaults:any;
content():any;
}
interface Decoration {
destroy(): void;
}
/**
* Represents a buffer annotation that remains logically stationary even as the buffer changes. This is used
* to represent cursors, folds, snippet targets, misspelled words, any anything else that needs to track a
* logical location in the buffer over time.
*/
interface Marker {
/**
* Destroys the marker, causing it to emit the 'destroyed' event. Once destroyed, a marker cannot be
* restored by undo/redo operations.
*/
destroy(): void;
/**
* Gets the screen range of the display marker.
*/
getScreenRange(): Range;
}
interface IWorkspaceView extends View {
// Delegator.includeInto(WorkspaceView);
@@ -143,6 +164,12 @@ declare module AtomCore {
highlightLines():boolean;
}
interface ICommandRegistry {
add(selector: string, name: string, callback: (event: any) => void): void; // selector:'atom-editor'|'atom-workspace'
findCommands(params: Object): Object[];
dispatch(selector: any, name:string): void;
}
interface ICommandPanel {
// TBD
}
@@ -344,11 +371,20 @@ declare module AtomCore {
foldForMarker(marker:any):any;
}
interface IViewRegistry {
getView(selector:any):any;
}
interface ICursorStatic {
new (arg:{editor:IEditor; marker:IDisplayBufferMarker; id: number;}):ICursor;
}
interface ScopeDescriptor {
scopes: string[];
}
interface ICursor /* extends Theorist.Model */ {
getScopeDescriptor(): ScopeDescriptor;
screenPosition:any;
bufferPosition:any;
goalColumn:any;
@@ -413,6 +449,7 @@ declare module AtomCore {
isAtEndOfLine():boolean;
getScopes():string[];
hasPrecedingCharactersOnLine():boolean;
getMarker(): Marker;
}
interface ILanguageMode {
@@ -561,11 +598,16 @@ declare module AtomCore {
subscribeToDisplayBuffer():void;
getViewClass():any; // return type are EditorView
destroyed():void;
isDestroyed():boolean;
copy():IEditor;
getTitle():string;
getLongTitle():string;
setVisible(visible:boolean):void;
setMini(mini:any):void;
setScrollTop(scrollTop:any):void;
getScrollTop():number;
setScrollLeft(scrollLeft:any):void;
getScrollLeft():number;
setEditorWidthInChars(editorWidthInChars:any):void;
getSoftWrapColumn():number;
getSoftTabs():boolean;
@@ -717,7 +759,7 @@ declare module AtomCore {
getSelectedBufferRanges():TextBuffer.IRange[];
getSelectedText():string;
getTextInBufferRange(range:TextBuffer.IRange):string;
setTextInBufferRange(range:TextBuffer.IRange, text:string):any;
setTextInBufferRange(range:TextBuffer.IRange | any[], text:string):any;
getCurrentParagraphBufferRange():TextBuffer.IRange;
getWordUnderCursor(options?:any):string;
moveCursorUp(lineCount?:number):void;
@@ -760,6 +802,7 @@ declare module AtomCore {
selectToPreviousWordBoundary():ISelection[];
selectToNextWordBoundary():ISelection[];
selectLine():ISelection[];
selectLinesContainingCursors():ISelection[];
addSelectionBelow():ISelection[];
addSelectionAbove():ISelection[];
splitSelectionsIntoLines():any[];
@@ -841,14 +884,43 @@ declare module AtomCore {
getVerticalScrollbarWidth():any;
setVerticalScrollbarWidth(width:any):any;
// deprecated joinLine():any;
onDidChange(callback: Function): Disposable;
onDidDestroy(callback: Function): Disposable;
onDidStopChanging(callback: Function): Disposable;
onDidChangeCursorPosition(callback: Function): Disposable;
onDidSave(callback: (event: { path: string }) => void): Disposable;
decorateMarker(marker: Marker, options: any): Decoration;
getLastCursor(): ICursor;
}
interface IGrammar {
bundledPackage: boolean;
emitter: any;
fileTypes: [string];
firstLineRegex: any;
foldingStopMarker: any;
includedGrammarScopes: [any];
initialRule: any;
injectionSelector: any;
injections: any;
maxTokensPerLine: Number;
name: string;
packageName: string;
path: string;
rawPatterns: [any];
rawRepository: any;
registration: Disposable;
registry: any;
repository: Object;
scopeName: string;
// TBD
}
interface IPane /* extends Theorist.Model */ {
itemForURI: (uri:string)=>IEditor;
items:any[];
activeItem:any;
@@ -856,6 +928,7 @@ declare module AtomCore {
deserializeParams(params:any):any;
getViewClass():any; // return type are PaneView
isActive():boolean;
isDestroyed():boolean;
focus():void;
blur():void;
activate():void;
@@ -886,7 +959,6 @@ declare module AtomCore {
saveItem(item:any, nextAction:Function):void;
saveItemAs(item:any, nextAction:Function):void;
saveItems():any[];
itemForURI(uri:any):any;
activateItemForURI(uri:any):any;
copyActiveItem():void;
splitLeft(params:any):IPane;
@@ -898,7 +970,7 @@ declare module AtomCore {
findOrCreateRightmostSibling():IPane;
}
// https://atom.io/docs/v0.84.0/advanced/serialization
// https://atom.io/docs/v0.84.0/advanced/serialization
interface ISerializationStatic<T> {
deserialize(data:ISerializationInfo):T;
new (data:T): ISerialization;
@@ -934,7 +1006,9 @@ declare module AtomCore {
// Serializable.includeInto(Project);
path:string;
rootDirectory:PathWatcher.IDirectory;
/** deprecated */
rootDirectory?:PathWatcher.IDirectory;
rootDirectories:PathWatcher.IDirectory[];
serializeParams():any;
deserializeParams(params:any):any;
@@ -964,26 +1038,52 @@ declare module AtomCore {
replace(regex:any, replacementText:any, filePaths:any, iterator:any):Q.Promise<any>;
buildEditorForBuffer(buffer:any, editorOptions:any):IEditor;
eachBuffer(...args:any[]):any;
onDidChangePaths(callback: Function): Disposable;
}
interface IWorkspaceStatic {
new():IWorkspace;
}
interface IWorkspacePanelOptions{
item:any;
visible?:boolean;
priority?:number;
}
interface Panel{
getItem():any;
getPriority():any;
isVisible():boolean;
show():void;
hide():void;
}
interface IWorkspace {
addBottomPanel(options:IWorkspacePanelOptions):Panel;
addLeftPanel(options:IWorkspacePanelOptions):Panel;
addRightPanel(options:IWorkspacePanelOptions):Panel;
addTopPanel(options:IWorkspacePanelOptions):Panel;
addModalPanel(options:IWorkspacePanelOptions):Panel;
addOpener(opener: Function): any;
deserializeParams(params:any):any;
serializeParams():{paneContainer:any;fullScreen:boolean;};
eachEditor(callback:Function):void;
getEditors():IEditor[];
eachEditor(callback: Function): void;
getTextEditors():IEditor[];
open(uri:string, options:any):Q.Promise<View>;
openLicense():void;
openSync(uri:string, options:any):any;
openURIInPane(uri:string, pane:any, options:any):Q.Promise<View>;
openUriInPane(uri: string, pane: any, options: any): Q.Promise<View>;
observeTextEditors(callback: Function): Disposable;
reopenItemSync():any;
registerOpener(opener:(urlToOpen:string)=>any):void;
unregisterOpener(opener:Function):void;
getOpeners():any;
getActivePane(): IPane;
getActivePaneItem(): IPane;
getActiveTextEditor(): IEditor;
getPanes():any;
saveAll():void;
activateNextPane():any;
@@ -1000,6 +1100,8 @@ declare module AtomCore {
itemOpened(item:any):void;
onPaneItemDestroyed(item:any):void;
destroyed():void;
onDidChangeActivePaneItem(item:any):Disposable;
}
interface IAtomSettings {
@@ -1041,7 +1143,7 @@ declare module AtomCore {
// TBD
}
interface IPackage {
interface IPackage {
mainModulePath: string;
mainModule: any;
enable(): void;
@@ -1053,8 +1155,8 @@ declare module AtomCore {
reset(): void;
activate(): Q.Promise<any[]>;
activateNow(): void;
// TBD
}
// TBD
}
interface IPackageManager extends Emissary.IEmitter {
packageDirPaths:string[];
@@ -1098,6 +1200,13 @@ declare module AtomCore {
getAvailablePackageMetadata():any[];
}
interface INotifications {
addInfo: Function;
addError: Function;
addSuccess: Function;
addWarning: Function;
}
interface IThemeManager {
// TBD
}
@@ -1111,7 +1220,8 @@ declare module AtomCore {
}
interface IClipboard {
// TBD
write(text:string, metadata?:any):any;
read():string;
}
interface ISyntax {
@@ -1150,13 +1260,6 @@ declare module AtomCore {
dispose():void
}
class CommandRegistry {
add(target:string, commandName:string, callback:Function):Disposable
findCommands(params:Object):Object[]
dispatch(target:any,commandName:string):void
}
// https://atom.io/docs/api/v0.106.0/api/classes/Atom.html
/* Global Atom class : instance members */
interface IAtom {
@@ -1166,14 +1269,17 @@ declare module AtomCore {
mode:string;
deserializers:IDeserializerManager;
config: IConfig;
commands: ICommandRegistry;
keymaps: IKeymapManager;
keymap: IKeymapManager;
packages: IPackageManager;
themes: IThemeManager;
contextManu: IContextMenuManager;
menu: IMenuManager;
notifications: INotifications; // https://github.com/atom/notifications
clipboard:IClipboard;
syntax:ISyntax;
views: IViewRegistry;
windowEventHandler: IWindowEventHandler;
// really exists? start
@@ -1187,8 +1293,6 @@ declare module AtomCore {
workspace: IWorkspace;
// really exists? end
commands: CommandRegistry;
initialize:Function;
// registerRepresentationClass:Function;
// registerRepresentationClasses:Function;
@@ -1243,6 +1347,8 @@ declare module AtomCore {
getUserInitScriptPath:Function;
requireUserInitScript:Function;
requireWithGlobals:Function;
services: any; // TODO: New services api
}
interface IBufferedNodeProcessStatic {
@@ -1718,6 +1824,7 @@ declare module "atom" {
cancelling:boolean;
items:any[];
list:JQuery;
filterEditorView: JQuery;
previouslyFocusedElement:JQuery;
@@ -1753,7 +1860,7 @@ declare module "atom" {
confirmSelection():any;
viewForItem(item:any):JQuery; // You must override this method!
viewForItem(item:any):JQuery|string|HTMLElement|View; // You must override this method!
confirmed(item:any):any; // You must override this method!
getFilterKey():any;

6
auth0/auth0.d.ts vendored
View File

@@ -15,7 +15,7 @@ interface Location {
/** This is the interface for the main Auth0 client. */
interface Auth0Static {
new(options: Auth0ClientOptions): Auth0Static;
changePassword(options: any, callback?: Function): void;
decodeJwt(jwt: string): any;
@@ -40,7 +40,7 @@ interface Auth0ClientOptions {
callbackOnLoactionHash?: boolean;
domain: string;
forceJSONP?: boolean;
}
}
/** Represents a normalized UserProfile. */
interface Auth0UserProfile {
@@ -128,6 +128,6 @@ interface Auth0DelegationToken {
declare var Auth0: Auth0Static;
declare module "Auth0" {
declare module "auth0" {
export = Auth0
}

View File

@@ -181,8 +181,8 @@ declare module Backbone {
comparator(element: TModel): number;
comparator(compare: TModel, to?: TModel): number;
add(model: TModel, options?: AddOptions): Collection<TModel>;
add(models: TModel[], options?: AddOptions): Collection<TModel>;
add(model: {}|TModel, options?: AddOptions): TModel;
add(models: ({}|TModel)[], options?: AddOptions): TModel[];
at(index: number): TModel;
/**
* Get a model from a collection, specified by an id, a cid, or by passing in a model.

View File

@@ -0,0 +1,7 @@
/// <reference path="./blob-stream.d.ts" />
/// <reference path="../node/node.d.ts" />
var bl = require('blob-stream');
var blob = bl.toBlob();
var brl = bl.toBlobURL("app/JSON");

20
blob-stream/blob-stream.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
// Type definitions for blob-stream v0.1.3
// Project: https://github.com/devongovett/blob-stream
// Definitions by: Eric Hillah <https://github.com/erichillah>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare function BlobStream(): BlobStream.IBlobStream;
declare module BlobStream {
interface IBlobStream extends NodeJS.WritableStream{
toBlob(type?: string): Blob;
toBlobURL(type?: string): string;
}
}
declare module "blob-stream" {
export = BlobStream;
}

View File

@@ -79,4 +79,9 @@ bs.init({
bs.reload();
function browserSyncInit(): browserSync.BrowserSync {
var browser = browserSync.create();
browser.init();
return browser;
}
var browser = browserSyncInit();

View File

@@ -88,24 +88,26 @@ declare module "browser-sync" {
fn: (match: string) => string;
}
interface BrowserSync {
init(config?: Options, callback?: (err: Error, bs: Object) => any): void;
reload(): void;
reload(file: string): void;
reload(files: string[]): void;
reload(options: {stream: boolean}): NodeJS.ReadWriteStream;
notify(message: string, timeout?: number): void;
exit(): void;
watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any): NodeJS.EventEmitter;
pause(): void;
resume(): void;
emitter: NodeJS.EventEmitter;
active: boolean;
paused: boolean;
module browserSync {
interface BrowserSync {
init(config?: Options, callback?: (err: Error, bs: Object) => any): void;
reload(): void;
reload(file: string): void;
reload(files: string[]): void;
reload(options: {stream: boolean}): NodeJS.ReadWriteStream;
notify(message: string, timeout?: number): void;
exit(): void;
watch(patterns: string, opts?: chokidar.WatchOptions, fn?: (event: string, file: fs.Stats) => any): NodeJS.EventEmitter;
pause(): void;
resume(): void;
emitter: NodeJS.EventEmitter;
active: boolean;
paused: boolean;
}
}
interface Exports extends BrowserSync {
create(): BrowserSync;
interface Exports extends browserSync.BrowserSync {
create(): browserSync.BrowserSync;
(config?: Options, callback?: (err: Error, bs: Object) => any): void;
}

View File

@@ -6,7 +6,7 @@
/// <reference path="../node/node.d.ts" />
interface BrowserifyObject extends NodeJS.EventEmitter {
add(file:string): BrowserifyObject;
add(file:string, opts?:any): BrowserifyObject;
require(file:string, opts?:{
expose: string;
}): BrowserifyObject;
@@ -18,10 +18,10 @@ interface BrowserifyObject extends NodeJS.EventEmitter {
insertGlobalVars?: any;
}, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
external(file:string): BrowserifyObject;
ignore(file:string): BrowserifyObject;
transform(tr:string): BrowserifyObject;
transform(tr:Function): BrowserifyObject;
external(file:string, opts?:any): BrowserifyObject;
ignore(file:string, opts?:any): BrowserifyObject;
transform(tr:string, opts?:any): BrowserifyObject;
transform(tr:Function, opts?:any): BrowserifyObject;
plugin(plugin:string, opts?:any): BrowserifyObject;
plugin(plugin:Function, opts?:any): BrowserifyObject;
}

1
chrome/chrome.d.ts vendored
View File

@@ -158,6 +158,7 @@ declare module chrome.bookmarks {
var onImportEnded: BookmarkImportEndedEvent;
var onImportBegan: BookmarkImportBeganEvent;
var onChanged: BookmarkChangedEvent;
var onMoved: BookmarkMovedEvent;
var onCreated: BookmarkCreatedEvent;
var onChildrenReordered: BookmarkChildrenReordered;
}

View File

@@ -0,0 +1,17 @@
///<reference path='classnames.d.ts' />
import classNames = require('classnames')
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', { bar: true }); // => 'foo bar'
classNames({ foo: true }, { bar: true }); // => 'foo bar'
classNames({ foo: true, bar: true }); // => 'foo bar'
// lots of arguments of various types
classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }) // => 'foo bar baz quux'
// other falsy values are just ignored
// NOTE: We don't really want to allow this kind of thing with Typescript (otherwise what's the point!)
//classNames(null, false, 'bar', undefined, 0, 1, { baz: null }, ''); // => 'bar 1'

13
classnames/classnames.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
// Type definitions for classnames
// Project: https://github.com/JedWatson/classnames
// Definitions by: Dave Keen <http://www.keendevelopment.ch>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface ClassDictionary {
[id: string]: boolean;
}
declare module "classnames" {
function classNames(...classes: (string|ClassDictionary)[]): string;
export = classNames
}

View File

@@ -16,3 +16,33 @@ var myCodeMirror4: CodeMirror.Editor = CodeMirror.fromTextArea(myTextArea);
var doc: CodeMirror.Doc = new CodeMirror.Doc('text');
var doc2: CodeMirror.Doc = CodeMirror(document.body).getDoc();
var lintStateOptions: CodeMirror.LintStateOptions = {
async: true,
hasGutters: true
};
var lintOptions: CodeMirror.LintOptions = {
async: true,
hasGutters: true,
getAnnotations: (content: string,
updateLintingCallback: CodeMirror.UpdateLintingCallback,
options: CodeMirror.LintStateOptions,
codeMirror: CodeMirror.Editor) => {}
};
var updateLintingCallback: CodeMirror.UpdateLintingCallback = (codeMirror: CodeMirror.Editor,
annotations: CodeMirror.Annotation[]) => {};
var annotation: CodeMirror.Annotation = {
from: {
ch: 0,
line: 0
},
to: {
ch: 1,
line: 0
},
message: "test",
severity: "warning"
};

View File

@@ -761,7 +761,10 @@ declare module CodeMirror {
This affects the amount of updates needed when scrolling, and the amount of work that such an update does.
You should usually leave it at its default, 10. Can be set to Infinity to make sure the whole document is always rendered,
and thus the browser's text search works on it. This will have bad effects on performance of big documents. */
viewportMargin?: number;
viewportMargin?: number;
/** Optional lint configuration to be used in conjunction with CodeMirror's linter addon. */
lint?: LintOptions;
}
interface TextMarkerOptions {
@@ -1004,6 +1007,48 @@ declare module CodeMirror {
* Both modes get to parse all of the text, but when both assign a non-null style to a piece of code, the overlay wins, unless
* the combine argument was true and not overridden, or state.overlay.combineTokens was true, in which case the styles are combined.
*/
function overlayMode<T, S>(base: Mode<T>, overlay: Mode<S>, combine?: boolean): Mode<any>
function overlayMode<T, S>(base: Mode<T>, overlay: Mode<S>, combine?: boolean): Mode<any>
/**
* async specifies that the lint process runs asynchronously. hasGutters specifies that lint errors should be displayed in the CodeMirror
* gutter, note that you must use this in conjunction with [ "CodeMirror-lint-markers" ] as an element in the gutters argument on
* initialization of the CodeMirror instance.
*/
interface LintStateOptions {
async: boolean;
hasGutters: boolean;
}
/**
* Adds the getAnnotations callback to LintStateOptions which may be overridden by the user if they choose use their own
* linter.
*/
interface LintOptions extends LintStateOptions {
getAnnotations: AnnotationsCallback;
}
/**
* A function that calls the updateLintingCallback with any errors found during the linting process.
*/
interface AnnotationsCallback {
(content: string, updateLintingCallback: UpdateLintingCallback, options: LintStateOptions, codeMirror: Editor): void;
}
/**
* A function that, given an array of annotations, updates the CodeMirror linting GUI with those annotations
*/
interface UpdateLintingCallback {
(codeMirror: Editor, annotations: Annotation[]): void;
}
/**
* An annotation contains a description of a lint error, detailing the location of the error within the code, the severity of the error,
* and an explaination as to why the error was thrown.
*/
interface Annotation {
from: Position;
message?: string;
severity?: string;
to?: Position;
}
}

View File

@@ -0,0 +1,8 @@
/// <reference path="compare-version.d.ts" />
import compareVersion = require('compare-version');
var result :number;
result = compareVersion('1.11.0', '1.11.0');
result = compareVersion('1.11.0', '1.2.9');
result = compareVersion('1.11.3', '1.11.25');

11
compare-version/compare-version.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
// Type definitions for compare-version v0.1.2
// Project: https://www.npmjs.com/package/compare-version
// Definitions by: Jonathan Pevarnek <https://github.com/jpevarnek/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'compare-version' {
function compare(a: string, b: string): number;
export = compare;
}

View File

@@ -0,0 +1,16 @@
import context = require("contextjs");
context.init();
context.settings({compress: true});
context.attach('#test', [
{header: 'header 1'},
{divider: true},
{text:'foobar', submenu: [
{text:'sub1'},
{text:'sub2'}
]}
]);
context.destroy('#test');

33
contextjs/contextjs.d.ts vendored Normal file
View File

@@ -0,0 +1,33 @@
// Type definitions for contextjs 2.1.1
// Project: https://github.com/jakiestfu/Context.js
// Definitions by: Kern Handa <https://github.com/kernhanda>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "contextjs" {
interface MenuObject {
action?: (e: Event) => void;
divider?: boolean;
header?: string;
href?: string;
subMenu?: MenuObject[];
target?: string;
text?: string;
}
interface InitSettings {
above?: string | boolean;
compress?: boolean;
fadeSpeed?: number;
filter?: (e: Element) => void;
preventDoubleContext?: boolean;
}
module context {
function init(settings?: InitSettings): void;
function destroy(selector: any): void;
function attach(selector: any, menuObjects: MenuObject[]): void;
function settings(settings: InitSettings): void;
}
export = context;
}

1
cson/cson-test.cson Normal file
View File

@@ -0,0 +1 @@
hello: 'world'

1
cson/cson-test.json Normal file
View File

@@ -0,0 +1 @@
{"hello": "world"}

36
cson/cson-tests.ts Normal file
View File

@@ -0,0 +1,36 @@
/// <reference path="cson.d.ts" />
import cson = require('cson');
var data: string = cson.stringify({hello: 'world'});
console.log('cson.stringify => %s', data);
data = cson.createString({hello: 'world'});
console.log('cson.createString => %s', data);
data = cson.createJSONString({hello: 'world'});
console.log('cson.createJSONString => %s', data);
data = cson.createCSONString({hello: 'world'});
console.log('cson.createCSONString => %s', data);
var obj: Object = cson.parse(data);
console.log('cson.parse => %s', JSON.stringify(obj));
obj = cson.parseCSONString(data);
console.log('cson.parseCSONString => %s', JSON.stringify(obj));
obj = cson.parseJSONString('{"hello": "world"}');
console.log('cson.parseJSONString => %s', JSON.stringify(obj));
obj = cson.parseString("hello: 'world'");
console.log('cson.parseString => %s', JSON.stringify(obj));
obj = cson.load('cson-test.cson');
console.log('cson.load => %s', JSON.stringify(obj));
obj = cson.parseCSONFile('cson-test.cson');
console.log('cson.parseCSONFile => %s', JSON.stringify(obj));
obj = cson.parseJSONFile('cson-test.json');
console.log('cson.parseJSONFile => %s', JSON.stringify(obj));

32
cson/cson.d.ts vendored Normal file
View File

@@ -0,0 +1,32 @@
// Type definitions for CSON
// Project: https://github.com/bevry/cson
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "cson" {
// Create Strings
export function stringify(data: Object, opts?: Object, indent?: any): string;
export function createCSONString(data: Object, opts?: Object, next?: any): string;
export function createJSONString(data: Object, opts?: Object, next?: any): string;
export function createString(data: Object, opts?: Object, next?: any): string;
// Parse Strings
export function parse(data: string, opts?: Object, next?: any): Object;
export function parseCSONString(data: string, opts?: Object, next?: any): Object;
export function parseJSONString(data: string, opts?: Object, next?: any): Object;
export function parseCSString(data: string, opts?: Object, next?: any): Object;
export function parseJSString(data: string, opts?: Object, next?: any): Object;
export function parseString(data: string, opts?: Object, next?:any): Object;
// Parse Files
export function load(filePath: string, opts?: Object, next?: any): Object;
export function parseCSONFile(filePath: string, opts?: Object, next?: any): Object;
export function parseJSONFile(filePath: string, opts?: Object, next?: any): Object;
export function parseCSFile(filePath: string, opts?: Object, next?: any): Object;
export function parseJSFile(filePath: string, opts?: Object, next?: any): Object;
// Require Files
export function requireCSFile(filePath: string, opts?: Object, next?: any): Object;
export function requireJSFile(filePath: string, opts?: Object, next?: any): Object;
export function requireFile(filePath: string, opts?: Object, next?: any): Object;
}

5
cuid/cuid-tests.ts Normal file
View File

@@ -0,0 +1,5 @@
///<reference path='cuid.d.ts' />
import cuid = require('cuid')
var result: string = cuid();

10
cuid/cuid.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
// Type definitions for cuid
// Project: https://github.com/ericelliott/cuid
// Definitions by: Dave Keen <http://www.keendevelopment.ch>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'cuid' {
function cuid(): string;
export = cuid
}

View File

@@ -2677,4 +2677,17 @@ function testD3Events () {
console.log('shift + ' + d3.event.which);
}
});
}
function testD3MutlieTimeFormat() {
var format = d3.time.format.multi([
[".%L", function(d) { return d.getMilliseconds(); }],
[":%S", function(d) { return d.getSeconds(); }],
["%I:%M", function(d) { return d.getMinutes(); }],
["%I %p", function(d) { return d.getHours(); }],
["%a %d", function(d) { return d.getDay() && d.getDate() != 1; }],
["%b %d", function(d) { return d.getDate() != 1; }],
["%B", function(d) { return d.getMonth(); }],
["%Y", function() { return true; }]
]);
}

10
d3/d3.d.ts vendored
View File

@@ -386,7 +386,7 @@ declare module d3 {
/**
* Returns the first non-null element in the selection, or null otherwise.
*/
node(): EventTarget;
node(): Node;
/**
* Returns the total number of elements in the selection.
@@ -1090,8 +1090,8 @@ declare module d3 {
export function bisectRight<T>(array: T[], x: T, lo?: number, hi?: number): number;
export function bisector<T, U>(accessor: (x: T) => U): {
left: (array: T[], x: T, lo?: number, hi?: number) => number;
right: (array: T[], x: T, lo?: number, hi?: number) => number;
left: (array: T[], x: U, lo?: number, hi?: number) => number;
right: (array: T[], x: U, lo?: number, hi?: number) => number;
}
export function bisector<T, U>(comparator: (a: T, b: U) => number): {
@@ -1780,7 +1780,7 @@ declare module d3 {
export function format(specifier: string): Format;
export module format {
export function multi(formats: Array<[string, (d: Date) => boolean]>): Format;
export function multi(formats: Array<[string, (d: Date) => boolean|number]>): Format;
export function utc(specifier: string): Format;
export var iso: Format;
}
@@ -2535,6 +2535,7 @@ declare module d3 {
tickFormat(): (t: any) => string;
tickFormat(format: (t: any) => string): Axis;
tickFormat(format:string): Axis;
}
export function brush(): Brush<any>;
@@ -2719,6 +2720,7 @@ declare module d3 {
timeFormat: {
(specifier: string): time.Format;
utc(specifier: string): time.Format;
multi(formats: Array<[string, (d: Date) => boolean|number]>): time.Format;
}
}

12
dagre/dagre.d.ts vendored
View File

@@ -10,20 +10,24 @@ declare module Dagre{
interface Graph {
new (): Graph;
edges(): string[];
edge(id: string): any;
edges(): Edge[];
edge(id: any): any;
nodes(): string[];
node(id: string): any;
node(id: any): any;
setDefaultEdgeLabel(callback: () => void): Graph;
setEdge(sourceId: string, targetId: string): Graph;
setGraph(options: { [key: string]: any }): Graph;
setNode(id: string, node: { [key: string]: any }): Graph;
}
interface Edge {
v: string;
w: string;
}
interface GraphLib {
Graph: Graph;
}
}
declare var dagre: Dagre.DagreFactory;

View File

@@ -34,7 +34,7 @@ declare module deepDiff {
}
}
declare var diff: deepDiff.IDeepDiff;
declare var DeepDiff: deepDiff.IDeepDiff;
declare module "deep-diff" {
var diff: deepDiff.IDeepDiff;

View File

@@ -3,6 +3,10 @@ import del = require("del");
var paths = ["build", "dist/**/*.js"];
del(["tmp/*.js", "!tmp/unicorn.js"]);
del(["tmp/*.js", "!tmp/unicorn.js"], {force: true});
del(["tmp/*.js", "!tmp/unicorn.js"], (err, paths) => {
console.log('Deleted files/folders:\n', paths.join('\n'));
});
@@ -11,6 +15,10 @@ del(["tmp/*.js", "!tmp/unicorn.js"], {force: true}, (err, paths) => {
console.log('Deleted files/folders:\n', paths.join('\n'));
});
del("tmp/*.js");
del("tmp/*.js", {force: true});
del("tmp/*.js", (err, paths) => {
console.log('Deleted files/folders:\n', paths.join('\n'));
});
@@ -25,4 +33,4 @@ del.sync(["tmp/*.js", "!tmp/unicorn.js"], {force: true});
del.sync("tmp/*.js");
del.sync("tmp/*.js", {force: true});
del.sync("tmp/*.js", {force: true});

11
del/del.d.ts vendored
View File

@@ -1,4 +1,4 @@
// Type definitions for del
// Type definitions for del v1.2.0
// Project: https://github.com/sindresorhus/del
// Definitions by: Asana <https://asana.com>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -8,13 +8,16 @@
declare module "del" {
import glob = require("glob");
function Del(pattern: string): void;
function Del(pattern: string, options: Del.Options): void;
function Del(pattern: string, callback: (err: Error, deletedFiles: string[]) => any): void;
function Del(pattern: string, options: Del.Options, callback: (err: Error, deletedFiles: string[]) => any): void;
function Del(patterns: string[]): void;
function Del(patterns: string[], options: Del.Options): void;
function Del(patterns: string[], callback: (err: Error, deletedFiles: string[]) => any): void;
function Del(patterns: string[], options: Del.Options, callback: (err: Error, deletedFiles: string[]) => any): void;
module Del {
function sync(pattern: string, options?: Options): void;
function sync(patterns: string[], options?: Options): void;
@@ -25,4 +28,4 @@ declare module "del" {
}
export = Del;
}
}

6403
devextreme/dx.devextreme-15.1.3.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
/// <reference path="dexie.d.ts" />
import Dexie = require("Dexie");
import Dexie = require("dexie");
module Utils {

2
dexie/dexie.d.ts vendored
View File

@@ -315,6 +315,6 @@ declare module Dexie {
}
}
declare module 'Dexie' {
declare module 'dexie' {
export = Dexie;
}

4
dojo/dojo.d.ts vendored
View File

@@ -1671,7 +1671,7 @@ declare module dojo {
* @param selector A CSS selector to search for.
* @param context OptionalAn optional context to limit the searching scope. Only nodes under context will bescanned.
*/
interface query{(selector: String, context?: String): void}
interface query{(selector: String, context?: String): NodeList}
/**
* Permalink: http://dojotoolkit.org/api/1.9/dojo/query.html
*
@@ -1713,7 +1713,7 @@ declare module dojo {
* @param selector A CSS selector to search for.
* @param context OptionalAn optional context to limit the searching scope. Only nodes under context will bescanned.
*/
interface query{(selector: String, context?: HTMLElement): void}
interface query{(selector: String, context?: HTMLElement): NodeList}
interface query {
/**
* can be used as AMD plugin to conditionally load new query engine

View File

@@ -0,0 +1,44 @@
/**
* Created by karl on 14/07/15.
*/
/// <reference path="../express/express.d.ts" />
/// <reference path="./easy-api-request.d.ts" />
import express = require('express');
import APIRequest = require('easy-api-request');
APIRequest.create({
name: 'testAPI',
config: {
url: 'http://example.com'
}
});
var app = express();
app.get('/', function (req:any, res:express.Response) {
var rMaker = <APIRequest.RequestMaker>req.testAPI;
var r = rMaker();
r.get('/', function (err, resp) {
if(err) {
console.error(err);
}
res.json(err || resp);
});
});
app.get('/', function (req:any, res:express.Response) {
var rMaker = <APIRequest.RequestMaker>req.testAPI;
var r = rMaker();
r.get('/')
.then(function (resp) {
res.json(resp);
})
.catch(function (err){
if(err) {
console.error(err);
}
res.json(err);
});
});

115
easy-api-request/easy-api-request.d.ts vendored Normal file
View File

@@ -0,0 +1,115 @@
// Type definitions for easy-api-request
// Project: https://github.com/DeadAlready/easy-api-request
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../q/Q.d.ts" />
/// <reference path="../node/node.d.ts" />
/// <reference path="../request/request.d.ts" />
/// <reference path="../bunyan/bunyan.d.ts" />
/// <reference path="../express/express.d.ts" />
declare module "easy-api-request" {
import stream = require('stream');
import http = require('http');
import request = require('request');
import bunyan = require('bunyan');
import express = require('express');
export function create(opts: {
name: any;
config: {
url: string;
internal?: boolean;
headers?: string[];
cookies?: string[];
replyCookies?: string[];
jSend?: boolean;
opts?: Object;
};
}): void;
import Q = require('q');
interface Result {
response: http.IncomingMessage;
body: any;
err?: any;
data?: any;
}
class BaseRequest {
protected base: request.Request;
protected req: express.Request;
protected log: bunyan.Logger;
protected replyCookies: string[];
protected jSend: boolean;
constructor(opts: any);
_parseOptions(args: IArguments, type: string): {
opts: any;
cb: any;
};
_do(args: IArguments, type?: string): any;
_request(opts?: any, cb?:any): any;
get(url?: any, opts?: any, cb?: any): any;
post(url?: any, opts?: any, cb?: any): any;
patch(url?: any, opts?: any, cb?: any): any;
del(url?: any, opts?: any, cb?: any): any;
}
class StreamRequest extends BaseRequest {
_request(opts: Object): stream.Stream;
get(url: string, params: Object): stream.Stream;
get(opts: Object): stream.Stream;
get(url: string): stream.Stream;
post(url: string, params: Object): stream.Stream;
post(opts: Object): stream.Stream;
post(url: string): stream.Stream;
patch(url: string, params: Object): stream.Stream;
patch(opts: Object): stream.Stream;
patch(url: string): stream.Stream;
del(url: string, params: Object): stream.Stream;
del(opts: Object): stream.Stream;
del(url: string): stream.Stream;
}
class CBPromiseRequest extends BaseRequest {
_request(opts: Object): stream.Stream;
get(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void;
get(url: string, cb:(err?:any, resp?: Result) => void): void;
get(opts: Object, cb:(err?:any, resp?: Result) => void): void;
get(url: string, params: Object): Q.Promise<Result>;
get(opts: Object): Q.Promise<Result>;
get(url: string): Q.Promise<Result>;
post(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void;
post(url: string, cb:(err?:any, resp?: Result) => void): void;
post(opts: Object, cb:(err?:any, resp?: Result) => void): void;
post(url: string, params: Object): Q.Promise<Result>;
post(opts: Object): Q.Promise<Result>;
post(url: string): Q.Promise<Result>;
patch(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void;
patch(url: string, cb:(err?:any, resp?: Result) => void): void;
patch(opts: Object, cb:(err?:any, resp?: Result) => void): void;
patch(url: string, params: Object): Q.Promise<Result>;
patch(opts: Object): Q.Promise<Result>;
patch(url: string): Q.Promise<Result>;
del(url: string, params: Object, cb:(err?:any, resp?: Result) => void): void;
del(url: string, cb:(err?:any, resp?: Result) => void): void;
del(opts: Object, cb:(err?:any, resp?: Result) => void): void;
del(url: string, params: Object): Q.Promise<Result>;
del(opts: Object): Q.Promise<Result>;
del(url: string): Q.Promise<Result>;
}
export interface RequestMaker {
(): CBPromiseRequest;
(stream: boolean): StreamRequest | CBPromiseRequest;
}
}

View File

@@ -0,0 +1,49 @@
/// <reference path="./easy-jsend.d.ts" />
/// <reference path="../mongoose/mongoose.d.ts" />
import mongoose = require('mongoose');
import express = require('express');
import jSend = require('easy-jsend');
var schema = new mongoose.Schema({
name: {type: String}
});
var Model = mongoose.model('model', schema);
jSend.init({partial: true});
var app = express();
app.get('/success', function (req, res, next) {
res.success('Success');
});
app.get('/fail', function (req, res, next) {
res.fail('fail');
});
app.get('/error', function (req, res, next) {
res.error('error');
});
app.get('/partial', function (req, res, next) {
res.partial({
offset: 10,
limit: 50,
count: 100,
data: []
});
});
app.get('/partial', function (req, res, next) {
res.makePartial({
model: Model,
search: {},
opts: {
limit: 30,
skip: 10
},
result: []
});
});

38
easy-jsend/easy-jsend.d.ts vendored Normal file
View File

@@ -0,0 +1,38 @@
// Type definitions for easy-jsend
// Project: https://github.com/DeadAlready/easy-jsend
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module Express {
interface MakePartialInput {
model:any;
opts: {
limit: number;
skip: number;
};
search: Object;
result: any;
}
interface PartialInput {
limit?: number;
offset: number;
count: number;
data: any;
}
export interface Response {
success (data?: any, status?: number): void;
fail (data: any, status?: number): void;
error (err: any, status?: number): void;
partial? (data: PartialInput, status?: number): void;
makePartial? (data: MakePartialInput): void;
}
}
declare module "easy-jsend" {
export function init(conf?:{partial:boolean}): void;
}

View File

@@ -0,0 +1,16 @@
/**
* Created by karl on 14/07/15.
*/
/// <reference path="../express/express.d.ts" />
/// <reference path="./easy-x-headers.d.ts" />
import express = require('express');
import xHeaders = require('easy-x-headers');
var app = express();
app.use(xHeaders.getMiddleware());
app.get('/', function (req, res) {
res.json(req.info);
});

18
easy-x-headers/easy-x-headers.d.ts vendored Normal file
View File

@@ -0,0 +1,18 @@
// Type definitions for easy-x-headers
// Project: https://github.com/DeadAlready/easy-x-headers
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module Express {
export interface Request {
info: any;
}
}
declare module "easy-x-headers" {
import express = require('express');
export function getMiddleware(defaults?: Object): express.RequestHandler;
}

View File

@@ -0,0 +1,27 @@
/**
* Created by karl on 14/07/15.
*/
/// <reference path="../express/express.d.ts" />
/// <reference path="./easy-xapi-supertest.d.ts" />
import express = require('express');
import eSupertest = require('easy-xapi-supertest');
var app = express();
var getAgent = eSupertest.getAgentFactory(app);
var agent = getAgent({
user: 'Jack',
role: 'user'
});
var getAgent2 = eSupertest.getAgentFactory(app, function (user:string, role?:string) {
return {
user: user,
role: role || 'user'
}
});
var agent = getAgent2('Jack');

View File

@@ -0,0 +1,29 @@
// Type definitions for easy-x-headers
// Project: https://github.com/DeadAlready/easy-x-headers
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "easy-xapi-supertest" {
import express = require('express');
export interface BodyAgent {
send(data: Object): any;
attach(arg1: any, arg2?: any): any;
}
export interface Agent {
get(url:string): any;
delete(url:string): any;
post(url:string): BodyAgent;
patch(url:string): BodyAgent;
put(url:string): BodyAgent;
}
interface getAgent {
(...args:any[]): Agent
}
export function getAgentFactory(app: express.Application, transform?: Function): getAgent;
}

View File

@@ -0,0 +1,32 @@
/**
* Created by karl on 14/07/15.
*/
/// <reference path="../express/express.d.ts" />
/// <reference path="./easy-xapi.d.ts" />
import express = require('express');
import eXapi = require('easy-xapi');
eXapi.init({
jSend: {
partial: true
}
});
var xApi = eXapi.create({
root: __dirname,
log: {
name: 'Log',
level: 'info'
},
port: 3000,
name: 'test',
mount: function (app) {
app.get('/', function (req, res) {
res.send('ok');
});
}
});
xApi.listen();

47
easy-xapi/easy-xapi.d.ts vendored Normal file
View File

@@ -0,0 +1,47 @@
// Type definitions for easy-xapi
// Project: https://github.com/DeadAlready/easy-xapi
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
/// <reference path="../easy-jsend/easy-jsend.d.ts" />
/// <reference path="../bunyan/bunyan.d.ts" />
declare module Express {
export interface Request {
log: any;
}
}
declare module "easy-xapi" {
import express = require('express');
import http = require('http');
import bunyan = require('bunyan');
interface InitConfig {
jSend?: {partial: boolean};
}
interface Config {
root: string;
port: number;
name: string;
xHeaderDefaults?: Object;
log: {
name: string;
level: string
}
mount: (app: express.Application) => void
}
interface Result {
express: any;
app: express.Application;
server: http.Server;
log: bunyan.Logger;
listen: () => void;
}
export function init(conf: InitConfig): void;
export function create(conf: Config): Result;
}

3
event-kit/.editorconfig Normal file
View File

@@ -0,0 +1,3 @@
[*.ts]
indent_style = tab
indent_size = 4

View File

@@ -0,0 +1,65 @@
/// <reference path="./event-kit.d.ts" />
// The following line only works in TypeScript 1.5
//import { Disposable, CompositeDisposable, Emitter } from "event-kit";
// DefinitelyTyped is still using TypeScript 1.4 to run tests
// so until they upgrade we have to do the following instead
import eventKit = require('event-kit');
type Disposable = AtomEventKit.Disposable;
var Disposable = eventKit.Disposable;
type CompositeDisposable = AtomEventKit.CompositeDisposable;
var CompositeDisposable = eventKit.CompositeDisposable;
type Emitter = AtomEventKit.Emitter;
var Emitter = eventKit.Emitter;
// Emitter
class User {
private emitter: Emitter;
name: string;
constructor() {
this.emitter = new Emitter();
}
onDidChangeName(callback: (name: string) => void): Disposable {
return this.emitter.on('did-change-name', callback);
}
setName(name: string): void {
if (this.name != name) {
this.name = name;
this.emitter.emit('did-change-name', name);
}
}
destroy(): void {
this.emitter.dispose();
}
}
// Disposable
var disposable = new Disposable(() => {
// cleanup
});
disposable.dispose();
var user = new User();
var subscription = user.onDidChangeName((name: string) => {
console.log('User name change to: ' + name);
});
subscription.dispose();
// CompositeDisposable
var subscriptions = new CompositeDisposable();
subscriptions.add(
user.onDidChangeName((name: string) => {
console.log('subscriber #1');
}),
user.onDidChangeName((name: string) => {
console.log('subscriber #2');
})
);
subscriptions.dispose();

82
event-kit/event-kit.d.ts vendored Normal file
View File

@@ -0,0 +1,82 @@
// Type definitions for event-kit v1.2.0
// Project: https://github.com/atom/event-kit
// Definitions by: Vadim Macagon <https://github.com/enlight/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module AtomEventKit {
interface IDisposable {
dispose(): void;
}
/** Static side of the Disposable class. */
interface DisposableStatic {
prototype: Disposable;
new (disposalAction: Function): Disposable;
}
/** Instance side of the Disposable class. */
interface Disposable extends IDisposable {
disposed: boolean;
constructor: DisposableStatic;
}
/** A class that represent a handle to a resource that can be disposed. */
var Disposable: DisposableStatic;
/** Static side of the CompositeDisposable class. */
interface CompositeDisposableStatic {
prototype: CompositeDisposable;
new (...disposables: IDisposable[]): CompositeDisposable;
}
/** Instance side of the CompositeDisposable class. */
interface CompositeDisposable extends IDisposable {
disposed: boolean;
constructor: CompositeDisposableStatic;
add(...disposables: IDisposable[]): void;
remove(disposable: IDisposable): void;
clear(): void;
}
/**
* A class that aggregates multiple [[Disposable]] instances together into a single disposable,
* so that they can all be disposed as a group.
*/
var CompositeDisposable: CompositeDisposableStatic;
/** Static side of the Emitter class. */
interface EmitterStatic {
prototype: Emitter;
new (): Emitter;
}
/** Instance side of the Emitter class. */
interface Emitter {
isDisposed: boolean;
constructor: EmitterStatic;
dispose(): void;
/**
* Registers a handler to be invoked whenever the given event is emitted.
* @return An object that will unregister the handler when disposed.
*/
on(eventName: string, handler: (value: any) => void, unshift?: boolean): Disposable;
/**
* Registers a handler to be invoked *before* all previously registered handlers for
* the given event.
* @return An object that will unregister the handler when disposed.
*/
preempt(eventName: string, handler: (value: any) => void): Disposable;
/** Invokes any registered handlers for the given event. */
emit(eventName: string, value: any): void;
}
/** A utility class for implementing event-based APIs. */
var Emitter: EmitterStatic;
}
declare module "event-kit" {
export = AtomEventKit;
}

View File

@@ -391,8 +391,6 @@ declare module "express" {
authenticatedUser: any;
files: any;
/**
* Clear cookie `name`.
*

177639
fhir/fhir-tests.ts Normal file

File diff suppressed because one or more lines are too long

10799
fhir/fhir.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -306,6 +306,10 @@ interface FirebaseStatic {
}
declare var Firebase: FirebaseStatic;
declare module 'firebase' {
export = Firebase;
}
// Reference: https://www.firebase.com/docs/web/api/firebase/getauth.html
interface FirebaseAuthData {
uid: string;

3
first-mate/.editorconfig Normal file
View File

@@ -0,0 +1,3 @@
[*.ts]
indent_style = tab
indent_size = 4

View File

@@ -0,0 +1,15 @@
/// <reference path="./first-mate.d.ts" />
import firstMate = require('first-mate');
var GrammarRegistry = firstMate.GrammarRegistry;
var Grammar = firstMate.GrammarRegistry;
type IToken = AtomFirstMate.IToken;
// The import and type aliasing above can be done more concisely in TypeScript 1.5+:
//import { GrammarRegistry, Grammar, IToken } from "first-mate";
var registry = new GrammarRegistry({ maxTokensPerLine: 100 });
var grammar = registry.loadGrammarSync('javascript.json');
var result = grammar.tokenizeLine('var text = "hello world";');
result.tokens.forEach((token) => {
console.log("Token text: '" + token.value + "' with scopes: " + token.scopes);
});

108
first-mate/first-mate.d.ts vendored Normal file
View File

@@ -0,0 +1,108 @@
// Type definitions for first-mate v4.1.7
// Project: https://github.com/atom/first-mate/
// Definitions by: Vadim Macagon <https://github.com/enlight/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../event-kit/event-kit.d.ts" />
declare module AtomFirstMate {
type Disposable = AtomEventKit.Disposable;
interface IToken {
value: string;
scopes: string[];
}
/** Result returned by `Grammar.tokenizeLine`. */
interface TokenizeLineResult {
/** Text that was tokenized. */
line: string;
tags: any[];
/**
* This is a dynamic property that will only be available if `Grammar.tokenizeLine` was called
* with `compatibilityMode` set to `true` (the default).
*/
tokens?: IToken[];
/**
* The tokenized state at the end of the line. This should be passed back into `tokenizeLine`
* when tokenizing the next line in the file/buffer.
*/
ruleStack: Rule[]
}
/** Instance side of Rule class. */
interface Rule {
}
/** Static side of Grammar class. */
interface GrammarStatic {
prototype: Grammar;
new (registry: GrammarRegistry, options?: any): Grammar;
}
/** Instance side of Grammar class. */
interface Grammar {
constructor: GrammarStatic;
onDidUpdate(callback: Function): Disposable;
/**
* Tokenizes all lines in a string.
*
* @param text A string containing one or more lines.
* @return An array of token arrays, one token array per line.
*/
tokenizeLines(text: string): Array<Array<IToken>>;
/**
* Tokenizes a line of text.
*
* @param line Text to be tokenized.
* @param firstLine Indicates whether `line` is the first line in the file/buffer,
* defaults to `false`.
* @param compatibilityMode `true` by default.
* @return An object containing tokens for the given line.
*/
tokenizeLine(
line: string, ruleStack?: Rule[], firstLine?: boolean, compatibilityMode?: boolean
): TokenizeLineResult;
}
/** Grammar that tokenizes lines of text. */
var Grammar: GrammarStatic;
/** Static side of GrammarRegistry class. */
interface GrammarRegistryStatic {
prototype: GrammarRegistry;
new (options?: { maxTokensPerLine: number }): GrammarRegistry;
}
/** Instance side of GrammarRegistry class. */
interface GrammarRegistry {
constructor: GrammarRegistryStatic;
// Event Subscription
onDidAddGrammar(callback: (grammar: Grammar) => void): Disposable;
onDidUpdateGrammar(callback: (grammar: Grammar) => void): Disposable;
// Managing Grammars
getGrammars(): Grammar[];
grammarForScopeName(scopeName: string): Grammar;
addGrammar(grammar: Grammar): Disposable;
removeGrammarForScopeName(scopeName: string): Grammar;
readGrammarSync(grammarPath: string): Grammar;
readGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void;
loadGrammarSync(grammarPath: string): Grammar;
loadGrammar(grammarPath: string, callback: (error: Error, grammar: Grammar) => void): void;
grammarOverrideForPath(filePath: string): Grammar;
setGrammarOverrideForPath(filePath: string, scopeName: string): Grammar;
clearGrammarOverrides(): void;
selectGrammar(filePath: string, fileContents: string): Grammar;
}
/** Registry containing one or more grammars. */
var GrammarRegistry: GrammarRegistryStatic;
}
declare module 'first-mate' {
export = AtomFirstMate;
}

28
flux/flux.d.ts vendored
View File

@@ -3,14 +3,14 @@
// Definitions by: Steve Baker <https://github.com/stkb/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'flux' {
declare module Flux {
/**
* Dispatcher class
* Create an instance to use throughout the application.
* Or extend it to create a derived dispatcher class.
*
* Specify a type in the 'TPayload' generic argument to use strongly-typed payloads,
* Specify a type in the 'TPayload' generic argument to use strongly-typed payloads,
* otherwise specify 'any'
*
* Examples:
@@ -23,41 +23,45 @@ declare module 'flux' {
/**
* Create an instance of the Dispatcher class to use throughout the application.
*
* Specify a type in the 'TPayload' generic argument to use strongly-typed payloads,
* Specify a type in the 'TPayload' generic argument to use strongly-typed payloads,
* otherwise specify 'any'
*
* Examples:
* var dispatcher = new flux.Dispatcher<any>()
* var typedDispatcher = new flux.Dispatcher<MyCustomActionType>()
*/
constructor()
constructor();
/**
* Registers a callback that will be invoked with every payload sent to the dispatcher.
* Returns a string token to identify the callback to be used with waitFor() or unregister.
*/
register(callback: (payload: TPayload) => void): string
register(callback: (payload: TPayload) => void): string;
/**
* Unregisters a callback with the given ID token
*/
unregister(id: string): void
unregister(id: string): void;
/**
* Waits for the callbacks with the specified IDs to be invoked before continuing execution
* of the current callback. This method should only be used by a callback in response
* of the current callback. This method should only be used by a callback in response
* to a dispatched payload.
*/
waitFor(IDs: string[]): void
waitFor(IDs: string[]): void;
/**
* Dispatches a payload to all registered callbacks
*/
dispatch(payload: TPayload): void
dispatch(payload: TPayload): void;
/**
* Gets whether the dispatcher is currently dispatching
*/
isDispatching(): boolean
isDispatching(): boolean;
}
}
}
declare module "flux" {
export = Flux;
}

View File

@@ -1,33 +1,346 @@
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="foundation.d.ts" />
function test_orbit() {
$("#featured").orbit();
$('#featured').orbit({
animation: 'fade',
animationSpeed: 800,
timer: true,
resetTimerOnClick: false,
advanceSpeed: 4000,
pauseOnHover: false,
startClockOnMouseOut: false,
startClockOnMouseOutAfter: 1000,
directionalNav: true,
captions: true,
captionAnimation: 'fade',
captionAnimationSpeed: 800,
bullets: false,
bulletThumbs: false,
bulletThumbLocation: '',
afterSlideChange: function () { },
fluid: true
});
}
function test_fluid() {
$("#myModal").reveal();
}
function test_joyride() {
$("#chooseID").joyride();
}
/// <reference path="../jquery/jquery.d.ts" />
/// <reference path="foundation.d.ts" />
function empty_callback() : void {}
function plugin_list() {
return [
"abide",
"accordion",
"alert",
"clearing",
"dropdown",
"interchange",
"joyride",
"magellan",
"offcanvas",
"orbit",
"reveal",
"slider",
"tab",
"tooltip",
"topbar"
];
}
function abide_patterns() {
var patterns : Foundation.AbidePatterns = {};
patterns.alpha = /^[a-zA-Z]+$/;
patterns.alpha_numeric = /^[a-zA-Z0-9]+$/;
patterns.integer = /^[-+]?\d+$/;
patterns.number = /^[-+]?[1-9]\d*$/;
patterns.card = /^[0-9]{8}$/;
patterns.cvv = /^([0-9]){3,4}$/;
patterns.email = /^test@example\.org$/;
patterns.url = /http:\/\/www\.google\.com\//;
patterns.domain = /definitelytyped\.org/;
patterns.datetime = /([0-2][0-9]{3})\-([0-1][0-9])\-([0-3][0-9])T([0-5][0-9])\:([0-5][0-9])\:([0-5][0-9])(Z|([\-\+]([0-1][0-9])\:00))/;
patterns.date = /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/;
patterns.time = /(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]){2}/;
patterns.dateISO = /\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/;
patterns.month_day_year = /(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](19|20)\d\d/;
patterns.color = /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/;
return patterns;
}
function abide_options() {
var opts : Foundation.AbideOptions = {};
opts.live_validate = false;
opts.validate_on_blur = true;
opts.focus_on_invalid = true;
opts.error_labels = true;
opts.timeout = 500;
opts.patterns = abide_patterns();
opts.validators = {
diceRoll: function(el : HTMLInputElement, required : boolean, parent : HTMLElement) {
var possibilities = [true, false];
return possibilities[Math.round(Math.random())];
},
isAllowed: function(el : HTMLInputElement, required : boolean, parent : HTMLElement) {
var possibilities = ["a@zurb.com", "b.zurb.com"];
return possibilities.indexOf(el.value) > -1;
}
}
return opts;
}
function accordion_options() {
var opts : Foundation.AccordionOptions = {};
opts.content_class = "content";
opts.active_class = "class-name";
opts.multi_expand = false;
opts.toggleable = true;
opts.callback = empty_callback;
return opts;
}
function alert_options() {
var opts : Foundation.AlertOptions = {};
opts.callback = empty_callback;
return opts;
}
function clearing_options() {
var opts : Foundation.ClearingOptions = {};
opts.templates = {
viewing : '<div>Some HTML</div>'
};
opts.close_selectors = "#id-value, .class-name";
opts.open_selectors = "li#id-value";
opts.skip_selector = ".skip-class";
opts.touch_label = "Display string";
opts.init = true;
opts.locked = false;
return opts;
}
function dropdown_options() {
var opts : Foundation.DropdownOptions = {};
opts.active_class = "class-name";
opts.disabled_class = "disabled-class";
opts.mega_class = "big";
opts.align = "top";
opts.is_hover = false;
opts.hover_timeout = 250;
opts.opened = empty_callback;
opts.closed = empty_callback;
return opts;
}
function equalizer_options() {
var opts : Foundation.EqualizerOptions = {};
opts.use_tallest = true;
opts.equalize_on_stack = false;
return opts;
}
function interchange_options() {
var opts : Foundation.InterchangeOptions = {};
opts.load_attr = "interchange";
opts.named_queries = {
my_custom_query: "only screen and (max-width: 200px)"
};
opts.directives = {
replace: empty_callback
};
return opts;
}
function joyride_options() {
var opts : Foundation.JoyrideOptions = {};
opts.expose = false;
opts.modal = true;
opts.keyboard = true;
opts.tip_location = "bottom";
opts.nub_position = "left";
opts.scroll_speed = 2500;
opts.scroll_animation = "lineaer";
opts.timer = 100;
opts.start_timer_on_click = true;
opts.start_offset = 3;
opts.next_button = false;
opts.prev_button = false;
opts.tip_animation = "pulse";
opts.pause_after = [4, 7, 10, 14];
opts.exposed = ["#elm-id-one", "#elm-id-two"];
opts.tip_animation_fade_speed = 100;
opts.cookie_monster = true;
opts.cookie_name = "ts_joyride";
opts.cookie_domain = false;
opts.cookie_expires = 7;
opts.tip_container = '#header';
opts.tip_location_patterns = {
top: ['botom'],
bottom: [],
left: ['right', 'top', 'bottom'],
right: ['left', 'top', 'bottom']
};
opts.post_ride_callback = empty_callback;
opts.post_step_callback = empty_callback;
opts.pre_step_callback = empty_callback;
opts.pre_ride_callback = empty_callback;
opts.post_expose_callback = empty_callback;
opts.template = {
link: '<a href="#close" class="joyride-close-tip">&times;</a>',
timer: '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',
tip: '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',
wrapper: '<div class="joyride-content-wrapper"></div>',
button: '<a href="#" class="small button joyride-next-tip"></a>',
prev_button: '<a href="#" class="small button joyride-prev-tip"></a>',
modal: '<div class="joyride-modal-bg"></div>',
expose: '<div class="joyride-expose-wrapper"></div>',
expose_cover: '<div class="joyride-expose-cover"></div>'
};
opts.expose_add_class = ".expose .class-name";
return opts;
}
function magellan_options() {
var opts : Foundation.MagellanOptions = {};
opts.active_class = ".active-element";
opts.threshold = 20;
opts.destination_threshold = 30;
opts.throttle_delay = 24;
opts.fixed_top = 0;
opts.offset_by_height = false;
opts.duration = 1000;
opts.easing = "linear";
return opts;
}
function offcanvas_options() {
var opts : Foundation.OffCanvasOptions = {};
opts.open_method = "overlap_single";
opts.close_on_click = true;
return opts;
}
function orbit_options() {
var opts : Foundation.OrbitOptions = {};
opts.animation = 'slide';
opts.timer_speed = 10000;
opts.pause_on_hover = true;
opts.resume_on_mouseout = false;
opts.next_on_click = true;
opts.animation_speed = 500;
opts.stack_on_small = false;
opts.navigation_arrows = true;
opts.slide_number = true;
opts.slide_number_text = 'of';
opts.container_class = 'orbit-container';
opts.stack_on_small_class = 'orbit-stack-on-small';
opts.next_class = 'orbit-next';
opts.prev_class = 'orbit-prev';
opts.timer_container_class = 'orbit-timer';
opts.timer_paused_class = 'paused';
opts.timer_progress_class = 'orbit-progress';
opts.slides_container_class = 'orbit-slides-container';
opts.preloader_class = 'preloader';
opts.slide_selector = 'li';
opts.bullets_container_class = 'orbit-bullets';
opts.bullets_active_class = 'active';
opts.slide_number_class = 'orbit-slide-number';
opts.caption_class = 'orbit-caption';
opts.active_slide_class = 'active';
opts.orbit_transition_class = 'orbit-transitioning';
opts.bullets = true;
opts.circular = true;
opts.timer = true;
opts.variable_height = false;
opts.swipe = true;
opts.before_slide_change = empty_callback;
opts.after_slide_change = empty_callback;
return opts;
}
function reveal_css_options() {
var opts : Foundation.RevealCSSOptions = {};
opts.opacity = 0;
opts.visibility = 'hidden';
opts.display = "inline-block";
return opts;
}
function reveal_options() {
var opts : Foundation.RevealOptions = {};
opts.animation = "linear";
opts.animation_speed = 500;
opts.close_on_background_click = false;
opts.dismiss_modal_class = ".modal-bye-bye";
opts.multiple_opened = true;
opts.bg_class = ".modal-background";
opts.root_element = "#element-id.element-class";
opts.on_ajax_error = empty_callback;
opts.open = empty_callback;
opts.opened = empty_callback;
opts.close = empty_callback;
opts.close = empty_callback;
opts.bg = $("#my-modal-id .background");
opts.css = {
open: reveal_css_options(),
close: reveal_css_options()
};
return opts;
}
function slider_options() {
var opts : Foundation.SliderOptions = {};
opts.start = -1000;
opts.end = 1000;
opts.step = 50;
opts.precision = 4;
opts.initial = 0;
opts.vertical = false;
opts.trigger_input_change = true;
opts.on_change = empty_callback;
return opts;
}
function tab_options() {
var opts : Foundation.TabOptions = {};
opts.active_class = "class-name";
opts.callback = empty_callback;
opts.deep_linking = false;
opts.scroll_to_content = true;
opts.is_hover = false;
return opts;
}
function tooltip_options() {
var opts : Foundation.TooltipOptions = {};
opts.additional_inheritable_classes = ["class1", "class2"];
opts.tooltip_class = "tooltip";
opts.append_to = "append-class";
opts.touch_close_text = "Close";
opts.disable_for_touch = true;
opts.hover_delay = 100;
opts.show_on = "all";
opts.tip_template = function (selector, content) {
return '<span data-selector="' + selector + '" id="' + selector + '" class="' +
Foundation.libs.tooltip.settings.tooltip_class.substring(1) +
'" role="tooltip">' + content + '<span class="nub"></span></span>';
};
return opts;
}
function topbar_options() {
var opts : Foundation.TopbarOptions = {};
opts.index = 1;
opts.sticky_class = "top-bar";
opts.custom_back_text = true;
opts.back_text = "Return";
opts.is_hover = false;
opts.mobile_show_parent_link = true;
opts.scrolltop = true;
opts.sticky_on = "all";
return opts;
}
function foundation_options() {
var opts : Foundation.Options = {};
opts.abide = abide_options();
opts.accordion = accordion_options();
opts.alert = alert_options();
opts.clearing = clearing_options();
opts.dropdown = dropdown_options();
opts.equalizer = equalizer_options();
opts.joyride = joyride_options();
opts.magellan = magellan_options();
opts.offcanvas = offcanvas_options();
opts.orbit = orbit_options();
opts.reveal = reveal_options();
opts.slider = slider_options();
opts.tab = tab_options();
opts.tooltip = tooltip_options();
opts.topbar = topbar_options();
return opts;
}
$(document).foundation();
$(document).foundation(foundation_options());
$(document).foundation("reflow");
plugin_list().forEach((plugin) => $(document).foundation(plugin, "reflow"));
$(document).foundation("slider", "set_value", 100);

View File

@@ -1,88 +1,317 @@
// Type definitions for Foundation 3.2
// Project: http://foundation.zurb.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
interface OrbitOptions {
animation?: string;
animationSpeed?: number;
timer?: boolean;
resetTimerOnClick?: boolean;
advanceSpeed?: number;
pauseOnHover?: boolean;
startClockOnMouseOut?: boolean;
startClockOnMouseOutAfter?: number;
directionalNav?: number;
captions?: number;
captionAnimation?: string;
captionAnimationSpeed?: number;
bullets?: boolean;
bulletThumbs?: boolean;
bulletThumbLocation?: string;
afterSlideChange?: () => void;
fluid?: boolean;
}
interface RevealOptions {
animation?: string;
animationSpeed?: number;
closeOnBackgroundClick?: boolean;
dismissModalClass?: string;
/**
* The class of the modals background.
*/
bgClass?: string;
open?: () => void;
opened?: () => void;
close?: () => void;
closed?: () => void;
/**
* The modals background object.
*/
bg: JQuery;
/**
* The css property for when the modal is opened and closed.
*/
css: {
open: {
opacity?: number;
visibility?: string;
display: string;
};
close: {
opacity: number;
visibility: string;
display: string;
};
};
}
interface JoyrideOptions {
tipLocation?: string;
nubPosition?: string;
scrollSpeed?: number;
timer?: number;
startTimerOnClick?: boolean;
nextButton?: boolean;
tipAnimation?: string;
pauseAfter?: number[];
tipAnimationFadeSpeed?: number;
cookieMonster?: boolean;
cookieName?: string;
cookieDomain?: boolean;
tipContainer?: string;
postRideCallback?: () => void;
postStepCallback?: () => void;
}
interface JQuery {
orbit(): JQuery;
orbit(OrbitOptions): JQuery;
reveal(): JQuery;
reveal(RevealOptions): JQuery;
joyride(): JQuery;
joyride(JoyrideOptions): JQuery;
}
// Type definitions for Foundation v5.5.1
// Project: http://foundation.zurb.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
declare module Foundation {
// http://foundation.zurb.com/docs/components/abide.html#optional-javascript-configuration
interface AbidePatterns {
alpha? : RegExp;
alpha_numeric? : RegExp;
integer? : RegExp;
number? : RegExp;
card? : RegExp;
cvv? : RegExp;
email? : RegExp;
url? : RegExp;
domain? : RegExp;
datetime? : RegExp;
date? : RegExp;
time? : RegExp;
dateISO? : RegExp;
month_day_year? : RegExp;
color? : RegExp;
}
interface AbideOptions {
live_validate? : boolean;
validate_on_blur? : boolean;
focus_on_invalid? : boolean;
error_labels? : boolean;
timeout? : number;
patterns? : AbidePatterns;
validators? : Object;
}
// http://foundation.zurb.com/docs/components/accordion.html#optional-javascript-configuration
interface AccordionOptions {
content_class? : string;
active_class? : string;
multi_expand? : boolean;
toggleable? : boolean;
callback? : () => any;
}
// http://foundation.zurb.com/docs/components/alert_boxes.html
interface AlertOptions {
callback? : () => any;
}
// http://foundation.zurb.com/docs/components/clearing.html#optional-javascript-configuration
interface ClearingOptions {
templates? : Object;
close_selectors? : string;
open_selectors? : string;
skip_selector? : string;
touch_label? : string;
init? : boolean;
locked? : boolean;
}
// http://foundation.zurb.com/docs/components/dropdown.html#optional-javascript-configuration
interface DropdownOptions {
active_class? : string;
disabled_class? : string;
mega_class? : string;
align? : string;
is_hover? : boolean;
hover_timeout? : number;
opened? : () => any;
closed? : () => any;
}
// http://foundation.zurb.com/docs/components/equalizer.html#optional-javascript-configuration
interface EqualizerOptions {
use_tallest? : boolean;
equalize_on_stack? : boolean;
}
// http://foundation.zurb.com/docs/components/interchange.html#custom-named-queries
interface InterchangeOptions {
load_attr? : string;
named_queries? : Object;
directives? : Object;
}
// http://foundation.zurb.com/docs/components/joyride.html#optional-javascript-configuration
interface JoyrideOptions {
expose? : boolean;
modal? : boolean;
keyboard? : boolean;
tip_location? : string;
nub_position? : string;
scroll_speed? : number;
scroll_animation? : string;
timer? : number;
start_timer_on_click? : boolean;
start_offset? : number;
next_button? : boolean;
prev_button? : boolean;
tip_animation? : string;
pause_after? : number[];
exposed? : string[];
tip_animation_fade_speed? : number;
cookie_monster? : boolean;
cookie_name? : string;
cookie_domain? : boolean;
cookie_expires? : number;
tip_container? : string;
tip_location_patterns? : {
top? : string[];
bottom? : string[];
left? : string[];
right? : string[];
};
post_ride_callback? : () => void;
post_step_callback? : () => void;
pre_step_callback? : () => void;
pre_ride_callback? : () => void;
post_expose_callback? : () => void;
template? : {
link? : string;
timer? : string;
tip? : string;
wrapper? : string;
button? : string;
modal? : string;
expose? : string;
expose_cover? : string;
};
expose_add_class? : string;
}
// http://foundation.zurb.com/docs/components/magellan.html#js
interface MagellanOptions {
active_class? : string;
threshold? : number;
destination_threshold? : number;
throttle_delay? : number;
fixed_top? : number;
offset_by_height? : boolean;
duration? : number;
easing? : string;
}
// http://foundation.zurb.com/docs/components/offcanvas.html#optional-javascript-configuration
interface OffCanvasOptions {
open_method? : string;
close_on_click? : boolean;
}
// http://foundation.zurb.com/docs/components/orbit.html#advanced
interface OrbitOptions {
animation? : string;
timer_speed? : number;
pause_on_hover? : boolean;
resume_on_mouseout? : boolean;
next_on_click? : boolean;
animation_speed? : number;
stack_on_small? : boolean;
navigation_arrows? : boolean;
slide_number? : boolean;
slide_number_text? : string;
container_class? : string;
stack_on_small_class? : string;
next_class? : string;
prev_class? : string;
timer_container_class? : string;
timer_paused_class? : string;
timer_progress_class? : string;
slides_container_class? : string;
preloader_class? : string;
slide_selector? : string;
bullets_container_class? : string;
bullets_active_class? : string;
slide_number_class? : string;
caption_class? : string;
active_slide_class? : string;
orbit_transition_class? : string;
bullets? : boolean;
circular? : boolean;
timer? : boolean;
variable_height? : boolean;
swipe? : boolean;
before_slide_change? : () => any;
after_slide_change? : () => any;
}
// http://foundation.zurb.com/docs/components/reveal.html
interface RevealCSSOptions {
opacity? : number;
visibility? : string;
display? : string;
}
interface RevealOptions {
animation? : string;
animation_speed? : number;
close_on_background_click? : boolean;
dismiss_modal_class? : string;
multiple_opened? : boolean;
bg_class? : string;
root_element? : string;
on_ajax_error? : () => any;
open? : () => any;
opened? : () => any;
close? : () => any;
closed? : () => any;
bg? : JQuery;
css? : {
open? : RevealCSSOptions;
close? : RevealCSSOptions;
};
}
// http://foundation.zurb.com/docs/components/range_slider.html
interface SliderOptions {
start? : number;
end? : number;
step? : number;
precision? : number;
initial? : number;
vertical? : boolean;
trigger_input_change? : boolean;
on_change? : () => any;
}
// http://foundation.zurb.com/docs/components/tabs.html
interface TabOptions {
active_class? : string;
callback? : () => any;
deep_linking? : boolean;
scroll_to_content? : boolean;
is_hover? : boolean;
}
interface TooltipOptions {
additional_inheritable_classes? : string[];
tooltip_class? : string;
append_to? : string;
touch_close_text? : string;
disable_for_touch? : boolean;
hover_delay? : number;
show_on? : string;
tip_template? : (selector : string, content : string) => string;
}
interface TopbarOptions {
index? : number;
sticky_class? : string;
custom_back_text? : boolean;
back_text? : string;
is_hover? : boolean;
mobile_show_parent_link? : boolean;
scrolltop? : boolean;
sticky_on? : string;
}
interface Options {
abide? : AbideOptions;
accordion? : AccordionOptions;
alert? : AlertOptions;
clearing? : ClearingOptions;
dropdown? : DropdownOptions;
equalizer? : EqualizerOptions;
interchange? : InterchangeOptions;
joyride? : JoyrideOptions;
magellan? : MagellanOptions;
offcanvas? : OffCanvasOptions;
orbit? : OrbitOptions;
reveal? : RevealOptions;
slider? : SliderOptions;
tab? : TabOptions;
tooltip? : TooltipOptions;
topbar? : TopbarOptions;
}
interface FoundationStatic {
name : string;
version : string;
media_queries : Object;
stylesheet : CSSStyleSheet;
global : {
namespace : string;
};
init(scope : JQuery) : JQuery;
init(scope : JQuery, libraries : Options) : JQuery;
init(scope : JQuery, libraries : string, method : Options) : JQuery;
init(scope : JQuery, libraries : string, method : string, options : Object) : JQuery;
init_lib(lib : any, args : any) : (...args : any[]) => any;
patch(lib : any) : void;
inherit(scope : JQuery, methods : string) : void;
set_namespace() : void;
libs : any;
utils : {
S(selector : any, context : any) : JQuery;
throttle(func : (...args : any[]) => any, delay : number) : (...args : any[]) => any;
debounce(func : (...args : any[]) => any, delay : number, immediate : boolean) : (...args : any[]) => any;
data_options(el : JQuery) : Object;
register_media(media : string, media_class : string) : void;
add_custom_rule(rule : string, media : string) : void;
image_loaded(images : JQuery, callback : (...args : any[]) => any) : void;
random_str(length? : number) : string;
};
}
}
interface JQuery {
foundation() : JQuery;
foundation(libraries : Foundation.Options | string) : JQuery;
foundation(libraries : string, method : Foundation.Options | string) : JQuery;
foundation(libraries : string, method : string, options : Object) : JQuery;
}
declare var Foundation : Foundation.FoundationStatic;

View File

@@ -1,6 +1,6 @@
// Type definitions for FullCalendar 1.6.1
// Project: http://arshaw.com/fullcalendar/
// Definitions by: Neil Stalker <https://github.com/nestalk>
// Definitions by: Neil Stalker <https://github.com/nestalk>, Marcelo Camargo <https://github.com/hasellcamargo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts"/>
@@ -99,7 +99,7 @@ declare module FullCalendar {
selectHelper?: any; // Boolean/Function
unselectAuto?: boolean;
unselectCancel?: string;
select?: (startDate: Date, endDate: Date, allDay: boolean, jsEvent: MouseEvent, view: View) => void;
select?: (startDate: Date | string, endDate: Date | string, allDay: boolean, jsEvent: MouseEvent, view: View) => void;
unselect?: (view: View, jsEvent: Event) => void;
// Event Data - http://arshaw.com/fullcalendar/docs/event_data/
@@ -109,7 +109,7 @@ declare module FullCalendar {
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date, end: Date, callback: {(events: EventObject[]) => void;}) => void;
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
@@ -119,7 +119,7 @@ declare module FullCalendar {
* - EventSource
* - EventObject[]
* - string (JSON feed)
* - (start: Date, end: Date, callback: {(events: EventObject[]) => void;}) => void;
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
*/
eventSources?: any[];
@@ -164,8 +164,8 @@ declare module FullCalendar {
export interface View {
name: string;
title: string;
start: Date;
end: Date;
start: Date | string;
end: Date | string;
visStart: Date;
visEnd: Date;
}
@@ -214,8 +214,8 @@ declare module FullCalendar {
id?: any // String/number
title: string;
allDay?: boolean;
start: Date;
end?: Date;
start: Date | string;
end?: Date | string;
url?: string;
className?: any; // string/Array<string>
editable?: boolean;
@@ -233,7 +233,7 @@ declare module FullCalendar {
*
* - EventObject[]
* - string (JSON feed)
* - (start: Date, end: Date, callback: {(events: EventObject[]) => void;}) => void;
* - (start: Date | string, end: Date | string, callback: {(events: EventObject[]) => void;}) => void;
*/
events?: any;
@@ -312,7 +312,7 @@ interface JQuery {
/**
* Moves the calendar to an arbitrary date.
*/
fullCalendar(method: 'gotoDate', date: Date): void;
fullCalendar(method: 'gotoDate', date: Date | string): void;
/**
* Moves the calendar forward/backward an arbitrary amount of time.

View File

@@ -0,0 +1,25 @@
/// <reference path="./geometry-dom.d.ts" />
var point = new DOMPoint(5, 4);
var matrix = new DOMMatrix(2, 0, 0, 2, 10, 10);
var transformedPoint = point.matrixTransform(matrix);
var point = new DOMPoint(2, 0);
var quad1 = new DOMQuad(point, {x: 12, y: 0}, {x: 2, y: 10}, {x: 12, y: 10});
var rect = new DOMRect(2, 0, 10, 10);
var quad2 = new DOMQuad(rect);
new DOMQuad({x: 40, y: 25}, {x: 180, y: 8}, {x: 210, y: 150}, {x: 10, y: 180});
var matrix = new DOMMatrix();
matrix.scaleSelf(2);
matrix.translateSelf(20,20);
var matrix = new DOMMatrix();
matrix.translateSelf(20, 20);
matrix.scaleSelf(2);
matrix.translateSelf(-20, -20);
var matrix = new DOMMatrix();
matrix.translateSelf(20, 20).scaleSelf(2).translateSelf(-20, -20);

326
geometry-dom/geometry-dom.d.ts vendored Normal file
View File

@@ -0,0 +1,326 @@
// Type definitions for Geometry Format Specification
// Project: http://www.w3.org/TR/geometry-1/
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module GeometryDom {
export interface DOMPointReadOnly {
/**
* x coordinate / readonly
*/
x: number;
/**
* y coordinate / readonly
*/
y: number;
/**
* z coordinate / readonly
*/
z: number;
/**
* w coordinate / readonly
*/
w: number;
/**
* Post-multiply point with matrix.
* @param matrix
*/
matrixTransform(matrix:DOMMatrixReadOnly): DOMPoint;
}
interface DOMPoint extends DOMPointReadOnly {
/**
* x coordinate
*/
x: number;
/**
* y coordinate
*/
y: number;
/**
* z coordinate
*/
z: number;
/**
* w coordinate
*/
w: number;
}
interface DOMRect extends DOMRectReadOnly {
/**
* x coordinate
*/
x: number;
/**
* y coordinate
*/
y: number;
/**
* width value
*/
width: number;
/**
* height value
*/
height: number;
}
interface DOMRectReadOnly {
/**
* x coordinate
*/
x: number;
/**
* y coordinate
*/
y: number;
/**
* width value
*/
width: number;
/**
* height value
*/
height: number;
/**
* min(y coordinate, y coordinate + height dimension)
*/
top: number;
/**
* max(x coordinate, x coordinate + width dimension)
*/
right: number;
/**
* max(y coordinate, y coordinate + height dimension)
*/
bottom: number;
/**
* min(x coordinate, x coordinate + width dimension)
*/
left: number;
}
interface DOMRectList {
/**
* total number of DOMRect objects associated with the object.
* readonly unsigned long length
*/
length: number;
/**
* the DOMRect object at index must be returned.
* @param index
*/
item(index: number): DOMRect;
}
interface DOMQuad {
/**
* a DOMPoint that represents p1 of the quadrilateral
*/
p1: DOMPoint;
/**
* a DOMPoint that represents p2 of the quadrilateral
*/
p2: DOMPoint;
/**
* a DOMPoint that represents p3 of the quadrilateral
*/
p3: DOMPoint;
/**
* a DOMPoint that represents p4 of the quadrilateral
*/
p4: DOMPoint;
/**
* the associated bounding rectangle of the quadrilateral
*/
bounds: DOMRectReadOnly;
}
interface DOMMatrixReadOnly {
/**
* These attributes are simple aliases for certain elements of the 4x4 matrix
*/
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
m11: number;
m12: number;
m13: number;
m14: number;
m21: number;
m22: number;
m23: number;
m24: number;
m31: number;
m32: number;
m33: number;
m34: number;
m41: number;
m42: number;
m43: number;
m44: number;
is2D: boolean;
isIdentity: boolean;
translate(tx: number, ty: number, tz?: number): DOMMatrix;
scale(scale: number, originX?: number, originY?: number): DOMMatrix;
scale3d(scale: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
scaleNonUniform(scale: number, scaleX: number, scaleY: number, scaleZ: number, originX: number, originY: number, originZ: number): DOMMatrix;
rotate(angle: number, originX?: number, originY?: number): DOMMatrix;
rotateFromVector(x: number, y: number): DOMMatrix;
rotateAxisAngle(x: number, y: number, z: number, angle: number): DOMMatrix;
skewX(sx: number): DOMMatrix;
skewY(sx: number): DOMMatrix;
multiply(other: DOMMatrix): DOMMatrix;
flipX(): DOMMatrix;
flipY(): DOMMatrix;
inverse(): DOMMatrix;
transformPoint(point?: DOMPointInit): DOMPoint;
toFloat32Array(): Array<number>;
toFloat64Array(): Array<number>;
}
interface DOMMatrix extends DOMMatrixReadOnly {
a: number;
b: number;
c: number;
d: number;
e: number;
f: number;
m11: number;
m12: number;
m13: number;
m14: number;
m21: number;
m22: number;
m23: number;
m24: number;
m31: number;
m32: number;
m33: number;
m34: number;
m41: number;
m42: number;
m43: number;
m44: number;
multiplySelf(other: DOMMatrix): DOMMatrix;
preMultiplySelf(other: DOMMatrix): DOMMatrix;
translateSelf(tx: number, ty: number, tz?: number): DOMMatrix;
scaleSelf(scale: number, originX?: number, originY?: number): DOMMatrix;
scale3dSelf(scale: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
scaleNonUniformSelf(scaleX: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
rotateSelf(angle: number, originX?: number, originY?: number): DOMMatrix;
rotateFromVectorSelf(x: number, y: number): DOMMatrix;
rotateAxisAngleSelf(x: number, y: number, z: number, angle: number): DOMMatrix;
skewXSelf(sx: number): DOMMatrix;
skewYSelf(sy: number): DOMMatrix;
invertSelf(): DOMMatrix;
setMatrixValue(transformList: DOMMatrix): DOMMatrix;
}
}
declare var DOMPointReadOnly: {
prototype: GeometryDom.DOMPointReadOnly;
new (x: number, y: number, z: number, w: number): GeometryDom.DOMPointReadOnly;
};
declare var DOMPoint: {
prototype: GeometryDom.DOMPoint;
new (x?:number, y?:number, z?:number, w?:number): GeometryDom.DOMPoint;
};
interface DOMPointInit {
/**
* x coordinate: 0
*/
x: number;
/**
* y coordinate: 0
*/
y: number;
/**
* z coordinate: 0
*/
z?: number;
/**
* w coordinate: 1
*/
w?: number;
}
declare var DOMRect: {
prototype: GeometryDom.DOMRect;
new (x: number, y: number, width: number, height: number): GeometryDom.DOMRect;
};
declare var DOMRectReadOnly: {
prototype: GeometryDom.DOMRectReadOnly;
new (x: number, y: number, width: number, height: number): GeometryDom.DOMRectReadOnly;
};
interface DOMRectInit {
/**
* x coordinate
*/
x: number;
/**
* y coordinate
*/
y: number;
/**
* width value
*/
width: number;
/**
* height value
*/
height: number;
}
interface DOMRectList {
/**
* total number of DOMRect objects associated with the object.
* readonly unsigned long length
*/
length: number;
/**
* the DOMRect object at index must be returned.
* @param index
*/
item(index: number): GeometryDom.DOMRect;
}
declare var DOMQuad: {
prototype: GeometryDom.DOMQuad;
new (rect?: DOMRectInit): GeometryDom.DOMQuad;
new (p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): GeometryDom.DOMQuad;
};
declare var DOMMatrixReadOnly: {
prototype: GeometryDom.DOMMatrixReadOnly;
new (numberSequence: Array<number>): GeometryDom.DOMMatrixReadOnly;
};
declare var DOMMatrix: {
prototype: GeometryDom.DOMMatrix;
new (): GeometryDom.DOMMatrix;
new (transformList: string): GeometryDom.DOMMatrix;
new (other: GeometryDom.DOMMatrixReadOnly): GeometryDom.DOMMatrix;
new (array: Array<number>): GeometryDom.DOMMatrix;
new (a: number, b: number, c: number, d: number, e: number, f: number): GeometryDom.DOMMatrix;
};

123
glob/glob.d.ts vendored
View File

@@ -1,4 +1,4 @@
// Type definitions for Glob
// Type definitions for Glob 5.0.10
// Project: https://github.com/isaacs/node-glob
// Definitions by: vvakame <https://github.com/vvakame/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -9,63 +9,104 @@
declare module "glob" {
import events = require("events");
import fs = require('fs');
import minimatch = require("minimatch");
function G(pattern:string, cb:(err:Error, matches:string[])=>void):void;
function G(pattern:string, options:G.IOptions, cb:(err:Error, matches:string[])=>void):void;
function G(pattern: string, cb: (err: Error, matches: string[]) => void): void;
function G(pattern: string, options: G.IOptions, cb: (err: Error, matches: string[]) => void): void;
module G {
function sync(pattern:string, options?:IOptions):string[];
function sync(pattern: string, options?: IOptions): string[];
var Glob:IGlobStatic;
function hasMagic(pattern: string, options?: IOptions): boolean;
var Glob: IGlobStatic;
var GlobSync: IGlobSyncStatic;
interface IOptions extends minimatch.IOptions {
cwd?: string;
sync?: boolean;
root?: string;
dot?: boolean;
nomount?: boolean;
matchBase?:any;
noglobstar?:any;
mark?: boolean;
nosort?: boolean;
stat?: boolean;
silent?: boolean;
strict?: boolean;
dot?:boolean;
mark?:boolean;
nounique?:boolean;
nonull?:boolean;
nosort?:boolean;
nocase?:boolean;
stat?:boolean;
debug?:boolean;
globDebug?:boolean;
silent?:boolean;
cache?: { [path: string]: any /* boolean | string | string[] */ };
statCache?: { [path: string]: fs.Stats };
symlinks?: any;
sync?: boolean;
nounique?: boolean;
nonull?: boolean;
debug?: boolean;
nobrace?: boolean;
noglobstar?: boolean;
noext?: boolean;
nocase?: boolean;
matchBase?: any;
nodir?: boolean;
ignore?: any; /* string | string[] */
follow?: boolean;
realpath?: boolean;
nonegate?: boolean;
nocomment?: boolean;
/** Deprecated. */
globDebug?: boolean;
}
interface IGlobStatic extends events.EventEmitter {
new (pattern:string, cb?:(err:Error, matches:string[])=>void):IGlob;
new (pattern:string, options:any, cb?:(err:Error, matches:string[])=>void):IGlob;
new (pattern: string, cb?: (err: Error, matches: string[]) => void): IGlob;
new (pattern: string, options: IOptions, cb?: (err: Error, matches: string[]) => void): IGlob;
prototype: IGlob;
}
interface IGlob {
EOF:any;
paused:boolean;
maxDepth:number;
maxLength:number;
cache:any;
statCache:any;
changedCwd:boolean;
cwd: string;
root: string;
error: any;
aborted: boolean;
minimatch: minimatch.IMinimatch;
matches:string[];
interface IGlobSyncStatic {
new (pattern: string, options?: IOptions): IGlobBase
prototype: IGlobBase;
}
log(...args:any[]):void;
abort():void;
pause():void;
resume():void;
emitMatch(m:any):void;
interface IGlobBase {
minimatch: minimatch.IMinimatch;
options: IOptions;
aborted: boolean;
cache: { [path: string]: any /* boolean | string | string[] */ };
statCache: { [path: string]: fs.Stats };
symlinks: { [path: string]: boolean };
realpathCache: { [path: string]: string };
found: string[];
}
interface IGlob extends IGlobBase, events.EventEmitter {
pause(): void;
resume(): void;
abort(): void;
/** Deprecated. */
EOF: any;
/** Deprecated. */
paused: boolean;
/** Deprecated. */
maxDepth: number;
/** Deprecated. */
maxLength: number;
/** Deprecated. */
changedCwd: boolean;
/** Deprecated. */
cwd: string;
/** Deprecated. */
root: string;
/** Deprecated. */
error: any;
/** Deprecated. */
matches: string[];
/** Deprecated. */
log(...args: any[]): void;
/** Deprecated. */
emitMatch(m: any): void;
}
}
export = G;
export = G;
}

View File

@@ -1,6 +1,6 @@
/// <reference path="globalize.d.ts" />
Globalize.culture("fr");
/*Globalize.culture("fr");
console.log(Globalize.culture().name);
Globalize.culture("fr-FR");
@@ -66,7 +66,7 @@ Globalize.format(new Date(2012, 1, 20), 'd');
Globalize.format(new Date(2012, 1, 20), 'D');
Globalize.cultures[ "default" ] = {
Globalize.load[ "default" ] = {
name: "English",
englishName: "English",
nativeName: "English",
@@ -132,4 +132,4 @@ Globalize.cultures[ "default" ] = {
}
},
messages: {}
}
}*/

View File

@@ -1,125 +1,28 @@
// Type definitions for Globalize
// Project: https://github.com/jquery/globalize
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Definitions by: Aram Taieb <https://github.com/afromogli/>
// Definitions: https://github.com/afromogli/DefinitelyTyped
interface GlobalizePercent {
pattern: string[];
decimals: number;
groupSizes: number[];
//",": string;
//".": string;
symbol: string;
interface NumberFormatterOptions {
minimumIntegerDigits?: number;
minimumFractionDigits?: number;
maximumFractionDigits?: number;
minimumSignificantDigits?: number;
maximumSignificantDigits?: number;
round?: string;
useGrouping?: boolean;
}
interface GlobalizeCurrency {
pattern: string[];
decimals: number;
groupSizes: number[];
//",": string;
//".": string;
symbol: string;
}
interface GlobalizeNumberFormat {
pattern: string[];
decimals: string;
//",": string;
//".": string;
groupSizes: number[];
//"+": string;
//"-": string;
NaN: string;
negativeInfinity: string;
positiveInfinity: string;
percent: GlobalizePercent;
currency: GlobalizeCurrency;
}
interface GlobalizeEra {
name: string;
start: any;
offset: number;
}
interface GlobalizeDays {
names: string[];
namesAbbr: string[];
namesShort: string[];
}
interface GlobalizeMonths {
names: string[];
namesAbbr: string[];
}
interface GlobalizePatterns {
d: string;
D: string;
t: string;
T: string;
f: string;
F: string;
M: string;
Y: string;
S: string;
}
interface GlobalizeCalendar {
name: string;
// "/": string,
// ":": string,
firstDay: number;
days: GlobalizeDays;
months: GlobalizeMonths;
AM: string[];
PM: string[];
eras: GlobalizeEra[];
twoDigitYearMax: number;
patterns: GlobalizePatterns;
}
interface GlobalizeCalendars {
standard: GlobalizeCalendar;
}
interface GlobalizeCulture {
name: string;
englishName: string;
nativeName: string;
isRTL: boolean;
language: string;
numberFormat: GlobalizeNumberFormat;
calendar: GlobalizeCalendar;
calendars: GlobalizeCalendars;
messages: any;
}
interface GlobalizeCultures {
[index: number]: GlobalizeCulture;
interface Cldr {
/* TODO: add typings */
}
interface GlobalizeStatic {
cultures: GlobalizeCultures;
init(cultureSelector: string): GlobalizeStatic;
cultureSelector: string;
load(jsonData: any): void;
locale(locale: string): Cldr;
culture(): GlobalizeCulture;
culture(cultureSelector: string): GlobalizeCulture;
culture(cultureSelector: string[]): GlobalizeCulture;
addCultureInfo(cultureName: string, baseCultureName: string, info: Object): void;
addCultureInfo(cultureName: string, info: Object): void;
addCultureInfo(info: Object): void;
findClosestCulture(cultureSelector: string): GlobalizeStatic;
format(value: number, format: string, cultureSelector?: string): string;
format(value: Date, format: string, cultureSelector?: string): string;
localize(key: string, cultureSelector?: string): string;
parseDate(value: string, format?: string, cultureSelector?: string): Date;
parseDate(value: string, formats?: string[], cultureSelector?: string): Date;
parseInt(value: string, radix?: number, cultureSelector?: string): number;
parseFloat(value: string, radix?: number, cultureSelector?: string): number;
numberFormatter(options?: NumberFormatterOptions): (value: number) => string;
formatNumber(value:number, options?: NumberFormatterOptions): string;
}
declare var Globalize: GlobalizeStatic;

View File

@@ -1,241 +1,243 @@
// Test file for GoJS.d.ts
// Test file for goJS.d.ts
// This is taken from http://gojs.net/latest/samples/basic.html
/* Copyright (C) 1998 - 2013 by Northwoods Software Corporation. */
/* Copyright (C) 1998-2015 by Northwoods Software Corporation. */
/// <reference path="goJS.d.ts" />
function init() {
var $ = go.GraphObject.make; // for conciseness in defining templates
var $ = go.GraphObject.make; // for conciseness in defining templates
var myDiagram =
$(go.Diagram, "myDiagram", // create a Diagram for the DIV HTML element
{
// position the graph in the middle of the diagram
initialContentAlignment: go.Spot.Center,
var myDiagram: go.Diagram =
$(go.Diagram, "myDiagram", // create a Diagram for the DIV HTML element
{
// position the graph in the middle of the diagram
initialContentAlignment: go.Spot.Center,
// allow double-click in background to create a new node
"clickCreatingTool.archetypeNodeData": { text: "Node", color: "white" },
// allow double-click in background to create a new node
"clickCreatingTool.archetypeNodeData": { text: "Node", color: "white" },
// allow Ctrl-G to call groupSelection()
"commandHandler.archetypeGroupData": { text: "Group", isGroup: true, color: "blue" }
});
// allow Ctrl-G to call groupSelection()
"commandHandler.archetypeGroupData": { text: "Group", isGroup: true, color: "blue" },
// Define the appearance and behavior for Nodes:
// enable undo & redo
"undoManager.isEnabled": true
});
// First, define the shared context menu for all Nodes, Links, and Groups.
// Define the appearance and behavior for Nodes:
// To simplify this code we define a function for creating a context menu button:
function makeButton(text: string, action, visiblePredicate?) {
if (visiblePredicate === undefined) visiblePredicate = function() { return true; };
return $("ContextMenuButton",
$(go.TextBlock, text),
{ click: action },
new go.Binding("visible", "", visiblePredicate).ofObject());
}
// First, define the shared context menu for all Nodes, Links, and Groups.
// a context menu is an Adornment with a bunch of buttons in them
var partContextMenu =
$(go.Adornment, "Vertical",
makeButton("Properties",
function(e, obj) { // the OBJ is this Button
var contextmenu = obj.part; // the Button is in the context menu Adornment
var part = contextmenu.adornedPart; // the adornedPart is the Part that the context menu adorns
// now can do something with PART, or with its data, or with the Adornment (the context menu)
if (part instanceof go.Link) alert(linkInfo(part.data));
else if (part instanceof go.Group) alert(groupInfo(contextmenu));
else alert(nodeInfo(part.data));
}),
makeButton("Cut",
function(e, obj) { e.diagram.commandHandler.cutSelection(); },
function(o) { return o.diagram.commandHandler.canCutSelection(); }),
makeButton("Copy",
function(e, obj) { e.diagram.commandHandler.copySelection(); },
function(o) { return o.diagram.commandHandler.canCopySelection(); }),
makeButton("Paste",
function(e, obj) { e.diagram.commandHandler.pasteSelection(e.diagram.lastInput.documentPoint); },
function(o) { return o.diagram.commandHandler.canPasteSelection(); }),
makeButton("Delete",
function(e, obj) { e.diagram.commandHandler.deleteSelection(); },
function(o) { return o.diagram.commandHandler.canDeleteSelection(); }),
makeButton("Undo",
function(e, obj) { e.diagram.commandHandler.undo(); },
function(o) { return o.diagram.commandHandler.canUndo(); }),
makeButton("Redo",
function(e, obj) { e.diagram.commandHandler.redo(); },
function(o) { return o.diagram.commandHandler.canRedo(); }),
makeButton("Group",
function(e, obj) { e.diagram.commandHandler.groupSelection(); },
function(o) { return o.diagram.commandHandler.canGroupSelection(); }),
makeButton("Ungroup",
function(e, obj) { e.diagram.commandHandler.ungroupSelection(); },
function(o) { return o.diagram.commandHandler.canUngroupSelection(); })
);
function nodeInfo(d) { // Tooltip info for a node data object
var str = "Node " + d.key + ": " + d.text + "\n";
if (d.group)
str += "member of " + d.group;
else
str += "top-level node";
return str;
}
// These nodes have text surrounded by a rounded rectangle
// whose fill color is bound to the node data.
// The user can drag a node by dragging its TextBlock label.
// Dragging from the Shape will start drawing a new link.
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{ locationSpot: go.Spot.Center },
$(go.Shape, "RoundedRectangle",
{
fill: "white",
portId: "", cursor: "pointer", // the Shape is the port, not the whole Node
// allow all kinds of links from and to this port
fromLinkable: true, fromLinkableSelfNode: true, fromLinkableDuplicates: true,
toLinkable: true, toLinkableSelfNode: true, toLinkableDuplicates: true
},
new go.Binding("fill", "color")),
$(go.TextBlock,
{
margin: 4, // make some extra space for the shape around the text
isMultiline: false, // don't allow newlines in text
editable: true // allow in-place editing by user
},
new go.Binding("text", "text").makeTwoWay()), // the label shows the node data's text
{ // this tooltip Adornment is shared by all nodes
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 }, // the tooltip shows the result of calling nodeInfo(data)
new go.Binding("text", "", nodeInfo))
),
// this context menu Adornment is shared by all nodes
contextMenu: partContextMenu
}
);
// Define the appearance and behavior for Links:
function linkInfo(d) { // Tooltip info for a link data object
return "Link:\nfrom " + d.from + " to " + d.to;
}
// The link shape and arrowhead have their stroke brush data bound to the "color" property
myDiagram.linkTemplate =
$(go.Link,
{ relinkableFrom: true, relinkableTo: true }, // allow the user to relink existing links
$(go.Shape,
{ strokeWidth: 2 },
new go.Binding("stroke", "color")),
$(go.Shape,
{ toArrow: "Standard", stroke: null },
new go.Binding("fill", "color")),
{ // this tooltip Adornment is shared by all links
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 }, // the tooltip shows the result of calling linkInfo(data)
new go.Binding("text", "", linkInfo))
),
// the same context menu Adornment is shared by all links
contextMenu: partContextMenu
}
);
// Define the appearance and behavior for Groups:
function groupInfo(adornment) { // takes the tooltip, not a group node data object
var g = adornment.adornedPart; // get the Group that the tooltip adorns
var mems = g.memberParts.count;
var links = 0;
var it = g.memberParts;
while (it.next()) {
if (it.value instanceof go.Link) links++;
// To simplify this code we define a function for creating a context menu button:
function makeButton(text: string, action: (e: go.InputEvent, obj: go.GraphObject) => void, visiblePredicate?: (obj: go.GraphObject) => boolean) {
if (visiblePredicate === undefined) visiblePredicate = function (o) { return true; };
return $("ContextMenuButton",
$(go.TextBlock, text),
{ click: action },
// don't bother with binding GraphObject.visible if there's no predicate
visiblePredicate ? new go.Binding("visible", "", visiblePredicate).ofObject() : {});
}
return "Group " + g.data.key + ": " + g.data.text + "\n" + mems + " members including " + links + " links";
}
// Groups consist of a title in the color given by the group node data
// above a translucent gray rectangle surrounding the member parts
myDiagram.groupTemplate =
// a context menu is an Adornment with a bunch of buttons in them
var partContextMenu =
$(go.Adornment, "Vertical",
makeButton("Properties",
function (e, obj) { // the OBJ is this Button
var contextmenu = <go.Adornment>obj.part; // the Button is in the context menu Adornment
var part = contextmenu.adornedPart; // the adornedPart is the Part that the context menu adorns
// now can do something with PART, or with its data, or with the Adornment (the context menu)
if (part instanceof go.Link) alert(linkInfo(part.data));
else if (part instanceof go.Group) alert(groupInfo(contextmenu));
else alert(nodeInfo(part.data));
}),
makeButton("Cut",
function (e, obj) { e.diagram.commandHandler.cutSelection(); },
function (o) { return o.diagram.commandHandler.canCutSelection(); }),
makeButton("Copy",
function (e, obj) { e.diagram.commandHandler.copySelection(); },
function (o) { return o.diagram.commandHandler.canCopySelection(); }),
makeButton("Paste",
function (e, obj) { e.diagram.commandHandler.pasteSelection(e.diagram.lastInput.documentPoint); },
function (o) { return o.diagram.commandHandler.canPasteSelection(); }),
makeButton("Delete",
function (e, obj) { e.diagram.commandHandler.deleteSelection(); },
function (o) { return o.diagram.commandHandler.canDeleteSelection(); }),
makeButton("Undo",
function (e, obj) { e.diagram.commandHandler.undo(); },
function (o) { return o.diagram.commandHandler.canUndo(); }),
makeButton("Redo",
function (e, obj) { e.diagram.commandHandler.redo(); },
function (o) { return o.diagram.commandHandler.canRedo(); }),
makeButton("Group",
function (e, obj) { e.diagram.commandHandler.groupSelection(); },
function (o) { return o.diagram.commandHandler.canGroupSelection(); }),
makeButton("Ungroup",
function (e, obj) { e.diagram.commandHandler.ungroupSelection(); },
function (o) { return o.diagram.commandHandler.canUngroupSelection(); })
);
function nodeInfo(d) { // Tooltip info for a node data object
var str = "Node " + d.key + ": " + d.text + "\n";
if (d.group)
str += "member of " + d.group;
else
str += "top-level node";
return str;
}
// These nodes have text surrounded by a rounded rectangle
// whose fill color is bound to the node data.
// The user can drag a node by dragging its TextBlock label.
// Dragging from the Shape will start drawing a new link.
myDiagram.nodeTemplate =
$(go.Node, "Auto",
{ locationSpot: go.Spot.Center },
$(go.Shape, "RoundedRectangle",
{
fill: "white", // the default fill, if there is no data-binding
portId: "", cursor: "pointer", // the Shape is the port, not the whole Node
// allow all kinds of links from and to this port
fromLinkable: true, fromLinkableSelfNode: true, fromLinkableDuplicates: true,
toLinkable: true, toLinkableSelfNode: true, toLinkableDuplicates: true
},
new go.Binding("fill", "color")),
$(go.TextBlock,
{
font: "bold 14px sans-serif",
stroke: '#333',
margin: 6, // make some extra space for the shape around the text
isMultiline: false, // don't allow newlines in text
editable: true // allow in-place editing by user
},
new go.Binding("text", "text").makeTwoWay()), // the label shows the node data's text
{ // this tooltip Adornment is shared by all nodes
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 }, // the tooltip shows the result of calling nodeInfo(data)
new go.Binding("text", "", nodeInfo))
),
// this context menu Adornment is shared by all nodes
contextMenu: partContextMenu
}
);
// Define the appearance and behavior for Links:
function linkInfo(d) { // Tooltip info for a link data object
return "Link:\nfrom " + d.from + " to " + d.to;
}
// The link shape and arrowhead have their stroke brush data bound to the "color" property
myDiagram.linkTemplate =
$(go.Link,
{ relinkableFrom: true, relinkableTo: true }, // allow the user to relink existing links
$(go.Shape,
{ strokeWidth: 2 },
new go.Binding("stroke", "color")),
$(go.Shape,
{ toArrow: "Standard", stroke: null },
new go.Binding("fill", "color")),
{ // this tooltip Adornment is shared by all links
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 }, // the tooltip shows the result of calling linkInfo(data)
new go.Binding("text", "", linkInfo))
),
// the same context menu Adornment is shared by all links
contextMenu: partContextMenu
}
);
// Define the appearance and behavior for Groups:
function groupInfo(adornment: go.Adornment) { // takes the tooltip, not a group node data object
var g = <go.Group>adornment.adornedPart; // get the Group that the tooltip adorns
var mems = g.memberParts.count;
var links = 0;
g.memberParts.each(function (part) {
if (part instanceof go.Link) links++;
});
return "Group " + g.data.key + ": " + g.data.text + "\n" + mems + " members including " + links + " links";
}
// Groups consist of a title in the color given by the group node data
// above a translucent gray rectangle surrounding the member parts
myDiagram.groupTemplate =
$(go.Group, "Vertical",
{
selectionObjectName: "PANEL", // selection handle goes around shape, not label
ungroupable: true // enable Ctrl-Shift-G to ungroup a selected Group
},
$(go.TextBlock,
{
font: "bold 12pt sans-serif",
isMultiline: false, // don't allow newlines in text
editable: true // allow in-place editing by user
selectionObjectName: "PANEL", // selection handle goes around shape, not label
ungroupable: true // enable Ctrl-Shift-G to ungroup a selected Group
},
new go.Binding("text", "text").makeTwoWay(),
new go.Binding("stroke", "color")),
$(go.Panel, "Auto",
{ name: "PANEL" },
$(go.Shape, "Rectangle", // the rectangular shape around the members
{ fill: "rgba(128,128,128,0.2)", stroke: "gray", strokeWidth: 3 }),
$(go.Placeholder, { padding: 5 }) // represents where the members are
),
{ // this tooltip Adornment is shared by all groups
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 },
// bind to tooltip, not to Group.data, to allow access to Group properties
new go.Binding("text", "", groupInfo).ofObject())
),
// the same context menu Adornment is shared by all groups
contextMenu: partContextMenu
}
);
$(go.TextBlock,
{
font: "bold 12pt sans-serif",
isMultiline: false, // don't allow newlines in text
editable: true // allow in-place editing by user
},
new go.Binding("text", "text").makeTwoWay(),
new go.Binding("stroke", "color")),
$(go.Panel, "Auto",
{ name: "PANEL" },
$(go.Shape, "Rectangle", // the rectangular shape around the members
{ fill: "rgba(128,128,128,0.2)", stroke: "gray", strokeWidth: 3 }),
$(go.Placeholder, { padding: 5 }) // represents where the members are
),
{ // this tooltip Adornment is shared by all groups
toolTip:
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 },
// bind to tooltip, not to Group.data, to allow access to Group properties
new go.Binding("text", "", groupInfo).ofObject())
),
// the same context menu Adornment is shared by all groups
contextMenu: partContextMenu
}
);
// Define the behavior for the Diagram background:
// Define the behavior for the Diagram background:
function diagramInfo(model) { // Tooltip info for the diagram's model
return "Model:\n" + model.nodeDataArray.length + " nodes, " + model.linkDataArray.length + " links";
}
function diagramInfo(model: go.GraphLinksModel) { // Tooltip info for the diagram's model
return "Model:\n" + model.nodeDataArray.length + " nodes, " + model.linkDataArray.length + " links";
}
// provide a tooltip for the background of the Diagram, when not over any Part
myDiagram.toolTip =
// provide a tooltip for the background of the Diagram, when not over any Part
myDiagram.toolTip =
$(go.Adornment, "Auto",
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 },
new go.Binding("text", "", diagramInfo))
);
$(go.Shape, { fill: "#FFFFCC" }),
$(go.TextBlock, { margin: 4 },
new go.Binding("text", "", diagramInfo))
);
// provide a context menu for the background of the Diagram, when not over any Part
myDiagram.contextMenu =
// provide a context menu for the background of the Diagram, when not over any Part
myDiagram.contextMenu =
$(go.Adornment, "Vertical",
makeButton("Paste",
function(e, obj) { e.diagram.commandHandler.pasteSelection(e.diagram.lastInput.documentPoint); },
function(o) { return o.diagram.commandHandler.canPasteSelection(); }),
makeButton("Undo",
function(e, obj) { e.diagram.commandHandler.undo(); },
function(o) { return o.diagram.commandHandler.canUndo(); }),
makeButton("Redo",
function(e, obj) { e.diagram.commandHandler.redo(); },
function(o) { return o.diagram.commandHandler.canRedo(); })
);
makeButton("Paste",
function (e, obj) { e.diagram.commandHandler.pasteSelection(e.diagram.lastInput.documentPoint); },
function (o) { return o.diagram.commandHandler.canPasteSelection(); }),
makeButton("Undo",
function (e, obj) { e.diagram.commandHandler.undo(); },
function (o) { return o.diagram.commandHandler.canUndo(); }),
makeButton("Redo",
function (e, obj) { e.diagram.commandHandler.redo(); },
function (o) { return o.diagram.commandHandler.canRedo(); })
);
// Create the Diagram's Model:
var nodeDataArray = [
{ key: 1, text: "Alpha", color: "lightblue" },
{ key: 2, text: "Beta", color: "orange" },
{ key: 3, text: "Gamma", color: "lightgreen", group: 5 },
{ key: 4, text: "Delta", color: "pink", group: 5 },
{ key: 5, text: "Epsilon", color: "green", isGroup: true }
];
var linkDataArray = [
{ from: 1, to: 2, color: "blue" },
{ from: 2, to: 2 },
{ from: 3, to: 4, color: "green" },
{ from: 3, to: 1, color: "purple" }
];
myDiagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
// now enable undo/redo, only after setting the Diagram.model
myDiagram.model.undoManager.isEnabled = true;
// Create the Diagram's Model:
var nodeDataArray = [
{ key: 1, text: "Alpha", color: "lightblue" },
{ key: 2, text: "Beta", color: "orange" },
{ key: 3, text: "Gamma", color: "lightgreen", group: 5 },
{ key: 4, text: "Delta", color: "pink", group: 5 },
{ key: 5, text: "Epsilon", color: "green", isGroup: true }
];
var linkDataArray = [
{ from: 1, to: 2, color: "blue" },
{ from: 2, to: 2 },
{ from: 3, to: 4, color: "green" },
{ from: 3, to: 1, color: "purple" }
];
myDiagram.model = new go.GraphLinksModel(nodeDataArray, linkDataArray);
}

3717
goJS/goJS.d.ts vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More