import { SVGProps, ReactNode, Ref } from 'react';

declare const STATUS: {
    readonly IDLE: "idle";
    readonly LOADING: "loading";
    readonly LOADED: "loaded";
    readonly FAILED: "failed";
    readonly READY: "ready";
    readonly UNSUPPORTED: "unsupported";
};

/**
 * Called when loading the SVG fails.
 */
type ErrorCallback = (error: Error | FetchError) => void;
/**
 * Called when the SVG loads successfully.
 */
type LoadCallback = (src: string, isCached: boolean) => void;
/**
 * Pre-processes the SVG string before parsing.
 * Must return a string.
 */
type PreProcessorCallback = (code: string) => string;
type Props = Simplify<Omit<SVGProps<SVGElement>, 'onLoad' | 'onError' | 'ref'> & {
    /**
     * A URL to prepend to url() references inside the SVG when using `uniquifyIDs`.
     * Only required if your page uses an HTML `<base>` tag.
     */
    baseURL?: string;
    /**
     * Cache remote SVGs in memory.
     *
     * When used with the CacheProvider, requests are also persisted in the browser cache.
     * @default true
     */
    cacheRequests?: boolean;
    /**
     * Fallback content rendered on fetch error or unsupported browser.
     */
    children?: ReactNode;
    /**
     * A description for the SVG.
     * Overrides an existing `<desc>` tag.
     */
    description?: string;
    /**
     * Custom options for the fetch request.
     */
    fetchOptions?: RequestInit;
    /**
     * A ref to the rendered SVG element.
     * Not available on initial render — use `onLoad` instead.
     */
    innerRef?: Ref<SVGElement | null>;
    /**
     * A component shown while the SVG is loading.
     */
    loader?: ReactNode;
    /**
     * Called when loading the SVG fails.
     * Receives an `Error` or `FetchError`.
     */
    onError?: ErrorCallback;
    /**
     * Called when the SVG loads successfully.
     * Receives the `src` and an `isCached` flag.
     */
    onLoad?: LoadCallback;
    /**
     * A function to pre-process the SVG string before parsing.
     * Must return a string.
     */
    preProcessor?: PreProcessorCallback;
    /**
     * The SVG to load.
     * Accepts a URL or path, a data URI (base64 or URL-encoded), or a raw SVG string.
     */
    src: string;
    /**
     * A title for the SVG. Overrides an existing `<title>` tag.
     * Pass `null` to remove it.
     */
    title?: string | null;
    /**
     * A string to use with `uniquifyIDs`.
     * @default random 8-character alphanumeric string
     */
    uniqueHash?: string;
    /**
     * Create unique IDs for each icon.
     * @default false
     */
    uniquifyIDs?: boolean;
}>;
type Simplify<T> = {
    [KeyType in keyof T]: T[KeyType];
} & {};
type Status = (typeof STATUS)[keyof typeof STATUS];
interface FetchError extends Error {
    code: string;
    errno: string;
    message: string;
    type: string;
}
interface State {
    content: string;
    element: ReactNode;
    isCached: boolean;
    status: Status;
}
interface StorageItem {
    content: string;
    status: Status;
}

interface CacheStoreOptions {
    name?: string;
    persistent?: boolean;
}
declare class CacheStore {
    private cacheApi;
    private readonly cacheStore;
    private readonly subscribers;
    isReady: boolean;
    constructor(options?: CacheStoreOptions);
    onReady(callback: () => void): () => void;
    private waitForReady;
    get(url: string, fetchOptions?: RequestInit): Promise<string>;
    getContent(url: string): string;
    set(url: string, data: StorageItem): void;
    isCached(url: string): boolean;
    private fetchAndCache;
    private fetchFromPersistentCache;
    private handleLoading;
    keys(): Array<string>;
    data(): Array<Record<string, StorageItem>>;
    delete(url: string): Promise<void>;
    clear(): Promise<void>;
}

export { CacheStore as C, type ErrorCallback as E, type FetchError as F, type LoadCallback as L, type Props as P, type Simplify as S, type PreProcessorCallback as a, type State as b, type Status as c, type StorageItem as d };
