mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Revert "build: add API goldens for portal" (#16703)
This reverts commit 8b5afcc41e.
This commit is contained in:
@@ -108,9 +108,3 @@ export class DomPortalOutlet extends BasePortalOutlet {
|
||||
return (componentRef.hostView as EmbeddedViewRef<any>).rootNodes[0] as HTMLElement;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `DomPortalOutlet` instead.
|
||||
* @breaking-change 9.0.0
|
||||
*/
|
||||
export class DomPortalHost extends DomPortalOutlet {}
|
||||
|
||||
@@ -36,16 +36,6 @@ export class CdkPortal extends TemplatePortal {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `CdkPortal` instead.
|
||||
* @breaking-change 9.0.0
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[cdk-portal], [cdkPortal], [portal]',
|
||||
exportAs: 'cdkPortal',
|
||||
})
|
||||
export class TemplatePortalDirective extends CdkPortal {}
|
||||
|
||||
/**
|
||||
* Possible attached references to the CdkPortalOutlet.
|
||||
*/
|
||||
@@ -168,20 +158,9 @@ export class CdkPortalOutlet extends BasePortalOutlet implements OnInit, OnDestr
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `CdkPortalOutlet` instead.
|
||||
* @breaking-change 9.0.0
|
||||
*/
|
||||
@Directive({
|
||||
selector: '[cdkPortalOutlet], [cdkPortalHost], [portalHost]',
|
||||
exportAs: 'cdkPortalOutlet, cdkPortalHost',
|
||||
inputs: ['portal: cdkPortalOutlet']
|
||||
})
|
||||
export class PortalHostDirective extends CdkPortalOutlet {}
|
||||
|
||||
|
||||
@NgModule({
|
||||
exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
|
||||
declarations: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
|
||||
exports: [CdkPortal, CdkPortalOutlet],
|
||||
declarations: [CdkPortal, CdkPortalOutlet],
|
||||
})
|
||||
export class PortalModule {}
|
||||
|
||||
@@ -169,11 +169,6 @@ export interface PortalOutlet {
|
||||
hasAttached(): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `PortalOutlet` instead.
|
||||
* @breaking-change 9.0.0
|
||||
*/
|
||||
export type PortalHost = PortalOutlet;
|
||||
|
||||
/**
|
||||
* Partial implementation of PortalOutlet that handles attaching
|
||||
@@ -259,9 +254,3 @@ export abstract class BasePortalOutlet implements PortalOutlet {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `BasePortalOutlet` instead.
|
||||
* @breaking-change 9.0.0
|
||||
*/
|
||||
export abstract class BasePortalHost extends BasePortalOutlet {}
|
||||
|
||||
@@ -10,3 +10,10 @@ export * from './portal';
|
||||
export * from './dom-portal-outlet';
|
||||
export * from './portal-directives';
|
||||
export * from './portal-injector';
|
||||
|
||||
export {DomPortalOutlet as DomPortalHost} from './dom-portal-outlet';
|
||||
export {
|
||||
CdkPortalOutlet as PortalHostDirective,
|
||||
CdkPortal as TemplatePortalDirective,
|
||||
} from './portal-directives';
|
||||
export {PortalOutlet as PortalHost, BasePortalOutlet as BasePortalHost} from './portal';
|
||||
|
||||
@@ -2,5 +2,8 @@ package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(":generate-guard-tests.bzl", "generate_test_targets")
|
||||
|
||||
# TODO(devversion): All entry-points except the CDK portal are currently validated. This is
|
||||
# because aliases are not supported by ts-api-guardian. Re-add once we found a solution for that.
|
||||
|
||||
# Generate the API guard test targets for each golden file in the current package.
|
||||
generate_test_targets(glob(["**/*.d.ts"]))
|
||||
|
||||
-96
@@ -1,96 +0,0 @@
|
||||
export declare abstract class BasePortalHost extends BasePortalOutlet {
|
||||
}
|
||||
|
||||
export declare abstract class BasePortalOutlet implements PortalOutlet {
|
||||
protected _attachedPortal: Portal<any> | null;
|
||||
attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;
|
||||
attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
|
||||
attach(portal: any): any;
|
||||
abstract attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
|
||||
abstract attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
|
||||
detach(): void;
|
||||
dispose(): void;
|
||||
hasAttached(): boolean;
|
||||
setDisposeFn(fn: () => void): void;
|
||||
}
|
||||
|
||||
export declare class CdkPortal extends TemplatePortal {
|
||||
constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef);
|
||||
}
|
||||
|
||||
export declare class CdkPortalOutlet extends BasePortalOutlet implements OnInit, OnDestroy {
|
||||
attached: EventEmitter<CdkPortalOutletAttachedRef>;
|
||||
readonly attachedRef: CdkPortalOutletAttachedRef;
|
||||
portal: Portal<any> | null;
|
||||
constructor(_componentFactoryResolver: ComponentFactoryResolver, _viewContainerRef: ViewContainerRef);
|
||||
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
|
||||
attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
|
||||
ngOnDestroy(): void;
|
||||
ngOnInit(): void;
|
||||
}
|
||||
|
||||
export declare type CdkPortalOutletAttachedRef = ComponentRef<any> | EmbeddedViewRef<any> | null;
|
||||
|
||||
export declare class ComponentPortal<T> extends Portal<ComponentRef<T>> {
|
||||
component: ComponentType<T>;
|
||||
componentFactoryResolver?: ComponentFactoryResolver | null;
|
||||
injector?: Injector | null;
|
||||
viewContainerRef?: ViewContainerRef | null;
|
||||
constructor(component: ComponentType<T>, viewContainerRef?: ViewContainerRef | null, injector?: Injector | null, componentFactoryResolver?: ComponentFactoryResolver | null);
|
||||
}
|
||||
|
||||
export interface ComponentType<T> {
|
||||
new (...args: any[]): T;
|
||||
}
|
||||
|
||||
export declare class DomPortalHost extends DomPortalOutlet {
|
||||
}
|
||||
|
||||
export declare class DomPortalOutlet extends BasePortalOutlet {
|
||||
outletElement: Element;
|
||||
constructor(
|
||||
outletElement: Element, _componentFactoryResolver: ComponentFactoryResolver, _appRef: ApplicationRef, _defaultInjector: Injector);
|
||||
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
|
||||
attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
export declare abstract class Portal<T> {
|
||||
readonly isAttached: boolean;
|
||||
attach(host: PortalOutlet): T;
|
||||
detach(): void;
|
||||
setAttachedHost(host: PortalOutlet | null): void;
|
||||
}
|
||||
|
||||
export declare type PortalHost = PortalOutlet;
|
||||
|
||||
export declare class PortalHostDirective extends CdkPortalOutlet {
|
||||
}
|
||||
|
||||
export declare class PortalInjector implements Injector {
|
||||
constructor(_parentInjector: Injector, _customTokens: WeakMap<any, any>);
|
||||
get(token: any, notFoundValue?: any): any;
|
||||
}
|
||||
|
||||
export declare class PortalModule {
|
||||
}
|
||||
|
||||
export interface PortalOutlet {
|
||||
attach(portal: Portal<any>): any;
|
||||
detach(): any;
|
||||
dispose(): void;
|
||||
hasAttached(): boolean;
|
||||
}
|
||||
|
||||
export declare class TemplatePortal<C = any> extends Portal<EmbeddedViewRef<C>> {
|
||||
context: C | undefined;
|
||||
readonly origin: ElementRef;
|
||||
templateRef: TemplateRef<C>;
|
||||
viewContainerRef: ViewContainerRef;
|
||||
constructor(template: TemplateRef<C>, viewContainerRef: ViewContainerRef, context?: C);
|
||||
attach(host: PortalOutlet, context?: C | undefined): EmbeddedViewRef<C>;
|
||||
detach(): void;
|
||||
}
|
||||
|
||||
export declare class TemplatePortalDirective extends CdkPortal {
|
||||
}
|
||||
Reference in New Issue
Block a user