import * as ng_primitives_collapsible from 'ng-primitives/collapsible'; import * as _angular_core from '@angular/core'; import { WritableSignal, Signal } from '@angular/core'; import { BooleanInput } from '@angular/cdk/coercion'; import { NgpOrientation } from 'ng-primitives/common'; import * as ng_primitives_state from 'ng-primitives/state'; import { SetterOptions } from 'ng-primitives/state'; import { Observable } from 'rxjs'; /** * Apply the `ngpCollapsible` directive to an element that contains a collapsible * trigger and content. It manages the open state of a single disclosure. */ declare class NgpCollapsible { /** * Whether the collapsible is open. Leave unset for uncontrolled usage. */ readonly open: _angular_core.InputSignalWithTransform; /** * The default open state for uncontrolled usage. * @default false */ readonly defaultOpen: _angular_core.InputSignalWithTransform; /** * Emits when the open state changes. */ readonly openChange: _angular_core.OutputEmitterRef; /** * Whether the collapsible is disabled. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The orientation of the collapsible. * @default 'vertical' */ readonly orientation: _angular_core.InputSignal; /** * The state for the collapsible primitive. */ protected readonly state: ng_primitives_collapsible.NgpCollapsibleState; /** * Toggle the open state. */ toggle(): void; /** * Set the open state. */ setOpen(value: boolean, options?: SetterOptions): void; /** * Set the disabled state. */ setDisabled(value: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The shared state for the Collapsible primitive. This is the reusable core * behind both the standalone collapsible and each accordion item - the trigger * and content parts read their open/disabled/orientation state and their * registered ids from here. */ interface NgpCollapsibleState { /** * Whether the collapsible is open. */ readonly open: WritableSignal; /** * Whether the collapsible is disabled. */ readonly disabled: WritableSignal; /** * The orientation of the collapsible. */ readonly orientation: Signal; /** * Emits when the open state changes. */ readonly openChange: Observable; /** * The id of the trigger, registered by the trigger part. */ readonly triggerId: Signal; /** * The id of the content, registered by the content part. */ readonly contentId: Signal; /** * Toggle the open state. */ toggle(): void; /** * Set the open state. */ setOpen(value: boolean, options?: SetterOptions): void; /** * Set the disabled state. */ setDisabled(value: boolean): void; /** * Set the default open state. */ setDefaultOpen(value: boolean): void; /** * Register the trigger id. * @internal */ setTrigger(id: string): void; /** * Register the content id. * @internal */ setContent(id: string): void; } /** * Inputs for configuring the Collapsible primitive. */ interface NgpCollapsibleProps { /** * Whether the collapsible is open. Leave `undefined` for uncontrolled usage. */ readonly open: Signal; /** * The default open state for uncontrolled usage. */ readonly defaultOpen?: Signal; /** * Whether the collapsible is disabled. */ readonly disabled?: Signal; /** * The orientation of the collapsible. */ readonly orientation?: Signal; /** * Callback fired when the open state changes. */ readonly onOpenChange?: (open: boolean) => void; } declare const NgpCollapsibleStateToken: _angular_core.InjectionToken>; declare const ngpCollapsible: ({ open: _open, defaultOpen: _defaultOpen, disabled: _disabled, orientation: _orientation, onOpenChange, }: NgpCollapsibleProps) => NgpCollapsibleState; declare const injectCollapsibleState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideCollapsibleState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpCollapsibleTrigger` directive to an element - typically a * `button` - that toggles the collapsible open and closed. */ declare class NgpCollapsibleTrigger { /** * The id of the trigger. */ readonly id: _angular_core.InputSignal; private readonly state; /** * Toggle the collapsible. */ toggle(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpCollapsibleTriggerState { /** * The id of the trigger. */ readonly id: Signal; /** * Toggle the collapsible. */ toggle(): void; } interface NgpCollapsibleTriggerProps { /** * The id of the trigger. */ readonly id?: Signal; } declare const NgpCollapsibleTriggerStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpCollapsibleTrigger: ({ id, }: NgpCollapsibleTriggerProps) => NgpCollapsibleTriggerState; declare const injectCollapsibleTriggerState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideCollapsibleTriggerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * Apply the `ngpCollapsibleContent` directive to the element that contains the * collapsible content that is shown and hidden by the trigger. */ declare class NgpCollapsibleContent { /** * The id of the content region. */ readonly id: _angular_core.InputSignal; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpCollapsibleContentState { /** * The id of the content region. */ readonly id: Signal; } interface NgpCollapsibleContentProps { /** * The id of the content region. */ readonly id?: Signal; /** * The CSS custom property prefix for the measured dimensions. The content's * width and height are exposed as `---width` and `---height`. * @default 'ngp-collapsible-content' */ readonly cssVarPrefix?: string; } declare const NgpCollapsibleContentStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal>; declare const ngpCollapsibleContent: ({ id, cssVarPrefix, }: NgpCollapsibleContentProps) => NgpCollapsibleContentState; declare const injectCollapsibleContentState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideCollapsibleContentState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; export { NgpCollapsible, NgpCollapsibleContent, NgpCollapsibleContentStateToken, NgpCollapsibleStateToken, NgpCollapsibleTrigger, NgpCollapsibleTriggerStateToken, injectCollapsibleContentState, injectCollapsibleState, injectCollapsibleTriggerState, ngpCollapsible, ngpCollapsibleContent, ngpCollapsibleTrigger, provideCollapsibleContentState, provideCollapsibleState, provideCollapsibleTriggerState }; export type { NgpCollapsibleContentProps, NgpCollapsibleContentState, NgpCollapsibleProps, NgpCollapsibleState, NgpCollapsibleTriggerProps, NgpCollapsibleTriggerState };