/**
 * Runs the recordAttachmentsStoreForModel helper.
 * @param {import("../index.js").default} model - Model instance.
 * @returns {RecordAttachmentsStore} - Store instance.
 */
export function recordAttachmentsStoreForModel(model: import("../index.js").default): RecordAttachmentsStore;
/**
 * Attachment persistence store.
 */
export default class RecordAttachmentsStore {
    /**
     * Runs constructor.
     * @param {object} args - Options.
     * @param {import("../../../configuration.js").default} args.configuration - Configuration instance.
     * @param {string} args.databaseIdentifier - Database identifier.
     */
    constructor({ configuration, databaseIdentifier }: {
        configuration: import("../../../configuration.js").default;
        databaseIdentifier: string;
    });
    configuration: import("../../../configuration.js").default;
    databaseIdentifier: string;
    _readyPromise: Promise<void> | null;
    _driverColumnsAvailable: boolean;
    _contentBase64Nullable: boolean;
    /**
     * Narrows the runtime value to the documented type.
      @type {Map<string, Record<string, ?>>} */
    _attachmentDriversByName: Map<string, Record<string, unknown>>;
    /**
     * Narrows the runtime value to the documented type.
      @type {Map<AttachmentDriverConstructor | Record<string, ?>, Record<string, ?>>} */
    _attachmentDriversByReference: Map<AttachmentDriverConstructor | Record<string, unknown>, Record<string, unknown>>;
    /**
     * Runs ensure ready.
     * @returns {Promise<void>} - Resolves when schema is ready.
     */
    ensureReady(): Promise<void>;
    /**
     * Runs attach.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @param {?} args.input - Attachment input.
     * @param {boolean} args.replace - Whether to replace existing attachments.
     * @returns {Promise<void>} - Resolves when complete.
     */
    attach({ input, model, name, replace }: {
        model: import("../index.js").default;
        name: string;
        input: unknown;
        replace: boolean;
    }): Promise<void>;
    /**
     * Runs ensure attachment store schema.
     * @param {object} args - Options.
     * @param {import("../../../database/drivers/base.js").default} args.db - DB connection.
     * @returns {Promise<void>} - Resolves when schema columns are ensured.
     */
    ensureAttachmentStoreSchema({ db }: {
        db: import("../../../database/drivers/base.js").default;
    }): Promise<void>;
    /**
     * Runs read attachment row.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @param {Record<string, ?>} args.row - Attachment row.
     * @returns {Promise<Buffer>} - Attachment bytes.
     */
    readAttachmentRow({ model, name, row }: {
        model: import("../index.js").default;
        name: string;
        row: Record<string, unknown>;
    }): Promise<Buffer>;
    /**
     * Runs attachment row url.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @param {Record<string, ?>} args.row - Attachment row.
     * @returns {Promise<string | null>} - Attachment URL.
     */
    attachmentRowUrl({ model, name, row }: {
        model: import("../index.js").default;
        name: string;
        row: Record<string, unknown>;
    }): Promise<string | null>;
    /**
     * Runs find one.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @param {string} [args.id] - Optional attachment id.
     * @returns {Promise<Record<string, ?> | null>} - Attachment row.
     */
    findOne({ id, model, name }: {
        model: import("../index.js").default;
        name: string;
        id?: string | undefined;
    }): Promise<Record<string, unknown> | null>;
    /**
     * Runs find many.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @returns {Promise<Array<Record<string, ?>>>} - Attachment rows.
     */
    findMany({ model, name }: {
        model: import("../index.js").default;
        name: string;
    }): Promise<Array<Record<string, unknown>>>;
    /**
     * Runs delete attachment row storage.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @param {Record<string, ?>} args.row - Attachment row.
     * @returns {Promise<void>} - Resolves when row storage has been deleted.
     */
    deleteAttachmentRowStorage({ model, name, row }: {
        model: import("../index.js").default;
        name: string;
        row: Record<string, unknown>;
    }): Promise<void>;
    /**
     * Runs attachment driver by name.
     * @param {string} driverName - Driver name.
     * @returns {Promise<Record<string, ?>>} - Attachment storage driver instance.
     */
    attachmentDriverByName(driverName: string): Promise<Record<string, unknown>>;
    /**
     * Runs attachment driver by reference.
     * @param {object} args - Options.
     * @param {AttachmentDriverConstructor | Record<string, ?>} args.driverReference - Driver class or instance.
     * @param {string} args.attachmentName - Attachment name.
     * @param {typeof import("../index.js").default} args.modelClass - Model class.
     * @returns {Record<string, ?>} - Attachment driver instance.
     */
    attachmentDriverByReference({ attachmentName, driverReference, modelClass }: {
        driverReference: AttachmentDriverConstructor | Record<string, unknown>;
        attachmentName: string;
        modelClass: typeof import("../index.js").default;
    }): Record<string, unknown>;
    /**
     * Runs attachment driver name for.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @returns {string} - Attachment driver name.
     */
    _attachmentDriverNameFor({ model, name }: {
        model: import("../index.js").default;
        name: string;
    }): string;
    /**
     * Runs resolve attachment driver.
     * @param {object} args - Options.
     * @param {import("../index.js").default} args.model - Model instance.
     * @param {string} args.name - Attachment name.
     * @param {Record<string, ?>} [args.row] - Attachment row.
     * @returns {Promise<Record<string, ?>>} - Attachment storage driver instance.
     */
    resolveAttachmentDriver({ model, name, row }: {
        model: import("../index.js").default;
        name: string;
        row?: Record<string, any> | undefined;
    }): Promise<Record<string, unknown>>;
    /**
     * Runs next position.
     * @param {object} args - Options.
     * @param {import("../../../database/drivers/base.js").default} args.db - DB connection.
     * @param {string} args.name - Attachment name.
     * @param {string} args.recordId - Record id.
     * @param {string} args.recordType - Record type.
     * @returns {Promise<number>} - Next position.
     */
    _nextPosition({ db, name, recordId, recordType }: {
        db: import("../../../database/drivers/base.js").default;
        name: string;
        recordId: string;
        recordType: string;
    }): Promise<number>;
    /**
     * Runs with db.
     * @template T
     * @param {(db: import("../../../database/drivers/base.js").default) => Promise<T>} callback - Callback.
     * @returns {Promise<T>} - Callback result.
     */
    _withDb<T>(callback: (db: import("../../../database/drivers/base.js").default) => Promise<T>): Promise<T>;
}
/**
 * AttachmentDriverConstructor type.
 */
export type AttachmentDriverConstructor = import("../../../configuration-types.js").AttachmentDriverConstructor;
//# sourceMappingURL=store.d.ts.map