import { Observable } from 'rxjs';
import { LogService } from '../log';
import { CoreState, DeepPartial } from '@eui/base';
import * as i0 from "@angular/core";
export declare enum BrowserStorageType {
    local = 0,
    session = 1
}
export type Handler<T> = (state: T[keyof T]) => Partial<T[keyof T]>;
export declare class StoreService<T = any> {
    protected logService: LogService;
    private platformId;
    /**
     * autoSave handlers to call before saving in local Storage
     */
    protected _autoSaveHandlers: {
        [key: string]: Handler<T>;
    };
    /** storage instance e.g. localStorage, sessionStorage */
    private _storage;
    private state;
    private isHandlingAutoSave;
    constructor(logService: LogService, platformId: unknown);
    init(version?: string, storageType?: BrowserStorageType): void;
    /**
     * Add an autoSave handler for a specific state slice
     * @param stateSlice
     * @param handler
     * @deprecated it will be removed in the next major version
     */
    addAutoSaveHandler(stateSlice: string, handler: Handler<T>): void;
    handleAutoSave(): void;
    /**
     * Proxy to NGRX store.dispatch()
     * that allows to intercept if the store is present
     *
     * @deprecated it will be removed in the next version support of NGRX will cease
     */
    dispatch(action: unknown): void;
    /**
     * This method is used to update the state of the service with a new state.
     *
     * @param state
     */
    updateState(state: DeepPartial<T>): void;
    /**
     * @deprecated it will be removed in next version. Use updateState(partialState: DeepPartial<T>) instead
     * @param slice
     * @param reducer
     */
    updateState(slice: DeepPartial<T>, reducer: (state: T, action: DeepPartial<T>) => T): void;
    select(key?: any): Observable<T[any]>;
    /**
     * filters and save the state with the Browser storage
     * @param state type of CoreState
     */
    protected saveState(state: CoreState): void;
    /**
     * deep merge two objects
     * @param target the object that will be merged into
     * @param source the object that will be merged from
     */
    private deepMerge;
    /**
     * checks if the given item is an object
     * @param item the item that will be checked
     */
    private isObject;
    static ɵfac: i0.ɵɵFactoryDeclaration<StoreService<any>, [{ optional: true; }, null]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<StoreService<any>>;
}
//# sourceMappingURL=store.service.d.ts.map