import * as react_jsx_runtime from 'react/jsx-runtime';
import React, { Dispatch, SetStateAction, ReactNode } from 'react';
import { omit, mapValues, omitBy, pick, groupBy, findIndex } from 'remeda';
import * as openpgp from 'openpgp/lightweight';
import { QueryClient } from '@tanstack/react-query';
export { useQueryClient } from '@tanstack/react-query';
import { StoreApi } from 'zustand';
import { Socket } from 'socket.io-client';

type AppProviderServices = Record<string, InstanceType<any>>;
interface AppProvider {
    get type(): "service" | "data" | "utils";
    services(params?: any): AppProviderServices;
}

declare class CoreUtilsProvider implements AppProvider {
    get type(): string;
    services(params?: any): Record<string, InstanceType<any>>;
}

declare class CoreDataProvider implements AppProvider {
    get type(): string;
    services(params?: any): Record<string, InstanceType<any>>;
}

declare class CoreServiceProvider implements AppProvider {
    get type(): string;
    services(params?: any): Record<string, InstanceType<any>>;
}

declare abstract class AppModule {
    abstract name: string;
    abstract providers: AppProvider[];
    protected serviceRegistry: Record<string, any>;
    protected config: Record<string, any>;
    constructor(args: {
        deps: Record<string, AppModule>;
        config?: Record<string, any>;
    });
    init(): void;
    getService<T>(name: string): T;
    getConfig<T = any>(path?: string, throwIfMissing?: boolean): T | undefined;
}

interface HttpErrorDetails {
    [key: string]: any;
}
declare class HttpError extends Error {
    status: string;
    details: any;
    constructor(message: string, status?: string, details?: any);
}

interface ApiResponse<T = any> {
    status: number;
    headers: Headers;
    body: T;
    rawBody: any;
    json: any;
}
interface ApiClient {
    key?: string;
}
interface ErrorHandlingStrategy {
    handleNetworkError?: (error: HttpError) => void;
    handleUnauthorizedError?: (error: HttpError) => void;
    handleForbiddenError?: (error: HttpError) => void;
    handleInvalidClientError?: (error: HttpError) => void;
    handleGenericError?: (error: HttpError, status: number) => void;
    shouldShowToast?: (error: HttpError, status: number) => boolean;
    getErrorTitle?: () => string;
}
interface Options extends RequestInit {
    client?: ApiClient;
    skipErrorToast?: boolean;
    errorHandling?: ErrorHandlingStrategy;
    skipCsrf?: boolean;
}

interface HttpClientConfig {
    apiUrl: string;
    errorHandlingStrategy?: ErrorHandlingStrategy;
    client?: ApiClient;
}
declare class HttpClient {
    private config;
    private csrfToken;
    private csrfTokenPromise;
    constructor(config: HttpClientConfig);
    get apiUrl(): string;
    setApiUrl(url: string): void;
    get client(): ApiClient | undefined;
    get errorHandlingStrategy(): ErrorHandlingStrategy;
    static isValidObject(value: any): boolean;
    static flattenObject(value: any, path?: any[]): any;
    static jsonToQueryString(json: Record<string, any>): string;
    fetchJson<T = any>(url: string, options?: Options): Promise<ApiResponse<T>>;
    fetchData(url: string, options?: Options): Promise<Response>;
    private createHeaders;
    private interceptResponse;
    private isUnauthorized;
    private isLimitExceeded;
    private getMethod;
    private isBrowserRuntime;
    private shouldAttachCsrf;
    private fetchCsrfToken;
    private getOrCreateCsrfToken;
    private attachCsrfHeaderIfNeeded;
}

type CoreModuleConfig = {
    httpClient: HttpClient;
    secureStorage?: {
        getKey: (params?: any) => Promise<string>;
    };
    safekey?: {
        enableMergeAuthorityAuthCheck?: boolean;
    };
};
declare class CoreModule$1 extends AppModule {
    static readonly dependsOn: readonly [];
    static readonly config?: CoreModuleConfig;
    name: string;
    constructor(args: {
        config?: CoreModuleConfig;
    });
    get providers(): (CoreDataProvider | CoreUtilsProvider)[];
}

interface HttpClientFactoryConfig {
    apiUrl: string;
    errorHandlingStrategy?: ErrorHandlingStrategy;
}
declare class HttpClientFactory {
    static create(config: HttpClientFactoryConfig): HttpClient;
}

declare class BrowserSessionStorage {
    private storage;
    constructor(options?: {
        secure?: boolean;
        secretKey?: string;
    });
    removeItem(path: string): Promise<void>;
    getItem<T = any>(path: string): Promise<T | null>;
    setItem(path: string, data: any): Promise<void>;
    clean(root?: string): Promise<void>;
    searchItem<T = any>(root: string, callback: (item: T) => boolean): Promise<T | undefined>;
    searchItems<T = any>(root: string, callback: (item: T) => boolean): Promise<T[]>;
    multiRemove(root: string, keys: string[]): Promise<void>;
}

declare class BrowserLocalStorage {
    private storage;
    constructor(options?: {
        secure?: boolean;
        secretKey?: string;
    });
    removeItem(path: string): void;
    getItem<T = any>(path: string): T | null;
    setItem(path: string, data: any): void;
    clean(root: string): void;
    searchItem<T = any>(root: string, callback: (item: T) => boolean): T | undefined;
    searchItems<T = any>(root: string, callback: (item: T) => boolean): T[];
    multiRemove(root: string, keys: string[]): void;
    /**
     * Get all localStorage keys, optionally filtered by a root string
     * @param root - Optional root string to filter keys. If provided, only keys containing this string will be returned
     * @returns Array of localStorage keys
     */
    getAllKeys(root?: string): string[];
}

declare const SECURE_SESSION_INDEXED_DB_NAME = "inheriti_secure_session_data";
declare const SECURE_SESSION_INDEXED_DB_VERSION = 2;
declare const SECURE_SESSION_INDEXED_DB_STORES: {
    readonly mediaPayloads: "media_payloads";
    readonly configurationProcessPayloads: "configuration_process_payloads";
};
interface SecureSessionIndexedDbStoreDefinition {
    name: string;
    keyPath?: string;
    indexes?: Array<{
        name: string;
        keyPath: string;
        unique?: boolean;
    }>;
}
declare function openSecureSessionIndexedDb(stores?: SecureSessionIndexedDbStoreDefinition[]): Promise<IDBDatabase | null>;

declare function createContext<T = any>(initialData: any): {
    Context: React.Context<any>;
    Provider: ({ children, value }: {
        children: React.ReactNode;
        value: T;
    }) => react_jsx_runtime.JSX.Element;
    useContextSelector: <T_1 = any, K = any>(selector: (s: T_1) => K) => any;
};
declare function createContextWithStore<T>(): {
    Provider: ({ children, createStore, }: {
        children: React.ReactNode;
        createStore: (set: StoreApi<T>["setState"], get: StoreApi<T>["getState"], api: StoreApi<T>) => T;
    }) => react_jsx_runtime.JSX.Element;
    useStore: (selector?: any) => any;
    Context: React.Context<any>;
};
declare function useContextSelector<T = any, K = any>(context: any, selector: (s: T) => K): any;

declare function useSafeSetState<T>(initialState?: T): [T, Dispatch<SetStateAction<T>>];

declare function useService<T>(serviceName: string): T;

declare function useRepository<T>(repoName: string): T;

declare const DateTimeUtils: {
    differenceInMinutes: (a: Date, b: Date) => number;
    differenceInSeconds: (a: Date, b: Date) => number;
    format: (date: Date, formatStr: string, utc?: boolean) => string;
};

type JSONObject = Record<string, any>;
declare const ObjectUtils: {
    get: <T = any>(obj: JSONObject, path: string, defaultValue?: T) => T | undefined;
    isNull: (val: any) => val is null;
    isEmpty: (val: any) => boolean;
    omit: typeof omit;
    mapValues: typeof mapValues;
    omitUnknown: (object: JSONObject) => JSONObject;
    omitBy: typeof omitBy;
    pick: typeof pick;
    merge: (...objects: JSONObject[]) => JSONObject;
    compress: (json: JSONObject, keys: string[]) => any[];
    decompress: (compressedArray: any[], keys: string[]) => JSONObject;
};

declare const UuidUtils: {
    generate(): string;
    code(length?: number, includeLetters?: boolean): string;
    validate(id: string): boolean;
};

declare const TextUtils: {
    truncate(text: string, max: number): string;
    insertAt(str: string | undefined, sub: any, pos: any): string;
    capitalize(str: string): string;
    generateFakeBlockchainAddress(): string;
};

interface AppUtils {
    uuid: typeof UuidUtils;
    object: typeof ObjectUtils;
    date: typeof DateTimeUtils;
    text: typeof TextUtils;
}

declare function useUtils(): AppUtils;

declare function getErrorMessage(error: any): string | undefined;

declare function getErrorDescription(error: any): string | undefined;

declare function useModule<T extends AppModule>(moduleName: string): T;

interface DebugServiceConfig {
    enabled: boolean;
    methods?: string[];
}
interface DebugModuleConfig {
    enabled: boolean;
    services?: Record<string, DebugServiceConfig>;
}
interface DebugConfiguration {
    modules?: Record<string, DebugModuleConfig>;
    globalEnabled?: boolean;
}
interface DebugLogEntry {
    timestamp: string;
    level: "call" | "return" | "error";
    module: string;
    service: string;
    method: string;
    args?: any[];
    result?: any;
    error?: any;
}
interface DebugServiceOptions {
    enableConsoleLogging?: boolean;
    enableLogCollection?: boolean;
    logRetentionLimit?: number;
    customLogger?: (entry: DebugLogEntry) => void;
    safeMode?: boolean;
}
declare class DebugService {
    private config;
    private options;
    private logs;
    private wrappedInstances;
    constructor(options?: DebugServiceOptions);
    static createConfig(): DebugConfigBuilder;
    configure(config: DebugConfiguration): void;
    enableModule(moduleName: string): this;
    enableService(moduleName: string, serviceName: string, methods?: string[]): this;
    disableModule(moduleName: string): this;
    disableService(moduleName: string, serviceName: string): this;
    shouldDebugModule(moduleName: string): boolean;
    shouldDebugService(moduleName: string, serviceName: string): boolean;
    getMethodsToDebug(moduleName: string, serviceName: string): string[] | undefined;
    wrapService<T extends object>(instance: T, moduleName: string, serviceName: string, serviceType?: string): T;
    getLogs(): DebugLogEntry[];
    getFilteredLogs(filter: {
        module?: string;
        service?: string;
        method?: string;
        level?: DebugLogEntry["level"];
        since?: Date;
    }): DebugLogEntry[];
    clearLogs(): void;
    getStats(): {
        totalLogs: number;
        callCount: number;
        errorCount: number;
        moduleStats: Record<string, number>;
        serviceStats: Record<string, number>;
    };
    exportLogs(): string;
    importLogs(jsonLogs: string): void;
    private handleCall;
    private handleReturn;
    private handleError;
    private logEntry;
}
declare class DebugConfigBuilder {
    private config;
    globalEnable(): this;
    globalDisable(): this;
    module(moduleName: string): ModuleConfigBuilder;
    build(): DebugConfiguration;
}
declare class ModuleConfigBuilder {
    private parent;
    private moduleName;
    constructor(parent: DebugConfigBuilder, moduleName: string);
    service(serviceName: string, methods?: string[]): this;
    module(moduleName: string): ModuleConfigBuilder;
    build(): DebugConfiguration;
}

declare function useServiceDebugger(): DebugService | undefined;

interface CoreProviderProps {
    children: ReactNode;
    modules: Record<string, AppModule>;
    moduleConfigs?: Record<string, Record<string, any>>;
    debugMode?: boolean;
    debugConfig?: DebugConfiguration;
    debugOptions?: DebugServiceOptions;
}
declare function CoreProvider({ children, modules, moduleConfigs, debugMode, debugConfig, debugOptions, }: CoreProviderProps): any;

declare function useCreate<Repository, NewInstanceData extends object | undefined, T = any>(props: {
    resource: string;
    repository: string;
    fn: (repo: Repository, newItem: NewInstanceData) => Promise<any>;
    onSuccess?: (response: any, queryClient: QueryClient, params: any) => void;
    onFailure?: (error: any) => void;
    options?: {
        refetchList?: boolean;
    };
}): {
    save: (newInstanceData?: NewInstanceData) => Promise<T>;
    reset: () => any;
    loading: boolean;
    loaded: boolean;
    data: any;
    error: any;
};

declare function useDelete<Model, Repository>(props: {
    resource: string;
    repository: string;
    fn: (repo: Repository, id: string) => Promise<void>;
    onSuccess?: (response: any, queryClient: QueryClient, params: any) => void;
    onFailure?: (error: any) => void;
    options?: {
        refetchList?: boolean;
    };
}): {
    delete: (id: string, additionalParams?: any) => Promise<void>;
    reset: () => any;
    loading: boolean;
    loaded: boolean;
    data: null;
    error: any;
};

declare function useUpdate<Model, Repository>(props: {
    resource: string;
    repository: string;
    fn: (repo: Repository, id: string, changes: Model) => Promise<void>;
    onSuccess?: (response: any, queryClient: QueryClient, params: any) => void;
    onFailure?: (error: any) => void;
    options?: {
        refetchList?: boolean;
        refetchGet?: boolean;
    };
}): {
    save: (id: string, changes: Model) => Promise<any>;
    reset: () => any;
    loading: boolean;
    loaded: boolean;
    data: null;
    error: any;
};

interface PaginationOptions {
    page?: number;
    perPage?: number;
}

interface QueryOptions {
    keepPreviousData?: boolean;
    enabled?: boolean;
    cacheTime?: number;
    staleTime?: number;
}

type ResourceCount = {
    count: number;
};

interface SortOptions {
    field?: string;
    order?: string;
}

interface UseQueryValue<T = any> {
    data?: T;
    total?: number;
    error?: any;
    isIdle: boolean;
    loading: boolean;
    loaded: boolean;
    refetch: any;
    isFetching: boolean;
    isRefetching: boolean;
}

type ResponseQueryValue$1<Model> = Omit<UseQueryValue, 'data' | 'isIdle'> & {
    data?: {
        [id: string]: Model;
    };
    isIdle?: boolean;
    ids?: string[];
};
interface UseGetListValue<T> extends ResponseQueryValue$1<T> {
}
declare function useGetList<Model, Repository>(props: {
    resource: string;
    repository: string;
    filters?: any;
    pagination?: PaginationOptions;
    sort?: SortOptions;
    fn: (repo: Repository, filters?: any, pagination?: PaginationOptions, sort?: SortOptions) => Promise<Model[]>;
    countFn?: (repo: Repository, filters?: any) => Promise<ResourceCount>;
    options?: QueryOptions;
}): UseGetListValue<Model>;

type ResponseQueryValue = Omit<UseQueryValue, 'data'> & {
    data?: ResourceCount;
};
declare function useGetCount<Repository>(props: {
    resource: string;
    repository: string;
    filters?: any;
    fn: (repo: Repository, filters?: any) => Promise<ResourceCount>;
    onFailure?: any;
    options?: QueryOptions;
}): ResponseQueryValue;

declare function useGetOne<Model, Repository>(props: {
    resource: string;
    repository: string;
    id: string;
    fn: (repo: Repository, id: string) => Promise<Model | undefined>;
    options?: QueryOptions;
}): {
    error?: any;
    isIdle: boolean;
    loading: boolean;
    loaded: boolean;
    refetch: any;
    isFetching: boolean;
    isRefetching: boolean;
    data?: Model | undefined;
};

interface APIRepositoryProps {
    httpClient: HttpClient;
    httpClientKey?: string;
}
interface RequestOptions {
}
declare abstract class APIRepository {
    protected readonly props: APIRepositoryProps;
    protected httpClient: HttpClient;
    constructor(props: APIRepositoryProps);
    findByCriteriaRequest<T>(resource: string, filter?: any, pagination?: PaginationOptions, sort?: SortOptions, withAuth?: boolean, options?: RequestOptions): Promise<T[]>;
    countRequest<T>(resource: string, where?: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    findOneById<T>(resource: string, id: string, withAuth?: boolean, options?: RequestOptions): Promise<T | undefined>;
    create<T>(resource: string, data: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    updateById<T>(resource: string, id: string, changes: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    deleteById<T>(resource: string, id: string, withAuth?: boolean, options?: RequestOptions): Promise<void>;
    get<T>(path: string, withAuth?: boolean, options?: RequestOptions): Promise<T>;
    post<T>(path: string, data: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    patch<T>(resource: string, changes: any, withAuth?: boolean, options?: RequestOptions): Promise<any>;
    getClientApiUrl(path: string): string;
    private getRequestOptions;
}

interface Query {
    id: string;
    type: string;
    payload: object;
}

declare function useQuery<P = void, R = void>(query: Query, fn: (params: P) => any, options?: QueryOptions): {
    error?: any;
    isIdle: boolean;
    loading: boolean;
    loaded: boolean;
    refetch: any;
    isFetching: boolean;
    isRefetching: boolean;
    data?: R | undefined;
};

interface Mutation {
    id: string;
    type: string;
    payload: object;
}

interface MutationOptions {
    action?: string;
    undoable?: boolean;
    onSuccess?: (response: any, queryClient: QueryClient, params: any) => any | Object;
    onFailure?: (error?: any) => any | Object;
    withDeclarativeSideEffectsSupport?: boolean;
}

declare function useMutate<T = void>(mutation: Mutation, fn: (params: T) => any, options?: MutationOptions): {
    execute<Z = any>(payload: T): Promise<Z>;
    reset: () => any;
    loading: boolean;
    loaded: boolean;
    data: any;
    error: any;
};

interface FilterOptions {
    [k: string]: any;
}

type UseMutationValue<T = any> = [
    (query?: Partial<Mutation>, options?: Partial<MutationOptions>) => any,
    {
        data?: T;
        total?: number;
        error?: any;
        loading: boolean;
        loaded: boolean;
        reset: () => any;
    }
];

interface MutationCreator {
    execute<T = any>(query: Mutation, queryFn: (...args: any[]) => Promise<T>, options?: MutationOptions): UseMutationValue<T>;
}

interface QueryCreator {
    execute(query: Query, queryFn: any, options: QueryOptions): UseQueryValue;
}

declare function setWhere(url: URL, filter: any, initKey?: string): void;

declare const ArrayUtils: {
    groupBy: typeof groupBy;
    orderBy: <T>(array: T[], key: keyof T, direction?: "asc" | "desc") => T[];
    isArray: (arg: any) => arg is any[];
    filter: <T>(arr: T[], fn: (item: T) => boolean) => T[];
    find: <T>(arr: T[], fn: (item: T) => boolean) => T | undefined;
    differenceWith: <T>(arr1: T[], arr2: T[], comparator: (a: T, b: T) => boolean) => T[];
    combine: <T = any>(arr1: T[], arr2: T[]) => T[];
    xor: <T>(arr1: T[], arr2: T[]) => T[];
    replaceByKey: <T = any>(arr: T[], newValue: T, keyName: keyof T) => T[];
    replaceWhere: <T = any>(arr: T[], condition: (params: T) => boolean, newValue: T) => T[];
    toggleAdd: <T = any>(array: T[], element: T, predicate: (item: T) => any) => T[];
    keyBy<T, K extends keyof T>(array: T[], key: K): Record<string, T>;
    uniq: <T>(array: T[]) => T[];
    uniqBy<T, K>(array: T[], keyFn: (item: T) => K): T[];
    findIndex: typeof findIndex;
    concat: <T = any>(array: T[], ...rest: T[][]) => T[];
    filterLike: (arr1: any[], fieldName: string, like: string) => any[];
};

declare const NumberUtils: {
    format: (value: number, formatString: string) => string;
};

declare const EncryptUtils: {
    createPassphrase(length?: number): string;
    generateKey(passphrase: string): Promise<{
        publicKeyArmored: string;
        privateKeyArmored: string;
    }>;
    asymmetricEncrypt(data: string, publicKeyArmored: string, privateKeyArmored: string, passphrase: string): Promise<string>;
    symmetricEncrypt(data: string, passphrase: string): Promise<string>;
    decryptPrivateKey({ privateKeyArmored, passphrase }: {
        privateKeyArmored: any;
        passphrase: any;
    }): Promise<openpgp.PrivateKey>;
    keyToBase64(key: string, passphrase: string): Promise<string>;
    keyFromBase64(base64D: string, passphrase: string): Promise<openpgp.PrivateKey>;
};

declare const defaultErrorHandlingStrategy: ErrorHandlingStrategy;

declare class SocketIoEventListener {
    readonly socket: Socket;
    constructor(props: {
        url: string;
    });
    connect(): void;
    disconnect(): void;
    reconnect(): void;
}
declare function getSocketInstance(url: string): SocketIoEventListener;
declare function reconnectSocketInstance(url: string): SocketIoEventListener;

declare class CoreModule extends CoreModule$1 {
    get providers(): (CoreDataProvider | CoreUtilsProvider | CoreServiceProvider)[];
}

declare class AuthServiceProvider implements AppProvider {
    private core;
    private module;
    constructor(core: AppModule, module: AuthModule);
    get type(): "service";
    services(): Record<string, InstanceType<any>>;
}

type ValidEnv = 'local' | 'development' | 'staging' | 'production';
type AuthClientProps = {
    key: string;
    options?: {
        env: ValidEnv;
    };
};
type AuthModuleConfig = {
    onLoginSuccessCallback?: () => void;
    onSessionRestored?: () => void;
    routes: {
        login: string;
        logout: string;
        profile: string;
    };
};
declare class AuthModule extends AppModule {
    private args;
    static readonly dependsOn: readonly ["core"];
    name: string;
    constructor(args: {
        deps: {
            core: AppModule;
        };
        config?: AuthModuleConfig;
    });
    get providers(): AuthServiceProvider[];
}

type AuthState = {
    isLoggedIn: boolean;
    client?: AuthClientProps;
    userData?: any;
};

interface AuthStateManager {
    getState(): AuthState;
    setState(patch: Partial<AuthState>): void;
    subscribe(listener: (state: AuthState) => void): () => void;
}

interface UserIdentityProfile {
    id: string;
    email: string;
    firstName: string;
    lastName: string;
    profilePictureUrl?: string;
    code: string;
    createdAt: Date;
}
interface UserIdentityProps {
    profile?: UserIdentityProfile;
}
interface UserIdentityPrimitiveProps extends UserIdentityProps {
}
declare class UserIdentity {
    private props;
    constructor(props: UserIdentityProps);
    get id(): string | undefined;
    get code(): string | undefined;
    get createdAt(): Date | undefined;
    get firstName(): string | undefined;
    get lastName(): string | undefined;
    get profilePictureUrl(): string | undefined;
    get fullName(): string;
    get email(): string | undefined;
    static fromPrimitives(props: UserIdentityPrimitiveProps): UserIdentity;
    toPrimitives(): UserIdentityPrimitiveProps;
}

interface AuthenticationSessionManager {
    login(client: AuthClientProps): Promise<any>;
    logout(params?: any): Promise<void | false | string>;
    checkSession(): Promise<boolean>;
    getIdentity(): Promise<UserIdentity | null>;
}

declare class AuthClientUseCase {
    private stateManager;
    private sessionManager;
    constructor(stateManager: AuthStateManager, sessionManager: AuthenticationSessionManager);
    getState(): AuthState;
    subscribe(listener: (state: AuthState) => void): () => void;
    /** Checks the current session and signs in if active. Call once during app init. */
    init(): Promise<void>;
    login(client: AuthClientProps): Promise<void>;
    logout(): Promise<void>;
    getIdentity(): Promise<UserIdentity | null>;
}

declare function useClient(): {
    client: AuthClientProps | undefined;
    isConnected: boolean;
    connect: (params: AuthClientProps) => Promise<void>;
    disconnect: () => Promise<void>;
    loading: boolean;
};

declare function useAuthState(): AuthState;
declare function useAuthState<T>(selector: (s: AuthState) => T): T;

declare function useIsLoggedIn(): {
    isLoggedIn: boolean;
};

interface GetIdentityState {
    loading: boolean;
    loaded: boolean;
    identity?: UserIdentity;
    error?: any;
}
declare function useGetIdentity(): GetIdentityState;

declare function useInitAuthSession(): {
    sessionChecked: boolean;
};

interface AuthStateProviderProps {
    children: ReactNode;
}
/**
 * Legacy wrapper — the auth state store is now initialized by AuthModule in the DI container.
 * This component is kept for backward compatibility and simply renders its children.
 * For session restoration on mount, use AuthSessionRestorer instead.
 */
declare function AuthStateProvider({ children }: AuthStateProviderProps): react_jsx_runtime.JSX.Element;

interface AuthSessionRestorerProps {
    children: ReactNode;
    fallback?: ReactNode;
}
declare function AuthSessionRestorer({ children, fallback }: AuthSessionRestorerProps): react_jsx_runtime.JSX.Element;

/**
 * Union of all supported secret types that can be stored in a data asset.
 */
type SecretData = PlainTextAsset | UserAndPasswordAsset | RecoveryCodeAsset | PINCodeAsset | ApiKeyAsset | PrivateKeyAsset | SeedPhraseAsset | PaymentDebitCardAsset | PaymentCreditCardAsset | MediaAsset;
/**
 * Enumerates all possible asset types.
 */
type DataAssetType = 'PLAIN-TEXT' | 'ONLINE-ACCOUNT' | 'RECOVERY-CODE' | 'PIN-CODE' | 'API-KEY' | 'PRIVATE-KEY' | 'SEED-PHRASE' | 'PAYMENT-DEBIT-CARD' | 'PAYMENT-CREDIT-CARD' | 'DOCUMENT' | 'IMAGE' | 'VIDEO' | 'PDF';
/**
 * A secure, named asset that contains sensitive information such as passwords, keys, or account details.
 */
type DataAsset = {
    /**
     * Unique identifier of the asset.
     */
    id: string;
    /**
     * The type of secret stored. Used to determine how to parse and display the `secret` field.
     */
    type: DataAssetType;
    /**
     * Metadata describing the asset (e.g., name, notes).
     */
    meta: {
        /**
         * Display name for the asset.
         */
        name: string;
        /**
         * Optional notes or context for the asset.
         */
        notes?: string;
        /**
         * MIME type of the asset content (e.g. "application/pdf", "video/mp4").
         * Required when isMedia is true.
         */
        mimeType?: string;
        /**
         * True for binary media assets (DOCUMENT, IMAGE, VIDEO). When true, mimeType must be provided.
         * Used to correctly encode/decode the secret data during share generation and revelation.
         */
        isMedia?: boolean;
    };
    /**
     * The actual sensitive data, varying by asset type.
     */
    secret: SecretData;
};
/**
 * A simple plain text asset.
 */
type PlainTextAsset = {
    text: string;
};
/**
 * Credentials for logging into an app or website.
 */
type UserAndPasswordAsset = {
    appOrWebsite: string;
    email: string;
    username?: string;
    password: string;
};
/**
 * Backup recovery code for 2FA apps or websites.
 */
type RecoveryCodeAsset = {
    appOrWebsite: string;
    code: string;
};
/**
 * PIN code for a device or app.
 */
type PINCodeAsset = {
    deviceOrApp: string;
    code: string;
};
/**
 * API key for external services or apps.
 */
type ApiKeyAsset = {
    app: string;
    apiKey: string;
};
/**
 * Cryptocurrency private key and its associated public address.
 */
type PrivateKeyAsset = {
    publicAddress: string;
    privateKey: string;
};
/**
 * A seed phrase (mnemonic words) used to recover a crypto wallet.
 */
type SeedPhraseAsset = {
    words: string[];
};
/**
 * Sensitive information related to a debit card.
 */
type PaymentDebitCardAsset = {
    cardNumber: string;
    bank?: string;
    accountNumber?: string;
    cardHolderName?: string;
    expiryDate?: string;
    pinCode?: string;
    code?: string;
    clientId?: string;
};
/**
 * Sensitive information related to a credit card.
 */
type PaymentCreditCardAsset = {
    cardNumber: string;
    bank?: string;
    accountNumber?: string;
    cardHolderName?: string;
    expiryDate?: string;
    pinCode?: string;
    code?: string;
    clientId?: string;
};
/**
 * A binary media asset (document, image, or video file).
 *
 * When creating/sharing: `data` is a base64-encoded string.
 * When revealed via parseAssets({ denormalize: true }): `data` is a Blob with the correct MIME type.
 *
 * `mimeType` is stored inside the secret so it survives the SSDP+ round-trip
 * and is available during reconstruction without any extra metadata lookup.
 */
type MediaAsset = {
    /** Base64-encoded string (stored/shared) or a reconstructed Blob (after reveal). */
    data: string | Blob;
    /** MIME type of the content, e.g. "application/pdf" or "video/mp4". */
    mimeType: string;
};

declare class DataAssetManager {
    constructor();
    parseAssets(secrets: string, metadata: any, options?: {
        denormalize?: boolean;
    }): DataAsset[] | null;
    secrets(assets: DataAsset[]): ({
        text: string;
        id: string;
        type: DataAssetType;
    } | {
        appOrWebsite: string;
        email: string;
        username?: string;
        password: string;
        id: string;
        type: DataAssetType;
    } | {
        appOrWebsite: string;
        code: string;
        id: string;
        type: DataAssetType;
    } | {
        deviceOrApp: string;
        code: string;
        id: string;
        type: DataAssetType;
    } | {
        app: string;
        apiKey: string;
        id: string;
        type: DataAssetType;
    } | {
        publicAddress: string;
        privateKey: string;
        id: string;
        type: DataAssetType;
    } | {
        words: string[];
        id: string;
        type: DataAssetType;
    } | {
        cardNumber: string;
        bank?: string;
        accountNumber?: string;
        cardHolderName?: string;
        expiryDate?: string;
        pinCode?: string;
        code?: string;
        clientId?: string;
        id: string;
        type: DataAssetType;
    } | {
        cardNumber: string;
        bank?: string;
        accountNumber?: string;
        cardHolderName?: string;
        expiryDate?: string;
        pinCode?: string;
        code?: string;
        clientId?: string;
        id: string;
        type: DataAssetType;
    } | {
        data: string | Blob;
        mimeType: string;
        id: string;
        type: DataAssetType;
    })[];
    metadata(assets: DataAsset[]): {};
    toHex(assetsSecret: any[]): string;
    compress(assets: DataAsset[]): void;
    sanitizeAssetsValues(values: any): any[];
    private sanitizeValues;
    private base64ToBlob;
    private parseSecrets;
}

declare class DataAssetInputValidator {
    static validateOne(input: unknown): DataAsset;
    static safeValidateOne(input: unknown): {
        success: true;
        data: DataAsset;
    } | {
        success: false;
        errors: string[];
    };
    static validate(input: unknown): DataAsset[];
    static safeValidate(input: unknown): {
        success: true;
        data: DataAsset[];
    } | {
        success: false;
        errors: string[];
    };
}

type DataAssetMediaType = 'DOCUMENT' | 'IMAGE' | 'VIDEO';
type MagicFormat = 'PDF' | 'XLSX' | 'CSV' | 'JPEG' | 'PNG' | 'WEBP' | 'MP4' | 'MOV' | 'WEBM' | 'UNKNOWN';
type MediaFileLike = Blob & {
    name?: string;
    type?: string;
};
interface ValidateDataAssetMediaFileInput {
    assetType: DataAssetMediaType;
    file: MediaFileLike;
    maxSizeInBytes: number;
}
interface ValidatedDataAssetMediaFile {
    assetType: DataAssetMediaType;
    extension: string;
    mimeType: string;
    size: number;
    detectedFormat: Exclude<MagicFormat, 'UNKNOWN'>;
}
type ValidationSuccess = {
    success: true;
    data: ValidatedDataAssetMediaFile;
};
type ValidationFailure = {
    success: false;
    errors: string[];
};
declare class DataAssetMediaFileValidator {
    static safeValidate(input: ValidateDataAssetMediaFileInput): Promise<ValidationSuccess | ValidationFailure>;
    static validate(input: ValidateDataAssetMediaFileInput): Promise<ValidatedDataAssetMediaFile>;
}
declare function validateDataAssetMediaFile(input: ValidateDataAssetMediaFileInput): Promise<ValidatedDataAssetMediaFile>;

interface DataAssetShareProps {
    id?: string;
    name: string;
    notes?: string;
}
declare class DataAssetBuilder {
    static plainText(props: {
        secret: PlainTextAsset;
    } & Omit<DataAssetShareProps, 'notes'>): DataAsset;
    static userAndPassword(props: {
        secret: UserAndPasswordAsset;
    } & DataAssetShareProps): DataAsset;
    static recoveryCode(props: {
        secret: RecoveryCodeAsset;
    } & DataAssetShareProps): DataAsset;
    static pinCode(props: {
        secret: PINCodeAsset;
    } & DataAssetShareProps): DataAsset;
    static apiKey(props: {
        secret: ApiKeyAsset;
    } & DataAssetShareProps): DataAsset;
    static privateKey(props: {
        secret: PrivateKeyAsset;
    } & DataAssetShareProps): DataAsset;
    static seedPhrase(props: {
        secret: SeedPhraseAsset;
    } & DataAssetShareProps): DataAsset;
    static paymentDebitCard(props: {
        secret: PaymentDebitCardAsset;
    } & DataAssetShareProps): DataAsset;
    static paymentCreditCard(props: {
        secret: PaymentCreditCardAsset;
    } & DataAssetShareProps): DataAsset;
}

/**
 * The category a data asset belongs to.
 */
type DataAssetCategoryId = 'GENERAL-DATA' | 'ONLINE-ACCOUNT' | 'DEV-KEYS-SECRETS' | 'CRYPTO-WALLETS' | 'PAYMENT-CARD' | 'MEDIA-FILES';
/**
 * Core (static) definition of a data asset type.
 * Does not include UI-specific concerns like translated name/description
 * or form/previewer components — those are injected by the consumer via resolve().
 */
interface DataAssetCoreDef {
    /** Asset type identifier (e.g. 'PLAIN-TEXT', 'USER-PSWD'). */
    id: string;
    /** Short code abbreviation (e.g. 'PTXT'). */
    code: string;
    /** Category this asset belongs to. */
    category: DataAssetCategoryId;
    /** FontAwesome icon name (kebab-case). */
    iconName: string;
    /** Secret field names relevant to this asset type. */
    fields: string[];
    /** Whether this asset type requires a full plan subscription. */
    requiresFullPlan: boolean;
}
/**
 * Core (static) definition of a data asset category.
 * The name is intentionally omitted — supply it via resolveCategories().
 */
interface DataAssetCategoryCoreDef {
    /** Category identifier. */
    id: DataAssetCategoryId;
    /** Display order (ascending). */
    order: number;
    /** FontAwesome icon name (kebab-case). */
    iconName: string;
}
/**
 * Provides the canonical list of data asset type and category definitions.
 *
 * Core definitions hold structural metadata only (id, code, category, icon, fields).
 * UI-specific concerns — translated name/description, Form, Previewer — are injected
 * by the consumer via resolve() / resolveCategories(), keeping the SDK decoupled from
 * any i18n or UI framework.
 *
 * @example
 * ```typescript
 * const service = new DataAssetDefinitionService();
 *
 * const assets = service.resolve(def => ({
 *     name: translate(`assets.${def.id}.name`),
 *     description: translate(`assets.${def.id}.description`),
 *     Form: formMap[def.id],
 *     Previewer: previewerMap[def.id],
 * }));
 *
 * const categories = service.resolveCategories(cat => ({
 *     name: translate(`categories.${cat.id}.name`),
 * }));
 * ```
 */
declare class DataAssetDefinitionService {
    /** Returns all core asset definitions without any consumer extensions. */
    getCoreDefinitions(): DataAssetCoreDef[];
    /** Returns all core category definitions without any consumer extensions. */
    getCoreCategories(): DataAssetCategoryCoreDef[];
    /**
     * Returns all asset definitions merged with the result of the resolver callback.
     * Use this to attach translated name/description, Form, Previewer, or any other
     * UI-layer properties without coupling the SDK to a specific framework.
     *
     * @param resolver Called once per definition; its return value is spread onto the def.
     */
    resolve<TExtra>(resolver: (def: DataAssetCoreDef) => TExtra): (DataAssetCoreDef & TExtra)[];
    /**
     * Returns all category definitions merged with the result of the resolver callback.
     * Use this to attach a translated name (or any other UI-layer property) per category.
     *
     * @param resolver Called once per category; its return value is spread onto the def.
     */
    resolveCategories<TExtra>(resolver: (def: DataAssetCategoryCoreDef) => TExtra): (DataAssetCategoryCoreDef & TExtra)[];
}

export { APIRepository, AppModule, ArrayUtils, AuthClientUseCase, AuthModule, AuthSessionRestorer, AuthStateProvider, BrowserLocalStorage, BrowserSessionStorage, CoreModule, CoreProvider, DataAssetBuilder, DataAssetDefinitionService, DataAssetInputValidator, DataAssetManager, DataAssetMediaFileValidator, DateTimeUtils, EncryptUtils, HttpClient, HttpClientFactory, HttpError, NumberUtils, ObjectUtils, SECURE_SESSION_INDEXED_DB_NAME, SECURE_SESSION_INDEXED_DB_STORES, SECURE_SESSION_INDEXED_DB_VERSION, TextUtils, UuidUtils, createContext, createContextWithStore, defaultErrorHandlingStrategy, getErrorDescription, getErrorMessage, getSocketInstance, openSecureSessionIndexedDb, reconnectSocketInstance, setWhere, useAuthState, useClient, useContextSelector, useCreate, useDelete, useGetCount, useGetIdentity, useGetList, useGetOne, useInitAuthSession, useIsLoggedIn, useModule, useMutate, useQuery, useRepository, useSafeSetState, useService, useServiceDebugger, useUpdate, useUtils, validateDataAssetMediaFile };
export type { APIRepositoryProps, ApiKeyAsset, AppProvider, AppProviderServices, AuthClientProps, AuthModuleConfig, AuthState, CoreModuleConfig, DataAsset, DataAssetCategoryCoreDef, DataAssetCategoryId, DataAssetCoreDef, DataAssetMediaType, DataAssetShareProps, DataAssetType, ErrorHandlingStrategy, FilterOptions, GetIdentityState, HttpErrorDetails, MediaAsset, Mutation, MutationCreator, MutationOptions, PINCodeAsset, PaginationOptions, PaymentCreditCardAsset, PaymentDebitCardAsset, PlainTextAsset, PrivateKeyAsset, Query, QueryCreator, QueryOptions, RecoveryCodeAsset, ResourceCount, SecretData, SeedPhraseAsset, SortOptions, UseGetListValue, UseQueryValue, UserAndPasswordAsset, ValidEnv, ValidateDataAssetMediaFileInput, ValidatedDataAssetMediaFile };
