Revert "refactor(core): Change `abstract get` to `readonly` (#19226)"
This reverts commit 3aa3d5c548
.
This commit is contained in:
parent
6a9ce67714
commit
14e8e88022
|
@ -34,9 +34,9 @@ export abstract class PlatformLocation {
|
|||
abstract onPopState(fn: LocationChangeListener): void;
|
||||
abstract onHashChange(fn: LocationChangeListener): void;
|
||||
|
||||
readonly pathname: string;
|
||||
readonly search: string;
|
||||
readonly hash: string;
|
||||
abstract get pathname(): string;
|
||||
abstract get search(): string;
|
||||
abstract get hash(): string;
|
||||
|
||||
abstract replaceState(state: any, title: string, url: string): void;
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ export abstract class ReflectiveInjector implements Injector {
|
|||
* 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.
|
||||
|
|
|
@ -26,32 +26,32 @@ export abstract class ComponentRef<C> {
|
|||
/**
|
||||
* Location of the Host Element of this Component Instance.
|
||||
*/
|
||||
readonly location: ElementRef;
|
||||
abstract get location(): ElementRef;
|
||||
|
||||
/**
|
||||
* The injector on which the component instance exists.
|
||||
*/
|
||||
readonly injector: Injector;
|
||||
abstract get injector(): Injector;
|
||||
|
||||
/**
|
||||
* The instance of the Component.
|
||||
*/
|
||||
readonly instance: C;
|
||||
abstract get instance(): C;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
readonly changeDetectorRef: ChangeDetectorRef;
|
||||
abstract get changeDetectorRef(): ChangeDetectorRef;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
@ -68,20 +68,20 @@ export abstract class ComponentRef<C> {
|
|||
* @stable
|
||||
*/
|
||||
export abstract class ComponentFactory<C> {
|
||||
readonly selector: string;
|
||||
readonly componentType: Type<any>;
|
||||
abstract get selector(): string;
|
||||
abstract get componentType(): Type<any>;
|
||||
/**
|
||||
* selector for all <ng-content> elements in the component.
|
||||
*/
|
||||
readonly ngContentSelectors: string[];
|
||||
abstract get ngContentSelectors(): string[];
|
||||
/**
|
||||
* the inputs of the component.
|
||||
*/
|
||||
readonly inputs: {propName: string, templateName: string}[];
|
||||
abstract get inputs(): {propName: string, templateName: string}[];
|
||||
/**
|
||||
* the outputs of the component.
|
||||
*/
|
||||
readonly outputs: {propName: string, templateName: string}[];
|
||||
abstract get outputs(): {propName: string, templateName: string}[];
|
||||
/**
|
||||
* Creates a new component.
|
||||
*/
|
||||
|
|
|
@ -24,18 +24,18 @@ export abstract class NgModuleRef<T> {
|
|||
/**
|
||||
* 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
|
||||
* declared in the `entryComponents` property of the module.
|
||||
*/
|
||||
readonly componentFactoryResolver: ComponentFactoryResolver;
|
||||
abstract get componentFactoryResolver(): ComponentFactoryResolver;
|
||||
|
||||
/**
|
||||
* The NgModule instance.
|
||||
*/
|
||||
readonly instance: T;
|
||||
abstract get instance(): T;
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
export abstract class NgModuleFactory<T> {
|
||||
readonly moduleType: Type<T>;
|
||||
abstract get moduleType(): Type<T>;
|
||||
abstract create(parentInjector: Injector|null): NgModuleRef<T>;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ export abstract class TemplateRef<C> {
|
|||
*
|
||||
*/
|
||||
// TODO(i): rename to anchor or location
|
||||
readonly elementRef: ElementRef;
|
||||
abstract get elementRef(): ElementRef;
|
||||
|
||||
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.
|
||||
* <!-- 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.
|
||||
|
@ -56,7 +56,7 @@ export abstract class ViewContainerRef {
|
|||
/**
|
||||
* 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
|
||||
|
|
|
@ -19,7 +19,7 @@ export abstract class ViewRef extends ChangeDetectorRef {
|
|||
*/
|
||||
abstract destroy(): void;
|
||||
|
||||
readonly destroyed: boolean;
|
||||
abstract get destroyed(): boolean;
|
||||
|
||||
abstract onDestroy(callback: Function): any /** TODO #9100 */;
|
||||
}
|
||||
|
@ -79,9 +79,9 @@ export abstract class ViewRef extends ChangeDetectorRef {
|
|||
* @experimental
|
||||
*/
|
||||
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 {
|
||||
|
|
|
@ -23,12 +23,12 @@ export class RenderComponentType {
|
|||
* @deprecated Debug info is handeled internally in the view engine now.
|
||||
*/
|
||||
export abstract class RenderDebugInfo {
|
||||
readonly injector: Injector;
|
||||
readonly component: any;
|
||||
readonly providerTokens: any[];
|
||||
readonly references: {[key: string]: any};
|
||||
readonly context: any;
|
||||
readonly source: string;
|
||||
abstract get injector(): Injector;
|
||||
abstract get component(): any;
|
||||
abstract get providerTokens(): any[];
|
||||
abstract get references(): {[key: string]: any};
|
||||
abstract get context(): any;
|
||||
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 is useful for renderers that delegate to other renderers.
|
||||
*/
|
||||
readonly data: {[key: string]: any};
|
||||
abstract get data(): {[key: string]: any};
|
||||
|
||||
abstract destroy(): void;
|
||||
abstract createElement(name: string, namespace?: string|null): any;
|
||||
|
|
|
@ -479,15 +479,15 @@ export interface RootData {
|
|||
}
|
||||
|
||||
export abstract class DebugContext {
|
||||
readonly view: ViewData;
|
||||
readonly nodeIndex: number|null;
|
||||
readonly injector: Injector;
|
||||
readonly component: any;
|
||||
readonly providerTokens: any[];
|
||||
readonly references: {[key: string]: any};
|
||||
readonly context: any;
|
||||
readonly componentRenderElement: any;
|
||||
readonly renderNode: any;
|
||||
abstract get view(): ViewData;
|
||||
abstract get nodeIndex(): number|null;
|
||||
abstract get injector(): Injector;
|
||||
abstract get component(): any;
|
||||
abstract get providerTokens(): any[];
|
||||
abstract get references(): {[key: string]: any};
|
||||
abstract get context(): any;
|
||||
abstract get componentRenderElement(): any;
|
||||
abstract get renderNode(): any;
|
||||
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
|
||||
* instance.
|
||||
*/
|
||||
readonly control: AbstractControl|null;
|
||||
abstract get control(): AbstractControl|null;
|
||||
|
||||
/** The value of the control. */
|
||||
get value(): any { return this.control ? this.control.value : null; }
|
||||
|
|
|
@ -392,9 +392,9 @@ export declare class PercentPipe implements PipeTransform {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class PlatformLocation {
|
||||
readonly hash: string;
|
||||
readonly pathname: string;
|
||||
readonly search: string;
|
||||
readonly abstract hash: string;
|
||||
readonly abstract pathname: string;
|
||||
readonly abstract search: string;
|
||||
abstract back(): void;
|
||||
abstract forward(): void;
|
||||
abstract getBaseHrefFromDOM(): string;
|
||||
|
|
|
@ -213,17 +213,17 @@ export interface ComponentDecorator {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class ComponentFactory<C> {
|
||||
readonly componentType: Type<any>;
|
||||
readonly inputs: {
|
||||
readonly abstract componentType: Type<any>;
|
||||
readonly abstract inputs: {
|
||||
propName: string;
|
||||
templateName: string;
|
||||
}[];
|
||||
readonly ngContentSelectors: string[];
|
||||
readonly outputs: {
|
||||
readonly abstract ngContentSelectors: string[];
|
||||
readonly abstract outputs: {
|
||||
propName: string;
|
||||
templateName: string;
|
||||
}[];
|
||||
readonly selector: string;
|
||||
readonly abstract selector: string;
|
||||
abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
||||
}
|
||||
|
||||
|
@ -235,12 +235,12 @@ export declare abstract class ComponentFactoryResolver {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class ComponentRef<C> {
|
||||
readonly changeDetectorRef: ChangeDetectorRef;
|
||||
readonly componentType: Type<any>;
|
||||
readonly hostView: ViewRef;
|
||||
readonly injector: Injector;
|
||||
readonly instance: C;
|
||||
readonly 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;
|
||||
}
|
||||
|
@ -369,8 +369,8 @@ export declare class ElementRef {
|
|||
|
||||
/** @experimental */
|
||||
export declare abstract class EmbeddedViewRef<C> extends ViewRef {
|
||||
readonly context: C;
|
||||
readonly rootNodes: any[];
|
||||
readonly abstract context: C;
|
||||
readonly abstract rootNodes: any[];
|
||||
}
|
||||
|
||||
/** @stable */
|
||||
|
@ -597,7 +597,7 @@ export declare const NgModule: NgModuleDecorator;
|
|||
|
||||
/** @experimental */
|
||||
export declare abstract class NgModuleFactory<T> {
|
||||
readonly moduleType: Type<T>;
|
||||
readonly abstract moduleType: Type<T>;
|
||||
abstract create(parentInjector: Injector | null): NgModuleRef<T>;
|
||||
}
|
||||
|
||||
|
@ -608,9 +608,9 @@ export declare abstract class NgModuleFactoryLoader {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class NgModuleRef<T> {
|
||||
readonly componentFactoryResolver: ComponentFactoryResolver;
|
||||
readonly injector: Injector;
|
||||
readonly instance: T;
|
||||
readonly abstract componentFactoryResolver: ComponentFactoryResolver;
|
||||
readonly abstract injector: Injector;
|
||||
readonly abstract instance: T;
|
||||
abstract destroy(): void;
|
||||
abstract onDestroy(callback: () => void): void;
|
||||
}
|
||||
|
@ -738,7 +738,7 @@ export declare class QueryList<T> {
|
|||
|
||||
/** @deprecated */
|
||||
export declare abstract class ReflectiveInjector implements Injector {
|
||||
readonly parent: Injector | null;
|
||||
readonly abstract parent: Injector | null;
|
||||
abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;
|
||||
abstract get(token: any, notFoundValue?: any): any;
|
||||
abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;
|
||||
|
@ -795,7 +795,7 @@ export declare abstract class Renderer {
|
|||
|
||||
/** @experimental */
|
||||
export declare abstract class Renderer2 {
|
||||
readonly data: {
|
||||
readonly abstract data: {
|
||||
[key: string]: any;
|
||||
};
|
||||
destroyNode: ((node: any) => void) | null;
|
||||
|
@ -953,7 +953,7 @@ export declare abstract class SystemJsNgModuleLoaderConfig {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class TemplateRef<C> {
|
||||
readonly elementRef: ElementRef;
|
||||
readonly abstract elementRef: ElementRef;
|
||||
abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;
|
||||
}
|
||||
|
||||
|
@ -1057,10 +1057,10 @@ export interface ViewChildrenDecorator {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class ViewContainerRef {
|
||||
readonly element: ElementRef;
|
||||
readonly injector: Injector;
|
||||
readonly length: number;
|
||||
readonly 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[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;
|
||||
abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number): EmbeddedViewRef<C>;
|
||||
|
@ -1081,7 +1081,7 @@ export declare enum ViewEncapsulation {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class ViewRef extends ChangeDetectorRef {
|
||||
readonly destroyed: boolean;
|
||||
readonly abstract destroyed: boolean;
|
||||
abstract destroy(): void;
|
||||
abstract onDestroy(callback: Function): any;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ export declare abstract class AbstractControl {
|
|||
|
||||
/** @stable */
|
||||
export declare abstract class AbstractControlDirective {
|
||||
readonly control: AbstractControl | null;
|
||||
readonly abstract control: AbstractControl | null;
|
||||
readonly dirty: boolean | null;
|
||||
readonly disabled: boolean | null;
|
||||
readonly enabled: boolean | null;
|
||||
|
|
Loading…
Reference in New Issue