test: add public api golden files
Includes a few style fixes on "* as foo" imports.
This commit is contained in:
+3
-1
@@ -43,7 +43,9 @@ const entrypoints = [
|
||||
'dist/packages-dist/platform-server/index.d.ts',
|
||||
'dist/packages-dist/platform-server/testing.d.ts',
|
||||
'dist/packages-dist/http/index.d.ts',
|
||||
'dist/packages-dist/http/testing.d.ts'
|
||||
'dist/packages-dist/http/testing.d.ts',
|
||||
'dist/packages-dist/forms/index.d.ts',
|
||||
'dist/packages-dist/router/index.d.ts'
|
||||
];
|
||||
const publicApiDir = 'tools/public_api_guard';
|
||||
const publicApiArgs = [
|
||||
|
||||
@@ -12,7 +12,7 @@ import {StringMapWrapper} from '../facade/collection';
|
||||
import {isArray, isPresent} from '../facade/lang';
|
||||
|
||||
import {AsyncValidatorFn, ValidatorFn} from './directives/validators';
|
||||
import * as modelModule from './model';
|
||||
import {AbstractControl, Control, ControlArray, ControlGroup} from './model';
|
||||
|
||||
|
||||
|
||||
@@ -67,22 +67,21 @@ export class FormBuilder {
|
||||
*
|
||||
* See the {@link ControlGroup} constructor for more details.
|
||||
*/
|
||||
group(controlsConfig: {[key: string]: any}, extra: {[key: string]: any} = null):
|
||||
modelModule.ControlGroup {
|
||||
group(controlsConfig: {[key: string]: any}, extra: {[key: string]: any} = null): ControlGroup {
|
||||
var controls = this._reduceControls(controlsConfig);
|
||||
var optionals = <{[key: string]: boolean}>(
|
||||
isPresent(extra) ? StringMapWrapper.get(extra, 'optionals') : null);
|
||||
var validator: ValidatorFn = isPresent(extra) ? StringMapWrapper.get(extra, 'validator') : null;
|
||||
var asyncValidator: AsyncValidatorFn =
|
||||
isPresent(extra) ? StringMapWrapper.get(extra, 'asyncValidator') : null;
|
||||
return new modelModule.ControlGroup(controls, optionals, validator, asyncValidator);
|
||||
return new ControlGroup(controls, optionals, validator, asyncValidator);
|
||||
}
|
||||
/**
|
||||
* Construct a new {@link Control} with the given `value`,`validator`, and `asyncValidator`.
|
||||
*/
|
||||
control(value: Object, validator: ValidatorFn = null, asyncValidator: AsyncValidatorFn = null):
|
||||
modelModule.Control {
|
||||
return new modelModule.Control(value, validator, asyncValidator);
|
||||
Control {
|
||||
return new Control(value, validator, asyncValidator);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,15 +90,14 @@ export class FormBuilder {
|
||||
*/
|
||||
array(
|
||||
controlsConfig: any[], validator: ValidatorFn = null,
|
||||
asyncValidator: AsyncValidatorFn = null): modelModule.ControlArray {
|
||||
asyncValidator: AsyncValidatorFn = null): ControlArray {
|
||||
var controls = controlsConfig.map(c => this._createControl(c));
|
||||
return new modelModule.ControlArray(controls, validator, asyncValidator);
|
||||
return new ControlArray(controls, validator, asyncValidator);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
_reduceControls(controlsConfig: {[k: string]: any}):
|
||||
{[key: string]: modelModule.AbstractControl} {
|
||||
var controls: {[key: string]: modelModule.AbstractControl} = {};
|
||||
_reduceControls(controlsConfig: {[k: string]: any}): {[key: string]: AbstractControl} {
|
||||
var controls: {[key: string]: AbstractControl} = {};
|
||||
StringMapWrapper.forEach(controlsConfig, (controlConfig: any, controlName: string) => {
|
||||
controls[controlName] = this._createControl(controlConfig);
|
||||
});
|
||||
@@ -107,10 +105,9 @@ export class FormBuilder {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
_createControl(controlConfig: any): modelModule.AbstractControl {
|
||||
if (controlConfig instanceof modelModule.Control ||
|
||||
controlConfig instanceof modelModule.ControlGroup ||
|
||||
controlConfig instanceof modelModule.ControlArray) {
|
||||
_createControl(controlConfig: any): AbstractControl {
|
||||
if (controlConfig instanceof Control || controlConfig instanceof ControlGroup ||
|
||||
controlConfig instanceof ControlArray) {
|
||||
return controlConfig;
|
||||
|
||||
} else if (isArray(controlConfig)) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {StringMapWrapper} from '../facade/collection';
|
||||
import {isBlank, isPresent, isPromise, isString} from '../facade/lang';
|
||||
import {PromiseWrapper} from '../facade/promise';
|
||||
import {AsyncValidatorFn, ValidatorFn} from './directives/validators';
|
||||
import * as modelModule from './model';
|
||||
import {AbstractControl} from './model';
|
||||
|
||||
/**
|
||||
* Providers for validators to be used for {@link Control}s in a form.
|
||||
@@ -57,7 +57,7 @@ export class Validators {
|
||||
/**
|
||||
* Validator that requires controls to have a non-empty value.
|
||||
*/
|
||||
static required(control: modelModule.AbstractControl): {[key: string]: boolean} {
|
||||
static required(control: AbstractControl): {[key: string]: boolean} {
|
||||
return isBlank(control.value) || (isString(control.value) && control.value == '') ?
|
||||
{'required': true} :
|
||||
null;
|
||||
@@ -67,7 +67,7 @@ export class Validators {
|
||||
* Validator that requires controls to have a value of a minimum length.
|
||||
*/
|
||||
static minLength(minLength: number): ValidatorFn {
|
||||
return (control: modelModule.AbstractControl): {[key: string]: any} => {
|
||||
return (control: AbstractControl): {[key: string]: any} => {
|
||||
if (isPresent(Validators.required(control))) return null;
|
||||
var v: string = control.value;
|
||||
return v.length < minLength ?
|
||||
@@ -80,7 +80,7 @@ export class Validators {
|
||||
* Validator that requires controls to have a value of a maximum length.
|
||||
*/
|
||||
static maxLength(maxLength: number): ValidatorFn {
|
||||
return (control: modelModule.AbstractControl): {[key: string]: any} => {
|
||||
return (control: AbstractControl): {[key: string]: any} => {
|
||||
if (isPresent(Validators.required(control))) return null;
|
||||
var v: string = control.value;
|
||||
return v.length > maxLength ?
|
||||
@@ -93,7 +93,7 @@ export class Validators {
|
||||
* Validator that requires a control to match a regex to its value.
|
||||
*/
|
||||
static pattern(pattern: string): ValidatorFn {
|
||||
return (control: modelModule.AbstractControl): {[key: string]: any} => {
|
||||
return (control: AbstractControl): {[key: string]: any} => {
|
||||
if (isPresent(Validators.required(control))) return null;
|
||||
let regex = new RegExp(`^${pattern}$`);
|
||||
let v: string = control.value;
|
||||
@@ -105,7 +105,7 @@ export class Validators {
|
||||
/**
|
||||
* No-op validator.
|
||||
*/
|
||||
static nullValidator(c: modelModule.AbstractControl): {[key: string]: boolean} { return null; }
|
||||
static nullValidator(c: AbstractControl): {[key: string]: boolean} { return null; }
|
||||
|
||||
/**
|
||||
* Compose multiple validators into a single function that returns the union
|
||||
@@ -116,7 +116,7 @@ export class Validators {
|
||||
var presentValidators = validators.filter(isPresent);
|
||||
if (presentValidators.length == 0) return null;
|
||||
|
||||
return function(control: modelModule.AbstractControl) {
|
||||
return function(control: AbstractControl) {
|
||||
return _mergeErrors(_executeValidators(control, presentValidators));
|
||||
};
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class Validators {
|
||||
var presentValidators = validators.filter(isPresent);
|
||||
if (presentValidators.length == 0) return null;
|
||||
|
||||
return function(control: modelModule.AbstractControl) {
|
||||
return function(control: AbstractControl) {
|
||||
let promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);
|
||||
return PromiseWrapper.all(promises).then(_mergeErrors);
|
||||
};
|
||||
@@ -137,13 +137,11 @@ function _convertToPromise(obj: any): Promise<any> {
|
||||
return isPromise(obj) ? obj : ObservableWrapper.toPromise(obj);
|
||||
}
|
||||
|
||||
function _executeValidators(
|
||||
control: modelModule.AbstractControl, validators: ValidatorFn[]): any[] {
|
||||
function _executeValidators(control: AbstractControl, validators: ValidatorFn[]): any[] {
|
||||
return validators.map(v => v(control));
|
||||
}
|
||||
|
||||
function _executeAsyncValidators(
|
||||
control: modelModule.AbstractControl, validators: AsyncValidatorFn[]): any[] {
|
||||
function _executeAsyncValidators(control: AbstractControl, validators: AsyncValidatorFn[]): any[] {
|
||||
return validators.map(v => v(control));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import * as impl from './wtf_impl';
|
||||
import {WtfScopeFn, createScope, detectWTF, endTimeRange, leave, startTimeRange} from './wtf_impl';
|
||||
|
||||
export {WtfScopeFn} from './wtf_impl';
|
||||
|
||||
@@ -16,7 +16,7 @@ export {WtfScopeFn} from './wtf_impl';
|
||||
/**
|
||||
* True if WTF is enabled.
|
||||
*/
|
||||
export var wtfEnabled = impl.detectWTF();
|
||||
export var wtfEnabled = detectWTF();
|
||||
|
||||
function noopScope(arg0?: any, arg1?: any): any {
|
||||
return null;
|
||||
@@ -52,8 +52,8 @@ function noopScope(arg0?: any, arg1?: any): any {
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfCreateScope: (signature: string, flags?: any) => impl.WtfScopeFn =
|
||||
wtfEnabled ? impl.createScope : (signature: string, flags?: any) => noopScope;
|
||||
export var wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =
|
||||
wtfEnabled ? createScope : (signature: string, flags?: any) => noopScope;
|
||||
|
||||
/**
|
||||
* Used to mark end of Scope.
|
||||
@@ -65,7 +65,7 @@ export var wtfCreateScope: (signature: string, flags?: any) => impl.WtfScopeFn =
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfLeave: <T>(scope: any, returnValue?: T) => T =
|
||||
wtfEnabled ? impl.leave : (s: any, r?: any) => r;
|
||||
wtfEnabled ? leave : (s: any, r?: any) => r;
|
||||
|
||||
/**
|
||||
* Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.
|
||||
@@ -81,7 +81,7 @@ export var wtfLeave: <T>(scope: any, returnValue?: T) => T =
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfStartTimeRange: (rangeType: string, action: string) => any =
|
||||
wtfEnabled ? impl.startTimeRange : (rangeType: string, action: string) => null;
|
||||
wtfEnabled ? startTimeRange : (rangeType: string, action: string) => null;
|
||||
|
||||
/**
|
||||
* Ends a async time range operation.
|
||||
@@ -89,5 +89,4 @@ export var wtfStartTimeRange: (rangeType: string, action: string) => any =
|
||||
* enabled.
|
||||
* @experimental
|
||||
*/
|
||||
export var wtfEndTimeRange: (range: any) => void =
|
||||
wtfEnabled ? impl.endTimeRange : (r: any) => null;
|
||||
export var wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {Injectable} from '@angular/core';
|
||||
import {AsyncValidatorFn, ValidatorFn} from './directives/validators';
|
||||
import {StringMapWrapper} from './facade/collection';
|
||||
import {isArray, isPresent} from './facade/lang';
|
||||
import * as modelModule from './model';
|
||||
import {AbstractControl, FormArray, FormControl, FormGroup} from './model';
|
||||
|
||||
|
||||
|
||||
@@ -63,23 +63,22 @@ export class FormBuilder {
|
||||
*
|
||||
* See the {@link FormGroup} constructor for more details.
|
||||
*/
|
||||
group(controlsConfig: {[key: string]: any}, extra: {[key: string]: any} = null):
|
||||
modelModule.FormGroup {
|
||||
group(controlsConfig: {[key: string]: any}, extra: {[key: string]: any} = null): FormGroup {
|
||||
var controls = this._reduceControls(controlsConfig);
|
||||
var optionals = <{[key: string]: boolean}>(
|
||||
isPresent(extra) ? StringMapWrapper.get(extra, 'optionals') : null);
|
||||
var validator: ValidatorFn = isPresent(extra) ? StringMapWrapper.get(extra, 'validator') : null;
|
||||
var asyncValidator: AsyncValidatorFn =
|
||||
isPresent(extra) ? StringMapWrapper.get(extra, 'asyncValidator') : null;
|
||||
return new modelModule.FormGroup(controls, optionals, validator, asyncValidator);
|
||||
return new FormGroup(controls, optionals, validator, asyncValidator);
|
||||
}
|
||||
/**
|
||||
* Construct a new {@link FormControl} with the given `value`,`validator`, and `asyncValidator`.
|
||||
*/
|
||||
control(
|
||||
value: Object, validator: ValidatorFn|ValidatorFn[] = null,
|
||||
asyncValidator: AsyncValidatorFn|AsyncValidatorFn[] = null): modelModule.FormControl {
|
||||
return new modelModule.FormControl(value, validator, asyncValidator);
|
||||
asyncValidator: AsyncValidatorFn|AsyncValidatorFn[] = null): FormControl {
|
||||
return new FormControl(value, validator, asyncValidator);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,15 +87,14 @@ export class FormBuilder {
|
||||
*/
|
||||
array(
|
||||
controlsConfig: any[], validator: ValidatorFn = null,
|
||||
asyncValidator: AsyncValidatorFn = null): modelModule.FormArray {
|
||||
asyncValidator: AsyncValidatorFn = null): FormArray {
|
||||
var controls = controlsConfig.map(c => this._createControl(c));
|
||||
return new modelModule.FormArray(controls, validator, asyncValidator);
|
||||
return new FormArray(controls, validator, asyncValidator);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
_reduceControls(controlsConfig: {[k: string]: any}):
|
||||
{[key: string]: modelModule.AbstractControl} {
|
||||
var controls: {[key: string]: modelModule.AbstractControl} = {};
|
||||
_reduceControls(controlsConfig: {[k: string]: any}): {[key: string]: AbstractControl} {
|
||||
var controls: {[key: string]: AbstractControl} = {};
|
||||
StringMapWrapper.forEach(controlsConfig, (controlConfig: any, controlName: string) => {
|
||||
controls[controlName] = this._createControl(controlConfig);
|
||||
});
|
||||
@@ -104,10 +102,9 @@ export class FormBuilder {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
_createControl(controlConfig: any): modelModule.AbstractControl {
|
||||
if (controlConfig instanceof modelModule.FormControl ||
|
||||
controlConfig instanceof modelModule.FormGroup ||
|
||||
controlConfig instanceof modelModule.FormArray) {
|
||||
_createControl(controlConfig: any): AbstractControl {
|
||||
if (controlConfig instanceof FormControl || controlConfig instanceof FormGroup ||
|
||||
controlConfig instanceof FormArray) {
|
||||
return controlConfig;
|
||||
|
||||
} else if (isArray(controlConfig)) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {ObservableWrapper} from './facade/async';
|
||||
import {StringMapWrapper} from './facade/collection';
|
||||
import {isBlank, isPresent, isPromise, isString} from './facade/lang';
|
||||
import {PromiseWrapper} from './facade/promise';
|
||||
import * as modelModule from './model';
|
||||
import {AbstractControl} from './model';
|
||||
|
||||
/**
|
||||
* Providers for validators to be used for {@link FormControl}s in a form.
|
||||
@@ -57,7 +57,7 @@ export class Validators {
|
||||
/**
|
||||
* Validator that requires controls to have a non-empty value.
|
||||
*/
|
||||
static required(control: modelModule.AbstractControl): {[key: string]: boolean} {
|
||||
static required(control: AbstractControl): {[key: string]: boolean} {
|
||||
return isBlank(control.value) || (isString(control.value) && control.value == '') ?
|
||||
{'required': true} :
|
||||
null;
|
||||
@@ -67,7 +67,7 @@ export class Validators {
|
||||
* Validator that requires controls to have a value of a minimum length.
|
||||
*/
|
||||
static minLength(minLength: number): ValidatorFn {
|
||||
return (control: modelModule.AbstractControl): {[key: string]: any} => {
|
||||
return (control: AbstractControl): {[key: string]: any} => {
|
||||
if (isPresent(Validators.required(control))) return null;
|
||||
var v: string = control.value;
|
||||
return v.length < minLength ?
|
||||
@@ -80,7 +80,7 @@ export class Validators {
|
||||
* Validator that requires controls to have a value of a maximum length.
|
||||
*/
|
||||
static maxLength(maxLength: number): ValidatorFn {
|
||||
return (control: modelModule.AbstractControl): {[key: string]: any} => {
|
||||
return (control: AbstractControl): {[key: string]: any} => {
|
||||
if (isPresent(Validators.required(control))) return null;
|
||||
var v: string = control.value;
|
||||
return v.length > maxLength ?
|
||||
@@ -93,7 +93,7 @@ export class Validators {
|
||||
* Validator that requires a control to match a regex to its value.
|
||||
*/
|
||||
static pattern(pattern: string): ValidatorFn {
|
||||
return (control: modelModule.AbstractControl): {[key: string]: any} => {
|
||||
return (control: AbstractControl): {[key: string]: any} => {
|
||||
if (isPresent(Validators.required(control))) return null;
|
||||
let regex = new RegExp(`^${pattern}$`);
|
||||
let v: string = control.value;
|
||||
@@ -105,7 +105,7 @@ export class Validators {
|
||||
/**
|
||||
* No-op validator.
|
||||
*/
|
||||
static nullValidator(c: modelModule.AbstractControl): {[key: string]: boolean} { return null; }
|
||||
static nullValidator(c: AbstractControl): {[key: string]: boolean} { return null; }
|
||||
|
||||
/**
|
||||
* Compose multiple validators into a single function that returns the union
|
||||
@@ -116,7 +116,7 @@ export class Validators {
|
||||
var presentValidators = validators.filter(isPresent);
|
||||
if (presentValidators.length == 0) return null;
|
||||
|
||||
return function(control: modelModule.AbstractControl) {
|
||||
return function(control: AbstractControl) {
|
||||
return _mergeErrors(_executeValidators(control, presentValidators));
|
||||
};
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export class Validators {
|
||||
var presentValidators = validators.filter(isPresent);
|
||||
if (presentValidators.length == 0) return null;
|
||||
|
||||
return function(control: modelModule.AbstractControl) {
|
||||
return function(control: AbstractControl) {
|
||||
let promises = _executeAsyncValidators(control, presentValidators).map(_convertToPromise);
|
||||
return PromiseWrapper.all(promises).then(_mergeErrors);
|
||||
};
|
||||
@@ -137,13 +137,11 @@ function _convertToPromise(obj: any): Promise<any> {
|
||||
return isPromise(obj) ? obj : ObservableWrapper.toPromise(obj);
|
||||
}
|
||||
|
||||
function _executeValidators(
|
||||
control: modelModule.AbstractControl, validators: ValidatorFn[]): any[] {
|
||||
function _executeValidators(control: AbstractControl, validators: ValidatorFn[]): any[] {
|
||||
return validators.map(v => v(control));
|
||||
}
|
||||
|
||||
function _executeAsyncValidators(
|
||||
control: modelModule.AbstractControl, validators: AsyncValidatorFn[]): any[] {
|
||||
function _executeAsyncValidators(control: AbstractControl, validators: AsyncValidatorFn[]): any[] {
|
||||
return validators.map(v => v(control));
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import {PlatformLocation} from '@angular/common';
|
||||
import {BrowserPlatformLocation} from '@angular/platform-browser';
|
||||
|
||||
import * as common from './common_router_providers';
|
||||
import {ExtraOptions, provideRouter as provideRouter_} from './common_router_providers';
|
||||
import {RouterConfig} from './config';
|
||||
|
||||
|
||||
@@ -31,9 +31,8 @@ import {RouterConfig} from './config';
|
||||
* bootstrap(AppCmp, [provideRouter(router)]);
|
||||
* ```
|
||||
*/
|
||||
export function provideRouter(config: RouterConfig, opts: common.ExtraOptions = {}): any[] {
|
||||
export function provideRouter(config: RouterConfig, opts: ExtraOptions = {}): any[] {
|
||||
return [
|
||||
{provide: PlatformLocation, useClass: BrowserPlatformLocation},
|
||||
...common.provideRouter(config, opts)
|
||||
{provide: PlatformLocation, useClass: BrowserPlatformLocation}, ...provideRouter_(config, opts)
|
||||
];
|
||||
}
|
||||
|
||||
+531
File diff suppressed because it is too large
Load Diff
+33
@@ -0,0 +1,33 @@
|
||||
export declare class MockLocationStrategy extends LocationStrategy {
|
||||
internalBaseHref: string;
|
||||
internalPath: string;
|
||||
internalTitle: string;
|
||||
urlChanges: string[];
|
||||
constructor();
|
||||
simulatePopState(url: string): void;
|
||||
path(): string;
|
||||
prepareExternalUrl(internal: string): string;
|
||||
pushState(ctx: any, title: string, path: string, query: string): void;
|
||||
replaceState(ctx: any, title: string, path: string, query: string): void;
|
||||
onPopState(fn: (value: any) => void): void;
|
||||
getBaseHref(): string;
|
||||
back(): void;
|
||||
forward(): void;
|
||||
}
|
||||
|
||||
export declare class SpyLocation implements Location {
|
||||
urlChanges: string[];
|
||||
setInitialPath(url: string): void;
|
||||
setBaseHref(url: string): void;
|
||||
path(): string;
|
||||
isCurrentPathEqualTo(path: string, query?: string): boolean;
|
||||
simulateUrlPop(pathname: string): void;
|
||||
simulateHashChange(pathname: string): void;
|
||||
prepareExternalUrl(url: string): string;
|
||||
go(path: string, query?: string): void;
|
||||
replaceState(path: string, query?: string): void;
|
||||
forward(): void;
|
||||
back(): void;
|
||||
subscribe(onNext: (value: any) => void, onThrow?: (error: any) => void, onReturn?: () => void): Object;
|
||||
normalize(url: string): string;
|
||||
}
|
||||
+582
File diff suppressed because it is too large
Load Diff
+79
@@ -0,0 +1,79 @@
|
||||
export declare class ComponentFixture<T> {
|
||||
debugElement: DebugElement;
|
||||
componentInstance: any;
|
||||
nativeElement: any;
|
||||
elementRef: ElementRef;
|
||||
componentRef: ComponentRef<T>;
|
||||
changeDetectorRef: ChangeDetectorRef;
|
||||
ngZone: NgZone;
|
||||
constructor(componentRef: ComponentRef<T>, ngZone: NgZone, autoDetect: boolean);
|
||||
detectChanges(checkNoChanges?: boolean): void;
|
||||
checkNoChanges(): void;
|
||||
autoDetectChanges(autoDetect?: boolean): void;
|
||||
isStable(): boolean;
|
||||
whenStable(): Promise<any>;
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
export declare var ComponentFixtureAutoDetect: OpaqueToken;
|
||||
|
||||
export declare var ComponentFixtureNoNgZone: OpaqueToken;
|
||||
|
||||
export declare class MockDirectiveResolver extends DirectiveResolver {
|
||||
resolve(type: Type): DirectiveMetadata;
|
||||
setProvidersOverride(type: Type, providers: any[]): void;
|
||||
setViewProvidersOverride(type: Type, viewProviders: any[]): void;
|
||||
}
|
||||
|
||||
export declare class MockSchemaRegistry implements ElementSchemaRegistry {
|
||||
existingProperties: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
attrPropMapping: {
|
||||
[key: string]: string;
|
||||
};
|
||||
constructor(existingProperties: {
|
||||
[key: string]: boolean;
|
||||
}, attrPropMapping: {
|
||||
[key: string]: string;
|
||||
});
|
||||
hasProperty(tagName: string, property: string): boolean;
|
||||
securityContext(tagName: string, property: string): SecurityContext;
|
||||
getMappedPropName(attrName: string): string;
|
||||
}
|
||||
|
||||
export declare class MockViewResolver extends ViewResolver {
|
||||
constructor();
|
||||
setView(component: Type, view: ViewMetadata): void;
|
||||
setInlineTemplate(component: Type, template: string): void;
|
||||
setAnimations(component: Type, animations: AnimationEntryMetadata[]): void;
|
||||
overrideViewDirective(component: Type, from: Type, to: Type): void;
|
||||
resolve(component: Type): ViewMetadata;
|
||||
}
|
||||
|
||||
export declare class MockXHR extends XHR {
|
||||
get(url: string): Promise<string>;
|
||||
expect(url: string, response: string): void;
|
||||
when(url: string, response: string): void;
|
||||
flush(): void;
|
||||
verifyNoOutstandingExpectations(): void;
|
||||
}
|
||||
|
||||
export declare class TestComponentBuilder {
|
||||
constructor(_injector: Injector);
|
||||
overrideTemplate(componentType: Type, template: string): TestComponentBuilder;
|
||||
overrideAnimations(componentType: Type, animations: AnimationEntryMetadata[]): TestComponentBuilder;
|
||||
overrideView(componentType: Type, view: ViewMetadata): TestComponentBuilder;
|
||||
overrideDirective(componentType: Type, from: Type, to: Type): TestComponentBuilder;
|
||||
overrideProviders(type: Type, providers: any[]): TestComponentBuilder;
|
||||
overrideBindings(type: Type, providers: any[]): TestComponentBuilder;
|
||||
overrideViewProviders(type: Type, providers: any[]): TestComponentBuilder;
|
||||
overrideViewBindings(type: Type, providers: any[]): TestComponentBuilder;
|
||||
createAsync(rootComponentType: Type): Promise<ComponentFixture<any>>;
|
||||
createFakeAsync(rootComponentType: Type): ComponentFixture<any>;
|
||||
createSync<C>(componentFactory: ComponentFactory<C>): ComponentFixture<C>;
|
||||
}
|
||||
|
||||
export declare class TestComponentRenderer {
|
||||
insertRootElement(rootElementId: string): void;
|
||||
}
|
||||
+1266
File diff suppressed because it is too large
Load Diff
+97
@@ -0,0 +1,97 @@
|
||||
export declare var afterEach: Function;
|
||||
|
||||
export declare function async(fn: Function): Function;
|
||||
|
||||
export declare function beforeEach(fn: Function): void;
|
||||
|
||||
export declare function beforeEachProviders(fn: () => Array<any>): void;
|
||||
|
||||
export declare function clearPendingTimers(): void;
|
||||
|
||||
export declare var ddescribe: Function;
|
||||
|
||||
export declare var describe: Function;
|
||||
|
||||
export declare function discardPeriodicTasks(): void;
|
||||
|
||||
export declare var expect: Function;
|
||||
|
||||
export declare function fakeAsync(fn: Function): Function;
|
||||
|
||||
export declare var fdescribe: Function;
|
||||
|
||||
export declare function fit(name: string, fn: Function, timeOut?: number): void;
|
||||
|
||||
export declare function flushMicrotasks(): void;
|
||||
|
||||
export declare function getTestInjector(): TestInjector;
|
||||
|
||||
export declare function getTypeOf(instance: any): any;
|
||||
|
||||
export declare function iit(name: string, fn: Function, timeOut?: number): void;
|
||||
|
||||
export declare function inject(tokens: any[], fn: Function): Function;
|
||||
|
||||
export declare function injectAsync(tokens: any[], fn: Function): Function;
|
||||
|
||||
export declare class InjectSetupWrapper {
|
||||
constructor(_providers: () => any);
|
||||
inject(tokens: any[], fn: Function): Function;
|
||||
injectAsync(tokens: any[], fn: Function): Function;
|
||||
}
|
||||
|
||||
export declare function instantiateType(type: Function, params?: any[]): any;
|
||||
|
||||
export declare function it(name: string, fn: Function, timeOut?: number): void;
|
||||
|
||||
export declare class Log {
|
||||
logItems: any[];
|
||||
constructor();
|
||||
add(value: any): void;
|
||||
fn(value: any): (a1?: any, a2?: any, a3?: any, a4?: any, a5?: any) => void;
|
||||
clear(): void;
|
||||
result(): string;
|
||||
}
|
||||
|
||||
export declare class MockApplicationRef extends ApplicationRef {
|
||||
registerBootstrapListener(listener: (ref: ComponentRef<any>) => void): void;
|
||||
registerDisposeListener(dispose: () => void): void;
|
||||
bootstrap<C>(componentFactory: ComponentFactory<C>): ComponentRef<C>;
|
||||
injector: Injector;
|
||||
zone: NgZone;
|
||||
run(callback: Function): any;
|
||||
waitForAsyncInitializers(): Promise<any>;
|
||||
dispose(): void;
|
||||
tick(): void;
|
||||
componentTypes: Type[];
|
||||
}
|
||||
|
||||
export declare class MockNgZone extends NgZone {
|
||||
constructor();
|
||||
onStable: EventEmitter<any>;
|
||||
run(fn: Function): any;
|
||||
runOutsideAngular(fn: Function): any;
|
||||
simulateZoneExit(): void;
|
||||
}
|
||||
|
||||
export declare function resetBaseTestProviders(): void;
|
||||
|
||||
export declare function setBaseTestProviders(platformProviders: Array<Type | Provider | any[]>, applicationProviders: Array<Type | Provider | any[]>): void;
|
||||
|
||||
export declare class TestInjector {
|
||||
reset(): void;
|
||||
platformProviders: Array<Type | Provider | any[] | any>;
|
||||
applicationProviders: Array<Type | Provider | any[] | any>;
|
||||
addProviders(providers: Array<Type | Provider | any[] | any>): void;
|
||||
createInjector(): ReflectiveInjector;
|
||||
get(token: any): any;
|
||||
execute(tokens: any[], fn: Function): any;
|
||||
}
|
||||
|
||||
export declare function tick(millis?: number): void;
|
||||
|
||||
export declare function withProviders(providers: () => any): InjectSetupWrapper;
|
||||
|
||||
export declare var xdescribe: Function;
|
||||
|
||||
export declare function xit(name: string, fn: Function, timeOut?: number): void;
|
||||
+340
File diff suppressed because it is too large
Load Diff
+215
@@ -0,0 +1,215 @@
|
||||
export declare class BaseRequestOptions extends RequestOptions {
|
||||
constructor();
|
||||
}
|
||||
|
||||
export declare class BaseResponseOptions extends ResponseOptions {
|
||||
constructor();
|
||||
}
|
||||
|
||||
export declare class BrowserXhr {
|
||||
constructor();
|
||||
build(): any;
|
||||
}
|
||||
|
||||
export declare abstract class Connection {
|
||||
readyState: ReadyState;
|
||||
request: Request;
|
||||
response: any;
|
||||
}
|
||||
|
||||
export declare abstract class ConnectionBackend {
|
||||
abstract createConnection(request: any): Connection;
|
||||
}
|
||||
|
||||
export declare class CookieXSRFStrategy implements XSRFStrategy {
|
||||
constructor(_cookieName?: string, _headerName?: string);
|
||||
configureRequest(req: Request): void;
|
||||
}
|
||||
|
||||
export declare class Headers {
|
||||
constructor(headers?: Headers | {
|
||||
[key: string]: any;
|
||||
});
|
||||
static fromResponseHeaderString(headersString: string): Headers;
|
||||
append(name: string, value: string): void;
|
||||
delete(name: string): void;
|
||||
forEach(fn: (values: string[], name: string, headers: Map<string, string[]>) => void): void;
|
||||
get(header: string): string;
|
||||
has(header: string): boolean;
|
||||
keys(): string[];
|
||||
set(header: string, value: string | string[]): void;
|
||||
values(): string[][];
|
||||
toJSON(): {
|
||||
[key: string]: any;
|
||||
};
|
||||
getAll(header: string): string[];
|
||||
entries(): void;
|
||||
}
|
||||
|
||||
export declare class Http {
|
||||
protected _backend: ConnectionBackend;
|
||||
protected _defaultOptions: RequestOptions;
|
||||
constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions);
|
||||
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
|
||||
get(url: string, options?: RequestOptionsArgs): Observable<Response>;
|
||||
post(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
|
||||
put(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
|
||||
delete(url: string, options?: RequestOptionsArgs): Observable<Response>;
|
||||
patch(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
|
||||
head(url: string, options?: RequestOptionsArgs): Observable<Response>;
|
||||
}
|
||||
|
||||
export declare const HTTP_BINDINGS: any[];
|
||||
|
||||
export declare const HTTP_PROVIDERS: any[];
|
||||
|
||||
export declare function httpFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions): Http;
|
||||
|
||||
export declare const JSON_BINDINGS: any[];
|
||||
|
||||
export declare class Jsonp extends Http {
|
||||
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions);
|
||||
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
|
||||
}
|
||||
|
||||
export declare const JSONP_PROVIDERS: any[];
|
||||
|
||||
export declare abstract class JSONPBackend extends ConnectionBackend {
|
||||
}
|
||||
|
||||
export declare abstract class JSONPConnection implements Connection {
|
||||
readyState: ReadyState;
|
||||
request: Request;
|
||||
response: Observable<Response>;
|
||||
abstract finished(data?: any): void;
|
||||
}
|
||||
|
||||
export declare enum ReadyState {
|
||||
Unsent = 0,
|
||||
Open = 1,
|
||||
HeadersReceived = 2,
|
||||
Loading = 3,
|
||||
Done = 4,
|
||||
Cancelled = 5,
|
||||
}
|
||||
|
||||
export declare class Request {
|
||||
method: RequestMethod;
|
||||
headers: Headers;
|
||||
url: string;
|
||||
withCredentials: boolean;
|
||||
constructor(requestOptions: RequestArgs);
|
||||
text(): string;
|
||||
json(): string;
|
||||
arrayBuffer(): ArrayBuffer;
|
||||
blob(): Blob;
|
||||
detectContentType(): ContentType;
|
||||
getBody(): any;
|
||||
}
|
||||
|
||||
export declare enum RequestMethod {
|
||||
Get = 0,
|
||||
Post = 1,
|
||||
Put = 2,
|
||||
Delete = 3,
|
||||
Options = 4,
|
||||
Head = 5,
|
||||
Patch = 6,
|
||||
}
|
||||
|
||||
export declare class RequestOptions {
|
||||
method: RequestMethod | string;
|
||||
headers: Headers;
|
||||
body: any;
|
||||
url: string;
|
||||
search: URLSearchParams;
|
||||
withCredentials: boolean;
|
||||
constructor({method, headers, body, url, search, withCredentials}?: RequestOptionsArgs);
|
||||
merge(options?: RequestOptionsArgs): RequestOptions;
|
||||
}
|
||||
|
||||
export interface RequestOptionsArgs {
|
||||
url?: string;
|
||||
method?: string | RequestMethod;
|
||||
search?: string | URLSearchParams;
|
||||
headers?: Headers;
|
||||
body?: any;
|
||||
withCredentials?: boolean;
|
||||
}
|
||||
|
||||
export declare class Response {
|
||||
type: ResponseType;
|
||||
ok: boolean;
|
||||
url: string;
|
||||
status: number;
|
||||
statusText: string;
|
||||
bytesLoaded: number;
|
||||
totalBytes: number;
|
||||
headers: Headers;
|
||||
constructor(responseOptions: ResponseOptions);
|
||||
blob(): any;
|
||||
json(): any;
|
||||
text(): string;
|
||||
arrayBuffer(): any;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class ResponseOptions {
|
||||
body: string | Object;
|
||||
status: number;
|
||||
headers: Headers;
|
||||
url: string;
|
||||
constructor({body, status, headers, statusText, type, url}?: ResponseOptionsArgs);
|
||||
merge(options?: ResponseOptionsArgs): ResponseOptions;
|
||||
}
|
||||
|
||||
export declare type ResponseOptionsArgs = {
|
||||
body?: string | Object | FormData;
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
headers?: Headers;
|
||||
type?: ResponseType;
|
||||
url?: string;
|
||||
};
|
||||
|
||||
export declare enum ResponseType {
|
||||
Basic = 0,
|
||||
Cors = 1,
|
||||
Default = 2,
|
||||
Error = 3,
|
||||
Opaque = 4,
|
||||
}
|
||||
|
||||
export declare class URLSearchParams {
|
||||
rawParams: string;
|
||||
paramsMap: Map<string, string[]>;
|
||||
constructor(rawParams?: string);
|
||||
clone(): URLSearchParams;
|
||||
has(param: string): boolean;
|
||||
get(param: string): string;
|
||||
getAll(param: string): string[];
|
||||
set(param: string, val: string): void;
|
||||
setAll(searchParams: URLSearchParams): void;
|
||||
append(param: string, val: string): void;
|
||||
appendAll(searchParams: URLSearchParams): void;
|
||||
replaceAll(searchParams: URLSearchParams): void;
|
||||
toString(): string;
|
||||
delete(param: string): void;
|
||||
}
|
||||
|
||||
export declare class XHRBackend implements ConnectionBackend {
|
||||
constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy);
|
||||
createConnection(request: Request): XHRConnection;
|
||||
}
|
||||
|
||||
export declare class XHRConnection implements Connection {
|
||||
request: Request;
|
||||
response: Observable<Response>;
|
||||
readyState: ReadyState;
|
||||
constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions);
|
||||
setDetectedContentType(req: any, _xhr: any): void;
|
||||
}
|
||||
|
||||
export declare abstract class XSRFStrategy {
|
||||
abstract configureRequest(req: Request): void;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
export declare class MockBackend implements ConnectionBackend {
|
||||
connections: any;
|
||||
connectionsArray: MockConnection[];
|
||||
pendingConnections: any;
|
||||
constructor();
|
||||
verifyNoPendingRequests(): void;
|
||||
resolveAllConnections(): void;
|
||||
createConnection(req: Request): MockConnection;
|
||||
}
|
||||
|
||||
export declare class MockConnection implements Connection {
|
||||
readyState: ReadyState;
|
||||
request: Request;
|
||||
response: ReplaySubject<Response>;
|
||||
constructor(req: Request);
|
||||
mockRespond(res: Response): void;
|
||||
mockDownload(res: Response): void;
|
||||
mockError(err?: Error): void;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export declare function bootstrap(appComponentType: Type, customProviders?: Array<any>): Promise<ComponentRef<any>>;
|
||||
|
||||
export declare function bootstrapWorkerApp(appComponentType: Type, customProviders?: Array<any>): Promise<ComponentRef<any>>;
|
||||
|
||||
export declare function bootstrapWorkerUi(workerScriptUri: string, customProviders?: Array<any>): Promise<ApplicationRef>;
|
||||
|
||||
export declare const BROWSER_APP_COMPILER_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const CACHED_TEMPLATE_PROVIDER: Array<any>;
|
||||
@@ -0,0 +1,3 @@
|
||||
export declare const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any>;
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
export declare const BROWSER_APP_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const BROWSER_PLATFORM_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const BROWSER_PROVIDERS: any[];
|
||||
|
||||
export declare const BROWSER_SANITIZATION_PROVIDERS: Array<any>;
|
||||
|
||||
export declare function browserPlatform(): PlatformRef;
|
||||
|
||||
export declare class BrowserPlatformLocation extends PlatformLocation {
|
||||
constructor();
|
||||
getBaseHrefFromDOM(): string;
|
||||
onPopState(fn: UrlChangeListener): void;
|
||||
onHashChange(fn: UrlChangeListener): void;
|
||||
pathname: string;
|
||||
search: string;
|
||||
hash: string;
|
||||
pushState(state: any, title: string, url: string): void;
|
||||
replaceState(state: any, title: string, url: string): void;
|
||||
forward(): void;
|
||||
back(): void;
|
||||
}
|
||||
|
||||
export declare class By {
|
||||
static all(): Predicate<DebugElement>;
|
||||
static css(selector: string): Predicate<DebugElement>;
|
||||
static directive(type: Type): Predicate<DebugElement>;
|
||||
}
|
||||
|
||||
export declare abstract class ClientMessageBroker {
|
||||
abstract runOnService(args: UiArguments, returnType: Type): Promise<any>;
|
||||
}
|
||||
|
||||
export declare abstract class ClientMessageBrokerFactory {
|
||||
abstract createMessageBroker(channel: string, runInZone?: boolean): ClientMessageBroker;
|
||||
}
|
||||
|
||||
export declare function disableDebugTools(): void;
|
||||
|
||||
export declare const DOCUMENT: OpaqueToken;
|
||||
|
||||
export declare class DomEventsPlugin extends EventManagerPlugin {
|
||||
supports(eventName: string): boolean;
|
||||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
|
||||
addGlobalEventListener(target: string, eventName: string, handler: Function): Function;
|
||||
}
|
||||
|
||||
export declare abstract class DomSanitizationService implements SanitizationService {
|
||||
abstract sanitize(context: SecurityContext, value: any): string;
|
||||
abstract bypassSecurityTrustHtml(value: string): SafeHtml;
|
||||
abstract bypassSecurityTrustStyle(value: string): SafeStyle;
|
||||
abstract bypassSecurityTrustScript(value: string): SafeScript;
|
||||
abstract bypassSecurityTrustUrl(value: string): SafeUrl;
|
||||
abstract bypassSecurityTrustResourceUrl(value: string): SafeResourceUrl;
|
||||
}
|
||||
|
||||
export declare const ELEMENT_PROBE_PROVIDERS: any[];
|
||||
|
||||
export declare function enableDebugTools<T>(ref: ComponentRef<T>): ComponentRef<T>;
|
||||
|
||||
export declare const EVENT_MANAGER_PLUGINS: OpaqueToken;
|
||||
|
||||
export declare class EventManager {
|
||||
constructor(plugins: EventManagerPlugin[], _zone: NgZone);
|
||||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
|
||||
addGlobalEventListener(target: string, eventName: string, handler: Function): Function;
|
||||
getZone(): NgZone;
|
||||
}
|
||||
|
||||
export declare class FnArg {
|
||||
value: any;
|
||||
type: Type;
|
||||
constructor(value: any, type: Type);
|
||||
}
|
||||
|
||||
export declare const HAMMER_GESTURE_CONFIG: OpaqueToken;
|
||||
|
||||
export declare class HammerGestureConfig {
|
||||
events: string[];
|
||||
overrides: {
|
||||
[key: string]: Object;
|
||||
};
|
||||
buildHammer(element: HTMLElement): HammerInstance;
|
||||
}
|
||||
|
||||
export declare class KeyEventsPlugin extends EventManagerPlugin {
|
||||
constructor();
|
||||
supports(eventName: string): boolean;
|
||||
addEventListener(element: HTMLElement, eventName: string, handler: Function): Function;
|
||||
static parseEventName(eventName: string): {
|
||||
[key: string]: string;
|
||||
};
|
||||
static getEventFullKey(event: KeyboardEvent): string;
|
||||
static eventCallback(element: HTMLElement, fullKey: any, handler: Function, zone: NgZone): Function;
|
||||
}
|
||||
|
||||
export declare abstract class MessageBus implements MessageBusSource, MessageBusSink {
|
||||
abstract initChannel(channel: string, runInZone?: boolean): void;
|
||||
abstract attachToZone(zone: NgZone): void;
|
||||
abstract from(channel: string): EventEmitter<any>;
|
||||
abstract to(channel: string): EventEmitter<any>;
|
||||
}
|
||||
|
||||
export interface MessageBusSink {
|
||||
initChannel(channel: string, runInZone: boolean): void;
|
||||
attachToZone(zone: NgZone): void;
|
||||
to(channel: string): EventEmitter<any>;
|
||||
}
|
||||
|
||||
export interface MessageBusSource {
|
||||
initChannel(channel: string, runInZone: boolean): void;
|
||||
attachToZone(zone: NgZone): void;
|
||||
from(channel: string): EventEmitter<any>;
|
||||
}
|
||||
|
||||
export declare const PRIMITIVE: Type;
|
||||
|
||||
export declare class ReceivedMessage {
|
||||
method: string;
|
||||
args: any[];
|
||||
id: string;
|
||||
type: string;
|
||||
constructor(data: {
|
||||
[key: string]: any;
|
||||
});
|
||||
}
|
||||
|
||||
export interface SafeHtml extends SafeValue {
|
||||
}
|
||||
|
||||
export interface SafeResourceUrl extends SafeValue {
|
||||
}
|
||||
|
||||
export interface SafeScript extends SafeValue {
|
||||
}
|
||||
|
||||
export interface SafeStyle extends SafeValue {
|
||||
}
|
||||
|
||||
export interface SafeUrl extends SafeValue {
|
||||
}
|
||||
|
||||
export declare var SecurityContext: typeof t.SecurityContext;
|
||||
|
||||
export declare abstract class ServiceMessageBroker {
|
||||
abstract registerMethod(methodName: string, signature: Type[], method: Function, returnType?: Type): void;
|
||||
}
|
||||
|
||||
export declare abstract class ServiceMessageBrokerFactory {
|
||||
abstract createMessageBroker(channel: string, runInZone?: boolean): ServiceMessageBroker;
|
||||
}
|
||||
|
||||
export declare class Title {
|
||||
getTitle(): string;
|
||||
setTitle(newTitle: string): void;
|
||||
}
|
||||
|
||||
export declare class UiArguments {
|
||||
method: string;
|
||||
args: FnArg[];
|
||||
constructor(method: string, args?: FnArg[]);
|
||||
}
|
||||
|
||||
export declare class WebWorkerInstance {
|
||||
worker: Worker;
|
||||
bus: MessageBus;
|
||||
}
|
||||
|
||||
export declare const WORKER_APP_APPLICATION_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const WORKER_APP_LOCATION_PROVIDERS: ({
|
||||
provide: typeof PlatformLocation;
|
||||
useClass: typeof WebWorkerPlatformLocation;
|
||||
} | {
|
||||
provide: any;
|
||||
useFactory: (platformLocation: WebWorkerPlatformLocation, zone: NgZone) => () => Promise<boolean>;
|
||||
multi: boolean;
|
||||
deps: (typeof PlatformLocation | typeof NgZone)[];
|
||||
})[];
|
||||
|
||||
export declare const WORKER_APP_PLATFORM_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const WORKER_SCRIPT: OpaqueToken;
|
||||
|
||||
export declare const WORKER_UI_APPLICATION_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const WORKER_UI_LOCATION_PROVIDERS: (typeof MessageBasedPlatformLocation | typeof BrowserPlatformLocation | {
|
||||
provide: any;
|
||||
useFactory: (injector: Injector) => () => void;
|
||||
multi: boolean;
|
||||
deps: typeof Injector[];
|
||||
})[];
|
||||
|
||||
export declare const WORKER_UI_PLATFORM_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const WORKER_UI_STARTABLE_MESSAGING_SERVICE: OpaqueToken;
|
||||
|
||||
export declare function workerAppPlatform(): PlatformRef;
|
||||
|
||||
export declare function workerUiPlatform(): PlatformRef;
|
||||
@@ -0,0 +1,40 @@
|
||||
export declare var browserDetection: BrowserDetection;
|
||||
|
||||
export declare class BrowserDetection {
|
||||
static setup(): void;
|
||||
constructor(ua: string);
|
||||
isFirefox: boolean;
|
||||
isAndroid: boolean;
|
||||
isEdge: boolean;
|
||||
isIE: boolean;
|
||||
isWebkit: boolean;
|
||||
isIOS7: boolean;
|
||||
isSlow: boolean;
|
||||
supportsIntlApi: boolean;
|
||||
isChromeDesktop: boolean;
|
||||
}
|
||||
|
||||
export declare function dispatchEvent(element: any, eventType: any): void;
|
||||
|
||||
export declare function el(html: string): HTMLElement;
|
||||
|
||||
export declare var expect: (actual: any) => NgMatchers;
|
||||
|
||||
export interface NgMatchers extends jasmine.Matchers {
|
||||
toBePromise(): boolean;
|
||||
toBeAnInstanceOf(expected: any): boolean;
|
||||
toHaveText(expected: any): boolean;
|
||||
toHaveCssClass(expected: any): boolean;
|
||||
toHaveCssStyle(expected: any): boolean;
|
||||
toImplement(expected: any): boolean;
|
||||
toContainError(expected: any): boolean;
|
||||
not: NgMatchers;
|
||||
}
|
||||
|
||||
export declare function normalizeCSS(css: string): string;
|
||||
|
||||
export declare function stringifyElement(el: any): string;
|
||||
|
||||
export declare const TEST_BROWSER_APPLICATION_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const TEST_BROWSER_PLATFORM_PROVIDERS: Array<any>;
|
||||
@@ -0,0 +1,7 @@
|
||||
export declare var $: cssSelectorHelper;
|
||||
|
||||
export declare var browser: protractor.IBrowser;
|
||||
|
||||
export declare function clickAll(buttonSelectors: any): void;
|
||||
|
||||
export declare function verifyNoBrowserErrors(): void;
|
||||
@@ -0,0 +1,5 @@
|
||||
export declare const SERVER_PLATFORM_PROVIDERS: Array<any>;
|
||||
|
||||
export declare function serverBootstrap(appComponentType: Type, providers: Array<any>): Promise<ComponentRef<any>>;
|
||||
|
||||
export declare function serverPlatform(): PlatformRef;
|
||||
@@ -0,0 +1,3 @@
|
||||
export declare const TEST_SERVER_APPLICATION_PROVIDERS: Array<any>;
|
||||
|
||||
export declare const TEST_SERVER_PLATFORM_PROVIDERS: Array<any>;
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
export declare class ActivatedRoute {
|
||||
url: Observable<UrlPathWithParams[]>;
|
||||
params: Observable<Params>;
|
||||
outlet: string;
|
||||
component: Type | string;
|
||||
snapshot: ActivatedRouteSnapshot;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class ActivatedRouteSnapshot {
|
||||
url: UrlPathWithParams[];
|
||||
params: Params;
|
||||
outlet: string;
|
||||
component: Type | string;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export interface CanActivate {
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean;
|
||||
}
|
||||
|
||||
export interface CanDeactivate<T> {
|
||||
canDeactivate(component: T, route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> | boolean;
|
||||
}
|
||||
|
||||
export declare class DefaultUrlSerializer implements UrlSerializer {
|
||||
parse(url: string): UrlTree;
|
||||
serialize(tree: UrlTree): string;
|
||||
}
|
||||
|
||||
export declare type Event = NavigationStart | NavigationEnd | NavigationCancel | NavigationError;
|
||||
|
||||
export interface ExtraOptions {
|
||||
enableTracing?: boolean;
|
||||
}
|
||||
|
||||
export declare class NavigationCancel {
|
||||
id: number;
|
||||
url: string;
|
||||
constructor(id: number, url: string);
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class NavigationEnd {
|
||||
id: number;
|
||||
url: string;
|
||||
urlAfterRedirects: string;
|
||||
constructor(id: number, url: string, urlAfterRedirects: string);
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class NavigationError {
|
||||
id: number;
|
||||
url: string;
|
||||
error: any;
|
||||
constructor(id: number, url: string, error: any);
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class NavigationStart {
|
||||
id: number;
|
||||
url: string;
|
||||
constructor(id: number, url: string);
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare type Params = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
export declare const PRIMARY_OUTLET: string;
|
||||
|
||||
export declare function provideRouter(config: RouterConfig, opts?: ExtraOptions): any[];
|
||||
|
||||
export interface Route {
|
||||
path?: string;
|
||||
terminal?: boolean;
|
||||
component?: Type | string;
|
||||
outlet?: string;
|
||||
canActivate?: any[];
|
||||
canDeactivate?: any[];
|
||||
redirectTo?: string;
|
||||
children?: Route[];
|
||||
}
|
||||
|
||||
export declare class Router {
|
||||
routerState: RouterState;
|
||||
url: string;
|
||||
events: Observable<Event>;
|
||||
resetConfig(config: RouterConfig): void;
|
||||
createUrlTree(commands: any[], {relativeTo, queryParams, fragment}?: NavigationExtras): UrlTree;
|
||||
navigateByUrl(url: string | UrlTree): Promise<boolean>;
|
||||
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
|
||||
serializeUrl(url: UrlTree): string;
|
||||
parseUrl(url: string): UrlTree;
|
||||
}
|
||||
|
||||
export declare const ROUTER_DIRECTIVES: (typeof RouterOutlet | typeof RouterLink | typeof RouterLinkActive)[];
|
||||
|
||||
export declare type RouterConfig = Route[];
|
||||
|
||||
export declare class RouterOutletMap {
|
||||
registerOutlet(name: string, outlet: RouterOutlet): void;
|
||||
}
|
||||
|
||||
export declare class RouterState extends Tree<ActivatedRoute> {
|
||||
queryParams: Observable<Params>;
|
||||
fragment: Observable<string>;
|
||||
snapshot: RouterStateSnapshot;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
|
||||
url: string;
|
||||
queryParams: Params;
|
||||
fragment: string;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class RoutesRecognized {
|
||||
id: number;
|
||||
url: string;
|
||||
urlAfterRedirects: string;
|
||||
state: RouterStateSnapshot;
|
||||
constructor(id: number, url: string, urlAfterRedirects: string, state: RouterStateSnapshot);
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class UrlPathWithParams {
|
||||
path: string;
|
||||
parameters: {
|
||||
[key: string]: string;
|
||||
};
|
||||
constructor(path: string, parameters: {
|
||||
[key: string]: string;
|
||||
});
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare abstract class UrlSerializer {
|
||||
abstract parse(url: string): UrlTree;
|
||||
abstract serialize(tree: UrlTree): string;
|
||||
}
|
||||
|
||||
export declare class UrlTree {
|
||||
root: UrlSegment;
|
||||
queryParams: {
|
||||
[key: string]: string;
|
||||
};
|
||||
fragment: string;
|
||||
toString(): string;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
export declare class UpgradeAdapter {
|
||||
downgradeNg2Component(type: Type): Function;
|
||||
upgradeNg1Component(name: string): Type;
|
||||
bootstrap(element: Element, modules?: any[], config?: angular.IAngularBootstrapConfig): UpgradeAdapterRef;
|
||||
addProvider(provider: Type | Provider | any[] | any): void;
|
||||
upgradeNg1Provider(name: string, options?: {
|
||||
asToken: any;
|
||||
}): void;
|
||||
downgradeNg2Provider(token: any): Function;
|
||||
}
|
||||
|
||||
export declare class UpgradeAdapterRef {
|
||||
ng1RootScope: angular.IRootScopeService;
|
||||
ng1Injector: angular.IInjectorService;
|
||||
ng2ApplicationRef: ApplicationRef;
|
||||
ng2Injector: Injector;
|
||||
ready(fn: (upgradeAdapterRef?: UpgradeAdapterRef) => void): void;
|
||||
dispose(): void;
|
||||
}
|
||||
Reference in New Issue
Block a user