import * as _c8y_client from '@c8y/client';
import { IManagedObject, IResultList } from '@c8y/client';
import * as _c8y_ngx_components from '@c8y/ngx-components';
import { SearchFilters, Column, Pagination, ActionControl, BulkActionControl, GridConfigContextProvider, DataGridComponent, FeatureCacheService, UserPreferencesGridConfigContext, DataSourceModifier, ServerSideDataResult, FilteringActionType, FilteringModifier, AlertService, RouterService, ColumnConfig } from '@c8y/ngx-components';
import * as rxjs from 'rxjs';
import { BehaviorSubject, UnaryFunction, Observable } from 'rxjs';
import * as i0 from '@angular/core';
import { EventEmitter, OnDestroy, OnInit, ModuleWithProviders } from '@angular/core';
import * as i2 from '@c8y/ngx-components/device-grid';
import * as i3 from '@c8y/ngx-components/data-grid-columns/asset-type';
import { AssetTypeGridColumn } from '@c8y/ngx-components/data-grid-columns/asset-type';
import * as _angular_router from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';

declare class AssetSearchService {
    GRID_CONFIG_STORAGE_KEY: string;
    DEFAULT_PAGE_SIZE: number;
    getGlobalSearchData: any;
    appliedFilters$: BehaviorSubject<{
        [SearchFilters.ALL_FILTERS]: boolean;
        [SearchFilters.ONLY_GROUPS_AND_ASSETS]: boolean;
        [SearchFilters.ONLY_DEVICES]: boolean;
        [SearchFilters.CURRENT_HIERARCHY]: boolean;
    }>;
    private queriesUtil;
    private featureCacheService;
    private deviceGridService;
    private assetNodeService;
    private contextRouteService;
    constructor();
    /**
     * Resets the status of applied filters, used during the search.
     * Applies only to filters: 'All', 'Show only devices', 'Show only groups and assets'.
     */
    resetAppliedFilters(): void;
    buildCombinedRootQueryFilter(columns: Column[], pagination: Pagination): _c8y_client.QueryObjectWithDedicatedFilter | _c8y_client.QueryObjectFilterComparison | {
        [x: string]: _c8y_client.QueryObjectFilterComparison[];
    };
    getData(columns: Column[], pagination: Pagination, text?: string): Promise<any>;
    getDefaultColumns(): Column[];
    getDefaultActionControls(): ActionControl[];
    getDefaultBulkActionControls(): BulkActionControl[];
    getDefaultPagination(): Pagination;
    isWildcardSearchEnabled(): Promise<boolean>;
    private buildSearchQuery;
    /**
     * Get search data based on the provided text and pagination.
     * @param text The search text.
     * @param pagination The pagination options.
     * @returns The search results.
     */
    private getSearchData;
    static ɵfac: i0.ɵɵFactoryDeclaration<AssetSearchService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<AssetSearchService>;
}

/**
 * Configuration object of the SearchModule.
 */
interface SearchConfig {
    /**
     * Allows to enable advanced filters.
     * Default value: true.
     */
    showAdvancedFilters?: boolean;
    /**
     * Allows a custom placeholder.
     * Default value: ''
     */
    placeholder?: string;
}

declare class SearchGridComponent implements GridConfigContextProvider {
    parentGroup: IManagedObject;
    title: string;
    loadingItemsLabel: string;
    set _columns(value: Column[]);
    set _pagination(value: Pagination);
    set _actionControls(value: ActionControl[]);
    selectable: boolean;
    set _bulkActionControls(value: BulkActionControl[]);
    onColumnsChange: EventEmitter<Column[]>;
    searchText: string;
    filteringName: string;
    /** The name of the key where columns configuration will be stored. */
    columnsConfigKey: string;
    moduleConfig: SearchConfig;
    showAdvancedFilters: boolean;
    customPlaceholder: string;
    columns: Column[];
    assetSearchService: AssetSearchService;
    pagination: Pagination;
    actionControls: ActionControl[];
    bulkActionControls: BulkActionControl[];
    serverSideDataCallback: any;
    refresh: EventEmitter<any>;
    dataGrid: DataGridComponent;
    featureCacheService: FeatureCacheService;
    isWildcardSearchEnabled$: rxjs.Observable<boolean>;
    wildcardSearchTitle: "Asset data";
    fullTextSearchTitle: "Search results";
    private sizeCount;
    private bsModalService;
    private smartGroupsService;
    private subAssetsGridService;
    getGridConfigContext(): UserPreferencesGridConfigContext;
    ngOnInit(): void;
    ngAfterViewInit(): void;
    trackByName(_index: any, column: Column): string;
    onDataSourceModifier(dataSourceModifier: DataSourceModifier): Promise<ServerSideDataResult>;
    setActionControls(): void;
    updateFiltering(columnNames: string[], action: {
        type: FilteringActionType;
        payload?: {
            filteringModifier: FilteringModifier;
        };
    }): void;
    onColumnFilterReset(column: Column): void;
    private onDeleteAsset;
    private setInitialFilterForTypeColumn;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchGridComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchGridComponent, "c8y-search-grid", never, { "parentGroup": { "alias": "parent-group"; "required": false; }; "title": { "alias": "title"; "required": false; }; "loadingItemsLabel": { "alias": "loadingItemsLabel"; "required": false; }; "_columns": { "alias": "columns"; "required": false; }; "_pagination": { "alias": "pagination"; "required": false; }; "_actionControls": { "alias": "actionControls"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "_bulkActionControls": { "alias": "bulkActionControls"; "required": false; }; "searchText": { "alias": "searchText"; "required": false; }; "filteringName": { "alias": "filteringName"; "required": false; }; "columnsConfigKey": { "alias": "columnsConfigKey"; "required": false; }; }, { "onColumnsChange": "onColumnsChange"; }, never, never, true, never>;
}

declare class SearchResultsComponent implements OnDestroy {
    private route;
    private alert;
    filter: string;
    searchText: string;
    searchGrid: SearchGridComponent;
    filteringName: string;
    featureCacheService: FeatureCacheService;
    isWildcardSearchEnabled$: rxjs.Observable<boolean>;
    private readonly WARNING_TIMEOUT_TIME;
    private unsubscribe$;
    constructor(route: ActivatedRoute, alert: AlertService);
    ngOnInit(): void;
    ngAfterViewInit(): void;
    resetSearch(): void;
    resetFilter(): void;
    ngOnDestroy(): void;
    private onQueryParamsChange;
    private shouldFilter;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchResultsComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchResultsComponent, "c8y-search-results", never, {}, {}, never, never, true, never>;
}

declare class SearchActionComponent {
    showAdvancedFilters: boolean;
    customPlaceholder: string;
    customQuery: UnaryFunction<string, Observable<IResultList<IManagedObject>>>;
    typeaheadReload: EventEmitter<any>;
    featureCacheService: FeatureCacheService;
    isWildcardSearchEnabled$: Observable<boolean>;
    c8yRouter: RouterService;
    router: Router;
    moduleConfig: SearchConfig;
    isOnlyHierarchyQuery: boolean;
    constructor();
    triggerDataLoad(): void;
    onOpenChange(isOpen: boolean): void;
    onSearch(on: string): Promise<void>;
    onFilter(on: string): void;
    onClick(mo: IManagedObject): void;
    private navigate;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchActionComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchActionComponent, "c8y-search-action", never, {}, {}, never, never, true, never>;
}

type Checkbox = {
    label: string;
    name: string;
    value: boolean;
    indeterminate?: boolean;
    isDisabled?: boolean;
};
declare class SearchCustomFiltersComponent implements OnInit {
    useTabs: boolean;
    customDataQuery: EventEmitter<any>;
    refresh: EventEmitter<any>;
    tabNames: {
        all: "All";
        devices: "Devices";
        groupsAndAssets: "Groups and assets";
    };
    selectedTab: (typeof this.tabNames)[keyof typeof this.tabNames];
    checkboxesState: Array<Checkbox>;
    isOnlyHierarchyQuery: boolean;
    isOnlyHierarchyQueryChange: EventEmitter<boolean>;
    private assetSearchService;
    private contextRouteService;
    private router;
    contextRouteData$: rxjs.Observable<_angular_router.Data & _c8y_ngx_components.ContextData>;
    context$: rxjs.Observable<_c8y_ngx_components.ContextData | (_angular_router.Data & _c8y_ngx_components.ContextData)>;
    ngOnInit(): void;
    onCheckboxChange(event: Event, checkbox: Checkbox): void;
    onTabChange(tabName?: (typeof this.tabNames)[keyof typeof this.tabNames]): void;
    onHierarchyQueryChange(checked: boolean): void;
    onSearchFilterChange(all: boolean, devices: boolean, groupsAndAssets: boolean, currentHierarchy?: boolean): void;
    private saveCheckboxValue;
    private onSelectAll;
    private onAllDevices;
    private onGroupsAndAssets;
    private getCheckbox;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchCustomFiltersComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<SearchCustomFiltersComponent, "c8y-search-custom-filters", never, { "useTabs": { "alias": "useTabs"; "required": false; }; "isOnlyHierarchyQuery": { "alias": "isOnlyHierarchyQuery"; "required": false; }; }, { "customDataQuery": "customDataQuery"; "refresh": "refresh"; "isOnlyHierarchyQueryChange": "isOnlyHierarchyQueryChange"; }, never, never, true, never>;
}

declare class SearchModule {
    static config(config?: SearchConfig): ModuleWithProviders<SearchModule>;
    static ɵfac: i0.ɵɵFactoryDeclaration<SearchModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<SearchModule, never, [typeof _c8y_ngx_components.CoreModule, typeof i2.DeviceGridModule, typeof _c8y_ngx_components.CoreSearchModule, typeof i3.AssetTypeCellRendererComponent, typeof SearchResultsComponent, typeof SearchGridComponent, typeof SearchActionComponent, typeof SearchCustomFiltersComponent], [typeof SearchResultsComponent, typeof SearchGridComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<SearchModule>;
}

declare class AssetTypeSearchGridColumn extends AssetTypeGridColumn {
    constructor(hideExtendedFilters: boolean, initialColumnConfig?: ColumnConfig, assetSearchService?: AssetSearchService, customPlaceholder?: string);
    private getFilteringConfig;
}

export { AssetSearchService, AssetTypeSearchGridColumn, SearchCustomFiltersComponent, SearchGridComponent, SearchModule, SearchResultsComponent };
export type { Checkbox };
//# sourceMappingURL=index.d.ts.map
