import { Observable } from 'rxjs';
import { OnDestroy, ElementRef } from '@angular/core';
import { DbxInjectionComponentConfig } from '@dereekb/dbx-core';
import { ListLoadingState } from '@dereekb/rxjs';
import { Maybe, Milliseconds } from '@dereekb/util';
import { DbxListSelectionMode, DbxListView, ListSelectionState } from './list.view';
import * as i0 from "@angular/core";
/**
 * Used internally by DbxListComponent
 */
export declare class DbxListInternalContentDirective {
    private readonly parent;
    readonly elementRef: ElementRef<any>;
    readonly hide: import("@angular/core").InputSignal<Maybe<boolean>>;
    constructor();
    onScrollEvent($event: Event): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DbxListInternalContentDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<DbxListInternalContentDirective, "[dbxListInternalContent]", never, { "hide": { "alias": "hide"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}
/**
 * Direction the scroll was triggered moving.
 */
export type DbxListScrollDirectionTrigger = 'up' | 'down';
/**
 * Used to trigger the loading of additional items.
 *
 * If an observable is returned it is used to throttle the loading of more items until it returns.
 */
export type DbxListLoadMoreHandler = () => Observable<void> | void;
/**
 * DbxListComponent configuration.
 */
export interface DbxListConfig<T = unknown, V extends DbxListView<T> = DbxListView<T>> extends DbxInjectionComponentConfig<V> {
    /**
     * Whether or not to hide the list content when it is an empty list.
     */
    readonly hideOnEmpty?: boolean;
    /**
     * Whether or not this list should scroll upward from the bottom, like a message list.
     */
    readonly invertedList?: boolean;
    /**
     * Distance to scroll.
     */
    readonly scrollDistance?: number;
    /**
     * Number of ms to throttle scrolling events.
     */
    readonly throttle?: Milliseconds;
    /**
     * (Optional) onClick handler
     */
    readonly onClick?: (value: T) => void;
    /**
     * (Optional) onSelection handler
     */
    readonly onSelectionChange?: (selection: ListSelectionState<T>) => void;
    /**
     * (Optional) handler function to load more items.
     */
    readonly loadMore?: DbxListLoadMoreHandler;
    /**
     * Default selection list value. If not defined, will default to 'view'.
     */
    readonly defaultSelectionMode?: Maybe<DbxListSelectionMode>;
}
export type DbxListComponentScrolledEventPosition = number;
export declare const DBX_LIST_DEFAULT_SCROLL_DISTANCE = 1.5;
export declare const DBX_LIST_DEFAULT_THROTTLE_SCROLL = 50;
/**
 * Used to display a potentially infinitely scrollable list of content.
 *
 * This component is generally wrapped by another component that provides this one configuration.
 */
export declare class DbxListComponent<T = unknown, V extends DbxListView<T> = DbxListView<T>, S extends ListLoadingState<T> = ListLoadingState<T>> implements OnDestroy {
    /**
     * Emitted when content is scrolled.
     */
    readonly contentScrolled: import("@angular/core").OutputEmitterRef<number>;
    /**
     * Whether or not to add bottom padding to the list content.
     */
    readonly padded: import("@angular/core").InputSignal<boolean>;
    readonly state: import("@angular/core").InputSignal<Maybe<Observable<Maybe<S>>>>;
    readonly config: import("@angular/core").InputSignal<Maybe<DbxListConfig<T, V>>>;
    readonly disabled: import("@angular/core").InputSignal<Maybe<boolean>>;
    readonly selectionMode: import("@angular/core").InputSignal<Maybe<DbxListSelectionMode>>;
    readonly hasMore: import("@angular/core").InputSignal<Maybe<boolean>>;
    readonly hasMore$: Observable<Maybe<boolean>>;
    private readonly _internalContentSignal;
    readonly nativeElementSignal: import("@angular/core").Signal<HTMLElement | undefined>;
    private readonly _loadMoreTrigger;
    private readonly _scrollTrigger;
    private readonly _loadMoreSub;
    private readonly _onClickSub;
    private readonly _disabledSub;
    private readonly _selectionModeSub;
    private readonly _onSelectionChangeSub;
    readonly currentState$: Observable<Maybe<S>>;
    readonly context: import("@dereekb/rxjs").MutableListLoadingStateContext<T, S>;
    readonly hasMoreFromCurrentState$: Observable<Maybe<boolean>>;
    readonly isEnd$: Observable<Maybe<boolean>>;
    readonly isEmpty$: Observable<boolean>;
    readonly isEmptyLoading$: Observable<boolean>;
    readonly isEmptyAndNotLoading$: Observable<boolean>;
    readonly config$: Observable<Maybe<DbxListConfig<T, V>>>;
    readonly disabled$: Observable<boolean>;
    readonly selectionMode$: Observable<Maybe<DbxListSelectionMode>>;
    readonly hideOnEmpty$: Observable<boolean>;
    readonly invertedList$: Observable<boolean>;
    readonly throttleScroll$: Observable<number>;
    readonly scrollDistance$: Observable<number>;
    readonly scrollLoadMoreTrigger$: Observable<DbxListScrollDirectionTrigger>;
    readonly loadMore$: Observable<void | DbxListScrollDirectionTrigger>;
    readonly injectedComponentConfig$: Observable<Maybe<DbxInjectionComponentConfig<V>>>;
    readonly hideContent$: Observable<boolean>;
    readonly infiniteScrollDistanceSignal: import("@angular/core").Signal<number>;
    readonly infiniteScrollThrottleSignal: import("@angular/core").Signal<number>;
    readonly hideContentSignal: import("@angular/core").Signal<boolean | undefined>;
    readonly injectedComponentConfigSignal: import("@angular/core").Signal<Maybe<DbxInjectionComponentConfig<V>>>;
    readonly isEmptyAndNotLoadingSignal: import("@angular/core").Signal<boolean | undefined>;
    readonly isEmptyLoadingSignal: import("@angular/core").Signal<boolean | undefined>;
    readonly isEndSignal: import("@angular/core").Signal<Maybe<boolean>>;
    ngOnDestroy(): void;
    getScrollPositionRelativeToBottom(): number;
    jumpToBottom(): void;
    jumpToPositionRelativeToBottom(pos: number): void;
    onScrollDown(): void;
    onScrollUp(): void;
    loadMore(): void;
    setInternalContent(content: DbxListInternalContentDirective): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<DbxListComponent<any, any, any>, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<DbxListComponent<any, any, any>, "dbx-list", never, { "padded": { "alias": "padded"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "hasMore": { "alias": "hasMore"; "required": false; "isSignal": true; }; }, { "contentScrolled": "contentScrolled"; }, never, ["[top]", "[bottom]", "[end]", "[empty]", "[emptyLoading]"], true, never>;
}
