index.d.ts 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { B as BasePortalOutlet, a as ComponentPortal, T as TemplatePortal, D as DomPortal } from '../portal-directives.d-BoG39gYN.js';
  2. export { d as BasePortalHost, e as CdkPortal, h as CdkPortalOutlet, g as CdkPortalOutletAttachedRef, C as ComponentType, P as Portal, c as PortalHost, i as PortalHostDirective, j as PortalModule, b as PortalOutlet, f as TemplatePortalDirective } from '../portal-directives.d-BoG39gYN.js';
  3. import { ApplicationRef, Injector, ComponentRef, EmbeddedViewRef } from '@angular/core';
  4. /**
  5. * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
  6. * application context.
  7. */
  8. declare class DomPortalOutlet extends BasePortalOutlet {
  9. /** Element into which the content is projected. */
  10. outletElement: Element;
  11. private _appRef?;
  12. private _defaultInjector?;
  13. private _document;
  14. /**
  15. * @param outletElement Element into which the content is projected.
  16. * @param _unusedComponentFactoryResolver Used to resolve the component factory.
  17. * Only required when attaching component portals.
  18. * @param _appRef Reference to the application. Only used in component portals when there
  19. * is no `ViewContainerRef` available.
  20. * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
  21. * have one. Only used for component portals.
  22. * @param _document Reference to the document. Used when attaching a DOM portal. Will eventually
  23. * become a required parameter.
  24. */
  25. constructor(
  26. /** Element into which the content is projected. */
  27. outletElement: Element,
  28. /**
  29. * @deprecated No longer in use. To be removed.
  30. * @breaking-change 18.0.0
  31. */
  32. _unusedComponentFactoryResolver?: any, _appRef?: ApplicationRef | undefined, _defaultInjector?: Injector | undefined,
  33. /**
  34. * @deprecated `_document` Parameter to be made required.
  35. * @breaking-change 10.0.0
  36. */
  37. _document?: any);
  38. /**
  39. * Attach the given ComponentPortal to DOM element.
  40. * @param portal Portal to be attached
  41. * @returns Reference to the created component.
  42. */
  43. attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
  44. /**
  45. * Attaches a template portal to the DOM as an embedded view.
  46. * @param portal Portal to be attached.
  47. * @returns Reference to the created embedded view.
  48. */
  49. attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
  50. /**
  51. * Attaches a DOM portal by transferring its content into the outlet.
  52. * @param portal Portal to be attached.
  53. * @deprecated To be turned into a method.
  54. * @breaking-change 10.0.0
  55. */
  56. attachDomPortal: (portal: DomPortal) => void;
  57. /**
  58. * Clears out a portal from the DOM.
  59. */
  60. dispose(): void;
  61. /** Gets the root HTMLElement for an instantiated component. */
  62. private _getComponentRootNode;
  63. }
  64. /**
  65. * @deprecated Use `DomPortalOutlet` instead.
  66. * @breaking-change 9.0.0
  67. */
  68. declare class DomPortalHost extends DomPortalOutlet {
  69. }
  70. /**
  71. * Custom injector to be used when providing custom
  72. * injection tokens to components inside a portal.
  73. * @docs-private
  74. * @deprecated Use `Injector.create` instead.
  75. * @breaking-change 11.0.0
  76. */
  77. declare class PortalInjector implements Injector {
  78. private _parentInjector;
  79. private _customTokens;
  80. constructor(_parentInjector: Injector, _customTokens: WeakMap<any, any>);
  81. get(token: any, notFoundValue?: any): any;
  82. }
  83. export { BasePortalOutlet, ComponentPortal, DomPortal, DomPortalHost, DomPortalOutlet, PortalInjector, TemplatePortal };