base.d.ts 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { AnimationEvent } from '@angular/animations';
  6. import { ComponentType, Overlay } from '@angular/cdk/overlay';
  7. import { ChangeDetectorRef, EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
  8. import { Subject } from 'rxjs';
  9. import { MessageConfig, NzConfigService } from 'ng-zorro-antd/core/config';
  10. import { NzSingletonService } from 'ng-zorro-antd/core/services';
  11. import { NzMessageData, NzMessageDataOptions } from './typings';
  12. import * as i0 from "@angular/core";
  13. export declare abstract class NzMNService<T extends NzMNContainerComponent> {
  14. protected overlay: Overlay;
  15. private injector;
  16. protected abstract componentPrefix: string;
  17. protected container?: T;
  18. protected nzSingletonService: NzSingletonService;
  19. protected constructor(overlay: Overlay, injector: Injector);
  20. remove(id?: string): void;
  21. protected getInstanceId(): string;
  22. protected withContainer(ctor: ComponentType<T>): T;
  23. }
  24. export declare abstract class NzMNContainerComponent<C extends MessageConfig = MessageConfig, D extends NzMessageData = NzMessageData> implements OnInit, OnDestroy {
  25. config?: Required<C>;
  26. instances: Array<Required<D>>;
  27. private readonly _afterAllInstancesRemoved;
  28. readonly afterAllInstancesRemoved: import("rxjs").Observable<void>;
  29. protected cdr: ChangeDetectorRef;
  30. protected nzConfigService: NzConfigService;
  31. protected readonly destroy$: Subject<void>;
  32. ngOnInit(): void;
  33. ngOnDestroy(): void;
  34. create(data: D): Required<D>;
  35. remove(id: string, userAction?: boolean): void;
  36. removeAll(): void;
  37. protected onCreate(instance: D): Required<D>;
  38. protected onRemove(instance: Required<D>, userAction: boolean): void;
  39. private onAllInstancesRemoved;
  40. protected readyInstances(): void;
  41. protected abstract subscribeConfigChange(): void;
  42. protected mergeOptions(options?: D['options']): D['options'];
  43. static ɵfac: i0.ɵɵFactoryDeclaration<NzMNContainerComponent<any, any>, never>;
  44. static ɵdir: i0.ɵɵDirectiveDeclaration<NzMNContainerComponent<any, any>, never, never, {}, {}, never, never, true, never>;
  45. }
  46. export declare abstract class NzMNComponent implements OnInit, OnDestroy {
  47. abstract instance: Required<NzMessageData>;
  48. abstract index?: number;
  49. abstract destroyed: EventEmitter<{
  50. id: string;
  51. userAction: boolean;
  52. }>;
  53. protected cdr: ChangeDetectorRef;
  54. readonly animationStateChanged: Subject<AnimationEvent>;
  55. protected options: Required<NzMessageDataOptions>;
  56. protected autoClose?: boolean;
  57. protected closeTimer?: ReturnType<typeof setTimeout>;
  58. protected userAction: boolean;
  59. protected eraseTimer?: ReturnType<typeof setTimeout>;
  60. protected eraseTimingStart?: number;
  61. protected eraseTTL: number;
  62. ngOnInit(): void;
  63. ngOnDestroy(): void;
  64. onEnter(): void;
  65. onLeave(): void;
  66. protected destroy(userAction?: boolean): void;
  67. private initErase;
  68. private updateTTL;
  69. private startEraseTimeout;
  70. private clearEraseTimeout;
  71. static ɵfac: i0.ɵɵFactoryDeclaration<NzMNComponent, never>;
  72. static ɵdir: i0.ɵɵDirectiveDeclaration<NzMNComponent, never, never, {}, {}, never, never, true, never>;
  73. }