index.d.ts 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. import * as i0 from '@angular/core';
  2. import { InjectionToken, OnDestroy, OnChanges, SimpleChanges, OnInit, EventEmitter } from '@angular/core';
  3. import { U as UniqueSelectionDispatcher } from '../unique-selection-dispatcher.d-DSFqf1MM.js';
  4. import { Subject } from 'rxjs';
  5. /**
  6. * Injection token that can be used to reference instances of `CdkAccordion`. It serves
  7. * as alternative token to the actual `CdkAccordion` class which could cause unnecessary
  8. * retention of the class and its directive metadata.
  9. */
  10. declare const CDK_ACCORDION: InjectionToken<CdkAccordion>;
  11. /**
  12. * Directive whose purpose is to manage the expanded state of CdkAccordionItem children.
  13. */
  14. declare class CdkAccordion implements OnDestroy, OnChanges {
  15. /** Emits when the state of the accordion changes */
  16. readonly _stateChanges: Subject<SimpleChanges>;
  17. /** Stream that emits true/false when openAll/closeAll is triggered. */
  18. readonly _openCloseAllActions: Subject<boolean>;
  19. /** A readonly id value to use for unique selection coordination. */
  20. readonly id: string;
  21. /** Whether the accordion should allow multiple expanded accordion items simultaneously. */
  22. multi: boolean;
  23. /** Opens all enabled accordion items in an accordion where multi is enabled. */
  24. openAll(): void;
  25. /** Closes all enabled accordion items. */
  26. closeAll(): void;
  27. ngOnChanges(changes: SimpleChanges): void;
  28. ngOnDestroy(): void;
  29. static ɵfac: i0.ɵɵFactoryDeclaration<CdkAccordion, never>;
  30. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAccordion, "cdk-accordion, [cdkAccordion]", ["cdkAccordion"], { "multi": { "alias": "multi"; "required": false; }; }, {}, never, never, true, never>;
  31. static ngAcceptInputType_multi: unknown;
  32. }
  33. /**
  34. * A basic directive expected to be extended and decorated as a component. Sets up all
  35. * events and attributes needed to be managed by a CdkAccordion parent.
  36. */
  37. declare class CdkAccordionItem implements OnInit, OnDestroy {
  38. accordion: CdkAccordion;
  39. private _changeDetectorRef;
  40. protected _expansionDispatcher: UniqueSelectionDispatcher;
  41. /** Subscription to openAll/closeAll events. */
  42. private _openCloseAllSubscription;
  43. /** Event emitted every time the AccordionItem is closed. */
  44. readonly closed: EventEmitter<void>;
  45. /** Event emitted every time the AccordionItem is opened. */
  46. readonly opened: EventEmitter<void>;
  47. /** Event emitted when the AccordionItem is destroyed. */
  48. readonly destroyed: EventEmitter<void>;
  49. /**
  50. * Emits whenever the expanded state of the accordion changes.
  51. * Primarily used to facilitate two-way binding.
  52. * @docs-private
  53. */
  54. readonly expandedChange: EventEmitter<boolean>;
  55. /** The unique AccordionItem id. */
  56. readonly id: string;
  57. /** Whether the AccordionItem is expanded. */
  58. get expanded(): boolean;
  59. set expanded(expanded: boolean);
  60. private _expanded;
  61. /** Whether the AccordionItem is disabled. */
  62. disabled: boolean;
  63. /** Unregister function for _expansionDispatcher. */
  64. private _removeUniqueSelectionListener;
  65. constructor(...args: unknown[]);
  66. ngOnInit(): void;
  67. /** Emits an event for the accordion item being destroyed. */
  68. ngOnDestroy(): void;
  69. /** Toggles the expanded state of the accordion item. */
  70. toggle(): void;
  71. /** Sets the expanded state of the accordion item to false. */
  72. close(): void;
  73. /** Sets the expanded state of the accordion item to true. */
  74. open(): void;
  75. private _subscribeToOpenCloseAllActions;
  76. static ɵfac: i0.ɵɵFactoryDeclaration<CdkAccordionItem, never>;
  77. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkAccordionItem, "cdk-accordion-item, [cdkAccordionItem]", ["cdkAccordionItem"], { "expanded": { "alias": "expanded"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; "destroyed": "destroyed"; "expandedChange": "expandedChange"; }, never, never, true, never>;
  78. static ngAcceptInputType_expanded: unknown;
  79. static ngAcceptInputType_disabled: unknown;
  80. }
  81. declare class CdkAccordionModule {
  82. static ɵfac: i0.ɵɵFactoryDeclaration<CdkAccordionModule, never>;
  83. static ɵmod: i0.ɵɵNgModuleDeclaration<CdkAccordionModule, never, [typeof CdkAccordion, typeof CdkAccordionItem], [typeof CdkAccordion, typeof CdkAccordionItem]>;
  84. static ɵinj: i0.ɵɵInjectorDeclaration<CdkAccordionModule>;
  85. }
  86. export { CDK_ACCORDION, CdkAccordion, CdkAccordionItem, CdkAccordionModule };