build: update public API with readonly (#13294)

PR Close #13294
This commit is contained in:
Alex Eagle 2017-02-07 19:27:01 -08:00 committed by Miško Hevery
parent ef32e6b0d0
commit 7a4c25535d
4 changed files with 155 additions and 161 deletions

View File

@ -231,9 +231,9 @@ export declare class PercentPipe implements PipeTransform {
/** @stable */
export declare abstract class PlatformLocation {
hash: string;
pathname: string;
search: string;
readonly hash: string;
readonly pathname: string;
readonly search: string;
abstract back(): void;
abstract forward(): void;
abstract getBaseHrefFromDOM(): string;

View File

@ -40,7 +40,7 @@ export declare class AnimationEntryMetadata {
/** @experimental */
export declare class AnimationGroupMetadata extends AnimationWithStepsMetadata {
steps: AnimationMetadata[];
readonly steps: AnimationMetadata[];
constructor(_steps: AnimationMetadata[]);
}
@ -80,7 +80,7 @@ export declare abstract class AnimationPlayer {
/** @experimental */
export declare class AnimationSequenceMetadata extends AnimationWithStepsMetadata {
steps: AnimationMetadata[];
readonly steps: AnimationMetadata[];
constructor(_steps: AnimationMetadata[]);
}
@ -143,7 +143,7 @@ export declare class AnimationTransitionEvent {
/** @experimental */
export declare abstract class AnimationWithStepsMetadata extends AnimationMetadata {
steps: AnimationMetadata[];
readonly steps: AnimationMetadata[];
constructor();
}
@ -158,8 +158,8 @@ export declare const APP_INITIALIZER: InjectionToken<(() => void)[]>;
/** @experimental */
export declare class ApplicationInitStatus {
done: boolean;
donePromise: Promise<any>;
readonly done: boolean;
readonly donePromise: Promise<any>;
constructor(appInits: (() => any)[]);
}
@ -169,9 +169,9 @@ export declare class ApplicationModule {
/** @stable */
export declare abstract class ApplicationRef {
componentTypes: Type<any>[];
components: ComponentRef<any>[];
viewCount: number;
readonly abstract componentTypes: Type<any>[];
readonly abstract components: ComponentRef<any>[];
readonly abstract viewCount: number;
abstract attachView(view: ViewRef): void;
abstract bootstrap<C>(componentFactory: ComponentFactory<C> | Type<C>): ComponentRef<C>;
abstract detachView(view: ViewRef): void;
@ -188,7 +188,7 @@ export declare function assertPlatform(requiredToken: any): PlatformRef;
export declare const Attribute: AttributeDecorator;
/** @experimental */
export declare const AUTO_STYLE: string;
export declare const AUTO_STYLE = "*";
/** @stable */
export declare enum ChangeDetectionStrategy {
@ -238,13 +238,7 @@ export declare class Compiler {
}
/** @experimental */
export declare const COMPILER_OPTIONS: InjectionToken<{
useDebug?: boolean;
useJit?: boolean;
defaultEncapsulation?: ViewEncapsulation;
providers?: any[];
missingTranslation?: MissingTranslationStrategy;
}[]>;
export declare const COMPILER_OPTIONS: InjectionToken<CompilerOptions[]>;
/** @experimental */
export declare abstract class CompilerFactory {
@ -285,12 +279,12 @@ export declare abstract class ComponentFactoryResolver {
/** @stable */
export declare abstract class ComponentRef<C> {
changeDetectorRef: ChangeDetectorRef;
componentType: Type<any>;
hostView: ViewRef;
injector: Injector;
instance: C;
location: ElementRef;
readonly abstract changeDetectorRef: ChangeDetectorRef;
readonly abstract componentType: Type<any>;
readonly abstract hostView: ViewRef;
readonly abstract injector: Injector;
readonly abstract instance: C;
readonly abstract location: ElementRef;
abstract destroy(): void;
abstract onDestroy(callback: Function): void;
}
@ -338,7 +332,7 @@ export declare class DebugElement extends DebugNode {
[key: string]: string;
};
childNodes: DebugNode[];
children: DebugElement[];
readonly children: DebugElement[];
classes: {
[key: string]: boolean;
};
@ -362,25 +356,25 @@ export declare class DebugElement extends DebugNode {
/** @experimental */
export declare class DebugNode {
componentInstance: any;
context: any;
injector: Injector;
readonly componentInstance: any;
readonly context: any;
readonly injector: Injector;
listeners: EventListener[];
nativeNode: any;
parent: DebugElement;
providerTokens: any[];
references: {
readonly providerTokens: any[];
readonly references: {
[key: string]: any;
};
source: string;
readonly source: string;
constructor(nativeNode: any, parent: DebugNode, _debugInfo: RenderDebugInfo);
}
/** @deprecated */
export declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
collection: NgIterable<V>;
isDirty: boolean;
length: number;
readonly collection: NgIterable<V>;
readonly isDirty: boolean;
readonly length: number;
constructor(_trackByFn?: TrackByFunction<V>);
check(collection: NgIterable<V>): boolean;
diff(collection: NgIterable<V>): DefaultIterableDiffer<V>;
@ -420,8 +414,8 @@ export declare class ElementRef {
/** @experimental */
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
context: C;
rootNodes: any[];
readonly abstract context: C;
readonly abstract rootNodes: any[];
}
/** @stable */
@ -647,7 +641,7 @@ export declare const NgModule: NgModuleDecorator;
/** @experimental */
export declare class NgModuleFactory<T> {
moduleType: Type<T>;
readonly moduleType: Type<T>;
constructor(_injectorClass: {
new (parentInjector: Injector): NgModuleInjector<T>;
}, _moduleType: Type<T>);
@ -661,9 +655,9 @@ export declare abstract class NgModuleFactoryLoader {
/** @stable */
export declare abstract class NgModuleRef<T> {
componentFactoryResolver: ComponentFactoryResolver;
injector: Injector;
instance: T;
readonly abstract componentFactoryResolver: ComponentFactoryResolver;
readonly abstract injector: Injector;
readonly abstract instance: T;
abstract destroy(): void;
abstract onDestroy(callback: () => void): void;
}
@ -677,13 +671,13 @@ export declare class NgProbeToken {
/** @experimental */
export declare class NgZone {
hasPendingMacrotasks: boolean;
hasPendingMicrotasks: boolean;
isStable: boolean;
onError: EventEmitter<any>;
onMicrotaskEmpty: EventEmitter<any>;
onStable: EventEmitter<any>;
onUnstable: EventEmitter<any>;
readonly hasPendingMacrotasks: boolean;
readonly hasPendingMicrotasks: boolean;
readonly isStable: boolean;
readonly onError: EventEmitter<any>;
readonly onMicrotaskEmpty: EventEmitter<any>;
readonly onStable: EventEmitter<any>;
readonly onUnstable: EventEmitter<any>;
constructor({enableLongStackTrace}: {
enableLongStackTrace?: boolean;
});
@ -751,8 +745,8 @@ export declare const platformCore: (extraProviders?: Provider[]) => PlatformRef;
/** @stable */
export declare abstract class PlatformRef {
destroyed: boolean;
injector: Injector;
readonly abstract destroyed: boolean;
readonly abstract injector: Injector;
/** @stable */ abstract bootstrapModule<M>(moduleType: Type<M>, compilerOptions?: CompilerOptions | CompilerOptions[]): Promise<NgModuleRef<M>>;
/** @experimental */ abstract bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>): Promise<NgModuleRef<M>>;
abstract destroy(): void;
@ -768,11 +762,11 @@ export declare abstract class Query {
/** @stable */
export declare class QueryList<T> {
changes: Observable<any>;
dirty: boolean;
first: T;
last: T;
length: number;
readonly changes: Observable<any>;
readonly dirty: boolean;
readonly first: T;
readonly last: T;
readonly length: number;
filter(fn: (item: T, index: number, array: T[]) => boolean): T[];
find(fn: (item: T, index: number, array: T[]) => boolean): T;
forEach(fn: (item: T, index: number, array: T[]) => void): void;
@ -788,7 +782,7 @@ export declare class QueryList<T> {
/** @stable */
export declare abstract class ReflectiveInjector implements Injector {
parent: Injector;
readonly abstract parent: Injector;
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
abstract get(token: any, notFoundValue?: any): any;
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
@ -801,11 +795,11 @@ export declare abstract class ReflectiveInjector implements Injector {
/** @experimental */
export declare class ReflectiveKey {
displayName: string;
readonly displayName: string;
id: number;
token: Object;
constructor(token: Object, id: number);
static numberOfKeys: number;
static readonly numberOfKeys: number;
static get(token: Object): ReflectiveKey;
}
@ -953,7 +947,7 @@ export declare abstract class SystemJsNgModuleLoaderConfig {
/** @stable */
export declare abstract class TemplateRef<C> {
elementRef: ElementRef;
readonly abstract elementRef: ElementRef;
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
}
@ -1026,9 +1020,9 @@ export interface ValueProvider {
/** @stable */
export declare class Version {
full: string;
major: string;
minor: string;
patch: string;
readonly major: string;
readonly minor: string;
readonly patch: string;
constructor(full: string);
}
@ -1063,10 +1057,10 @@ export interface ViewChildrenDecorator {
/** @stable */
export declare abstract class ViewContainerRef {
element: ElementRef;
injector: Injector;
length: number;
parentInjector: Injector;
readonly abstract element: ElementRef;
readonly abstract injector: Injector;
readonly abstract length: number;
readonly abstract parentInjector: Injector;
abstract clear(): void;
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][]): ComponentRef<C>;
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
@ -1087,7 +1081,7 @@ export declare enum ViewEncapsulation {
/** @stable */
export declare abstract class ViewRef extends ChangeDetectorRef {
destroyed: boolean;
readonly abstract destroyed: boolean;
abstract destroy(): void;
abstract onDestroy(callback: Function): any;
}

View File

@ -1,25 +1,25 @@
/** @stable */
export declare abstract class AbstractControl {
asyncValidator: AsyncValidatorFn;
dirty: boolean;
disabled: boolean;
enabled: boolean;
errors: {
readonly dirty: boolean;
readonly disabled: boolean;
readonly enabled: boolean;
readonly errors: {
[key: string]: any;
};
invalid: boolean;
parent: FormGroup | FormArray;
pending: boolean;
pristine: boolean;
root: AbstractControl;
status: string;
statusChanges: Observable<any>;
touched: boolean;
untouched: boolean;
valid: boolean;
readonly invalid: boolean;
readonly parent: FormGroup | FormArray;
readonly pending: boolean;
readonly pristine: boolean;
readonly root: AbstractControl;
readonly status: string;
readonly statusChanges: Observable<any>;
readonly touched: boolean;
readonly untouched: boolean;
readonly valid: boolean;
validator: ValidatorFn;
value: any;
valueChanges: Observable<any>;
readonly value: any;
readonly valueChanges: Observable<any>;
constructor(validator: ValidatorFn, asyncValidator: AsyncValidatorFn);
clearAsyncValidators(): void;
clearValidators(): void;
@ -68,23 +68,23 @@ export declare abstract class AbstractControl {
/** @stable */
export declare abstract class AbstractControlDirective {
control: AbstractControl;
dirty: boolean;
disabled: boolean;
enabled: boolean;
errors: {
readonly control: AbstractControl;
readonly dirty: boolean;
readonly disabled: boolean;
readonly enabled: boolean;
readonly errors: {
[key: string]: any;
};
invalid: boolean;
path: string[];
pending: boolean;
pristine: boolean;
statusChanges: Observable<any>;
touched: boolean;
untouched: boolean;
valid: boolean;
value: any;
valueChanges: Observable<any>;
readonly invalid: boolean;
readonly path: string[];
readonly pending: boolean;
readonly pristine: boolean;
readonly statusChanges: Observable<any>;
readonly touched: boolean;
readonly untouched: boolean;
readonly valid: boolean;
readonly value: any;
readonly valueChanges: Observable<any>;
getError(errorCode: string, path?: string[]): any;
hasError(errorCode: string, path?: string[]): boolean;
reset(value?: any): void;
@ -92,11 +92,11 @@ export declare abstract class AbstractControlDirective {
/** @stable */
export declare class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy {
asyncValidator: AsyncValidatorFn;
control: FormGroup;
formDirective: Form;
path: string[];
validator: ValidatorFn;
readonly asyncValidator: AsyncValidatorFn;
readonly control: FormGroup;
readonly formDirective: Form;
readonly path: string[];
readonly validator: ValidatorFn;
ngOnDestroy(): void;
ngOnInit(): void;
}
@ -126,9 +126,9 @@ export declare class CheckboxRequiredValidator extends RequiredValidator {
/** @stable */
export declare class ControlContainer extends AbstractControlDirective {
formDirective: Form;
readonly formDirective: Form;
name: string;
path: string[];
readonly path: string[];
}
/** @stable */
@ -173,7 +173,7 @@ export interface Form {
/** @stable */
export declare class FormArray extends AbstractControl {
controls: AbstractControl[];
length: number;
readonly length: number;
constructor(controls: AbstractControl[], validator?: ValidatorFn, asyncValidator?: AsyncValidatorFn);
at(index: number): AbstractControl;
getRawValue(): any[];
@ -197,12 +197,12 @@ export declare class FormArray extends AbstractControl {
/** @stable */
export declare class FormArrayName extends ControlContainer implements OnInit, OnDestroy {
asyncValidator: AsyncValidatorFn;
control: FormArray;
formDirective: FormGroupDirective;
readonly asyncValidator: AsyncValidatorFn;
readonly control: FormArray;
readonly formDirective: FormGroupDirective;
name: string;
path: string[];
validator: ValidatorFn;
readonly path: string[];
readonly validator: ValidatorFn;
constructor(parent: ControlContainer, validators: any[], asyncValidators: any[]);
ngOnDestroy(): void;
ngOnInit(): void;
@ -244,14 +244,14 @@ export declare class FormControl extends AbstractControl {
/** @stable */
export declare class FormControlDirective extends NgControl implements OnChanges {
asyncValidator: AsyncValidatorFn;
control: FormControl;
readonly asyncValidator: AsyncValidatorFn;
readonly control: FormControl;
form: FormControl;
isDisabled: boolean;
model: any;
path: string[];
readonly path: string[];
update: EventEmitter<{}>;
validator: ValidatorFn;
readonly validator: ValidatorFn;
viewModel: any;
constructor(validators: Array<Validator | ValidatorFn>, asyncValidators: Array<Validator | AsyncValidatorFn>, valueAccessors: ControlValueAccessor[]);
ngOnChanges(changes: SimpleChanges): void;
@ -260,15 +260,15 @@ export declare class FormControlDirective extends NgControl implements OnChanges
/** @stable */
export declare class FormControlName extends NgControl implements OnChanges, OnDestroy {
asyncValidator: AsyncValidatorFn;
control: FormControl;
formDirective: any;
readonly asyncValidator: AsyncValidatorFn;
readonly control: FormControl;
readonly formDirective: any;
isDisabled: boolean;
model: any;
name: string;
path: string[];
readonly path: string[];
update: EventEmitter<{}>;
validator: ValidatorFn;
readonly validator: ValidatorFn;
constructor(parent: ControlContainer, validators: Array<Validator | ValidatorFn>, asyncValidators: Array<Validator | AsyncValidatorFn>, valueAccessors: ControlValueAccessor[]);
ngOnChanges(changes: SimpleChanges): void;
ngOnDestroy(): void;
@ -309,13 +309,13 @@ export declare class FormGroup extends AbstractControl {
/** @stable */
export declare class FormGroupDirective extends ControlContainer implements Form, OnChanges {
control: FormGroup;
readonly control: FormGroup;
directives: FormControlName[];
form: FormGroup;
formDirective: Form;
readonly formDirective: Form;
ngSubmit: EventEmitter<{}>;
path: string[];
submitted: boolean;
readonly path: string[];
readonly submitted: boolean;
constructor(_validators: any[], _asyncValidators: any[]);
addControl(dir: FormControlName): FormControl;
addFormArray(dir: FormArrayName): void;
@ -374,9 +374,9 @@ export declare const NG_VALUE_ACCESSOR: InjectionToken<ControlValueAccessor>;
/** @stable */
export declare abstract class NgControl extends AbstractControlDirective {
asyncValidator: AsyncValidatorFn;
readonly asyncValidator: AsyncValidatorFn;
name: string;
validator: ValidatorFn;
readonly validator: ValidatorFn;
valueAccessor: ControlValueAccessor;
abstract viewToModelUpdate(newValue: any): void;
}
@ -393,15 +393,15 @@ export declare class NgControlStatusGroup extends AbstractControlStatus {
/** @stable */
export declare class NgForm extends ControlContainer implements Form {
control: FormGroup;
controls: {
readonly control: FormGroup;
readonly controls: {
[key: string]: AbstractControl;
};
form: FormGroup;
formDirective: Form;
readonly formDirective: Form;
ngSubmit: EventEmitter<{}>;
path: string[];
submitted: boolean;
readonly path: string[];
readonly submitted: boolean;
constructor(validators: any[], asyncValidators: any[]);
addControl(dir: NgModel): void;
addFormGroup(dir: NgModelGroup): void;
@ -420,9 +420,9 @@ export declare class NgForm extends ControlContainer implements Form {
/** @stable */
export declare class NgModel extends NgControl implements OnChanges, OnDestroy {
asyncValidator: AsyncValidatorFn;
control: FormControl;
formDirective: any;
readonly asyncValidator: AsyncValidatorFn;
readonly control: FormControl;
readonly formDirective: any;
isDisabled: boolean;
model: any;
name: string;
@ -430,9 +430,9 @@ export declare class NgModel extends NgControl implements OnChanges, OnDestroy {
name?: string;
standalone?: boolean;
};
path: string[];
readonly path: string[];
update: EventEmitter<{}>;
validator: ValidatorFn;
readonly validator: ValidatorFn;
viewModel: any;
constructor(parent: ControlContainer, validators: Array<Validator | ValidatorFn>, asyncValidators: Array<Validator | AsyncValidatorFn>, valueAccessors: ControlValueAccessor[]);
compositionEnd(): void;

View File

@ -1,17 +1,17 @@
/** @stable */
export declare class ActivatedRoute {
children: ActivatedRoute[];
readonly children: ActivatedRoute[];
component: Type<any> | string;
data: Observable<Data>;
firstChild: ActivatedRoute;
readonly firstChild: ActivatedRoute;
fragment: Observable<string>;
outlet: string;
params: Observable<Params>;
parent: ActivatedRoute;
pathFromRoot: ActivatedRoute[];
readonly parent: ActivatedRoute;
readonly pathFromRoot: ActivatedRoute[];
queryParams: Observable<Params>;
root: ActivatedRoute;
routeConfig: Route;
readonly root: ActivatedRoute;
readonly routeConfig: Route;
snapshot: ActivatedRouteSnapshot;
url: Observable<UrlSegment[]>;
toString(): string;
@ -19,18 +19,18 @@ export declare class ActivatedRoute {
/** @stable */
export declare class ActivatedRouteSnapshot {
children: ActivatedRouteSnapshot[];
readonly children: ActivatedRouteSnapshot[];
component: Type<any> | string;
data: Data;
firstChild: ActivatedRouteSnapshot;
readonly firstChild: ActivatedRouteSnapshot;
fragment: string;
outlet: string;
params: Params;
parent: ActivatedRouteSnapshot;
pathFromRoot: ActivatedRouteSnapshot[];
readonly parent: ActivatedRouteSnapshot;
readonly pathFromRoot: ActivatedRouteSnapshot[];
queryParams: Params;
root: ActivatedRouteSnapshot;
routeConfig: Route;
readonly root: ActivatedRouteSnapshot;
readonly routeConfig: Route;
url: UrlSegment[];
toString(): string;
}
@ -166,7 +166,7 @@ export declare abstract class PreloadingStrategy {
}
/** @stable */
export declare const PRIMARY_OUTLET: string;
export declare const PRIMARY_OUTLET = "primary";
/** @stable */
export declare function provideRoutes(routes: Routes): any;
@ -203,11 +203,11 @@ export interface Route {
export declare class Router {
config: Routes;
errorHandler: ErrorHandler;
events: Observable<Event>;
readonly events: Observable<Event>;
navigated: boolean;
routeReuseStrategy: RouteReuseStrategy;
routerState: RouterState;
url: string;
readonly routerState: RouterState;
readonly url: string;
urlHandlingStrategy: UrlHandlingStrategy;
constructor(rootComponentType: Type<any>, urlSerializer: UrlSerializer, outletMap: RouterOutletMap, location: Location, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Routes);
createUrlTree(commands: any[], {relativeTo, queryParams, fragment, preserveQueryParams, queryParamsHandling, preserveFragment}?: NavigationExtras): UrlTree;
@ -250,14 +250,14 @@ export declare class RouterLink {
replaceUrl: boolean;
routerLink: any[] | string;
skipLocationChange: boolean;
urlTree: UrlTree;
readonly urlTree: UrlTree;
constructor(router: Router, route: ActivatedRoute, tabIndex: string, renderer: Renderer, el: ElementRef);
onClick(): boolean;
}
/** @stable */
export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit {
isActive: boolean;
readonly isActive: boolean;
links: QueryList<RouterLink>;
linksWithHrefs: QueryList<RouterLinkWithHref>;
routerLinkActive: string[] | string;
@ -284,7 +284,7 @@ export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
routerLink: any[] | string;
skipLocationChange: boolean;
target: string;
urlTree: UrlTree;
readonly urlTree: UrlTree;
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
ngOnChanges(changes: {}): any;
ngOnDestroy(): any;
@ -301,12 +301,12 @@ export declare class RouterModule {
/** @stable */
export declare class RouterOutlet implements OnDestroy {
activateEvents: EventEmitter<any>;
activatedRoute: ActivatedRoute;
component: Object;
readonly activatedRoute: ActivatedRoute;
readonly component: Object;
deactivateEvents: EventEmitter<any>;
isActivated: boolean;
locationFactoryResolver: ComponentFactoryResolver;
locationInjector: Injector;
readonly isActivated: boolean;
readonly locationFactoryResolver: ComponentFactoryResolver;
readonly locationInjector: Injector;
outletMap: RouterOutletMap;
constructor(parentOutletMap: RouterOutletMap, location: ViewContainerRef, resolver: ComponentFactoryResolver, name: string);
activate(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver, injector: Injector, providers: ResolvedReflectiveProvider[], outletMap: RouterOutletMap): void;
@ -385,7 +385,7 @@ export declare class UrlSegmentGroup {
children: {
[key: string]: UrlSegmentGroup;
};
numberOfChildren: number;
readonly numberOfChildren: number;
parent: UrlSegmentGroup;
segments: UrlSegment[];
constructor(