Revert "refactor(core): Change abstract get
to readonly
(#19226)"
This reverts commit 3aa3d5c5480cb8f0c1be61902aa15ce6a424c2eb.
This commit is contained in:
parent
6a9ce67714
commit
14e8e88022
@ -34,9 +34,9 @@ export abstract class PlatformLocation {
|
|||||||
abstract onPopState(fn: LocationChangeListener): void;
|
abstract onPopState(fn: LocationChangeListener): void;
|
||||||
abstract onHashChange(fn: LocationChangeListener): void;
|
abstract onHashChange(fn: LocationChangeListener): void;
|
||||||
|
|
||||||
readonly pathname: string;
|
abstract get pathname(): string;
|
||||||
readonly search: string;
|
abstract get search(): string;
|
||||||
readonly hash: string;
|
abstract get hash(): string;
|
||||||
|
|
||||||
abstract replaceState(state: any, title: string, url: string): void;
|
abstract replaceState(state: any, title: string, url: string): void;
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ export abstract class ReflectiveInjector implements Injector {
|
|||||||
* expect(child.parent).toBe(parent);
|
* expect(child.parent).toBe(parent);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
readonly parent: Injector|null;
|
abstract get parent(): Injector|null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves an array of providers and creates a child injector from those providers.
|
* Resolves an array of providers and creates a child injector from those providers.
|
||||||
|
@ -26,32 +26,32 @@ export abstract class ComponentRef<C> {
|
|||||||
/**
|
/**
|
||||||
* Location of the Host Element of this Component Instance.
|
* Location of the Host Element of this Component Instance.
|
||||||
*/
|
*/
|
||||||
readonly location: ElementRef;
|
abstract get location(): ElementRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The injector on which the component instance exists.
|
* The injector on which the component instance exists.
|
||||||
*/
|
*/
|
||||||
readonly injector: Injector;
|
abstract get injector(): Injector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The instance of the Component.
|
* The instance of the Component.
|
||||||
*/
|
*/
|
||||||
readonly instance: C;
|
abstract get instance(): C;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link ViewRef} of the Host View of this Component instance.
|
* The {@link ViewRef} of the Host View of this Component instance.
|
||||||
*/
|
*/
|
||||||
readonly hostView: ViewRef;
|
abstract get hostView(): ViewRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link ChangeDetectorRef} of the Component instance.
|
* The {@link ChangeDetectorRef} of the Component instance.
|
||||||
*/
|
*/
|
||||||
readonly changeDetectorRef: ChangeDetectorRef;
|
abstract get changeDetectorRef(): ChangeDetectorRef;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The component type.
|
* The component type.
|
||||||
*/
|
*/
|
||||||
readonly componentType: Type<any>;
|
abstract get componentType(): Type<any>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys the component instance and all of the data structures associated with it.
|
* Destroys the component instance and all of the data structures associated with it.
|
||||||
@ -68,20 +68,20 @@ export abstract class ComponentRef<C> {
|
|||||||
* @stable
|
* @stable
|
||||||
*/
|
*/
|
||||||
export abstract class ComponentFactory<C> {
|
export abstract class ComponentFactory<C> {
|
||||||
readonly selector: string;
|
abstract get selector(): string;
|
||||||
readonly componentType: Type<any>;
|
abstract get componentType(): Type<any>;
|
||||||
/**
|
/**
|
||||||
* selector for all <ng-content> elements in the component.
|
* selector for all <ng-content> elements in the component.
|
||||||
*/
|
*/
|
||||||
readonly ngContentSelectors: string[];
|
abstract get ngContentSelectors(): string[];
|
||||||
/**
|
/**
|
||||||
* the inputs of the component.
|
* the inputs of the component.
|
||||||
*/
|
*/
|
||||||
readonly inputs: {propName: string, templateName: string}[];
|
abstract get inputs(): {propName: string, templateName: string}[];
|
||||||
/**
|
/**
|
||||||
* the outputs of the component.
|
* the outputs of the component.
|
||||||
*/
|
*/
|
||||||
readonly outputs: {propName: string, templateName: string}[];
|
abstract get outputs(): {propName: string, templateName: string}[];
|
||||||
/**
|
/**
|
||||||
* Creates a new component.
|
* Creates a new component.
|
||||||
*/
|
*/
|
||||||
|
@ -24,18 +24,18 @@ export abstract class NgModuleRef<T> {
|
|||||||
/**
|
/**
|
||||||
* The injector that contains all of the providers of the NgModule.
|
* The injector that contains all of the providers of the NgModule.
|
||||||
*/
|
*/
|
||||||
readonly injector: Injector;
|
abstract get injector(): Injector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ComponentFactoryResolver to get hold of the ComponentFactories
|
* The ComponentFactoryResolver to get hold of the ComponentFactories
|
||||||
* declared in the `entryComponents` property of the module.
|
* declared in the `entryComponents` property of the module.
|
||||||
*/
|
*/
|
||||||
readonly componentFactoryResolver: ComponentFactoryResolver;
|
abstract get componentFactoryResolver(): ComponentFactoryResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The NgModule instance.
|
* The NgModule instance.
|
||||||
*/
|
*/
|
||||||
readonly instance: T;
|
abstract get instance(): T;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys the module instance and all of the data structures associated with it.
|
* Destroys the module instance and all of the data structures associated with it.
|
||||||
@ -58,6 +58,6 @@ export interface InternalNgModuleRef<T> extends NgModuleRef<T> {
|
|||||||
* @experimental
|
* @experimental
|
||||||
*/
|
*/
|
||||||
export abstract class NgModuleFactory<T> {
|
export abstract class NgModuleFactory<T> {
|
||||||
readonly moduleType: Type<T>;
|
abstract get moduleType(): Type<T>;
|
||||||
abstract create(parentInjector: Injector|null): NgModuleRef<T>;
|
abstract create(parentInjector: Injector|null): NgModuleRef<T>;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ export abstract class TemplateRef<C> {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
// TODO(i): rename to anchor or location
|
// TODO(i): rename to anchor or location
|
||||||
readonly elementRef: ElementRef;
|
abstract get elementRef(): ElementRef;
|
||||||
|
|
||||||
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
||||||
}
|
}
|
||||||
|
@ -37,11 +37,11 @@ export abstract class ViewContainerRef {
|
|||||||
* Anchor element that specifies the location of this container in the containing View.
|
* Anchor element that specifies the location of this container in the containing View.
|
||||||
* <!-- TODO: rename to anchorElement -->
|
* <!-- TODO: rename to anchorElement -->
|
||||||
*/
|
*/
|
||||||
readonly element: ElementRef;
|
abstract get element(): ElementRef;
|
||||||
|
|
||||||
readonly injector: Injector;
|
abstract get injector(): Injector;
|
||||||
|
|
||||||
readonly parentInjector: Injector;
|
abstract get parentInjector(): Injector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys all Views in this container.
|
* Destroys all Views in this container.
|
||||||
@ -56,7 +56,7 @@ export abstract class ViewContainerRef {
|
|||||||
/**
|
/**
|
||||||
* Returns the number of Views currently attached to this container.
|
* Returns the number of Views currently attached to this container.
|
||||||
*/
|
*/
|
||||||
readonly length: number;
|
abstract get length(): number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates an Embedded View based on the {@link TemplateRef `templateRef`} and inserts it
|
* Instantiates an Embedded View based on the {@link TemplateRef `templateRef`} and inserts it
|
||||||
|
@ -19,7 +19,7 @@ export abstract class ViewRef extends ChangeDetectorRef {
|
|||||||
*/
|
*/
|
||||||
abstract destroy(): void;
|
abstract destroy(): void;
|
||||||
|
|
||||||
readonly destroyed: boolean;
|
abstract get destroyed(): boolean;
|
||||||
|
|
||||||
abstract onDestroy(callback: Function): any /** TODO #9100 */;
|
abstract onDestroy(callback: Function): any /** TODO #9100 */;
|
||||||
}
|
}
|
||||||
@ -79,9 +79,9 @@ export abstract class ViewRef extends ChangeDetectorRef {
|
|||||||
* @experimental
|
* @experimental
|
||||||
*/
|
*/
|
||||||
export abstract class EmbeddedViewRef<C> extends ViewRef {
|
export abstract class EmbeddedViewRef<C> extends ViewRef {
|
||||||
readonly context: C;
|
abstract get context(): C;
|
||||||
|
|
||||||
readonly rootNodes: any[];
|
abstract get rootNodes(): any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InternalViewRef extends ViewRef {
|
export interface InternalViewRef extends ViewRef {
|
||||||
|
@ -23,12 +23,12 @@ export class RenderComponentType {
|
|||||||
* @deprecated Debug info is handeled internally in the view engine now.
|
* @deprecated Debug info is handeled internally in the view engine now.
|
||||||
*/
|
*/
|
||||||
export abstract class RenderDebugInfo {
|
export abstract class RenderDebugInfo {
|
||||||
readonly injector: Injector;
|
abstract get injector(): Injector;
|
||||||
readonly component: any;
|
abstract get component(): any;
|
||||||
readonly providerTokens: any[];
|
abstract get providerTokens(): any[];
|
||||||
readonly references: {[key: string]: any};
|
abstract get references(): {[key: string]: any};
|
||||||
readonly context: any;
|
abstract get context(): any;
|
||||||
readonly source: string;
|
abstract get source(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,7 +149,7 @@ export abstract class Renderer2 {
|
|||||||
* This field can be used to store arbitrary data on this renderer instance.
|
* This field can be used to store arbitrary data on this renderer instance.
|
||||||
* This is useful for renderers that delegate to other renderers.
|
* This is useful for renderers that delegate to other renderers.
|
||||||
*/
|
*/
|
||||||
readonly data: {[key: string]: any};
|
abstract get data(): {[key: string]: any};
|
||||||
|
|
||||||
abstract destroy(): void;
|
abstract destroy(): void;
|
||||||
abstract createElement(name: string, namespace?: string|null): any;
|
abstract createElement(name: string, namespace?: string|null): any;
|
||||||
|
@ -479,15 +479,15 @@ export interface RootData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export abstract class DebugContext {
|
export abstract class DebugContext {
|
||||||
readonly view: ViewData;
|
abstract get view(): ViewData;
|
||||||
readonly nodeIndex: number|null;
|
abstract get nodeIndex(): number|null;
|
||||||
readonly injector: Injector;
|
abstract get injector(): Injector;
|
||||||
readonly component: any;
|
abstract get component(): any;
|
||||||
readonly providerTokens: any[];
|
abstract get providerTokens(): any[];
|
||||||
readonly references: {[key: string]: any};
|
abstract get references(): {[key: string]: any};
|
||||||
readonly context: any;
|
abstract get context(): any;
|
||||||
readonly componentRenderElement: any;
|
abstract get componentRenderElement(): any;
|
||||||
readonly renderNode: any;
|
abstract get renderNode(): any;
|
||||||
abstract logError(console: Console, ...values: any[]): void;
|
abstract logError(console: Console, ...values: any[]): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export abstract class AbstractControlDirective {
|
|||||||
* that backs this directive. Most properties fall through to that
|
* that backs this directive. Most properties fall through to that
|
||||||
* instance.
|
* instance.
|
||||||
*/
|
*/
|
||||||
readonly control: AbstractControl|null;
|
abstract get control(): AbstractControl|null;
|
||||||
|
|
||||||
/** The value of the control. */
|
/** The value of the control. */
|
||||||
get value(): any { return this.control ? this.control.value : null; }
|
get value(): any { return this.control ? this.control.value : null; }
|
||||||
|
6
tools/public_api_guard/common/common.d.ts
vendored
6
tools/public_api_guard/common/common.d.ts
vendored
@ -392,9 +392,9 @@ export declare class PercentPipe implements PipeTransform {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class PlatformLocation {
|
export declare abstract class PlatformLocation {
|
||||||
readonly hash: string;
|
readonly abstract hash: string;
|
||||||
readonly pathname: string;
|
readonly abstract pathname: string;
|
||||||
readonly search: string;
|
readonly abstract search: string;
|
||||||
abstract back(): void;
|
abstract back(): void;
|
||||||
abstract forward(): void;
|
abstract forward(): void;
|
||||||
abstract getBaseHrefFromDOM(): string;
|
abstract getBaseHrefFromDOM(): string;
|
||||||
|
50
tools/public_api_guard/core/core.d.ts
vendored
50
tools/public_api_guard/core/core.d.ts
vendored
@ -213,17 +213,17 @@ export interface ComponentDecorator {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class ComponentFactory<C> {
|
export declare abstract class ComponentFactory<C> {
|
||||||
readonly componentType: Type<any>;
|
readonly abstract componentType: Type<any>;
|
||||||
readonly inputs: {
|
readonly abstract inputs: {
|
||||||
propName: string;
|
propName: string;
|
||||||
templateName: string;
|
templateName: string;
|
||||||
}[];
|
}[];
|
||||||
readonly ngContentSelectors: string[];
|
readonly abstract ngContentSelectors: string[];
|
||||||
readonly outputs: {
|
readonly abstract outputs: {
|
||||||
propName: string;
|
propName: string;
|
||||||
templateName: string;
|
templateName: string;
|
||||||
}[];
|
}[];
|
||||||
readonly selector: string;
|
readonly abstract selector: string;
|
||||||
abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,12 +235,12 @@ export declare abstract class ComponentFactoryResolver {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class ComponentRef<C> {
|
export declare abstract class ComponentRef<C> {
|
||||||
readonly changeDetectorRef: ChangeDetectorRef;
|
readonly abstract changeDetectorRef: ChangeDetectorRef;
|
||||||
readonly componentType: Type<any>;
|
readonly abstract componentType: Type<any>;
|
||||||
readonly hostView: ViewRef;
|
readonly abstract hostView: ViewRef;
|
||||||
readonly injector: Injector;
|
readonly abstract injector: Injector;
|
||||||
readonly instance: C;
|
readonly abstract instance: C;
|
||||||
readonly location: ElementRef;
|
readonly abstract location: ElementRef;
|
||||||
abstract destroy(): void;
|
abstract destroy(): void;
|
||||||
abstract onDestroy(callback: Function): void;
|
abstract onDestroy(callback: Function): void;
|
||||||
}
|
}
|
||||||
@ -369,8 +369,8 @@ export declare class ElementRef {
|
|||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
|
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
|
||||||
readonly context: C;
|
readonly abstract context: C;
|
||||||
readonly rootNodes: any[];
|
readonly abstract rootNodes: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
@ -597,7 +597,7 @@ export declare const NgModule: NgModuleDecorator;
|
|||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare abstract class NgModuleFactory<T> {
|
export declare abstract class NgModuleFactory<T> {
|
||||||
readonly moduleType: Type<T>;
|
readonly abstract moduleType: Type<T>;
|
||||||
abstract create(parentInjector: Injector | null): NgModuleRef<T>;
|
abstract create(parentInjector: Injector | null): NgModuleRef<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -608,9 +608,9 @@ export declare abstract class NgModuleFactoryLoader {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class NgModuleRef<T> {
|
export declare abstract class NgModuleRef<T> {
|
||||||
readonly componentFactoryResolver: ComponentFactoryResolver;
|
readonly abstract componentFactoryResolver: ComponentFactoryResolver;
|
||||||
readonly injector: Injector;
|
readonly abstract injector: Injector;
|
||||||
readonly instance: T;
|
readonly abstract instance: T;
|
||||||
abstract destroy(): void;
|
abstract destroy(): void;
|
||||||
abstract onDestroy(callback: () => void): void;
|
abstract onDestroy(callback: () => void): void;
|
||||||
}
|
}
|
||||||
@ -738,7 +738,7 @@ export declare class QueryList<T> {
|
|||||||
|
|
||||||
/** @deprecated */
|
/** @deprecated */
|
||||||
export declare abstract class ReflectiveInjector implements Injector {
|
export declare abstract class ReflectiveInjector implements Injector {
|
||||||
readonly parent: Injector | null;
|
readonly abstract parent: Injector | null;
|
||||||
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
|
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
|
||||||
abstract get(token: any, notFoundValue?: any): any;
|
abstract get(token: any, notFoundValue?: any): any;
|
||||||
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
|
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
|
||||||
@ -795,7 +795,7 @@ export declare abstract class Renderer {
|
|||||||
|
|
||||||
/** @experimental */
|
/** @experimental */
|
||||||
export declare abstract class Renderer2 {
|
export declare abstract class Renderer2 {
|
||||||
readonly data: {
|
readonly abstract data: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
destroyNode: ((node: any) => void) | null;
|
destroyNode: ((node: any) => void) | null;
|
||||||
@ -953,7 +953,7 @@ export declare abstract class SystemJsNgModuleLoaderConfig {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class TemplateRef<C> {
|
export declare abstract class TemplateRef<C> {
|
||||||
readonly elementRef: ElementRef;
|
readonly abstract elementRef: ElementRef;
|
||||||
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1057,10 +1057,10 @@ export interface ViewChildrenDecorator {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class ViewContainerRef {
|
export declare abstract class ViewContainerRef {
|
||||||
readonly element: ElementRef;
|
readonly abstract element: ElementRef;
|
||||||
readonly injector: Injector;
|
readonly abstract injector: Injector;
|
||||||
readonly length: number;
|
readonly abstract length: number;
|
||||||
readonly parentInjector: Injector;
|
readonly abstract parentInjector: Injector;
|
||||||
abstract clear(): void;
|
abstract clear(): void;
|
||||||
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
||||||
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
|
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
|
||||||
@ -1081,7 +1081,7 @@ export declare enum ViewEncapsulation {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class ViewRef extends ChangeDetectorRef {
|
export declare abstract class ViewRef extends ChangeDetectorRef {
|
||||||
readonly destroyed: boolean;
|
readonly abstract destroyed: boolean;
|
||||||
abstract destroy(): void;
|
abstract destroy(): void;
|
||||||
abstract onDestroy(callback: Function): any;
|
abstract onDestroy(callback: Function): any;
|
||||||
}
|
}
|
||||||
|
2
tools/public_api_guard/forms/forms.d.ts
vendored
2
tools/public_api_guard/forms/forms.d.ts
vendored
@ -65,7 +65,7 @@ export declare abstract class AbstractControl {
|
|||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare abstract class AbstractControlDirective {
|
export declare abstract class AbstractControlDirective {
|
||||||
readonly control: AbstractControl | null;
|
readonly abstract control: AbstractControl | null;
|
||||||
readonly dirty: boolean | null;
|
readonly dirty: boolean | null;
|
||||||
readonly disabled: boolean | null;
|
readonly disabled: boolean | null;
|
||||||
readonly enabled: boolean | null;
|
readonly enabled: boolean | null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user