mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
Merge remote-tracking branch 'refs/remotes/DefinitelyTyped/master'
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=none
|
||||
* text=auto
|
||||
|
||||
# Custom for Visual Studio
|
||||
*.cs diff=csharp
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/// <reference path="angular-environment.d.ts" />
|
||||
var envServiceProvider: angular.environment.ServiceProvider;
|
||||
var envService: angular.environment.Service;
|
||||
|
||||
envServiceProvider.config({
|
||||
domains: {
|
||||
development: ['localhost', 'dev.local'],
|
||||
production: ['acme.com', 'acme.net', 'acme.org']
|
||||
},
|
||||
vars: {
|
||||
development: {
|
||||
apiUrl: '//localhost/api',
|
||||
staticUrl: '//localhost/static'
|
||||
},
|
||||
production: {
|
||||
apiUrl: '//api.acme.com/v2',
|
||||
staticUrl: '//static.acme.com'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
envServiceProvider.check();
|
||||
|
||||
envService.get();
|
||||
|
||||
envService.set('production');
|
||||
|
||||
var isProd: boolean = envService.is('production');
|
||||
|
||||
var val: any = envService.read('apiUrl');
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
// Type definitions for angular-environment v1.0.4
|
||||
// Project: https://github.com/juanpablob/angular-environment
|
||||
// Definitions by: Matt Wheatley <https://github.com/terrawheat>
|
||||
// Definitions: https://github.com/LiberisLabs
|
||||
|
||||
declare module angular.environment {
|
||||
interface ServiceProvider {
|
||||
/**
|
||||
* Sets the configuration object
|
||||
*/
|
||||
config: (config: angular.environment.Config) => void;
|
||||
/**
|
||||
* Evaluates the current domain and
|
||||
* loads the correct environment variables.
|
||||
*/
|
||||
check: () => void;
|
||||
}
|
||||
interface Service {
|
||||
/**
|
||||
* Retrieve the current environment
|
||||
*/
|
||||
get: () => string,
|
||||
|
||||
/**
|
||||
* Force sets the current environment
|
||||
*/
|
||||
set: (environment: string) => void,
|
||||
|
||||
/**
|
||||
* Evaluates current environment against
|
||||
* environment parameter.
|
||||
*/
|
||||
is: (environment: string) => boolean,
|
||||
|
||||
/**
|
||||
* Retrieves the correct version of a
|
||||
* variable for the current environment.
|
||||
*/
|
||||
read: (key: string) => any;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
/**
|
||||
* Map of domains to their environments
|
||||
*/
|
||||
domains: { [environment: string]: Array<string> },
|
||||
/**
|
||||
* List of variables split by environment
|
||||
*/
|
||||
vars: { [environment: string]: { [variable: string]: any }},
|
||||
}
|
||||
}
|
||||
Vendored
+3
-1
@@ -198,7 +198,9 @@ declare module AngularFormly {
|
||||
className?: string;
|
||||
|
||||
|
||||
elementAttributes?: string;
|
||||
elementAttributes?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+11
-2
@@ -63,7 +63,10 @@ declare module angular.material {
|
||||
interface IDialogOptions {
|
||||
templateUrl?: string;
|
||||
template?: string;
|
||||
autoWrap?: boolean; // default: true
|
||||
targetEvent?: MouseEvent;
|
||||
openFrom?: any;
|
||||
closeTo?: any;
|
||||
scope?: angular.IScope; // default: new child scope
|
||||
preserveScope?: boolean; // default: false
|
||||
disableParentScroll?: boolean; // default: true
|
||||
@@ -77,8 +80,10 @@ declare module angular.material {
|
||||
resolve?: {[index: string]: angular.IPromise<any>}
|
||||
controllerAs?: string;
|
||||
parent?: string|Element|JQuery; // default: root node
|
||||
fullscreen?: boolean;
|
||||
onShowing?: Function;
|
||||
onComplete?: Function;
|
||||
onRemoving?: Function;
|
||||
fullscreen?: boolean;
|
||||
}
|
||||
|
||||
interface IDialogService {
|
||||
@@ -224,7 +229,7 @@ declare module angular.material {
|
||||
setDefaultTheme(theme: string): void;
|
||||
alwaysWatchTheme(alwaysWatch: boolean): void;
|
||||
}
|
||||
|
||||
|
||||
interface IDateLocaleProvider {
|
||||
months: string[];
|
||||
shortMonths: string[];
|
||||
@@ -239,4 +244,8 @@ declare module angular.material {
|
||||
msgCalendar: string;
|
||||
msgOpenCalendar: string;
|
||||
}
|
||||
|
||||
interface IMenuService {
|
||||
hide(response?: any, options?: any): angular.IPromise<any>;
|
||||
}
|
||||
}
|
||||
|
||||
-4624
File diff suppressed because it is too large
Load Diff
-6162
File diff suppressed because it is too large
Load Diff
-6875
File diff suppressed because it is too large
Load Diff
-6137
File diff suppressed because it is too large
Load Diff
-6043
File diff suppressed because it is too large
Load Diff
-6310
File diff suppressed because it is too large
Load Diff
-6564
File diff suppressed because it is too large
Load Diff
-5775
File diff suppressed because it is too large
Load Diff
-5920
File diff suppressed because it is too large
Load Diff
-12214
File diff suppressed because it is too large
Load Diff
-17106
File diff suppressed because it is too large
Load Diff
-17105
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
/// <reference path="angular2.d.ts"/>
|
||||
|
||||
// No tests, because angular 2 typings are not in DefinitelyTyped.
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
// Type definitions for Angular 2
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Angular 2 distributes typings in our NPM package.
|
||||
// To get the typings, simply:
|
||||
// $ npm install angular2
|
||||
// and use TypeScript 1.6.2 or later.
|
||||
//
|
||||
// Note that TypeScript must be configured with
|
||||
// --moduleResolution node
|
||||
// which is the default when --module commonjs
|
||||
Vendored
-1007
File diff suppressed because it is too large
Load Diff
Vendored
-1310
File diff suppressed because it is too large
Load Diff
Vendored
-1310
File diff suppressed because it is too large
Load Diff
Vendored
-352
@@ -1,352 +0,0 @@
|
||||
// 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;
|
||||
}
|
||||
Vendored
-459
@@ -1,459 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-alpha.31
|
||||
// Project: http://angular.io/
|
||||
// Definitions by: angular team <https://github.com/angular/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// ***********************************************************
|
||||
// This file is generated by the Angular build process.
|
||||
// Please do not create manual edits or send pull requests
|
||||
// modifying this file.
|
||||
// ***********************************************************
|
||||
///<reference path="./angular2-2.0.0-alpha.31.d.ts"/>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Maps application URLs into application states, to support deep-linking and navigation.
|
||||
*/
|
||||
declare module ng {
|
||||
interface List<T> extends Array<T> {}
|
||||
interface Map<K,V> {}
|
||||
interface StringMap<K,V> extends Map<K,V> {}
|
||||
|
||||
export class Instruction {
|
||||
// "capturedUrl" is the part of the URL captured by this instruction
|
||||
// "accumulatedUrl" is the part of the URL captured by this instruction and all children
|
||||
accumulatedUrl: string;
|
||||
reuse: boolean;
|
||||
specificity: number;
|
||||
|
||||
private _params: StringMap<string, string>;
|
||||
|
||||
constructor (component: any, capturedUrl: string,
|
||||
_recognizer: PathRecognizer, child: Instruction);
|
||||
|
||||
params(): StringMap<string, string>;
|
||||
}
|
||||
|
||||
class TouchMap {
|
||||
map: StringMap<string, string>;
|
||||
keys: StringMap<string, boolean>;
|
||||
|
||||
constructor(map: StringMap<string, any>);
|
||||
|
||||
get(key: string): string;
|
||||
|
||||
getUnused(): StringMap<string, any>;
|
||||
}
|
||||
|
||||
export class Segment {
|
||||
name: string;
|
||||
regex: string;
|
||||
generate(params: TouchMap): string;
|
||||
}
|
||||
|
||||
export class PathRecognizer {
|
||||
segments: List<Segment>;
|
||||
regex: RegExp;
|
||||
specificity: number;
|
||||
terminal: boolean;
|
||||
path: string;
|
||||
handler: RouteHandler;
|
||||
|
||||
constructor(path: string, handler: RouteHandler);
|
||||
|
||||
parseParams(url: string): StringMap<string, string>;
|
||||
|
||||
generate(params: StringMap<string, any>): string;
|
||||
|
||||
resolveComponentType(): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
export interface RouteHandler {
|
||||
componentType: Function;
|
||||
resolveComponentType(): Promise<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* # Router
|
||||
* The router is responsible for mapping URLs to components.
|
||||
*
|
||||
* You can see the state of the router by inspecting the read-only field `router.navigating`.
|
||||
* This may be useful for showing a spinner, for instance.
|
||||
*
|
||||
* ## Concepts
|
||||
* Routers and component instances have a 1:1 correspondence.
|
||||
*
|
||||
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
|
||||
* router dynamically fills in depending on the current URL.
|
||||
*
|
||||
* When the router navigates from a URL, it must first recognizes it and serialize it into an
|
||||
* `Instruction`.
|
||||
* The router uses the `RouteRegistry` to get an `Instruction`.
|
||||
*/
|
||||
class Router {
|
||||
|
||||
navigating: boolean;
|
||||
|
||||
lastNavigationAttempt: string;
|
||||
|
||||
registry: RouteRegistry;
|
||||
|
||||
parent: Router;
|
||||
|
||||
hostComponent: any;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
|
||||
* component.
|
||||
*/
|
||||
childRouter(hostComponent: any): Router;
|
||||
|
||||
|
||||
/**
|
||||
* Register an object to notify of route changes. You probably don't need to use this unless
|
||||
* you're writing a reusable component.
|
||||
*/
|
||||
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamically update the routing configuration and trigger a navigation.
|
||||
*
|
||||
* # Usage
|
||||
*
|
||||
* ```
|
||||
* router.config({ 'path': '/', 'component': IndexCmp});
|
||||
* ```
|
||||
*
|
||||
* Or:
|
||||
*
|
||||
* ```
|
||||
* router.config([
|
||||
* { 'path': '/', 'component': IndexComp },
|
||||
* { 'path': '/user/:id', 'component': UserComp },
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
config(config: StringMap<string, any>| List<StringMap<string, any>>): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigate to a URL. Returns a promise that resolves when navigation is complete.
|
||||
*
|
||||
* If the given URL begins with a `/`, router will navigate absolutely.
|
||||
* If the given URL does not begin with `/`, the router will navigate relative to this component.
|
||||
*/
|
||||
navigate(url: string): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Updates this router and all descendant routers according to the given instruction
|
||||
*/
|
||||
commit(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
*/
|
||||
subscribe(onNext: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
*/
|
||||
deactivate(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL, returns an instruction representing the component graph
|
||||
*/
|
||||
recognize(url: string): Promise<Instruction>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
|
||||
* router has yet to successfully navigate.
|
||||
*/
|
||||
renavigate(): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
|
||||
* app's base href.
|
||||
*/
|
||||
generate(linkParams: List<any>): string;
|
||||
}
|
||||
|
||||
class RootRouter extends Router {
|
||||
|
||||
commit(instruction: any): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
|
||||
*
|
||||
* ## Use
|
||||
*
|
||||
* ```
|
||||
* <router-outlet></router-outlet>
|
||||
* ```
|
||||
*/
|
||||
class RouterOutlet {
|
||||
|
||||
childRouter: Router;
|
||||
|
||||
|
||||
/**
|
||||
* Given an instruction, update the contents of this outlet.
|
||||
*/
|
||||
commit(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canReuse(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
deactivate(nextInstruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouterLink directive lets you link to specific parts of your app.
|
||||
*
|
||||
* Consider the following route configuration:
|
||||
*
|
||||
* ```
|
||||
* @RouteConfig({
|
||||
* path: '/user', component: UserCmp, as: 'user'
|
||||
* });
|
||||
* class MyComp {}
|
||||
* ```
|
||||
*
|
||||
* When linking to this `user` route, you can write:
|
||||
*
|
||||
* ```
|
||||
* <a [router-link]="['./user']">link to user component</a>
|
||||
* ```
|
||||
*
|
||||
* RouterLink expects the value to be an array of route names, followed by the params
|
||||
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
|
||||
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
|
||||
* and with a child route `user` with params `{userId: 2}`.
|
||||
*
|
||||
* The first route name should be prepended with `/`, `./`, or `../`.
|
||||
* If the route begins with `/`, the router will look up the route from the root of the app.
|
||||
* If the route begins with `./`, the router will instead look in the current component's
|
||||
* children for the route. And if the route begins with `../`, the router will look at the
|
||||
* current component's parent.
|
||||
*/
|
||||
class RouterLink {
|
||||
|
||||
visibleHref: string;
|
||||
|
||||
routeParams: void;
|
||||
|
||||
onClick(): boolean;
|
||||
}
|
||||
|
||||
class RouteParams {
|
||||
|
||||
params: StringMap<string, string>;
|
||||
|
||||
get(param: string): string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouteRegistry holds route configurations for each component in an Angular app.
|
||||
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
|
||||
* parameters.
|
||||
*/
|
||||
class RouteRegistry {
|
||||
|
||||
|
||||
/**
|
||||
* Given a component and a configuration object, add the route to this registry
|
||||
*/
|
||||
config(parentComponent: any, config: StringMap<string, any>): void;
|
||||
|
||||
|
||||
/**
|
||||
* Reads the annotations of a component and configures the registry based on them
|
||||
*/
|
||||
configFromComponent(component: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL and a parent component, return the most specific instruction for navigating
|
||||
* the application into the state specified by the url
|
||||
*/
|
||||
recognize(url: string, parentComponent: any): Promise<Instruction>;
|
||||
|
||||
|
||||
/**
|
||||
* Given a normalized list with component names and params like: `['user', {id: 3 }]`
|
||||
* generates a url with a leading slash relative to the provided `parentComponent`.
|
||||
*/
|
||||
generate(linkParams: List<any>, parentComponent: any): string;
|
||||
}
|
||||
|
||||
class LocationStrategy {
|
||||
|
||||
path(): string;
|
||||
|
||||
pushState(ctx: any, title: string, url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
|
||||
onPopState(fn: any): void;
|
||||
|
||||
getBaseHref(): string;
|
||||
}
|
||||
|
||||
class HashLocationStrategy extends LocationStrategy {
|
||||
|
||||
onPopState(fn: EventListener): void;
|
||||
|
||||
getBaseHref(): string;
|
||||
|
||||
path(): string;
|
||||
|
||||
pushState(state: any, title: string, url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
}
|
||||
|
||||
class HTML5LocationStrategy extends LocationStrategy {
|
||||
|
||||
onPopState(fn: EventListener): void;
|
||||
|
||||
getBaseHref(): string;
|
||||
|
||||
path(): string;
|
||||
|
||||
pushState(state: any, title: string, url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This is the service that an application developer will directly interact with.
|
||||
*
|
||||
* Responsible for normalizing the URL against the application's base href.
|
||||
* A normalized URL is absolute from the URL host, includes the application's base href, and has no
|
||||
* trailing slash:
|
||||
* - `/my/app/user/123` is normalized
|
||||
* - `my/app/user/123` **is not** normalized
|
||||
* - `/my/app/user/123/` **is not** normalized
|
||||
*/
|
||||
class Location {
|
||||
|
||||
path(): string;
|
||||
|
||||
normalize(url: string): string;
|
||||
|
||||
normalizeAbsolutely(url: string): string;
|
||||
|
||||
go(url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
|
||||
subscribe(onNext: any, onThrow?: any, onReturn?: any): void;
|
||||
}
|
||||
|
||||
var appBaseHrefToken : OpaqueToken ;
|
||||
|
||||
|
||||
/**
|
||||
* Responsible for performing each step of navigation.
|
||||
* "Steps" are conceptually similar to "middleware"
|
||||
*/
|
||||
class Pipeline {
|
||||
|
||||
steps: List<Function>;
|
||||
|
||||
process(instruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onActivate]
|
||||
*/
|
||||
interface OnActivate {
|
||||
|
||||
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onDeactivate]
|
||||
*/
|
||||
interface OnDeactivate {
|
||||
|
||||
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onReuse]
|
||||
*/
|
||||
interface OnReuse {
|
||||
|
||||
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canDeactivate]
|
||||
*/
|
||||
interface CanDeactivate {
|
||||
|
||||
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canReuse]
|
||||
*/
|
||||
interface CanReuse {
|
||||
|
||||
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
var CanActivate:any;
|
||||
|
||||
var routerDirectives : List<any> ;
|
||||
|
||||
var routerInjectables : List<any> ;
|
||||
|
||||
var RouteConfig:any;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
declare module "angular2/router" {
|
||||
export = ng;
|
||||
}
|
||||
Vendored
-469
@@ -1,469 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-alpha.34
|
||||
// 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.34.d.ts"/>
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @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`.
|
||||
*/
|
||||
class Router {
|
||||
|
||||
navigating: boolean;
|
||||
|
||||
lastNavigationAttempt: string;
|
||||
|
||||
registry: RouteRegistry;
|
||||
|
||||
parent: Router;
|
||||
|
||||
hostComponent: any;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
|
||||
* component.
|
||||
*/
|
||||
childRouter(hostComponent: any): Router;
|
||||
|
||||
|
||||
/**
|
||||
* Register an object to notify of route changes. You probably don't need to use this unless
|
||||
* you're writing a reusable component.
|
||||
*/
|
||||
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamically update the routing configuration and trigger a navigation.
|
||||
*
|
||||
* # Usage
|
||||
*
|
||||
* ```
|
||||
* router.config([
|
||||
* { 'path': '/', 'component': IndexComp },
|
||||
* { 'path': '/user/:id', 'component': UserComp },
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
config(definitions: List<RouteDefinition>): 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, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Updates this router and all descendant routers according to the given instruction
|
||||
*/
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
*/
|
||||
subscribe(onNext: (value: any) => void): void;
|
||||
|
||||
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
*/
|
||||
deactivate(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL, returns an instruction representing the component graph
|
||||
*/
|
||||
recognize(url: string): Promise<Instruction>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
|
||||
* router has yet to successfully navigate.
|
||||
*/
|
||||
renavigate(): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
|
||||
* app's base href.
|
||||
*/
|
||||
generate(linkParams: List<any>): string;
|
||||
}
|
||||
|
||||
class RootRouter extends Router {
|
||||
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
|
||||
*
|
||||
* ## Use
|
||||
*
|
||||
* ```
|
||||
* <router-outlet></router-outlet>
|
||||
* ```
|
||||
*/
|
||||
class RouterOutlet {
|
||||
|
||||
childRouter: Router;
|
||||
|
||||
|
||||
/**
|
||||
* Given an instruction, update the contents of this outlet.
|
||||
*/
|
||||
commit(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canReuse(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
deactivate(nextInstruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouterLink directive lets you link to specific parts of your app.
|
||||
*
|
||||
* Consider the following route configuration:
|
||||
*
|
||||
* ```
|
||||
* @RouteConfig([
|
||||
* { path: '/user', component: UserCmp, as: 'user' }
|
||||
* ]);
|
||||
* class MyComp {}
|
||||
* ```
|
||||
*
|
||||
* When linking to this `user` route, you can write:
|
||||
*
|
||||
* ```
|
||||
* <a [router-link]="['./user']">link to user component</a>
|
||||
* ```
|
||||
*
|
||||
* RouterLink expects the value to be an array of route names, followed by the params
|
||||
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
|
||||
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
|
||||
* and with a child route `user` with params `{userId: 2}`.
|
||||
*
|
||||
* The first route name should be prepended with `/`, `./`, or `../`.
|
||||
* If the route begins with `/`, the router will look up the route from the root of the app.
|
||||
* If the route begins with `./`, the router will instead look in the current component's
|
||||
* children for the route. And if the route begins with `../`, the router will look at the
|
||||
* current component's parent.
|
||||
*/
|
||||
class RouterLink {
|
||||
|
||||
visibleHref: string;
|
||||
|
||||
routeParams: void;
|
||||
|
||||
onClick(): boolean;
|
||||
}
|
||||
|
||||
class RouteParams {
|
||||
|
||||
params: StringMap<string, string>;
|
||||
|
||||
get(param: string): string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouteRegistry holds route configurations for each component in an Angular app.
|
||||
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
|
||||
* parameters.
|
||||
*/
|
||||
class RouteRegistry {
|
||||
|
||||
|
||||
/**
|
||||
* Given a component and a configuration object, add the route to this registry
|
||||
*/
|
||||
config(parentComponent: any, config: RouteDefinition, isRootLevelRoute?: boolean): void;
|
||||
|
||||
|
||||
/**
|
||||
* Reads the annotations of a component and configures the registry based on them
|
||||
*/
|
||||
configFromComponent(component: any, isRootComponent?: boolean): 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) => 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: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
|
||||
}
|
||||
|
||||
const appBaseHrefToken : OpaqueToken ;
|
||||
|
||||
|
||||
/**
|
||||
* Responsible for performing each step of navigation.
|
||||
* "Steps" are conceptually similar to "middleware"
|
||||
*/
|
||||
class Pipeline {
|
||||
|
||||
steps: List<Function>;
|
||||
|
||||
process(instruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onActivate]
|
||||
*/
|
||||
interface OnActivate {
|
||||
|
||||
onActivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onDeactivate]
|
||||
*/
|
||||
interface OnDeactivate {
|
||||
|
||||
onDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onReuse]
|
||||
*/
|
||||
interface OnReuse {
|
||||
|
||||
onReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canDeactivate]
|
||||
*/
|
||||
interface CanDeactivate {
|
||||
|
||||
canDeactivate(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canReuse]
|
||||
*/
|
||||
interface CanReuse {
|
||||
|
||||
canReuse(nextInstruction: Instruction, prevInstruction: Instruction): any;
|
||||
}
|
||||
|
||||
var CanActivate : (hook: (next: Instruction, prev: Instruction) => Promise<boolean>| boolean) => ClassDecorator ;
|
||||
|
||||
|
||||
/**
|
||||
* An `Instruction` represents the component hierarchy of the application based on a given route
|
||||
*/
|
||||
class Instruction {
|
||||
|
||||
accumulatedUrl: string;
|
||||
|
||||
reuse: boolean;
|
||||
|
||||
specificity: number;
|
||||
|
||||
component: any;
|
||||
|
||||
capturedUrl: string;
|
||||
|
||||
child: Instruction;
|
||||
|
||||
params(): StringMap<string, string>;
|
||||
}
|
||||
|
||||
const routerDirectives : List<any> ;
|
||||
|
||||
var routerInjectables : List<any> ;
|
||||
|
||||
class Route implements RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
component: Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class Redirect implements RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
redirectTo: string;
|
||||
|
||||
as: string;
|
||||
}
|
||||
|
||||
class AsyncRoute implements RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
as: string;
|
||||
}
|
||||
|
||||
interface RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
component?: Type | ComponentDefinition;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
redirectTo?: string;
|
||||
|
||||
as?: string;
|
||||
}
|
||||
|
||||
var RouteConfig : (configs: List<RouteDefinition>) => ClassDecorator ;
|
||||
|
||||
interface ComponentDefinition {
|
||||
|
||||
type: string;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
component?: Type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/router" {
|
||||
export = ng;
|
||||
}
|
||||
|
||||
|
||||
Vendored
-689
@@ -1,689 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-alpha.35
|
||||
// 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.
|
||||
// ***********************************************************
|
||||
|
||||
// angular2/router depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
|
||||
///<reference path="./angular2-2.0.0-alpha.35.d.ts"/>
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Maps application URLs into application states, to support deep-linking and navigation.
|
||||
*/
|
||||
declare module ngRouter {
|
||||
|
||||
/**
|
||||
* # Router
|
||||
* The router is responsible for mapping URLs to components.
|
||||
*
|
||||
* You can see the state of the router by inspecting the read-only field `router.navigating`.
|
||||
* This may be useful for showing a spinner, for instance.
|
||||
*
|
||||
* ## Concepts
|
||||
* Routers and component instances have a 1:1 correspondence.
|
||||
*
|
||||
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
|
||||
* router dynamically fills in depending on the current URL.
|
||||
*
|
||||
* When the router navigates from a URL, it must first recognizes it and serialize it into an
|
||||
* `Instruction`.
|
||||
* The router uses the `RouteRegistry` to get an `Instruction`.
|
||||
*/
|
||||
class Router {
|
||||
|
||||
navigating: boolean;
|
||||
|
||||
lastNavigationAttempt: string;
|
||||
|
||||
registry: RouteRegistry;
|
||||
|
||||
parent: Router;
|
||||
|
||||
hostComponent: any;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
|
||||
* component.
|
||||
*/
|
||||
childRouter(hostComponent: any): Router;
|
||||
|
||||
|
||||
/**
|
||||
* Register an object to notify of route changes. You probably don't need to use this unless
|
||||
* you're writing a reusable component.
|
||||
*/
|
||||
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamically update the routing configuration and trigger a navigation.
|
||||
*
|
||||
* # Usage
|
||||
*
|
||||
* ```
|
||||
* router.config([
|
||||
* { 'path': '/', 'component': IndexComp },
|
||||
* { 'path': '/user/:id', 'component': UserComp },
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
config(definitions: Array<RouteDefinition>): 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, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
|
||||
* complete.
|
||||
*/
|
||||
navigateInstruction(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Updates this router and all descendant routers according to the given instruction
|
||||
*/
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
*/
|
||||
subscribe(onNext: (value: any) => void): void;
|
||||
|
||||
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
*/
|
||||
deactivate(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL, returns an instruction representing the component graph
|
||||
*/
|
||||
recognize(url: string): Promise<Instruction>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigates to either the last URL successfully navigated to, or the last URL requested if the
|
||||
* router has yet to successfully navigate.
|
||||
*/
|
||||
renavigate(): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Generate a URL from a component name and optional map of parameters. The URL is relative to the
|
||||
* app's base href.
|
||||
*/
|
||||
generate(linkParams: Array<any>): Instruction;
|
||||
}
|
||||
|
||||
class RootRouter extends Router {
|
||||
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
|
||||
*
|
||||
* ## Use
|
||||
*
|
||||
* ```
|
||||
* <router-outlet></router-outlet>
|
||||
* ```
|
||||
*/
|
||||
class RouterOutlet {
|
||||
|
||||
childRouter: Router;
|
||||
|
||||
name: string;
|
||||
|
||||
|
||||
/**
|
||||
* Given an instruction, update the contents of this outlet.
|
||||
*/
|
||||
commit(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canReuse(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
deactivate(nextInstruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouterLink directive lets you link to specific parts of your app.
|
||||
*
|
||||
* Consider the following route configuration:
|
||||
*
|
||||
* ```
|
||||
* @RouteConfig([
|
||||
* { path: '/user', component: UserCmp, as: 'user' }
|
||||
* ]);
|
||||
* class MyComp {}
|
||||
* ```
|
||||
*
|
||||
* When linking to this `user` route, you can write:
|
||||
*
|
||||
* ```
|
||||
* <a [router-link]="['./user']">link to user component</a>
|
||||
* ```
|
||||
*
|
||||
* RouterLink expects the value to be an array of route names, followed by the params
|
||||
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
|
||||
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
|
||||
* and with a child route `user` with params `{userId: 2}`.
|
||||
*
|
||||
* The first route name should be prepended with `/`, `./`, or `../`.
|
||||
* If the route begins with `/`, the router will look up the route from the root of the app.
|
||||
* If the route begins with `./`, the router will instead look in the current component's
|
||||
* children for the route. And if the route begins with `../`, the router will look at the
|
||||
* current component's parent.
|
||||
*/
|
||||
class RouterLink {
|
||||
|
||||
visibleHref: string;
|
||||
|
||||
routeParams: void;
|
||||
|
||||
onClick(): boolean;
|
||||
}
|
||||
|
||||
class RouteParams {
|
||||
|
||||
params: StringMap<string, string>;
|
||||
|
||||
get(param: string): string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouteRegistry holds route configurations for each component in an Angular app.
|
||||
* It is responsible for creating Instructions from URLs, and generating URLs based on route and
|
||||
* parameters.
|
||||
*/
|
||||
class RouteRegistry {
|
||||
|
||||
|
||||
/**
|
||||
* Given a component and a configuration object, add the route to this registry
|
||||
*/
|
||||
config(parentComponent: any, config: RouteDefinition): void;
|
||||
|
||||
|
||||
/**
|
||||
* Reads the annotations of a component and configures the registry based on them
|
||||
*/
|
||||
configFromComponent(component: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL and a parent component, return the most specific instruction for navigating
|
||||
* the application into the state specified by the url
|
||||
*/
|
||||
recognize(url: string, 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: Array<any>, parentComponent: any): Instruction;
|
||||
}
|
||||
|
||||
class LocationStrategy {
|
||||
|
||||
path(): string;
|
||||
|
||||
pushState(ctx: any, title: string, url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
|
||||
onPopState(fn: (_: any) => 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: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
|
||||
}
|
||||
|
||||
const APP_BASE_HREF : OpaqueToken ;
|
||||
|
||||
|
||||
/**
|
||||
* Responsible for performing each step of navigation.
|
||||
* "Steps" are conceptually similar to "middleware"
|
||||
*/
|
||||
class Pipeline {
|
||||
|
||||
steps: Array<Function>;
|
||||
|
||||
process(instruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onActivate], which is called by the router at the end of a
|
||||
* successful route navigation.
|
||||
*
|
||||
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
|
||||
* depending on the result of [canReuse].
|
||||
*
|
||||
* If `onActivate` returns a promise, the route change will wait until the promise settles to
|
||||
* instantiate and activate child components.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements OnActivate {
|
||||
* onActivate(next, prev) {
|
||||
* this.log = 'Finished navigating from ' + prev.urlPath + ' to ' + next.urlPath;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnActivate {
|
||||
|
||||
onActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onDeactivate], which is called by the router before destroying
|
||||
* a component as part of a route change.
|
||||
*
|
||||
* If `onDeactivate` returns a promise, the route change will wait until the promise settles.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse() {
|
||||
* return true;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.params = next.params;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnDeactivate {
|
||||
|
||||
onDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onReuse], which is called by the router at the end of a
|
||||
* successful route navigation when [canReuse] is implemented and returns or resolves to true.
|
||||
*
|
||||
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
|
||||
* depending on the result of [canReuse].
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse() {
|
||||
* return true;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.params = next.params;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnReuse {
|
||||
|
||||
onReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canDeactivate], which is called by the router to determine
|
||||
* if a component can be removed as part of a navigation.
|
||||
*
|
||||
* If `canDeactivate` returns or resolves to `false`, the navigation is cancelled.
|
||||
*
|
||||
* If `canDeactivate` throws or rejects, the navigation is also cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanDeactivate {
|
||||
* canDeactivate(next, prev) {
|
||||
* return askUserIfTheyAreSureTheyWantToQuit();
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface CanDeactivate {
|
||||
|
||||
canDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canReuse], which is called by the router to determine whether a
|
||||
* component should be reused across routes, or whether to destroy and instantiate a new component.
|
||||
*
|
||||
* If `canReuse` returns or resolves to `true`, the component instance will be reused.
|
||||
*
|
||||
* If `canReuse` throws or rejects, the navigation will be cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse(next, prev) {
|
||||
* return next.params.id == prev.params.id;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.id = next.params.id;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface CanReuse {
|
||||
|
||||
canReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canActivate], which is called by the router to determine
|
||||
* if a component can be instantiated as part of a navigation.
|
||||
*
|
||||
* Note that unlike other lifecycle hooks, this one uses an annotation rather than an interface.
|
||||
* This is because [canActivate] is called before the component is instantiated.
|
||||
*
|
||||
* If `canActivate` returns or resolves to `false`, the navigation is cancelled.
|
||||
*
|
||||
* If `canActivate` throws or rejects, the navigation is also cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'control-panel-cmp'
|
||||
* })
|
||||
* @CanActivate(() => checkIfUserIsLoggedIn())
|
||||
* class ControlPanelCmp {
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
var CanActivate : (hook: (next: ComponentInstruction, prev: ComponentInstruction) => Promise<boolean>| boolean) =>
|
||||
ClassDecorator ;
|
||||
|
||||
|
||||
/**
|
||||
* `Instruction` is a tree of `ComponentInstructions`, with all the information needed
|
||||
* to transition each component in the app to a given route, including all auxiliary routes.
|
||||
*
|
||||
* This is a public API.
|
||||
*/
|
||||
class Instruction {
|
||||
|
||||
component: ComponentInstruction;
|
||||
|
||||
child: Instruction;
|
||||
|
||||
auxInstruction: StringMap<string, Instruction>;
|
||||
|
||||
replaceChild(child: Instruction): Instruction;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A `ComponentInstruction` represents the route state for a single component. An `Instruction` is
|
||||
* composed of a tree of these `ComponentInstruction`s.
|
||||
*
|
||||
* `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed
|
||||
* to route lifecycle hooks, like {@link CanActivate}.
|
||||
*/
|
||||
class ComponentInstruction {
|
||||
|
||||
reuse: boolean;
|
||||
|
||||
urlPath: string;
|
||||
|
||||
urlParams: Array<string>;
|
||||
|
||||
params: StringMap<string, any>;
|
||||
|
||||
componentType: void;
|
||||
|
||||
resolveComponentType(): Promise<Type>;
|
||||
|
||||
specificity: void;
|
||||
|
||||
terminal: void;
|
||||
|
||||
routeData(): Object;
|
||||
}
|
||||
|
||||
class Url {
|
||||
|
||||
path: string;
|
||||
|
||||
child: Url;
|
||||
|
||||
auxiliary: Array<Url>;
|
||||
|
||||
params: StringMap<string, any>;
|
||||
|
||||
toString(): string;
|
||||
|
||||
segmentToString(): string;
|
||||
}
|
||||
|
||||
class OpaqueToken {
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runtime representation of a type.
|
||||
*
|
||||
* In JavaScript a Type is a constructor function.
|
||||
*/
|
||||
interface Type extends Function {
|
||||
|
||||
new(args: any): any;
|
||||
|
||||
}
|
||||
|
||||
const routerDirectives : Array<any> ;
|
||||
|
||||
var routerInjectables : Array<any> ;
|
||||
|
||||
class Route implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
component: Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class Redirect implements RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
redirectTo: string;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
data: any;
|
||||
}
|
||||
|
||||
class AuxRoute implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
component: Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class AsyncRoute implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
as: string;
|
||||
}
|
||||
|
||||
interface RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
component?: Type | ComponentDefinition;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
redirectTo?: string;
|
||||
|
||||
as?: string;
|
||||
|
||||
data?: any;
|
||||
}
|
||||
|
||||
const ROUTE_DATA : OpaqueToken ;
|
||||
|
||||
var RouteConfig : (configs: Array<RouteDefinition>) => ClassDecorator ;
|
||||
|
||||
interface ComponentDefinition {
|
||||
|
||||
type: string;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
component?: Type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/router" {
|
||||
export = ngRouter;
|
||||
}
|
||||
|
||||
|
||||
Vendored
-689
@@ -1,689 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-alpha.36
|
||||
// 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.
|
||||
// ***********************************************************
|
||||
|
||||
// angular2/router depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
|
||||
///<reference path="./angular2-2.0.0-alpha.36.d.ts"/>
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Maps application URLs into application states, to support deep-linking and navigation.
|
||||
*/
|
||||
declare module ngRouter {
|
||||
|
||||
/**
|
||||
* # Router
|
||||
* The router is responsible for mapping URLs to components.
|
||||
*
|
||||
* You can see the state of the router by inspecting the read-only field `router.navigating`.
|
||||
* This may be useful for showing a spinner, for instance.
|
||||
*
|
||||
* ## Concepts
|
||||
* Routers and component instances have a 1:1 correspondence.
|
||||
*
|
||||
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
|
||||
* router dynamically fills in depending on the current URL.
|
||||
*
|
||||
* When the router navigates from a URL, it must first recognizes it and serialize it into an
|
||||
* `Instruction`.
|
||||
* The router uses the `RouteRegistry` to get an `Instruction`.
|
||||
*/
|
||||
class Router {
|
||||
|
||||
navigating: boolean;
|
||||
|
||||
lastNavigationAttempt: string;
|
||||
|
||||
registry: RouteRegistry;
|
||||
|
||||
parent: Router;
|
||||
|
||||
hostComponent: any;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
|
||||
* component.
|
||||
*/
|
||||
childRouter(hostComponent: any): Router;
|
||||
|
||||
|
||||
/**
|
||||
* Register an object to notify of route changes. You probably don't need to use this unless
|
||||
* you're writing a reusable component.
|
||||
*/
|
||||
registerOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamically update the routing configuration and trigger a navigation.
|
||||
*
|
||||
* # Usage
|
||||
*
|
||||
* ```
|
||||
* router.config([
|
||||
* { 'path': '/', 'component': IndexComp },
|
||||
* { 'path': '/user/:id', 'component': UserComp },
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
config(definitions: Array<RouteDefinition>): 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, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
|
||||
* complete.
|
||||
*/
|
||||
navigateInstruction(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Updates this router and all descendant routers according to the given instruction
|
||||
*/
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
*/
|
||||
subscribe(onNext: (value: any) => void): Object;
|
||||
|
||||
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
*/
|
||||
deactivate(instruction: Instruction): 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: Array<any>): Instruction;
|
||||
}
|
||||
|
||||
class RootRouter extends Router {
|
||||
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A router outlet is a placeholder that Angular dynamically fills based on the application's route.
|
||||
*
|
||||
* ## Use
|
||||
*
|
||||
* ```
|
||||
* <router-outlet></router-outlet>
|
||||
* ```
|
||||
*/
|
||||
class RouterOutlet {
|
||||
|
||||
childRouter: Router;
|
||||
|
||||
name: string;
|
||||
|
||||
|
||||
/**
|
||||
* Given an instruction, update the contents of this outlet.
|
||||
*/
|
||||
commit(instruction: Instruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canDeactivate(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by Router during recognition phase
|
||||
*/
|
||||
canReuse(nextInstruction: Instruction): Promise<boolean>;
|
||||
|
||||
deactivate(nextInstruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The RouterLink directive lets you link to specific parts of your app.
|
||||
*
|
||||
* Consider the following route configuration:
|
||||
*
|
||||
* ```
|
||||
* @RouteConfig([
|
||||
* { path: '/user', component: UserCmp, as: 'user' }
|
||||
* ]);
|
||||
* class MyComp {}
|
||||
* ```
|
||||
*
|
||||
* When linking to this `user` route, you can write:
|
||||
*
|
||||
* ```
|
||||
* <a [router-link]="['./user']">link to user component</a>
|
||||
* ```
|
||||
*
|
||||
* RouterLink expects the value to be an array of route names, followed by the params
|
||||
* for that level of routing. For instance `['/team', {teamId: 1}, 'user', {userId: 2}]`
|
||||
* means that we want to generate a link for the `team` route with params `{teamId: 1}`,
|
||||
* and with a child route `user` with params `{userId: 2}`.
|
||||
*
|
||||
* The first route name should be prepended with `/`, `./`, or `../`.
|
||||
* If the route begins with `/`, the router will look up the route from the root of the app.
|
||||
* If the route begins with `./`, the router will instead look in the current component's
|
||||
* children for the route. And if the route begins with `../`, the router will look at the
|
||||
* current component's parent.
|
||||
*/
|
||||
class RouterLink {
|
||||
|
||||
visibleHref: string;
|
||||
|
||||
routeParams: any;
|
||||
|
||||
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: RouteDefinition): void;
|
||||
|
||||
|
||||
/**
|
||||
* Reads the annotations of a component and configures the registry based on them
|
||||
*/
|
||||
configFromComponent(component: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL and a parent component, return the most specific instruction for navigating
|
||||
* the application into the state specified by the url
|
||||
*/
|
||||
recognize(url: string, 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: Array<any>, parentComponent: any): Instruction;
|
||||
}
|
||||
|
||||
class LocationStrategy {
|
||||
|
||||
path(): string;
|
||||
|
||||
pushState(ctx: any, title: string, url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
|
||||
onPopState(fn: (_: any) => 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 PathLocationStrategy 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: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
|
||||
}
|
||||
|
||||
const APP_BASE_HREF : OpaqueToken ;
|
||||
|
||||
|
||||
/**
|
||||
* Responsible for performing each step of navigation.
|
||||
* "Steps" are conceptually similar to "middleware"
|
||||
*/
|
||||
class Pipeline {
|
||||
|
||||
steps: Array<Function>;
|
||||
|
||||
process(instruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onActivate], which is called by the router at the end of a
|
||||
* successful route navigation.
|
||||
*
|
||||
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
|
||||
* depending on the result of [canReuse].
|
||||
*
|
||||
* If `onActivate` returns a promise, the route change will wait until the promise settles to
|
||||
* instantiate and activate child components.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements OnActivate {
|
||||
* onActivate(next, prev) {
|
||||
* this.log = 'Finished navigating from ' + prev.urlPath + ' to ' + next.urlPath;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnActivate {
|
||||
|
||||
onActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onDeactivate], which is called by the router before destroying
|
||||
* a component as part of a route change.
|
||||
*
|
||||
* If `onDeactivate` returns a promise, the route change will wait until the promise settles.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse() {
|
||||
* return true;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.params = next.params;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnDeactivate {
|
||||
|
||||
onDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onReuse], which is called by the router at the end of a
|
||||
* successful route navigation when [canReuse] is implemented and returns or resolves to true.
|
||||
*
|
||||
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
|
||||
* depending on the result of [canReuse].
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse() {
|
||||
* return true;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.params = next.params;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnReuse {
|
||||
|
||||
onReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canDeactivate], which is called by the router to determine
|
||||
* if a component can be removed as part of a navigation.
|
||||
*
|
||||
* If `canDeactivate` returns or resolves to `false`, the navigation is cancelled.
|
||||
*
|
||||
* If `canDeactivate` throws or rejects, the navigation is also cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanDeactivate {
|
||||
* canDeactivate(next, prev) {
|
||||
* return askUserIfTheyAreSureTheyWantToQuit();
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface CanDeactivate {
|
||||
|
||||
canDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canReuse], which is called by the router to determine whether a
|
||||
* component should be reused across routes, or whether to destroy and instantiate a new component.
|
||||
*
|
||||
* If `canReuse` returns or resolves to `true`, the component instance will be reused.
|
||||
*
|
||||
* If `canReuse` throws or rejects, the navigation will be cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse(next, prev) {
|
||||
* return next.params.id == prev.params.id;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.id = next.params.id;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface CanReuse {
|
||||
|
||||
canReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canActivate], which is called by the router to determine
|
||||
* if a component can be instantiated as part of a navigation.
|
||||
*
|
||||
* Note that unlike other lifecycle hooks, this one uses an annotation rather than an interface.
|
||||
* This is because [canActivate] is called before the component is instantiated.
|
||||
*
|
||||
* If `canActivate` returns or resolves to `false`, the navigation is cancelled.
|
||||
*
|
||||
* If `canActivate` throws or rejects, the navigation is also cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'control-panel-cmp'
|
||||
* })
|
||||
* @CanActivate(() => checkIfUserIsLoggedIn())
|
||||
* class ControlPanelCmp {
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
var CanActivate : (hook: (next: ComponentInstruction, prev: ComponentInstruction) => Promise<boolean>| boolean) =>
|
||||
ClassDecorator ;
|
||||
|
||||
|
||||
/**
|
||||
* `Instruction` is a tree of `ComponentInstructions`, with all the information needed
|
||||
* to transition each component in the app to a given route, including all auxiliary routes.
|
||||
*
|
||||
* This is a public API.
|
||||
*/
|
||||
class Instruction {
|
||||
|
||||
component: ComponentInstruction;
|
||||
|
||||
child: Instruction;
|
||||
|
||||
auxInstruction: StringMap<string, Instruction>;
|
||||
|
||||
replaceChild(child: Instruction): Instruction;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A `ComponentInstruction` represents the route state for a single component. An `Instruction` is
|
||||
* composed of a tree of these `ComponentInstruction`s.
|
||||
*
|
||||
* `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed
|
||||
* to route lifecycle hooks, like {@link CanActivate}.
|
||||
*/
|
||||
class ComponentInstruction {
|
||||
|
||||
reuse: boolean;
|
||||
|
||||
urlPath: string;
|
||||
|
||||
urlParams: Array<string>;
|
||||
|
||||
params: StringMap<string, any>;
|
||||
|
||||
componentType: any;
|
||||
|
||||
resolveComponentType(): Promise<Type>;
|
||||
|
||||
specificity: any;
|
||||
|
||||
terminal: any;
|
||||
|
||||
routeData(): Object;
|
||||
}
|
||||
|
||||
class Url {
|
||||
|
||||
path: string;
|
||||
|
||||
child: Url;
|
||||
|
||||
auxiliary: Array<Url>;
|
||||
|
||||
params: StringMap<string, any>;
|
||||
|
||||
toString(): string;
|
||||
|
||||
segmentToString(): string;
|
||||
}
|
||||
|
||||
class OpaqueToken {
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Runtime representation of a type.
|
||||
*
|
||||
* In JavaScript a Type is a constructor function.
|
||||
*/
|
||||
interface Type extends Function {
|
||||
|
||||
new(args: any): any;
|
||||
|
||||
}
|
||||
|
||||
const ROUTE_DATA : OpaqueToken ;
|
||||
|
||||
const ROUTER_DIRECTIVES : Array<any> ;
|
||||
|
||||
const ROUTER_BINDINGS : Array<any> ;
|
||||
|
||||
class Route implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
component: Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class Redirect implements RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
redirectTo: string;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
data: any;
|
||||
}
|
||||
|
||||
class AuxRoute implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
component: Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class AsyncRoute implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
as: string;
|
||||
}
|
||||
|
||||
interface RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
component?: Type | ComponentDefinition;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
redirectTo?: string;
|
||||
|
||||
as?: string;
|
||||
|
||||
data?: any;
|
||||
}
|
||||
|
||||
var RouteConfig : (configs: Array<RouteDefinition>) => ClassDecorator ;
|
||||
|
||||
interface ComponentDefinition {
|
||||
|
||||
type: string;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
component?: Type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/router" {
|
||||
export = ngRouter;
|
||||
}
|
||||
|
||||
|
||||
Vendored
-738
@@ -1,738 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-alpha.37
|
||||
// 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.
|
||||
// ***********************************************************
|
||||
|
||||
// angular2/router depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
|
||||
///<reference path="./angular2-2.0.0-alpha.37.d.ts"/>
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Maps application URLs into application states, to support deep-linking and navigation.
|
||||
*/
|
||||
declare module ngRouter {
|
||||
|
||||
/**
|
||||
* # Router
|
||||
* The router is responsible for mapping URLs to components.
|
||||
*
|
||||
* You can see the state of the router by inspecting the read-only field `router.navigating`.
|
||||
* This may be useful for showing a spinner, for instance.
|
||||
*
|
||||
* ## Concepts
|
||||
* Routers and component instances have a 1:1 correspondence.
|
||||
*
|
||||
* The router holds reference to a number of "outlets." An outlet is a placeholder that the
|
||||
* router dynamically fills in depending on the current URL.
|
||||
*
|
||||
* When the router navigates from a URL, it must first recognizes it and serialize it into an
|
||||
* `Instruction`.
|
||||
* The router uses the `RouteRegistry` to get an `Instruction`.
|
||||
*/
|
||||
class Router {
|
||||
|
||||
navigating: boolean;
|
||||
|
||||
lastNavigationAttempt: string;
|
||||
|
||||
registry: RouteRegistry;
|
||||
|
||||
parent: Router;
|
||||
|
||||
hostComponent: any;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
|
||||
* component.
|
||||
*/
|
||||
childRouter(hostComponent: any): Router;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a child router. You probably don't need to use this unless you're writing a reusable
|
||||
* component.
|
||||
*/
|
||||
auxRouter(hostComponent: any): Router;
|
||||
|
||||
|
||||
/**
|
||||
* Register an outlet to notified of primary route changes.
|
||||
*
|
||||
* You probably don't need to use this unless you're writing a reusable component.
|
||||
*/
|
||||
registerPrimaryOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Register an outlet to notified of auxiliary route changes.
|
||||
*
|
||||
* You probably don't need to use this unless you're writing a reusable component.
|
||||
*/
|
||||
registerAuxOutlet(outlet: RouterOutlet): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Given an instruction, returns `true` if the instruction is currently active,
|
||||
* otherwise `false`.
|
||||
*/
|
||||
isRouteActive(instruction: Instruction): boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Dynamically update the routing configuration and trigger a navigation.
|
||||
*
|
||||
* # Usage
|
||||
*
|
||||
* ```
|
||||
* router.config([
|
||||
* { 'path': '/', 'component': IndexComp },
|
||||
* { 'path': '/user/:id', 'component': UserComp },
|
||||
* ]);
|
||||
* ```
|
||||
*/
|
||||
config(definitions: RouteDefinition[]): 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, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Navigate via the provided instruction. Returns a promise that resolves when navigation is
|
||||
* complete.
|
||||
*/
|
||||
navigateInstruction(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Updates this router and all descendant routers according to the given instruction
|
||||
*/
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Subscribe to URL updates from the router
|
||||
*/
|
||||
subscribe(onNext: (value: any) => void): Object;
|
||||
|
||||
|
||||
/**
|
||||
* Removes the contents of this router's outlet and all descendant outlets
|
||||
*/
|
||||
deactivate(instruction: Instruction): 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: any[]): Instruction;
|
||||
}
|
||||
|
||||
class RootRouter extends Router {
|
||||
|
||||
commit(instruction: Instruction, _skipLocationChange?: boolean): 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 {
|
||||
|
||||
name: string;
|
||||
|
||||
|
||||
/**
|
||||
* Called by the Router to instantiate a new component during the commit phase of a navigation.
|
||||
* This method in turn is responsible for calling the `onActivate` hook of its child.
|
||||
*/
|
||||
activate(nextInstruction: ComponentInstruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} during the commit phase of a navigation when an outlet
|
||||
* reuses a component between different routes.
|
||||
* This method in turn is responsible for calling the `onReuse` hook of its child.
|
||||
*/
|
||||
reuse(nextInstruction: ComponentInstruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} when an outlet reuses a component across navigations.
|
||||
* This method in turn is responsible for calling the `onReuse` hook of its child.
|
||||
*/
|
||||
deactivate(nextInstruction: ComponentInstruction): Promise<any>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} during recognition phase of a navigation.
|
||||
*
|
||||
* If this resolves to `false`, the given navigation is cancelled.
|
||||
*
|
||||
* This method delegates to the child component's `canDeactivate` hook if it exists,
|
||||
* and otherwise resolves to true.
|
||||
*/
|
||||
canDeactivate(nextInstruction: ComponentInstruction): Promise<boolean>;
|
||||
|
||||
|
||||
/**
|
||||
* Called by the {@link Router} during recognition phase of a navigation.
|
||||
*
|
||||
* If the new child component has a different Type than the existing child component,
|
||||
* this will resolve to `false`. You can't reuse an old component when the new component
|
||||
* is of a different Type.
|
||||
*
|
||||
* Otherwise, this method delegates to the child component's `canReuse` hook if it exists,
|
||||
* or resolves to true if the hook is not present.
|
||||
*/
|
||||
canReuse(nextInstruction: ComponentInstruction): 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.
|
||||
*/
|
||||
class RouterLink {
|
||||
|
||||
visibleHref: string;
|
||||
|
||||
isRouteActive: boolean;
|
||||
|
||||
routeParams: any;
|
||||
|
||||
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: RouteDefinition): void;
|
||||
|
||||
|
||||
/**
|
||||
* Reads the annotations of a component and configures the registry based on them
|
||||
*/
|
||||
configFromComponent(component: any): void;
|
||||
|
||||
|
||||
/**
|
||||
* Given a URL and a parent component, return the most specific instruction for navigating
|
||||
* the application into the state specified by the url
|
||||
*/
|
||||
recognize(url: string, 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: any[], parentComponent: any): Instruction;
|
||||
}
|
||||
|
||||
class LocationStrategy {
|
||||
|
||||
path(): string;
|
||||
|
||||
pushState(ctx: any, title: string, url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
|
||||
onPopState(fn: (_: any) => 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 PathLocationStrategy 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 {
|
||||
|
||||
platformStrategy: LocationStrategy;
|
||||
|
||||
path(): string;
|
||||
|
||||
normalize(url: string): string;
|
||||
|
||||
normalizeAbsolutely(url: string): string;
|
||||
|
||||
go(url: string): void;
|
||||
|
||||
forward(): void;
|
||||
|
||||
back(): void;
|
||||
|
||||
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): void;
|
||||
}
|
||||
|
||||
const APP_BASE_HREF : OpaqueToken ;
|
||||
|
||||
|
||||
/**
|
||||
* Responsible for performing each step of navigation.
|
||||
* "Steps" are conceptually similar to "middleware"
|
||||
*/
|
||||
class Pipeline {
|
||||
|
||||
steps: Function[];
|
||||
|
||||
process(instruction: Instruction): Promise<any>;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onActivate], which is called by the router at the end of a
|
||||
* successful route navigation.
|
||||
*
|
||||
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
|
||||
* depending on the result of [canReuse].
|
||||
*
|
||||
* If `onActivate` returns a promise, the route change will wait until the promise settles to
|
||||
* instantiate and activate child components.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements OnActivate {
|
||||
* onActivate(next, prev) {
|
||||
* this.log = 'Finished navigating from ' + prev.urlPath + ' to ' + next.urlPath;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnActivate {
|
||||
|
||||
onActivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onDeactivate], which is called by the router before destroying
|
||||
* a component as part of a route change.
|
||||
*
|
||||
* If `onDeactivate` returns a promise, the route change will wait until the promise settles.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse() {
|
||||
* return true;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.params = next.params;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnDeactivate {
|
||||
|
||||
onDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [onReuse], which is called by the router at the end of a
|
||||
* successful route navigation when [canReuse] is implemented and returns or resolves to true.
|
||||
*
|
||||
* For a single component's navigation, only one of either [onActivate] or [onReuse] will be called,
|
||||
* depending on the result of [canReuse].
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse() {
|
||||
* return true;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.params = next.params;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface OnReuse {
|
||||
|
||||
onReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canDeactivate], which is called by the router to determine
|
||||
* if a component can be removed as part of a navigation.
|
||||
*
|
||||
* If `canDeactivate` returns or resolves to `false`, the navigation is cancelled.
|
||||
*
|
||||
* If `canDeactivate` throws or rejects, the navigation is also cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanDeactivate {
|
||||
* canDeactivate(next, prev) {
|
||||
* return askUserIfTheyAreSureTheyWantToQuit();
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface CanDeactivate {
|
||||
|
||||
canDeactivate(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canReuse], which is called by the router to determine whether a
|
||||
* component should be reused across routes, or whether to destroy and instantiate a new component.
|
||||
*
|
||||
* If `canReuse` returns or resolves to `true`, the component instance will be reused.
|
||||
*
|
||||
* If `canReuse` throws or rejects, the navigation will be cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'my-cmp'
|
||||
* })
|
||||
* class MyCmp implements CanReuse, OnReuse {
|
||||
* canReuse(next, prev) {
|
||||
* return next.params.id == prev.params.id;
|
||||
* }
|
||||
*
|
||||
* onReuse(next, prev) {
|
||||
* this.id = next.params.id;
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface CanReuse {
|
||||
|
||||
canReuse(nextInstruction: ComponentInstruction, prevInstruction: ComponentInstruction): any;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Defines route lifecycle method [canActivate], which is called by the router to determine
|
||||
* if a component can be instantiated as part of a navigation.
|
||||
*
|
||||
* Note that unlike other lifecycle hooks, this one uses an annotation rather than an interface.
|
||||
* This is because [canActivate] is called before the component is instantiated.
|
||||
*
|
||||
* If `canActivate` returns or resolves to `false`, the navigation is cancelled.
|
||||
*
|
||||
* If `canActivate` throws or rejects, the navigation is also cancelled.
|
||||
*
|
||||
* ## Example
|
||||
* ```
|
||||
* @Directive({
|
||||
* selector: 'control-panel-cmp'
|
||||
* })
|
||||
* @CanActivate(() => checkIfUserIsLoggedIn())
|
||||
* class ControlPanelCmp {
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
var CanActivate : (hook: (next: ComponentInstruction, prev: ComponentInstruction) => Promise<boolean>| boolean) =>
|
||||
ClassDecorator ;
|
||||
|
||||
|
||||
/**
|
||||
* `Instruction` is a tree of `ComponentInstructions`, with all the information needed
|
||||
* to transition each component in the app to a given route, including all auxiliary routes.
|
||||
*
|
||||
* This is a public API.
|
||||
*/
|
||||
class Instruction {
|
||||
|
||||
component: ComponentInstruction;
|
||||
|
||||
child: Instruction;
|
||||
|
||||
auxInstruction: StringMap<string, Instruction>;
|
||||
|
||||
replaceChild(child: Instruction): Instruction;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A `ComponentInstruction` represents the route state for a single component. An `Instruction` is
|
||||
* composed of a tree of these `ComponentInstruction`s.
|
||||
*
|
||||
* `ComponentInstructions` is a public API. Instances of `ComponentInstruction` are passed
|
||||
* to route lifecycle hooks, like {@link CanActivate}.
|
||||
*
|
||||
* `ComponentInstruction`s are [https://en.wikipedia.org/wiki/Hash_consing](hash consed). You should
|
||||
* never construct one yourself with "new." Instead, rely on {@link PathRecognizer} to construct
|
||||
* `ComponentInstruction`s.
|
||||
*
|
||||
* You should not modify this object. It should be treated as immutable.
|
||||
*/
|
||||
class ComponentInstruction {
|
||||
|
||||
reuse: boolean;
|
||||
|
||||
urlPath: string;
|
||||
|
||||
urlParams: string[];
|
||||
|
||||
params: StringMap<string, any>;
|
||||
|
||||
componentType: any;
|
||||
|
||||
resolveComponentType(): Promise<ng.Type>;
|
||||
|
||||
specificity: any;
|
||||
|
||||
terminal: any;
|
||||
|
||||
routeData(): Object;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This class represents a parsed URL
|
||||
*/
|
||||
class Url {
|
||||
|
||||
path: string;
|
||||
|
||||
child: Url;
|
||||
|
||||
auxiliary: Url[];
|
||||
|
||||
params: StringMap<string, any>;
|
||||
|
||||
toString(): string;
|
||||
|
||||
segmentToString(): string;
|
||||
}
|
||||
|
||||
class OpaqueToken {
|
||||
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
const ROUTE_DATA : OpaqueToken ;
|
||||
|
||||
const ROUTER_DIRECTIVES : any[] ;
|
||||
|
||||
const ROUTER_BINDINGS : any[] ;
|
||||
|
||||
class Route implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
component: ng.Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class Redirect implements RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
redirectTo: string;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
data: any;
|
||||
}
|
||||
|
||||
class AuxRoute implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
component: ng.Type;
|
||||
|
||||
as: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
redirectTo: string;
|
||||
}
|
||||
|
||||
class AsyncRoute implements RouteDefinition {
|
||||
|
||||
data: any;
|
||||
|
||||
path: string;
|
||||
|
||||
loader: Function;
|
||||
|
||||
as: string;
|
||||
}
|
||||
|
||||
interface RouteDefinition {
|
||||
|
||||
path: string;
|
||||
|
||||
component?: ng.Type | ComponentDefinition;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
redirectTo?: string;
|
||||
|
||||
as?: string;
|
||||
|
||||
data?: any;
|
||||
}
|
||||
|
||||
var RouteConfig : (configs: RouteDefinition[]) => ClassDecorator ;
|
||||
|
||||
interface ComponentDefinition {
|
||||
|
||||
type: string;
|
||||
|
||||
loader?: Function;
|
||||
|
||||
component?: ng.Type;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/router" {
|
||||
export = ngRouter;
|
||||
}
|
||||
|
||||
|
||||
Vendored
-1330
File diff suppressed because it is too large
Load Diff
Vendored
-1330
File diff suppressed because it is too large
Load Diff
-408
@@ -1,408 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.f77234e
|
||||
// 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.
|
||||
// ***********************************************************
|
||||
|
||||
// angular2/test_lib depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
|
||||
///<reference path="./angular2-2.0.0-alpha.38.d.ts"/>
|
||||
///<reference path="../jasmine/jasmine.d.ts"/>
|
||||
|
||||
|
||||
|
||||
declare module ngTestLib {
|
||||
/**
|
||||
* Allows injecting dependencies in `beforeEach()` and `it()`.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* beforeEach(inject([Dependency, AClass], (dep, object) => {
|
||||
* // some code that uses `dep` and `object`
|
||||
* // ...
|
||||
* }));
|
||||
*
|
||||
* it('...', inject([AClass, AsyncTestCompleter], (object, async) => {
|
||||
* object.doSomething().then(() => {
|
||||
* expect(...);
|
||||
* async.done();
|
||||
* });
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* Notes:
|
||||
* - injecting an `AsyncTestCompleter` allow completing async tests - this is the equivalent of
|
||||
* adding a `done` parameter in Jasmine,
|
||||
* - inject is currently a function because of some Traceur limitation the syntax should eventually
|
||||
* becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`
|
||||
*
|
||||
* @param {Array} tokens
|
||||
* @param {Function} fn
|
||||
* @return {FunctionWithParamTokens}
|
||||
*/
|
||||
function inject(tokens: any[], fn: Function): FunctionWithParamTokens;
|
||||
|
||||
|
||||
|
||||
var proxy: ClassDecorator;
|
||||
|
||||
|
||||
|
||||
var afterEach: Function;
|
||||
|
||||
|
||||
|
||||
type SyncTestFn = () => void
|
||||
|
||||
|
||||
interface NgMatchers extends jasmine.Matchers {
|
||||
|
||||
toBe(expected: any): boolean;
|
||||
|
||||
toEqual(expected: any): boolean;
|
||||
|
||||
toBePromise(): boolean;
|
||||
|
||||
toBeAnInstanceOf(expected: any): boolean;
|
||||
|
||||
toHaveText(expected: any): boolean;
|
||||
|
||||
toHaveCssClass(expected: any): boolean;
|
||||
|
||||
toImplement(expected: any): boolean;
|
||||
|
||||
toContainError(expected: any): boolean;
|
||||
|
||||
toThrowErrorWith(expectedMessage: any): boolean;
|
||||
|
||||
not: NgMatchers;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var expect: (actual: any) => NgMatchers;
|
||||
|
||||
|
||||
|
||||
class AsyncTestCompleter {
|
||||
|
||||
constructor(_done: Function);
|
||||
|
||||
done(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function describe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function ddescribe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function xdescribe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function beforeEach(fn: FunctionWithParamTokens | SyncTestFn): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Allows overriding default bindings defined in test_injector.js.
|
||||
*
|
||||
* The given function must return a list of DI bindings.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* beforeEachBindings(() => [
|
||||
* bind(Compiler).toClass(MockCompiler),
|
||||
* bind(SomeToken).toValue(myValue),
|
||||
* ]);
|
||||
*/
|
||||
function beforeEachBindings(fn: any): void;
|
||||
|
||||
|
||||
|
||||
function it(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
function xit(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
function iit(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
interface GuinessCompatibleSpy extends jasmine.Spy {
|
||||
|
||||
/**
|
||||
* By chaining the spy with and.returnValue, all calls to the function will return a specific
|
||||
* value.
|
||||
*/
|
||||
andReturn(val: any): void;
|
||||
|
||||
/**
|
||||
* By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied
|
||||
* function.
|
||||
*/
|
||||
andCallFake(fn: Function): GuinessCompatibleSpy;
|
||||
|
||||
/**
|
||||
* removes all recorded calls
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class SpyObject {
|
||||
|
||||
constructor(type?: any);
|
||||
|
||||
static stub(object?: any, config?: any, overrides?: any): void;
|
||||
|
||||
noSuchMethod(args: any): void;
|
||||
|
||||
spy(name: any): void;
|
||||
|
||||
prop(name: any, value: any): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function isInInnerZone(): boolean;
|
||||
|
||||
|
||||
|
||||
interface RootTestComponent {
|
||||
|
||||
debugElement: ng.DebugElement;
|
||||
|
||||
detectChanges(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Builds a RootTestComponent for use in component level tests.
|
||||
*/
|
||||
class TestComponentBuilder {
|
||||
|
||||
constructor(_injector: ng.Injector);
|
||||
|
||||
/**
|
||||
* Overrides only the html of a {@link ComponentMetadata}.
|
||||
* All the other properties of the component's {@link ng.ViewMetadata} are preserved.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {string} html
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideTemplate(componentType: ng.Type, template: string): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides a component's {@link ng.ViewMetadata}.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {view} View
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideView(componentType: ng.Type, view: ng.ViewMetadata): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides the directives from the component {@link ng.ViewMetadata}.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {ng.Type} from
|
||||
* @param {ng.Type} to
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideDirective(componentType: ng.Type, from: ng.Type, to: ng.Type): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides one or more injectables configured via `bindings` metadata property of a directive or
|
||||
* component.
|
||||
* Very useful when certain bindings need to be mocked out.
|
||||
*
|
||||
* The bindings specified via this method are appended to the existing `bindings` causing the
|
||||
* duplicated bindings to
|
||||
* be overridden.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {any[]} bindings
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideBindings(type: ng.Type, bindings: any[]): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides one or more injectables configured via `bindings` metadata property of a directive or
|
||||
* component.
|
||||
* Very useful when certain bindings need to be mocked out.
|
||||
*
|
||||
* The bindings specified via this method are appended to the existing `bindings` causing the
|
||||
* duplicated bindings to
|
||||
* be overridden.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {any[]} bindings
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideViewBindings(type: ng.Type, bindings: any[]): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Builds and returns a RootTestComponent.
|
||||
*
|
||||
* @return {Promise<RootTestComponent>}
|
||||
*/
|
||||
createAsync(rootComponentType: ng.Type): Promise<RootTestComponent>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function createTestInjector(bindings: Array<ng.Type | ng.Binding | any[]>): ng.Injector;
|
||||
|
||||
|
||||
|
||||
class FunctionWithParamTokens {
|
||||
|
||||
constructor(_tokens: any[], _fn: Function);
|
||||
|
||||
/**
|
||||
* Returns the value of the executed function.
|
||||
*/
|
||||
execute(injector: ng.Injector): any;
|
||||
|
||||
hasToken(token: any): boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wraps a function to be executed in the fakeAsync zone:
|
||||
* - microtasks are manually executed by calling `flushMicrotasks()`,
|
||||
* - timers are synchronous, `tick()` simulates the asynchronous passage of time.
|
||||
*
|
||||
* If there are any pending timers at the end of the function, an exception will be thrown.
|
||||
*
|
||||
* @param fn
|
||||
* @returns {Function} The function wrapped to be executed in the fakeAsync zone
|
||||
*/
|
||||
function fakeAsync(fn: Function): Function;
|
||||
|
||||
|
||||
|
||||
function clearPendingTimers(): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
|
||||
*
|
||||
* The microtasks queue is drained at the very start of this function and after any timer callback
|
||||
* has been executed.
|
||||
*
|
||||
* @param {number} millis Number of millisecond, defaults to 0
|
||||
*/
|
||||
function tick(millis?: number): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Flush any pending microtasks.
|
||||
*/
|
||||
function flushMicrotasks(): void;
|
||||
|
||||
|
||||
|
||||
class Log {
|
||||
|
||||
constructor();
|
||||
|
||||
add(value: any): void;
|
||||
|
||||
fn(value: any): void;
|
||||
|
||||
clear(): void;
|
||||
|
||||
result(): string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class BrowserDetection {
|
||||
|
||||
constructor(ua: string);
|
||||
|
||||
isFirefox: boolean;
|
||||
|
||||
isAndroid: boolean;
|
||||
|
||||
isEdge: boolean;
|
||||
|
||||
isIE: boolean;
|
||||
|
||||
isWebkit: boolean;
|
||||
|
||||
isIOS7: boolean;
|
||||
|
||||
isSlow: boolean;
|
||||
|
||||
supportsIntlApi: boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var browserDetection: BrowserDetection;
|
||||
|
||||
|
||||
|
||||
function dispatchEvent(element: any, eventType: any): void;
|
||||
|
||||
|
||||
|
||||
function el(html: string): HTMLElement;
|
||||
|
||||
|
||||
|
||||
function containsRegexp(input: string): RegExp;
|
||||
|
||||
|
||||
|
||||
function normalizeCSS(css: string): string;
|
||||
|
||||
|
||||
|
||||
function stringifyElement(el: any): string;
|
||||
|
||||
|
||||
|
||||
var RootTestComponent: ng.InjectableReference;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/test_lib" {
|
||||
export = ngTestLib;
|
||||
}
|
||||
|
||||
|
||||
-408
@@ -1,408 +0,0 @@
|
||||
// Type definitions for Angular v2.0.0-local_sha.7d5c3eb
|
||||
// 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.
|
||||
// ***********************************************************
|
||||
|
||||
// angular2/test_lib depends transitively on these libraries.
|
||||
// If you don't have them installed you can install them using TSD
|
||||
// https://github.com/DefinitelyTyped/tsd
|
||||
|
||||
///<reference path="./angular2-2.0.0-alpha.39.d.ts"/>
|
||||
///<reference path="../jasmine/jasmine.d.ts"/>
|
||||
|
||||
|
||||
|
||||
declare module ngTestLib {
|
||||
/**
|
||||
* Allows injecting dependencies in `beforeEach()` and `it()`.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* beforeEach(inject([Dependency, AClass], (dep, object) => {
|
||||
* // some code that uses `dep` and `object`
|
||||
* // ...
|
||||
* }));
|
||||
*
|
||||
* it('...', inject([AClass, AsyncTestCompleter], (object, async) => {
|
||||
* object.doSomething().then(() => {
|
||||
* expect(...);
|
||||
* async.done();
|
||||
* });
|
||||
* })
|
||||
* ```
|
||||
*
|
||||
* Notes:
|
||||
* - injecting an `AsyncTestCompleter` allow completing async tests - this is the equivalent of
|
||||
* adding a `done` parameter in Jasmine,
|
||||
* - inject is currently a function because of some Traceur limitation the syntax should eventually
|
||||
* becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`
|
||||
*
|
||||
* @param {Array} tokens
|
||||
* @param {Function} fn
|
||||
* @return {FunctionWithParamTokens}
|
||||
*/
|
||||
function inject(tokens: any[], fn: Function): FunctionWithParamTokens;
|
||||
|
||||
|
||||
|
||||
var proxy: ClassDecorator;
|
||||
|
||||
|
||||
|
||||
var afterEach: Function;
|
||||
|
||||
|
||||
|
||||
type SyncTestFn = () => void
|
||||
|
||||
|
||||
interface NgMatchers extends jasmine.Matchers {
|
||||
|
||||
toBe(expected: any): boolean;
|
||||
|
||||
toEqual(expected: any): boolean;
|
||||
|
||||
toBePromise(): boolean;
|
||||
|
||||
toBeAnInstanceOf(expected: any): boolean;
|
||||
|
||||
toHaveText(expected: any): boolean;
|
||||
|
||||
toHaveCssClass(expected: any): boolean;
|
||||
|
||||
toImplement(expected: any): boolean;
|
||||
|
||||
toContainError(expected: any): boolean;
|
||||
|
||||
toThrowErrorWith(expectedMessage: any): boolean;
|
||||
|
||||
not: NgMatchers;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var expect: (actual: any) => NgMatchers;
|
||||
|
||||
|
||||
|
||||
class AsyncTestCompleter {
|
||||
|
||||
constructor(_done: Function);
|
||||
|
||||
done(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function describe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function ddescribe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function xdescribe(...args: any[]): void;
|
||||
|
||||
|
||||
|
||||
function beforeEach(fn: FunctionWithParamTokens | SyncTestFn): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Allows overriding default bindings defined in test_injector.js.
|
||||
*
|
||||
* The given function must return a list of DI bindings.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* beforeEachBindings(() => [
|
||||
* bind(Compiler).toClass(MockCompiler),
|
||||
* bind(SomeToken).toValue(myValue),
|
||||
* ]);
|
||||
*/
|
||||
function beforeEachBindings(fn: any): void;
|
||||
|
||||
|
||||
|
||||
function it(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
function xit(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
function iit(name: any, fn: any, timeOut?: any): void;
|
||||
|
||||
|
||||
|
||||
interface GuinessCompatibleSpy extends jasmine.Spy {
|
||||
|
||||
/**
|
||||
* By chaining the spy with and.returnValue, all calls to the function will return a specific
|
||||
* value.
|
||||
*/
|
||||
andReturn(val: any): void;
|
||||
|
||||
/**
|
||||
* By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied
|
||||
* function.
|
||||
*/
|
||||
andCallFake(fn: Function): GuinessCompatibleSpy;
|
||||
|
||||
/**
|
||||
* removes all recorded calls
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class SpyObject {
|
||||
|
||||
constructor(type?: any);
|
||||
|
||||
static stub(object?: any, config?: any, overrides?: any): void;
|
||||
|
||||
noSuchMethod(args: any): void;
|
||||
|
||||
spy(name: any): void;
|
||||
|
||||
prop(name: any, value: any): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function isInInnerZone(): boolean;
|
||||
|
||||
|
||||
|
||||
interface RootTestComponent {
|
||||
|
||||
debugElement: ng.DebugElement;
|
||||
|
||||
detectChanges(): void;
|
||||
|
||||
destroy(): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Builds a RootTestComponent for use in component level tests.
|
||||
*/
|
||||
class TestComponentBuilder {
|
||||
|
||||
constructor(_injector: ng.Injector);
|
||||
|
||||
/**
|
||||
* Overrides only the html of a {@link ComponentMetadata}.
|
||||
* All the other properties of the component's {@link ng.ViewMetadata} are preserved.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {string} html
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideTemplate(componentType: ng.Type, template: string): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides a component's {@link ng.ViewMetadata}.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {view} View
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideView(componentType: ng.Type, view: ng.ViewMetadata): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides the directives from the component {@link ng.ViewMetadata}.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {ng.Type} from
|
||||
* @param {ng.Type} to
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideDirective(componentType: ng.Type, from: ng.Type, to: ng.Type): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides one or more injectables configured via `bindings` metadata property of a directive or
|
||||
* component.
|
||||
* Very useful when certain bindings need to be mocked out.
|
||||
*
|
||||
* The bindings specified via this method are appended to the existing `bindings` causing the
|
||||
* duplicated bindings to
|
||||
* be overridden.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {any[]} bindings
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideBindings(type: ng.Type, bindings: any[]): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Overrides one or more injectables configured via `bindings` metadata property of a directive or
|
||||
* component.
|
||||
* Very useful when certain bindings need to be mocked out.
|
||||
*
|
||||
* The bindings specified via this method are appended to the existing `bindings` causing the
|
||||
* duplicated bindings to
|
||||
* be overridden.
|
||||
*
|
||||
* @param {ng.Type} component
|
||||
* @param {any[]} bindings
|
||||
*
|
||||
* @return {TestComponentBuilder}
|
||||
*/
|
||||
overrideViewBindings(type: ng.Type, bindings: any[]): TestComponentBuilder;
|
||||
|
||||
/**
|
||||
* Builds and returns a RootTestComponent.
|
||||
*
|
||||
* @return {Promise<RootTestComponent>}
|
||||
*/
|
||||
createAsync(rootComponentType: ng.Type): Promise<RootTestComponent>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function createTestInjector(bindings: Array<ng.Type | ng.Binding | any[]>): ng.Injector;
|
||||
|
||||
|
||||
|
||||
class FunctionWithParamTokens {
|
||||
|
||||
constructor(_tokens: any[], _fn: Function);
|
||||
|
||||
/**
|
||||
* Returns the value of the executed function.
|
||||
*/
|
||||
execute(injector: ng.Injector): any;
|
||||
|
||||
hasToken(token: any): boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wraps a function to be executed in the fakeAsync zone:
|
||||
* - microtasks are manually executed by calling `flushMicrotasks()`,
|
||||
* - timers are synchronous, `tick()` simulates the asynchronous passage of time.
|
||||
*
|
||||
* If there are any pending timers at the end of the function, an exception will be thrown.
|
||||
*
|
||||
* @param fn
|
||||
* @returns {Function} The function wrapped to be executed in the fakeAsync zone
|
||||
*/
|
||||
function fakeAsync(fn: Function): Function;
|
||||
|
||||
|
||||
|
||||
function clearPendingTimers(): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
|
||||
*
|
||||
* The microtasks queue is drained at the very start of this function and after any timer callback
|
||||
* has been executed.
|
||||
*
|
||||
* @param {number} millis Number of millisecond, defaults to 0
|
||||
*/
|
||||
function tick(millis?: number): void;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Flush any pending microtasks.
|
||||
*/
|
||||
function flushMicrotasks(): void;
|
||||
|
||||
|
||||
|
||||
class Log {
|
||||
|
||||
constructor();
|
||||
|
||||
add(value: any): void;
|
||||
|
||||
fn(value: any): void;
|
||||
|
||||
clear(): void;
|
||||
|
||||
result(): string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class BrowserDetection {
|
||||
|
||||
constructor(ua: string);
|
||||
|
||||
isFirefox: boolean;
|
||||
|
||||
isAndroid: boolean;
|
||||
|
||||
isEdge: boolean;
|
||||
|
||||
isIE: boolean;
|
||||
|
||||
isWebkit: boolean;
|
||||
|
||||
isIOS7: boolean;
|
||||
|
||||
isSlow: boolean;
|
||||
|
||||
supportsIntlApi: boolean;
|
||||
|
||||
}
|
||||
|
||||
|
||||
var browserDetection: BrowserDetection;
|
||||
|
||||
|
||||
|
||||
function dispatchEvent(element: any, eventType: any): void;
|
||||
|
||||
|
||||
|
||||
function el(html: string): HTMLElement;
|
||||
|
||||
|
||||
|
||||
function containsRegexp(input: string): RegExp;
|
||||
|
||||
|
||||
|
||||
function normalizeCSS(css: string): string;
|
||||
|
||||
|
||||
|
||||
function stringifyElement(el: any): string;
|
||||
|
||||
|
||||
|
||||
var RootTestComponent: ng.InjectableReference;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
declare module "angular2/test_lib" {
|
||||
export = ngTestLib;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -200,6 +200,7 @@ declare module angular {
|
||||
* @param inlineAnnotatedFunction Execute this function on module load. Useful for service configuration.
|
||||
*/
|
||||
config(inlineAnnotatedFunction: any[]): IModule;
|
||||
config(object: Object): IModule;
|
||||
/**
|
||||
* Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
|
||||
*
|
||||
@@ -1083,7 +1084,7 @@ declare module angular {
|
||||
}
|
||||
|
||||
interface IDeferred<T> {
|
||||
resolve(value?: T): void;
|
||||
resolve(value?: T|IPromise<T>): void;
|
||||
reject(reason?: any): void;
|
||||
notify(state?: any): void;
|
||||
promise: IPromise<T>;
|
||||
|
||||
@@ -291,9 +291,9 @@ fooProm = fooProm.caught((error: any) => {
|
||||
|
||||
fooProm = fooProm.catch((reason: any) => {
|
||||
//handle multiple valid return types simultaneously
|
||||
if (true) {
|
||||
if (foo === null) {
|
||||
return;
|
||||
} else if (false) {
|
||||
} else if (!reason) {
|
||||
return voidProm;
|
||||
} else if (foo) {
|
||||
return foo;
|
||||
@@ -696,6 +696,15 @@ fooProm = Promise.try(() => {
|
||||
return fooThen;
|
||||
}, arr, x);
|
||||
|
||||
// - - - - - - - - - - - - - - - - -
|
||||
|
||||
fooProm = Promise.try(() => {
|
||||
if (fooProm) {
|
||||
return fooProm;
|
||||
}
|
||||
return foo;
|
||||
});
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
fooProm = Promise.attempt(() => {
|
||||
@@ -710,6 +719,15 @@ fooProm = Promise.attempt(() => {
|
||||
|
||||
// - - - - - - - - - - - - - - - - -
|
||||
|
||||
fooProm = Promise.attempt(() => {
|
||||
if (fooProm) {
|
||||
return fooProm;
|
||||
}
|
||||
return foo;
|
||||
});
|
||||
|
||||
// - - - - - - - - - - - - - - - - -
|
||||
|
||||
fooProm = Promise.attempt(() => {
|
||||
return fooThen;
|
||||
});
|
||||
|
||||
Vendored
+30
-59
@@ -51,11 +51,9 @@ interface PromiseConstructor {
|
||||
*
|
||||
* Alias for `attempt();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
try<T>(fn: () => PromiseLike<T>, args?: any[], ctx?: any): Promise<T>;
|
||||
try<T>(fn: () => T, args?: any[], ctx?: any): Promise<T>;
|
||||
try<T>(fn: () => T | PromiseLike<T>, args?: any[], ctx?: any): Promise<T>;
|
||||
|
||||
attempt<T>(fn: () => PromiseLike<T>, args?: any[], ctx?: any): Promise<T>;
|
||||
attempt<T>(fn: () => T, args?: any[], ctx?: any): Promise<T>;
|
||||
attempt<T>(fn: () => T | PromiseLike<T>, args?: any[], ctx?: any): Promise<T>;
|
||||
|
||||
/**
|
||||
* Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function.
|
||||
@@ -66,9 +64,8 @@ interface PromiseConstructor {
|
||||
/**
|
||||
* Create a promise that is resolved with the given `value`. If `value` is a thenable or promise, the returned promise will assume its state.
|
||||
*/
|
||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
||||
resolve(): Promise<void>;
|
||||
resolve<T>(value: PromiseLike<T>): Promise<T>;
|
||||
resolve<T>(value: T): Promise<T>;
|
||||
|
||||
/**
|
||||
* Create a promise that is rejected with the given `reason`.
|
||||
@@ -84,8 +81,7 @@ interface PromiseConstructor {
|
||||
/**
|
||||
* Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable.
|
||||
*/
|
||||
cast<T>(value: PromiseLike<T>): Promise<T>;
|
||||
cast<T>(value: T): Promise<T>;
|
||||
cast<T>(value: T | PromiseLike<T>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Sugar for `Promise.resolve(undefined).bind(thisArg);`. See `.bind()`.
|
||||
@@ -106,8 +102,7 @@ interface PromiseConstructor {
|
||||
* Returns a promise that will be fulfilled with `value` (or `undefined`) after given `ms` milliseconds. If `value` is a promise, the delay will start counting down when it is fulfilled and the returned promise will be fulfilled with the fulfillment value of the `value` promise.
|
||||
*/
|
||||
// TODO enable more overloads
|
||||
delay<T>(ms: number, value: PromiseLike<T>): Promise<T>;
|
||||
delay<T>(ms: number, value: T): Promise<T>;
|
||||
delay<T>(ms: number, value: T | PromiseLike<T>): Promise<T>;
|
||||
delay(ms: number): Promise<void>;
|
||||
|
||||
/**
|
||||
@@ -177,10 +172,10 @@ interface PromiseConstructor {
|
||||
// array with promises of value
|
||||
all<T>(values: PromiseLike<T>[]): Promise<T[]>;
|
||||
// array with promises of different types
|
||||
all<T1, T2>(values: [PromiseLike<T1>, PromiseLike<T2>]): Promise<[T1, T2]>;
|
||||
all<T1, T2, T3>(values: [PromiseLike<T1>, PromiseLike<T2>, PromiseLike<T3>]): Promise<[T1, T2, T3]>;
|
||||
all<T1, T2, T3, T4>(values: [PromiseLike<T1>, PromiseLike<T2>, PromiseLike<T3>, PromiseLike<T4>]): Promise<[T1, T2, T3, T4]>;
|
||||
all<T1, T2, T3, T4, T5>(values: [PromiseLike<T1>, PromiseLike<T2>, PromiseLike<T3>, PromiseLike<T4>, PromiseLike<T5>]): Promise<[T1, T2, T3, T4, T5]>;
|
||||
all<T1, T2, T3, T4>(values: [PromiseLike<T1>, PromiseLike<T2>, PromiseLike<T3>, PromiseLike<T4>]): Promise<[T1, T2, T3, T4]>;
|
||||
all<T1, T2, T3>(values: [PromiseLike<T1>, PromiseLike<T2>, PromiseLike<T3>]): Promise<[T1, T2, T3]>;
|
||||
all<T1, T2>(values: [PromiseLike<T1>, PromiseLike<T2>]): Promise<[T1, T2]>;
|
||||
// array with values
|
||||
all<T>(values: T[]): Promise<T[]>;
|
||||
|
||||
@@ -269,20 +264,16 @@ interface PromiseConstructor {
|
||||
* *The original array is not modified.*
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
map<T, U>(values: PromiseLike<PromiseLike<T>[]>, mapper: (item: T, index: number, arrayLength: number) => PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: PromiseLike<PromiseLike<T>[]>, mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: PromiseLike<PromiseLike<T>[]>, mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
|
||||
// promise of array with values
|
||||
map<T, U>(values: PromiseLike<T[]>, mapper: (item: T, index: number, arrayLength: number) => PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: PromiseLike<T[]>, mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: PromiseLike<T[]>, mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
|
||||
// array with promises of value
|
||||
map<T, U>(values: PromiseLike<T>[], mapper: (item: T, index: number, arrayLength: number) => PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: PromiseLike<T>[], mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: PromiseLike<T>[], mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
|
||||
// array with values
|
||||
map<T, U>(values: T[], mapper: (item: T, index: number, arrayLength: number) => PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: T[], mapper: (item: T, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<T, U>(values: T[], mapper: (item: T, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
|
||||
/**
|
||||
* Similar to `map` with concurrency set to 1 but guaranteed to execute in sequential order
|
||||
@@ -312,20 +303,16 @@ interface PromiseConstructor {
|
||||
* *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.*
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
reduce<T, U>(values: PromiseLike<PromiseLike<T>[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: PromiseLike<PromiseLike<T>[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: PromiseLike<PromiseLike<T>[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
|
||||
// promise of array with values
|
||||
reduce<T, U>(values: PromiseLike<T[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: PromiseLike<T[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: PromiseLike<T[]>, reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
|
||||
// array with promises of value
|
||||
reduce<T, U>(values: PromiseLike<T>[], reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: PromiseLike<T>[], reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: PromiseLike<T>[], reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
|
||||
// array with values
|
||||
reduce<T, U>(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>;
|
||||
reduce<T, U>(values: T[], reducer: (total: U, current: T, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
|
||||
/**
|
||||
* Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
|
||||
@@ -335,20 +322,16 @@ interface PromiseConstructor {
|
||||
* *The original array is not modified.
|
||||
*/
|
||||
// promise of array with promises of value
|
||||
filter<T>(values: PromiseLike<PromiseLike<T>[]>, filterer: (item: T, index: number, arrayLength: number) => PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: PromiseLike<PromiseLike<T>[]>, filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: PromiseLike<PromiseLike<T>[]>, filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
|
||||
// promise of array with values
|
||||
filter<T>(values: PromiseLike<T[]>, filterer: (item: T, index: number, arrayLength: number) => PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: PromiseLike<T[]>, filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: PromiseLike<T[]>, filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
|
||||
// array with promises of value
|
||||
filter<T>(values: PromiseLike<T>[], filterer: (item: T, index: number, arrayLength: number) => PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: PromiseLike<T>[], filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: PromiseLike<T>[], filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
|
||||
// array with values
|
||||
filter<T>(values: T[], filterer: (item: T, index: number, arrayLength: number) => PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: T[], filterer: (item: T, index: number, arrayLength: number) => boolean, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
filter<T>(values: T[], filterer: (item: T, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Promise.ConcurrencyOption): Promise<T[]>;
|
||||
|
||||
/**
|
||||
* Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well.
|
||||
@@ -412,11 +395,9 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
|
||||
*
|
||||
* Alias `.lastly();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
finally<U>(handler: () => PromiseLike<U>): Promise<T>;
|
||||
finally<U>(handler: () => U): Promise<T>;
|
||||
finally<U>(handler: () => U | PromiseLike<U>): Promise<T>;
|
||||
|
||||
lastly<U>(handler: () => PromiseLike<U>): Promise<T>;
|
||||
lastly<U>(handler: () => U): Promise<T>;
|
||||
lastly<U>(handler: () => U | PromiseLike<U>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise.
|
||||
@@ -426,16 +407,13 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
|
||||
/**
|
||||
* Like `.then()`, but any unhandled rejection that ends up here will be thrown as an error.
|
||||
*/
|
||||
done<U>(onFulfilled: (value: T) => PromiseLike<U>, onRejected: (error: any) => PromiseLike<U>, onProgress?: (note: any) => any): void;
|
||||
done<U>(onFulfilled: (value: T) => PromiseLike<U>, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void;
|
||||
done<U>(onFulfilled: (value: T) => U, onRejected: (error: any) => PromiseLike<U>, onProgress?: (note: any) => any): void;
|
||||
done<U>(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): void;
|
||||
done<U>(onFulfilled?: (value: T) => PromiseLike<U>, onRejected?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): void;
|
||||
done<U>(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): void;
|
||||
|
||||
/**
|
||||
* Like `.finally()`, but not called for rejections.
|
||||
*/
|
||||
tap<U>(onFulFill: (value: T) => PromiseLike<U>): Promise<T>;
|
||||
tap<U>(onFulfill: (value: T) => U): Promise<T>;
|
||||
tap<U>(onFulFill: (value: T) => U | PromiseLike<U>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Shorthand for `.then(null, null, handler);`. Attach a progress handler that will be called if this promise is progressed. Returns a new promise chained from this promise.
|
||||
@@ -481,10 +459,7 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
|
||||
/**
|
||||
* Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors.
|
||||
*/
|
||||
fork<U>(onFulfilled: (value: T) => PromiseLike<U>, onRejected: (error: any) => PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
|
||||
fork<U>(onFulfilled: (value: T) => PromiseLike<U>, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>;
|
||||
fork<U>(onFulfilled: (value: T) => U, onRejected: (error: any) => PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
|
||||
fork<U>(onFulfilled?: (value: T) => U, onRejected?: (error: any) => U, onProgress?: (note: any) => any): Promise<U>;
|
||||
fork<U>(onFulfilled?: (value: T) => U | PromiseLike<U>, onRejected?: (error: any) => U | PromiseLike<U>, onProgress?: (note: any) => any): Promise<U>;
|
||||
|
||||
/**
|
||||
* Create an uncancellable promise based on this promise.
|
||||
@@ -605,8 +580,7 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
|
||||
* Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers.
|
||||
*/
|
||||
// TODO how to model instance.spread()? like Q?
|
||||
spread<U>(onFulfill: Function, onReject?: (reason: any) => PromiseLike<U>): Promise<U>;
|
||||
spread<U>(onFulfill: Function, onReject?: (reason: any) => U): Promise<U>;
|
||||
spread<U>(onFulfill: Function, onReject?: (reason: any) => U | PromiseLike<U>): Promise<U>;
|
||||
/*
|
||||
// TODO or something like this?
|
||||
spread<U, W>(onFulfill: (...values: W[]) => PromiseLike<U>, onReject?: (reason: any) => PromiseLike<U>): Promise<U>;
|
||||
@@ -654,8 +628,7 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
|
||||
* Same as calling `Promise.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
map<Q, U>(mapper: (item: Q, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
|
||||
/**
|
||||
* Same as `Promise.mapSeries(thisPromise, mapper)`.
|
||||
@@ -667,15 +640,13 @@ interface Promise<T> extends PromiseLike<T>, Promise.Inspection<T> {
|
||||
* Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U, initialValue?: U): Promise<U>;
|
||||
reduce<Q, U>(reducer: (memo: U, item: Q, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
||||
|
||||
/**
|
||||
* Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
*/
|
||||
// TODO type inference from array-resolving promise?
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => PromiseLike<boolean>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
filter<U>(filterer: (item: U, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, options?: Promise.ConcurrencyOption): Promise<U[]>;
|
||||
|
||||
/**
|
||||
* Same as calling ``Promise.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
|
||||
|
||||
+297
-63
@@ -1,5 +1,15 @@
|
||||
///<reference path="chartist.d.ts" />
|
||||
|
||||
Chartist.escapingMap = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
'\'': ''',
|
||||
};
|
||||
|
||||
Chartist.precision = 8;
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
|
||||
series: [
|
||||
@@ -8,26 +18,26 @@ new Chartist.Line('.ct-chart', {
|
||||
[1, 3, 4, 5, 6]
|
||||
]
|
||||
}, {
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 40
|
||||
}
|
||||
});
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 40
|
||||
}
|
||||
});
|
||||
|
||||
var lineChart = new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
|
||||
series: [
|
||||
[5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9],
|
||||
[10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null],
|
||||
[null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null]
|
||||
[null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null]
|
||||
]
|
||||
}, {
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 10
|
||||
},
|
||||
low: 0
|
||||
});
|
||||
fullWidth: true,
|
||||
chartPadding: {
|
||||
right: 10
|
||||
},
|
||||
low: 0
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: ['1', '2', '3', '4', '5', '6'],
|
||||
@@ -47,10 +57,10 @@ var data = {
|
||||
series: [5, 3, 4]
|
||||
};
|
||||
|
||||
var sum = function(a: number, b: number) { return a + b };
|
||||
var sum = (a: number, b: number) => { return a + b };
|
||||
|
||||
new Chartist.Pie('.ct-chart', data, {
|
||||
labelInterpolationFnc: function(value: number) {
|
||||
labelInterpolationFnc: (value: number) => {
|
||||
return Math.round(value / data.series.reduce(sum) * 100) + '%';
|
||||
}
|
||||
});
|
||||
@@ -58,26 +68,24 @@ new Chartist.Pie('.ct-chart', data, {
|
||||
new Chartist.Pie('.ct-chart', {
|
||||
series: [20, 10, 30, 40]
|
||||
}, {
|
||||
donut: true,
|
||||
donutWidth: 60,
|
||||
startAngle: 270,
|
||||
total: 200,
|
||||
showLabel: false
|
||||
});
|
||||
|
||||
donut: true,
|
||||
donutWidth: 60,
|
||||
startAngle: 270,
|
||||
total: 200,
|
||||
showLabel: false
|
||||
});
|
||||
|
||||
// Animation Donut example
|
||||
|
||||
var chart = new Chartist.Pie('.ct-chart', {
|
||||
series: [10, 20, 50, 20, 5, 50, 15],
|
||||
labels: [1, 2, 3, 4, 5, 6, 7]
|
||||
}, {
|
||||
donut: true,
|
||||
showLabel: false
|
||||
});
|
||||
donut: true,
|
||||
showLabel: false
|
||||
});
|
||||
|
||||
chart.on('draw', function(data: any) {
|
||||
if(data.type === 'slice') {
|
||||
chart.on('draw', (data: any) => {
|
||||
if (data.type === 'slice') {
|
||||
// Get the total path length in order to use for dash array animation
|
||||
var pathLength = data.element._node.getTotalLength();
|
||||
|
||||
@@ -87,12 +95,12 @@ chart.on('draw', function(data: any) {
|
||||
});
|
||||
|
||||
// Create animation definition while also assigning an ID to the animation for later sync usage
|
||||
var animationDefinition: any = {
|
||||
var animationDefinition: Chartist.IChartistAnimations = {
|
||||
'stroke-dashoffset': {
|
||||
id: 'anim' + data.index,
|
||||
dur: 1000,
|
||||
from: -pathLength + 'px',
|
||||
to: '0px',
|
||||
to: '0px',
|
||||
easing: Chartist.Svg.Easing.easeOutQuint,
|
||||
// We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible)
|
||||
fill: 'freeze'
|
||||
@@ -100,7 +108,7 @@ chart.on('draw', function(data: any) {
|
||||
};
|
||||
|
||||
// If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation
|
||||
if(data.index !== 0) {
|
||||
if (data.index !== 0) {
|
||||
animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end';
|
||||
}
|
||||
|
||||
@@ -119,8 +127,8 @@ new Chartist.Bar('.ct-chart', {
|
||||
labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'],
|
||||
series: [20, 60, 120, 200, 180, 20, 10]
|
||||
}, {
|
||||
distributeSeries: true
|
||||
});
|
||||
distributeSeries: true
|
||||
});
|
||||
|
||||
new Chartist.Bar('.ct-chart', {
|
||||
labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],
|
||||
@@ -132,39 +140,265 @@ new Chartist.Bar('.ct-chart', {
|
||||
[4, 1, 2, 1]
|
||||
]
|
||||
}, {
|
||||
// Default mobile configuration
|
||||
stackBars: true,
|
||||
axisX: {
|
||||
labelInterpolationFnc: function(value: string) {
|
||||
return value.split(/\s+/).map(function(word: string) {
|
||||
return word[0];
|
||||
}).join('');
|
||||
}
|
||||
},
|
||||
axisY: {
|
||||
offset: 20
|
||||
}
|
||||
}, [
|
||||
// Options override for media > 400px
|
||||
['screen and (min-width: 400px)', {
|
||||
reverseData: true,
|
||||
horizontalBars: true,
|
||||
// Default mobile configuration
|
||||
stackBars: true,
|
||||
axisX: {
|
||||
labelInterpolationFnc: Chartist.noop
|
||||
labelInterpolationFnc: (value: string) => {
|
||||
return value.split(/\s+/).map((word: string) => {
|
||||
return word[0];
|
||||
}).join('');
|
||||
}
|
||||
},
|
||||
axisY: {
|
||||
offset: 60
|
||||
offset: 20
|
||||
}
|
||||
}, [
|
||||
// Options override for media > 400px
|
||||
['screen and (min-width: 400px)', {
|
||||
reverseData: true,
|
||||
horizontalBars: true,
|
||||
axisX: {
|
||||
labelInterpolationFnc: Chartist.noop
|
||||
},
|
||||
axisY: {
|
||||
offset: 60
|
||||
}
|
||||
}],
|
||||
// Options override for media > 800px
|
||||
['screen and (min-width: 800px)', {
|
||||
stackBars: false,
|
||||
seriesBarDistance: 10
|
||||
}],
|
||||
// Options override for media > 1000px
|
||||
['screen and (min-width: 1000px)', {
|
||||
reverseData: false,
|
||||
horizontalBars: false,
|
||||
seriesBarDistance: 15
|
||||
}]
|
||||
]);
|
||||
|
||||
new Chartist.Pie('.ct-chart', {
|
||||
series: [{
|
||||
value: 20,
|
||||
name: 'Series 1',
|
||||
className: 'my-custom-class-one',
|
||||
meta: 'Meta One'
|
||||
}, {
|
||||
value: 10,
|
||||
name: 'Series 2',
|
||||
className: 'my-custom-class-two',
|
||||
meta: 'Meta Two'
|
||||
}, {
|
||||
value: 70,
|
||||
name: 'Series 3',
|
||||
className: 'my-custom-class-three',
|
||||
meta: 'Meta Three'
|
||||
}]
|
||||
});
|
||||
|
||||
new Chartist.Bar('.bar-chart', {
|
||||
labels: ['foo', 'bar', 'foobar'],
|
||||
series: [
|
||||
{
|
||||
data: [1],
|
||||
className: 'graph-foo',
|
||||
},
|
||||
{
|
||||
data: [10],
|
||||
className: 'graph-foo',
|
||||
},
|
||||
{
|
||||
data: [12],
|
||||
className: 'graph-foo',
|
||||
}]
|
||||
}, {
|
||||
seriesBarDistance: 30,
|
||||
reverseData: true,
|
||||
horizontalBars: true,
|
||||
height: '115px',
|
||||
axisY: {
|
||||
offset: 70,
|
||||
showGrid: false,
|
||||
},
|
||||
axisX: {
|
||||
scaleMinSpace: 200
|
||||
}
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
series: [
|
||||
[5, 9, 7, 8, 5, 3, 5, 4]
|
||||
]
|
||||
}, {
|
||||
ticks: [0, 4],
|
||||
low: 0,
|
||||
showArea: true,
|
||||
axisY: {
|
||||
showLabel: true,
|
||||
showGrid: false,
|
||||
ticks: [1, 4],
|
||||
type: Chartist.FixedScaleAxis
|
||||
}
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5, 6, 7, 8],
|
||||
series: [
|
||||
[5, 9, 7, 8, 5, 3, 5, 4]
|
||||
]
|
||||
}, {
|
||||
ticks: [0, 4],
|
||||
low: 0,
|
||||
showArea: true,
|
||||
axisX: {
|
||||
showGrid: false
|
||||
},
|
||||
axisY: {
|
||||
showLabel: true,
|
||||
showGrid: false,
|
||||
ticks: [1, 4],
|
||||
type: Chartist.FixedScaleAxis
|
||||
}
|
||||
});
|
||||
|
||||
var chart2 = new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5],
|
||||
series: [
|
||||
[12, 9, 7, 8, 5]
|
||||
]
|
||||
});
|
||||
|
||||
// Listening for draw events that get emitted by the Chartist chart
|
||||
chart2.on('draw', (data: any) => {
|
||||
// If the draw event was triggered from drawing a point on the line chart
|
||||
if (data.type === 'point') {
|
||||
// We are creating a new path SVG element that draws a triangle around the point coordinates
|
||||
var triangle = new Chartist.Svg('path', {
|
||||
d: ['M',
|
||||
data.x,
|
||||
data.y - 15,
|
||||
'L',
|
||||
data.x - 15,
|
||||
data.y + 8,
|
||||
'L',
|
||||
data.x + 15,
|
||||
data.y + 8,
|
||||
'z'].join(' '),
|
||||
style: 'fill-opacity: 1'
|
||||
}, 'ct-area');
|
||||
|
||||
// With data.element we get the Chartist SVG wrapper and we can replace the original point drawn by Chartist with our newly created triangle
|
||||
data.element.replace(triangle);
|
||||
}
|
||||
});
|
||||
|
||||
// Create a simple bi-polar bar chart
|
||||
var biPolarChart = new Chartist.Bar('.ct-chart', {
|
||||
labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'],
|
||||
series: [
|
||||
[1, 2, 4, 8, 6, -2, -1, -4, -6, -2]
|
||||
]
|
||||
}, {
|
||||
high: 10,
|
||||
low: -10,
|
||||
axisX: {
|
||||
labelInterpolationFnc: (value: any, index: number) => {
|
||||
return index % 2 === 0 ? value : null;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Listen for draw events on the bar chart
|
||||
biPolarChart.on('draw', (data: any) => {
|
||||
// If this draw event is of type bar we can use the data to create additional content
|
||||
if (data.type === 'bar') {
|
||||
// We use the group element of the current series to append a simple circle with the bar peek coordinates and a circle radius that is depending on the value
|
||||
data.group.append(new Chartist.Svg('circle', {
|
||||
cx: data.x2,
|
||||
cy: data.y2,
|
||||
r: Math.abs(Chartist.getMultiValue(data.value)) * 2 + 5
|
||||
}, 'ct-slice-pie'));
|
||||
}
|
||||
});
|
||||
|
||||
new Chartist.Bar('.ct-chart', {
|
||||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
series: [
|
||||
[5, 4, 3, 7, 5, 10, 3],
|
||||
[3, 2, 9, 5, 4, 6, 4]
|
||||
]
|
||||
}, {
|
||||
axisX: {
|
||||
// On the x-axis start means top and end means bottom
|
||||
position: 'start'
|
||||
},
|
||||
axisY: {
|
||||
// On the y-axis start means left and end means right
|
||||
position: 'end'
|
||||
}
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5],
|
||||
series: [[1, 2, 8, 1, 7]]
|
||||
}, {
|
||||
lineSmooth: Chartist.Interpolation.none({
|
||||
fillHoles: false
|
||||
})
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5],
|
||||
series: [[1, 2, 8, 1, 7]]
|
||||
}, {
|
||||
lineSmooth: Chartist.Interpolation.simple({
|
||||
divisor: 2,
|
||||
fillHoles: false
|
||||
})
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5],
|
||||
series: [[1, 2, 8, 1, 7]]
|
||||
}, {
|
||||
lineSmooth: Chartist.Interpolation.cardinal({
|
||||
tension: 1,
|
||||
fillHoles: false
|
||||
})
|
||||
});
|
||||
|
||||
new Chartist.Line('.ct-chart', {
|
||||
labels: [1, 2, 3, 4, 5],
|
||||
series: [[1, 2, 8, 1, 7]]
|
||||
}, {
|
||||
lineSmooth: Chartist.Interpolation.step({
|
||||
postpone: true,
|
||||
fillHoles: false
|
||||
})
|
||||
});
|
||||
|
||||
var overlappingBarsData: Chartist.IChartistData = {
|
||||
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||
series: [
|
||||
[5, 4, 3, 7, 5, 10, 3, 4, 8, 10, 6, 8],
|
||||
[3, 2, 9, 5, 4, 6, 4, 6, 7, 8, 7, 4]
|
||||
]
|
||||
};
|
||||
|
||||
var overlappingBarsOptions: Chartist.IBarChartOptions = {
|
||||
seriesBarDistance: 10
|
||||
};
|
||||
|
||||
var overlappingBarsResponsiveOptions: Array<Chartist.IResponsiveOptionTuple<Chartist.IBarChartOptions>> = [
|
||||
['screen and (max-width: 640px)', {
|
||||
seriesBarDistance: 5,
|
||||
axisX: {
|
||||
labelInterpolationFnc: (value: any) => {
|
||||
return value[0];
|
||||
}
|
||||
}
|
||||
}],
|
||||
// Options override for media > 800px
|
||||
['screen and (min-width: 800px)', {
|
||||
stackBars: false,
|
||||
seriesBarDistance: 10
|
||||
}],
|
||||
// Options override for media > 1000px
|
||||
['screen and (min-width: 1000px)', {
|
||||
reverseData: false,
|
||||
horizontalBars: false,
|
||||
seriesBarDistance: 15
|
||||
}]
|
||||
]);
|
||||
];
|
||||
|
||||
new Chartist.Bar('.ct-chart', overlappingBarsData, overlappingBarsOptions, overlappingBarsResponsiveOptions);
|
||||
|
||||
Vendored
+305
-14
@@ -1,16 +1,62 @@
|
||||
// Type definitions for Chartist v0.9.4
|
||||
// Type definitions for Chartist v0.9.5
|
||||
// Project: https://github.com/gionkunz/chartist-js
|
||||
// Definitions by: Matt Gibbs <https://github.com/mtgibbs>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module Chartist {
|
||||
|
||||
interface ChartistStatic {
|
||||
|
||||
/**
|
||||
* Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.
|
||||
*/
|
||||
precision: number;
|
||||
|
||||
/**
|
||||
* A map with characters to escape for strings to be safely used as attribute values.
|
||||
*/
|
||||
escapingMap: IChartistEscapeMap;
|
||||
|
||||
Pie: IChartistPieChart;
|
||||
Bar: IChartistBarChart;
|
||||
Line: IChartistLineChart;
|
||||
|
||||
Svg: any;
|
||||
FixedScaleAxis: IFixedScaleAxisStatic;
|
||||
AutoScaleAxis: IAutoScaleAxisStatic;
|
||||
StepAxis: IStepAxisStatic;
|
||||
|
||||
Svg: ChartistSvgStatic;
|
||||
Interpolation: ChartistInterpolationStatic;
|
||||
|
||||
noop: Function;
|
||||
|
||||
alphaNumerate(n: number): string;
|
||||
extend(target: Object, ...sources: Object[]): Object;
|
||||
|
||||
replaceAll(str: string, subStr: string, newSubStr: string): string;
|
||||
ensureUnit(value: number, unit: string): string;
|
||||
quantity(input: string | number): Object;
|
||||
|
||||
query(query: Node | string): Node;
|
||||
times(length: number): Array<any>;
|
||||
sum(previous: number, current: number): number;
|
||||
mapMultiply(factor: number): (num: number) => number;
|
||||
mapAdd(addend: number): (num: number) => number;
|
||||
serialMap(arr: Array<any>, cb: Function): Array<any>;
|
||||
roundWithPrecision(value: number, digits?: number): number;
|
||||
|
||||
getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples
|
||||
|
||||
serialize(data: Object | string | number): string;
|
||||
deserialize(data: string): Object | string | number;
|
||||
|
||||
createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement
|
||||
|
||||
plugins: any;
|
||||
}
|
||||
|
||||
interface IChartistEscapeMap {
|
||||
[Key: string]: string;
|
||||
}
|
||||
|
||||
interface IResponsiveOptionTuple<T extends IChartOptions> extends Array<string | T> {
|
||||
@@ -18,9 +64,33 @@ declare module Chartist {
|
||||
1: T;
|
||||
}
|
||||
|
||||
// these have no other purpose than to help define the types that can be placed on
|
||||
// a line chart axisX
|
||||
// in the actual chartist library these are classes that project their options onto
|
||||
// the parent class
|
||||
interface IFixedScaleAxisStatic { }
|
||||
interface IAutoScaleAxisStatic { }
|
||||
interface IStepAxisStatic { }
|
||||
|
||||
// data formats are not well documented on all the ways they can be passed to the constructors
|
||||
// this definition gives some intellisense, but does not protect the user from misuse
|
||||
// TODO: come in and tidy this up and make it fit better
|
||||
interface IChartistData {
|
||||
labels?: Array<string> | Array<number> | Array<Date>;
|
||||
series: Array<IChartistSeriesData> | Array<number> | Array<Array<number>>;
|
||||
}
|
||||
|
||||
interface IChartistSeriesData {
|
||||
name?: string;
|
||||
value?: number;
|
||||
data?: Array<number>;
|
||||
className?: string;
|
||||
meta?: string; // I assume this could probably be a number as well?
|
||||
}
|
||||
|
||||
interface IChartistBase<T extends IChartOptions> {
|
||||
container: any;
|
||||
data: Object;
|
||||
data: IChartistData;
|
||||
defaultOptions: T;
|
||||
options: T;
|
||||
responsiveOptions: Array<IResponsiveOptionTuple<T>>;
|
||||
@@ -32,6 +102,8 @@ declare module Chartist {
|
||||
supportsAnimations: boolean;
|
||||
resizeListener: any;
|
||||
|
||||
plugins?: Array<any>; // all of these plugins seem to be functions with options, but keeping type any for now
|
||||
|
||||
update(data: Object, options?: T, override?: boolean): void;
|
||||
detatch(): void;
|
||||
|
||||
@@ -55,15 +127,15 @@ declare module Chartist {
|
||||
}
|
||||
|
||||
interface IChartistPieChart extends IChartistBase<IPieChartOptions> {
|
||||
new (target: any, data: Object, options?: IPieChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IPieChartOptions>>): IChartistPieChart;
|
||||
new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IPieChartOptions>>): IChartistPieChart;
|
||||
}
|
||||
|
||||
interface IChartistLineChart extends IChartistBase<ILineChartOptions> {
|
||||
new (target: any, data: Object, options?: ILineChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<ILineChartOptions>>): IChartistLineChart;
|
||||
new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<ILineChartOptions>>): IChartistLineChart;
|
||||
}
|
||||
|
||||
interface IChartistBarChart extends IChartistBase<IBarChartOptions> {
|
||||
new (target: any, data: Object, options?: IBarChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IBarChartOptions>>): IChartistBarChart;
|
||||
new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array<IResponsiveOptionTuple<IBarChartOptions>>): IChartistBarChart;
|
||||
}
|
||||
|
||||
interface IChartOptions {
|
||||
@@ -71,6 +143,8 @@ declare module Chartist {
|
||||
* If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
|
||||
*/
|
||||
reverseData?: boolean;
|
||||
|
||||
plugins?: Array<any>;
|
||||
}
|
||||
|
||||
interface IPieChartOptions extends IChartOptions {
|
||||
@@ -163,6 +237,7 @@ declare module Chartist {
|
||||
height?: number | string;
|
||||
high?: number;
|
||||
low?: number;
|
||||
ticks?: Array<string | number>;
|
||||
onlyInteger?: boolean;
|
||||
chartPadding?: IChartPadding;
|
||||
seriesBarDistance?: number;
|
||||
@@ -206,20 +281,20 @@ declare module Chartist {
|
||||
}
|
||||
|
||||
interface ILineChartOptions extends IChartOptions {
|
||||
axisX?: ILineChartXAxis;
|
||||
axisY?: ILineChartYAxis;
|
||||
axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
|
||||
axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
|
||||
width?: number | string;
|
||||
height?: number | string;
|
||||
showLine?: boolean;
|
||||
showPoint?: boolean;
|
||||
showArea?: boolean;
|
||||
areaBase?: number;
|
||||
lineSmooth?: boolean;
|
||||
lineSmooth?: Function | boolean;
|
||||
low?: number;
|
||||
high?: number;
|
||||
ticks?: Array<string | number>;
|
||||
chartPadding?: IChartPadding;
|
||||
fullWidth?: boolean;
|
||||
reverseData?: boolean;
|
||||
classNames?: ILineChartClasses;
|
||||
}
|
||||
|
||||
@@ -233,18 +308,31 @@ declare module Chartist {
|
||||
showLabel?: boolean;
|
||||
showGrid?: boolean;
|
||||
labelInterpolationFnc?: Function;
|
||||
type?: any;
|
||||
}
|
||||
|
||||
interface ILineChartXAxis extends ILineChartAxis {
|
||||
interface IChartistStepAxis extends ILineChartAxis {
|
||||
type?: IStepAxisStatic;
|
||||
ticks?: Array<string> | Array<number>;
|
||||
stretch?: boolean;
|
||||
}
|
||||
|
||||
interface ILineChartYAxis extends ILineChartAxis {
|
||||
interface IChartistFixedScaleAxis extends ILineChartAxis {
|
||||
type?: IFixedScaleAxisStatic;
|
||||
high?: number;
|
||||
low?: number;
|
||||
divisor?: number;
|
||||
ticks?: Array<string> | Array<number>;
|
||||
}
|
||||
|
||||
interface IChartistAutoScaleAxis extends ILineChartAxis {
|
||||
high?: number;
|
||||
low?: number;
|
||||
scaleMinSpace?: number;
|
||||
onlyInteger?: boolean;
|
||||
referenceValue?: number;
|
||||
type?: IAutoScaleAxisStatic;
|
||||
}
|
||||
|
||||
// TODO: Finish documenting all of the defaults
|
||||
interface ILineChartClasses {
|
||||
/**
|
||||
* Default is 'ct-chart-line'
|
||||
@@ -263,6 +351,209 @@ declare module Chartist {
|
||||
start?: string;
|
||||
end?: string;
|
||||
}
|
||||
|
||||
interface ChartistSvgStatic {
|
||||
new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg;
|
||||
|
||||
Easing: ChartistEasingStatic;
|
||||
|
||||
/**
|
||||
* This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.
|
||||
*/
|
||||
isSupported(feature: string): boolean;
|
||||
}
|
||||
|
||||
interface IChartistSvg {
|
||||
|
||||
/**
|
||||
* Set attributes on the current SVG element of the wrapper you're currently working on.
|
||||
*/
|
||||
attr(attributes: Object | string, ns: string): Object | string;
|
||||
|
||||
/**
|
||||
* Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.
|
||||
*/
|
||||
elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Returns the parent Chartist.SVG wrapper object
|
||||
*/
|
||||
parent(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.
|
||||
*/
|
||||
root(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.
|
||||
*/
|
||||
querySelector(selector: string): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.
|
||||
*/
|
||||
querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list
|
||||
|
||||
/**
|
||||
* This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.
|
||||
*/
|
||||
foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
|
||||
|
||||
/**
|
||||
* This method adds a new text element to the current Chartist.Svg wrapper.
|
||||
*/
|
||||
text(t: string): IChartistSvg;
|
||||
|
||||
/**
|
||||
* This method will clear all child nodes of the current wrapper object.
|
||||
*/
|
||||
empty(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.
|
||||
*/
|
||||
remove(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* This method will replace the element with a new element that can be created outside of the current DOM.
|
||||
*/
|
||||
replace(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* This method will append an element to the current element as a child.
|
||||
*/
|
||||
append(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.
|
||||
*/
|
||||
classes(): Array<string>;
|
||||
|
||||
/**
|
||||
* Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
|
||||
*
|
||||
* @method addClass
|
||||
* @param names {string} A white space separated list of class names
|
||||
*/
|
||||
addClass(names: string): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Removes one or a space separated list of classes from the current element.
|
||||
*
|
||||
* @method removeClass
|
||||
* @param names {string} A white space separated list of class names
|
||||
*/
|
||||
removeClass(names: string): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Removes all classes from the current element.
|
||||
*/
|
||||
removeAllClasses(): IChartistSvg;
|
||||
|
||||
/**
|
||||
* Get element height with fallback to svg BoundingBox or parent container dimensions
|
||||
*/
|
||||
height(): number;
|
||||
|
||||
/**
|
||||
* The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes.
|
||||
*/
|
||||
animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg;
|
||||
|
||||
/**
|
||||
* "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node.
|
||||
* THIS IS A WORKAROUND
|
||||
*/
|
||||
getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static
|
||||
}
|
||||
|
||||
interface IChartistAnimations {
|
||||
[Key: string]: IChartistAnimationOptions;
|
||||
}
|
||||
|
||||
interface IChartistAnimationOptions {
|
||||
id?: string;
|
||||
dur: string | number;
|
||||
from: string | number;
|
||||
to: string | number;
|
||||
easing?: IChartistEasingDefinition | string;
|
||||
fill?: string;
|
||||
begin?: string;
|
||||
}
|
||||
|
||||
interface IChartistEasingDefinition {
|
||||
0: number;
|
||||
1: number;
|
||||
2: number;
|
||||
3: number;
|
||||
}
|
||||
|
||||
interface ChartistEasingStatic {
|
||||
easeInSine: IChartistEasingDefinition;
|
||||
easeOutSine: IChartistEasingDefinition;
|
||||
easeInOutSine: IChartistEasingDefinition;
|
||||
easeInQuad: IChartistEasingDefinition;
|
||||
easeOutQuad: IChartistEasingDefinition;
|
||||
easeInOutQuad: IChartistEasingDefinition;
|
||||
easeInCubic: IChartistEasingDefinition;
|
||||
easeOutCubic: IChartistEasingDefinition;
|
||||
easeInOutCubic: IChartistEasingDefinition;
|
||||
easeInQuart: IChartistEasingDefinition;
|
||||
easeOutQuart: IChartistEasingDefinition;
|
||||
easeInOutQuart: IChartistEasingDefinition;
|
||||
easeInQuint: IChartistEasingDefinition;
|
||||
easeOutQuint: IChartistEasingDefinition;
|
||||
easeInOutQuint: IChartistEasingDefinition;
|
||||
easeInExpo: IChartistEasingDefinition;
|
||||
easeOutExpo: IChartistEasingDefinition;
|
||||
easeInOutExpo: IChartistEasingDefinition;
|
||||
easeInCirc: IChartistEasingDefinition;
|
||||
easeOutCirc: IChartistEasingDefinition;
|
||||
easeInOutCirc: IChartistEasingDefinition;
|
||||
easeInBack: IChartistEasingDefinition;
|
||||
easeOutBack: IChartistEasingDefinition;
|
||||
easeInOutBack: IChartistEasingDefinition;
|
||||
}
|
||||
|
||||
interface ChartistInterpolationStatic {
|
||||
|
||||
/**
|
||||
* This interpolation function does not smooth the path and the result is only containing lines and no curves.
|
||||
*/
|
||||
none(options?: IChartistInterpolationOptions): Function;
|
||||
|
||||
/**
|
||||
* Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.
|
||||
*/
|
||||
simple(options?: IChartistSimpleInterpolationOptions): Function;
|
||||
|
||||
/**
|
||||
* Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.
|
||||
*/
|
||||
cardinal(options?: IChartistCardinalInterpolationOptions): Function;
|
||||
|
||||
/**
|
||||
* Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled.
|
||||
*/
|
||||
step(options?: IChartistStepInterpolationOptions): Function;
|
||||
}
|
||||
|
||||
interface IChartistInterpolationOptions {
|
||||
fillHoles?: boolean;
|
||||
}
|
||||
|
||||
interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions {
|
||||
divisor?: number;
|
||||
}
|
||||
|
||||
interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions {
|
||||
tension?: number;
|
||||
}
|
||||
|
||||
interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions {
|
||||
postpone?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare var Chartist: Chartist.ChartistStatic;
|
||||
|
||||
Vendored
+7325
File diff suppressed because it is too large
Load Diff
Vendored
+93
-35
@@ -1,4 +1,4 @@
|
||||
// Type definitions for DevExtreme 15.2.4
|
||||
// Type definitions for DevExtreme 15.2.5
|
||||
// Project: http://js.devexpress.com/
|
||||
// Definitions by: DevExpress Inc. <http://devexpress.com/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -35,7 +35,7 @@ declare module DevExpress {
|
||||
brokenRules: any[];
|
||||
validators: IValidator[];
|
||||
}
|
||||
export interface GroupConfig extends EventsMixin<GroupConfig> {
|
||||
export interface GroupConfig extends EventsMixin<GroupConfig> {
|
||||
group: any;
|
||||
validators: IValidator[];
|
||||
validate(): ValidationGroupValidationResult;
|
||||
@@ -56,7 +56,7 @@ declare module DevExpress {
|
||||
/** Validates the rules that are defined within the dxValidator objects that are registered for the specified ViewModel. */
|
||||
export function validateModel(model: Object): ValidationGroupValidationResult;
|
||||
/** Registers all the dxValidator objects by which the fields of the specified ViewModel are extended. */
|
||||
export function registerModelForValidation(model: Object): void;
|
||||
export function registerModelForValidation(model: Object) : void;
|
||||
}
|
||||
export var hardwareBackButton: JQueryCallback;
|
||||
/** Processes the hardware back button click. */
|
||||
@@ -429,7 +429,10 @@ declare module DevExpress {
|
||||
}
|
||||
/** An object that provides access to a data web service or local data storage for collection container widgets. */
|
||||
export class DataSource implements EventsMixin<DataSource> {
|
||||
constructor(options?: DataSourceOptions);
|
||||
constructor(url: string);
|
||||
constructor(data: Array<any>);
|
||||
constructor(options: CustomStoreOptions);
|
||||
constructor(options: DataSourceOptions);
|
||||
/** Disposes all resources associated with this DataSource. */
|
||||
dispose(): void;
|
||||
/** Returns the current filter option value. */
|
||||
@@ -452,6 +455,8 @@ declare module DevExpress {
|
||||
key(): any;
|
||||
/** Starts loading data. */
|
||||
load(): JQueryPromise<Array<any>>;
|
||||
/** Clears currently loaded DataSource items and calls the load() method. */
|
||||
reload(): JQueryPromise<Array<any>>;
|
||||
/** Returns an object that would be passed to the load() method of the underlying Store according to the current data shaping option values of the current DataSource instance. */
|
||||
loadOptions(): Object;
|
||||
/** Returns the current pageSize option value. */
|
||||
@@ -612,6 +617,8 @@ declare module DevExpress {
|
||||
enumerate(): JQueryPromise<any>;
|
||||
/** Filters the current Query data. */
|
||||
filter(criteria: Array<any>): Query;
|
||||
/** Filters the current Query data. */
|
||||
filter(predicate: (item: any) => boolean): Query;
|
||||
/** Groups the current Query data. */
|
||||
groupBy(getter: Object): Query;
|
||||
/** Applies the specified transformation to each item. */
|
||||
@@ -1429,7 +1436,7 @@ declare module DevExpress.ui {
|
||||
clearButtonText?: string;
|
||||
/** Specifies whether or not the widget cleans the search box when the popup window is displayed. */
|
||||
cleanSearchOnOpening?: boolean;
|
||||
/** A Boolean value specifying whether or not the widget is closed if a user clicks outside of the overlaying window. */
|
||||
/** A Boolean value specifying whether or not a widget is closed if a user clicks outside of the overlaying window. */
|
||||
closeOnOutsideClick?: any;
|
||||
/** The text displayed on the Apply button. */
|
||||
applyButtonText?: string;
|
||||
@@ -2053,7 +2060,7 @@ declare module DevExpress.ui {
|
||||
dataField?: string;
|
||||
/** Specifies the form item name. */
|
||||
name?: string;
|
||||
/** Specifie which editor widget is used to display and edit the form item value. */
|
||||
/** Specifies which editor widget is used to display and edit the form item value. */
|
||||
editorType?: string;
|
||||
/** Specifies configuration options for the editor widget of the current form item. */
|
||||
editorOptions?: Object;
|
||||
@@ -2133,6 +2140,7 @@ declare module DevExpress.ui {
|
||||
items?: Array<dxFormItem>;
|
||||
/** A Boolean value specifying whether to enable or disable form scrolling. */
|
||||
scrollingEnabled?: boolean;
|
||||
onContentReady?: Function;
|
||||
}
|
||||
/** A form widget used to display and edit values of object fields. */
|
||||
export class dxForm extends Widget {
|
||||
@@ -2401,7 +2409,7 @@ declare module DevExpress.ui {
|
||||
scrollPosition(): number;
|
||||
}
|
||||
export interface dxSwitchOptions extends EditorOptions {
|
||||
activeStateEnabled?: boolean;
|
||||
activeStateEnabled?: boolean;
|
||||
/** Text displayed when the widget is in a disabled state. */
|
||||
offText?: string;
|
||||
/** Text displayed when the widget is in an enabled state. */
|
||||
@@ -2902,6 +2910,22 @@ declare module DevExpress.ui {
|
||||
horizontalScrollingEnabled?: boolean;
|
||||
/** Specifies whether a user can switch views using tabs or a drop-down menu. */
|
||||
useDropDownViewSwitcher?: boolean;
|
||||
/** Specifies the name of the data source item field that defines the start of the appointment. */
|
||||
startDateExpr?: string;
|
||||
/** Specifies the name of the data source item field that defines the ending of the appointment. */
|
||||
endDateExpr?: string;
|
||||
/** Specifies the name of the data source item field that holds the subject of the appointment. */
|
||||
textExpr?: string;
|
||||
/** Specifies the name of the data source item field whose value holds the description of the corresponding appointment. */
|
||||
descriptionExpr?: string;
|
||||
/** Specifies the name of the data source item field whose value defines whether or not the corresponding appointment is an all-day appointment. */
|
||||
allDayExpr?: string;
|
||||
/** Specifies the name of the data source item field that defines a recurrence rule for generating recurring appointments. */
|
||||
recurrenceRuleExpr?: string;
|
||||
/** Specifies the name of the data source item field that defines exceptions for the current recurring appointment. */
|
||||
recurrenceExceptionExpr?: string;
|
||||
/** Specifies whether filtering is performed on the server or client side. */
|
||||
remoteFiltering?: boolean;
|
||||
}
|
||||
/** A widget that displays scheduled data using different views and provides the capability to load, add and edit appointments. */
|
||||
export class dxScheduler extends Widget {
|
||||
@@ -2961,7 +2985,10 @@ declare module DevExpress.ui {
|
||||
dataStructure?: string;
|
||||
/** Specifies whether or not a user can expand all tree view items by the "*" hot key. */
|
||||
expandAllEnabled?: boolean;
|
||||
/** Specifies whether or not a check box is displayed at each tree view item. */
|
||||
/**
|
||||
* Specifies whether or not a check box is displayed at each tree view item.
|
||||
* @deprecated Use the showCheckBoxesMode option instead.
|
||||
*/
|
||||
showCheckBoxes?: boolean;
|
||||
/** Specifies the current check boxes display mode. */
|
||||
showCheckBoxesMode?: string;
|
||||
@@ -2969,7 +2996,10 @@ declare module DevExpress.ui {
|
||||
selectNodesRecursive?: boolean;
|
||||
/** Specifies whether or not all parent nodes of an initially expanded node are displayed expanded. */
|
||||
expandNodesRecursive?: boolean;
|
||||
/** Specifies whether the "Select All" check box is displayed over the tree view. */
|
||||
/**
|
||||
* Specifies whether the "Select All" check box is displayed over the tree view.
|
||||
* @deprecated Use the showCheckBoxesMode option instead.
|
||||
*/
|
||||
selectAllEnabled?: boolean;
|
||||
/** Specifies the text displayed at the "Select All" check box. */
|
||||
selectAllText?: string;
|
||||
@@ -3222,7 +3252,7 @@ declare module DevExpress.ui {
|
||||
};
|
||||
/** Specifies column-level options for filtering using a column header filter. */
|
||||
headerFilter?: {
|
||||
/** Specifies the data source to be used for header filter. */
|
||||
/** Specifies the data source to be used for the header filter. */
|
||||
dataSource?: any;
|
||||
/** Specifies how header filter values should be combined into groups. */
|
||||
groupInterval?: any;
|
||||
@@ -3499,6 +3529,8 @@ declare module DevExpress.ui {
|
||||
};
|
||||
/** Specifies whether or not grid rows must be shaded in a different way. */
|
||||
rowAlternationEnabled?: boolean;
|
||||
/** Specifies whether to enable two-way data binding. */
|
||||
twoWayBindingEnabled?: boolean;
|
||||
/** A handler for the rowClick event. */
|
||||
onRowClick?: any;
|
||||
/** A handler for the rowPrepared event. */
|
||||
@@ -3571,7 +3603,7 @@ declare module DevExpress.ui {
|
||||
texts?: {
|
||||
/** Specifies text for the Export button when this button invokes a dropdown menu so you can choose the required export format. */
|
||||
exportTo?: string;
|
||||
/** Specifies text for the Export button when this button exports to the XSLX format. */
|
||||
/** Specifies text for the Export button's hint when this button exports to the XSLX format without invoking the drop-down menu. */
|
||||
exportToExcel?: string;
|
||||
/** Specifies text for the item in the Export dropdown menu that exports grid data to Excel. */
|
||||
excelFormat?: string;
|
||||
@@ -3605,6 +3637,13 @@ declare module DevExpress.ui {
|
||||
format: string;
|
||||
cancel: boolean;
|
||||
}) => void;
|
||||
/** A handler for the fileSaving event. */
|
||||
onFileSaving?: (e: {
|
||||
fileName: string;
|
||||
format: string;
|
||||
data: any;
|
||||
cancel: boolean;
|
||||
}) => void;
|
||||
/** A handler for the exported event. */
|
||||
onExported?: (e: Object) => void;
|
||||
/** A handler for the keyDown event. */
|
||||
@@ -4001,6 +4040,13 @@ declare module DevExpress.ui {
|
||||
format: string;
|
||||
cancel: boolean;
|
||||
}) => void;
|
||||
/** A handler for the fileSaving event. */
|
||||
onFileSaving?: (e: {
|
||||
fileName: string;
|
||||
format: string;
|
||||
data: any;
|
||||
cancel: boolean;
|
||||
}) => void;
|
||||
/** A handler for the exported event. */
|
||||
onExported?: (e: Object) => void;
|
||||
/** A configuration object specifying options related to state storing. */
|
||||
@@ -4480,11 +4526,11 @@ declare module DevExpress.viz.core {
|
||||
font?: viz.core.Font;
|
||||
/** Specifies the widget title's horizontal position. */
|
||||
horizontalAlignment?: string;
|
||||
/** Specifies the widget title's position in the vertical direction. */
|
||||
/** Specifies the widget title's position in the vertical direction. */
|
||||
verticalAlignment?: string;
|
||||
/** Specifies the distance between the title and surrounding widget elements in pixels. */
|
||||
margin?: viz.core.Margins;
|
||||
/** Specifies the height of the space reserved for the title. */
|
||||
/** Specifies the height of the space reserved for the title. */
|
||||
placeholderSize?: number;
|
||||
/** Specifies text for the title. */
|
||||
text?: string;
|
||||
@@ -4492,7 +4538,7 @@ declare module DevExpress.viz.core {
|
||||
subtitle?: {
|
||||
/** Specifies font options for the subtitle. */
|
||||
font?: viz.core.Font;
|
||||
/** Specifies text for the subtitle. */
|
||||
/** Specifies text for the subtitle. */
|
||||
text?: string;
|
||||
}
|
||||
}
|
||||
@@ -4595,7 +4641,7 @@ declare module DevExpress.viz.core {
|
||||
/** Specifies whether or not the legend is visible on the map. */
|
||||
visible?: boolean;
|
||||
}
|
||||
export interface BaseWidgetOptions {
|
||||
export interface BaseWidgetOptions extends DOMComponentOptions {
|
||||
/** A handler for the drawn event. */
|
||||
onDrawn?: (e: {
|
||||
component: BaseWidget;
|
||||
@@ -4603,16 +4649,16 @@ declare module DevExpress.viz.core {
|
||||
}) => void;
|
||||
/** A handler for the incidentOccurred event. */
|
||||
onIncidentOccurred?: (
|
||||
component: BaseWidget,
|
||||
element: Element,
|
||||
target: {
|
||||
id: string;
|
||||
type: string;
|
||||
args: any;
|
||||
text: string;
|
||||
widget: string;
|
||||
version: string;
|
||||
}
|
||||
component: BaseWidget,
|
||||
element: Element,
|
||||
target: {
|
||||
id: string;
|
||||
type: string;
|
||||
args: any;
|
||||
text: string;
|
||||
widget: string;
|
||||
version: string;
|
||||
}
|
||||
) => void;
|
||||
/** Notifies a widget that it is embedded into an HTML page that uses a path modifier. */
|
||||
pathModified?: boolean;
|
||||
@@ -5153,6 +5199,10 @@ declare module DevExpress.viz.charts {
|
||||
valueField?: string;
|
||||
}
|
||||
export interface CommonPieSeriesSettings extends CommonPieSeriesConfig {
|
||||
/**
|
||||
* Specifies the type of the pie chart series.
|
||||
* @deprecated use the 'type' option instead
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
export interface PieSeriesConfig extends CommonPieSeriesConfig {
|
||||
@@ -5447,10 +5497,12 @@ declare module DevExpress.viz.charts {
|
||||
}
|
||||
export interface ChartArgumentAxis extends ChartAxis, ArgumentAxis { }
|
||||
export interface PolarArgumentAxis extends PolarAxis, ArgumentAxis {
|
||||
/** Specifies a start angle for the argument axis in degrees. */
|
||||
/** Specifies the angle in arc degrees to which the argument axis should be rotated. The positive values rotate the axis clockwise. */
|
||||
startAngle?: number;
|
||||
/** Specifies whether or not to display the first point at the angle specified by the startAngle option. */
|
||||
firstPointOnStartAngle?: boolean;
|
||||
/** Specifies the value to be used as the origin for the argument axis. */
|
||||
originValue?: number;
|
||||
/** Specifies the period of the argument values in the data source. */
|
||||
period?: number;
|
||||
}
|
||||
@@ -5823,7 +5875,7 @@ declare module DevExpress.viz.charts {
|
||||
diameter?: number;
|
||||
/** Specifies the direction that the pie chart segments will occupy. */
|
||||
segmentsDirection?: string;
|
||||
/** Specifies the starting angle in arc degrees for the first segment in a pie chart. */
|
||||
/** Specifies the angle in arc degrees from which the first segment of a pie chart should start. */
|
||||
startAngle?: number;
|
||||
/** Specifies the fraction of the inner radius relative to the total radius in the series of the 'doughnut' type. The value should be between 0 and 1. */
|
||||
innerRadius?: number;
|
||||
@@ -6391,6 +6443,7 @@ declare module DevExpress.viz.rangeSelector {
|
||||
* @deprecated ..\tickInterval\tickInterval.md
|
||||
*/
|
||||
majorTickInterval?: any;
|
||||
/** Specifies an interval between axis ticks. */
|
||||
tickInterval?: any;
|
||||
/** Specifies options for the date-time scale's markers. */
|
||||
marker?: {
|
||||
@@ -6442,10 +6495,15 @@ declare module DevExpress.viz.rangeSelector {
|
||||
/** Specifies the width of the scale's ticks (both major and minor ticks). */
|
||||
width?: number;
|
||||
};
|
||||
/** Specifies options of the range selector's minor ticks. */
|
||||
minorTick?: {
|
||||
/** Specifies the color of the scale's minor ticks. */
|
||||
color?: string;
|
||||
/** Specifies the opacity of the scale's minor ticks. */
|
||||
opacity?: number;
|
||||
/** Specifies the width of the scale's minor ticks. */
|
||||
width?: number;
|
||||
/** Indicates whether scale minor ticks are visible or not. */
|
||||
visible?: boolean;
|
||||
};
|
||||
/** Specifies the type of the scale. */
|
||||
@@ -6454,8 +6512,8 @@ declare module DevExpress.viz.rangeSelector {
|
||||
useTicksAutoArrangement?: boolean;
|
||||
/** Specifies the type of values on the scale. */
|
||||
valueType?: string;
|
||||
/** Specifies the order of arguments on a discrete scale. */
|
||||
categories?: Array<any>;
|
||||
/** Specifies the order of arguments on a discrete scale. */
|
||||
categories?: Array<any>;
|
||||
};
|
||||
/** Specifies the range to be selected when displaying the dxRangeSelector. */
|
||||
selectedRange?: {
|
||||
@@ -6692,7 +6750,7 @@ declare module DevExpress.viz.map {
|
||||
elementType?: string;
|
||||
/** Specifies a data source for the layer. */
|
||||
data?: any;
|
||||
/** Specifies the width of the layer elements border in pixels. */
|
||||
/** Specifies the line width (for layers of a line type) or width of the layer elements border in pixels. */
|
||||
borderWidth?: number;
|
||||
/** Specifies a color for the border of the layer elements. */
|
||||
borderColor?: string;
|
||||
@@ -6700,11 +6758,11 @@ declare module DevExpress.viz.map {
|
||||
color?: string;
|
||||
/** Specifies a color for the border of the layer element when it is hovered over. */
|
||||
hoveredBorderColor?: string;
|
||||
/** Specifies the pixel-measured width for the border of the layer element when it is hovered over. */
|
||||
/** Specifies the pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is hovered over. */
|
||||
hoveredBorderWidth?: number;
|
||||
/** Specifies a color for a layer element when it is hovered over. */
|
||||
hoveredColor?: string;
|
||||
/** Specifies a pixel-measured width for the border of the layer element when it is selected. */
|
||||
/** Specifies a pixel-measured line width (for layers of a line type) or width for the border of the layer element when it is selected. */
|
||||
selectedBorderWidth?: number;
|
||||
/** Specifies a color for the border of the layer element when it is selected. */
|
||||
selectedBorderColor?: string;
|
||||
@@ -7050,9 +7108,9 @@ declare module DevExpress.viz.map {
|
||||
center?: Array<number>;
|
||||
/** A handler for the centerChanged event. */
|
||||
onCenterChanged?: (e: {
|
||||
center: Array<number>;
|
||||
component: dxVectorMap;
|
||||
element: Element;
|
||||
center: Array<number>;
|
||||
component: dxVectorMap;
|
||||
element: Element;
|
||||
}) => void;
|
||||
/** A handler for the tooltipShown event. */
|
||||
onTooltipShown?: (e: {
|
||||
|
||||
Vendored
+10
-10
@@ -3,13 +3,13 @@
|
||||
// Definitions by: François de Campredon <https://github.com/fdecampredon/>, vvakame <https://github.com/vvakame>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Thenable<R> {
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
|
||||
interface Thenable<T> {
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
|
||||
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
|
||||
}
|
||||
|
||||
declare class Promise<R> implements Thenable<R> {
|
||||
declare class Promise<T> implements Thenable<T> {
|
||||
/**
|
||||
* If you call resolve in the body of the callback passed to the constructor,
|
||||
* your promise is fulfilled with result object passed to resolve.
|
||||
@@ -17,7 +17,7 @@ declare class Promise<R> implements Thenable<R> {
|
||||
* For consistency and debugging (eg stack traces), obj should be an instanceof Error.
|
||||
* Any errors thrown in the constructor callback will be implicitly passed to reject().
|
||||
*/
|
||||
constructor(callback: (resolve : (value?: R | Thenable<R>) => void, reject: (error?: any) => void) => void);
|
||||
constructor(callback: (resolve : (value?: T | Thenable<T>) => void, reject: (error?: any) => void) => void);
|
||||
|
||||
/**
|
||||
* onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
|
||||
@@ -29,8 +29,8 @@ declare class Promise<R> implements Thenable<R> {
|
||||
* @param onFulfilled called when/if "promise" resolves
|
||||
* @param onRejected called when/if "promise" rejects
|
||||
*/
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
|
||||
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
|
||||
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
|
||||
|
||||
/**
|
||||
* Sugar for promise.then(undefined, onRejected)
|
||||
@@ -45,7 +45,7 @@ declare module Promise {
|
||||
* Make a new promise from the thenable.
|
||||
* A thenable is promise-like in as far as it has a "then" method.
|
||||
*/
|
||||
function resolve<R>(value?: R | Thenable<R>): Promise<R>;
|
||||
function resolve<T>(value?: T | Thenable<T>): Promise<T>;
|
||||
|
||||
/**
|
||||
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
|
||||
@@ -57,12 +57,12 @@ declare module Promise {
|
||||
* the array passed to all can be a mixture of promise-like objects and other objects.
|
||||
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
|
||||
*/
|
||||
function all<R>(promises: (R | Thenable<R>)[]): Promise<R[]>;
|
||||
function all<T>(promises: (T | Thenable<T>)[]): Promise<T[]>;
|
||||
|
||||
/**
|
||||
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
|
||||
*/
|
||||
function race<R>(promises: (R | Thenable<R>)[]): Promise<R>;
|
||||
function race<T>(promises: (T | Thenable<T>)[]): Promise<T>;
|
||||
}
|
||||
|
||||
declare module 'es6-promise' {
|
||||
|
||||
@@ -17,6 +17,12 @@ app.use(function(req, res, next){
|
||||
next();
|
||||
});
|
||||
|
||||
app.use(function(err: any, req: express.Request, res: express.Response, next: express.NextFunction) {
|
||||
console.error(err);
|
||||
next(err);
|
||||
});
|
||||
|
||||
|
||||
app.get('/', function(req, res){
|
||||
res.send('hello world');
|
||||
});
|
||||
@@ -47,6 +53,13 @@ router.route('/users')
|
||||
res.send(req.query['token']);
|
||||
});
|
||||
|
||||
router.get('/user/:id', function(req, res, next) {
|
||||
if (req.params.id == 0) next('route');
|
||||
else next();
|
||||
}, function(req, res, next) {
|
||||
res.render('regular');
|
||||
});
|
||||
|
||||
app.use((req, res, next) => {
|
||||
// hacky trick, router is just a handler
|
||||
router(req, res, next);
|
||||
|
||||
Vendored
+10
-5
@@ -407,9 +407,9 @@ declare module "express" {
|
||||
originalUrl: string;
|
||||
|
||||
url: string;
|
||||
|
||||
|
||||
baseUrl: string;
|
||||
|
||||
|
||||
app: Application;
|
||||
}
|
||||
|
||||
@@ -796,18 +796,23 @@ declare module "express" {
|
||||
charset: string;
|
||||
}
|
||||
|
||||
interface NextFunction {
|
||||
(): void;
|
||||
(err: any): void;
|
||||
}
|
||||
|
||||
interface ErrorRequestHandler {
|
||||
(err: any, req: Request, res: Response, next: Function): any;
|
||||
(err: any, req: Request, res: Response, next: NextFunction): any;
|
||||
}
|
||||
|
||||
interface RequestHandler {
|
||||
(req: Request, res: Response, next: Function): any;
|
||||
(req: Request, res: Response, next: NextFunction): any;
|
||||
}
|
||||
|
||||
interface Handler extends RequestHandler {}
|
||||
|
||||
interface RequestParamHandler {
|
||||
(req: Request, res: Response, next: Function, param: any): any;
|
||||
(req: Request, res: Response, next: NextFunction, param: any): any;
|
||||
}
|
||||
|
||||
interface Application extends IRouter<Application>, Express.Application {
|
||||
|
||||
@@ -75,10 +75,10 @@ fs.outputJSON(file, data, errorCallback);
|
||||
fs.outputJsonSync(file, data);
|
||||
fs.outputJSONSync(file, data);
|
||||
|
||||
fs.readJson(file, errorCallback);
|
||||
fs.readJson(file, openOpts, errorCallback);
|
||||
fs.readJSON(file, errorCallback);
|
||||
fs.readJSON(file, openOpts, errorCallback);
|
||||
fs.readJson(file, (error: Error, jsonObject: any) => {});
|
||||
fs.readJson(file, openOpts, (error: Error, jsonObject: any) => {});
|
||||
fs.readJSON(file, (error: Error, jsonObject: any) => {});
|
||||
fs.readJSON(file, openOpts, (error: Error, jsonObject: any) => {});
|
||||
|
||||
fs.readJsonSync(file, openOpts);
|
||||
fs.readJSONSync(file, openOpts);
|
||||
|
||||
Vendored
+4
-4
@@ -65,10 +65,10 @@ declare module "fs-extra" {
|
||||
export function outputJsonSync(file: string, data: any): void;
|
||||
export function outputJSONSync(file: string, data: any): void;
|
||||
|
||||
export function readJson(file: string, callback?: (err: Error) => void): void;
|
||||
export function readJson(file: string, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
export function readJSON(file: string, callback?: (err: Error) => void): void;
|
||||
export function readJSON(file: string, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
export function readJson(file: string, callback: (err: Error, jsonObject: any) => void): void;
|
||||
export function readJson(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void;
|
||||
export function readJSON(file: string, callback: (err: Error, jsonObject: any) => void): void;
|
||||
export function readJSON(file: string, options: OpenOptions, callback: (err: Error, jsonObject: any) => void): void;
|
||||
|
||||
export function readJsonSync(file: string, options?: OpenOptions): any;
|
||||
export function readJSONSync(file: string, options?: OpenOptions): any;
|
||||
|
||||
Vendored
+22
-16
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Electron v0.35.0
|
||||
// Type definitions for Electron v0.36.3
|
||||
// Project: http://electron.atom.io/
|
||||
// Definitions by: jedmao <https://github.com/jedmao/>, rhysd <https://rhysd.github.io>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -51,6 +51,10 @@ declare module Electron {
|
||||
* Marks the image as template image.
|
||||
*/
|
||||
setTemplateImage(option: boolean): void;
|
||||
/**
|
||||
* Returns a boolean whether the image is a template image.
|
||||
*/
|
||||
isTemplateImage(): boolean;
|
||||
}
|
||||
|
||||
module Clipboard {
|
||||
@@ -479,6 +483,7 @@ declare module Electron {
|
||||
interface WebPreferences {
|
||||
nodeIntegration?: boolean;
|
||||
preload?: string;
|
||||
session?: Session;
|
||||
partition?: string;
|
||||
zoomFactor?: number;
|
||||
javascript?: boolean;
|
||||
@@ -492,16 +497,11 @@ declare module Electron {
|
||||
plugins?: boolean;
|
||||
experimentalFeatures?: boolean;
|
||||
experimentalCanvasFeatures?: boolean;
|
||||
overlayScrollbars?: boolean;
|
||||
sharedWorker?: boolean;
|
||||
directWrite?: boolean;
|
||||
pageVisibility?: boolean;
|
||||
blinkFeatures?: string;
|
||||
}
|
||||
|
||||
// Includes all options BrowserWindow can take as of this writing
|
||||
// http://electron.atom.io/docs/v0.29.0/api/browser-window/
|
||||
interface BrowserWindowOptions extends Rectangle {
|
||||
show?: boolean;
|
||||
useContentSize?: boolean;
|
||||
center?: boolean;
|
||||
minWidth?: number;
|
||||
@@ -512,28 +512,22 @@ declare module Electron {
|
||||
alwaysOnTop?: boolean;
|
||||
fullscreen?: boolean;
|
||||
skipTaskbar?: boolean;
|
||||
zoomFactor?: number;
|
||||
kiosk?: boolean;
|
||||
title?: string;
|
||||
icon?: NativeImage|string;
|
||||
show?: boolean;
|
||||
frame?: boolean;
|
||||
acceptFirstMouse?: boolean;
|
||||
disableAutoHideCursor?: boolean;
|
||||
autoHideMenuBar?: boolean;
|
||||
enableLargerThanScreen?: boolean;
|
||||
backgroundColor?: string;
|
||||
darkTheme?: boolean;
|
||||
preload?: string;
|
||||
transparent?: boolean;
|
||||
type?: string;
|
||||
standardWindow?: boolean;
|
||||
webPreferences?: WebPreferences;
|
||||
java?: boolean;
|
||||
textAreasAreResizable?: boolean;
|
||||
extraPluginDirs?: string[];
|
||||
subpixelFontScaling?: boolean;
|
||||
overlayFullscreenVideo?: boolean;
|
||||
titleBarStyle?: string;
|
||||
backgroundColor?: string;
|
||||
webPreferences?: WebPreferences;
|
||||
}
|
||||
|
||||
interface Rectangle {
|
||||
@@ -1584,6 +1578,17 @@ declare module Electron {
|
||||
* corrupted by active network attackers.
|
||||
*/
|
||||
registerURLSchemeAsSecure(scheme: string): void;
|
||||
/**
|
||||
* Inserts text to the focused element.
|
||||
*/
|
||||
insertText(text: string): void;
|
||||
/**
|
||||
* Evaluates `code` in page.
|
||||
* In the browser window some HTML APIs like `requestFullScreen` can only be
|
||||
* invoked by a gesture from the user. Setting `userGesture` to `true` will remove
|
||||
* this limitation.
|
||||
*/
|
||||
executeJavaScript(code: string, userGesture?: boolean): void;
|
||||
}
|
||||
|
||||
// Type definitions for main process
|
||||
@@ -1806,6 +1811,7 @@ declare module Electron {
|
||||
clearCache(callback: Function): void;
|
||||
clearStorageData(callback: Function): void;
|
||||
clearStorageData(options: ClearStorageDataOptions, callback: Function): void;
|
||||
flushStorageData(): void;
|
||||
setProxy(config: string, callback: Function): void;
|
||||
resolveProxy(url: URL, callback: (proxy: any) => any): void;
|
||||
setDownloadPath(path: string): void;
|
||||
|
||||
Vendored
+13
@@ -6285,3 +6285,16 @@ interface JQuery {
|
||||
**/
|
||||
highcharts(options: HighchartsOptions, callback: (chart: HighchartsChartObject) => void): JQuery;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enabling the usage of ES6 module loading.
|
||||
*/
|
||||
declare var Highcharts: HighchartsStatic;
|
||||
|
||||
/**
|
||||
* Declaration for ES6 module loading.
|
||||
*/
|
||||
declare module "highcharts" {
|
||||
export = Highcharts;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -79,7 +79,7 @@ declare class IScroll {
|
||||
scrollTo(x: number, y: number, time?: number, relative?: boolean): void;
|
||||
scrollToElement(element: string, time?: number): void;
|
||||
scrollToElement(element: HTMLElement, time?: number): void;
|
||||
scrollToPage(pageX: number, pageY: number, time?: number): void;
|
||||
goToPage(pageX: number, pageY: number, time?: number): void;
|
||||
disable(): void;
|
||||
enable(): void;
|
||||
stop(): void;
|
||||
|
||||
Vendored
+2
-2
@@ -423,11 +423,11 @@ declare module jasmine {
|
||||
/** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */
|
||||
callThrough(): Spy;
|
||||
/** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */
|
||||
returnValue(val: any): void;
|
||||
returnValue(val: any): Spy;
|
||||
/** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */
|
||||
callFake(fn: Function): Spy;
|
||||
/** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */
|
||||
throwError(msg: string): void;
|
||||
throwError(msg: string): Spy;
|
||||
/** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */
|
||||
stub(): Spy;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
///<reference path="js-schema.d.ts" />
|
||||
|
||||
import {default as schema} from 'js-schema';
|
||||
|
||||
var Duck = schema({ // A duck
|
||||
swim : Function, // - can swim
|
||||
quack : Function, // - can quack
|
||||
age : Number.min(0).max(5), // - is 0 to 5 years old
|
||||
color : ['yellow', 'brown'] // - has either yellow or brown color
|
||||
});
|
||||
|
||||
// Some animals
|
||||
var myDuck = { swim : function() {}, quack : function() {}, age : 2, color : 'yellow' },
|
||||
myCat = { walk : function() {}, purr : function() {}, age : 3, color : 'black' },
|
||||
animals = [ myDuck, myCat, {}, /*...*/ ];
|
||||
|
||||
// Simple checks
|
||||
console.log( Duck(myDuck) ); // true
|
||||
console.log( Duck(myCat) ); // false
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
// Type definitions for js-schema
|
||||
// Project: https://github.com/molnarg/js-schema
|
||||
// Definitions by: Marcin Porebski <https://github.com/marcinporebski>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
declare module 'js-schema'
|
||||
{
|
||||
export interface Schema
|
||||
{
|
||||
(obj: any): boolean; // test obj against the schema
|
||||
}
|
||||
|
||||
export default function schema(definition: any): Schema
|
||||
}
|
||||
|
||||
interface NumberConstructor
|
||||
{
|
||||
min(n: number): NumberConstructor;
|
||||
max(n: number): NumberConstructor;
|
||||
below(n: number): NumberConstructor;
|
||||
above(n: number): NumberConstructor;
|
||||
step(n: number): NumberConstructor;
|
||||
}
|
||||
|
||||
interface StringConstructor
|
||||
{
|
||||
of(charset: string): StringConstructor;
|
||||
of(length: number, charset: string): StringConstructor;
|
||||
of(minLength: number, maxLength: number, charset: string): StringConstructor;
|
||||
}
|
||||
|
||||
interface ArrayConstructor
|
||||
{
|
||||
like(arr: Array<any>): ArrayConstructor;
|
||||
of(pattern: any): ArrayConstructor;
|
||||
of(length: number, pattern: any): ArrayConstructor;
|
||||
of(minLength: number, maxLength: number, pattern: any): ArrayConstructor;
|
||||
}
|
||||
|
||||
interface ObjectConstructor
|
||||
{
|
||||
like(obj: any): ObjectConstructor;
|
||||
reference(obj: any): ObjectConstructor;
|
||||
}
|
||||
|
||||
interface FunctionConstructor
|
||||
{
|
||||
reference(func: Function): FunctionConstructor;
|
||||
}
|
||||
@@ -3,12 +3,31 @@
|
||||
import yaml = require('js-yaml');
|
||||
import LoadOptions = yaml.LoadOptions;
|
||||
import DumpOptions = yaml.DumpOptions;
|
||||
import TypeConstructorOptions = yaml.TypeConstructorOptions;
|
||||
import SchemaDefinition = yaml.SchemaDefinition;
|
||||
|
||||
var bool: boolean;
|
||||
var num: number;
|
||||
var str: string;
|
||||
var obj: Object;
|
||||
var value: any;
|
||||
var array: any[];
|
||||
var fn: Function;
|
||||
var schemaDefinition: SchemaDefinition = {
|
||||
implicit: array,
|
||||
explicit: array,
|
||||
include: array
|
||||
};
|
||||
var typeConstructorOptions: TypeConstructorOptions = {
|
||||
kind: str,
|
||||
resolve: fn,
|
||||
construct: fn,
|
||||
instanceOf: obj,
|
||||
predicate: str,
|
||||
represent: fn,
|
||||
defaultStyle: str,
|
||||
styleAliases: obj
|
||||
};
|
||||
|
||||
var loadOpts: LoadOptions;
|
||||
var dumpOpts: DumpOptions;
|
||||
@@ -20,6 +39,8 @@ yaml.JSON_SCHEMA;
|
||||
yaml.CORE_SCHEMA;
|
||||
yaml.DEFAULT_SAFE_SCHEMA;
|
||||
yaml.DEFAULT_FULL_SCHEMA;
|
||||
yaml.MINIMAL_SCHEMA;
|
||||
yaml.SAFE_SCHEMA;
|
||||
|
||||
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
@@ -82,3 +103,7 @@ value = yaml.safeDump(str, dumpOpts);
|
||||
|
||||
value = yaml.dump(str);
|
||||
value = yaml.dump(str, dumpOpts);
|
||||
|
||||
value = new yaml.YAMLException();
|
||||
value = new yaml.Type(str, typeConstructorOptions);
|
||||
value = yaml.Schema.create([schemaDefinition]);
|
||||
|
||||
Vendored
+38
-5
@@ -1,17 +1,26 @@
|
||||
// Type definitions for js-yaml 3.0.2
|
||||
// Type definitions for js-yaml 3.5.2
|
||||
// Project: https://github.com/nodeca/js-yaml
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Sebastian Clausen <https://github.com/sclausen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module jsyaml {
|
||||
export function safeLoad(str: string, opts?: LoadOptions): any;
|
||||
export function load(str: string, opts?: LoadOptions): any;
|
||||
|
||||
export class Type implements TypeConstructorOptions {
|
||||
constructor(tag: string, opts?: TypeConstructorOptions);
|
||||
tag: string;
|
||||
}
|
||||
export class Schema {
|
||||
constructor(definition: SchemaDefinition);
|
||||
public static create(args: any[]): Schema;
|
||||
}
|
||||
|
||||
export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
|
||||
export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): any;
|
||||
|
||||
export function safeDump(obj: any, opts?: DumpOptions): string;
|
||||
export function dump(obj: any, opts?: DumpOptions): string
|
||||
export function dump(obj: any, opts?: DumpOptions): string;
|
||||
|
||||
export interface LoadOptions {
|
||||
// string to be used as a file path in error/warning messages.
|
||||
@@ -29,12 +38,29 @@ declare module jsyaml {
|
||||
skipInvalid?: boolean;
|
||||
// specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere
|
||||
flowLevel?: number;
|
||||
// Each tag may have own set of styles. - "tag" => "style" map.
|
||||
// Each tag may have own set of styles. - "tag" => "style" map.
|
||||
styles?: Object;
|
||||
// specifies a schema to use.
|
||||
schema?: any;
|
||||
}
|
||||
|
||||
export interface TypeConstructorOptions {
|
||||
kind?: string;
|
||||
resolve?: Function;
|
||||
construct?: Function;
|
||||
instanceOf?: Object;
|
||||
predicate?: string;
|
||||
represent?: Function;
|
||||
defaultStyle?: string;
|
||||
styleAliases?: Object;
|
||||
}
|
||||
|
||||
export interface SchemaDefinition {
|
||||
implicit?: any[];
|
||||
explicit?: any[];
|
||||
include?: any[];
|
||||
}
|
||||
|
||||
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
export var FAILSAFE_SCHEMA: any;
|
||||
// only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346
|
||||
@@ -45,6 +71,13 @@ declare module jsyaml {
|
||||
export var DEFAULT_SAFE_SCHEMA: any;
|
||||
// all supported YAML types.
|
||||
export var DEFAULT_FULL_SCHEMA: any;
|
||||
export var MINIMAL_SCHEMA: any;
|
||||
export var SAFE_SCHEMA: any;
|
||||
|
||||
export class YAMLException extends Error {
|
||||
constructor(reason?: any, mark?: any);
|
||||
toString(compact?: boolean): string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'js-yaml' {
|
||||
|
||||
Vendored
+18
-4
@@ -301,7 +301,7 @@ declare module kendo {
|
||||
|
||||
class Layout extends View {
|
||||
containers: { [selector: string]: ViewContainer; };
|
||||
showIn(selector: string, view: View): void;
|
||||
showIn(selector: string, view: View, transitionClass?: string): void;
|
||||
}
|
||||
|
||||
class History extends Observable {
|
||||
@@ -316,9 +316,13 @@ declare module kendo {
|
||||
var history: History;
|
||||
|
||||
interface RouterOptions {
|
||||
init?: (e: RouterEvent) => void;
|
||||
routeMissing?: (e: RouterEvent) => void;
|
||||
change?: (e: RouterEvent) => void;
|
||||
pushState?: boolean;
|
||||
hashBang?: boolean;
|
||||
root?: string;
|
||||
ignoreCase?: boolean;
|
||||
change?(e: RouterChangeEvent): void;
|
||||
routeMissing?(e: RouterRouteMissingEvent): void;
|
||||
same?(e: RouterEvent): void;
|
||||
}
|
||||
|
||||
interface RouterEvent {
|
||||
@@ -327,6 +331,15 @@ declare module kendo {
|
||||
preventDefault: Function;
|
||||
isDefaultPrevented(): boolean;
|
||||
}
|
||||
|
||||
interface RouterChangeEvent extends RouterEvent {
|
||||
params: any;
|
||||
backButtonPressed: boolean;
|
||||
}
|
||||
|
||||
interface RouterRouteMissingEvent extends RouterEvent {
|
||||
params: any;
|
||||
}
|
||||
|
||||
class Route extends Class {
|
||||
route: RegExp;
|
||||
@@ -932,6 +945,7 @@ declare module kendo.data {
|
||||
interface DataSourceSchemaModel {
|
||||
id?: string;
|
||||
fields?: any;
|
||||
[index: string]: any;
|
||||
}
|
||||
|
||||
interface DataSourceSchemaModelWithFieldsArray extends DataSourceSchemaModel {
|
||||
|
||||
@@ -15,6 +15,7 @@ var createOptions = {
|
||||
var updateOptions = {
|
||||
data: inputData,
|
||||
parent: parent,
|
||||
target: inputModel,
|
||||
observable: ko.observable(7)
|
||||
}
|
||||
|
||||
@@ -49,6 +50,18 @@ mapping.fromJSON(inputJSON);
|
||||
mapping.fromJSON(inputJSON, targetOptions);
|
||||
mapping.fromJSON(inputJSON, inputOptions, inputModel);
|
||||
|
||||
mapping.fromJS(inputJSON, {
|
||||
fieldNeedingCustomOptions: {
|
||||
key: (data: any) => data.id,
|
||||
create: (options: KnockoutMappingCreateOptions) => {
|
||||
return mapping.fromJS(options.data);
|
||||
},
|
||||
update: (options: KnockoutMappingUpdateOptions) => {
|
||||
return mapping.fromJS(options.data, options.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// toJS function
|
||||
mapping.toJS(inputModel);
|
||||
mapping.toJS(inputModel, mappingOptions);
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@ interface KnockoutMappingCreateOptions {
|
||||
interface KnockoutMappingUpdateOptions {
|
||||
data: any;
|
||||
parent: any;
|
||||
observable: KnockoutObservable<any>;
|
||||
target: any;
|
||||
observable?: KnockoutObservable<any>;
|
||||
}
|
||||
|
||||
interface KnockoutMappingOptions {
|
||||
|
||||
Vendored
+10
-17
@@ -41,7 +41,7 @@ declare module L {
|
||||
export function bounds(points: Point[]): Bounds;
|
||||
|
||||
|
||||
export interface BoundsStatic extends ClassStatic {
|
||||
export interface BoundsStatic {
|
||||
/**
|
||||
* Creates a Bounds object from two coordinates (usually top-left and bottom-right
|
||||
* corners).
|
||||
@@ -513,7 +513,7 @@ declare module L {
|
||||
/**
|
||||
* Creates a control with the given options.
|
||||
*/
|
||||
function (options?: ControlOptions): Control;
|
||||
(options?: ControlOptions): Control;
|
||||
}
|
||||
|
||||
export namespace control {
|
||||
@@ -805,13 +805,6 @@ declare namespace L {
|
||||
}
|
||||
|
||||
declare namespace L {
|
||||
|
||||
/**
|
||||
* Creates a Draggable object for moving the given element when you start dragging
|
||||
* the dragHandle element (equals the element itself by default).
|
||||
*/
|
||||
function draggable(element: HTMLElement, dragHandle?: HTMLElement): Draggable;
|
||||
|
||||
export interface DraggableStatic extends ClassStatic {
|
||||
/**
|
||||
* Creates a Draggable object for moving the given element when you start dragging
|
||||
@@ -1453,7 +1446,7 @@ declare namespace L {
|
||||
*/
|
||||
function latLng(coords: LatLngExpression): LatLng;
|
||||
|
||||
export interface LatLngStatic extends ClassStatic {
|
||||
export interface LatLngStatic {
|
||||
/**
|
||||
* Creates an object representing a geographical point with the given latitude
|
||||
* and longitude.
|
||||
@@ -1539,7 +1532,7 @@ declare namespace L {
|
||||
*/
|
||||
function latLngBounds(latlngs: LatLngBoundsExpression): LatLngBounds;
|
||||
|
||||
export interface LatLngBoundsStatic extends ClassStatic {
|
||||
export interface LatLngBoundsStatic {
|
||||
/**
|
||||
* Creates a LatLngBounds object by defining south-west and north-east corners
|
||||
* of the rectangle.
|
||||
@@ -2442,7 +2435,7 @@ declare namespace L {
|
||||
options: Map.MapOptions;
|
||||
|
||||
/**
|
||||
* Iterates over the layers of the map, optionally specifying context
|
||||
* Iterates over the layers of the map, optionally specifying context
|
||||
* of the iterator function.
|
||||
*/
|
||||
eachLayer(fn: (layer: ILayer) => void, context?: any): Map;
|
||||
@@ -3058,7 +3051,7 @@ declare namespace L {
|
||||
*/
|
||||
function multiPolygon(latlngs: LatLng[][], options?: PolylineOptions): MultiPolygon;
|
||||
|
||||
export interface MultiPolylgonStatic extends ClassStatic {
|
||||
export interface MultiPolygonStatic extends ClassStatic {
|
||||
/**
|
||||
* Instantiates a multi-polyline object given an array of latlngs arrays (one
|
||||
* for each individual polygon) and optionally an options object (the same
|
||||
@@ -3066,7 +3059,7 @@ declare namespace L {
|
||||
*/
|
||||
new(latlngs: LatLng[][], options?: PolylineOptions): MultiPolygon;
|
||||
}
|
||||
export var MultiPolylgon: MultiPolylgonStatic;
|
||||
export var MultiPolygon: MultiPolygonStatic;
|
||||
|
||||
export interface MultiPolygon extends FeatureGroup<Polygon> {
|
||||
/**
|
||||
@@ -3401,7 +3394,7 @@ declare namespace L {
|
||||
*/
|
||||
function point(x: number, y: number, round?: boolean): Point;
|
||||
|
||||
export interface PointStatic extends ClassStatic {
|
||||
export interface PointStatic {
|
||||
/**
|
||||
* Creates a Point object with the given x and y coordinates. If optional round
|
||||
* is set to true, rounds the x and y values.
|
||||
@@ -4182,7 +4175,7 @@ declare namespace L {
|
||||
* When this option is set, the TileLayer only loads tiles that are in the given geographical bounds.
|
||||
*/
|
||||
bounds?: LatLngBounds;
|
||||
|
||||
|
||||
/**
|
||||
* Custom keys may be specified in TileLayerOptions so they can be used in a provided URL template.
|
||||
*/
|
||||
@@ -4191,7 +4184,7 @@ declare namespace L {
|
||||
}
|
||||
|
||||
declare namespace L {
|
||||
export interface TransformationStatic extends ClassStatic {
|
||||
export interface TransformationStatic {
|
||||
/**
|
||||
* Creates a transformation object with the given coefficients.
|
||||
*/
|
||||
|
||||
+370
-142
@@ -1934,6 +1934,169 @@ module TestUnion {
|
||||
}
|
||||
}
|
||||
|
||||
// _.unionBy
|
||||
namespace TestUnionBy {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let iteratee: (value: TResult) => any;
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.unionBy<TResult>(array, array);
|
||||
result = _.unionBy<TResult>(array, list, array);
|
||||
result = _.unionBy<TResult>(array, array, list, array);
|
||||
result = _.unionBy<TResult>(array, list, array, list, array);
|
||||
result = _.unionBy<TResult>(array, array, list, array, list, array);
|
||||
|
||||
result = _.unionBy<TResult>(array, array, iteratee);
|
||||
result = _.unionBy<TResult>(array, list, array, iteratee);
|
||||
result = _.unionBy<TResult>(array, array, list, array, iteratee);
|
||||
result = _.unionBy<TResult>(array, list, array, list, array, iteratee);
|
||||
result = _.unionBy<TResult>(array, array, list, array, list, array, iteratee);
|
||||
|
||||
result = _.unionBy<TResult>(array, array, 'a');
|
||||
result = _.unionBy<TResult>(array, list, array, 'a');
|
||||
result = _.unionBy<TResult>(array, array, list, array, 'a');
|
||||
result = _.unionBy<TResult>(array, list, array, list, array, 'a');
|
||||
result = _.unionBy<TResult>(array, array, list, array, list, array, 'a');
|
||||
|
||||
result = _.unionBy<TResult, {a: number}>(array, array, {a: 1});
|
||||
result = _.unionBy<TResult, {a: number}>(array, list, array, {a: 1});
|
||||
result = _.unionBy<TResult, {a: number}>(array, array, list, array, {a: 1});
|
||||
result = _.unionBy<TResult, {a: number}>(array, list, array, list, array, {a: 1});
|
||||
result = _.unionBy<TResult>(array, list, array, list, array, list, {a: 1});
|
||||
|
||||
result = _.unionBy<TResult>(list, list);
|
||||
result = _.unionBy<TResult>(list, array, list);
|
||||
result = _.unionBy<TResult>(list, list, array, list);
|
||||
result = _.unionBy<TResult>(list, array, list, array, list);
|
||||
result = _.unionBy<TResult>(list, list, array, list, array, list);
|
||||
|
||||
result = _.unionBy<TResult>(list, list, iteratee);
|
||||
result = _.unionBy<TResult>(list, array, list, iteratee);
|
||||
result = _.unionBy<TResult>(list, list, array, list, iteratee);
|
||||
result = _.unionBy<TResult>(list, array, list, array, list, iteratee);
|
||||
result = _.unionBy<TResult>(list, list, array, list, array, list, iteratee);
|
||||
|
||||
result = _.unionBy<TResult>(list, list, 'a');
|
||||
result = _.unionBy<TResult>(list, array, list, 'a');
|
||||
result = _.unionBy<TResult>(list, list, array, list, 'a');
|
||||
result = _.unionBy<TResult>(list, array, list, array, list, 'a');
|
||||
result = _.unionBy<TResult>(list, list, array, list, array, list, 'a');
|
||||
|
||||
result = _.unionBy<TResult, {a: number}>(list, list, {a: 1});
|
||||
result = _.unionBy<TResult, {a: number}>(list, array, list, {a: 1});
|
||||
result = _.unionBy<TResult, {a: number}>(list, list, array, list, {a: 1});
|
||||
result = _.unionBy<TResult, {a: number}>(list, array, list, array, list, {a: 1});
|
||||
result = _.unionBy<TResult>(list, array, list, array, list, array, {a: 1});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).unionBy<TResult>(array);
|
||||
result = _(array).unionBy<TResult>(list, array);
|
||||
result = _(array).unionBy<TResult>(array, list, array);
|
||||
result = _(array).unionBy<TResult>(list, array, list, array);
|
||||
result = _(array).unionBy<TResult>(array, list, array, list, array);
|
||||
|
||||
result = _(array).unionBy<TResult>(array, iteratee);
|
||||
result = _(array).unionBy<TResult>(list, array, iteratee);
|
||||
result = _(array).unionBy<TResult>(array, list, array, iteratee);
|
||||
result = _(array).unionBy<TResult>(list, array, list, array, iteratee);
|
||||
result = _(array).unionBy<TResult>(array, list, array, list, array, iteratee);
|
||||
|
||||
result = _(array).unionBy<TResult>(array, 'a');
|
||||
result = _(array).unionBy<TResult>(list, array, 'a');
|
||||
result = _(array).unionBy<TResult>(array, list, array, 'a');
|
||||
result = _(array).unionBy<TResult>(list, array, list, array, 'a');
|
||||
result = _(array).unionBy<TResult>(array, list, array, list, array, 'a');
|
||||
|
||||
result = _(array).unionBy<TResult, {a: number}>(array, {a: 1});
|
||||
result = _(array).unionBy<TResult, {a: number}>(list, array, {a: 1});
|
||||
result = _(array).unionBy<TResult, {a: number}>(array, list, array, {a: 1});
|
||||
result = _(array).unionBy<TResult, {a: number}>(list, array, list, array, {a: 1});
|
||||
result = _(array).unionBy<TResult>(list, array, list, array, list, {a: 1});
|
||||
|
||||
result = _(list).unionBy<TResult>(list);
|
||||
result = _(list).unionBy<TResult>(array, list);
|
||||
result = _(list).unionBy<TResult>(list, array, list);
|
||||
result = _(list).unionBy<TResult>(array, list, array, list);
|
||||
result = _(list).unionBy<TResult>(list, array, list, array, list);
|
||||
|
||||
result = _(list).unionBy<TResult>(list, iteratee);
|
||||
result = _(list).unionBy<TResult>(array, list, iteratee);
|
||||
result = _(list).unionBy<TResult>(list, array, list, iteratee);
|
||||
result = _(list).unionBy<TResult>(array, list, array, list, iteratee);
|
||||
result = _(list).unionBy<TResult>(list, array, list, array, list, iteratee);
|
||||
|
||||
result = _(list).unionBy<TResult>(list, 'a');
|
||||
result = _(list).unionBy<TResult>(array, list, 'a');
|
||||
result = _(list).unionBy<TResult>(list, array, list, 'a');
|
||||
result = _(list).unionBy<TResult>(array, list, array, list, 'a');
|
||||
result = _(list).unionBy<TResult>(list, array, list, array, list, 'a');
|
||||
|
||||
result = _(list).unionBy<TResult, {a: number}>(list, {a: 1});
|
||||
result = _(list).unionBy<TResult, {a: number}>(array, list, {a: 1});
|
||||
result = _(list).unionBy<TResult, {a: number}>(list, array, list, {a: 1});
|
||||
result = _(list).unionBy<TResult, {a: number}>(array, list, array, list, {a: 1});
|
||||
result = _(list).unionBy<TResult>(array, list, array, list, array, {a: 1});
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).chain().unionBy<TResult>(array);
|
||||
result = _(array).chain().unionBy<TResult>(list, array);
|
||||
result = _(array).chain().unionBy<TResult>(array, list, array);
|
||||
result = _(array).chain().unionBy<TResult>(list, array, list, array);
|
||||
result = _(array).chain().unionBy<TResult>(array, list, array, list, array);
|
||||
|
||||
result = _(array).chain().unionBy<TResult>(array, iteratee);
|
||||
result = _(array).chain().unionBy<TResult>(list, array, iteratee);
|
||||
result = _(array).chain().unionBy<TResult>(array, list, array, iteratee);
|
||||
result = _(array).chain().unionBy<TResult>(list, array, list, array, iteratee);
|
||||
result = _(array).chain().unionBy<TResult>(array, list, array, list, array, iteratee);
|
||||
|
||||
result = _(array).chain().unionBy<TResult>(array, 'a');
|
||||
result = _(array).chain().unionBy<TResult>(list, array, 'a');
|
||||
result = _(array).chain().unionBy<TResult>(array, list, array, 'a');
|
||||
result = _(array).chain().unionBy<TResult>(list, array, list, array, 'a');
|
||||
result = _(array).chain().unionBy<TResult>(array, list, array, list, array, 'a');
|
||||
|
||||
result = _(array).chain().unionBy<TResult, {a: number}>(array, {a: 1});
|
||||
result = _(array).chain().unionBy<TResult, {a: number}>(list, array, {a: 1});
|
||||
result = _(array).chain().unionBy<TResult, {a: number}>(array, list, array, {a: 1});
|
||||
result = _(array).chain().unionBy<TResult, {a: number}>(list, array, list, array, {a: 1});
|
||||
result = _(array).chain().unionBy<TResult>(list, array, list, array, list, {a: 1});
|
||||
|
||||
result = _(list).chain().unionBy<TResult>(list);
|
||||
result = _(list).chain().unionBy<TResult>(array, list);
|
||||
result = _(list).chain().unionBy<TResult>(list, array, list);
|
||||
result = _(list).chain().unionBy<TResult>(array, list, array, list);
|
||||
result = _(list).chain().unionBy<TResult>(list, array, list, array, list);
|
||||
|
||||
result = _(list).chain().unionBy<TResult>(list, iteratee);
|
||||
result = _(list).chain().unionBy<TResult>(array, list, iteratee);
|
||||
result = _(list).chain().unionBy<TResult>(list, array, list, iteratee);
|
||||
result = _(list).chain().unionBy<TResult>(array, list, array, list, iteratee);
|
||||
result = _(list).chain().unionBy<TResult>(list, array, list, array, list, iteratee);
|
||||
|
||||
result = _(list).chain().unionBy<TResult>(list, 'a');
|
||||
result = _(list).chain().unionBy<TResult>(array, list, 'a');
|
||||
result = _(list).chain().unionBy<TResult>(list, array, list, 'a');
|
||||
result = _(list).chain().unionBy<TResult>(array, list, array, list, 'a');
|
||||
result = _(list).chain().unionBy<TResult>(list, array, list, array, list, 'a');
|
||||
|
||||
result = _(list).chain().unionBy<TResult, {a: number}>(list, {a: 1});
|
||||
result = _(list).chain().unionBy<TResult, {a: number}>(array, list, {a: 1});
|
||||
result = _(list).chain().unionBy<TResult, {a: number}>(list, array, list, {a: 1});
|
||||
result = _(list).chain().unionBy<TResult, {a: number}>(array, list, array, list, {a: 1});
|
||||
result = _(list).chain().unionBy<TResult>(array, list, array, list, array, {a: 1});
|
||||
}
|
||||
}
|
||||
|
||||
// _.uniq
|
||||
module TestUniq {
|
||||
type SampleObject = {a: number; b: string; c: boolean};
|
||||
@@ -3407,52 +3570,68 @@ module TestEachRight {
|
||||
}
|
||||
|
||||
// _.every
|
||||
module TestEvery {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let dictionary: _.Dictionary<TResult>;
|
||||
namespace TestEvery {
|
||||
type SampleObject = {a: number; b: string; c: boolean;};
|
||||
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => boolean;
|
||||
let array: SampleObject[];
|
||||
let list: _.List<SampleObject>;
|
||||
let dictionary: _.Dictionary<SampleObject>;
|
||||
let numericDictionary: _.NumericDictionary<SampleObject>;
|
||||
|
||||
let listIterator: (value: SampleObject, index: number, collection: _.List<SampleObject>) => boolean;
|
||||
let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary<SampleObject>) => boolean;
|
||||
let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary<SampleObject>) => boolean;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.every<TResult>(array);
|
||||
result = _.every<TResult>(array, listIterator);
|
||||
result = _.every<TResult>(array, listIterator, any);
|
||||
result = _.every<TResult>(array, '');
|
||||
result = _.every<{a: number}, TResult>(array, {a: 42});
|
||||
result = _.every<SampleObject>(array);
|
||||
result = _.every<SampleObject>(array, listIterator);
|
||||
result = _.every<SampleObject>(array, 'a');
|
||||
result = _.every<SampleObject>(array, ['a', 42]);
|
||||
result = _.every<{a: number}, SampleObject>(array, {a: 42});
|
||||
|
||||
result = _.every<TResult>(list);
|
||||
result = _.every<TResult>(list, listIterator);
|
||||
result = _.every<TResult>(list, listIterator, any);
|
||||
result = _.every<TResult>(list, '');
|
||||
result = _.every<{a: number}, TResult>(list, {a: 42});
|
||||
result = _.every<SampleObject>(list);
|
||||
result = _.every<SampleObject>(list, listIterator);
|
||||
result = _.every<SampleObject>(list, 'a');
|
||||
result = _.every<SampleObject>(list, ['a', 42]);
|
||||
result = _.every<{a: number}, SampleObject>(list, {a: 42});
|
||||
|
||||
result = _.every<TResult>(dictionary);
|
||||
result = _.every<TResult>(dictionary, dictionaryIterator);
|
||||
result = _.every<TResult>(dictionary, dictionaryIterator, any);
|
||||
result = _.every<TResult>(dictionary, '');
|
||||
result = _.every<{a: number}, TResult>(dictionary, {a: 42});
|
||||
result = _.every<SampleObject>(dictionary);
|
||||
result = _.every<SampleObject>(dictionary, dictionaryIterator);
|
||||
result = _.every<SampleObject>(dictionary, 'a');
|
||||
result = _.every<SampleObject>(dictionary, ['a', 42]);
|
||||
result = _.every<{a: number}, SampleObject>(dictionary, {a: 42});
|
||||
|
||||
result = _.every<SampleObject>(numericDictionary);
|
||||
result = _.every<SampleObject>(numericDictionary, numericDictionaryIterator);
|
||||
result = _.every<SampleObject>(numericDictionary, 'a');
|
||||
result = _.every<SampleObject>(numericDictionary, ['a', 42]);
|
||||
result = _.every<{a: number}, SampleObject>(numericDictionary, {a: 42});
|
||||
|
||||
result = _(array).every();
|
||||
result = _(array).every(listIterator);
|
||||
result = _(array).every(listIterator, any);
|
||||
result = _(array).every('');
|
||||
result = _(array).every('a');
|
||||
result = _(array).every(['a', 42]);
|
||||
result = _(array).every<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).every<TResult>();
|
||||
result = _(list).every<TResult>(listIterator);
|
||||
result = _(list).every<TResult>(listIterator, any);
|
||||
result = _(list).every('');
|
||||
result = _(list).every<SampleObject>();
|
||||
result = _(list).every<SampleObject>(listIterator);
|
||||
result = _(list).every('a');
|
||||
result = _(list).every(['a', 42]);
|
||||
result = _(list).every<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).every<TResult>();
|
||||
result = _(dictionary).every<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).every<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).every('');
|
||||
result = _(dictionary).every<SampleObject>();
|
||||
result = _(dictionary).every<SampleObject>(dictionaryIterator);
|
||||
result = _(dictionary).every('a');
|
||||
result = _(dictionary).every(['a', 42]);
|
||||
result = _(dictionary).every<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).every<SampleObject>();
|
||||
result = _(numericDictionary).every<SampleObject>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).every('a');
|
||||
result = _(numericDictionary).every(['a', 42]);
|
||||
result = _(numericDictionary).every<{a: number}>({a: 42});
|
||||
}
|
||||
|
||||
{
|
||||
@@ -3460,21 +3639,27 @@ module TestEvery {
|
||||
|
||||
result = _(array).chain().every();
|
||||
result = _(array).chain().every(listIterator);
|
||||
result = _(array).chain().every(listIterator, any);
|
||||
result = _(array).chain().every('');
|
||||
result = _(array).chain().every('a');
|
||||
result = _(array).chain().every(['a', 42]);
|
||||
result = _(array).chain().every<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).chain().every<TResult>();
|
||||
result = _(list).chain().every<TResult>(listIterator);
|
||||
result = _(list).chain().every<TResult>(listIterator, any);
|
||||
result = _(list).chain().every('');
|
||||
result = _(list).chain().every<SampleObject>();
|
||||
result = _(list).chain().every<SampleObject>(listIterator);
|
||||
result = _(list).chain().every('a');
|
||||
result = _(list).chain().every(['a', 42]);
|
||||
result = _(list).chain().every<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).chain().every<TResult>();
|
||||
result = _(dictionary).chain().every<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).chain().every<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).chain().every('');
|
||||
result = _(dictionary).chain().every<SampleObject>();
|
||||
result = _(dictionary).chain().every<SampleObject>(dictionaryIterator);
|
||||
result = _(dictionary).chain().every('a');
|
||||
result = _(dictionary).chain().every(['a', 42]);
|
||||
result = _(dictionary).chain().every<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).chain().every<SampleObject>();
|
||||
result = _(numericDictionary).chain().every<SampleObject>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).chain().every('a');
|
||||
result = _(numericDictionary).chain().every(['a', 42]);
|
||||
result = _(numericDictionary).chain().every<{a: number}>({a: 42});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4175,7 +4360,7 @@ module TestInvokeMap {
|
||||
c: 3,
|
||||
d: 4
|
||||
}
|
||||
|
||||
|
||||
let result: string[];
|
||||
result = _.invokeMap<number, string>(numArray, 'toString');
|
||||
result = _.invokeMap<number, string>(numArray, 'toString', 2);
|
||||
@@ -4185,7 +4370,7 @@ module TestInvokeMap {
|
||||
result = _(numArray).invokeMap<string>('toString', 2).value();
|
||||
result = _(numArray).chain().invokeMap<string>('toString').value();
|
||||
result = _(numArray).chain().invokeMap<string>('toString', 2).value();
|
||||
|
||||
|
||||
result = _.invokeMap<number, string>(numArray, Number.prototype.toString);
|
||||
result = _.invokeMap<number, string>(numArray, Number.prototype.toString, 2);
|
||||
result = _.invokeMap<string>(numArray, Number.prototype.toString);
|
||||
@@ -4194,7 +4379,7 @@ module TestInvokeMap {
|
||||
result = _(numArray).invokeMap<string>(Number.prototype.toString, 2).value();
|
||||
result = _(numArray).chain().invokeMap<string>(Number.prototype.toString).value();
|
||||
result = _(numArray).chain().invokeMap<string>(Number.prototype.toString, 2).value();
|
||||
|
||||
|
||||
result = _.invokeMap<number, string>(numDict, 'toString');
|
||||
result = _.invokeMap<number, string>(numDict, 'toString', 2);
|
||||
result = _.invokeMap<string>(numDict, 'toString');
|
||||
@@ -4203,7 +4388,7 @@ module TestInvokeMap {
|
||||
result = _(numDict).invokeMap<string>('toString', 2).value();
|
||||
result = _(numDict).chain().invokeMap<string>('toString').value();
|
||||
result = _(numDict).chain().invokeMap<string>('toString', 2).value();
|
||||
|
||||
|
||||
result = _.invokeMap<number, string>(numDict, Number.prototype.toString);
|
||||
result = _.invokeMap<number, string>(numDict, Number.prototype.toString, 2);
|
||||
result = _.invokeMap<string>(numDict, Number.prototype.toString);
|
||||
@@ -4612,65 +4797,67 @@ module TestSize {
|
||||
}
|
||||
|
||||
// _.some
|
||||
module TestSome {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let dictionary: _.Dictionary<TResult>;
|
||||
let numericDictionary: _.NumericDictionary<TResult>;
|
||||
namespace TestSome {
|
||||
type SampleObject = {a: number; b: string; c: boolean;};
|
||||
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => boolean;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => boolean;
|
||||
let numericDictionaryIterator: (value: TResult, key: number, collection: _.NumericDictionary<TResult>) => boolean;
|
||||
let array: SampleObject[];
|
||||
let list: _.List<SampleObject>;
|
||||
let dictionary: _.Dictionary<SampleObject>;
|
||||
let numericDictionary: _.NumericDictionary<SampleObject>;
|
||||
|
||||
let listIterator: (value: SampleObject, index: number, collection: _.List<SampleObject>) => boolean;
|
||||
let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary<SampleObject>) => boolean;
|
||||
let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary<SampleObject>) => boolean;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
|
||||
result = _.some<TResult>(array);
|
||||
result = _.some<TResult>(array, listIterator);
|
||||
result = _.some<TResult>(array, listIterator, any);
|
||||
result = _.some<TResult>(array, '');
|
||||
result = _.some<{a: number}, TResult>(array, {a: 42});
|
||||
result = _.some<SampleObject>(array);
|
||||
result = _.some<SampleObject>(array, listIterator);
|
||||
result = _.some<SampleObject>(array, 'a');
|
||||
result = _.some<SampleObject>(array, ['a', 42]);
|
||||
result = _.some<{a: number}, SampleObject>(array, {a: 42});
|
||||
|
||||
result = _.some<TResult>(list);
|
||||
result = _.some<TResult>(list, listIterator);
|
||||
result = _.some<TResult>(list, listIterator, any);
|
||||
result = _.some<TResult>(list, '');
|
||||
result = _.some<{a: number}, TResult>(list, {a: 42});
|
||||
result = _.some<SampleObject>(list);
|
||||
result = _.some<SampleObject>(list, listIterator);
|
||||
result = _.some<SampleObject>(list, 'a');
|
||||
result = _.some<SampleObject>(list, ['a', 42]);
|
||||
result = _.some<{a: number}, SampleObject>(list, {a: 42});
|
||||
|
||||
result = _.some<TResult>(dictionary);
|
||||
result = _.some<TResult>(dictionary, dictionaryIterator);
|
||||
result = _.some<TResult>(dictionary, dictionaryIterator, any);
|
||||
result = _.some<TResult>(dictionary, '');
|
||||
result = _.some<{a: number}, TResult>(dictionary, {a: 42});
|
||||
result = _.some<SampleObject>(dictionary);
|
||||
result = _.some<SampleObject>(dictionary, dictionaryIterator);
|
||||
result = _.some<SampleObject>(dictionary, 'a');
|
||||
result = _.some<SampleObject>(dictionary, ['a', 42]);
|
||||
result = _.some<{a: number}, SampleObject>(dictionary, {a: 42});
|
||||
|
||||
result = _.some<TResult>(numericDictionary);
|
||||
result = _.some<TResult>(numericDictionary, numericDictionaryIterator);
|
||||
result = _.some<TResult>(numericDictionary, numericDictionaryIterator, any);
|
||||
result = _.some<TResult>(numericDictionary, '');
|
||||
result = _.some<{a: number}, TResult>(numericDictionary, {a: 42});
|
||||
result = _.some<SampleObject>(numericDictionary);
|
||||
result = _.some<SampleObject>(numericDictionary, numericDictionaryIterator);
|
||||
result = _.some<SampleObject>(numericDictionary, 'a');
|
||||
result = _.some<SampleObject>(numericDictionary, ['a', 42]);
|
||||
result = _.some<{a: number}, SampleObject>(numericDictionary, {a: 42});
|
||||
|
||||
result = _(array).some();
|
||||
result = _(array).some(listIterator);
|
||||
result = _(array).some(listIterator, any);
|
||||
result = _(array).some('');
|
||||
result = _(array).some('a');
|
||||
result = _(array).some(['a', 42]);
|
||||
result = _(array).some<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).some<TResult>();
|
||||
result = _(list).some<TResult>(listIterator);
|
||||
result = _(list).some<TResult>(listIterator, any);
|
||||
result = _(list).some('');
|
||||
result = _(list).some<SampleObject>();
|
||||
result = _(list).some<SampleObject>(listIterator);
|
||||
result = _(list).some('a');
|
||||
result = _(list).some(['a', 42]);
|
||||
result = _(list).some<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).some<TResult>();
|
||||
result = _(dictionary).some<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).some<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).some('');
|
||||
result = _(dictionary).some<SampleObject>();
|
||||
result = _(dictionary).some<SampleObject>(dictionaryIterator);
|
||||
result = _(dictionary).some('a');
|
||||
result = _(dictionary).some(['a', 42]);
|
||||
result = _(dictionary).some<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).some<TResult>();
|
||||
result = _(numericDictionary).some<TResult>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).some<TResult>(numericDictionaryIterator, any);
|
||||
result = _(numericDictionary).some('');
|
||||
result = _(numericDictionary).some<SampleObject>();
|
||||
result = _(numericDictionary).some<SampleObject>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).some('a');
|
||||
result = _(numericDictionary).some(['a', 42]);
|
||||
result = _(numericDictionary).some<{a: number}>({a: 42});
|
||||
}
|
||||
|
||||
@@ -4679,26 +4866,26 @@ module TestSome {
|
||||
|
||||
result = _(array).chain().some();
|
||||
result = _(array).chain().some(listIterator);
|
||||
result = _(array).chain().some(listIterator, any);
|
||||
result = _(array).chain().some('');
|
||||
result = _(array).chain().some('a');
|
||||
result = _(array).chain().some(['a', 42]);
|
||||
result = _(array).chain().some<{a: number}>({a: 42});
|
||||
|
||||
result = _(list).chain().some<TResult>();
|
||||
result = _(list).chain().some<TResult>(listIterator);
|
||||
result = _(list).chain().some<TResult>(listIterator, any);
|
||||
result = _(list).chain().some('');
|
||||
result = _(list).chain().some<SampleObject>();
|
||||
result = _(list).chain().some<SampleObject>(listIterator);
|
||||
result = _(list).chain().some('a');
|
||||
result = _(list).chain().some(['a', 42]);
|
||||
result = _(list).chain().some<{a: number}>({a: 42});
|
||||
|
||||
result = _(dictionary).chain().some<TResult>();
|
||||
result = _(dictionary).chain().some<TResult>(dictionaryIterator);
|
||||
result = _(dictionary).chain().some<TResult>(dictionaryIterator, any);
|
||||
result = _(dictionary).chain().some('');
|
||||
result = _(dictionary).chain().some<SampleObject>();
|
||||
result = _(dictionary).chain().some<SampleObject>(dictionaryIterator);
|
||||
result = _(dictionary).chain().some('a');
|
||||
result = _(dictionary).chain().some(['a', 42]);
|
||||
result = _(dictionary).chain().some<{a: number}>({a: 42});
|
||||
|
||||
result = _(numericDictionary).chain().some<TResult>();
|
||||
result = _(numericDictionary).chain().some<TResult>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).chain().some<TResult>(numericDictionaryIterator, any);
|
||||
result = _(numericDictionary).chain().some('');
|
||||
result = _(numericDictionary).chain().some<SampleObject>();
|
||||
result = _(numericDictionary).chain().some<SampleObject>(numericDictionaryIterator);
|
||||
result = _(numericDictionary).chain().some('a');
|
||||
result = _(numericDictionary).chain().some(['a', 42]);
|
||||
result = _(numericDictionary).chain().some<{a: number}>({a: 42});
|
||||
}
|
||||
}
|
||||
@@ -8879,47 +9066,6 @@ module TestOmitBy {
|
||||
}
|
||||
}
|
||||
|
||||
// _.toPairs
|
||||
module TestToPairs {
|
||||
let object: _.Dictionary<string>;
|
||||
|
||||
{
|
||||
let result: any[][];
|
||||
|
||||
result = _.toPairs<_.Dictionary<string>>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: string[][];
|
||||
|
||||
result = _.toPairs<_.Dictionary<string>, string>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).toPairs<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).toPairs();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).chain().toPairs<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).chain().toPairs();
|
||||
}
|
||||
}
|
||||
|
||||
// _.pick
|
||||
module TestPick {
|
||||
let predicate: (element: any, key: string, collection: any) => boolean;
|
||||
@@ -9085,6 +9231,88 @@ module TestSetWith {
|
||||
}
|
||||
}
|
||||
|
||||
// _.toPairs
|
||||
namespace TestToPairs {
|
||||
let object: _.Dictionary<string>;
|
||||
|
||||
{
|
||||
let result: any[][];
|
||||
|
||||
result = _.toPairs<_.Dictionary<string>>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: string[][];
|
||||
|
||||
result = _.toPairs<_.Dictionary<string>, string>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).toPairs<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).toPairs();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).chain().toPairs<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).chain().toPairs();
|
||||
}
|
||||
}
|
||||
|
||||
// _.toPairsIn
|
||||
namespace TestToPairsIn {
|
||||
let object: _.Dictionary<string>;
|
||||
|
||||
{
|
||||
let result: any[][];
|
||||
|
||||
result = _.toPairsIn<_.Dictionary<string>>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: string[][];
|
||||
|
||||
result = _.toPairsIn<_.Dictionary<string>, string>(object);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).toPairsIn<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).toPairsIn();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<string[]>;
|
||||
|
||||
result = _(object).chain().toPairsIn<string>();
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<any[]>;
|
||||
|
||||
result = _(object).chain().toPairs();
|
||||
}
|
||||
}
|
||||
|
||||
// _.transform
|
||||
module TestTransform {
|
||||
let array: number[];
|
||||
|
||||
Vendored
+608
-132
@@ -4162,6 +4162,519 @@ declare module _ {
|
||||
union<T>(...arrays: List<T>[]): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.unionBy
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* This method is like `_.union` except that it accepts `iteratee` which is
|
||||
* invoked for each element of each `arrays` to generate the criterion by which
|
||||
* uniqueness is computed. The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @param arrays The arrays to inspect.
|
||||
* @param iteratee The iteratee invoked per element.
|
||||
* @return Returns the new array of combined values.
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays1: T[]|List<T>,
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): T[];
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays: T[]|List<T>,
|
||||
...iteratee: any[]
|
||||
): T[];
|
||||
}
|
||||
|
||||
interface LoDashImplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
...iteratee: any[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
...iteratee: any[]
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
...iteratee: any[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: (value: T) => any
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T, W extends Object>(
|
||||
arrays2: T[]|List<T>,
|
||||
arrays3: T[]|List<T>,
|
||||
arrays4: T[]|List<T>,
|
||||
arrays5: T[]|List<T>,
|
||||
iteratee?: W
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
|
||||
/**
|
||||
* @see _.unionBy
|
||||
*/
|
||||
unionBy<T>(
|
||||
...iteratee: any[]
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.uniq
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -4729,34 +5242,6 @@ declare module _ {
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.unionBy DUMMY
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* This method is like `_.union` except that it accepts `iteratee` which is
|
||||
* invoked for each element of each `arrays` to generate the criterion by which
|
||||
* uniqueness is computed. The iteratee is invoked with one argument: (value).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new array of combined values.
|
||||
* @example
|
||||
*
|
||||
* _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
|
||||
* // => [2.1, 1.2, 4.3]
|
||||
*
|
||||
* // using the `_.property` iteratee shorthand
|
||||
* _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 1 }, { 'x': 2 }]
|
||||
*/
|
||||
unionBy(
|
||||
array: any[]|List<any>,
|
||||
...values: any[]
|
||||
): any[];
|
||||
}
|
||||
|
||||
//_.unionWith DUMMY
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -6049,27 +6534,16 @@ declare module _ {
|
||||
//_.every
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if predicate returns truthy for all elements of collection. The predicate is bound to thisArg and
|
||||
* invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for predicate the created _.property style callback returns the property
|
||||
* value of the given element.
|
||||
*
|
||||
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
||||
* elements that have a matching property value, else false.
|
||||
*
|
||||
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
||||
* have the properties of the given object, else false.
|
||||
* Checks if predicate returns truthy for all elements of collection. Iteration is stopped once predicate
|
||||
* returns falsey. The predicate is invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* @param collection The collection to iterate over.
|
||||
* @param predicate The function invoked per iteration.
|
||||
* @param thisArg The this binding of predicate.
|
||||
* @return Returns true if all elements pass the predicate check, else false.
|
||||
*/
|
||||
every<T>(
|
||||
collection: List<T>,
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -6077,24 +6551,30 @@ declare module _ {
|
||||
*/
|
||||
every<T>(
|
||||
collection: Dictionary<T>,
|
||||
predicate?: DictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: DictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every<T>(
|
||||
collection: List<T>|Dictionary<T>,
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
collection: NumericDictionary<T>,
|
||||
predicate?: NumericDictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every<T>(
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: string|any[]
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every<TObject extends {}, T>(
|
||||
collection: List<T>|Dictionary<T>,
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: TObject
|
||||
): boolean;
|
||||
}
|
||||
@@ -6104,16 +6584,14 @@ declare module _ {
|
||||
* @see _.every
|
||||
*/
|
||||
every(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -6129,16 +6607,14 @@ declare module _ {
|
||||
* @see _.every
|
||||
*/
|
||||
every<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -6154,16 +6630,14 @@ declare module _ {
|
||||
* @see _.every
|
||||
*/
|
||||
every(
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -6179,16 +6653,14 @@ declare module _ {
|
||||
* @see _.every
|
||||
*/
|
||||
every<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
* @see _.every
|
||||
*/
|
||||
every(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -7432,7 +7904,7 @@ declare module _ {
|
||||
method: (...args: any[]) => TResult,
|
||||
...args: any[]): TResult[];
|
||||
}
|
||||
|
||||
|
||||
interface LoDashImplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.invokeMap
|
||||
@@ -7448,7 +7920,7 @@ declare module _ {
|
||||
method: (...args: any[]) => TResult,
|
||||
...args: any[]): LoDashImplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.invokeMap
|
||||
@@ -7464,7 +7936,7 @@ declare module _ {
|
||||
method: (...args: any[]) => TResult,
|
||||
...args: any[]): LoDashImplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.invokeMap
|
||||
@@ -7480,7 +7952,7 @@ declare module _ {
|
||||
method: (...args: any[]) => TResult,
|
||||
...args: any[]): LoDashExplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.invokeMap
|
||||
@@ -8320,28 +8792,16 @@ declare module _ {
|
||||
//_.some
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Checks if predicate returns truthy for any element of collection. The function returns as soon as it finds
|
||||
* a passing value and does not iterate over the entire collection. The predicate is bound to thisArg and
|
||||
* invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* If a property name is provided for predicate the created _.property style callback returns the property
|
||||
* value of the given element.
|
||||
*
|
||||
* If a value is also provided for thisArg the created _.matchesProperty style callback returns true for
|
||||
* elements that have a matching property value, else false.
|
||||
*
|
||||
* If an object is provided for predicate the created _.matches style callback returns true for elements that
|
||||
* have the properties of the given object, else false.
|
||||
* Checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate
|
||||
* returns truthy. The predicate is invoked with three arguments: (value, index|key, collection).
|
||||
*
|
||||
* @param collection The collection to iterate over.
|
||||
* @param predicate The function invoked per iteration.
|
||||
* @param thisArg The this binding of predicate.
|
||||
* @return Returns true if any element passes the predicate check, else false.
|
||||
*/
|
||||
some<T>(
|
||||
collection: List<T>,
|
||||
predicate?: ListIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -8349,8 +8809,7 @@ declare module _ {
|
||||
*/
|
||||
some<T>(
|
||||
collection: Dictionary<T>,
|
||||
predicate?: DictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: DictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -8358,8 +8817,7 @@ declare module _ {
|
||||
*/
|
||||
some<T>(
|
||||
collection: NumericDictionary<T>,
|
||||
predicate?: NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: NumericDictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -8367,8 +8825,7 @@ declare module _ {
|
||||
*/
|
||||
some<T>(
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T>,
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -8385,16 +8842,14 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -8410,16 +8865,14 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -8435,16 +8888,14 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<T, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -8460,16 +8911,14 @@ declare module _ {
|
||||
* @see _.some
|
||||
*/
|
||||
some<TResult>(
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>,
|
||||
thisArg?: any
|
||||
predicate?: ListIterator<TResult, boolean>|DictionaryIterator<TResult, boolean>|NumericDictionaryIterator<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
* @see _.some
|
||||
*/
|
||||
some(
|
||||
predicate?: string,
|
||||
thisArg?: any
|
||||
predicate?: string|any[]
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -15055,33 +15504,6 @@ declare module _ {
|
||||
): LoDashExplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.toPairs
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates a two dimensional array of the key-value pairs for object, e.g. [[key1, value1], [key2, value2]].
|
||||
*
|
||||
* @param object The object to query.
|
||||
* @return Returns the new array of key-value pairs.
|
||||
*/
|
||||
toPairs<T extends {}>(object?: T): any[][];
|
||||
|
||||
toPairs<T extends {}, TResult>(object?: T): TResult[][];
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toPairs
|
||||
*/
|
||||
toPairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toPairs
|
||||
*/
|
||||
toPairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
//_.pick
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
@@ -15354,6 +15776,60 @@ declare module _ {
|
||||
): LoDashExplicitObjectWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.toPairs
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array of own enumerable key-value pairs for object.
|
||||
*
|
||||
* @param object The object to query.
|
||||
* @return Returns the new array of key-value pairs.
|
||||
*/
|
||||
toPairs<T extends {}>(object?: T): any[][];
|
||||
|
||||
toPairs<T extends {}, TResult>(object?: T): TResult[][];
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toPairs
|
||||
*/
|
||||
toPairs<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toPairs
|
||||
*/
|
||||
toPairs<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
//_.toPairsIn
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
* Creates an array of own and inherited enumerable key-value pairs for object.
|
||||
*
|
||||
* @param object The object to query.
|
||||
* @return Returns the new array of key-value pairs.
|
||||
*/
|
||||
toPairsIn<T extends {}>(object?: T): any[][];
|
||||
|
||||
toPairsIn<T extends {}, TResult>(object?: T): TResult[][];
|
||||
}
|
||||
|
||||
interface LoDashImplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toPairsIn
|
||||
*/
|
||||
toPairsIn<TResult>(): LoDashImplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.toPairsIn
|
||||
*/
|
||||
toPairsIn<TResult>(): LoDashExplicitArrayWrapper<TResult[]>;
|
||||
}
|
||||
|
||||
//_.transform
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Vendored
+922
@@ -2359,3 +2359,925 @@ declare namespace __MaterialUI.Styles {
|
||||
}
|
||||
export var Colors: Colors;
|
||||
}
|
||||
|
||||
declare module "material-ui/lib/svg-icons" {
|
||||
export var ActionAccessibility: __MaterialUI.SvgIcon;
|
||||
export var ActionAccessible: __MaterialUI.SvgIcon;
|
||||
export var ActionAccountBalanceWallet: __MaterialUI.SvgIcon;
|
||||
export var ActionAccountBalance: __MaterialUI.SvgIcon;
|
||||
export var ActionAccountBox: __MaterialUI.SvgIcon;
|
||||
export var ActionAccountCircle: __MaterialUI.SvgIcon;
|
||||
export var ActionAddShoppingCart: __MaterialUI.SvgIcon;
|
||||
export var ActionAlarmAdd: __MaterialUI.SvgIcon;
|
||||
export var ActionAlarmOff: __MaterialUI.SvgIcon;
|
||||
export var ActionAlarmOn: __MaterialUI.SvgIcon;
|
||||
export var ActionAlarm: __MaterialUI.SvgIcon;
|
||||
export var ActionAllOut: __MaterialUI.SvgIcon;
|
||||
export var ActionAndroid: __MaterialUI.SvgIcon;
|
||||
export var ActionAnnouncement: __MaterialUI.SvgIcon;
|
||||
export var ActionAspectRatio: __MaterialUI.SvgIcon;
|
||||
export var ActionAssessment: __MaterialUI.SvgIcon;
|
||||
export var ActionAssignmentInd: __MaterialUI.SvgIcon;
|
||||
export var ActionAssignmentLate: __MaterialUI.SvgIcon;
|
||||
export var ActionAssignmentReturn: __MaterialUI.SvgIcon;
|
||||
export var ActionAssignmentReturned: __MaterialUI.SvgIcon;
|
||||
export var ActionAssignmentTurnedIn: __MaterialUI.SvgIcon;
|
||||
export var ActionAssignment: __MaterialUI.SvgIcon;
|
||||
export var ActionAutorenew: __MaterialUI.SvgIcon;
|
||||
export var ActionBackup: __MaterialUI.SvgIcon;
|
||||
export var ActionBook: __MaterialUI.SvgIcon;
|
||||
export var ActionBookmarkBorder: __MaterialUI.SvgIcon;
|
||||
export var ActionBookmark: __MaterialUI.SvgIcon;
|
||||
export var ActionBugReport: __MaterialUI.SvgIcon;
|
||||
export var ActionBuild: __MaterialUI.SvgIcon;
|
||||
export var ActionCached: __MaterialUI.SvgIcon;
|
||||
export var ActionCameraEnhance: __MaterialUI.SvgIcon;
|
||||
export var ActionCardGiftcard: __MaterialUI.SvgIcon;
|
||||
export var ActionCardMembership: __MaterialUI.SvgIcon;
|
||||
export var ActionCardTravel: __MaterialUI.SvgIcon;
|
||||
export var ActionChangeHistory: __MaterialUI.SvgIcon;
|
||||
export var ActionCheckCircle: __MaterialUI.SvgIcon;
|
||||
export var ActionChromeReaderMode: __MaterialUI.SvgIcon;
|
||||
export var ActionClass: __MaterialUI.SvgIcon;
|
||||
export var ActionCode: __MaterialUI.SvgIcon;
|
||||
export var ActionCompareArrows: __MaterialUI.SvgIcon;
|
||||
export var ActionCopyright: __MaterialUI.SvgIcon;
|
||||
export var ActionCreditCard: __MaterialUI.SvgIcon;
|
||||
export var ActionDashboard: __MaterialUI.SvgIcon;
|
||||
export var ActionDateRange: __MaterialUI.SvgIcon;
|
||||
export var ActionDelete: __MaterialUI.SvgIcon;
|
||||
export var ActionDescription: __MaterialUI.SvgIcon;
|
||||
export var ActionDns: __MaterialUI.SvgIcon;
|
||||
export var ActionDoneAll: __MaterialUI.SvgIcon;
|
||||
export var ActionDone: __MaterialUI.SvgIcon;
|
||||
export var ActionDonutLarge: __MaterialUI.SvgIcon;
|
||||
export var ActionDonutSmall: __MaterialUI.SvgIcon;
|
||||
export var ActionEject: __MaterialUI.SvgIcon;
|
||||
export var ActionEventSeat: __MaterialUI.SvgIcon;
|
||||
export var ActionEvent: __MaterialUI.SvgIcon;
|
||||
export var ActionExitToApp: __MaterialUI.SvgIcon;
|
||||
export var ActionExplore: __MaterialUI.SvgIcon;
|
||||
export var ActionExtension: __MaterialUI.SvgIcon;
|
||||
export var ActionFace: __MaterialUI.SvgIcon;
|
||||
export var ActionFavoriteBorder: __MaterialUI.SvgIcon;
|
||||
export var ActionFavorite: __MaterialUI.SvgIcon;
|
||||
export var ActionFeedback: __MaterialUI.SvgIcon;
|
||||
export var ActionFindInPage: __MaterialUI.SvgIcon;
|
||||
export var ActionFindReplace: __MaterialUI.SvgIcon;
|
||||
export var ActionFingerprint: __MaterialUI.SvgIcon;
|
||||
export var ActionFlightLand: __MaterialUI.SvgIcon;
|
||||
export var ActionFlightTakeoff: __MaterialUI.SvgIcon;
|
||||
export var ActionFlipToBack: __MaterialUI.SvgIcon;
|
||||
export var ActionFlipToFront: __MaterialUI.SvgIcon;
|
||||
export var ActionGavel: __MaterialUI.SvgIcon;
|
||||
export var ActionGetApp: __MaterialUI.SvgIcon;
|
||||
export var ActionGif: __MaterialUI.SvgIcon;
|
||||
export var ActionGrade: __MaterialUI.SvgIcon;
|
||||
export var ActionGroupWork: __MaterialUI.SvgIcon;
|
||||
export var ActionHelpOutline: __MaterialUI.SvgIcon;
|
||||
export var ActionHelp: __MaterialUI.SvgIcon;
|
||||
export var ActionHighlightOff: __MaterialUI.SvgIcon;
|
||||
export var ActionHistory: __MaterialUI.SvgIcon;
|
||||
export var ActionHome: __MaterialUI.SvgIcon;
|
||||
export var ActionHourglassEmpty: __MaterialUI.SvgIcon;
|
||||
export var ActionHourglassFull: __MaterialUI.SvgIcon;
|
||||
export var ActionHttp: __MaterialUI.SvgIcon;
|
||||
export var ActionHttps: __MaterialUI.SvgIcon;
|
||||
export var ActionImportantDevices: __MaterialUI.SvgIcon;
|
||||
export var ActionInfoOutline: __MaterialUI.SvgIcon;
|
||||
export var ActionInfo: __MaterialUI.SvgIcon;
|
||||
export var ActionInput: __MaterialUI.SvgIcon;
|
||||
export var ActionInvertColors: __MaterialUI.SvgIcon;
|
||||
export var ActionLabelOutline: __MaterialUI.SvgIcon;
|
||||
export var ActionLabel: __MaterialUI.SvgIcon;
|
||||
export var ActionLanguage: __MaterialUI.SvgIcon;
|
||||
export var ActionLaunch: __MaterialUI.SvgIcon;
|
||||
export var ActionLightbulbOutline: __MaterialUI.SvgIcon;
|
||||
export var ActionLineStyle: __MaterialUI.SvgIcon;
|
||||
export var ActionLineWeight: __MaterialUI.SvgIcon;
|
||||
export var ActionList: __MaterialUI.SvgIcon;
|
||||
export var ActionLockOpen: __MaterialUI.SvgIcon;
|
||||
export var ActionLockOutline: __MaterialUI.SvgIcon;
|
||||
export var ActionLock: __MaterialUI.SvgIcon;
|
||||
export var ActionLoyalty: __MaterialUI.SvgIcon;
|
||||
export var ActionMarkunreadMailbox: __MaterialUI.SvgIcon;
|
||||
export var ActionMotorcycle: __MaterialUI.SvgIcon;
|
||||
export var ActionNoteAdd: __MaterialUI.SvgIcon;
|
||||
export var ActionOfflinePin: __MaterialUI.SvgIcon;
|
||||
export var ActionOpacity: __MaterialUI.SvgIcon;
|
||||
export var ActionOpenInBrowser: __MaterialUI.SvgIcon;
|
||||
export var ActionOpenInNew: __MaterialUI.SvgIcon;
|
||||
export var ActionOpenWith: __MaterialUI.SvgIcon;
|
||||
export var ActionPageview: __MaterialUI.SvgIcon;
|
||||
export var ActionPanTool: __MaterialUI.SvgIcon;
|
||||
export var ActionPayment: __MaterialUI.SvgIcon;
|
||||
export var ActionPermCameraMic: __MaterialUI.SvgIcon;
|
||||
export var ActionPermContactCalendar: __MaterialUI.SvgIcon;
|
||||
export var ActionPermDataSetting: __MaterialUI.SvgIcon;
|
||||
export var ActionPermDeviceInformation: __MaterialUI.SvgIcon;
|
||||
export var ActionPermIdentity: __MaterialUI.SvgIcon;
|
||||
export var ActionPermMedia: __MaterialUI.SvgIcon;
|
||||
export var ActionPermPhoneMsg: __MaterialUI.SvgIcon;
|
||||
export var ActionPermScanWifi: __MaterialUI.SvgIcon;
|
||||
export var ActionPets: __MaterialUI.SvgIcon;
|
||||
export var ActionPictureInPictureAlt: __MaterialUI.SvgIcon;
|
||||
export var ActionPictureInPicture: __MaterialUI.SvgIcon;
|
||||
export var ActionPlayForWork: __MaterialUI.SvgIcon;
|
||||
export var ActionPolymer: __MaterialUI.SvgIcon;
|
||||
export var ActionPowerSettingsNew: __MaterialUI.SvgIcon;
|
||||
export var ActionPregnantWoman: __MaterialUI.SvgIcon;
|
||||
export var ActionPrint: __MaterialUI.SvgIcon;
|
||||
export var ActionQueryBuilder: __MaterialUI.SvgIcon;
|
||||
export var ActionQuestionAnswer: __MaterialUI.SvgIcon;
|
||||
export var ActionReceipt: __MaterialUI.SvgIcon;
|
||||
export var ActionRecordVoiceOver: __MaterialUI.SvgIcon;
|
||||
export var ActionRedeem: __MaterialUI.SvgIcon;
|
||||
export var ActionReorder: __MaterialUI.SvgIcon;
|
||||
export var ActionReportProblem: __MaterialUI.SvgIcon;
|
||||
export var ActionRestore: __MaterialUI.SvgIcon;
|
||||
export var ActionRoom: __MaterialUI.SvgIcon;
|
||||
export var ActionRoundedCorner: __MaterialUI.SvgIcon;
|
||||
export var ActionRowing: __MaterialUI.SvgIcon;
|
||||
export var ActionSchedule: __MaterialUI.SvgIcon;
|
||||
export var ActionSearch: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsApplications: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsBackupRestore: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsBluetooth: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsBrightness: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsCell: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsEthernet: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsInputAntenna: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsInputComponent: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsInputComposite: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsInputHdmi: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsInputSvideo: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsOverscan: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsPhone: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsPower: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsRemote: __MaterialUI.SvgIcon;
|
||||
export var ActionSettingsVoice: __MaterialUI.SvgIcon;
|
||||
export var ActionSettings: __MaterialUI.SvgIcon;
|
||||
export var ActionShopTwo: __MaterialUI.SvgIcon;
|
||||
export var ActionShop: __MaterialUI.SvgIcon;
|
||||
export var ActionShoppingBasket: __MaterialUI.SvgIcon;
|
||||
export var ActionShoppingCart: __MaterialUI.SvgIcon;
|
||||
export var ActionSpeakerNotes: __MaterialUI.SvgIcon;
|
||||
export var ActionSpellcheck: __MaterialUI.SvgIcon;
|
||||
export var ActionStars: __MaterialUI.SvgIcon;
|
||||
export var ActionStore: __MaterialUI.SvgIcon;
|
||||
export var ActionSubject: __MaterialUI.SvgIcon;
|
||||
export var ActionSupervisorAccount: __MaterialUI.SvgIcon;
|
||||
export var ActionSwapHoriz: __MaterialUI.SvgIcon;
|
||||
export var ActionSwapVert: __MaterialUI.SvgIcon;
|
||||
export var ActionSwapVerticalCircle: __MaterialUI.SvgIcon;
|
||||
export var ActionSystemUpdateAlt: __MaterialUI.SvgIcon;
|
||||
export var ActionTabUnselected: __MaterialUI.SvgIcon;
|
||||
export var ActionTab: __MaterialUI.SvgIcon;
|
||||
export var ActionTheaters: __MaterialUI.SvgIcon;
|
||||
export var ActionThreeDRotation: __MaterialUI.SvgIcon;
|
||||
export var ActionThumbDown: __MaterialUI.SvgIcon;
|
||||
export var ActionThumbUp: __MaterialUI.SvgIcon;
|
||||
export var ActionThumbsUpDown: __MaterialUI.SvgIcon;
|
||||
export var ActionTimeline: __MaterialUI.SvgIcon;
|
||||
export var ActionToc: __MaterialUI.SvgIcon;
|
||||
export var ActionToday: __MaterialUI.SvgIcon;
|
||||
export var ActionToll: __MaterialUI.SvgIcon;
|
||||
export var ActionTouchApp: __MaterialUI.SvgIcon;
|
||||
export var ActionTrackChanges: __MaterialUI.SvgIcon;
|
||||
export var ActionTranslate: __MaterialUI.SvgIcon;
|
||||
export var ActionTrendingDown: __MaterialUI.SvgIcon;
|
||||
export var ActionTrendingFlat: __MaterialUI.SvgIcon;
|
||||
export var ActionTrendingUp: __MaterialUI.SvgIcon;
|
||||
export var ActionTurnedInNot: __MaterialUI.SvgIcon;
|
||||
export var ActionTurnedIn: __MaterialUI.SvgIcon;
|
||||
export var ActionUpdate: __MaterialUI.SvgIcon;
|
||||
export var ActionVerifiedUser: __MaterialUI.SvgIcon;
|
||||
export var ActionViewAgenda: __MaterialUI.SvgIcon;
|
||||
export var ActionViewArray: __MaterialUI.SvgIcon;
|
||||
export var ActionViewCarousel: __MaterialUI.SvgIcon;
|
||||
export var ActionViewColumn: __MaterialUI.SvgIcon;
|
||||
export var ActionViewDay: __MaterialUI.SvgIcon;
|
||||
export var ActionViewHeadline: __MaterialUI.SvgIcon;
|
||||
export var ActionViewList: __MaterialUI.SvgIcon;
|
||||
export var ActionViewModule: __MaterialUI.SvgIcon;
|
||||
export var ActionViewQuilt: __MaterialUI.SvgIcon;
|
||||
export var ActionViewStream: __MaterialUI.SvgIcon;
|
||||
export var ActionViewWeek: __MaterialUI.SvgIcon;
|
||||
export var ActionVisibilityOff: __MaterialUI.SvgIcon;
|
||||
export var ActionVisibility: __MaterialUI.SvgIcon;
|
||||
export var ActionWatchLater: __MaterialUI.SvgIcon;
|
||||
export var ActionWork: __MaterialUI.SvgIcon;
|
||||
export var ActionYoutubeSearchedFor: __MaterialUI.SvgIcon;
|
||||
export var ActionZoomIn: __MaterialUI.SvgIcon;
|
||||
export var ActionZoomOut: __MaterialUI.SvgIcon;
|
||||
export var AlertAddAlert: __MaterialUI.SvgIcon;
|
||||
export var AlertErrorOutline: __MaterialUI.SvgIcon;
|
||||
export var AlertError: __MaterialUI.SvgIcon;
|
||||
export var AlertWarning: __MaterialUI.SvgIcon;
|
||||
export var AvAddToQueue: __MaterialUI.SvgIcon;
|
||||
export var AvAirplay: __MaterialUI.SvgIcon;
|
||||
export var AvAlbum: __MaterialUI.SvgIcon;
|
||||
export var AvArtTrack: __MaterialUI.SvgIcon;
|
||||
export var AvAvTimer: __MaterialUI.SvgIcon;
|
||||
export var AvClosedCaption: __MaterialUI.SvgIcon;
|
||||
export var AvEqualizer: __MaterialUI.SvgIcon;
|
||||
export var AvExplicit: __MaterialUI.SvgIcon;
|
||||
export var AvFastForward: __MaterialUI.SvgIcon;
|
||||
export var AvFastRewind: __MaterialUI.SvgIcon;
|
||||
export var AvFiberDvr: __MaterialUI.SvgIcon;
|
||||
export var AvFiberManualRecord: __MaterialUI.SvgIcon;
|
||||
export var AvFiberNew: __MaterialUI.SvgIcon;
|
||||
export var AvFiberPin: __MaterialUI.SvgIcon;
|
||||
export var AvFiberSmartRecord: __MaterialUI.SvgIcon;
|
||||
export var AvForward10: __MaterialUI.SvgIcon;
|
||||
export var AvForward30: __MaterialUI.SvgIcon;
|
||||
export var AvForward5: __MaterialUI.SvgIcon;
|
||||
export var AvGames: __MaterialUI.SvgIcon;
|
||||
export var AvHd: __MaterialUI.SvgIcon;
|
||||
export var AvHearing: __MaterialUI.SvgIcon;
|
||||
export var AvHighQuality: __MaterialUI.SvgIcon;
|
||||
export var AvLibraryAdd: __MaterialUI.SvgIcon;
|
||||
export var AvLibraryBooks: __MaterialUI.SvgIcon;
|
||||
export var AvLibraryMusic: __MaterialUI.SvgIcon;
|
||||
export var AvLoop: __MaterialUI.SvgIcon;
|
||||
export var AvMicNone: __MaterialUI.SvgIcon;
|
||||
export var AvMicOff: __MaterialUI.SvgIcon;
|
||||
export var AvMic: __MaterialUI.SvgIcon;
|
||||
export var AvMovie: __MaterialUI.SvgIcon;
|
||||
export var AvMusicVideo: __MaterialUI.SvgIcon;
|
||||
export var AvNewReleases: __MaterialUI.SvgIcon;
|
||||
export var AvNotInterested: __MaterialUI.SvgIcon;
|
||||
export var AvPauseCircleFilled: __MaterialUI.SvgIcon;
|
||||
export var AvPauseCircleOutline: __MaterialUI.SvgIcon;
|
||||
export var AvPause: __MaterialUI.SvgIcon;
|
||||
export var AvPlayArrow: __MaterialUI.SvgIcon;
|
||||
export var AvPlayCircleFilled: __MaterialUI.SvgIcon;
|
||||
export var AvPlayCircleOutline: __MaterialUI.SvgIcon;
|
||||
export var AvPlaylistAddCheck: __MaterialUI.SvgIcon;
|
||||
export var AvPlaylistAdd: __MaterialUI.SvgIcon;
|
||||
export var AvPlaylistPlay: __MaterialUI.SvgIcon;
|
||||
export var AvQueueMusic: __MaterialUI.SvgIcon;
|
||||
export var AvQueuePlayNext: __MaterialUI.SvgIcon;
|
||||
export var AvQueue: __MaterialUI.SvgIcon;
|
||||
export var AvRadio: __MaterialUI.SvgIcon;
|
||||
export var AvRecentActors: __MaterialUI.SvgIcon;
|
||||
export var AvRemoveFromQueue: __MaterialUI.SvgIcon;
|
||||
export var AvRepeatOne: __MaterialUI.SvgIcon;
|
||||
export var AvRepeat: __MaterialUI.SvgIcon;
|
||||
export var AvReplay10: __MaterialUI.SvgIcon;
|
||||
export var AvReplay30: __MaterialUI.SvgIcon;
|
||||
export var AvReplay5: __MaterialUI.SvgIcon;
|
||||
export var AvReplay: __MaterialUI.SvgIcon;
|
||||
export var AvShuffle: __MaterialUI.SvgIcon;
|
||||
export var AvSkipNext: __MaterialUI.SvgIcon;
|
||||
export var AvSkipPrevious: __MaterialUI.SvgIcon;
|
||||
export var AvSlowMotionVideo: __MaterialUI.SvgIcon;
|
||||
export var AvSnooze: __MaterialUI.SvgIcon;
|
||||
export var AvSortByAlpha: __MaterialUI.SvgIcon;
|
||||
export var AvStop: __MaterialUI.SvgIcon;
|
||||
export var AvSubscriptions: __MaterialUI.SvgIcon;
|
||||
export var AvSubtitles: __MaterialUI.SvgIcon;
|
||||
export var AvSurroundSound: __MaterialUI.SvgIcon;
|
||||
export var AvVideoLibrary: __MaterialUI.SvgIcon;
|
||||
export var AvVideocamOff: __MaterialUI.SvgIcon;
|
||||
export var AvVideocam: __MaterialUI.SvgIcon;
|
||||
export var AvVolumeDown: __MaterialUI.SvgIcon;
|
||||
export var AvVolumeMute: __MaterialUI.SvgIcon;
|
||||
export var AvVolumeOff: __MaterialUI.SvgIcon;
|
||||
export var AvVolumeUp: __MaterialUI.SvgIcon;
|
||||
export var AvWebAsset: __MaterialUI.SvgIcon;
|
||||
export var AvWeb: __MaterialUI.SvgIcon;
|
||||
export var CommunicationBusiness: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallEnd: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallMade: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallMerge: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallMissedOutgoing: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallMissed: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallReceived: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCallSplit: __MaterialUI.SvgIcon;
|
||||
export var CommunicationCall: __MaterialUI.SvgIcon;
|
||||
export var CommunicationChatBubbleOutline: __MaterialUI.SvgIcon;
|
||||
export var CommunicationChatBubble: __MaterialUI.SvgIcon;
|
||||
export var CommunicationChat: __MaterialUI.SvgIcon;
|
||||
export var CommunicationClearAll: __MaterialUI.SvgIcon;
|
||||
export var CommunicationComment: __MaterialUI.SvgIcon;
|
||||
export var CommunicationContactMail: __MaterialUI.SvgIcon;
|
||||
export var CommunicationContactPhone: __MaterialUI.SvgIcon;
|
||||
export var CommunicationContacts: __MaterialUI.SvgIcon;
|
||||
export var CommunicationDialerSip: __MaterialUI.SvgIcon;
|
||||
export var CommunicationDialpad: __MaterialUI.SvgIcon;
|
||||
export var CommunicationEmail: __MaterialUI.SvgIcon;
|
||||
export var CommunicationForum: __MaterialUI.SvgIcon;
|
||||
export var CommunicationImportContacts: __MaterialUI.SvgIcon;
|
||||
export var CommunicationImportExport: __MaterialUI.SvgIcon;
|
||||
export var CommunicationInvertColorsOff: __MaterialUI.SvgIcon;
|
||||
export var CommunicationLiveHelp: __MaterialUI.SvgIcon;
|
||||
export var CommunicationLocationOff: __MaterialUI.SvgIcon;
|
||||
export var CommunicationLocationOn: __MaterialUI.SvgIcon;
|
||||
export var CommunicationMailOutline: __MaterialUI.SvgIcon;
|
||||
export var CommunicationMessage: __MaterialUI.SvgIcon;
|
||||
export var CommunicationNoSim: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPhone: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPhonelinkErase: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPhonelinkLock: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPhonelinkRing: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPhonelinkSetup: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPortableWifiOff: __MaterialUI.SvgIcon;
|
||||
export var CommunicationPresentToAll: __MaterialUI.SvgIcon;
|
||||
export var CommunicationRingVolume: __MaterialUI.SvgIcon;
|
||||
export var CommunicationScreenShare: __MaterialUI.SvgIcon;
|
||||
export var CommunicationSpeakerPhone: __MaterialUI.SvgIcon;
|
||||
export var CommunicationStayCurrentLandscape: __MaterialUI.SvgIcon;
|
||||
export var CommunicationStayCurrentPortrait: __MaterialUI.SvgIcon;
|
||||
export var CommunicationStayPrimaryLandscape: __MaterialUI.SvgIcon;
|
||||
export var CommunicationStayPrimaryPortrait: __MaterialUI.SvgIcon;
|
||||
export var CommunicationStopScreenShare: __MaterialUI.SvgIcon;
|
||||
export var CommunicationSwapCalls: __MaterialUI.SvgIcon;
|
||||
export var CommunicationTextsms: __MaterialUI.SvgIcon;
|
||||
export var CommunicationVoicemail: __MaterialUI.SvgIcon;
|
||||
export var CommunicationVpnKey: __MaterialUI.SvgIcon;
|
||||
export var ContentAddBox: __MaterialUI.SvgIcon;
|
||||
export var ContentAddCircleOutline: __MaterialUI.SvgIcon;
|
||||
export var ContentAddCircle: __MaterialUI.SvgIcon;
|
||||
export var ContentAdd: __MaterialUI.SvgIcon;
|
||||
export var ContentArchive: __MaterialUI.SvgIcon;
|
||||
export var ContentBackspace: __MaterialUI.SvgIcon;
|
||||
export var ContentBlock: __MaterialUI.SvgIcon;
|
||||
export var ContentClear: __MaterialUI.SvgIcon;
|
||||
export var ContentContentCopy: __MaterialUI.SvgIcon;
|
||||
export var ContentContentCut: __MaterialUI.SvgIcon;
|
||||
export var ContentContentPaste: __MaterialUI.SvgIcon;
|
||||
export var ContentCreate: __MaterialUI.SvgIcon;
|
||||
export var ContentDrafts: __MaterialUI.SvgIcon;
|
||||
export var ContentFilterList: __MaterialUI.SvgIcon;
|
||||
export var ContentFlag: __MaterialUI.SvgIcon;
|
||||
export var ContentFontDownload: __MaterialUI.SvgIcon;
|
||||
export var ContentForward: __MaterialUI.SvgIcon;
|
||||
export var ContentGesture: __MaterialUI.SvgIcon;
|
||||
export var ContentInbox: __MaterialUI.SvgIcon;
|
||||
export var ContentLink: __MaterialUI.SvgIcon;
|
||||
export var ContentMail: __MaterialUI.SvgIcon;
|
||||
export var ContentMarkunread: __MaterialUI.SvgIcon;
|
||||
export var ContentMoveToInbox: __MaterialUI.SvgIcon;
|
||||
export var ContentNextWeek: __MaterialUI.SvgIcon;
|
||||
export var ContentRedo: __MaterialUI.SvgIcon;
|
||||
export var ContentRemoveCircleOutline: __MaterialUI.SvgIcon;
|
||||
export var ContentRemoveCircle: __MaterialUI.SvgIcon;
|
||||
export var ContentRemove: __MaterialUI.SvgIcon;
|
||||
export var ContentReplyAll: __MaterialUI.SvgIcon;
|
||||
export var ContentReply: __MaterialUI.SvgIcon;
|
||||
export var ContentReport: __MaterialUI.SvgIcon;
|
||||
export var ContentSave: __MaterialUI.SvgIcon;
|
||||
export var ContentSelectAll: __MaterialUI.SvgIcon;
|
||||
export var ContentSend: __MaterialUI.SvgIcon;
|
||||
export var ContentSort: __MaterialUI.SvgIcon;
|
||||
export var ContentTextFormat: __MaterialUI.SvgIcon;
|
||||
export var ContentUnarchive: __MaterialUI.SvgIcon;
|
||||
export var ContentUndo: __MaterialUI.SvgIcon;
|
||||
export var ContentWeekend: __MaterialUI.SvgIcon;
|
||||
export var DeviceAccessAlarm: __MaterialUI.SvgIcon;
|
||||
export var DeviceAccessAlarms: __MaterialUI.SvgIcon;
|
||||
export var DeviceAccessTime: __MaterialUI.SvgIcon;
|
||||
export var DeviceAddAlarm: __MaterialUI.SvgIcon;
|
||||
export var DeviceAirplanemodeActive: __MaterialUI.SvgIcon;
|
||||
export var DeviceAirplanemodeInactive: __MaterialUI.SvgIcon;
|
||||
export var DeviceBattery20: __MaterialUI.SvgIcon;
|
||||
export var DeviceBattery30: __MaterialUI.SvgIcon;
|
||||
export var DeviceBattery50: __MaterialUI.SvgIcon;
|
||||
export var DeviceBattery60: __MaterialUI.SvgIcon;
|
||||
export var DeviceBattery80: __MaterialUI.SvgIcon;
|
||||
export var DeviceBattery90: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryAlert: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryCharging20: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryCharging30: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryCharging50: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryCharging60: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryCharging80: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryCharging90: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryChargingFull: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryFull: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryStd: __MaterialUI.SvgIcon;
|
||||
export var DeviceBatteryUnknown: __MaterialUI.SvgIcon;
|
||||
export var DeviceBluetoothConnected: __MaterialUI.SvgIcon;
|
||||
export var DeviceBluetoothDisabled: __MaterialUI.SvgIcon;
|
||||
export var DeviceBluetoothSearching: __MaterialUI.SvgIcon;
|
||||
export var DeviceBluetooth: __MaterialUI.SvgIcon;
|
||||
export var DeviceBrightnessAuto: __MaterialUI.SvgIcon;
|
||||
export var DeviceBrightnessHigh: __MaterialUI.SvgIcon;
|
||||
export var DeviceBrightnessLow: __MaterialUI.SvgIcon;
|
||||
export var DeviceBrightnessMedium: __MaterialUI.SvgIcon;
|
||||
export var DeviceDataUsage: __MaterialUI.SvgIcon;
|
||||
export var DeviceDeveloperMode: __MaterialUI.SvgIcon;
|
||||
export var DeviceDevices: __MaterialUI.SvgIcon;
|
||||
export var DeviceDvr: __MaterialUI.SvgIcon;
|
||||
export var DeviceGpsFixed: __MaterialUI.SvgIcon;
|
||||
export var DeviceGpsNotFixed: __MaterialUI.SvgIcon;
|
||||
export var DeviceGpsOff: __MaterialUI.SvgIcon;
|
||||
export var DeviceGraphicEq: __MaterialUI.SvgIcon;
|
||||
export var DeviceLocationDisabled: __MaterialUI.SvgIcon;
|
||||
export var DeviceLocationSearching: __MaterialUI.SvgIcon;
|
||||
export var DeviceNetworkCell: __MaterialUI.SvgIcon;
|
||||
export var DeviceNetworkWifi: __MaterialUI.SvgIcon;
|
||||
export var DeviceNfc: __MaterialUI.SvgIcon;
|
||||
export var DeviceScreenLockLandscape: __MaterialUI.SvgIcon;
|
||||
export var DeviceScreenLockPortrait: __MaterialUI.SvgIcon;
|
||||
export var DeviceScreenLockRotation: __MaterialUI.SvgIcon;
|
||||
export var DeviceScreenRotation: __MaterialUI.SvgIcon;
|
||||
export var DeviceSdStorage: __MaterialUI.SvgIcon;
|
||||
export var DeviceSettingsSystemDaydream: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellular0Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellular1Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellular2Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellular3Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellular4Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularConnectedNoInternet0Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularConnectedNoInternet1Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularConnectedNoInternet2Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularConnectedNoInternet3Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularConnectedNoInternet4Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularNoSim: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularNull: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalCellularOff: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi0Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi1BarLock: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi1Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi2BarLock: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi2Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi3BarLock: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi3Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi4BarLock: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifi4Bar: __MaterialUI.SvgIcon;
|
||||
export var DeviceSignalWifiOff: __MaterialUI.SvgIcon;
|
||||
export var DeviceStorage: __MaterialUI.SvgIcon;
|
||||
export var DeviceUsb: __MaterialUI.SvgIcon;
|
||||
export var DeviceWallpaper: __MaterialUI.SvgIcon;
|
||||
export var DeviceWidgets: __MaterialUI.SvgIcon;
|
||||
export var DeviceWifiLock: __MaterialUI.SvgIcon;
|
||||
export var DeviceWifiTethering: __MaterialUI.SvgIcon;
|
||||
export var EditorAttachFile: __MaterialUI.SvgIcon;
|
||||
export var EditorAttachMoney: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderAll: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderBottom: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderClear: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderColor: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderHorizontal: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderInner: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderLeft: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderOuter: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderRight: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderStyle: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderTop: __MaterialUI.SvgIcon;
|
||||
export var EditorBorderVertical: __MaterialUI.SvgIcon;
|
||||
export var EditorDragHandle: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatAlignCenter: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatAlignJustify: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatAlignLeft: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatAlignRight: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatBold: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatClear: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatColorFill: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatColorReset: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatColorText: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatIndentDecrease: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatIndentIncrease: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatItalic: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatLineSpacing: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatListBulleted: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatListNumbered: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatPaint: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatQuote: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatShapes: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatSize: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatStrikethrough: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatTextdirectionLToR: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatTextdirectionRToL: __MaterialUI.SvgIcon;
|
||||
export var EditorFormatUnderlined: __MaterialUI.SvgIcon;
|
||||
export var EditorFunctions: __MaterialUI.SvgIcon;
|
||||
export var EditorHighlight: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertChart: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertComment: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertDriveFile: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertEmoticon: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertInvitation: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertLink: __MaterialUI.SvgIcon;
|
||||
export var EditorInsertPhoto: __MaterialUI.SvgIcon;
|
||||
export var EditorLinearScale: __MaterialUI.SvgIcon;
|
||||
export var EditorMergeType: __MaterialUI.SvgIcon;
|
||||
export var EditorModeComment: __MaterialUI.SvgIcon;
|
||||
export var EditorModeEdit: __MaterialUI.SvgIcon;
|
||||
export var EditorMoneyOff: __MaterialUI.SvgIcon;
|
||||
export var EditorPublish: __MaterialUI.SvgIcon;
|
||||
export var EditorShortText: __MaterialUI.SvgIcon;
|
||||
export var EditorSpaceBar: __MaterialUI.SvgIcon;
|
||||
export var EditorStrikethroughS: __MaterialUI.SvgIcon;
|
||||
export var EditorTextFields: __MaterialUI.SvgIcon;
|
||||
export var EditorVerticalAlignBottom: __MaterialUI.SvgIcon;
|
||||
export var EditorVerticalAlignCenter: __MaterialUI.SvgIcon;
|
||||
export var EditorVerticalAlignTop: __MaterialUI.SvgIcon;
|
||||
export var EditorWrapText: __MaterialUI.SvgIcon;
|
||||
export var FileAttachment: __MaterialUI.SvgIcon;
|
||||
export var FileCloudCircle: __MaterialUI.SvgIcon;
|
||||
export var FileCloudDone: __MaterialUI.SvgIcon;
|
||||
export var FileCloudDownload: __MaterialUI.SvgIcon;
|
||||
export var FileCloudOff: __MaterialUI.SvgIcon;
|
||||
export var FileCloudQueue: __MaterialUI.SvgIcon;
|
||||
export var FileCloudUpload: __MaterialUI.SvgIcon;
|
||||
export var FileCloud: __MaterialUI.SvgIcon;
|
||||
export var FileCreateNewFolder: __MaterialUI.SvgIcon;
|
||||
export var FileFileDownload: __MaterialUI.SvgIcon;
|
||||
export var FileFileUpload: __MaterialUI.SvgIcon;
|
||||
export var FileFolderOpen: __MaterialUI.SvgIcon;
|
||||
export var FileFolderShared: __MaterialUI.SvgIcon;
|
||||
export var FileFolder: __MaterialUI.SvgIcon;
|
||||
export var HardwareCastConnected: __MaterialUI.SvgIcon;
|
||||
export var HardwareCast: __MaterialUI.SvgIcon;
|
||||
export var HardwareComputer: __MaterialUI.SvgIcon;
|
||||
export var HardwareDesktopMac: __MaterialUI.SvgIcon;
|
||||
export var HardwareDesktopWindows: __MaterialUI.SvgIcon;
|
||||
export var HardwareDeveloperBoard: __MaterialUI.SvgIcon;
|
||||
export var HardwareDeviceHub: __MaterialUI.SvgIcon;
|
||||
export var HardwareDevicesOther: __MaterialUI.SvgIcon;
|
||||
export var HardwareDock: __MaterialUI.SvgIcon;
|
||||
export var HardwareGamepad: __MaterialUI.SvgIcon;
|
||||
export var HardwareHeadsetMic: __MaterialUI.SvgIcon;
|
||||
export var HardwareHeadset: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardArrowDown: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardArrowLeft: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardArrowRight: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardArrowUp: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardBackspace: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardCapslock: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardHide: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardReturn: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardTab: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboardVoice: __MaterialUI.SvgIcon;
|
||||
export var HardwareKeyboard: __MaterialUI.SvgIcon;
|
||||
export var HardwareLaptopChromebook: __MaterialUI.SvgIcon;
|
||||
export var HardwareLaptopMac: __MaterialUI.SvgIcon;
|
||||
export var HardwareLaptopWindows: __MaterialUI.SvgIcon;
|
||||
export var HardwareLaptop: __MaterialUI.SvgIcon;
|
||||
export var HardwareMemory: __MaterialUI.SvgIcon;
|
||||
export var HardwareMouse: __MaterialUI.SvgIcon;
|
||||
export var HardwarePhoneAndroid: __MaterialUI.SvgIcon;
|
||||
export var HardwarePhoneIphone: __MaterialUI.SvgIcon;
|
||||
export var HardwarePhonelinkOff: __MaterialUI.SvgIcon;
|
||||
export var HardwarePhonelink: __MaterialUI.SvgIcon;
|
||||
export var HardwarePowerInput: __MaterialUI.SvgIcon;
|
||||
export var HardwareRouter: __MaterialUI.SvgIcon;
|
||||
export var HardwareScanner: __MaterialUI.SvgIcon;
|
||||
export var HardwareSecurity: __MaterialUI.SvgIcon;
|
||||
export var HardwareSimCard: __MaterialUI.SvgIcon;
|
||||
export var HardwareSmartphone: __MaterialUI.SvgIcon;
|
||||
export var HardwareSpeakerGroup: __MaterialUI.SvgIcon;
|
||||
export var HardwareSpeaker: __MaterialUI.SvgIcon;
|
||||
export var HardwareTabletAndroid: __MaterialUI.SvgIcon;
|
||||
export var HardwareTabletMac: __MaterialUI.SvgIcon;
|
||||
export var HardwareTablet: __MaterialUI.SvgIcon;
|
||||
export var HardwareToys: __MaterialUI.SvgIcon;
|
||||
export var HardwareTv: __MaterialUI.SvgIcon;
|
||||
export var HardwareVideogameAsset: __MaterialUI.SvgIcon;
|
||||
export var HardwareWatch: __MaterialUI.SvgIcon;
|
||||
export var ImageAddAPhoto: __MaterialUI.SvgIcon;
|
||||
export var ImageAddToPhotos: __MaterialUI.SvgIcon;
|
||||
export var ImageAdjust: __MaterialUI.SvgIcon;
|
||||
export var ImageAssistantPhoto: __MaterialUI.SvgIcon;
|
||||
export var ImageAssistant: __MaterialUI.SvgIcon;
|
||||
export var ImageAudiotrack: __MaterialUI.SvgIcon;
|
||||
export var ImageBlurCircular: __MaterialUI.SvgIcon;
|
||||
export var ImageBlurLinear: __MaterialUI.SvgIcon;
|
||||
export var ImageBlurOff: __MaterialUI.SvgIcon;
|
||||
export var ImageBlurOn: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness1: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness2: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness3: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness4: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness5: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness6: __MaterialUI.SvgIcon;
|
||||
export var ImageBrightness7: __MaterialUI.SvgIcon;
|
||||
export var ImageBrokenImage: __MaterialUI.SvgIcon;
|
||||
export var ImageBrush: __MaterialUI.SvgIcon;
|
||||
export var ImageCameraAlt: __MaterialUI.SvgIcon;
|
||||
export var ImageCameraFront: __MaterialUI.SvgIcon;
|
||||
export var ImageCameraRear: __MaterialUI.SvgIcon;
|
||||
export var ImageCameraRoll: __MaterialUI.SvgIcon;
|
||||
export var ImageCamera: __MaterialUI.SvgIcon;
|
||||
export var ImageCenterFocusStrong: __MaterialUI.SvgIcon;
|
||||
export var ImageCenterFocusWeak: __MaterialUI.SvgIcon;
|
||||
export var ImageCollectionsBookmark: __MaterialUI.SvgIcon;
|
||||
export var ImageCollections: __MaterialUI.SvgIcon;
|
||||
export var ImageColorLens: __MaterialUI.SvgIcon;
|
||||
export var ImageColorize: __MaterialUI.SvgIcon;
|
||||
export var ImageCompare: __MaterialUI.SvgIcon;
|
||||
export var ImageControlPointDuplicate: __MaterialUI.SvgIcon;
|
||||
export var ImageControlPoint: __MaterialUI.SvgIcon;
|
||||
export var ImageCrop169: __MaterialUI.SvgIcon;
|
||||
export var ImageCrop32: __MaterialUI.SvgIcon;
|
||||
export var ImageCrop54: __MaterialUI.SvgIcon;
|
||||
export var ImageCrop75: __MaterialUI.SvgIcon;
|
||||
export var ImageCropDin: __MaterialUI.SvgIcon;
|
||||
export var ImageCropFree: __MaterialUI.SvgIcon;
|
||||
export var ImageCropLandscape: __MaterialUI.SvgIcon;
|
||||
export var ImageCropOriginal: __MaterialUI.SvgIcon;
|
||||
export var ImageCropPortrait: __MaterialUI.SvgIcon;
|
||||
export var ImageCropRotate: __MaterialUI.SvgIcon;
|
||||
export var ImageCropSquare: __MaterialUI.SvgIcon;
|
||||
export var ImageCrop: __MaterialUI.SvgIcon;
|
||||
export var ImageDehaze: __MaterialUI.SvgIcon;
|
||||
export var ImageDetails: __MaterialUI.SvgIcon;
|
||||
export var ImageEdit: __MaterialUI.SvgIcon;
|
||||
export var ImageExposureNeg1: __MaterialUI.SvgIcon;
|
||||
export var ImageExposureNeg2: __MaterialUI.SvgIcon;
|
||||
export var ImageExposurePlus1: __MaterialUI.SvgIcon;
|
||||
export var ImageExposurePlus2: __MaterialUI.SvgIcon;
|
||||
export var ImageExposureZero: __MaterialUI.SvgIcon;
|
||||
export var ImageExposure: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter1: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter2: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter3: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter4: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter5: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter6: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter7: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter8: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter9Plus: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter9: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterBAndW: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterCenterFocus: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterDrama: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterFrames: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterHdr: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterNone: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterTiltShift: __MaterialUI.SvgIcon;
|
||||
export var ImageFilterVintage: __MaterialUI.SvgIcon;
|
||||
export var ImageFilter: __MaterialUI.SvgIcon;
|
||||
export var ImageFlare: __MaterialUI.SvgIcon;
|
||||
export var ImageFlashAuto: __MaterialUI.SvgIcon;
|
||||
export var ImageFlashOff: __MaterialUI.SvgIcon;
|
||||
export var ImageFlashOn: __MaterialUI.SvgIcon;
|
||||
export var ImageFlip: __MaterialUI.SvgIcon;
|
||||
export var ImageGradient: __MaterialUI.SvgIcon;
|
||||
export var ImageGrain: __MaterialUI.SvgIcon;
|
||||
export var ImageGridOff: __MaterialUI.SvgIcon;
|
||||
export var ImageGridOn: __MaterialUI.SvgIcon;
|
||||
export var ImageHdrOff: __MaterialUI.SvgIcon;
|
||||
export var ImageHdrOn: __MaterialUI.SvgIcon;
|
||||
export var ImageHdrStrong: __MaterialUI.SvgIcon;
|
||||
export var ImageHdrWeak: __MaterialUI.SvgIcon;
|
||||
export var ImageHealing: __MaterialUI.SvgIcon;
|
||||
export var ImageImageAspectRatio: __MaterialUI.SvgIcon;
|
||||
export var ImageImage: __MaterialUI.SvgIcon;
|
||||
export var ImageIso: __MaterialUI.SvgIcon;
|
||||
export var ImageLandscape: __MaterialUI.SvgIcon;
|
||||
export var ImageLeakAdd: __MaterialUI.SvgIcon;
|
||||
export var ImageLeakRemove: __MaterialUI.SvgIcon;
|
||||
export var ImageLens: __MaterialUI.SvgIcon;
|
||||
export var ImageLinkedCamera: __MaterialUI.SvgIcon;
|
||||
export var ImageLooks3: __MaterialUI.SvgIcon;
|
||||
export var ImageLooks4: __MaterialUI.SvgIcon;
|
||||
export var ImageLooks5: __MaterialUI.SvgIcon;
|
||||
export var ImageLooks6: __MaterialUI.SvgIcon;
|
||||
export var ImageLooksOne: __MaterialUI.SvgIcon;
|
||||
export var ImageLooksTwo: __MaterialUI.SvgIcon;
|
||||
export var ImageLooks: __MaterialUI.SvgIcon;
|
||||
export var ImageLoupe: __MaterialUI.SvgIcon;
|
||||
export var ImageMonochromePhotos: __MaterialUI.SvgIcon;
|
||||
export var ImageMovieCreation: __MaterialUI.SvgIcon;
|
||||
export var ImageMovieFilter: __MaterialUI.SvgIcon;
|
||||
export var ImageMusicNote: __MaterialUI.SvgIcon;
|
||||
export var ImageNaturePeople: __MaterialUI.SvgIcon;
|
||||
export var ImageNature: __MaterialUI.SvgIcon;
|
||||
export var ImageNavigateBefore: __MaterialUI.SvgIcon;
|
||||
export var ImageNavigateNext: __MaterialUI.SvgIcon;
|
||||
export var ImagePalette: __MaterialUI.SvgIcon;
|
||||
export var ImagePanoramaFishEye: __MaterialUI.SvgIcon;
|
||||
export var ImagePanoramaHorizontal: __MaterialUI.SvgIcon;
|
||||
export var ImagePanoramaVertical: __MaterialUI.SvgIcon;
|
||||
export var ImagePanoramaWideAngle: __MaterialUI.SvgIcon;
|
||||
export var ImagePanorama: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoAlbum: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoCamera: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoFilter: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoLibrary: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoSizeSelectActual: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoSizeSelectLarge: __MaterialUI.SvgIcon;
|
||||
export var ImagePhotoSizeSelectSmall: __MaterialUI.SvgIcon;
|
||||
export var ImagePhoto: __MaterialUI.SvgIcon;
|
||||
export var ImagePictureAsPdf: __MaterialUI.SvgIcon;
|
||||
export var ImagePortrait: __MaterialUI.SvgIcon;
|
||||
export var ImageRemoveRedEye: __MaterialUI.SvgIcon;
|
||||
export var ImageRotate90DegreesCcw: __MaterialUI.SvgIcon;
|
||||
export var ImageRotateLeft: __MaterialUI.SvgIcon;
|
||||
export var ImageRotateRight: __MaterialUI.SvgIcon;
|
||||
export var ImageSlideshow: __MaterialUI.SvgIcon;
|
||||
export var ImageStraighten: __MaterialUI.SvgIcon;
|
||||
export var ImageStyle: __MaterialUI.SvgIcon;
|
||||
export var ImageSwitchCamera: __MaterialUI.SvgIcon;
|
||||
export var ImageSwitchVideo: __MaterialUI.SvgIcon;
|
||||
export var ImageTagFaces: __MaterialUI.SvgIcon;
|
||||
export var ImageTexture: __MaterialUI.SvgIcon;
|
||||
export var ImageTimelapse: __MaterialUI.SvgIcon;
|
||||
export var ImageTimer10: __MaterialUI.SvgIcon;
|
||||
export var ImageTimer3: __MaterialUI.SvgIcon;
|
||||
export var ImageTimerOff: __MaterialUI.SvgIcon;
|
||||
export var ImageTimer: __MaterialUI.SvgIcon;
|
||||
export var ImageTonality: __MaterialUI.SvgIcon;
|
||||
export var ImageTransform: __MaterialUI.SvgIcon;
|
||||
export var ImageTune: __MaterialUI.SvgIcon;
|
||||
export var ImageViewComfy: __MaterialUI.SvgIcon;
|
||||
export var ImageViewCompact: __MaterialUI.SvgIcon;
|
||||
export var ImageVignette: __MaterialUI.SvgIcon;
|
||||
export var ImageWbAuto: __MaterialUI.SvgIcon;
|
||||
export var ImageWbCloudy: __MaterialUI.SvgIcon;
|
||||
export var ImageWbIncandescent: __MaterialUI.SvgIcon;
|
||||
export var ImageWbIridescent: __MaterialUI.SvgIcon;
|
||||
export var ImageWbSunny: __MaterialUI.SvgIcon;
|
||||
export var MapsAddLocation: __MaterialUI.SvgIcon;
|
||||
export var MapsBeenhere: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsBike: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsBoat: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsBus: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsCar: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsRailway: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsRun: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsSubway: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsTransit: __MaterialUI.SvgIcon;
|
||||
export var MapsDirectionsWalk: __MaterialUI.SvgIcon;
|
||||
export var MapsDirections: __MaterialUI.SvgIcon;
|
||||
export var MapsEditLocation: __MaterialUI.SvgIcon;
|
||||
export var MapsFlight: __MaterialUI.SvgIcon;
|
||||
export var MapsHotel: __MaterialUI.SvgIcon;
|
||||
export var MapsLayersClear: __MaterialUI.SvgIcon;
|
||||
export var MapsLayers: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalActivity: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalAirport: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalAtm: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalBar: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalCafe: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalCarWash: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalConvenienceStore: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalDining: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalDrink: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalFlorist: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalGasStation: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalGroceryStore: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalHospital: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalHotel: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalLaundryService: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalLibrary: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalMall: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalMovies: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalOffer: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalParking: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalPharmacy: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalPhone: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalPizza: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalPlay: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalPostOffice: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalPrintshop: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalSee: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalShipping: __MaterialUI.SvgIcon;
|
||||
export var MapsLocalTaxi: __MaterialUI.SvgIcon;
|
||||
export var MapsMap: __MaterialUI.SvgIcon;
|
||||
export var MapsMyLocation: __MaterialUI.SvgIcon;
|
||||
export var MapsNavigation: __MaterialUI.SvgIcon;
|
||||
export var MapsNearMe: __MaterialUI.SvgIcon;
|
||||
export var MapsPersonPinCircle: __MaterialUI.SvgIcon;
|
||||
export var MapsPersonPin: __MaterialUI.SvgIcon;
|
||||
export var MapsPinDrop: __MaterialUI.SvgIcon;
|
||||
export var MapsPlace: __MaterialUI.SvgIcon;
|
||||
export var MapsRateReview: __MaterialUI.SvgIcon;
|
||||
export var MapsRestaurantMenu: __MaterialUI.SvgIcon;
|
||||
export var MapsSatellite: __MaterialUI.SvgIcon;
|
||||
export var MapsStoreMallDirectory: __MaterialUI.SvgIcon;
|
||||
export var MapsTerrain: __MaterialUI.SvgIcon;
|
||||
export var MapsTraffic: __MaterialUI.SvgIcon;
|
||||
export var MapsZoomOutMap: __MaterialUI.SvgIcon;
|
||||
export var NavigationApps: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowBack: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowDownward: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowDropDownCircle: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowDropDown: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowDropUp: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowForward: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowUpward: __MaterialUI.SvgIcon;
|
||||
export var NavigationCancel: __MaterialUI.SvgIcon;
|
||||
export var NavigationCheck: __MaterialUI.SvgIcon;
|
||||
export var NavigationChevronLeft: __MaterialUI.SvgIcon;
|
||||
export var NavigationChevronRight: __MaterialUI.SvgIcon;
|
||||
export var NavigationClose: __MaterialUI.SvgIcon;
|
||||
export var NavigationExpandLess: __MaterialUI.SvgIcon;
|
||||
export var NavigationExpandMore: __MaterialUI.SvgIcon;
|
||||
export var NavigationFullscreenExit: __MaterialUI.SvgIcon;
|
||||
export var NavigationFullscreen: __MaterialUI.SvgIcon;
|
||||
export var NavigationMenu: __MaterialUI.SvgIcon;
|
||||
export var NavigationMoreHoriz: __MaterialUI.SvgIcon;
|
||||
export var NavigationMoreVert: __MaterialUI.SvgIcon;
|
||||
export var NavigationRefresh: __MaterialUI.SvgIcon;
|
||||
export var NavigationSubdirectoryArrowLeft: __MaterialUI.SvgIcon;
|
||||
export var NavigationSubdirectoryArrowRight: __MaterialUI.SvgIcon;
|
||||
export var NavigationUnfoldLess: __MaterialUI.SvgIcon;
|
||||
export var NavigationUnfoldMore: __MaterialUI.SvgIcon;
|
||||
export var NavigationArrowDropRight: __MaterialUI.SvgIcon;
|
||||
export var NotificationAdb: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatFlatAngled: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatFlat: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatIndividualSuite: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatLegroomExtra: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatLegroomNormal: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatLegroomReduced: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatReclineExtra: __MaterialUI.SvgIcon;
|
||||
export var NotificationAirlineSeatReclineNormal: __MaterialUI.SvgIcon;
|
||||
export var NotificationBluetoothAudio: __MaterialUI.SvgIcon;
|
||||
export var NotificationConfirmationNumber: __MaterialUI.SvgIcon;
|
||||
export var NotificationDiscFull: __MaterialUI.SvgIcon;
|
||||
export var NotificationDoNotDisturbAlt: __MaterialUI.SvgIcon;
|
||||
export var NotificationDoNotDisturb: __MaterialUI.SvgIcon;
|
||||
export var NotificationDriveEta: __MaterialUI.SvgIcon;
|
||||
export var NotificationEnhancedEncryption: __MaterialUI.SvgIcon;
|
||||
export var NotificationEventAvailable: __MaterialUI.SvgIcon;
|
||||
export var NotificationEventBusy: __MaterialUI.SvgIcon;
|
||||
export var NotificationEventNote: __MaterialUI.SvgIcon;
|
||||
export var NotificationFolderSpecial: __MaterialUI.SvgIcon;
|
||||
export var NotificationLiveTv: __MaterialUI.SvgIcon;
|
||||
export var NotificationMms: __MaterialUI.SvgIcon;
|
||||
export var NotificationMore: __MaterialUI.SvgIcon;
|
||||
export var NotificationNetworkCheck: __MaterialUI.SvgIcon;
|
||||
export var NotificationNetworkLocked: __MaterialUI.SvgIcon;
|
||||
export var NotificationNoEncryption: __MaterialUI.SvgIcon;
|
||||
export var NotificationOndemandVideo: __MaterialUI.SvgIcon;
|
||||
export var NotificationPersonalVideo: __MaterialUI.SvgIcon;
|
||||
export var NotificationPhoneBluetoothSpeaker: __MaterialUI.SvgIcon;
|
||||
export var NotificationPhoneForwarded: __MaterialUI.SvgIcon;
|
||||
export var NotificationPhoneInTalk: __MaterialUI.SvgIcon;
|
||||
export var NotificationPhoneLocked: __MaterialUI.SvgIcon;
|
||||
export var NotificationPhoneMissed: __MaterialUI.SvgIcon;
|
||||
export var NotificationPhonePaused: __MaterialUI.SvgIcon;
|
||||
export var NotificationPower: __MaterialUI.SvgIcon;
|
||||
export var NotificationRvHookup: __MaterialUI.SvgIcon;
|
||||
export var NotificationSdCard: __MaterialUI.SvgIcon;
|
||||
export var NotificationSimCardAlert: __MaterialUI.SvgIcon;
|
||||
export var NotificationSmsFailed: __MaterialUI.SvgIcon;
|
||||
export var NotificationSms: __MaterialUI.SvgIcon;
|
||||
export var NotificationSyncDisabled: __MaterialUI.SvgIcon;
|
||||
export var NotificationSyncProblem: __MaterialUI.SvgIcon;
|
||||
export var NotificationSync: __MaterialUI.SvgIcon;
|
||||
export var NotificationSystemUpdate: __MaterialUI.SvgIcon;
|
||||
export var NotificationTapAndPlay: __MaterialUI.SvgIcon;
|
||||
export var NotificationTimeToLeave: __MaterialUI.SvgIcon;
|
||||
export var NotificationVibration: __MaterialUI.SvgIcon;
|
||||
export var NotificationVoiceChat: __MaterialUI.SvgIcon;
|
||||
export var NotificationVpnLock: __MaterialUI.SvgIcon;
|
||||
export var NotificationWc: __MaterialUI.SvgIcon;
|
||||
export var NotificationWifi: __MaterialUI.SvgIcon;
|
||||
export var PlacesAcUnit: __MaterialUI.SvgIcon;
|
||||
export var PlacesAirportShuttle: __MaterialUI.SvgIcon;
|
||||
export var PlacesAllInclusive: __MaterialUI.SvgIcon;
|
||||
export var PlacesBeachAccess: __MaterialUI.SvgIcon;
|
||||
export var PlacesBusinessCenter: __MaterialUI.SvgIcon;
|
||||
export var PlacesCasino: __MaterialUI.SvgIcon;
|
||||
export var PlacesChildCare: __MaterialUI.SvgIcon;
|
||||
export var PlacesChildFriendly: __MaterialUI.SvgIcon;
|
||||
export var PlacesFitnessCenter: __MaterialUI.SvgIcon;
|
||||
export var PlacesFreeBreakfast: __MaterialUI.SvgIcon;
|
||||
export var PlacesGolfCourse: __MaterialUI.SvgIcon;
|
||||
export var PlacesHotTub: __MaterialUI.SvgIcon;
|
||||
export var PlacesKitchen: __MaterialUI.SvgIcon;
|
||||
export var PlacesPool: __MaterialUI.SvgIcon;
|
||||
export var PlacesRoomService: __MaterialUI.SvgIcon;
|
||||
export var PlacesSmokeFree: __MaterialUI.SvgIcon;
|
||||
export var PlacesSmokingRooms: __MaterialUI.SvgIcon;
|
||||
export var PlacesSpa: __MaterialUI.SvgIcon;
|
||||
export var SocialCake: __MaterialUI.SvgIcon;
|
||||
export var SocialDomain: __MaterialUI.SvgIcon;
|
||||
export var SocialGroupAdd: __MaterialUI.SvgIcon;
|
||||
export var SocialGroup: __MaterialUI.SvgIcon;
|
||||
export var SocialLocationCity: __MaterialUI.SvgIcon;
|
||||
export var SocialMoodBad: __MaterialUI.SvgIcon;
|
||||
export var SocialMood: __MaterialUI.SvgIcon;
|
||||
export var SocialNotificationsActive: __MaterialUI.SvgIcon;
|
||||
export var SocialNotificationsNone: __MaterialUI.SvgIcon;
|
||||
export var SocialNotificationsOff: __MaterialUI.SvgIcon;
|
||||
export var SocialNotificationsPaused: __MaterialUI.SvgIcon;
|
||||
export var SocialNotifications: __MaterialUI.SvgIcon;
|
||||
export var SocialPages: __MaterialUI.SvgIcon;
|
||||
export var SocialPartyMode: __MaterialUI.SvgIcon;
|
||||
export var SocialPeopleOutline: __MaterialUI.SvgIcon;
|
||||
export var SocialPeople: __MaterialUI.SvgIcon;
|
||||
export var SocialPersonAdd: __MaterialUI.SvgIcon;
|
||||
export var SocialPersonOutline: __MaterialUI.SvgIcon;
|
||||
export var SocialPerson: __MaterialUI.SvgIcon;
|
||||
export var SocialPlusOne: __MaterialUI.SvgIcon;
|
||||
export var SocialPoll: __MaterialUI.SvgIcon;
|
||||
export var SocialPublic: __MaterialUI.SvgIcon;
|
||||
export var SocialSchool: __MaterialUI.SvgIcon;
|
||||
export var SocialShare: __MaterialUI.SvgIcon;
|
||||
export var SocialWhatshot: __MaterialUI.SvgIcon;
|
||||
export var ToggleCheckBoxOutlineBlank: __MaterialUI.SvgIcon;
|
||||
export var ToggleCheckBox: __MaterialUI.SvgIcon;
|
||||
export var ToggleIndeterminateCheckBox: __MaterialUI.SvgIcon;
|
||||
export var ToggleRadioButtonChecked: __MaterialUI.SvgIcon;
|
||||
export var ToggleRadioButtonUnchecked: __MaterialUI.SvgIcon;
|
||||
export var ToggleStarBorder: __MaterialUI.SvgIcon;
|
||||
export var ToggleStarHalf: __MaterialUI.SvgIcon;
|
||||
export var ToggleStar: __MaterialUI.SvgIcon;
|
||||
}
|
||||
+141
-82
@@ -11,20 +11,20 @@ Basic usage examples
|
||||
math.log(10000, 10); // 4
|
||||
math.sqrt(-4); // 2i
|
||||
math.pow([[-1, 2], [3, 1]], 2); // [[7, 0], [0, 7]]
|
||||
|
||||
|
||||
// expressions
|
||||
math.eval('1.2 * (2 + 4.5)'); // 7.8
|
||||
math.eval('5.08 cm to inch'); // 2 inch
|
||||
math.eval('sin(45 deg) ^ 2'); // 0.5
|
||||
math.eval('9 / 3 + 2i'); // 3 + 2i
|
||||
math.eval('det([-1, 2; 3, 1])'); // -7
|
||||
|
||||
|
||||
// chained operations
|
||||
var a = math.chain(3)
|
||||
.add(4)
|
||||
.multiply(2)
|
||||
.done(); // 14
|
||||
|
||||
|
||||
// mixed use of different data types in functions
|
||||
console.log('mixed use of data types');
|
||||
math.add(4, [5, 6]); // number + Array, [9, 10]
|
||||
@@ -44,22 +44,22 @@ Bignumbers examples
|
||||
// 'number' (default), 'bignumber', or 'fraction'
|
||||
precision: 20 // Number of significant digits for BigNumbers
|
||||
});
|
||||
|
||||
|
||||
console.log('round-off errors with numbers');
|
||||
math.add(0.1, 0.2); // number, 0.30000000000000004
|
||||
math.divide(0.3, 0.2); // number, 1.4999999999999998
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('no round-off errors with BigNumbers');
|
||||
math.add(math.bignumber(0.1), math.bignumber(0.2)); // BigNumber, 0.3
|
||||
math.divide(math.bignumber(0.3), math.bignumber(0.2)); // BigNumber, 1.5
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('create BigNumbers from strings when exceeding the range of a number');
|
||||
math.bignumber(1.2e+500); // BigNumber, Infinity WRONG
|
||||
math.bignumber('1.2e+500'); // BigNumber, 1.2e+500
|
||||
console.log();
|
||||
|
||||
|
||||
// one can work conveniently with BigNumbers using the expression parser.
|
||||
// note though that BigNumbers are only supported in arithmetic functions
|
||||
console.log('use BigNumbers in the expression parser');
|
||||
@@ -80,33 +80,33 @@ Chaining examples
|
||||
.add(4)
|
||||
.multiply(2)
|
||||
.done(); // 14
|
||||
|
||||
|
||||
// Another example, calculate square(sin(pi / 4))
|
||||
var b = math.chain(math.pi)
|
||||
.divide(4)
|
||||
.sin()
|
||||
.square()
|
||||
.done(); // 0.5
|
||||
|
||||
|
||||
// A chain has a few special methods: done, toString, valueOf, get, and set.
|
||||
// these are demonstrated in the following examples
|
||||
|
||||
|
||||
// toString will return a string representation of the chain's value
|
||||
var chain = math.chain(2).divide(3);
|
||||
var str = chain.toString(); // "0.6666666666666666"
|
||||
|
||||
|
||||
// a chain has a function .valueOf(), which returns the value hold by the chain.
|
||||
// This allows using it in regular operations. The function valueOf() acts the
|
||||
// same as function done().
|
||||
chain.valueOf(); // 0.66666666666667
|
||||
|
||||
|
||||
|
||||
|
||||
// the function subset can be used to get or replace sub matrices
|
||||
var array = [[1, 2], [3, 4]];
|
||||
var v = math.chain(array)
|
||||
.subset(math.index(1, 0))
|
||||
.done(); // 3
|
||||
|
||||
|
||||
var m = math.chain(array)
|
||||
.subset(math.index(0, 0), 8)
|
||||
.multiply(3)
|
||||
@@ -119,38 +119,38 @@ Complex numbers examples
|
||||
*/
|
||||
(function(){
|
||||
var a = math.complex(2, 3); // 2 + 3i
|
||||
|
||||
|
||||
// read the real and complex parts of the complex number
|
||||
a.re; // 2
|
||||
a.im; // 3
|
||||
|
||||
|
||||
// clone a complex value
|
||||
var clone = a.clone(); // 2 + 3i
|
||||
|
||||
|
||||
// adjust the complex value
|
||||
a.re = 5; // 5 + 3i
|
||||
|
||||
|
||||
// create a complex number by providing a string with real and complex parts
|
||||
var b = math.complex('3 - 7i'); // 3 - 7i
|
||||
console.log();
|
||||
|
||||
|
||||
// perform operations with complex numbers
|
||||
console.log('perform operations');
|
||||
math.add(a, b); // 8 - 4i
|
||||
math.multiply(a, b); // 36 - 26i
|
||||
math.sin(a); // -9.6541254768548 + 2.8416922956064i
|
||||
|
||||
|
||||
// some operations will return a complex number depending on the arguments
|
||||
math.sqrt(4); // 2
|
||||
math.sqrt(-4); // 2i
|
||||
|
||||
|
||||
// create a complex number from polar coordinates
|
||||
console.log('create complex numbers with polar coordinates');
|
||||
var c = math.complex({r: math.sqrt(2), phi: math.pi / 4}); // 1 + i
|
||||
|
||||
|
||||
// get polar coordinates of a complex number
|
||||
var d = math.complex(3, 4);
|
||||
d.toPolar(); // { r: 5, phi: 0.9272952180016122 }
|
||||
d.toPolar(); // { r: 5, phi: 0.9272952180016122 }
|
||||
}());
|
||||
|
||||
|
||||
@@ -166,14 +166,14 @@ Expressions examples
|
||||
// JavaScript Object. The scope will be used to resolve symbols, and to write
|
||||
// assigned variables or function.
|
||||
console.log('1. USING FUNCTION MATH.EVAL');
|
||||
|
||||
|
||||
// evaluate expressions
|
||||
console.log('\nevaluate expressions');
|
||||
math.eval('sqrt(3^2 + 4^2)'); // 5
|
||||
math.eval('sqrt(-4)'); // 2i
|
||||
math.eval('2 inch to cm'); // 5.08 cm
|
||||
math.eval('cos(45 deg)'); // 0.70711
|
||||
|
||||
|
||||
// evaluate multiple expressions at once
|
||||
console.log('\nevaluate multiple expressions at once');
|
||||
math.eval([
|
||||
@@ -181,34 +181,34 @@ Expressions examples
|
||||
'g = 4',
|
||||
'f * g'
|
||||
]); // [3, 4, 12]
|
||||
|
||||
|
||||
// provide a scope (just a regular JavaScript Object)
|
||||
console.log('\nevaluate expressions providing a scope with variables and functions');
|
||||
var scope: any = {
|
||||
a: 3,
|
||||
b: 4
|
||||
};
|
||||
|
||||
|
||||
// variables can be read from the scope
|
||||
math.eval('a * b', scope); // 12
|
||||
|
||||
|
||||
// variable assignments are written to the scope
|
||||
math.eval('c = 2.3 + 4.5', scope); // 6.8
|
||||
scope.c; // 6.8
|
||||
|
||||
|
||||
// scope can contain both variables and functions
|
||||
scope["hello"] = function (name: string) {
|
||||
return 'hello, ' + name + '!';
|
||||
};
|
||||
math.eval('hello("hero")', scope); // "hello, hero!"
|
||||
|
||||
|
||||
// define a function as an expression
|
||||
var f = math.eval('f(x) = x ^ a', scope);
|
||||
f(2); // 8
|
||||
scope.f(2); // 8
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 2. using function math.parse
|
||||
//
|
||||
// Function `math.parse` parses expressions into a node tree. The syntax is
|
||||
@@ -219,16 +219,16 @@ Expressions examples
|
||||
// scope. This scope is a regular JavaScript Object. The scope will be used
|
||||
// to resolve symbols, and to write assigned variables or function.
|
||||
console.log('\n2. USING FUNCTION MATH.PARSE');
|
||||
|
||||
|
||||
// parse an expression
|
||||
console.log('\nparse an expression into a node tree');
|
||||
var node1 = math.parse('sqrt(3^2 + 4^2)');
|
||||
node1.toString(); // "sqrt((3 ^ 2) + (4 ^ 2))"
|
||||
|
||||
|
||||
// compile and evaluate the compiled code
|
||||
// you could also do this in two steps: node1.compile().eval()
|
||||
node1.eval(); // 5
|
||||
|
||||
|
||||
// provide a scope
|
||||
console.log('\nprovide a scope');
|
||||
var node2 = math.parse('x^a');
|
||||
@@ -239,12 +239,12 @@ Expressions examples
|
||||
a: 2
|
||||
};
|
||||
code2.eval(scope); // 9
|
||||
|
||||
|
||||
// change a value in the scope and re-evaluate the node
|
||||
scope.a = 3;
|
||||
code2.eval(scope); // 27
|
||||
|
||||
|
||||
|
||||
|
||||
// 3. using function math.compile
|
||||
//
|
||||
// Function `math.compile` compiles expressions into a node tree. The syntax is
|
||||
@@ -255,14 +255,14 @@ Expressions examples
|
||||
// be provided. This scope will be used to resolve symbols, and to write
|
||||
// assigned variables or function.
|
||||
console.log('\n3. USING FUNCTION MATH.COMPILE');
|
||||
|
||||
|
||||
// parse an expression
|
||||
console.log('\ncompile an expression');
|
||||
var code3 = math.compile('sqrt(3^2 + 4^2)');
|
||||
|
||||
|
||||
// evaluate the compiled code
|
||||
code3.eval(); // 5
|
||||
|
||||
|
||||
// provide a scope for the variable assignment
|
||||
console.log('\nprovide a scope');
|
||||
var code2 = math.compile('a = a + 3');
|
||||
@@ -271,8 +271,8 @@ Expressions examples
|
||||
};
|
||||
code2.eval(scope);
|
||||
scope.a; // 10
|
||||
|
||||
|
||||
|
||||
|
||||
// 4. using a parser
|
||||
//
|
||||
// In addition to the static functions `math.eval` and `math.parse`, math.js
|
||||
@@ -281,21 +281,21 @@ Expressions examples
|
||||
// some convenience methods to get, set, and remove variables from memory.
|
||||
console.log('\n4. USING A PARSER');
|
||||
var parser = math.parser();
|
||||
|
||||
|
||||
// evaluate with parser
|
||||
console.log('\nevaluate expressions');
|
||||
parser.eval('sqrt(3^2 + 4^2)'); // 5
|
||||
parser.eval('sqrt(-4)'); // 2i
|
||||
parser.eval('2 inch to cm'); // 5.08 cm
|
||||
parser.eval('cos(45 deg)'); // 0.70711
|
||||
|
||||
|
||||
// define variables and functions
|
||||
console.log('\ndefine variables and functions');
|
||||
parser.eval('x = 7 / 2'); // 3.5
|
||||
parser.eval('x + 3'); // 6.5
|
||||
parser.eval('f(x, y) = x^y'); // f(x, y)
|
||||
parser.eval('f(2, 3)'); // 8
|
||||
|
||||
|
||||
// manipulate matrices
|
||||
// Note that matrix indexes in the expression parser are one-based with the
|
||||
// upper-bound included. On a JavaScript level however, math.js uses zero-based
|
||||
@@ -308,7 +308,7 @@ Expressions examples
|
||||
parser.eval('m = k * l'); // [[19, 22], [43, 50]]
|
||||
parser.eval('n = m[2, 1]'); // 43
|
||||
parser.eval('n = m[:, 1]'); // [[19], [43]]
|
||||
|
||||
|
||||
// get and set variables and functions
|
||||
console.log('\nget and set variables and function in the scope of the parser');
|
||||
var x = parser.get('x');
|
||||
@@ -317,14 +317,14 @@ Expressions examples
|
||||
console.log('f =', math.format(f)); // f = f(x, y)
|
||||
var g = f(3, 3);
|
||||
console.log('g =', g); // g = 27
|
||||
|
||||
|
||||
parser.set('h', 500);
|
||||
parser.eval('h / 2'); // 250
|
||||
parser.set('hello', function (name: string) {
|
||||
return 'hello, ' + name + '!';
|
||||
});
|
||||
parser.eval('hello("hero")'); // "hello, hero!"
|
||||
|
||||
|
||||
// clear defined functions and variables
|
||||
parser.clear();
|
||||
}());
|
||||
@@ -339,7 +339,7 @@ Fractions examples
|
||||
number: 'fraction' // Default type of number:
|
||||
// 'number' (default), 'bignumber', or 'fraction'
|
||||
});
|
||||
|
||||
|
||||
console.log('basic usage');
|
||||
math.fraction(0.125); // Fraction, 1/8
|
||||
math.fraction(0.32); // Fraction, 8/25
|
||||
@@ -348,23 +348,23 @@ Fractions examples
|
||||
math.fraction(2, 3); // Fraction, 2/3
|
||||
math.fraction('0.(285714)'); // Fraction, 2/7
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('round-off errors with numbers');
|
||||
math.add(0.1, 0.2); // number, 0.30000000000000004
|
||||
math.divide(0.3, 0.2); // number, 1.4999999999999998
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('no round-off errors with fractions :)');
|
||||
math.add(math.fraction(0.1), math.fraction(0.2)); // Fraction, 3/10
|
||||
math.divide(math.fraction(0.3), math.fraction(0.2)); // Fraction, 3/2
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('represent an infinite number of repeating digits');
|
||||
math.fraction('1/3'); // Fraction, 0.(3)
|
||||
math.fraction('2/7'); // Fraction, 0.(285714)
|
||||
math.fraction('23/11'); // Fraction, 2.(09)
|
||||
console.log();
|
||||
|
||||
|
||||
// one can work conveniently with fractions using the expression parser.
|
||||
// note though that Fractions are only supported by basic arithmetic functions
|
||||
console.log('use fractions in the expression parser');
|
||||
@@ -372,7 +372,7 @@ Fractions examples
|
||||
math.eval('0.3 / 0.2'); // Fraction, 3/2
|
||||
math.eval('23 / 11'); // Fraction, 23/11
|
||||
console.log();
|
||||
|
||||
|
||||
// output formatting
|
||||
console.log('output formatting of fractions');
|
||||
var a = math.fraction('2/3');
|
||||
@@ -380,7 +380,7 @@ Fractions examples
|
||||
console.log(math.format(a, {fraction: 'ratio'})); // Fraction, 2/3
|
||||
console.log(math.format(a, {fraction: 'decimal'})); // Fraction, 0.(6)
|
||||
console.log(a.toString()); // Fraction, 0.(6)
|
||||
console.log();
|
||||
console.log();
|
||||
}());
|
||||
|
||||
/*
|
||||
@@ -393,33 +393,33 @@ Matrices examples
|
||||
var a = math.matrix([1, 4, 9, 16, 25]); // [1, 4, 9, 16, 25]
|
||||
var b = math.matrix(math.ones([2, 3])); // [[1, 1, 1], [1, 1, 1]]
|
||||
b.size(); // [2, 3]
|
||||
|
||||
|
||||
// the Array data of a Matrix can be retrieved using valueOf()
|
||||
var array = a.valueOf(); // [1, 4, 9, 16, 25]
|
||||
|
||||
|
||||
// Matrices can be cloned
|
||||
var clone = a.clone(); // [1, 4, 9, 16, 25]
|
||||
console.log();
|
||||
|
||||
|
||||
// perform operations with matrices
|
||||
console.log('perform operations');
|
||||
math.sqrt(a); // [1, 2, 3, 4, 5]
|
||||
var c = [1, 2, 3, 4, 5];
|
||||
math.factorial(c); // [1, 2, 6, 24, 120]
|
||||
console.log();
|
||||
|
||||
|
||||
// create and manipulate matrices. Arrays and Matrices can be used mixed.
|
||||
console.log('manipulate matrices');
|
||||
var d = [[1, 2], [3, 4]]; // [[1, 2], [3, 4]]
|
||||
var e = math.matrix([[5, 6], [1, 1]]); // [[5, 6], [1, 1]]
|
||||
|
||||
|
||||
// set a submatrix.
|
||||
// Matrix indexes are zero-based.
|
||||
e.subset(math.index(1, [0, 1]), [[7, 8]]); // [[5, 6], [7, 8]]
|
||||
var f = math.multiply(d, e); // [[19, 22], [43, 50]]
|
||||
var g = f.subset(math.index(1, 0)); // 43
|
||||
console.log();
|
||||
|
||||
|
||||
// get a sub matrix
|
||||
// Matrix indexes are zero-based.
|
||||
console.log('get a sub matrix');
|
||||
@@ -428,8 +428,8 @@ Matrices examples
|
||||
var i = math.range(1,6); // [1, 2, 3, 4, 5]
|
||||
i.subset(math.index(math.range(1,4))); // [2, 3, 4]
|
||||
console.log();
|
||||
|
||||
|
||||
|
||||
|
||||
// resize a multi dimensional matrix
|
||||
console.log('resizing a matrix');
|
||||
var j = math.matrix();
|
||||
@@ -439,20 +439,20 @@ Matrices examples
|
||||
j.resize([2, 2]); // [[0, 0], [0, 0]]
|
||||
j.size(); // [2, 2]
|
||||
console.log();
|
||||
|
||||
|
||||
// setting a value outside the matrices range will resize the matrix.
|
||||
// new elements will be initialized with zero.
|
||||
console.log('set a value outside a matrices range');
|
||||
var k = math.matrix();
|
||||
k.subset(math.index(2), 6); // [0, 0, 6]
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('set a value outside a matrices range, leaving new entries uninitialized');
|
||||
var m = math.matrix();
|
||||
defaultValue = math.uninitialized;
|
||||
m.subset(math.index(2), 6, defaultValue); // [undefined, undefined, 6]
|
||||
console.log();
|
||||
|
||||
|
||||
// create ranges
|
||||
console.log('create ranges');
|
||||
math.range(1, 6); // [1, 2, 3, 4, 5]
|
||||
@@ -469,14 +469,14 @@ Sparse matrices examples
|
||||
// create a sparse matrix
|
||||
console.log('creating a 1000x1000 sparse matrix...');
|
||||
var a = math.eye(1000, 1000, 'sparse');
|
||||
|
||||
|
||||
// do operations with a sparse matrix
|
||||
console.log('doing some operations on the sparse matrix...');
|
||||
var b = math.multiply(a, a);
|
||||
var c = math.multiply(b, math.complex(2, 2));
|
||||
var d = math.transpose(c);
|
||||
var e = math.multiply(d, a);
|
||||
|
||||
|
||||
// we will not print the output, but doing the same operations
|
||||
// with a dense matrix are very slow, try it for yourself.
|
||||
console.log('already done');
|
||||
@@ -493,7 +493,7 @@ Units examples
|
||||
var a = math.unit(45, 'cm'); // 450 mm
|
||||
var b = math.unit('0.1m'); // 100 mm
|
||||
console.log();
|
||||
|
||||
|
||||
// units can be added, subtracted, and multiplied or divided by numbers and by other units
|
||||
console.log('perform operations');
|
||||
math.add(a, b); // 0.55 m
|
||||
@@ -501,7 +501,7 @@ Units examples
|
||||
math.divide(math.unit('1 m'), math.unit('1 s')); // 1 m / s
|
||||
math.pow(math.unit('12 in'), 3); // 1728 in^3
|
||||
console.log();
|
||||
|
||||
|
||||
// units can be converted to a specific type, or to a number
|
||||
console.log('convert to another type or to a number');
|
||||
b.to('cm'); // 10 cm Alternatively: math.to(b, 'cm')
|
||||
@@ -509,25 +509,25 @@ Units examples
|
||||
b.toNumber('cm'); // 10
|
||||
math.number(b, 'cm'); // 10
|
||||
console.log();
|
||||
|
||||
|
||||
// the expression parser supports units too
|
||||
console.log('parse expressions');
|
||||
math.eval('2 inch to cm'); // 5.08 cm
|
||||
math.eval('cos(45 deg)'); // 0.70711...
|
||||
math.eval('90 km/h to m/s'); // 25 m / s
|
||||
console.log();
|
||||
|
||||
|
||||
// convert a unit to a number
|
||||
// A second parameter with the unit for the exported number must be provided
|
||||
math.eval('number(5 cm, mm)'); // number, 50
|
||||
console.log();
|
||||
|
||||
|
||||
// simplify units
|
||||
console.log('simplify units');
|
||||
math.eval('100000 N / m^2'); // 100 kPa
|
||||
math.eval('9.81 m/s^2 * 100 kg * 40 m'); // 39.24 kJ
|
||||
console.log();
|
||||
|
||||
|
||||
// example engineering calculations
|
||||
console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol');
|
||||
var Rg = math.unit('8.314 N m / (mol K)');
|
||||
@@ -539,7 +539,7 @@ Units examples
|
||||
console.log('T = ' + format(T));
|
||||
console.log('v = Rg * T / P = ' + format(math.to(v, 'L/mol'))); // 23.910... L / mol
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('compute speed of fluid flowing out of hole in a container');
|
||||
var g = math.unit('9.81 m / s^2');
|
||||
var h = math.unit('1 m');
|
||||
@@ -548,17 +548,17 @@ Units examples
|
||||
console.log('h = ' + format(h));
|
||||
console.log('v = (2 g h) ^ 0.5 = ' + format(v2)); // 4.429... m / s
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('electrical power consumption:');
|
||||
var expr = '460 V * 20 A * 30 days to kWh';
|
||||
console.log(expr + ' = ' + math.eval(expr)); // 6624 kWh
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('circuit design:');
|
||||
var expr = '24 V / (6 mA)';
|
||||
console.log(expr + ' = ' + math.eval(expr)); // 4 kohm
|
||||
console.log();
|
||||
|
||||
|
||||
console.log('operations on arrays:');
|
||||
var B = math.eval('[1, 0, 0] T');
|
||||
var v3 = math.eval('[0, 1, 0] m/s');
|
||||
@@ -568,7 +568,7 @@ Units examples
|
||||
console.log('v (particle velocity) = ' + format(v3)); // [0 m / s, 1 m / s, 0 m / s]
|
||||
console.log('q (particle charge) = ' + format(q)); // 1 C
|
||||
console.log('F (force) = q (v cross B) = ' + format(F)); // [0 N, 0 N, -1 N]
|
||||
|
||||
|
||||
/**
|
||||
* Helper function to format an output a value.
|
||||
* @param {*} value
|
||||
@@ -578,4 +578,63 @@ Units examples
|
||||
var precision = 14;
|
||||
return math.format(value, precision);
|
||||
}
|
||||
}());
|
||||
}());
|
||||
|
||||
|
||||
/*
|
||||
Expression tree examples
|
||||
*/
|
||||
(function(){
|
||||
|
||||
// Filter an expression tree
|
||||
console.log('Filter all symbol nodes "x" in the expression "x^2 + x/4 + 3*y"');
|
||||
var node = math.parse('x^2 + x/4 + 3*y');
|
||||
var filtered = node.filter(function (node) {
|
||||
return node.isSymbolNode && node.name == 'x';
|
||||
});
|
||||
// returns an array with two entries: two SymbolNodes 'x'
|
||||
|
||||
filtered.forEach(function (node) {
|
||||
console.log(node.type, node.toString())
|
||||
});
|
||||
// outputs:
|
||||
// SymbolNode x
|
||||
// SymbolNode x
|
||||
|
||||
|
||||
// Traverse an expression tree
|
||||
console.log();
|
||||
console.log('Traverse the expression tree of expression "3 * x + 2"');
|
||||
var node1 = math.parse('3 * x + 2');
|
||||
node1.traverse(function (node, path, parent) {
|
||||
switch (node.type) {
|
||||
// case 'OperatorNode': console.log(node.type, node.op); break;
|
||||
case 'OperatorNode': console.log(node.type); break;//for now removing .op
|
||||
case 'ConstantNode': console.log(node.type, node.value); break;
|
||||
case 'SymbolNode': console.log(node.type, node.name); break;
|
||||
default: console.log(node.type);
|
||||
}
|
||||
});
|
||||
// outputs:
|
||||
// OperatorNode +
|
||||
// OperatorNode *
|
||||
// ConstantNode 3
|
||||
// SymbolNode x
|
||||
// ConstantNode 2
|
||||
|
||||
|
||||
// transform an expression tree
|
||||
// console.log();
|
||||
// console.log('Replace all symbol nodes "x" in expression "x^2 + 5*x" with a constant 3');
|
||||
// var node2 = math.parse('x^2 + 5*x');
|
||||
// var transformed = node2.transform(function (node, path, parent) {
|
||||
// if (node.isSymbolNode && node.name == 'x') {
|
||||
// return new math.expression.node.ConstantNode(3);
|
||||
// }
|
||||
// else {
|
||||
// return node;
|
||||
// }
|
||||
// });
|
||||
// console.log(transformed.toString());
|
||||
// outputs: '(3 ^ 2) + (5 * 3)'
|
||||
}());
|
||||
|
||||
Vendored
+509
-437
File diff suppressed because it is too large
Load Diff
+42
-40
@@ -43,7 +43,7 @@ Meteor.publish("adminSecretInfo", function () {
|
||||
return Rooms.find({admin: this.userId}, {fields: {secretInfo: 1}});
|
||||
});
|
||||
|
||||
Meteor.publish("roomAndMessages", function (roomId) {
|
||||
Meteor.publish("roomAndMessages", function (roomId: string) {
|
||||
check(roomId, String);
|
||||
return [
|
||||
Rooms.find({_id: roomId}, {fields: {secretInfo: 0}}),
|
||||
@@ -54,20 +54,20 @@ Meteor.publish("roomAndMessages", function (roomId) {
|
||||
/**
|
||||
* Also from Publish and Subscribe, Meteor.publish section
|
||||
*/
|
||||
Meteor.publish("counts-by-room", function (roomId) {
|
||||
Meteor.publish("counts-by-room", function (roomId: string) {
|
||||
var self = this;
|
||||
check(roomId, String);
|
||||
var count = 0;
|
||||
var initializing = true;
|
||||
var handle = Messages.find({roomId: roomId}).observeChanges({
|
||||
added: function (id) {
|
||||
added: function (id: any) {
|
||||
count++;
|
||||
// if (!initializing)
|
||||
|
||||
// Todo: Not sure how to define in typescript
|
||||
// self.changed("counts", roomId, {count: count});
|
||||
},
|
||||
removed: function (id) {
|
||||
removed: function (id: any) {
|
||||
count--;
|
||||
// Todo: Not sure how to define in typescript
|
||||
// self.changed("counts", roomId, {count: count});
|
||||
@@ -112,7 +112,7 @@ Tracker.autorun(function () {
|
||||
* From Methods, Meteor.methods section
|
||||
*/
|
||||
Meteor.methods({
|
||||
foo: function (arg1, arg2) {
|
||||
foo: function (arg1: string, arg2: number[]) {
|
||||
check(arg1, String);
|
||||
check(arg2, [Number]);
|
||||
|
||||
@@ -134,7 +134,11 @@ Meteor.methods({
|
||||
throw new Meteor.Error("logged-out",
|
||||
"The user must be logged in to post a comment.");
|
||||
|
||||
Meteor.call("methodName", function (error) {
|
||||
throw new Meteor.Error(403,
|
||||
"The user must be logged in to post a comment.");
|
||||
|
||||
|
||||
Meteor.call("methodName", function (error: Meteor.Error) {
|
||||
if (error.error === "logged-out") {
|
||||
Session.set("errorMessage", "Please log in to post a comment.");
|
||||
}
|
||||
@@ -147,7 +151,7 @@ console.log(error.details !== "");
|
||||
/**
|
||||
* From Methods, Meteor.call section
|
||||
*/
|
||||
Meteor.call('foo', 1, 2, function (error, result) {} );
|
||||
Meteor.call('foo', 1, 2, function (error:any, result:any) {} );
|
||||
var result = Meteor.call('foo', 1, 2);
|
||||
|
||||
/**
|
||||
@@ -164,7 +168,7 @@ interface MessagesDAO {
|
||||
var Chatrooms = new Mongo.Collection<ChatroomsDAO>("chatrooms");
|
||||
Messages = new Mongo.Collection<MessagesDAO>("messages");
|
||||
|
||||
var myMessages = <MessagesDAO> Messages.find({userId: Session.get('myUserId')}).fetch();
|
||||
var myMessages:any[] = Messages.find({userId: Session.get('myUserId')}).fetch();
|
||||
|
||||
Messages.insert({text: "Hello, world!"});
|
||||
|
||||
@@ -186,17 +190,15 @@ Posts.insert({title: "Hello world", body: "First post"});
|
||||
assert(Scratchpad.find({number: {$lt: 9}}).count() === 5);
|
||||
**/
|
||||
|
||||
var Animal = function (doc) {
|
||||
// _.extend(this, doc);
|
||||
};
|
||||
|
||||
// DA: I altered this to remove dependencies on Underscore
|
||||
Animal.prototype = {
|
||||
makeNoise: function () {
|
||||
console.log(this.sound);
|
||||
}
|
||||
};
|
||||
class Animal {
|
||||
private sound:string;
|
||||
constructor(doc:any) {
|
||||
|
||||
}
|
||||
makeNoise() {
|
||||
console.log(this.sound)
|
||||
}
|
||||
}
|
||||
|
||||
interface AnimalDAO {
|
||||
_id?: string;
|
||||
@@ -207,7 +209,7 @@ interface AnimalDAO {
|
||||
|
||||
// Define a Collection that uses Animal as its document
|
||||
var Animals = new Mongo.Collection<AnimalDAO>("Animals", {
|
||||
transform: function (doc) { return new Animal(doc); }
|
||||
transform: function (doc:any): Animal { return new Animal(doc); }
|
||||
});
|
||||
|
||||
// Create an Animal and call its makeNoise method
|
||||
@@ -280,15 +282,15 @@ interface iPost {
|
||||
Posts = new Mongo.Collection<iPost>("posts");
|
||||
|
||||
Posts.allow({
|
||||
insert: function (userId, doc: iPost) {
|
||||
insert: function (userId:string, doc: iPost) {
|
||||
// the user must be logged in, and the document must be owned by the user
|
||||
return (userId && doc.owner === userId);
|
||||
},
|
||||
update: function (userId, doc: iPost, fields, modifier) {
|
||||
update: function (userId:string, doc: iPost, fields:string[], modifier:any) {
|
||||
// can only change your own documents
|
||||
return doc.owner === userId;
|
||||
},
|
||||
remove: function (userId, doc: iPost) {
|
||||
remove: function (userId:string, doc: iPost) {
|
||||
// can only remove your own documents
|
||||
return doc.owner === userId;
|
||||
},
|
||||
@@ -296,11 +298,11 @@ Posts.allow({
|
||||
});
|
||||
|
||||
Posts.deny({
|
||||
update: function (userId, doc: iPost, fields, modifier) {
|
||||
update: function (userId:string, doc: iPost, fields:string[], modifier:any) {
|
||||
// can't change owners
|
||||
return doc.userId !== userId;
|
||||
},
|
||||
remove: function (userId, doc: iPost) {
|
||||
remove: function (userId:string, doc: iPost) {
|
||||
// can't remove locked documents
|
||||
return doc.locked;
|
||||
},
|
||||
@@ -312,7 +314,7 @@ Posts.deny({
|
||||
*/
|
||||
var topPosts = Posts.find({}, {sort: {score: -1}, limit: 5});
|
||||
var count = 0;
|
||||
topPosts.forEach(function (post) {
|
||||
topPosts.forEach(function (post:{title:string}) {
|
||||
console.log("Title of post " + count + ": " + post.title);
|
||||
count += 1;
|
||||
});
|
||||
@@ -326,7 +328,7 @@ var Users = new Mongo.Collection('users');
|
||||
var count1 = 0;
|
||||
var query = Users.find({admin: true, onlineNow: true});
|
||||
var handle = query.observeChanges({
|
||||
added: function (id, user) {
|
||||
added: function (id:string, user:{name:string}) {
|
||||
count1++;
|
||||
console.log(user.name + " brings the total to " + count1 + " admins.");
|
||||
},
|
||||
@@ -364,7 +366,7 @@ Session.set("enemy", "Eurasia");
|
||||
/**
|
||||
* From Sessions, Session.equals section
|
||||
*/
|
||||
var value;
|
||||
var value: string;
|
||||
Session.get("key") === value;
|
||||
Session.equals("key", value);
|
||||
|
||||
@@ -383,7 +385,7 @@ Meteor.users.deny({update: function () { return true; }});
|
||||
*/
|
||||
Meteor.loginWithGithub({
|
||||
requestPermissions: ['user', 'public_repo']
|
||||
}, function (err) {
|
||||
}, function (err: Meteor.Error) {
|
||||
if (err)
|
||||
Session.set('errorMessage', err.reason || 'Unknown error');
|
||||
});
|
||||
@@ -405,20 +407,20 @@ Accounts.ui.config({
|
||||
/**
|
||||
* From Accounts, Accounts.validateNewUser section
|
||||
*/
|
||||
Accounts.validateNewUser(function (user) {
|
||||
Accounts.validateNewUser(function (user:{username:string}) {
|
||||
if (user.username && user.username.length >= 3)
|
||||
return true;
|
||||
throw new Meteor.Error("403", "Username must have at least 3 characters");
|
||||
});
|
||||
// Validate username, without a specific error message.
|
||||
Accounts.validateNewUser(function (user) {
|
||||
Accounts.validateNewUser(function (user:{username:string}) {
|
||||
return user.username !== "root";
|
||||
});
|
||||
|
||||
/**
|
||||
* From Accounts, Accounts.onCreateUser section
|
||||
*/
|
||||
Accounts.onCreateUser(function(options, user) {
|
||||
Accounts.onCreateUser(function(options:{profile:any}, user:{profile:any, dexterity:number}) {
|
||||
var d6 = function () { return Math.floor(Math.random() * 6) + 1; };
|
||||
user.dexterity = d6() + d6() + d6();
|
||||
// We still want the default hook's 'profile' behavior.
|
||||
@@ -432,10 +434,10 @@ Accounts.onCreateUser(function(options, user) {
|
||||
*/
|
||||
Accounts.emailTemplates.siteName = "AwesomeSite";
|
||||
Accounts.emailTemplates.from = "AwesomeSite Admin <accounts@example.com>";
|
||||
Accounts.emailTemplates.enrollAccount.subject = function (user) {
|
||||
Accounts.emailTemplates.enrollAccount.subject = function (user:{ profile:{name: string} }) {
|
||||
return "Welcome to Awesome Town, " + user.profile.name;
|
||||
};
|
||||
Accounts.emailTemplates.enrollAccount.text = function (user, url) {
|
||||
Accounts.emailTemplates.enrollAccount.text = function (user:any, url:string) {
|
||||
return "You have been selected to participate in building a better future!"
|
||||
+ " To activate your account, simply click the link below:\n\n"
|
||||
+ url;
|
||||
@@ -485,13 +487,13 @@ var body = Template.body;
|
||||
*/
|
||||
var Chats = new Mongo.Collection('chats');
|
||||
|
||||
Meteor.publish("chats-in-room", function (roomId) {
|
||||
Meteor.publish("chats-in-room", function (roomId:string) {
|
||||
// Make sure roomId is a string, not an arbitrary mongo selector object.
|
||||
check(roomId, String);
|
||||
return Chats.find({room: roomId});
|
||||
});
|
||||
|
||||
Meteor.methods({addChat: function (roomId, message) {
|
||||
Meteor.methods({addChat: function (roomId:string, message:{text:string, timestamp:Date, tags:string}) {
|
||||
check(roomId, String);
|
||||
check(message, {
|
||||
text: String,
|
||||
@@ -552,7 +554,7 @@ var getWeather = function () {
|
||||
return weather;
|
||||
};
|
||||
|
||||
var setWeather = function (w) {
|
||||
var setWeather = function (w:string) {
|
||||
weather = w;
|
||||
// (could add logic here to only call changed()
|
||||
// if the new value is different from the old)
|
||||
@@ -562,7 +564,7 @@ var setWeather = function (w) {
|
||||
/**
|
||||
* From HTTP, HTTP.call section
|
||||
*/
|
||||
Meteor.methods({checkTwitter: function (userId) {
|
||||
Meteor.methods({checkTwitter: function (userId:string) {
|
||||
check(userId, String);
|
||||
this.unblock();
|
||||
var result = HTTP.call("GET", "http://api.twitter.com/xyz",
|
||||
@@ -575,7 +577,7 @@ Meteor.methods({checkTwitter: function (userId) {
|
||||
|
||||
HTTP.call("POST", "http://api.twitter.com/xyz",
|
||||
{data: {some: "json", stuff: 1}},
|
||||
function (error, result) {
|
||||
function (error: Meteor.Error, result:any) {
|
||||
if (result.statusCode === 200) {
|
||||
Session.set("twizzled", true);
|
||||
}
|
||||
@@ -585,7 +587,7 @@ HTTP.call("POST", "http://api.twitter.com/xyz",
|
||||
* From Email, Email.send section
|
||||
*/
|
||||
Meteor.methods({
|
||||
sendEmail: function (to, from, subject, text) {
|
||||
sendEmail: function (to:string, from:string, subject:string, text:string) {
|
||||
check([to, from, subject, text], [String]);
|
||||
|
||||
// Let other method calls from the same client start running,
|
||||
@@ -617,7 +619,7 @@ Blaze.toHTMLWithData(testView, {test: 1});
|
||||
Blaze.toHTMLWithData(testView, function() {});
|
||||
|
||||
var reactiveVar1 = new ReactiveVar<string>('test value');
|
||||
var reactiveVar2 = new ReactiveVar<string>('test value', function(oldVal) { return true; });
|
||||
var reactiveVar2 = new ReactiveVar<string>('test value', function(oldVal:any) { return true; });
|
||||
|
||||
var varValue: string = reactiveVar1.get();
|
||||
reactiveVar1.set('new value');
|
||||
|
||||
@@ -1 +1 @@
|
||||
|
||||
--noImplicitAny
|
||||
|
||||
Vendored
+2
-2
@@ -522,10 +522,10 @@ declare module Match {
|
||||
declare module Meteor {
|
||||
var Error: ErrorStatic;
|
||||
interface ErrorStatic {
|
||||
new(error: string, reason?: string, details?: string): Error;
|
||||
new(error: string | number, reason?: string, details?: string): Error;
|
||||
}
|
||||
interface Error {
|
||||
error: string;
|
||||
error: string | number;
|
||||
reason?: string;
|
||||
details?: string;
|
||||
}
|
||||
|
||||
Vendored
+20
-12
@@ -11,6 +11,7 @@
|
||||
declare module "mongodb" {
|
||||
import {EventEmitter} from 'events';
|
||||
|
||||
|
||||
// Class documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/MongoClient.html
|
||||
export class MongoClient {
|
||||
constructor();
|
||||
@@ -150,7 +151,7 @@ declare module "mongodb" {
|
||||
socketOptions?: SocketOptions;
|
||||
}
|
||||
|
||||
// Class documentation : http://mongodb.github.io/node-mongodb-native/api-generated/db.html
|
||||
// Class documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html
|
||||
export class Db extends EventEmitter {
|
||||
constructor(databaseName: string, serverConfig: Server | ReplSet | Mongos, options?: DbCreateOptions);
|
||||
|
||||
@@ -322,7 +323,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
// http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html
|
||||
export class Admin {
|
||||
export interface Admin {
|
||||
// http://mongodb.github.io/node-mongodb-native/2.1/api/Admin.html#addUser
|
||||
addUser(username: string, password: string, callback: MongoCallback<any>): void;
|
||||
addUser(username: string, password: string, options?: AddUserOptions): Promise<any>;
|
||||
@@ -552,7 +553,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
// Documentation : http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html
|
||||
export class Collection {
|
||||
export interface Collection {
|
||||
// Get the collection name.
|
||||
collectionName: string;
|
||||
// Get the full collection namespace.
|
||||
@@ -642,7 +643,7 @@ declare module "mongodb" {
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeOrderedBulkOp
|
||||
initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#initializeUnorderedBulkOp
|
||||
initializeOrderedBulkOp(options: CollectionOptions): OrderedBulkOperation;
|
||||
initializeUnorderedBulkOp(options: CollectionOptions): OrderedBulkOperation;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Collection.html#insertMany
|
||||
insertMany(docs: Object[], callback: MongoCallback<InsertWriteOpResult>): void
|
||||
insertMany(docs: Object[], options?: CollectionInsertManyOptions): Promise<InsertWriteOpResult>;
|
||||
@@ -871,7 +872,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html
|
||||
export class OrderedBulkOperation {
|
||||
export interface OrderedBulkOperation {
|
||||
length: number;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/OrderedBulkOperation.html#execute
|
||||
execute(callback: MongoCallback<BulkWriteResult>): void;
|
||||
@@ -884,7 +885,14 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/BulkWriteResult.html
|
||||
export class BulkWriteResult {
|
||||
export interface BulkWriteResult {
|
||||
ok: boolean;
|
||||
nInserted: number;
|
||||
nUpdated: number;
|
||||
nUpserted: number;
|
||||
nModified: number;
|
||||
nRemoved: number;
|
||||
|
||||
getInsertedIds(): Array<Object>;
|
||||
getLastOp(): Object;
|
||||
getRawResponse(): Object;
|
||||
@@ -916,7 +924,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/FindOperatorsOrdered.html
|
||||
export class FindOperatorsOrdered {
|
||||
export interface FindOperatorsOrdered {
|
||||
delete(): OrderedBulkOperation;
|
||||
deleteOne(): OrderedBulkOperation;
|
||||
replaceOne(doc: Object): OrderedBulkOperation;
|
||||
@@ -926,7 +934,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html
|
||||
export class UnorderedBulkOperation {
|
||||
export interface UnorderedBulkOperation {
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/UnorderedBulkOperation.html#execute
|
||||
execute(callback: MongoCallback<BulkWriteResult>): void;
|
||||
execute(options: FSyncOptions): Promise<BulkWriteResult>;
|
||||
@@ -938,7 +946,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/FindOperatorsUnordered.html
|
||||
export class FindOperatorsUnordered {
|
||||
export interface FindOperatorsUnordered {
|
||||
length: number;
|
||||
remove(): UnorderedBulkOperation;
|
||||
removeOne(): UnorderedBulkOperation;
|
||||
@@ -1044,7 +1052,7 @@ declare module "mongodb" {
|
||||
export type CursorResult = any | void | boolean;
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Cursor.html
|
||||
export class Cursor extends EventEmitter implements Readable {
|
||||
export interface Cursor extends Readable, NodeJS.EventEmitter {
|
||||
|
||||
sortValue: string;
|
||||
timeout: boolean;
|
||||
@@ -1161,7 +1169,7 @@ declare module "mongodb" {
|
||||
export type AggregationCursorResult = any | void;
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html
|
||||
export class AggregationCursor extends EventEmitter implements Readable {
|
||||
export interface AggregationCursor extends Readable, NodeJS.EventEmitter {
|
||||
// http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#batchSize
|
||||
batchSize(value: number): AggregationCursor;
|
||||
// http://mongodb.github.io/node-mongodb-native/2.1/api/AggregationCursor.html#clone
|
||||
@@ -1225,7 +1233,7 @@ declare module "mongodb" {
|
||||
}
|
||||
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html
|
||||
export class CommandCursor extends EventEmitter implements Readable {
|
||||
export interface CommandCursor extends Readable, NodeJS.EventEmitter {
|
||||
// http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#batchSize
|
||||
batchSize(value: number): CommandCursor;
|
||||
// http://mongodb.github.io/node-mongodb-native/2.1/api/CommandCursor.html#clone
|
||||
|
||||
@@ -16,6 +16,8 @@ import * as path from "path";
|
||||
import * as readline from "readline";
|
||||
import * as childProcess from "child_process";
|
||||
import * as os from "os";
|
||||
// Specifically test buffer module regression.
|
||||
import {Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer} from "buffer";
|
||||
|
||||
assert(1 + 1 - 2 === 0, "The universe isn't how it should.");
|
||||
|
||||
@@ -169,6 +171,14 @@ function bufferTests() {
|
||||
index = buffer.indexOf(23);
|
||||
index = buffer.indexOf(buffer);
|
||||
}
|
||||
|
||||
// Imported Buffer from buffer module works properly
|
||||
{
|
||||
let b = new ImportedBuffer('123');
|
||||
b.writeUInt8(0, 6);
|
||||
let sb = new ImportedSlowBuffer(43);
|
||||
b.writeUInt8(0, 6);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vendored
+3
@@ -411,6 +411,9 @@ interface NodeBuffer {
|
||||
************************************************/
|
||||
declare module "buffer" {
|
||||
export var INSPECT_MAX_BYTES: number;
|
||||
var BuffType: typeof Buffer;
|
||||
var SlowBuffType: typeof SlowBuffer;
|
||||
export { BuffType as Buffer, SlowBuffType as SlowBuffer };
|
||||
}
|
||||
|
||||
declare module "querystring" {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/// <reference path="onoff" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
import * as onoff from 'onoff';
|
||||
|
||||
var led:onoff.Gpio = new onoff.Gpio(17, 'out');
|
||||
|
||||
var toggleLed = function():void {
|
||||
var lastState:number = led.readSync();
|
||||
led.writeSync(lastState ^ 1);
|
||||
};
|
||||
|
||||
var intervalId:NodeJS.Timer = setInterval(toggleLed, 100);
|
||||
|
||||
setTimeout(function() {
|
||||
clearInterval(intervalId);
|
||||
led.writeSync(0);
|
||||
led.unexport();
|
||||
}, 2000);
|
||||
Vendored
+55
@@ -0,0 +1,55 @@
|
||||
// Type definitions for onoff
|
||||
// Project: https://github.com/fivdi/onoff
|
||||
// Definitions by: Marcel Ernst <https://github.com/marcel-ernst>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare namespace __ONOFF {
|
||||
|
||||
var version:string;
|
||||
|
||||
interface GpioOptions {
|
||||
debounceTimeout:number;
|
||||
}
|
||||
|
||||
class Gpio {
|
||||
constructor(gpio:number, direction:string);
|
||||
constructor(gpio:number, direction:string, edge:string);
|
||||
constructor(gpio:number, direction:string, edge:string, options:GpioOptions);
|
||||
constructor(gpio:number, direction:string, options:GpioOptions);
|
||||
|
||||
gpio:number
|
||||
gpioPath:string;
|
||||
opts:GpioOptions;
|
||||
readBuffer:Buffer;
|
||||
listeners:Array<(error:Error, value:number) => void>;
|
||||
valueFd:number;
|
||||
|
||||
read(cb:(err:Error, value:number) => void):void;
|
||||
readSync():number;
|
||||
|
||||
write(value:number, cb:(err:Error, value:number) => void):void;
|
||||
writeSync(value:number):void;
|
||||
|
||||
watch(cb:(error:Error, value:number) => void):void;
|
||||
unwatch():void;
|
||||
unwatch(cb:(error:Error, value:number) => void):void;
|
||||
unwatchAll():void;
|
||||
|
||||
direction():string;
|
||||
setDirection(value:string):void;
|
||||
|
||||
edge():string;
|
||||
setEdge(value:string):void;
|
||||
|
||||
options():GpioOptions;
|
||||
|
||||
unexport():void;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "onoff" {
|
||||
export = __ONOFF;
|
||||
}
|
||||
@@ -360,10 +360,22 @@ var imageWMS: ol.source.ImageWMS = new ol.source.ImageWMS({
|
||||
// ol.source.TileWMS
|
||||
//
|
||||
var tileWMS: ol.source.TileWMS = new ol.source.TileWMS({
|
||||
params: {},
|
||||
serverType: stringValue,
|
||||
url:stringValue
|
||||
});
|
||||
|
||||
//
|
||||
// ol.source.WMTS
|
||||
//
|
||||
var wmts: ol.source.WMTS = new ol.source.WMTS({
|
||||
tileGrid: new ol.tilegrid.WMTS({}),
|
||||
layer: "",
|
||||
style: "",
|
||||
matrixSet: "",
|
||||
wrapX: true
|
||||
});
|
||||
|
||||
//
|
||||
// ol.animation
|
||||
//
|
||||
@@ -521,3 +533,14 @@ jsonValue = geojsonFormat.writeFeaturesObject(featureArray);
|
||||
jsonValue = geojsonFormat.writeFeaturesObject(featureArray, writeOptions);
|
||||
jsonValue = geojsonFormat.writeGeometryObject(geometry);
|
||||
jsonValue = geojsonFormat.writeGeometryObject(geometry, writeOptions);
|
||||
|
||||
//
|
||||
// ol.interactions
|
||||
//
|
||||
var modify: ol.interaction.Modify = new ol.interaction.Modify({
|
||||
features: new ol.Collection<ol.Feature>(featureArray)
|
||||
});
|
||||
|
||||
var draw: ol.interaction.Draw = new ol.interaction.Draw({
|
||||
type: "Point"
|
||||
})
|
||||
|
||||
Vendored
+229
-42
@@ -129,15 +129,30 @@ declare module olx {
|
||||
|
||||
interface TileWMSOptions {
|
||||
|
||||
attributions?: Array<ol.Attribution>;
|
||||
|
||||
/**WMS request parameters. At least a LAYERS param is required. STYLES is '' by default. VERSION is 1.3.0 by default. WIDTH, HEIGHT, BBOX and CRS (SRS for WMS version < 1.3.0) will be set dynamically. Required.*/
|
||||
params: Object;
|
||||
/**The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.*/
|
||||
crossOrigin?: string;
|
||||
|
||||
/** The size in pixels of the gutter around image tiles to ignore. By setting this property to a non-zero value, images will be requested that are wider and taller than the tile size by a value of 2 x gutter. Defaults to zero. Using a non-zero value allows artifacts of rendering at tile edges to be ignored. If you control the WMS service it is recommended to address "artifacts at tile edges" issues by properly configuring the WMS service. For example, MapServer has a tile_map_edge_buffer configuration parameter for this. See http://mapserver.org/output/tile_mode.html. */
|
||||
gutter?: number;
|
||||
|
||||
/** Use the ol.Map#pixelRatio value when requesting the image from the remote server. Default is true.*/
|
||||
hidpi?: boolean;
|
||||
|
||||
logo?: string | olx.LogoOptions;
|
||||
|
||||
/** Tile grid. Base this on the resolutions, tilesize and extent supported by the server. If this is not defined, a default grid will be used: if there is a projection extent, the grid will be based on that; if not, a grid based on a global extent with origin at 0,0 will be used. */
|
||||
tileGrid?: ol.tilegrid.TileGrid;
|
||||
|
||||
/** experimental Maximum zoom. */
|
||||
maxZoom?: number;
|
||||
|
||||
projection?: ol.proj.ProjectionLike;
|
||||
reprojectionErrorThreshold?: number;
|
||||
|
||||
/** experimental Optional function to load a tile given a URL. */
|
||||
tileLoadFunction?: ol.TileLoadFunctionType;
|
||||
|
||||
@@ -515,37 +530,47 @@ declare module olx {
|
||||
zoomDelta?: number;
|
||||
zoomDuration?: number;
|
||||
}
|
||||
interface ModifyOptions {
|
||||
deleteCondition?: ol.events.ConditionType;
|
||||
pixelTolerance?: number;
|
||||
style?: ol.style.Style | Array<ol.style.Style> | ol.style.StyleFunction;
|
||||
features: ol.Collection<ol.Feature>;
|
||||
wrapX?: boolean;
|
||||
}
|
||||
interface DrawOptions {
|
||||
clickTolerance?: number;
|
||||
features?: ol.Collection<ol.Feature>;
|
||||
source?: ol.source.Vector;
|
||||
snapTolerance?: number;
|
||||
type: ol.geom.GeometryType;
|
||||
maxPoints?: number;
|
||||
minPoints?: number;
|
||||
style?: ol.style.Style | Array<ol.style.Style> | ol.style.StyleFunction;
|
||||
geometryFunction?: ol.interaction.DrawGeometryFunctionType;
|
||||
wrapX?: boolean;
|
||||
}
|
||||
interface SelectOptions{
|
||||
addCondition?: ol.events.ConditionType;
|
||||
condition?: ol.events.ConditionType;
|
||||
layers?: Array<ol.layer.Layer>;
|
||||
style?: ol.style.Style | Array<ol.style.Style> | ol.style.StyleFunction;
|
||||
removeCondition?: ol.events.ConditionType;
|
||||
toggleCondition?: ol.events.ConditionType;
|
||||
multi?: boolean;
|
||||
features?: ol.Collection<ol.Feature>
|
||||
filter?: ol.interaction.SelectFilterFunction;
|
||||
wrapX?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
module layer {
|
||||
|
||||
interface BaseOptions {
|
||||
|
||||
/**
|
||||
* Brightness. Default is 0.
|
||||
*/
|
||||
brightness?: number;
|
||||
|
||||
/**
|
||||
* Contrast. Default is 1.
|
||||
*/
|
||||
contrast?: number;
|
||||
|
||||
/**
|
||||
* Hue. Default is 0.
|
||||
*/
|
||||
hue?: number;
|
||||
|
||||
/**
|
||||
* Opacity (0, 1). Default is 1.
|
||||
*/
|
||||
opacity?: number;
|
||||
|
||||
/**
|
||||
* Saturation. Default is 1.
|
||||
*/
|
||||
saturation?: number;
|
||||
|
||||
/**
|
||||
* Visibility. Default is true.
|
||||
*/
|
||||
@@ -555,7 +580,8 @@ declare module olx {
|
||||
* The bounding extent for layer rendering. The layer will not be rendered outside of this extent.
|
||||
*/
|
||||
extent?: ol.Extent;
|
||||
|
||||
|
||||
zIndex?: number;
|
||||
/**
|
||||
* The minimum resolution (inclusive) at which this layer will be visible.
|
||||
*/
|
||||
@@ -722,6 +748,28 @@ declare module olx {
|
||||
*/
|
||||
wrapX?: boolean;
|
||||
}
|
||||
interface WMTSOptions{
|
||||
attributions?: Array<ol.Attribution>;
|
||||
crossOrigin?: string;
|
||||
logo?: string | olx.LogoOptions;
|
||||
tileGrid: ol.tilegrid.WMTS; // REQUIRED !
|
||||
projection?: ol.proj.ProjectionLike;
|
||||
reprojectionErrorThreshold?: number;
|
||||
requestEncoding?: ol.source.WMTSRequestEncoding;
|
||||
layer: string; //REQUIRED
|
||||
style: string; //REQUIRED
|
||||
tileClass?: Function;
|
||||
tilePixelRatio?: number;
|
||||
version?: string;
|
||||
format?: string;
|
||||
matrixSet: string; //REQUIRED
|
||||
dimensions?: Object;
|
||||
url?: string;
|
||||
maxZoom?: number;
|
||||
tileLoadFunction?: ol.TileLoadFunctionType;
|
||||
urls?: Array<string>;
|
||||
wrapX: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
module style {
|
||||
@@ -751,6 +799,38 @@ declare module olx {
|
||||
fill?: ol.style.Fill;
|
||||
stroke?: ol.style.Stroke;
|
||||
}
|
||||
interface StrokeOptions {
|
||||
color?: ol.Color | string;
|
||||
lineCap?: string;
|
||||
lineJoin?: string;
|
||||
lineDash?: Array<number>;
|
||||
miterLimit?: number;
|
||||
width?: number;
|
||||
}
|
||||
interface IconOptions {
|
||||
anchor?: Array<number>;
|
||||
anchorOrigin?: string;
|
||||
anchorXUnits?: string;
|
||||
anchorYUnits?: string;
|
||||
crossOrigin?: string;
|
||||
img?: ol.Image | HTMLCanvasElement;
|
||||
offset?: Array<number>;
|
||||
offsetOrigin?: string;
|
||||
opacity?: number;
|
||||
scale?: number;
|
||||
snapToPixel?: boolean;
|
||||
rotateWithView?: boolean;
|
||||
rotation?: number;
|
||||
size?: ol.Size;
|
||||
imgSize?: ol.Size;
|
||||
src?: string;
|
||||
}
|
||||
interface CircleOptions {
|
||||
fill?: ol.style.Fill;
|
||||
radius: number;
|
||||
snapToPixel?: boolean;
|
||||
stroke?: ol.style.Stroke;
|
||||
}
|
||||
}
|
||||
|
||||
module tilegrid {
|
||||
@@ -1197,18 +1277,12 @@ declare module ol {
|
||||
* @param name The property name of the default geometry.
|
||||
*/
|
||||
setGeometryName(name: string): void;
|
||||
|
||||
|
||||
/**
|
||||
* Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the ol.source.Vector#getFeatureById method.
|
||||
* @param id The feature id.
|
||||
*/
|
||||
setId(id: number): void;
|
||||
|
||||
/**
|
||||
* Set the feature id. The feature id is considered stable and may be used when requesting features or comparing identifiers returned from a remote source. The feature id can be used with the ol.source.Vector#getFeatureById method.
|
||||
* @param id The feature id.
|
||||
*/
|
||||
setId(id: string): void;
|
||||
setId(id: string|number): void;
|
||||
|
||||
/**
|
||||
* Set the style for the feature. This can be a single style object, an array of styles, or a function that takes a resolution and returns an array of styles. If it is null the feature has no style (a null style).
|
||||
@@ -2399,7 +2473,21 @@ declare module ol {
|
||||
|
||||
module events {
|
||||
module condition {
|
||||
function altKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function altShiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function always(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function click(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function doubleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function mouseOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function never(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function noModifierKeys(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function platformModifierKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function pointerMove(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function shiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function singleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
function targetNotEditable(mapBrowserEvent: ol.MapBrowserEvent): boolean;
|
||||
}
|
||||
interface ConditionType { (mapBrowseEvent: ol.MapBrowserEvent): boolean; }
|
||||
}
|
||||
|
||||
module extent {
|
||||
@@ -2711,6 +2799,7 @@ declare module ol {
|
||||
}
|
||||
|
||||
class WFS {
|
||||
readFeatures(source: Document | Node | Object | string, option?: olx.format.ReadOptions): Array<ol.Feature>;
|
||||
}
|
||||
|
||||
class WKT {
|
||||
@@ -2789,6 +2878,17 @@ declare module ol {
|
||||
* @returns Extent
|
||||
*/
|
||||
getExtent(extent?: ol.Extent): ol.Extent;
|
||||
|
||||
/**
|
||||
* Transform each coordinate of the geometry from one coordinate reference system to another.
|
||||
* The geometry is modified in place. For example, a line will be transformed to a line and a
|
||||
* circle to a circle. If you do not want the geometry modified in place, first clone() it and
|
||||
* then use this function on the clone.
|
||||
* @param source The current projection. Can be a string identifier or a ol.proj.Projection object.
|
||||
* @param destination The desired projection. Can be a string identifier or a ol.proj.Projection object.
|
||||
* @return This geometry. Note that original geometry is modified in place.
|
||||
*/
|
||||
transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike): ol.geom.Geometry;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3407,13 +3507,14 @@ declare module ol {
|
||||
class DragZoom {
|
||||
}
|
||||
|
||||
class Draw {
|
||||
class Draw extends ol.interaction.Pointer {
|
||||
constructor(opt_options?: olx.interaction.DrawOptions)
|
||||
}
|
||||
|
||||
class DrawEvent {
|
||||
}
|
||||
|
||||
class Interaction {
|
||||
class Interaction extends ol.Object {
|
||||
}
|
||||
|
||||
class KeyboardPan {
|
||||
@@ -3422,7 +3523,8 @@ declare module ol {
|
||||
class KeyboardZoom {
|
||||
}
|
||||
|
||||
class Modify {
|
||||
class Modify extends ol.interaction.Pointer {
|
||||
constructor(opt_options?: olx.interaction.ModifyOptions)
|
||||
}
|
||||
|
||||
class MouseWheelZoom {
|
||||
@@ -3434,16 +3536,21 @@ declare module ol {
|
||||
class PinchZoom {
|
||||
}
|
||||
|
||||
class Pointer {
|
||||
class Pointer extends ol.interaction.Interaction {
|
||||
}
|
||||
|
||||
class Select {
|
||||
class Select extends ol.interaction.Interaction {
|
||||
constructor(opt_options?: olx.interaction.SelectOptions);
|
||||
getLayer(): ol.layer.Layer;
|
||||
getFeatures(): ol.Collection<ol.Feature>;
|
||||
}
|
||||
|
||||
class Snap {
|
||||
}
|
||||
|
||||
function defaults(opts: olx.interaction.DefaultsOptions): ol.Collection<ol.interaction.Interaction>;
|
||||
interface DrawGeometryFunctionType { (coordinates: ol.Coordinate, geom?: ol.geom.Geometry): ol.geom.Geometry;}
|
||||
interface SelectFilterFunction { (feature: ol.Feature | ol.render.Feature, layer: ol.layer.Layer):boolean;}
|
||||
}
|
||||
|
||||
module layer {
|
||||
@@ -3774,6 +3881,15 @@ declare module ol {
|
||||
* @param Layer style
|
||||
*/
|
||||
setStyle(style: ol.style.StyleFunction): void;
|
||||
|
||||
/**
|
||||
* Sets the layer to be rendered on top of other layers on a map. The map will not manage this layer
|
||||
* in its layers collection, and the callback in ol.Map#forEachLayerAtPixel will receive null as
|
||||
* layer. This is useful for temporary layers. To remove an unmanaged layer from the map, use #setMap(null).
|
||||
* To add the layer to a map and have it managed by the map, use ol.Map#addLayer instead.
|
||||
* @argument map.
|
||||
*/
|
||||
setMap(map: ol.Map): void;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3898,7 +4014,13 @@ declare module ol {
|
||||
|
||||
class VectorContext {
|
||||
}
|
||||
|
||||
class Feature{
|
||||
get(key: string): any;
|
||||
getExtent(): ol.Extent;
|
||||
getGeometry(): ol.geom.Geometry;
|
||||
getProperties: Object[];
|
||||
getType(): ol.geom.GeometryType;
|
||||
}
|
||||
module canvas {
|
||||
class Immediate {
|
||||
}
|
||||
@@ -3978,19 +4100,45 @@ declare module ol {
|
||||
|
||||
class Vector {
|
||||
constructor(opts: olx.source.VectorOptions)
|
||||
|
||||
/**
|
||||
* Add a single feature to the source. If you want to add a batch of features at once,
|
||||
* call source.addFeatures() instead.
|
||||
*/
|
||||
addFeature(feature: ol.Feature):void;
|
||||
|
||||
/**
|
||||
* Add a batch of features to the source.
|
||||
*/
|
||||
addFeatures(features: ol.Feature[]):void;
|
||||
|
||||
/**
|
||||
* Remove all features from the source.
|
||||
* @param Skip dispatching of removefeature events.
|
||||
*/
|
||||
clear(fast?: boolean):void;
|
||||
/**
|
||||
* Get the extent of the features currently in the source.
|
||||
*/
|
||||
getExtent(): ol.Extent;
|
||||
|
||||
|
||||
/**
|
||||
* Get all features in the provided extent. Note that this returns all features whose bounding boxes
|
||||
* intersect the given extent (so it may include features whose geometries do not intersect the extent).
|
||||
* This method is not available when the source is configured with useSpatialIndex set to false.
|
||||
*/
|
||||
getFeaturesInExtent(extent: ol.Extent): ol.Feature[];
|
||||
|
||||
/**
|
||||
* Get all features on the source
|
||||
*/
|
||||
getFeatures(): ol.Feature[];
|
||||
}
|
||||
|
||||
class VectorEvent {
|
||||
}
|
||||
|
||||
class WMTS {
|
||||
constructor(options: olx.source.WMTSOptions);
|
||||
}
|
||||
|
||||
class XYZ {
|
||||
@@ -4014,7 +4162,8 @@ declare module ol {
|
||||
class AtlasManager {
|
||||
}
|
||||
|
||||
class Circle {
|
||||
class Circle extends Image{
|
||||
constructor(opt_options?: olx.style.CircleOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4034,10 +4183,20 @@ declare module ol {
|
||||
getChecksum(): string;
|
||||
}
|
||||
|
||||
class Icon {
|
||||
class Icon extends Image {
|
||||
constructor(option: olx.style.IconOptions)
|
||||
}
|
||||
|
||||
class Image {
|
||||
getOpacity(): number;
|
||||
getRotateWithView(): boolean;
|
||||
getRotation(): number;
|
||||
getScale(): number;
|
||||
getSnapToPiexl(): boolean;
|
||||
|
||||
setOpacity(opacity: number):void;
|
||||
setRotation(rotation: number):void;
|
||||
setScale(scale: number):void;
|
||||
}
|
||||
|
||||
interface GeometryFunction {
|
||||
@@ -4048,7 +4207,19 @@ declare module ol {
|
||||
}
|
||||
|
||||
class Stroke {
|
||||
constructor();
|
||||
constructor(opts?: olx.style.StrokeOptions);
|
||||
getColor(): ol.Color|string;
|
||||
getLineCap(): string;
|
||||
getLineDash(): number[];
|
||||
getLineJoin(): string;
|
||||
getMitterLimit(): number;
|
||||
getWidth(): number;
|
||||
setColor(color: ol.Color|string):void;
|
||||
setLineCap(lineCap: string):void;
|
||||
setLineDash(lineDash: number[]):void;
|
||||
setLineJoin(lineJoin: string):void;
|
||||
setMiterLimit(miterLimit: number):void;
|
||||
setWidth(width: number):void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4058,6 +4229,22 @@ declare module ol {
|
||||
*/
|
||||
class Style {
|
||||
constructor(opts: olx.style.StyleOptions);
|
||||
|
||||
getFill(): ol.style.Fill;
|
||||
/***
|
||||
* Get the geometry to be rendered.
|
||||
* @return Feature property or geometry or function that returns the geometry that will
|
||||
* be rendered with this style.
|
||||
*/
|
||||
getGeometry(): string | ol.geom.Geometry | ol.style.GeometryFunction;
|
||||
getGeometryFunction(): ol.style.GeometryFunction;
|
||||
getImage(): ol.style.Image;
|
||||
getStroke(): ol.style.Stroke;
|
||||
getText(): ol.style.Text;
|
||||
getZIndex(): number;
|
||||
|
||||
setGeometry(geometry: string | ol.geom.Geometry | ol.style.GeometryFunction):void;
|
||||
setZIndex( zIndex: number):void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4346,7 +4533,7 @@ declare module ol {
|
||||
/**
|
||||
* Implementation based on the code of OpenLayers, no documentation available (yet). If it is incorrect, please create an issue and I will change it.
|
||||
*/
|
||||
interface FeatureLoader { (extent: ol.Extent, number: number, projection: ol.proj.Projection): Array<Feature> }
|
||||
interface FeatureLoader { (extent: ol.Extent, number: number, projection: ol.proj.Projection): string }
|
||||
|
||||
/**
|
||||
* A function that returns a style given a resolution. The this keyword inside the function references the ol.Feature to be styled.
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/// <reference path="phantomcss.d.ts" />
|
||||
/// <reference path="../casperjs/casperjs.d.ts" />
|
||||
/// <reference path="../resemblejs/resemblejs.d.ts" />
|
||||
|
||||
// phantomCSS 0.11.1 is based on resemblejs 1.2.1, phantomJS 1.9.2 , casperJS 1.1.0-DEV
|
||||
|
||||
var options: PhantomCSS.PhantomCSSOptions = {
|
||||
libraryRoot: './modules/PhantomCSS',
|
||||
|
||||
screenshotRoot: './screenshots',
|
||||
|
||||
failedComparisonsRoot: './failures',
|
||||
|
||||
cleanupComparisonImages: true,
|
||||
|
||||
casper: null,
|
||||
|
||||
comparisonResultRoot: './results',
|
||||
|
||||
addIteratorToImage: false,
|
||||
|
||||
addLabelToFailedImage: false,
|
||||
|
||||
mismatchTolerance: 0.05,
|
||||
|
||||
onFail: function(test){ console.log(test.filename, test.mismatch); },
|
||||
|
||||
onPass: function(test){ console.log(test.filename); },
|
||||
|
||||
onNewImage: function(test){ console.log(test.filename); },
|
||||
|
||||
onTimeout: function(test){ console.log(test.filename); },
|
||||
|
||||
onComplete: function(allTests, noOfFails, noOfErrors){
|
||||
allTests.forEach(function(test){
|
||||
if(test.fail){
|
||||
console.log(test.filename, test.mismatch);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
fileNameGetter: function(root:string,filename:string){
|
||||
|
||||
return root+filename;
|
||||
},
|
||||
|
||||
prefixCount: true,
|
||||
|
||||
outputSettings: {
|
||||
errorColor: {
|
||||
red: 255,
|
||||
green: 0,
|
||||
blue: 255
|
||||
},
|
||||
errorType: 'movement',
|
||||
transparency: 0.3,
|
||||
largeImageThreshold: 1200
|
||||
},
|
||||
|
||||
rebase: null//casper.cli.get("rebase")
|
||||
}
|
||||
|
||||
declare var phantomcss:PhantomCSS.PhantomCSS;
|
||||
|
||||
phantomcss.turnOffAnimations();
|
||||
phantomcss.init(options);
|
||||
|
||||
phantomcss.compareAll('exclude.test');
|
||||
phantomcss.compareMatched('include.test', 'exclude.test');
|
||||
phantomcss.compareMatched( new RegExp('include.test'), new RegExp('exclude.test'));
|
||||
phantomcss.compareSession();
|
||||
phantomcss.compareExplicit(['/dialog.diff.png', '/header.diff.png']);
|
||||
phantomcss.getCreatedDiffFiles();
|
||||
phantomcss.compareFiles("baseFile", "diffFile");
|
||||
phantomcss.waitForTests([{error:false, fail:false, failFile: "failFile", filename: "filename", mismatch: null/* mismatch */ }]);
|
||||
|
||||
phantomcss.screenshot("#feedback-form");
|
||||
|
||||
phantomcss.screenshot("#feedback-form", undefined, 'input[type=file]');
|
||||
Vendored
+144
@@ -0,0 +1,144 @@
|
||||
// Type definitions for PhantomCSS 0.11.1
|
||||
// Project: https://github.com/Huddle/PhantomCSS
|
||||
// Definitions by: Amaury Bauzac <https://github.com/abauzac>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../casperjs/casperjs.d.ts" />
|
||||
/// <reference path="../resemblejs/resemblejs.d.ts" />
|
||||
declare module PhantomCSS {
|
||||
interface PhantomCSS {
|
||||
init(options: PhantomCSSOptions): void;
|
||||
update(options: PhantomCSSOptions): void;
|
||||
|
||||
/**
|
||||
* Take a screenshot of the targeted HTML element
|
||||
* FileName is required if addIteratorToImage option is set to false
|
||||
*/
|
||||
screenshot(target: string, fileName?: string): void;
|
||||
|
||||
/**
|
||||
* Take a screenshot of the targeted HTML element
|
||||
* FileName is required if addIteratorToImage option is set to false
|
||||
*/
|
||||
screenshot(target: ClipRect, fileName?: string): void;
|
||||
/**
|
||||
* Take a screenshot of the targeted HTML element
|
||||
* FileName is required if addIteratorToImage option is set to false
|
||||
*/
|
||||
screenshot(target: string, timeToWait: number, hideSelector: string, fileName?: string): void;
|
||||
|
||||
compareAll(exclude: string): void;
|
||||
compareAll(exclude: string, diffList: string[], include: string): void;
|
||||
compareMatched(match: string, exclude: string): void;
|
||||
compareMatched(match: RegExp, exclude: RegExp): void;
|
||||
/**
|
||||
* Explicitly define what files you want to compare
|
||||
*/
|
||||
compareExplicit(list: string[]): void;
|
||||
/**
|
||||
* Compare image diffs generated in this test run only
|
||||
*/
|
||||
compareSession(list?: any[]): void;
|
||||
compareFiles(baseFile: string, diffFiles: string): PhantomCSSTest;
|
||||
waitForTests(tests: PhantomCSSTest[]): void;
|
||||
done(): void;
|
||||
/**
|
||||
* Turn off CSS transitions and jQuery animations
|
||||
*/
|
||||
turnOffAnimations(): void;
|
||||
getExitStatus(): number;
|
||||
/**
|
||||
* Get a list of image diffs generated in this test run
|
||||
*/
|
||||
getCreatedDiffFiles(): Array<string>;
|
||||
}
|
||||
|
||||
interface PhantomCSSTest {
|
||||
filename?: string;
|
||||
error?: boolean;
|
||||
fail?: boolean;
|
||||
success?: boolean;
|
||||
failFile?: string;
|
||||
mismatch?: any;
|
||||
}
|
||||
|
||||
interface PhantomCSSOptions {
|
||||
/**
|
||||
Rebase is useful when you want to create new baseline
|
||||
images without manually deleting the files
|
||||
casperjs demo/test.js --rebase
|
||||
*/
|
||||
rebase?: any;
|
||||
/**
|
||||
A reference to a particular Casper instance. Required for SlimerJS.
|
||||
*/
|
||||
casper?: Casper;
|
||||
/**
|
||||
libraryRoot is relative to this file and must point to your phantomcss folder (not lib or node_modules). If you are using NPM, this will be './node_modules/phantomcss'.
|
||||
*/
|
||||
libraryRoot?: string;
|
||||
|
||||
screenshotRoot?: string;
|
||||
/**
|
||||
By default, failure images are put in the './failures' folder.
|
||||
If failedComparisonsRoot is set to false a separate folder will
|
||||
not be created but failure images can still be found alongside
|
||||
the original and new images.
|
||||
*/
|
||||
failedComparisonsRoot?: string;
|
||||
|
||||
/**
|
||||
You might want to keep master/baseline images in a completely
|
||||
different folder to the diffs/failures. Useful when working
|
||||
with version control systems. By default this resolves to the
|
||||
screenshotRoot folder.
|
||||
*/
|
||||
comparisonResultRoot?: string;
|
||||
|
||||
/**
|
||||
Don't add count number to images. If set to false (default), a filename is
|
||||
required when capturing screenshots.
|
||||
*/
|
||||
addIteratorToImage: boolean;
|
||||
|
||||
/**
|
||||
Remove results directory tree after run. Use in conjunction
|
||||
with failedComparisonsRoot to see failed comparisons.
|
||||
*/
|
||||
cleanupComparisonImages?: boolean;
|
||||
|
||||
/**
|
||||
* Don't add label to generated failure image
|
||||
*/
|
||||
addLabelToFailedImage?: boolean;
|
||||
/**
|
||||
* Change the output screenshot filenames for your specific
|
||||
* integration
|
||||
*/
|
||||
fileNameGetter?: (rootPath: string, fileName?: string) => string;
|
||||
|
||||
/**
|
||||
Mismatch tolerance defaults to 0.05%. Increasing this value
|
||||
will decrease test coverage
|
||||
*/
|
||||
mismatchTolerance?: number;
|
||||
|
||||
onPass?: (test: PhantomCSSTest) => void;
|
||||
onFail?: (test: PhantomCSSTest) => void;
|
||||
onTimeout?: (test: PhantomCSSTest) => void;
|
||||
onComplete?: (tests: PhantomCSSTest[], noOfFails: number, noOfErrors: number) => void;
|
||||
/**
|
||||
Called when creating new baseline images
|
||||
*/
|
||||
onNewImage?: (test: PhantomCSSTest) => void;
|
||||
|
||||
/**
|
||||
Prefix the screenshot number to the filename, instead of suffixing it
|
||||
*/
|
||||
prefixCount?: boolean;
|
||||
|
||||
hideElements?: string;
|
||||
outputSettings?: Resemble.OutputSettings;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,6 +10,10 @@ assert.equal(3, "3", "uses == comparator");
|
||||
|
||||
assert.notStrictEqual(2, "2", "uses === comparator");
|
||||
|
||||
assert.deepStrictEqual([{a:1}], [{a:1}], "uses === comparator");
|
||||
|
||||
assert.notDeepStrictEqual([{a:1}], [{a:1}], "uses === comparator");
|
||||
|
||||
assert.throws(() => {
|
||||
throw "a hammer at your face";
|
||||
}, undefined, "DODGED IT");
|
||||
|
||||
Vendored
+4
@@ -37,6 +37,10 @@ declare namespace assert {
|
||||
|
||||
export function notStrictEqual(actual:any, expected:any, message?:string):void;
|
||||
|
||||
export function deepStrictEqual(actual:any, expected:any, message?:string):void;
|
||||
|
||||
export function notDeepStrictEqual(actual:any, expected:any, message?:string):void;
|
||||
|
||||
export var throws:{
|
||||
(block:Function, message?:string): void;
|
||||
(block:Function, error:Function, message?:string): void;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
/// <reference path="pure-render-decorator.d.ts"/>
|
||||
|
||||
import * as PureRender from 'pure-render-decorator';
|
||||
|
||||
@PureRender
|
||||
class TestClass {}
|
||||
@@ -0,0 +1 @@
|
||||
--target es5 --noImplicitAny --experimentalDecorators --module commonjs
|
||||
@@ -0,0 +1,9 @@
|
||||
// Type definitions for pure-render-decorator v0.2.0
|
||||
// Project: https://github.com/felixgirault/pure-render-decorator
|
||||
// Definitions by: Sean Kelley <https://github.com/seansfkelley/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module 'pure-render-decorator' {
|
||||
var PureRender: ClassDecorator;
|
||||
export = PureRender;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
/// <reference path="quill.d.ts" />
|
||||
/// <reference path="../requirejs/require.d.ts"/>
|
||||
|
||||
export var Quill = require("quill");
|
||||
//export var Quill = require("quill");
|
||||
|
||||
function test_quill() {
|
||||
|
||||
|
||||
Vendored
+28
-9
@@ -6,10 +6,22 @@
|
||||
///<reference path="../eventemitter2/eventemitter2.d.ts" />
|
||||
|
||||
declare interface DeltaStatic{
|
||||
ops : Array<any>;
|
||||
ops? : Array<any>;
|
||||
retain?: any,
|
||||
delete?: any,
|
||||
insert?: any,
|
||||
attributes?: any
|
||||
}
|
||||
|
||||
declare interface RangeStatic{
|
||||
new(): RangeStatic;
|
||||
start: number;
|
||||
end: number;
|
||||
}
|
||||
|
||||
declare interface QuillStatic {
|
||||
new(selector: string, options?: Object):QuillStatic;
|
||||
|
||||
on(eventName: string, callback: (delta: DeltaStatic, source: string) => void): EventEmitter2;
|
||||
addModule(id: string, options: any) : Object;
|
||||
|
||||
@@ -36,7 +48,7 @@ declare interface QuillStatic {
|
||||
deleteText(start: number, end: number, source: string): void;
|
||||
|
||||
formatText(start: number, end: number): void;
|
||||
formatText(start: number, end: number, name: string, value: string): void;
|
||||
formatText(start: number, end: number, name: string, value: boolean): void;
|
||||
formatText(start: number, end: number, formats: any): void;
|
||||
formatText(start: number, end: number, source: string): void;
|
||||
formatText(start: number, end: number, name: string, value: string, source: string): void;
|
||||
@@ -44,7 +56,7 @@ declare interface QuillStatic {
|
||||
|
||||
|
||||
formatLine(start: number, end: number): void;
|
||||
formatLine(start: number, end: number, name: string, value: string): void;
|
||||
formatLine(start: number, end: number, name: string, value: boolean): void;
|
||||
formatLine(start: number, end: number, formats: any): void;
|
||||
formatLine(start: number, end: number, source: string): void;
|
||||
formatLine(start: number, end: number, name: string, value: string, source: string): void;
|
||||
@@ -62,14 +74,14 @@ declare interface QuillStatic {
|
||||
|
||||
setText(text: string): void;
|
||||
|
||||
getSelection(): string;
|
||||
getSelection(): RangeStatic;
|
||||
|
||||
setSelection(start: number, end: number): void;
|
||||
setSelection(start: number, end: number, source: string): void;
|
||||
setSelection(range: any): void;
|
||||
setSelection(range: any, source: string): void;
|
||||
setSelection(range: RangeStatic): void;
|
||||
setSelection(range: RangeStatic, source: string): void;
|
||||
|
||||
prepareFormat(format: string, value: string): void;
|
||||
prepareFormat(format: string, value: boolean): void;
|
||||
|
||||
focus(): void;
|
||||
|
||||
@@ -85,16 +97,23 @@ declare interface QuillStatic {
|
||||
|
||||
addFormat(name: string, config: any): void;
|
||||
|
||||
addContainer(cssClass: string, before: number): HTMLDivElement;
|
||||
addContainer(cssClass: string, before?: number): HTMLDivElement;
|
||||
}
|
||||
|
||||
declare var Quill: QuillStatic;
|
||||
declare module "Range"
|
||||
{
|
||||
var Range: RangeStatic;
|
||||
export = Range;
|
||||
}
|
||||
|
||||
declare var Delta: DeltaStatic;
|
||||
|
||||
declare module "Delta"{
|
||||
export = Delta;
|
||||
}
|
||||
|
||||
declare var Quill: QuillStatic;
|
||||
|
||||
declare module "Quill" {
|
||||
export = Quill;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/// <reference path="random-js.d.ts"/>
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
// Examples taken from the documentation at https://github.com/ckknight/random-js
|
||||
// create a Mersenne Twister-19937 that is auto-seeded based on time and other random values
|
||||
import Engine = random.Engine;
|
||||
import Random = random.Random;
|
||||
|
||||
var engine: Engine = Random.engines.mt19937().autoSeed();
|
||||
// create a distribution that will consistently produce integers within inclusive range [0, 99].
|
||||
var distribution: Function = Random.integer(0, 99);
|
||||
// generate a number that is guaranteed to be within [0, 99] without any particular bias.
|
||||
function generateNaturalLessThan100(): number {
|
||||
return distribution(engine);
|
||||
}
|
||||
|
||||
// using essentially Math.random()
|
||||
var engine2: Engine = Random.engines.nativeMath;
|
||||
// lower-case Hex string distribution
|
||||
var distribution2: Function = Random.hex(false);
|
||||
// generate a 40-character hex string
|
||||
function generateSHA1(): string {
|
||||
return distribution(40);
|
||||
}
|
||||
|
||||
var r: Random = new Random(Random.engines.mt19937().seedWithArray([0x12345678, 0x90abcdef]));
|
||||
var value = r.integer(0, 99);
|
||||
|
||||
r = new Random(); // same as new Random(Random.engines.nativeMath)
|
||||
Vendored
+62
@@ -0,0 +1,62 @@
|
||||
// Type definitions for random-js 1.0.8
|
||||
// Project: https://github.com/ckknight/random-js
|
||||
// Definitions by: Gustavo Di Pietro <https://github.com/pistacchio>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module random {
|
||||
export function Engine(): number;
|
||||
export interface Engine {
|
||||
|
||||
}
|
||||
|
||||
export function MT19937 (): number;
|
||||
export interface MT19937 extends Engine{
|
||||
seed (value: number): Engine;
|
||||
seedWithArray(array: Array<number>): Engine
|
||||
autoSeed(): Engine;
|
||||
discard(count: number): Engine;
|
||||
getUseCount(): Engine;
|
||||
}
|
||||
|
||||
export class Random {
|
||||
constructor (engine?: Engine);
|
||||
|
||||
static engines: {
|
||||
nativeMath: Engine,
|
||||
browserCrypto: Engine,
|
||||
mt19937: () => MT19937
|
||||
}
|
||||
|
||||
static integer(min: number, max: number): (engine: Engine) => number;
|
||||
static real(min: number, max: number, inclusive: boolean): (engine: Engine) => number;
|
||||
static bool(percentage?: number): (engine: Engine) => boolean;
|
||||
static bool(numerator: number, denominator: number): (engine: Engine) => boolean;
|
||||
static pick<T>(engine: Engine, array: Array<T>, begin?: number, end?: number): T;
|
||||
static picker<T>(array: Array<T>, begin?: number, end?: number): (engine: Engine) => T;
|
||||
static shuffle<T>(engine: Engine, array: Array<T>): Array<T>;
|
||||
static sample<T>(engine: Engine, population: Array<T>, sampleSize: number): Array<T>;
|
||||
static die(sideCount: number): (engine: Engine) => number;
|
||||
static dice(sideCount: number, dieCount: number): (engine: Engine) => number;
|
||||
static uuid4(engine: Engine): string;
|
||||
static string(engine: Engine, length: number): string;
|
||||
static string(pool: string, length: number): (engine: Engine, length: number) => string;
|
||||
static hex(upperCase?: boolean): (engine: Engine, length: number) => string;
|
||||
static date(start: Date, end: Date): (engine: Engine) => Date;
|
||||
|
||||
integer(min: number, max: number): number;
|
||||
real(min: number, max: number, inclusive: boolean): number;
|
||||
bool(percentage?: number): (engine: Engine) => boolean;
|
||||
bool(numerator: number, denominator: number): boolean;
|
||||
pick<T>(engine: Engine, array: Array<T>, begin?: number, end?: number): T;
|
||||
picker<T>(array: Array<T>, begin?: number, end?: number): (engine: Engine) => T;
|
||||
shuffle<T>(engine: Engine, array: Array<T>): Array<T>;
|
||||
sample<T>(engine: Engine, population: Array<T>, sampleSize: number): Array<T>;
|
||||
die(sideCount: number): (engine: Engine) => number;
|
||||
dice(sideCount: number, dieCount: number): number;
|
||||
uuid4(engine: Engine): string;
|
||||
string(engine: Engine, length: number): string;
|
||||
string(pool: string, length: number): string;
|
||||
hex(upperCase?: boolean): string;
|
||||
date(start: Date, end: Date): Date;
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ Raven.context({tags: { key: "value" }}, throwsError);
|
||||
setTimeout(Raven.wrap(throwsError), 1000);
|
||||
Raven.wrap({logger: "my.module"}, throwsError)();
|
||||
|
||||
Raven.setUser({
|
||||
Raven.setUserContext({
|
||||
email: 'matt@example.com',
|
||||
id: '123'
|
||||
});
|
||||
|
||||
Vendored
+61
-4
@@ -1,14 +1,22 @@
|
||||
// Type definitions for Raven.js
|
||||
// Project: https://github.com/getsentry/raven-js
|
||||
// Definitions by: Santi Albo <https://github.com/santialbo/>
|
||||
// Definitions by: Santi Albo <https://github.com/santialbo/>, Benjamin Pannell <http://github.com/spartan563>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var Raven: RavenStatic;
|
||||
|
||||
interface RavenOptions {
|
||||
/** The log level associated with this event. Default: error */
|
||||
level?: string;
|
||||
|
||||
/** The name of the logger used by Sentry. Default: javascript */
|
||||
logger?: string;
|
||||
|
||||
/** The release version of the application you are monitoring with Sentry */
|
||||
release?: string;
|
||||
|
||||
/** The name of the server or device that the client is running on */
|
||||
serverName?: string;
|
||||
|
||||
/** List of messages to be fitlered out before being sent to Sentry. */
|
||||
ignoreErrors?: string[];
|
||||
@@ -23,9 +31,26 @@ interface RavenOptions {
|
||||
includePaths?: RegExp[];
|
||||
|
||||
/** Additional data to be tagged onto the error. */
|
||||
tags?: any;
|
||||
tags?: {
|
||||
[id: string]: string;
|
||||
};
|
||||
|
||||
extra?: any;
|
||||
|
||||
/** In some cases you may see issues where Sentry groups multiple events together when they should be separate entities. In other cases, Sentry simply doesn’t group events together because they’re so sporadic that they never look the same. */
|
||||
fingerprint?: string[];
|
||||
|
||||
/** A function which allows mutation of the data payload right before being sent to Sentry */
|
||||
dataCallback?: (data: any) => any;
|
||||
|
||||
/** A callback function that allows you to apply your own filters to determine if the message should be sent to Sentry. */
|
||||
shouldSendCallback?: (data: any) => boolean;
|
||||
|
||||
/** By default, Raven does not truncate messages. If you need to truncate characters for whatever reason, you may set this to limit the length. */
|
||||
maxMessageLength?: number;
|
||||
|
||||
/** Override the default HTTP data transport handler. */
|
||||
transport?: (options: RavenTransportOptions) => void;
|
||||
}
|
||||
|
||||
interface RavenStatic {
|
||||
@@ -88,6 +113,8 @@ interface RavenStatic {
|
||||
*/
|
||||
wrap(func: Function): Function;
|
||||
wrap(options: RavenOptions, func: Function): Function;
|
||||
wrap<T extends Function>(func: T): T;
|
||||
wrap<T extends Function>(options: RavenOptions, func: T): T;
|
||||
|
||||
/*
|
||||
* Uninstalls the global error handler.
|
||||
@@ -114,11 +141,41 @@ interface RavenStatic {
|
||||
*/
|
||||
captureMessage(msg: string, options?: RavenOptions): RavenStatic;
|
||||
|
||||
/**
|
||||
* Clear the user context, removing the user data that would be sent to Sentry.
|
||||
*/
|
||||
setUserContext(): RavenStatic;
|
||||
|
||||
/*
|
||||
* Set/clear a user to be sent along with the payload.
|
||||
* Set a user to be sent along with the payload.
|
||||
*
|
||||
* @param {object} user An object representing user data [optional]
|
||||
* @return {Raven}
|
||||
*/
|
||||
setUser(user?: any): RavenStatic;
|
||||
setUserContext(user: {
|
||||
id?: string;
|
||||
username?: string;
|
||||
email?: string;
|
||||
}): RavenStatic;
|
||||
|
||||
/** Override the default HTTP data transport handler. */
|
||||
setTransport(transportFunction: (options: RavenTransportOptions) => void): RavenStatic;
|
||||
|
||||
/** An event id is a globally unique id for the event that was just sent. This event id can be used to find the exact event from within Sentry. */
|
||||
lastEventId(): string;
|
||||
|
||||
/** If you need to conditionally check if raven needs to be initialized or not, you can use the isSetup function. It will return true if Raven is already initialized. */
|
||||
isSetup(): boolean;
|
||||
}
|
||||
|
||||
interface RavenTransportOptions {
|
||||
url: string;
|
||||
data: any;
|
||||
auth: {
|
||||
sentry_version: string;
|
||||
sentry_client: string;
|
||||
sentry_key: string;
|
||||
};
|
||||
onSuccess: () => void;
|
||||
onFailure: () => void;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/// <reference path="react-bootstrap-table.d.ts"/>
|
||||
/// <reference path="../react/react-dom.d.ts"/>
|
||||
|
||||
import * as React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';
|
||||
|
||||
var products = [{
|
||||
id: 1,
|
||||
name: "Item name 1",
|
||||
price: 100
|
||||
}, {
|
||||
id: 2,
|
||||
name: "Item name 2",
|
||||
price: 100
|
||||
}];
|
||||
|
||||
// It's a data format example.
|
||||
function priceFormatter(cell: any, row: any) {
|
||||
return '<i class="glyphicon glyphicon-usd"></i> ' + cell;
|
||||
}
|
||||
|
||||
render(
|
||||
<BootstrapTable data={products} striped={true} hover={true}>
|
||||
<TableHeaderColumn dataField="id" isKey={true} dataAlign="center" dataSort={true}>Product ID</TableHeaderColumn>
|
||||
<TableHeaderColumn dataField="name" dataSort={true}>Product Name</TableHeaderColumn>
|
||||
<TableHeaderColumn dataField="price" dataFormat={priceFormatter}>Product Price</TableHeaderColumn>
|
||||
</BootstrapTable>,
|
||||
document.getElementById("app")
|
||||
);
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
// Type definitions for react-bootstrap-table v1.4.6
|
||||
// Project: https://github.com/AllenFang/react-bootstrap-table
|
||||
// Definitions by: Frank Laub <https://github.com/flaub>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module "react-bootstrap-table" {
|
||||
import { ComponentClass, Props, ReactElement } from 'react';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
interface SelectRow {
|
||||
mode?: string;
|
||||
bgColor?: string;
|
||||
selected?: any[];
|
||||
onSelect?: Function;
|
||||
onSelectAll?: Function;
|
||||
clickToSelect?: boolean;
|
||||
hideSelectColumn?: boolean;
|
||||
clickToSelectAndEditCell?: boolean;
|
||||
showOnlySelected?: boolean;
|
||||
}
|
||||
|
||||
interface CellEdit {
|
||||
mode?: string;
|
||||
blurToSave?: boolean;
|
||||
afterSaveCell?: Function;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
sortName?: string;
|
||||
sortOrder?: string;
|
||||
afterTableComplete?: Function;
|
||||
afterDeleteRow?: Function;
|
||||
afterInsertRow?: Function;
|
||||
afterSearch?: Function;
|
||||
afterColumnFilter?: Function;
|
||||
onRowClick?: Function;
|
||||
page?: number;
|
||||
sizePerPageList?: number[];
|
||||
sizePerPage?: number;
|
||||
paginationSize?: number;
|
||||
onSortChange?: Function;
|
||||
onPageChange?: Function;
|
||||
onSizePerPageList?: Function;
|
||||
noDataText?: string;
|
||||
handleConfirmDeleteRow?: Function;
|
||||
}
|
||||
|
||||
interface FetchInfo {
|
||||
dataTotalSize?: number;
|
||||
}
|
||||
|
||||
interface BootstrapTableProps extends Props<BootstrapTable> {
|
||||
keyField?: string;
|
||||
height?: string;
|
||||
maxHeight?: string;
|
||||
data?: any;
|
||||
remote?: boolean;
|
||||
striped?: boolean;
|
||||
bordered?: boolean;
|
||||
hover?: boolean;
|
||||
condensed?: boolean;
|
||||
pagination?: boolean;
|
||||
searchPlaceholder?: string;
|
||||
selectRow?: SelectRow;
|
||||
cellEdit?: CellEdit;
|
||||
insertRow?: boolean;
|
||||
deleteRow?: boolean;
|
||||
search?: boolean;
|
||||
columnFilter?: boolean;
|
||||
trClassName?: any;
|
||||
options?: Options;
|
||||
fetchInfo?: FetchInfo;
|
||||
exportCSV?: boolean;
|
||||
csvFileName?: string;
|
||||
}
|
||||
|
||||
interface BootstrapTable extends ComponentClass<BootstrapTableProps> { }
|
||||
const BootstrapTable: BootstrapTable;
|
||||
|
||||
interface TableHeaderColumnProps extends Props<TableHeaderColumn> {
|
||||
dataField?: string;
|
||||
dataAlign?: string;
|
||||
dataSort?: boolean;
|
||||
onSort?: Function;
|
||||
dataFormat?: Function;
|
||||
isKey?: boolean;
|
||||
editable?: any;
|
||||
hidden?: boolean;
|
||||
className?: string;
|
||||
width?: string;
|
||||
sortFunc?: Function;
|
||||
columnClassName?: any;
|
||||
filterFormatted?: boolean;
|
||||
sort?: string;
|
||||
}
|
||||
|
||||
interface TableHeaderColumn extends ComponentClass<TableHeaderColumnProps> { }
|
||||
const TableHeaderColumn: TableHeaderColumn;
|
||||
|
||||
class TableDataSet extends EventEmitter {
|
||||
constructor(data: any);
|
||||
setData(data: any): void;
|
||||
clear(): void;
|
||||
getData(): any;
|
||||
}
|
||||
|
||||
export {
|
||||
BootstrapTable,
|
||||
TableHeaderColumn,
|
||||
TableDataSet
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/// <reference path="react-fa.d.ts"/>
|
||||
/// <reference path="../react/react-dom.d.ts"/>
|
||||
|
||||
import * as React from "react";
|
||||
import { render } from 'react-dom';
|
||||
import Icon = require('react-fa');
|
||||
|
||||
render(
|
||||
<Icon spin name="spinner" />,
|
||||
document.getElementById('main')
|
||||
)
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
// Type definitions for react-fa v4.0.0
|
||||
// Project: https://github.com/andreypopp/react-fa
|
||||
// Definitions by: Frank Laub <https://github.com/flaub>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
|
||||
declare module "react-fa" {
|
||||
import { ComponentClass, Props } from 'react';
|
||||
|
||||
interface IconProps extends Props<Icon> {
|
||||
name: string;
|
||||
className?: string;
|
||||
size?: string;
|
||||
spin?: boolean;
|
||||
rotate?: string;
|
||||
flip?: string;
|
||||
fixedWidth?: boolean;
|
||||
pulse?: boolean;
|
||||
stack?: string;
|
||||
inverse?: boolean;
|
||||
}
|
||||
|
||||
interface Icon extends ComponentClass<IconProps> { }
|
||||
const Icon: Icon;
|
||||
|
||||
export = Icon;
|
||||
}
|
||||
@@ -75,15 +75,10 @@ declare module NotificationSystem {
|
||||
ref?: string;
|
||||
style?: Style | boolean;
|
||||
}
|
||||
|
||||
|
||||
export interface Component {
|
||||
(): React.ReactElement<Attributes>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module 'react-notification-system' {
|
||||
var component: NotificationSystem.Component;
|
||||
var component: __React.ClassicComponentClass<NotificationSystem.Attributes>;
|
||||
export = component;
|
||||
}
|
||||
|
||||
Vendored
+5
@@ -686,6 +686,11 @@ declare namespace __React {
|
||||
*/
|
||||
borderWidth?: any;
|
||||
|
||||
/**
|
||||
* This property specifies how far an absolutely positioned box's bottom margin edge is offset above the bottom edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the bottom edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties).
|
||||
*/
|
||||
bottom?: any;
|
||||
|
||||
/**
|
||||
* Obsolete.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
--target ES6
|
||||
Vendored
+2
-3
@@ -4,7 +4,6 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/// <reference path="../es6-promise/es6-promise.d.ts"/>
|
||||
/// <reference path="../react/react.d.ts" />
|
||||
/// <reference path="../redux/redux.d.ts" />
|
||||
|
||||
@@ -326,7 +325,7 @@ declare module 'redux-form' {
|
||||
*
|
||||
* See Asynchronous Blur Validation Example for more details.
|
||||
*/
|
||||
asyncValidate?(values:Object, dispatch:Dispatch, props:Object):
|
||||
asyncValidate?(values:FormData, dispatch:Dispatch, props:Object):
|
||||
Promise<any>;
|
||||
|
||||
/**
|
||||
@@ -366,7 +365,7 @@ declare module 'redux-form' {
|
||||
* you must pass it as a parameter to handleSubmit() inside your form
|
||||
* component.
|
||||
*/
|
||||
onSubmit?: Function;
|
||||
onSubmit?(values:FormData, dispatch?:Dispatch):any;
|
||||
|
||||
/**
|
||||
* If specified, all the props normally passed into your decorated
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
--target ES6
|
||||
@@ -0,0 +1,172 @@
|
||||
/// <reference path="./redux-saga.d.ts" />
|
||||
|
||||
|
||||
import sagaMiddleware, {
|
||||
take,
|
||||
put,
|
||||
race,
|
||||
call,
|
||||
fork,
|
||||
cancel,
|
||||
storeIO,
|
||||
runSaga,
|
||||
Saga,
|
||||
SagaCancellationException
|
||||
} from 'redux-saga'
|
||||
import {applyMiddleware, createStore} from 'redux';
|
||||
|
||||
declare const delay: (ms: number) => Promise<any>;
|
||||
declare const fetchApi: (url: string) => Promise<any>;
|
||||
|
||||
namespace GettingStarted {
|
||||
|
||||
const incrementAsync:Saga = function* incrementAsync() {
|
||||
|
||||
while(true) {
|
||||
|
||||
// wait for each INCREMENT_ASYNC action
|
||||
const nextAction = yield take('INCREMENT_ASYNC')
|
||||
|
||||
// delay is a sample function
|
||||
// return a Promise that resolves after (ms) milliseconds
|
||||
yield delay(1000)
|
||||
|
||||
// dispatch INCREMENT_COUNTER
|
||||
yield put( {type: 'INCREMENT_COUNTER'} )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const createStoreWithSaga = applyMiddleware(
|
||||
// ...,
|
||||
sagaMiddleware(incrementAsync)
|
||||
)(createStore)
|
||||
|
||||
export default function configureStore(initialState) {
|
||||
return createStoreWithSaga((state: any) => state, initialState)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace EffectCombinators {
|
||||
const fetchPostsWithTimeout:Saga = function* fetchPostsWithTimeout() {
|
||||
while( yield take('FETCH_POSTS') ) {
|
||||
// starts a race between 2 effects
|
||||
const {posts, timeout} = yield race({
|
||||
posts : call(fetchApi, '/posts'),
|
||||
timeout : call(delay, 1000)
|
||||
})
|
||||
|
||||
if(posts)
|
||||
put( {type: 'RECEIVE_POSTS', posts} )
|
||||
else
|
||||
put( {type: 'TIMEOUT_ERROR'} )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace SequencingSagasViaYield {
|
||||
function showScore(score) {
|
||||
return {
|
||||
type: 'SHOW_SCORE', score
|
||||
}
|
||||
}
|
||||
|
||||
function* playLevelOne(getState) { yield 1 }
|
||||
|
||||
function* playLevelTwo(getState) { yield 2 }
|
||||
|
||||
function* playLevelThree(getState) { yield 3 }
|
||||
|
||||
const game: Saga = function* game(getState) {
|
||||
|
||||
const score1 = yield* playLevelOne(getState)
|
||||
yield put(showScore(score1))
|
||||
|
||||
const score2 = yield* playLevelTwo(getState)
|
||||
yield put(showScore(score2))
|
||||
|
||||
const score3 = yield* playLevelThree(getState)
|
||||
yield put(showScore(score3))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace ComposingSagas {
|
||||
function* fetchProducts() {
|
||||
yield put( {type: 'REQUEST_PRODUCTS'} )
|
||||
const products = yield call(fetchApi, '/products')
|
||||
yield put( {type: 'RECEIVE_PRODUCTS', products } )
|
||||
}
|
||||
|
||||
function* watchFetch() {
|
||||
while ( yield take('FETCH_PRODUCTS') ) {
|
||||
yield call(fetchProducts) // waits for the fetchProducts task to
|
||||
// terminate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace NonBlockingCallsWithForkJoin {
|
||||
function* fetchPosts() {
|
||||
yield put( {type: 'REQUEST_POSTS'} )
|
||||
const posts = yield call(fetchApi, '/posts')
|
||||
yield put( {type: 'RECEIVE_POSTS', posts} )
|
||||
}
|
||||
|
||||
function* watchFetch() {
|
||||
while ( yield take('FETCH_POSTS') ) {
|
||||
yield fork(fetchPosts) // non blocking call
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace TaskCancellation {
|
||||
declare const someApi: () => any;
|
||||
|
||||
function* bgSync() {
|
||||
try {
|
||||
while(true) {
|
||||
yield put({type: 'REQUEST_START'})
|
||||
const result = yield call(someApi)
|
||||
yield put({type: 'REQUEST_SUCCESS', result})
|
||||
yield call(delay, 5000)
|
||||
}
|
||||
} catch(error) {
|
||||
if(error instanceof SagaCancellationException)
|
||||
yield put({type: 'REQUEST_FAILURE', message: 'Sync cancelled!'})
|
||||
}
|
||||
}
|
||||
|
||||
function* main() {
|
||||
while( yield take('START_BACKGROUND_SYNC') ) {
|
||||
// starts the task in the background
|
||||
const bgSyncTask = yield fork(bgSync)
|
||||
|
||||
// wait for the user stop action
|
||||
yield take('STOP_BACKGROUND_SYNC')
|
||||
// user clicked stop. cancel the background task
|
||||
// this will throw a SagaCancellationException into the forked bgSync
|
||||
// task
|
||||
yield cancel(bgSyncTask)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace DynamicallyStartingSagasWithRunSaga {
|
||||
const store = createStore((state: any, action: any) => state);
|
||||
|
||||
function* serverSaga(getState) {
|
||||
yield getState()
|
||||
}
|
||||
|
||||
runSaga(
|
||||
serverSaga(store.getState),
|
||||
storeIO(store)
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--target ES6
|
||||
Vendored
+110
@@ -0,0 +1,110 @@
|
||||
// Type definitions for redux-saga 0.6.0
|
||||
// Project: https://github.com/yelouafi/redux-saga
|
||||
// Definitions by: Daniel Lytkin <https://github.com/aikoven>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../redux/redux.d.ts" />
|
||||
|
||||
declare module 'redux-saga' {
|
||||
export class SagaCancellationException {
|
||||
}
|
||||
|
||||
export type Effect = {};
|
||||
|
||||
export type Saga = <T>(getState?: () => T) => Iterable<any>;
|
||||
|
||||
type Predicate = (action: any) => boolean;
|
||||
|
||||
export function take(pattern?: string|string[]|Predicate): Effect;
|
||||
|
||||
export function put(action: any): Effect;
|
||||
|
||||
export function race(effects: {[key:string]: any}): Effect;
|
||||
|
||||
export function call<T1, T2, T3>(fn: (arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]) => any,
|
||||
arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]): Effect;
|
||||
|
||||
|
||||
export interface Task<T> {
|
||||
name:string;
|
||||
isRunning():boolean;
|
||||
result():T;
|
||||
error():any;
|
||||
}
|
||||
|
||||
export function fork(effect: Effect): Effect;
|
||||
export function fork<T1, T2, T3>(fn: (arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]) =>
|
||||
Promise<any>|Iterable<any>,
|
||||
arg1?: T1, arg2?: T2, arg3?: T3, ...rest: any[]): Effect;
|
||||
|
||||
export function join(task: Task<any>): Effect;
|
||||
|
||||
export function cancel(task: Task<any>): Effect;
|
||||
|
||||
|
||||
import {Middleware} from 'redux';
|
||||
export default function (...sagas: Saga[]): Middleware;
|
||||
|
||||
export {
|
||||
CANCEL,
|
||||
RACE_AUTO_CANCEL,
|
||||
PARALLEL_AUTO_CANCEL,
|
||||
MANUAL_CANCEL
|
||||
} from 'redux-saga/lib/proc';
|
||||
|
||||
import * as monitorActions from 'redux-saga/lib/monitorActions';
|
||||
export {monitorActions}
|
||||
|
||||
export {runSaga, storeIO} from 'redux-saga/lib/runSaga'
|
||||
|
||||
}
|
||||
|
||||
|
||||
declare module 'redux-saga/lib/proc' {
|
||||
import {Task} from 'redux-saga';
|
||||
|
||||
export const CANCEL: symbol;
|
||||
export const NOT_ITERATOR_ERROR: string;
|
||||
export const PARALLEL_AUTO_CANCEL: string;
|
||||
export const RACE_AUTO_CANCEL: string;
|
||||
export const MANUAL_CANCEL: string;
|
||||
|
||||
export default function proc(iterator: Iterable<any>,
|
||||
subscribe?: (cb: Function) => Function,
|
||||
dispatch?: (action: any) => any,
|
||||
monitor?: (action: any) => void,
|
||||
parentEffectId?: any,
|
||||
name?: string): Task<any>;
|
||||
}
|
||||
|
||||
|
||||
declare module 'redux-saga/lib/runSaga' {
|
||||
import {Store} from 'redux';
|
||||
import {Task} from 'redux-saga';
|
||||
|
||||
interface IO {
|
||||
dispatch: (action: any) => any;
|
||||
subscribe: (cb: Function) => Function;
|
||||
}
|
||||
|
||||
export function storeIO(store: Store): IO;
|
||||
|
||||
export function runSaga(iterator: Iterable<any>,
|
||||
io: IO,
|
||||
monitor?: (action: any) => void): Task<any>;
|
||||
}
|
||||
|
||||
|
||||
declare module 'redux-saga/lib/emitter' {
|
||||
export default function emitter(): {
|
||||
subscribe(cb: Function):Function;
|
||||
emit(item: any):void;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'redux-saga/lib/monitorActions' {
|
||||
export const MONITOR_ACTION: string;
|
||||
export const EFFECT_TRIGGERED: string;
|
||||
export const EFFECT_RESOLVED: string;
|
||||
export const EFFECT_REJECTED: string;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
--target ES6
|
||||
Vendored
+1
-1
@@ -40,7 +40,7 @@ declare module Redux {
|
||||
subscribe(listener: Function): Function;
|
||||
}
|
||||
|
||||
function createStore(reducer: Reducer, initialState?: any): Store;
|
||||
function createStore(reducer: Reducer, initialState?: any, enhancer?: ()=>any): Store;
|
||||
function bindActionCreators<T>(actionCreators: T, dispatch: Dispatch): T;
|
||||
function combineReducers(reducers: any): Reducer;
|
||||
function applyMiddleware(...middlewares: Middleware[]): Function;
|
||||
|
||||
+20
-18
@@ -13,6 +13,7 @@ import oAuth = require('rest/interceptor/oAuth');
|
||||
import csrf = require('rest/interceptor/csrf');
|
||||
import errorCode = require('rest/interceptor/errorCode');
|
||||
import retry = require('rest/interceptor/retry');
|
||||
import template = require('rest/interceptor/template');
|
||||
import timeout = require('rest/interceptor/timeout');
|
||||
import jsonp = require('rest/interceptor/jsonp');
|
||||
import xdomain = require('rest/interceptor/ie/xdomain');
|
||||
@@ -117,24 +118,25 @@ var promiseOrResponse = interceptor({
|
||||
});
|
||||
|
||||
client = rest
|
||||
.wrap<any>(defaultRequest)
|
||||
.wrap<any>(hateoas)
|
||||
.wrap<any>(location)
|
||||
.wrap<any>(mime)
|
||||
.wrap<any>(pathPrefix)
|
||||
.wrap<any>(basicAuth)
|
||||
.wrap<any>(oAuth)
|
||||
.wrap<any>(csrf)
|
||||
.wrap<any>(errorCode)
|
||||
.wrap<any>(retry)
|
||||
.wrap<any>(timeout)
|
||||
.wrap<any>(jsonp)
|
||||
.wrap<any>(xdomain)
|
||||
.wrap<any>(xhr)
|
||||
.wrap<any>(noop)
|
||||
.wrap<any>(fail)
|
||||
.wrap<any>(knownConfig, { prop: 'value' })
|
||||
.wrap<any>(transformedConfig, { prop: 'value' });
|
||||
.wrap(defaultRequest)
|
||||
.wrap(hateoas)
|
||||
.wrap(location)
|
||||
.wrap(mime)
|
||||
.wrap(pathPrefix)
|
||||
.wrap(basicAuth)
|
||||
.wrap(oAuth)
|
||||
.wrap(csrf)
|
||||
.wrap(errorCode)
|
||||
.wrap(retry)
|
||||
.wrap(template, { template: 'auth={token}', params: { token: 'hunter2' } })
|
||||
.wrap(timeout)
|
||||
.wrap(jsonp)
|
||||
.wrap(xdomain)
|
||||
.wrap(xhr)
|
||||
.wrap(noop)
|
||||
.wrap(fail)
|
||||
.wrap<KnownConfig>(knownConfig, { prop: 'value' })
|
||||
.wrap(transformedConfig, { prop: 'value' });
|
||||
|
||||
import xhrClient = require('rest/client/xhr');
|
||||
import nodeClient = require('rest/client/node');
|
||||
|
||||
Vendored
+18
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for rest.js v1.2.0
|
||||
// Type definitions for rest.js v1.3.1
|
||||
// Project: https://github.com/cujojs/rest
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -255,6 +255,23 @@ declare module "rest/interceptor/retry" {
|
||||
export = retry;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/template" {
|
||||
import rest = require("rest");
|
||||
|
||||
var template: rest.Interceptor<template.Config>;
|
||||
|
||||
module template {
|
||||
interface Config {
|
||||
template?: string;
|
||||
params?: {
|
||||
[name: string]: any;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export = template;
|
||||
}
|
||||
|
||||
declare module "rest/interceptor/timeout" {
|
||||
import rest = require("rest");
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user