mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-07 18:50:14 +00:00
Merge branch 'master' of https://github.com/borisyankov/DefinitelyTyped
Conflicts: socket.io-client/socket.io-client.d.ts
This commit is contained in:
4
angular-material/angular-material-0.9.0.d.ts
vendored
4
angular-material/angular-material-0.9.0.d.ts
vendored
@@ -150,8 +150,8 @@ declare module angular.material {
|
||||
A400?: string;
|
||||
A700?: string;
|
||||
contrastDefaultColor?: string;
|
||||
contrastDarkColors?: string;
|
||||
contrastStrongLightColors?: string;
|
||||
contrastDarkColors?: string|string[];
|
||||
contrastLightColors?: string|string[];
|
||||
}
|
||||
|
||||
interface MDThemeHues {
|
||||
|
||||
2
angular-material/angular-material.d.ts
vendored
2
angular-material/angular-material.d.ts
vendored
@@ -144,7 +144,7 @@ declare module angular.material {
|
||||
|
||||
interface IToastService {
|
||||
show(optionsOrPreset: IToastOptions|IToastPreset<any>): angular.IPromise<any>;
|
||||
showSimple(): angular.IPromise<any>;
|
||||
showSimple(content: string): angular.IPromise<any>;
|
||||
simple(): ISimpleToastPreset;
|
||||
build(): IToastPreset<any>;
|
||||
updateContent(): void;
|
||||
|
||||
7
angular-ui-router/angular-ui-router.d.ts
vendored
7
angular-ui-router/angular-ui-router.d.ts
vendored
@@ -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 {
|
||||
|
||||
8
angular.throttle/angular.throttle-tests.ts
Normal file
8
angular.throttle/angular.throttle-tests.ts
Normal 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
12
angular.throttle/angular.throttle.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
6875
angular2/angular2-2.0.0-alpha.30.d.ts
vendored
Normal file
6875
angular2/angular2-2.0.0-alpha.30.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -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");
|
||||
|
||||
8003
angular2/angular2.d.ts
vendored
8003
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
352
angular2/router-2.0.0-alpha.30.d.ts
vendored
Normal 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;
|
||||
}
|
||||
352
angular2/router.d.ts
vendored
Normal file
352
angular2/router.d.ts
vendored
Normal 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.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;
|
||||
}
|
||||
155
angularjs/angular-animate.d.ts
vendored
155
angularjs/angular-animate.d.ts
vendored
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
45
angularjs/angular-cookies.d.ts
vendored
45
angularjs/angular-cookies.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
44
angularjs/angular-mocks.d.ts
vendored
44
angularjs/angular-mocks.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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){},
|
||||
|
||||
77
angularjs/angular.d.ts
vendored
77
angularjs/angular.d.ts
vendored
@@ -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)
|
||||
@@ -1074,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;
|
||||
@@ -1106,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 {
|
||||
@@ -1131,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.
|
||||
*/
|
||||
@@ -1141,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;
|
||||
@@ -1163,7 +1175,7 @@ declare module angular {
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// CompileService
|
||||
// see http://docs.angularjs.org/api/ng.$compile
|
||||
@@ -1416,6 +1428,11 @@ declare module angular {
|
||||
*/
|
||||
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;
|
||||
|
||||
3396
arcgis-js-api/arcgis-js-api.d.ts
vendored
3396
arcgis-js-api/arcgis-js-api.d.ts
vendored
File diff suppressed because it is too large
Load Diff
3
atom-keymap/.editorconfig
Normal file
3
atom-keymap/.editorconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
[*.ts]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
24
atom-keymap/atom-keymap-tests.ts
Normal file
24
atom-keymap/atom-keymap-tests.ts
Normal 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
135
atom-keymap/atom-keymap.d.ts
vendored
Normal 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;
|
||||
}
|
||||
6
auth0/auth0.d.ts
vendored
6
auth0/auth0.d.ts
vendored
@@ -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
|
||||
}
|
||||
|
||||
4
backbone/backbone.d.ts
vendored
4
backbone/backbone.d.ts
vendored
@@ -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.
|
||||
|
||||
7
blob-stream/blob-stream-tests.ts
Normal file
7
blob-stream/blob-stream-tests.ts
Normal 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
20
blob-stream/blob-stream.d.ts
vendored
Normal 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;
|
||||
}
|
||||
10
browserify/browserify.d.ts
vendored
10
browserify/browserify.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
};
|
||||
|
||||
51
codemirror/codemirror.d.ts
vendored
51
codemirror/codemirror.d.ts
vendored
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
16
contextjs/contextjs-tests.ts
Normal file
16
contextjs/contextjs-tests.ts
Normal 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
33
contextjs/contextjs.d.ts
vendored
Normal 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
1
cson/cson-test.cson
Normal file
@@ -0,0 +1 @@
|
||||
hello: 'world'
|
||||
1
cson/cson-test.json
Normal file
1
cson/cson-test.json
Normal file
@@ -0,0 +1 @@
|
||||
{"hello": "world"}
|
||||
36
cson/cson-tests.ts
Normal file
36
cson/cson-tests.ts
Normal 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
32
cson/cson.d.ts
vendored
Normal 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;
|
||||
}
|
||||
@@ -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; }]
|
||||
]);
|
||||
}
|
||||
5
d3/d3.d.ts
vendored
5
d3/d3.d.ts
vendored
@@ -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.
|
||||
@@ -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;
|
||||
}
|
||||
@@ -2720,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
2
deep-diff/deep-diff.d.ts
vendored
2
deep-diff/deep-diff.d.ts
vendored
@@ -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;
|
||||
|
||||
44
easy-api-request/easy-api-request-tests.ts
Normal file
44
easy-api-request/easy-api-request-tests.ts
Normal 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
115
easy-api-request/easy-api-request.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
49
easy-jsend/easy-jsend-tests.ts
Normal file
49
easy-jsend/easy-jsend-tests.ts
Normal 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
38
easy-jsend/easy-jsend.d.ts
vendored
Normal 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;
|
||||
}
|
||||
16
easy-x-headers/easy-x-headers-tests.ts
Normal file
16
easy-x-headers/easy-x-headers-tests.ts
Normal 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
18
easy-x-headers/easy-x-headers.d.ts
vendored
Normal 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;
|
||||
}
|
||||
27
easy-xapi-supertest/easy-xapi-supertest-tests.ts
Normal file
27
easy-xapi-supertest/easy-xapi-supertest-tests.ts
Normal 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');
|
||||
29
easy-xapi-supertest/easy-xapi-supertest.d.ts
vendored
Normal file
29
easy-xapi-supertest/easy-xapi-supertest.d.ts
vendored
Normal 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;
|
||||
}
|
||||
32
easy-xapi/easy-xapi-tests.ts
Normal file
32
easy-xapi/easy-xapi-tests.ts
Normal 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
47
easy-xapi/easy-xapi.d.ts
vendored
Normal 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
3
event-kit/.editorconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
[*.ts]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
65
event-kit/event-kit-tests.ts
Normal file
65
event-kit/event-kit-tests.ts
Normal 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
82
event-kit/event-kit.d.ts
vendored
Normal 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;
|
||||
}
|
||||
4
firebase/firebase.d.ts
vendored
4
firebase/firebase.d.ts
vendored
@@ -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
3
first-mate/.editorconfig
Normal file
@@ -0,0 +1,3 @@
|
||||
[*.ts]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
15
first-mate/first-mate-tests.ts
Normal file
15
first-mate/first-mate-tests.ts
Normal 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
108
first-mate/first-mate.d.ts
vendored
Normal 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
28
flux/flux.d.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
20
fullCalendar/fullCalendar.d.ts
vendored
20
fullCalendar/fullCalendar.d.ts
vendored
@@ -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.
|
||||
|
||||
@@ -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: {}
|
||||
}
|
||||
}*/
|
||||
129
globalize/globalize.d.ts
vendored
129
globalize/globalize.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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
3717
goJS/goJS.d.ts
vendored
File diff suppressed because it is too large
Load Diff
907
googlemaps/google.maps.d.ts
vendored
907
googlemaps/google.maps.d.ts
vendored
File diff suppressed because it is too large
Load Diff
14
gulp-debug/gulp-debug-tests.ts
Normal file
14
gulp-debug/gulp-debug-tests.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path="gulp-debug.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import debug = require('gulp-debug');
|
||||
|
||||
gulp.task('default', () =>
|
||||
gulp.src('foo.js')
|
||||
.pipe(debug({title: 'unicorn:'}))
|
||||
.pipe(gulp.dest('dist'))
|
||||
);
|
||||
|
||||
|
||||
debug();
|
||||
17
gulp-debug/gulp-debug.d.ts
vendored
Normal file
17
gulp-debug/gulp-debug.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for gulp-debug v2.0.1
|
||||
// Project: https://github.com/sindresorhus/gulp-debug
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-debug' {
|
||||
interface IOptions {
|
||||
title?: string;
|
||||
minimal?: boolean;
|
||||
}
|
||||
|
||||
function debug(options?: IOptions): NodeJS.ReadWriteStream;
|
||||
|
||||
export = debug;
|
||||
}
|
||||
32
gulp-jasmine-browser/gulp-jasmine-browser-tests.ts
Normal file
32
gulp-jasmine-browser/gulp-jasmine-browser-tests.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/// <reference path="gulp-jasmine-browser.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import jasmineBrowser = require('gulp-jasmine-browser');
|
||||
|
||||
gulp.task('jasmine', () =>
|
||||
gulp.src(['src/**/*.js', 'spec/**/*_spec.js'])
|
||||
.pipe(jasmineBrowser.specRunner())
|
||||
.pipe(jasmineBrowser.server({port: 8888}))
|
||||
);
|
||||
|
||||
|
||||
gulp.task('jasmine-phantom', () =>
|
||||
gulp.src(['src/**/*.js', 'spec/**/*_spec.js'])
|
||||
.pipe(jasmineBrowser.specRunner({console: true}))
|
||||
.pipe(jasmineBrowser.headless())
|
||||
);
|
||||
|
||||
|
||||
gulp.task('jasmine-slimerjs', () =>
|
||||
gulp.src(['src/**/*.js', 'spec/**/*_spec.js'])
|
||||
.pipe(jasmineBrowser.specRunner({console: true}))
|
||||
.pipe(jasmineBrowser.headless({driver: 'slimerjs'}))
|
||||
);
|
||||
|
||||
|
||||
gulp.task('jasmine', () =>
|
||||
gulp.src('spec/**/*_spec.js')
|
||||
.pipe(jasmineBrowser.specRunner())
|
||||
.pipe(jasmineBrowser.server())
|
||||
);
|
||||
17
gulp-jasmine-browser/gulp-jasmine-browser.d.ts
vendored
Normal file
17
gulp-jasmine-browser/gulp-jasmine-browser.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
// Type definitions for gulp-jasmine-browser v0.1.4
|
||||
// Project: https://github.com/jasmine/gulp-jasmine-browser
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-jasmine-browser' {
|
||||
interface IJasmineBrowser {
|
||||
specRunner(options?: any): NodeJS.ReadWriteStream;
|
||||
server(options?: any): NodeJS.ReadWriteStream;
|
||||
headless(options?: any): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
var jasmineBrowser: IJasmineBrowser;
|
||||
export = jasmineBrowser;
|
||||
}
|
||||
20
gulp-protractor/gulp-protractor-tests.ts
Normal file
20
gulp-protractor/gulp-protractor-tests.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/// <reference path="gulp-protractor.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import protractor = require('gulp-protractor');
|
||||
|
||||
gulp.src(["./src/tests/*.js"])
|
||||
.pipe(protractor.protractor({
|
||||
configFile: "test/protractor.config.js",
|
||||
args: ['--baseUrl', 'http://127.0.0.1:8000']
|
||||
}))
|
||||
|
||||
|
||||
gulp.task('webdriver_standalone', protractor.webdriver_standalone);
|
||||
|
||||
|
||||
gulp.task('webdriver-update', protractor.webdriver_update);
|
||||
|
||||
|
||||
console.log(protractor.getProtractorDir());
|
||||
25
gulp-protractor/gulp-protractor.d.ts
vendored
Normal file
25
gulp-protractor/gulp-protractor.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for gulp-protractor v1.0.0
|
||||
// Project: https://github.com/mllrsohn/gulp-protractor
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
declare module 'gulp-protractor' {
|
||||
interface IOptions {
|
||||
configFile?: string;
|
||||
args?: Array<string>;
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
interface IGulpProtractor {
|
||||
getProtractorDir(): string;
|
||||
protractor(options?: IOptions): NodeJS.ReadWriteStream;
|
||||
webdriver_standalone: gulp.ITaskCallback;
|
||||
webdriver_update: gulp.ITaskCallback;
|
||||
}
|
||||
|
||||
var protractor: IGulpProtractor;
|
||||
export = protractor;
|
||||
}
|
||||
63
gulp-rev-replace/gulp-rev-replace-tests.ts
Normal file
63
gulp-rev-replace/gulp-rev-replace-tests.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
/// <reference path="gulp-rev-replace.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
/// <reference path="../gulp-rev/gulp-rev.d.ts" />
|
||||
/// <reference path="../gulp-useref/gulp-useref.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import revReplace = require('gulp-rev-replace');
|
||||
import rev = require('gulp-rev');
|
||||
import useref = require('gulp-useref');
|
||||
|
||||
gulp.task("index", () => {
|
||||
var userefAssets = useref.assets();
|
||||
|
||||
return gulp.src("src/index.html")
|
||||
.pipe(userefAssets) // Concatenate with gulp-useref
|
||||
.pipe(rev()) // Rename the concatenated files
|
||||
.pipe(userefAssets.restore())
|
||||
.pipe(useref())
|
||||
.pipe(revReplace()) // Substitute in new filenames
|
||||
.pipe(gulp.dest('public'));
|
||||
});
|
||||
|
||||
|
||||
var opt = {
|
||||
srcFolder: 'src',
|
||||
distFolder: 'dist'
|
||||
}
|
||||
|
||||
gulp.task("revision", ["dist:css", "dist:js"], () =>
|
||||
gulp.src(["dist/**/*.css", "dist/**/*.js"])
|
||||
.pipe(rev())
|
||||
.pipe(gulp.dest(opt.distFolder))
|
||||
.pipe(rev.manifest())
|
||||
.pipe(gulp.dest(opt.distFolder))
|
||||
);
|
||||
|
||||
gulp.task("revreplace", ["revision"], () => {
|
||||
var manifest = gulp.src("./" + opt.distFolder + "/rev-manifest.json");
|
||||
|
||||
return gulp.src(opt.srcFolder + "/index.html")
|
||||
.pipe(revReplace({manifest: manifest}))
|
||||
.pipe(gulp.dest(opt.distFolder));
|
||||
});
|
||||
|
||||
|
||||
function replaceJsIfMap(filename: string): string {
|
||||
if (filename.indexOf('.map') > -1) {
|
||||
return filename.replace('js/', '');
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
gulp.task("revreplace", ["revision"], () => {
|
||||
var manifest = gulp.src("./" + opt.distFolder + "/rev-manifest.json");
|
||||
|
||||
return gulp.src(opt.distFolder + '**/*.js')
|
||||
.pipe(revReplace({
|
||||
manifest: manifest,
|
||||
modifyUnreved: replaceJsIfMap,
|
||||
modifyReved: replaceJsIfMap
|
||||
}))
|
||||
.pipe(gulp.dest(opt.distFolder));
|
||||
});
|
||||
21
gulp-rev-replace/gulp-rev-replace.d.ts
vendored
Normal file
21
gulp-rev-replace/gulp-rev-replace.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Type definitions for gulp-rev-replace v0.2.1
|
||||
// Project: https://github.com/jamesknelson/gulp-rev-replace
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-rev-replace' {
|
||||
interface IOptions {
|
||||
canonicalUris?: boolean;
|
||||
replaceInExtensions?: Array<string>;
|
||||
prefix?: string;
|
||||
manifest?: NodeJS.ReadWriteStream;
|
||||
modifyUnreved?: Function;
|
||||
modifyReved?: Function;
|
||||
}
|
||||
|
||||
function revReplace(options?: IOptions): NodeJS.ReadWriteStream;
|
||||
|
||||
export = revReplace;
|
||||
}
|
||||
36
gulp-rev/gulp-rev-tests.ts
Normal file
36
gulp-rev/gulp-rev-tests.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/// <reference path="gulp-rev.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import rev = require('gulp-rev');
|
||||
|
||||
gulp.task('default', () =>
|
||||
gulp.src('src/*.css')
|
||||
.pipe(rev())
|
||||
.pipe(gulp.dest('dist'))
|
||||
);
|
||||
|
||||
gulp.task('default', () =>
|
||||
// by default, gulp would pick `assets/css` as the base,
|
||||
// so we need to set it explicitly:
|
||||
gulp.src(['assets/css/*.css', 'assets/js/*.js'], {base: 'assets'})
|
||||
.pipe(gulp.dest('build/assets')) // copy original assets to build dir
|
||||
.pipe(rev())
|
||||
.pipe(gulp.dest('build/assets')) // write rev'd assets to build dir
|
||||
.pipe(rev.manifest())
|
||||
.pipe(gulp.dest('build/assets')) // write manifest to build dir
|
||||
);
|
||||
|
||||
gulp.task('default', () =>
|
||||
// by default, gulp would pick `assets/css` as the base,
|
||||
// so we need to set it explicitly:
|
||||
gulp.src(['assets/css/*.css', 'assets/js/*.js'], {base: 'assets'})
|
||||
.pipe(gulp.dest('build/assets'))
|
||||
.pipe(rev())
|
||||
.pipe(gulp.dest('build/assets'))
|
||||
.pipe(rev.manifest({
|
||||
base: 'build/assets',
|
||||
merge: true // merge with the existing manifest (if one exists)
|
||||
}))
|
||||
.pipe(gulp.dest('build/assets'))
|
||||
);
|
||||
26
gulp-rev/gulp-rev.d.ts
vendored
Normal file
26
gulp-rev/gulp-rev.d.ts
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
// Type definitions for gulp-csso v5.0.1
|
||||
// Project: https://github.com/sindresorhus/gulp-rev
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-rev' {
|
||||
interface IOptions {
|
||||
base?: string;
|
||||
cwd?: string;
|
||||
merge?: boolean;
|
||||
}
|
||||
|
||||
interface IRev {
|
||||
(): NodeJS.ReadWriteStream;
|
||||
|
||||
manifest(): NodeJS.ReadWriteStream;
|
||||
manifest(path?: string): NodeJS.ReadWriteStream;
|
||||
manifest(options?: IOptions): NodeJS.ReadWriteStream;
|
||||
manifest(path?: string, options?: IOptions): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
var rev: IRev;
|
||||
export = rev;
|
||||
}
|
||||
27
gulp-size/gulp-size-tests.ts
Normal file
27
gulp-size/gulp-size-tests.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/// <reference path="gulp-size.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
/// <reference path="../gulp-debug/gulp-debug.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import size = require('gulp-size');
|
||||
import debug = require('gulp-debug');
|
||||
|
||||
gulp.task('default', () =>
|
||||
gulp.src('fixture.js')
|
||||
.pipe(size())
|
||||
.pipe(gulp.dest('dist'))
|
||||
);
|
||||
|
||||
|
||||
gulp.task('default', () => {
|
||||
var s = size();
|
||||
|
||||
return gulp.src('fixture.js')
|
||||
.pipe(s)
|
||||
.pipe(gulp.dest('dist'))
|
||||
.pipe(debug({title: 'Total size ' + s.prettySize}));
|
||||
});
|
||||
|
||||
|
||||
size();
|
||||
size({showFiles: true, gzip: true});
|
||||
23
gulp-size/gulp-size.d.ts
vendored
Normal file
23
gulp-size/gulp-size.d.ts
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
// Type definitions for gulp-size v1.2.3
|
||||
// Project: https://github.com/sindresorhus/gulp-size
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-size' {
|
||||
interface IOptions {
|
||||
showFiles?: boolean;
|
||||
gzip?: boolean;
|
||||
title?: string;
|
||||
}
|
||||
|
||||
interface ISizeStream extends NodeJS.ReadWriteStream {
|
||||
size: number;
|
||||
prettySize: string;
|
||||
}
|
||||
|
||||
function size(options?: IOptions): ISizeStream;
|
||||
|
||||
export = size;
|
||||
}
|
||||
24
gulp-uglify/gulp-uglify-tests.ts
Normal file
24
gulp-uglify/gulp-uglify-tests.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/// <reference path="./gulp-uglify.d.ts"/>
|
||||
/// <reference path="../gulp/gulp.d.ts"/>
|
||||
import gulp = require("gulp");
|
||||
import uglify = require("gulp-uglify");
|
||||
|
||||
|
||||
gulp.task('compress', function() {
|
||||
var tsResult = gulp.src('lib/*.ts')
|
||||
.pipe(uglify())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
|
||||
gulp.task('compress2', function() {
|
||||
var tsResult = gulp.src('lib/*.ts')
|
||||
.pipe(uglify({
|
||||
mangle: false,
|
||||
preserverComments: "some",
|
||||
compress: false,
|
||||
output: {
|
||||
max_line_len: 300
|
||||
}
|
||||
}))
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
175
gulp-uglify/gulp-uglify.d.ts
vendored
Normal file
175
gulp-uglify/gulp-uglify.d.ts
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
// Type definitions for gulp-uglify
|
||||
// Project: https://github.com/terinjokes/gulp-uglify
|
||||
// Definitions by: Christopher Haws <https://github.com/ChristopherHaws/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "gulp-uglify" {
|
||||
function GulpUglify(options?: IGulpUglifyOptions): NodeJS.ReadWriteStream;
|
||||
|
||||
interface IGulpUglifyOptions {
|
||||
/**
|
||||
* Pass false to skip mangling names.
|
||||
*/
|
||||
mangle?: boolean;
|
||||
|
||||
/**
|
||||
* Pass if you wish to specify additional output options. The defaults are optimized for best compression.
|
||||
*/
|
||||
output?: IOutputOptions;
|
||||
|
||||
/**
|
||||
* Pass an object to specify custom compressor options. Pass false to skip compression completely.
|
||||
*/
|
||||
compress?: boolean;
|
||||
|
||||
/**
|
||||
* A convenience option for options.output.comments. Defaults to preserving no comments.
|
||||
* all - Preserve all comments in code blocks
|
||||
* some - Preserve comments that start with a bang (!) or include a Closure Compiler directive (@preserve, @license, @cc_on)
|
||||
* function - Specify your own comment preservation function. You will be passed the current node and the current comment and are expected to return either true or false.
|
||||
*/
|
||||
preserverComments?: string|((node: any, comment: ITokenizer) => boolean);
|
||||
}
|
||||
|
||||
interface IOutputOptions {
|
||||
/**
|
||||
* Start indentation on every line (only when `beautify`)
|
||||
*/
|
||||
indent_start?: number;
|
||||
|
||||
/**
|
||||
* Indentation level (only when `beautify`)
|
||||
*/
|
||||
indent_level?: number;
|
||||
|
||||
/**
|
||||
* Quote all keys in object literals?
|
||||
*/
|
||||
quote_keys?: boolean;
|
||||
|
||||
/**
|
||||
* Add a space after colon signs?
|
||||
*/
|
||||
space_colon?: boolean;
|
||||
|
||||
/**
|
||||
* Output ASCII-safe? (encodes Unicode characters as ASCII)
|
||||
*/
|
||||
ascii_only?: boolean;
|
||||
|
||||
/**
|
||||
* Escape "</script"?
|
||||
*/
|
||||
inline_script?: boolean;
|
||||
|
||||
/**
|
||||
* Informative maximum line width (for beautified output)
|
||||
*/
|
||||
width?: number;
|
||||
|
||||
/**
|
||||
* Maximum line length (for non-beautified output)
|
||||
*/
|
||||
max_line_len?: number;
|
||||
|
||||
/**
|
||||
* Output IE-safe code?
|
||||
*/
|
||||
ie_proof?: boolean;
|
||||
|
||||
/**
|
||||
* Beautify output?
|
||||
*/
|
||||
beautify?: boolean;
|
||||
|
||||
/**
|
||||
* Output a source map
|
||||
*/
|
||||
source_map?: ISourceMapOptions;
|
||||
|
||||
/**
|
||||
* Use brackets every time?
|
||||
*/
|
||||
bracketize?: boolean;
|
||||
|
||||
/**
|
||||
* Output comments?
|
||||
*/
|
||||
comments?: boolean;
|
||||
|
||||
/**
|
||||
* Use semicolons to separate statements? (otherwise, newlines)
|
||||
*/
|
||||
semicolons?: boolean;
|
||||
}
|
||||
|
||||
interface ISourceMapOptions {
|
||||
/**
|
||||
* The compressed file name
|
||||
*/
|
||||
file?: string;
|
||||
/**
|
||||
* The root URL to the original sources
|
||||
*/
|
||||
root?: string;
|
||||
|
||||
/**
|
||||
* The input source map.
|
||||
* Useful when you compress code that was generated from some other source (possibly other programming language).
|
||||
* If you have an input source map, pass it in this argument and UglifyJS will generate a mapping that maps back
|
||||
* to the original source (as opposed to the compiled code that you are compressing).
|
||||
*/
|
||||
orig? :Object|JSON;
|
||||
}
|
||||
|
||||
interface ITokenizer {
|
||||
/**
|
||||
* The type of this token.
|
||||
* Can be "num", "string", "regexp", "operator", "punc", "atom", "name", "keyword", "comment1" or "comment2".
|
||||
* "comment1" and "comment2" are for single-line, respectively multi-line comments.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* The name of the file where this token originated from. Useful when compressing multiple files at once to generate the proper source map.
|
||||
*/
|
||||
file: string;
|
||||
|
||||
/**
|
||||
* The "value" of the token.
|
||||
* That's additional information and depends on the token type: "num", "string" and "regexp" tokens you get their literal value.
|
||||
* - For "operator" you get the operator.
|
||||
* - For "punc" it's the punctuation sign (parens, comma, semicolon etc).
|
||||
* - For "atom", "name" and "keyword" it's the name of the identifier
|
||||
* - For comments it's the body of the comment (excluding the initial "//" and "/*".
|
||||
*/
|
||||
value: string;
|
||||
|
||||
/**
|
||||
* The line number of this token in the original code.
|
||||
* 1-based index.
|
||||
*/
|
||||
line: number;
|
||||
|
||||
/**
|
||||
* The column number of this token in the original code.
|
||||
* 0-based index.
|
||||
*/
|
||||
col: number;
|
||||
|
||||
/**
|
||||
* Short for "newline before", it's a boolean that tells us whether there was a newline before this node in the original source. It helps for automatic semicolon insertion.
|
||||
* For multi-line comments in particular this will be set to true if there either was a newline before this comment, or * * if this comment contains a newline.
|
||||
*/
|
||||
nlb: boolean;
|
||||
|
||||
/**
|
||||
* This doesn't apply for comment tokens, but for all other token types it will be an array of comment tokens that were found before.
|
||||
*/
|
||||
comments_before: string[];
|
||||
}
|
||||
|
||||
export = GulpUglify;
|
||||
}
|
||||
15
gulp-useref/gulp-useref-tests.ts
Normal file
15
gulp-useref/gulp-useref-tests.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/// <reference path="gulp-useref.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import useref = require('gulp-useref');
|
||||
|
||||
gulp.task('default', () => {
|
||||
var assets = useref.assets();
|
||||
|
||||
return gulp.src('app/*.html')
|
||||
.pipe(assets)
|
||||
.pipe(assets.restore())
|
||||
.pipe(useref())
|
||||
.pipe(gulp.dest('dist'));
|
||||
});
|
||||
25
gulp-useref/gulp-useref.d.ts
vendored
Normal file
25
gulp-useref/gulp-useref.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// Type definitions for gulp-useref v1.2.0
|
||||
// Project: https://github.com/jonkemp/gulp-useref
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-useref' {
|
||||
interface IAssetsOptions {
|
||||
searchPath?: string | string[];
|
||||
noconcat?: boolean;
|
||||
}
|
||||
|
||||
interface IAssetsStream extends NodeJS.ReadWriteStream {
|
||||
restore(): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
interface IUseref {
|
||||
(options?: any): NodeJS.ReadWriteStream;
|
||||
assets(options?: IAssetsOptions): IAssetsStream;
|
||||
}
|
||||
|
||||
var useref: IUseref;
|
||||
export = useref;
|
||||
}
|
||||
30
gulp-watch/gulp-watch-tests.ts
Normal file
30
gulp-watch/gulp-watch-tests.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference path="gulp-watch.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import watch = require('gulp-watch');
|
||||
|
||||
gulp.task('stream', () =>
|
||||
gulp.src('css/**/*.css')
|
||||
.pipe(watch('css/**/*.css'))
|
||||
.pipe(gulp.dest('build'))
|
||||
);
|
||||
|
||||
gulp.task('callback', (cb) =>
|
||||
watch('css/**/*.css', () =>
|
||||
gulp.src('css/**/*.css')
|
||||
.pipe(watch('css/**/*.css'))
|
||||
.on('end', cb)
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task('build', () => {
|
||||
var files = [
|
||||
'app/**/*.ts',
|
||||
'lib/**/*.ts',
|
||||
'components/**/*.ts',
|
||||
];
|
||||
|
||||
gulp.src(files, { base: '..' })
|
||||
.pipe(watch(files, { base: '..' }));
|
||||
});
|
||||
27
gulp-watch/gulp-watch.d.ts
vendored
Normal file
27
gulp-watch/gulp-watch.d.ts
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Type definitions for gulp-watch v4.1.1
|
||||
// Project: https://github.com/floatdrop/gulp-watch
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'gulp-watch' {
|
||||
interface IOptions {
|
||||
ignoreInitial?: boolean;
|
||||
events?: Array<string>;
|
||||
base?: string;
|
||||
name?: string;
|
||||
verbose?: boolean;
|
||||
readDelay?: number;
|
||||
}
|
||||
|
||||
interface IWatchStream extends NodeJS.ReadWriteStream {
|
||||
add(path: string | Array<string>): NodeJS.ReadWriteStream;
|
||||
unwatch(path: string | Array<string>): NodeJS.ReadWriteStream;
|
||||
close(): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
function watch(glob: string | Array<string>, options?: IOptions, callback?: Function): IWatchStream;
|
||||
|
||||
export = watch;
|
||||
}
|
||||
2212
hapi/hapi-8.2.0.d.ts
vendored
Normal file
2212
hapi/hapi-8.2.0.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
99
hapi/hapi-tests-8.2.0.ts
Normal file
99
hapi/hapi-tests-8.2.0.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
/// <reference path="hapi.d.ts" />
|
||||
|
||||
import Hapi = require("hapi");
|
||||
|
||||
// Create a server with a host and port
|
||||
var server = new Hapi.Server();
|
||||
server.connection({
|
||||
host: "localhost",
|
||||
port: 8000,
|
||||
});
|
||||
|
||||
// Add plugins
|
||||
var plugin: any = {
|
||||
register: function (plugin: Object, options: Object, next: Function) {
|
||||
next();
|
||||
}
|
||||
};
|
||||
|
||||
plugin.register.attributes = {
|
||||
name: "test",
|
||||
version: "1.0.0"
|
||||
};
|
||||
|
||||
// optional options parameter
|
||||
server.register({}, function (err) {});
|
||||
|
||||
// optional options.routes.vhost parameter
|
||||
server.register({}, { select: 'api', routes: { prefix: '/prefix' } }, function (err) {});
|
||||
|
||||
//server.pack.register(plugin, (err: Object) => {
|
||||
// if (err) { throw err; }
|
||||
//});
|
||||
|
||||
//server.pack.register([plugin], (err: Object) => {
|
||||
// if (err) { throw err; }
|
||||
//});
|
||||
|
||||
// Add server method
|
||||
var add = function (a: number, b: number, next: (err: any, result?: any, ttl?: number) => void) {
|
||||
next(null, a + b);
|
||||
};
|
||||
|
||||
server.method("sum", add);//, { cache: { expiresIn: 2000 } });
|
||||
|
||||
server.methods["sum"](4, 5, (err: any, result: any) => {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
var addArray = function (array: Array<number>, next: (err: any, result?: any, ttl?: number) => void) {
|
||||
var sum: number = 0;
|
||||
array.forEach((item: number) => {
|
||||
sum += item;
|
||||
});
|
||||
next(null, sum);
|
||||
};
|
||||
|
||||
server.method("sumObj", addArray, {
|
||||
//cache: { expiresIn: 2000 },
|
||||
generateKey: (array: Array<number>) => {
|
||||
return array.join(',');
|
||||
}
|
||||
});
|
||||
|
||||
server.methods["sumObj"]([5, 6], (err: any, result: any) => {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
// Add the route
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/hello',
|
||||
handler: function (request: Hapi.Request, reply: Function) {
|
||||
reply('hello world');
|
||||
}
|
||||
});
|
||||
|
||||
server.route([{
|
||||
method: 'GET',
|
||||
path: '/hello2',
|
||||
handler: function (request: Hapi.Request, reply: Function) {
|
||||
reply('hello world2');
|
||||
}
|
||||
}]);
|
||||
|
||||
// config.validate parameters should be optional
|
||||
server.route([{
|
||||
method: 'GET',
|
||||
path: '/hello2',
|
||||
handler: function(request: Hapi.Request, reply: Function) {
|
||||
reply('hello world2');
|
||||
},
|
||||
config: {
|
||||
validate: {
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
// Start the server
|
||||
server.start();
|
||||
@@ -4,9 +4,9 @@ import Hapi = require("hapi");
|
||||
|
||||
// Create a server with a host and port
|
||||
var server = new Hapi.Server();
|
||||
server.connection({
|
||||
server.connection(<Hapi.IServerConnectionOptions>{
|
||||
host: "localhost",
|
||||
port: 8000,
|
||||
port: 8000
|
||||
});
|
||||
|
||||
// Add plugins
|
||||
@@ -24,7 +24,7 @@ plugin.register.attributes = {
|
||||
// optional options parameter
|
||||
server.register({}, function (err) {});
|
||||
|
||||
// optional options.routes.vhost parameter
|
||||
// optional options.routes.vhost parameter
|
||||
server.register({}, { select: 'api', routes: { prefix: '/prefix' } }, function (err) {});
|
||||
|
||||
//server.pack.register(plugin, (err: Object) => {
|
||||
|
||||
156
hapi/hapi.d.ts
vendored
156
hapi/hapi.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for hapi 8.2.0
|
||||
// Type definitions for hapi 8.8.0
|
||||
// Project: http://github.com/spumko/hapi
|
||||
// Definitions by: Jason Swearingen <http://github.com/jasonswearingen>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -62,7 +62,7 @@ declare module "hapi" {
|
||||
}
|
||||
|
||||
/** Any connections configuration server defaults can be included to override and customize the individual connection. */
|
||||
export interface ISeverConnectionOptions extends IConnectionConfigurationServerDefaults {
|
||||
export interface IServerConnectionOptions extends IConnectionConfigurationServerDefaults {
|
||||
/** - the public hostname or IP address. Used only to set server.info.host and server.info.uri. If not configured, defaults to the operating system hostname and if not available, to 'localhost'.*/
|
||||
host?: string;
|
||||
/** - sets the host name or IP address the connection will listen on.If not configured, defaults to host if present, otherwise to all available network interfaces (i.e. '0.0.0.0').Set to 127.0.0.1 or localhost to restrict connection to only those coming from the same machine.*/
|
||||
@@ -83,7 +83,7 @@ declare module "hapi" {
|
||||
/** - a string or string array of labels used to server.select() specific connections matching the specified labels.Defaults to an empty array [](no labels).*/
|
||||
labels?: string|string[];
|
||||
/** - used to create an HTTPS connection.The tls object is passed unchanged as options to the node.js HTTPS server as described in the node.js HTTPS documentation.Set to true when passing a listener object that has been configured to use TLS directly. */
|
||||
tls?: boolean;
|
||||
tls?: boolean|Object;
|
||||
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ declare module "hapi" {
|
||||
/**Initializes the server views manager
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
|
||||
|
||||
server.views({
|
||||
engines: {
|
||||
html: require('handlebars'),
|
||||
@@ -229,8 +229,8 @@ declare module "hapi" {
|
||||
/** Concludes the handler activity by setting a response and returning control over to the framework where:
|
||||
erran optional error response.
|
||||
resultan optional response payload.
|
||||
Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first.
|
||||
FLOW CONTROL:
|
||||
Since an request can only have one response regardless if it is an error or success, the reply() method can only result in a single response value. This means that passing both an err and result will only use the err. There is no requirement for either err or result to be (or not) an Error object. The framework will simply use the first argument if present, otherwise the second. The method supports two arguments to be compatible with the common callback pattern of error first.
|
||||
FLOW CONTROL:
|
||||
When calling reply(), the framework waits until process.nextTick() to continue processing the request and transmit the response. This enables making changes to the returned response object before the response is sent. This means the framework will resume as soon as the handler method exits. To suspend this behavior, the returned response object supports the following methods: hold(), send() */
|
||||
export interface IReply {
|
||||
<T>(err: Error,
|
||||
@@ -241,7 +241,7 @@ declare module "hapi" {
|
||||
/** Note that if result is a Stream with a statusCode property, that status code will be used as the default response code. */
|
||||
<T>(result: string|number|boolean|Buffer|stream.Stream | Promise<T> | T): Response;
|
||||
|
||||
/** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200.
|
||||
/** Returns control back to the framework without setting a response. If called in the handler, the response defaults to an empty payload with status code 200.
|
||||
* The data argument is only used for passing back authentication data and is ignored elsewhere. */
|
||||
continue(credentialData?: any): void;
|
||||
|
||||
@@ -384,7 +384,7 @@ declare module "hapi" {
|
||||
an object */
|
||||
auth?: boolean|string|
|
||||
{
|
||||
/** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values:
|
||||
/** the authentication mode.Defaults to 'required' if a server authentication strategy is configured, otherwise defaults to no authentication.Available values:
|
||||
'required'authentication is required.
|
||||
'optional'authentication is optional (must be valid if present).
|
||||
'try'same as 'optional' but allows for invalid authentication. */
|
||||
@@ -569,7 +569,7 @@ declare module "hapi" {
|
||||
*/
|
||||
headers?: boolean | IJoi | IValidationFunction;
|
||||
|
||||
|
||||
|
||||
/** validation rules for incoming request path parameters, after matching the path against the route and extracting any parameters then stored in request.params.Values allowed:
|
||||
trueany path parameters allowed (no validation performed).This is the default.
|
||||
falseno path variables allowed.
|
||||
@@ -634,8 +634,8 @@ declare module "hapi" {
|
||||
tags?: string[]
|
||||
}
|
||||
/** server.realm http://hapijs.com/api#serverrealm
|
||||
The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(),
|
||||
the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin).
|
||||
The realm object contains server-wide or plugin-specific state that can be shared across various methods. For example, when calling server.bind(),
|
||||
the active realm settings.bind property is set which is then used by routes and extensions added at the same level (server root or plugin).
|
||||
Realms are a limited version of a sandbox where plugins can maintain state used by the framework when adding routes, extensions, and other properties.
|
||||
The server.realm object should be considered read-only and must not be changed directly except for the plugins property can be directly manipulated by the plugins (each setting its own under plugins[name]).
|
||||
exports.register = function (server, options, next) {
|
||||
@@ -716,9 +716,9 @@ declare module "hapi" {
|
||||
lookupCompressed: boolean;
|
||||
}
|
||||
|
||||
/**http://hapijs.com/api#route-handler
|
||||
/**http://hapijs.com/api#route-handler
|
||||
Built-in handlers
|
||||
|
||||
|
||||
The framework comes with a few built-in handler types available by setting the route handler config to an object containing one of these keys.*/
|
||||
export interface IRouteHandlerConfig {
|
||||
/** generates a static file endpoint for serving a single file. file can be set to:
|
||||
@@ -815,7 +815,7 @@ declare module "hapi" {
|
||||
export interface IRouteConfiguration {
|
||||
/** - (required) the absolute path used to match incoming requests (must begin with '/'). Incoming requests are compared to the configured paths based on the connection router configuration option.The path can include named parameters enclosed in {} which will be matched against literal values in the request as described in Path parameters.*/
|
||||
path: string;
|
||||
/** - (required) the HTTP method.Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'.Any HTTP method is allowed, except for 'HEAD'.Use '*' to match against any HTTP method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match).
|
||||
/** - (required) the HTTP method.Typically one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', or 'OPTIONS'.Any HTTP method is allowed, except for 'HEAD'.Use '*' to match against any HTTP method (only when an exact match was not found, and any match with a specific method will be given a higher priority over a wildcard match).
|
||||
* Can be assigned an array of methods which has the same result as adding the same route with different methods manually.*/
|
||||
method: string|string[];
|
||||
/** - an optional domain string or an array of domain strings for limiting the route to only requests with a matching host header field.Matching is done against the hostname part of the header only (excluding the port).Defaults to all hosts.*/
|
||||
@@ -828,7 +828,7 @@ declare module "hapi" {
|
||||
/** Route public interface When route information is returned or made available as a property. http://hapijs.com/api#route-public-interface */
|
||||
export interface IRoute {
|
||||
|
||||
|
||||
|
||||
/** the route HTTP method. */
|
||||
method: string;
|
||||
/** the route path. */
|
||||
@@ -853,8 +853,8 @@ declare module "hapi" {
|
||||
artifacts - optional authentication artifacts.
|
||||
reply.continue(result) - is called if authentication succeeded where:
|
||||
result - same object as result above.
|
||||
When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route.
|
||||
.If the err returned by the reply() method includes a message, no additional strategies will be attempted.
|
||||
When the scheme authenticate() method implementation calls reply() with an error condition, the specifics of the error affect whether additional authentication strategies will be attempted if configured for the route.
|
||||
.If the err returned by the reply() method includes a message, no additional strategies will be attempted.
|
||||
If the err does not include a message but does include a scheme name (e.g. Boom.unauthorized(null, 'Custom')), additional strategies will be attempted in order of preference.
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
@@ -1014,12 +1014,12 @@ declare module "hapi" {
|
||||
generateKey?(args: any[]): string;
|
||||
}
|
||||
/** Request object
|
||||
|
||||
|
||||
The request object is created internally for each incoming request. It is different from the node.js request object received from the HTTP server callback (which is available in request.raw.req). The request object methods and properties change throughout the request lifecycle.
|
||||
Request events
|
||||
|
||||
|
||||
The request object supports the following events:
|
||||
|
||||
|
||||
'peek' - emitted for each chunk of payload data read from the client connection. The event method signature is function(chunk, encoding).
|
||||
'finish' - emitted when the request payload finished reading. The event method signature is function ().
|
||||
'disconnect' - emitted when a request errors or aborts unexpectedly.
|
||||
@@ -1027,25 +1027,25 @@ declare module "hapi" {
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
|
||||
|
||||
server.ext('onRequest', function (request, reply) {
|
||||
|
||||
|
||||
var hash = Crypto.createHash('sha1');
|
||||
request.on('peek', function (chunk) {
|
||||
|
||||
|
||||
hash.update(chunk);
|
||||
});
|
||||
|
||||
|
||||
request.once('finish', function () {
|
||||
|
||||
|
||||
console.log(hash.digest('hex'));
|
||||
});
|
||||
|
||||
|
||||
request.once('disconnect', function () {
|
||||
|
||||
|
||||
console.error('request aborted');
|
||||
});
|
||||
|
||||
|
||||
return reply.continue();
|
||||
});*/
|
||||
export class Request extends Events.EventEmitter {
|
||||
@@ -1157,64 +1157,64 @@ declare module "hapi" {
|
||||
slashes: any;
|
||||
};
|
||||
/** request.setUrl(url)
|
||||
|
||||
|
||||
Available only in 'onRequest' extension methods.
|
||||
|
||||
|
||||
Changes the request URI before the router begins processing the request where:
|
||||
|
||||
|
||||
url - the new request path value.
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
|
||||
|
||||
server.ext('onRequest', function (request, reply) {
|
||||
|
||||
|
||||
// Change all requests to '/test'
|
||||
request.setUrl('/test');
|
||||
return reply.continue();
|
||||
});*/
|
||||
setUrl(url: string): void;
|
||||
/** request.setMethod(method)
|
||||
|
||||
|
||||
Available only in 'onRequest' extension methods.
|
||||
|
||||
|
||||
Changes the request method before the router begins processing the request where:
|
||||
|
||||
|
||||
method - is the request HTTP method (e.g. 'GET').
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
|
||||
|
||||
server.ext('onRequest', function (request, reply) {
|
||||
|
||||
|
||||
// Change all requests to 'GET'
|
||||
request.setMethod('GET');
|
||||
return reply.continue();
|
||||
});*/
|
||||
setMethod(method: string): void;
|
||||
/** request.log(tags, [data, [timestamp]])
|
||||
|
||||
|
||||
Always available.
|
||||
|
||||
|
||||
Logs request-specific events. When called, the server emits a 'request' event which can be used by other listeners or plugins. The arguments are:
|
||||
|
||||
|
||||
data - an optional message string or object with the application data being logged.
|
||||
timestamp - an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).
|
||||
Any logs generated by the server internally will be emitted only on the 'request-internal' channel and will include the event.internal flag set to true.
|
||||
|
||||
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
|
||||
|
||||
server.on('request', function (request, event, tags) {
|
||||
|
||||
|
||||
if (tags.error) {
|
||||
console.log(event);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var handler = function (request, reply) {
|
||||
|
||||
|
||||
request.log(['test', 'error'], 'Test event');
|
||||
return reply();
|
||||
};
|
||||
@@ -1227,9 +1227,9 @@ declare module "hapi" {
|
||||
/** an optional timestamp expressed in milliseconds. Defaults to Date.now() (now).*/
|
||||
timestamp?: number): void;
|
||||
/** request.getLog([tags], [internal])
|
||||
|
||||
|
||||
Always available.
|
||||
|
||||
|
||||
Returns an array containing the events matching any of the tags specified (logical OR)
|
||||
request.getLog();
|
||||
request.getLog('error');
|
||||
@@ -1244,38 +1244,38 @@ declare module "hapi" {
|
||||
internal?: boolean): string[];
|
||||
|
||||
/** request.tail([name])
|
||||
|
||||
|
||||
Available until immediately after the 'response' event is emitted.
|
||||
|
||||
|
||||
Adds a request tail which has to complete before the request lifecycle is complete where:
|
||||
|
||||
|
||||
name - an optional tail name used for logging purposes.
|
||||
Returns a tail function which must be called when the tail activity is completed.
|
||||
|
||||
|
||||
Tails are actions performed throughout the request lifecycle, but which may end after a response is sent back to the client. For example, a request may trigger a database update which should not delay sending back a response. However, it is still desirable to associate the activity with the request when logging it (or an error associated with it).
|
||||
|
||||
|
||||
When all tails completed, the server emits a 'tail' event.
|
||||
|
||||
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
|
||||
|
||||
var get = function (request, reply) {
|
||||
|
||||
|
||||
var dbTail = request.tail('write to database');
|
||||
|
||||
|
||||
db.save('key', 'value', function () {
|
||||
|
||||
|
||||
dbTail();
|
||||
});
|
||||
|
||||
|
||||
return reply('Success!');
|
||||
};
|
||||
|
||||
|
||||
server.route({ method: 'GET', path: '/', handler: get });
|
||||
|
||||
|
||||
server.on('tail', function (request) {
|
||||
|
||||
|
||||
console.log('Request completed including db activity');
|
||||
});*/
|
||||
tail(
|
||||
@@ -1283,34 +1283,34 @@ declare module "hapi" {
|
||||
name?: string): Function;
|
||||
}
|
||||
/** Response events
|
||||
|
||||
|
||||
The response object supports the following events:
|
||||
|
||||
|
||||
'peek' - emitted for each chunk of data written back to the client connection. The event method signature is function(chunk, encoding).
|
||||
'finish' - emitted when the response finished writing but before the client response connection is ended. The event method signature is function ().
|
||||
var Crypto = require('crypto');
|
||||
var Hapi = require('hapi');
|
||||
var server = new Hapi.Server();
|
||||
server.connection({ port: 80 });
|
||||
|
||||
|
||||
server.ext('onPreResponse', function (request, reply) {
|
||||
|
||||
|
||||
var response = request.response;
|
||||
if (response.isBoom) {
|
||||
return reply();
|
||||
}
|
||||
|
||||
|
||||
var hash = Crypto.createHash('sha1');
|
||||
response.on('peek', function (chunk) {
|
||||
|
||||
|
||||
hash.update(chunk);
|
||||
});
|
||||
|
||||
|
||||
response.once('finish', function () {
|
||||
|
||||
|
||||
console.log(hash.digest('hex'));
|
||||
});
|
||||
|
||||
|
||||
return reply.continue();
|
||||
});*/
|
||||
export class Response extends Events.EventEmitter {
|
||||
@@ -1412,7 +1412,7 @@ declare module "hapi" {
|
||||
|
||||
|
||||
/** Server http://hapijs.com/api#server
|
||||
rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080).
|
||||
rver object is the main application container. The server manages all incoming connections along with all the facilities provided by the framework. A server can contain more than one connection (e.g. listen to port 80 and 8080).
|
||||
Server events
|
||||
The server object inherits from Events.EventEmitter and emits the following events:
|
||||
'log' - events logged with server.log() and server events generated internally by the framework.
|
||||
@@ -1443,7 +1443,7 @@ declare module "hapi" {
|
||||
// server.connections.length === 2
|
||||
var a = server.select('a');
|
||||
// a.connections.length === 1*/
|
||||
connections: Array<ISeverConnectionOptions>;
|
||||
connections: Array<IServerConnectionOptions>;
|
||||
/** When the server contains exactly one connection, info is an object containing information about the sole connection.
|
||||
* When the server contains more than one connection, each server.connections array member provides its own connection.info.
|
||||
var server = new Hapi.Server();
|
||||
@@ -1734,7 +1734,7 @@ declare module "hapi" {
|
||||
cache(options: ICatBoxCacheOptions): void;
|
||||
|
||||
/** server.connection([options])
|
||||
Adds an incoming server connection
|
||||
Adds an incoming server connection
|
||||
Returns a server object with the new connection selected.
|
||||
Must be called before any other server method that modifies connections is called for it to apply to the new connection (e.g. server.state()).
|
||||
Note that the options object is deeply cloned (with the exception of listener which is shallowly copied) and cannot contain any values that are unsafe to perform deep copy on.
|
||||
@@ -1745,7 +1745,7 @@ declare module "hapi" {
|
||||
// server.connections.length === 2
|
||||
// web.connections.length === 1
|
||||
// admin.connections.length === 1 */
|
||||
connection(options: ISeverConnectionOptions): Server;
|
||||
connection(options: IServerConnectionOptions): Server;
|
||||
/** server.decorate(type, property, method)
|
||||
Extends various framework interfaces with custom methods where:
|
||||
type - the interface being decorated. Supported types:
|
||||
@@ -1872,8 +1872,8 @@ declare module "hapi" {
|
||||
};
|
||||
server.handler('test', handler);*/
|
||||
handler<THandlerConfig>(name: string, method: (route: IRoute, options: THandlerConfig) => ISessionHandler): void;
|
||||
/** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection.
|
||||
Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack.
|
||||
/** When the server contains exactly one connection, injects a request into the sole connection simulating an incoming HTTP request without making an actual socket connection.
|
||||
Injection is useful for testing purposes as well as for invoking routing logic internally without the overhead or limitations of the network stack.
|
||||
Utilizes the [shot module | https://github.com/hapijs/shot ] for performing injections, with some additional options and response properties
|
||||
* When the server contains more than one connection, each server.connections array member provides its own connection.inject().
|
||||
var Hapi = require('hapi');
|
||||
@@ -2209,4 +2209,4 @@ declare module "hapi" {
|
||||
views(options: IServerViewsConfiguration): void;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ var animate: HighchartsAnimation = {
|
||||
|
||||
var gradient: HighchartsGradient = {
|
||||
linearGradient: {
|
||||
x0: 0,
|
||||
y0: 0,
|
||||
x1: 500,
|
||||
y1: 500
|
||||
x1: 0,
|
||||
y1: 0,
|
||||
x2: 500,
|
||||
y2: 500
|
||||
},
|
||||
stops: [
|
||||
[0, 'rgb(255, 255, 255)'],
|
||||
@@ -136,4 +136,4 @@ var highChartSettings: HighchartsOptions = {
|
||||
|
||||
var container = $("#container").highcharts(highChartSettings, (chart) => {
|
||||
chart.series[0].setVisible(true, true);
|
||||
});
|
||||
});
|
||||
|
||||
2
highcharts/highcharts.d.ts
vendored
2
highcharts/highcharts.d.ts
vendored
@@ -166,7 +166,7 @@ interface HighchartsChartEvents {
|
||||
|
||||
interface HighchartsGradient {
|
||||
linearGradient?: {
|
||||
x0: number; y0: number; x1: number; y1: number;
|
||||
x1: number; y1: number; x2: number; y2: number;
|
||||
};
|
||||
radialGradient?: {
|
||||
cx: number; cy: number; r: number;
|
||||
|
||||
4
i18next/i18next.d.ts
vendored
4
i18next/i18next.d.ts
vendored
@@ -23,7 +23,7 @@ interface I18nextOptions {
|
||||
preload?: string[]; // Default value: []
|
||||
lowerCaseLng?: boolean; // Default value: false
|
||||
returnObjectTrees?: boolean; // Default value: false
|
||||
fallbackLng?: string; // Default value: 'dev'
|
||||
fallbackLng?: string|boolean; // Default value: 'dev'
|
||||
detectLngQS?: string; // Default value: 'setLng'
|
||||
ns?: any; // Default value: 'translation' (string), can also be an object
|
||||
nsseparator?: string; // Default value: '::'
|
||||
@@ -135,4 +135,4 @@ declare module 'i18next' {
|
||||
|
||||
declare module 'i18next-client' {
|
||||
export = i18n;
|
||||
}
|
||||
}
|
||||
|
||||
2
jasmine/jasmine.d.ts
vendored
2
jasmine/jasmine.d.ts
vendored
@@ -296,7 +296,7 @@ declare module jasmine {
|
||||
toContainHtml(expected: string): boolean;
|
||||
toContainText(expected: string): boolean;
|
||||
toThrow(expected?: any): boolean;
|
||||
toThrowError(expected?: any): boolean;
|
||||
toThrowError(expected?: any, message?: string): boolean;
|
||||
not: Matchers;
|
||||
|
||||
Any: Any;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/// <reference path="jquery-validation-unobtrusive.d.ts" />
|
||||
|
||||
// Test overloads for `add` method
|
||||
$.validator.unobtrusive.adapters.add("adapter", () => { });
|
||||
$.validator.unobtrusive.adapters.add("adapter", function () {
|
||||
return true;
|
||||
});
|
||||
$.validator.unobtrusive.adapters.add("adapter", ["param1", "param2"], () => { });
|
||||
|
||||
// Test overloads for `addMinMax` method
|
||||
$.validator.unobtrusive.adapters.addMinMax("adapter", "minRule", "maxRule", "minMaxRule");
|
||||
$.validator.unobtrusive.adapters.addMinMax("adapter", "minRule", "maxRule", "minMaxRule", "minAttr");
|
||||
$.validator.unobtrusive.adapters.addMinMax("adapter", "minRule", "maxRule", "minMaxRule", "minAttr", "maxAttr");
|
||||
|
||||
// Test overloads for `addSingleVal` method
|
||||
$.validator.unobtrusive.adapters.addSingleVal("adapter", "rule");
|
||||
$.validator.unobtrusive.adapters.addSingleVal("adapter", "attr", "rule");
|
||||
|
||||
// Test overloads for `addBool` method
|
||||
$.validator.unobtrusive.adapters.addBool("adapter");
|
||||
$.validator.unobtrusive.adapters.addBool("adapter", "rule");
|
||||
|
||||
// Test `addMethod`
|
||||
$.validator.unobtrusive.adapters.addMethod("adapter", (value, element, params) => {
|
||||
return true;
|
||||
});
|
||||
|
||||
// Test method chaining
|
||||
$.validator.unobtrusive.adapters
|
||||
.add("required", () => { })
|
||||
.addMinMax("length", "minlength", "maxlength", "rangelength")
|
||||
.addSingleVal("regex", "pattern")
|
||||
.addBool("url")
|
||||
.addMethod("nonalphamin", (value, element, nonalphamin) => {
|
||||
return null;
|
||||
});
|
||||
|
||||
// Test `Adapters` indexer
|
||||
var adapterName = $.validator.unobtrusive.adapters[0].name;
|
||||
|
||||
// Test `Adapters` iterator
|
||||
$.each($.validator.unobtrusive.adapters, function (index, adapter) {
|
||||
console.log(adapter.name);
|
||||
console.log(adapter.params);
|
||||
console.log(adapter.adapt);
|
||||
});
|
||||
|
||||
// Test `Adapters` array
|
||||
$.validator.unobtrusive.adapters.push({ name: "adapter", params: ["param1"], adapt: () => { } });
|
||||
|
||||
// Test overloads for `parseElement`
|
||||
$.validator.unobtrusive.parseElement("form");
|
||||
$.validator.unobtrusive.parseElement(document);
|
||||
$.validator.unobtrusive.parseElement(document.getElementById("the-form"));
|
||||
$.validator.unobtrusive.parseElement($("#the-form"));
|
||||
$.validator.unobtrusive.parseElement($("#the-form"), true);
|
||||
|
||||
// Test overloads for `parse`
|
||||
$.validator.unobtrusive.parse("form");
|
||||
$.validator.unobtrusive.parse(document);
|
||||
$.validator.unobtrusive.parse(document.getElementById("the-form"));
|
||||
$.validator.unobtrusive.parse($("#the-form"));
|
||||
38
jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts
vendored
Normal file
38
jquery-validation-unobtrusive/jquery-validation-unobtrusive.d.ts
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// Type definitions for Microsoft jQuery Unobtrusive Validation v3.2.3
|
||||
// Project: http://aspnetwebstack.codeplex.com/
|
||||
// Definitions by: Matt Brooks <https://github.com/EnableSoftware>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery.validation/jquery.validation.d.ts" />
|
||||
|
||||
declare module MicrosoftJQueryUnobtrusiveValidation {
|
||||
type JQuerySelector = string | Document | Element | JQuery;
|
||||
|
||||
interface Adapter {
|
||||
name: string;
|
||||
params: string[];
|
||||
adapt: Function
|
||||
}
|
||||
|
||||
interface Adapters extends Array<Adapter> {
|
||||
add(adapterName: string, fn: Function): Adapters;
|
||||
add(adapterName: string, params: string[], fn: Function): Adapters;
|
||||
addMinMax(adapterName: string, minRuleName: string, maxRuleName: string, minMaxRuleName: string, minAttribute?: string, maxAttribute?: string): Adapters;
|
||||
addSingleVal(adapterName: string, ruleName: string): Adapters;
|
||||
addSingleVal(adapterName: string, attribute: string, ruleName: string): Adapters;
|
||||
addBool(adapterName: string, ruleName?: string): Adapters;
|
||||
addMethod(adapterName: string, fn: (value: string, element: Element, params: any) => any): Adapters;
|
||||
}
|
||||
|
||||
interface Validator {
|
||||
adapters: Adapters;
|
||||
parseElement(element: JQuerySelector, skipAttach?: boolean): void;
|
||||
parse(selector: JQuerySelector): void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module JQueryValidation {
|
||||
interface ValidatorStatic {
|
||||
unobtrusive: MicrosoftJQueryUnobtrusiveValidation.Validator;
|
||||
}
|
||||
}
|
||||
13
jquery.autosize/jquery.autosize-tests.ts
Executable file
13
jquery.autosize/jquery.autosize-tests.ts
Executable file
@@ -0,0 +1,13 @@
|
||||
/// <reference path="jquery.autosize.d.ts" />
|
||||
|
||||
// from a NodeList
|
||||
autosize(document.querySelectorAll('textarea'));
|
||||
|
||||
// from a single Node
|
||||
autosize(document.querySelector('textarea'));
|
||||
|
||||
// from a jQuery collection
|
||||
autosize($('textarea'));
|
||||
|
||||
// from a single element
|
||||
autosize(document.getElementById('my-textarea'));
|
||||
24
jquery.autosize/jquery.autosize.d.ts
vendored
24
jquery.autosize/jquery.autosize.d.ts
vendored
@@ -1,21 +1,19 @@
|
||||
// Type definitions for jquery.autosize (un-versioned)
|
||||
// Type definitions for jquery.autosize 3.0.7
|
||||
// Project: http://www.jacklmoore.com/autosize/
|
||||
// Definitions by: Aaron T. King <https://github.com/kingdango>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
interface AutosizeOptions {
|
||||
className?: string;
|
||||
append?: string;
|
||||
callback?: Function;
|
||||
declare module autosize {
|
||||
interface AutosizeStatic {
|
||||
(el: Element): void;
|
||||
(el: NodeList): void;
|
||||
(el: JQuery): void;
|
||||
}
|
||||
}
|
||||
|
||||
interface Autosize {
|
||||
(): JQuery;
|
||||
(options: AutosizeOptions): JQuery;
|
||||
}
|
||||
declare var autosize: autosize.AutosizeStatic;
|
||||
|
||||
interface JQuery {
|
||||
autosize: Autosize;
|
||||
}
|
||||
declare module 'autosize' {
|
||||
export = autosize;
|
||||
}
|
||||
|
||||
13
jquery.fileupload/jquery.fileupload.d.ts
vendored
13
jquery.fileupload/jquery.fileupload.d.ts
vendored
@@ -5,7 +5,6 @@
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts"/>
|
||||
|
||||
|
||||
// Interface options for the plugin
|
||||
interface JQueryFileInputOptions {
|
||||
|
||||
@@ -152,13 +151,15 @@ interface JQueryFileInputOptions {
|
||||
|
||||
}
|
||||
|
||||
interface JQueryFileUpload {
|
||||
|
||||
interface JQueryFileUpload extends JQuery {
|
||||
contentType:string;
|
||||
}
|
||||
|
||||
interface JQuery
|
||||
{
|
||||
interface JQuery {
|
||||
// Interface to the main method of jQuery File Upload
|
||||
fileupload(settings: JQueryFileInputOptions): JQueryFileUpload;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuerySupport {
|
||||
fileInput?: boolean;
|
||||
}
|
||||
|
||||
5
jquery.pjax/jquery.pjax.d.ts
vendored
5
jquery.pjax/jquery.pjax.d.ts
vendored
@@ -32,6 +32,11 @@ interface PjaxSettings extends JQueryAjaxSettings {
|
||||
* Whether to replaceState the URL. Defaults to false.
|
||||
*/
|
||||
replace?: boolean;
|
||||
|
||||
/**
|
||||
* How many requests to cache. Defaults to 20.
|
||||
*/
|
||||
maxCacheLength?: number;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
|
||||
@@ -119,6 +119,11 @@ function test_ajax() {
|
||||
}).done(function (msg) {
|
||||
alert("Data Saved: " + msg);
|
||||
});
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "some.php",
|
||||
data: { name: "John", location: "Boston" }
|
||||
});
|
||||
$.ajax({
|
||||
url: "test.html",
|
||||
cache: false
|
||||
|
||||
4
jquery/jquery.d.ts
vendored
4
jquery/jquery.d.ts
vendored
@@ -105,6 +105,10 @@ interface JQueryAjaxSettings {
|
||||
* Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.
|
||||
*/
|
||||
jsonpCallback?: any;
|
||||
/**
|
||||
* The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0)
|
||||
*/
|
||||
method?: string;
|
||||
/**
|
||||
* A mime type to override the XHR mime type. (version added: 1.5.1)
|
||||
*/
|
||||
|
||||
2
jqueryui/jqueryui.d.ts
vendored
2
jqueryui/jqueryui.d.ts
vendored
@@ -507,7 +507,7 @@ declare module JQueryUI {
|
||||
|
||||
interface ProgressbarOptions {
|
||||
disabled?: boolean;
|
||||
value?: number;
|
||||
value?: number | boolean;
|
||||
}
|
||||
|
||||
interface ProgressbarUIParams {
|
||||
|
||||
26
karma/karma-tests.ts
Normal file
26
karma/karma-tests.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/// <reference path="karma.d.ts" />
|
||||
/// <reference path="../gulp/gulp.d.ts" />
|
||||
|
||||
import gulp = require('gulp');
|
||||
import karma = require('karma');
|
||||
|
||||
function runKarma(singleRun: boolean): void {
|
||||
karma.server.start({
|
||||
configFile: __dirname + '/karma.conf.js',
|
||||
singleRun: singleRun
|
||||
});
|
||||
}
|
||||
|
||||
gulp.task('test:unit:karma', ['build:test:unit'], () => runKarma(true));
|
||||
|
||||
|
||||
karma.server.start({port: 9876}, (exitCode) => {
|
||||
console.log('Karma has exited with ' + exitCode);
|
||||
process.exit(exitCode);
|
||||
});
|
||||
|
||||
|
||||
karma.runner.run({port: 9876}, (exitCode) => {
|
||||
console.log('Karma has exited with ' + exitCode);
|
||||
process.exit(exitCode);
|
||||
});
|
||||
24
karma/karma.d.ts
vendored
Normal file
24
karma/karma.d.ts
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// Type definitions for karma v0.12.37
|
||||
// Project: https://github.com/karma-runner/karma
|
||||
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module 'karma' {
|
||||
// See Karma public API https://karma-runner.github.io/0.12/dev/public-api.html
|
||||
|
||||
interface IKarmaServer {
|
||||
start(options?: any, callback?: (exitCode: number) => void): void;
|
||||
}
|
||||
|
||||
interface IKarmaRunner {
|
||||
run(options?: any, callback?: (exitCode: number) => void): void;
|
||||
}
|
||||
|
||||
interface IKarma {
|
||||
server: IKarmaServer;
|
||||
runner: IKarmaRunner;
|
||||
}
|
||||
|
||||
var karma: IKarma;
|
||||
export = karma;
|
||||
}
|
||||
@@ -198,6 +198,7 @@ knex('books').insert({title: 'Slaughterhouse Five'});
|
||||
knex('coords').insert([{x: 20}, {y: 30}, {x: 10, y: 20}]);
|
||||
|
||||
knex.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], 'id').into('books');
|
||||
knex.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}], ['id', 'title']).into('books');
|
||||
|
||||
knex('books')
|
||||
.returning('id')
|
||||
@@ -207,17 +208,20 @@ knex('books')
|
||||
.returning('id')
|
||||
.insert([{title: 'Great Gatsby'}, {title: 'Fahrenheit 451'}]);
|
||||
|
||||
knex('books')
|
||||
.where('published_date', '<', 2000)
|
||||
.update({
|
||||
status: 'archived'
|
||||
});
|
||||
knex('books').where('published_date', '<', 2000).update({status: 'archived'});
|
||||
knex('books').where('published_date', '<', 2000).update({status: 'archived'}, 'id');
|
||||
knex('books').where('published_date', '<', 2000).update({status: 'archived'}, ['id', 'title']);
|
||||
|
||||
knex('books').update('title', 'Slaughterhouse Five');
|
||||
knex('books').update('title', 'Slaughterhouse Five', 'id');
|
||||
knex('books').update('title', 'Slaughterhouse Five', ['id', 'title']);
|
||||
|
||||
knex('accounts')
|
||||
.where('activated', false)
|
||||
.del();
|
||||
knex('accounts').where('activated', false).del();
|
||||
knex('accounts').where('activated', false).del('id');
|
||||
knex('accounts').where('activated', false).del(['id', 'title']);
|
||||
knex('accounts').where('activated', false).delete();
|
||||
knex('accounts').where('activated', false).delete('id');
|
||||
knex('accounts').where('activated', false).delete(['id', 'title']);
|
||||
|
||||
var someExternalMethod: Function;
|
||||
|
||||
|
||||
10
knex/knex.d.ts
vendored
10
knex/knex.d.ts
vendored
@@ -131,13 +131,13 @@ declare module "knex" {
|
||||
debug(enabled?: boolean): QueryBuilder;
|
||||
pluck(column: string): QueryBuilder;
|
||||
|
||||
insert(data: any, returning?: string): QueryBuilder;
|
||||
update(data: any, returning?: string): QueryBuilder;
|
||||
update(columnName: string, value: Value, returning?: string): QueryBuilder;
|
||||
insert(data: any, returning?: string | string[]): QueryBuilder;
|
||||
update(data: any, returning?: string | string[]): QueryBuilder;
|
||||
update(columnName: string, value: Value, returning?: string | string[]): QueryBuilder;
|
||||
returning(column: string): QueryBuilder;
|
||||
|
||||
del(returning?: string): QueryBuilder;
|
||||
delete(returning?: string): QueryBuilder;
|
||||
del(returning?: string | string[]): QueryBuilder;
|
||||
delete(returning?: string | string[]): QueryBuilder;
|
||||
truncate(): QueryBuilder;
|
||||
|
||||
transacting(trx: Transaction): QueryBuilder;
|
||||
|
||||
96
kue/kue-tests.ts
Normal file
96
kue/kue-tests.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
/// <reference path="kue.d.ts" />
|
||||
|
||||
import kue = require('kue');
|
||||
|
||||
// create our job queue
|
||||
|
||||
var jobs = kue.createQueue();
|
||||
|
||||
// start redis with $ redis-server
|
||||
|
||||
// create some jobs at random,
|
||||
// usually you would create these
|
||||
// in your http processes upon
|
||||
// user input etc.
|
||||
|
||||
function create() {
|
||||
var name = [ 'tobi', 'loki', 'jane', 'manny' ][ Math.random() * 4 | 0 ];
|
||||
var job = jobs.create( 'video conversion', {
|
||||
title: 'converting ' + name + '\'s to avi', user: 1, frames: 200
|
||||
});
|
||||
|
||||
job.on('complete', function() {
|
||||
console.log(" Job complete");
|
||||
}).on('failed', function() {
|
||||
console.log(" Job failed");
|
||||
}).on('progress', function(progress: number) {
|
||||
process.stdout.write('\r job #' + job.id + ' ' + progress + '% complete');
|
||||
});
|
||||
|
||||
job.save();
|
||||
|
||||
setTimeout( create, Math.random() * 2000 | 0 );
|
||||
}
|
||||
|
||||
create();
|
||||
|
||||
// process video conversion jobs, 1 at a time.
|
||||
|
||||
jobs.process('video conversion', 1, function(job: kue.Job, done: Function) {
|
||||
var frames: number = job.data.frames;
|
||||
|
||||
function next(i: number) {
|
||||
// pretend we are doing some work
|
||||
convertFrame(i, function(err: Error) {
|
||||
if (err) return done(err);
|
||||
// report progress, i/frames complete
|
||||
job.progress(i, frames);
|
||||
if (i >= frames) done();
|
||||
else next(i + Math.random() * 10);
|
||||
} );
|
||||
}
|
||||
|
||||
next(0);
|
||||
} );
|
||||
|
||||
function convertFrame(i: number, fn: Function) {
|
||||
setTimeout(fn, Math.random() * 50);
|
||||
}
|
||||
|
||||
// one minute
|
||||
|
||||
var minute = 60000;
|
||||
|
||||
var email = jobs.create('email', {
|
||||
title: 'Account renewal required', to: 'tj@learnboost.com', template: 'renewal-email'
|
||||
}).delay(minute)
|
||||
.priority('high')
|
||||
.save();
|
||||
|
||||
|
||||
email.on('promotion', function() {
|
||||
console.log('renewal job promoted');
|
||||
} );
|
||||
|
||||
email.on('complete', function() {
|
||||
console.log('renewal job completed' );
|
||||
} );
|
||||
|
||||
jobs.create('email', {
|
||||
title: 'Account expired', to: 'tj@learnboost.com', template: 'expired-email'
|
||||
} ).delay( minute * 10 )
|
||||
.priority('high')
|
||||
.save();
|
||||
|
||||
jobs.promote();
|
||||
|
||||
jobs.process('email', 10, function(job: kue.Job, done: Function) {
|
||||
setTimeout(function() {
|
||||
done();
|
||||
}, Math.random() * 5000);
|
||||
});
|
||||
|
||||
// start the UI
|
||||
kue.app.listen(3000);
|
||||
console.log('UI started on port 3000');
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user