UNPKG

1.63 kBTypeScriptView Raw
1import { ElementRef, EventEmitter, NgZone, OnChanges, OnInit, SimpleChanges } from '@angular/core';
2import { NgbCollapseConfig } from './collapse-config';
3/**
4 * A directive to provide a simple way of hiding and showing elements on the page.
5 */
6export declare class NgbCollapse implements OnInit, OnChanges {
7 private _element;
8 private _zone;
9 /**
10 * If `true`, collapse will be animated.
11 *
12 * Animation is triggered only when clicked on triggering element
13 * or via the `.toggle()` function
14 *
15 * @since 8.0.0
16 */
17 animation: any;
18 /**
19 * If `true`, will collapse the element or show it otherwise.
20 */
21 collapsed: boolean;
22 ngbCollapseChange: EventEmitter<boolean>;
23 /**
24 * An event emitted when the collapse element is shown, after the transition. It has no payload.
25 *
26 * @since 8.0.0
27 */
28 shown: EventEmitter<void>;
29 /**
30 * An event emitted when the collapse element is hidden, after the transition. It has no payload.
31 *
32 * @since 8.0.0
33 */
34 hidden: EventEmitter<void>;
35 constructor(_element: ElementRef, config: NgbCollapseConfig, _zone: NgZone);
36 ngOnInit(): void;
37 ngOnChanges({ collapsed }: SimpleChanges): void;
38 /**
39 * Triggers collapsing programmatically.
40 *
41 * If there is a collapsing transition running already, it will be reversed.
42 * If the animations are turned off this happens synchronously.
43 *
44 * @since 8.0.0
45 */
46 toggle(open?: boolean): void;
47 private _runTransition;
48 private _runTransitionWithEvents;
49}