import { type PathLike } from 'fs';
export interface RenderedContent {
    html: string;
    metadata?: {
        imagePaths: Array<string>;
        [key: string]: unknown;
    };
}
export interface DataEntry<TData extends Record<string, unknown> = Record<string, unknown>> {
    id: string;
    data: TData;
    filePath?: string;
    body?: string;
    digest?: number | string;
    rendered?: RenderedContent;
}
export declare class DataStore {
    #private;
    constructor();
    get<T = unknown>(collectionName: string, key: string): T | undefined;
    entries<T = unknown>(collectionName: string): Array<[id: string, T]>;
    values<T = unknown>(collectionName: string): Array<T>;
    keys(collectionName: string): Array<string>;
    set(collectionName: string, key: string, value: unknown): void;
    delete(collectionName: string, key: string): void;
    clear(collectionName: string): void;
    has(collectionName: string, key: string): boolean;
    hasCollection(collectionName: string): boolean;
    collections(): Map<string, Map<string, any>>;
    addAssetImport(assetImport: string, filePath: string): void;
    addAssetImports(assets: Array<string>, filePath: string): void;
    writeAssetImports(filePath: PathLike): Promise<void>;
    scopedStore(collectionName: string): ScopedDataStore;
    metaStore(collectionName: string): MetaStore;
    toString(): string;
    writeToDisk(filePath: PathLike): Promise<void>;
    static fromDisk(filePath: PathLike): Promise<DataStore>;
    static fromString(str: string): DataStore;
    static fromModule(): Promise<DataStore>;
    static fromJSON(entries: Array<[string, Array<[string, any]>]>): DataStore;
}
export interface ScopedDataStore {
    get: <TData extends Record<string, unknown> = Record<string, unknown>>(key: string) => DataEntry<TData> | undefined;
    entries: () => Array<[id: string, DataEntry]>;
    /**
     * Adds a new entry to the store. If an entry with the same ID already exists,
     * it will be replaced.
     * @param opts
     * @param opts.id The ID of the entry. Must be unique per collection.
     * @param opts.data The data to store.
     * @param opts.body The raw body of the content, if applicable.
     * @param opts.filePath The file path of the content, if applicable. Relative to the site root.
     * @param opts.digest A content digest, to check if the content has changed.
     * @param opts.rendered The rendered content, if applicable.
     * @returns `true` if the entry was added or updated, `false` if the entry was not changed. This will be the case if the provided digest matches the one in the store.
     */
    set: <TData extends Record<string, unknown>>(opts: {
        id: string;
        data: TData;
        body?: string;
        filePath?: string;
        digest?: number | string;
        rendered?: RenderedContent;
    }) => boolean;
    values: () => Array<DataEntry>;
    keys: () => Array<string>;
    delete: (key: string) => void;
    clear: () => void;
    has: (key: string) => boolean;
    /**
     * Adds image etc assets to the store. These assets will be transformed
     * by Vite, and the URLs will be available in the final build.
     * @param assets An array of asset src values, relative to the importing file.
     * @param fileName The full path of the file that is importing the assets.
     */
    addAssetImports: (assets: Array<string>, fileName: string) => void;
    /**
     * Adds a single asset to the store. This asset will be transformed
     * by Vite, and the URL will be available in the final build.
     * @param assetImport
     * @param fileName
     * @returns
     */
    addAssetImport: (assetImport: string, fileName: string) => void;
}
/**
 * A key-value store for metadata strings. Useful for storing things like sync tokens.
 */
export interface MetaStore {
    get: (key: string) => string | undefined;
    set: (key: string, value: string) => void;
    has: (key: string) => boolean;
    delete: (key: string) => void;
}
export declare const globalDataStore: {
    get: () => Promise<DataStore>;
    set: (store: DataStore) => void;
};
