export default VelociousDatabaseRecord;
/**
 * Defines this typedef.
 */
export type ValidationErrorObjectType = {
    type: string;
    message: string;
};
/**
 * LifecycleCallbackType type.
 */
export type LifecycleCallbackType<T extends VelociousDatabaseRecord = VelociousDatabaseRecord> = ((model: T) => void | Promise<void>) | string;
/**
 * Model class constructor type used for static `this` typing.
 */
export type ModelConstructor<T extends VelociousDatabaseRecord> = {
    new (...args: Array<never>): T;
};
/**
 * AttachmentDriverConstructor type.
 */
export type AttachmentDriverConstructor = import("../../configuration-types.js").AttachmentDriverConstructor;
/**
 * Thrown by `Record.withAdvisoryLockOrFail` when the lock is already held
 * by another session at the moment of the call.
 */
export class AdvisoryLockBusyError extends Error {
    /**
     * Runs constructor.
     * @param {string} message - Error message.
     * @param {{name: string}} args - The advisory lock name that was already held.
     */
    constructor(message: string, { name }: {
        name: string;
    });
    lockName: string;
}
/**
 * Thrown by `Record.withAdvisoryLock` / `withAdvisoryLockOrFail` when the
 * caller supplied a `holdTimeoutMs` and the callback ran longer than it. The
 * lock is released before this is thrown, so a hung holder can't block other
 * sessions indefinitely. Note: the callback itself is not cancelled — pass an
 * AbortSignal to the work if it needs to stop.
 */
export class AdvisoryLockHoldTimeoutError extends Error {
    /**
     * Runs constructor.
     * @param {string} message - Error message.
     * @param {{name: string}} args - The advisory lock name whose hold timed out.
     */
    constructor(message: string, { name }: {
        name: string;
    });
    lockName: string;
}
/**
 * Thrown by `Record.withAdvisoryLock` when the caller supplied a
 * `timeoutMs` and the lock was not granted before it elapsed.
 */
export class AdvisoryLockTimeoutError extends Error {
    /**
     * Runs constructor.
     * @param {string} message - Error message.
     * @param {{name: string}} args - The advisory lock name that timed out.
     */
    constructor(message: string, { name }: {
        name: string;
    });
    lockName: string;
}
export class TenantDatabaseScopeError extends Error {
    /**
     * Runs constructor.
     * @param {string} message - Error message.
     * @param {{modelName: string}} args - Context for the failed tenant-scoped model.
     */
    constructor(message: string, { modelName }: {
        modelName: string;
    });
    modelName: string;
}
export class ValidationError extends Error {
    /**
     * Narrows the runtime value to the documented type.
     * @type {Record<string, ?> | undefined} - Velocious metadata for frontend-model error reporting.
     */
    velocious: Record<string, unknown> | undefined;
    /**
     * Runs get model.
     * @returns {VelociousDatabaseRecord} - The model.
     */
    getModel(): VelociousDatabaseRecord;
    /**
     * Runs set model.
     * @param {VelociousDatabaseRecord} model - Model instance.
     * @returns {void} - No return value.
     */
    setModel(model: VelociousDatabaseRecord): void;
    _model: VelociousDatabaseRecord | undefined;
    /**
     * Runs get validation errors.
     * @returns {Record<string, ValidationErrorObjectType[]>} - The validation errors.
     */
    getValidationErrors(): Record<string, ValidationErrorObjectType[]>;
    /**
     * Runs set validation errors.
     * @param {Record<string, ValidationErrorObjectType[]>} validationErrors - Validation errors to assign.
     */
    setValidationErrors(validationErrors: Record<string, ValidationErrorObjectType[]>): void;
    _validationErrors: Record<string, ValidationErrorObjectType[]> | undefined;
}
declare class VelociousDatabaseRecord {
    /**
     * Narrows the runtime value to the documented type.
      @type {string | undefined} */
    static modelName: string | undefined;
    /**
     * Narrows the runtime value to the documented type.
      @type {Promise<void> | null | undefined} */
    static _initializeRecordPromise: Promise<void> | null | undefined;
    /**
     * Narrows the runtime value to the documented type.
      @type {boolean | undefined} */
    static _eagerLoadRecordMetadata: boolean | undefined;
    /**
     * Returns the model name, preferring an explicit `static modelName` declaration
     * over the JavaScript class `.name` property. This allows minified builds to
     * preserve correct model names without relying on `keep_classnames`.
     * @returns {string} - The model name.
     */
    static getModelName(): string;
    static getAttributeNameToColumnNameMap(): Record<string, string>;
    /**
     * Resolves the database column name for a record attribute name.
     * @param {string} attributeName - Attribute name to resolve.
     * @returns {string} - Mapped column name, or the underscored attribute name when no mapping exists.
     */
    static getColumnNameForAttributeName(attributeName: string): string;
    /**
     * Resolves an incoming attribute or column name to the canonical attribute name this model exposes.
     * Accepts the canonical (deburred) attribute name, a raw umlaut/acronym column name, a pre-deburr
     * camelization, and camelCase casing variants (e.g. "vAFunktionID" vs "vAFunktionid"). Returns null
     * when nothing matches, so callers keep their own not-found handling.
     * @param {string} name - Attribute name or column name to resolve.
     * @returns {string | null} - Canonical attribute name, or null.
     */
    static resolveAttributeName(name: string): string | null;
    /**
     * Finds the member name on a target's prototype chain matching `memberName`, falling back to a
     * case-insensitive match. Resolves setters when a read-only attribute alias differs only in camelCase
     * casing from the generated accessor (e.g. a "vAFunktionID" alias whose setter is "setVAFunktionid").
     * @param {object} target - Instance or prototype to search.
     * @param {string} memberName - Member name to find.
     * @returns {string | null} - Matching member name, or null when absent.
     */
    static findMemberNameInsensitive(target: object, memberName: string): string | null;
    /**
     * Runs define scope.
     * @param {(...args: Array<?>) => ?} callback - Scope callback.
     * @returns {((...args: Array<?>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {scope: (...args: Array<?>) => import("../../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
     */
    static defineScope(callback: (...args: Array<unknown>) => unknown): ((...args: Array<unknown>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {
        scope: (...args: Array<unknown>) => import("../../utils/model-scope.js").ModelScopeDescriptor;
    };
    static getColumnNameToAttributeNameMap(): Record<string, string>;
    static getTranslationsMap(): Record<string, object>;
    static getValidatorsMap(): Record<string, import("./validators/base.js").default[]>;
    /**
     * Runs get lifecycle callbacks map.
     * @returns {Record<string, LifecycleCallbackType[]>} - Lifecycle callbacks keyed by name.
     */
    static getLifecycleCallbacksMap(): Record<string, LifecycleCallbackType[]>;
    static getValidatorTypesMap(): Record<string, typeof import("./validators/base.js").default>;
    /**
     * Runs get attachments map.
     * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
     */
    static getAttachmentsMap(): Record<string, {
        driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
        type: "hasOne" | "hasMany";
    }>;
    static validatorTypes(): Record<string, typeof import("./validators/base.js").default>;
    /**
     * Runs register validator type.
     * @param {string} name - Name.
     * @param {typeof import("./validators/base.js").default} validatorClass - Validator class.
     */
    static registerValidatorType(name: string, validatorClass: typeof import("./validators/base.js").default): void;
    /**
     * Runs register lifecycle callback.
     * @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
     * @param {LifecycleCallbackType} callback - Callback function or instance method name.
     * @returns {void}
     */
    static registerLifecycleCallback(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation", callback: LifecycleCallbackType): void;
    /**
     * Runs before validation.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static beforeValidation<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs before save.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static beforeSave<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs before create.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static beforeCreate<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs before update.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static beforeUpdate<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs before destroy.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static beforeDestroy<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs after save.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static afterSave<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs after create.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static afterCreate<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs after update.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static afterUpdate<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs after destroy.
     * @template {VelociousDatabaseRecord} T
     * @this {ModelConstructor<T> & typeof VelociousDatabaseRecord}
     * @param {LifecycleCallbackType<T>} callback - Callback function or instance method name.
     * @returns {void}
     */
    static afterDestroy<T extends VelociousDatabaseRecord>(this: ModelConstructor<T> & typeof VelociousDatabaseRecord, callback: LifecycleCallbackType<T>): void;
    /**
     * Runs get validator type.
     * @param {string} validatorName - Validator name.
     * @returns {typeof import("./validators/base.js").default} - The validator type.
     */
    static getValidatorType(validatorName: string): typeof import("./validators/base.js").default;
    /**
     * Runs relationship exists.
     * @param {string} relationshipName - Relationship name.
     * @returns {boolean} - Whether relationship exists.
     */
    static _relationshipExists(relationshipName: string): boolean;
    /**
     * RelationshipScopeCallback type.
     * @typedef {(query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)} RelationshipScopeCallback
     */
    /**
     * RelationshipDataArgumentType type.
     * @typedef {object} RelationshipDataArgumentType
     * @property {boolean} [autoload] - Disable auto-batch-preload for this relationship by passing false. Default true.
     * @property {string} [className] - Model class name for the related record.
     * @property {string} [dependent] - Dependent action when parent is destroyed (e.g. "destroy").
     * @property {typeof VelociousDatabaseRecord} [klass] - Model class for the related record.
     * @property {RelationshipScopeCallback} [scope] - Optional scope callback for the relationship.
     * @property {string} [type] - Relationship type (e.g. "hasMany", "belongsTo").
     */
    /**
     * Runs define relationship.
     * @param {string} relationshipName - Relationship name.
     * @param {RelationshipDataArgumentType} data - Data payload.
     */
    static _defineRelationship(relationshipName: string, data: {
        /**
         * - Disable auto-batch-preload for this relationship by passing false. Default true.
         */
        autoload?: boolean | undefined;
        /**
         * - Model class name for the related record.
         */
        className?: string | undefined;
        /**
         * - Dependent action when parent is destroyed (e.g. "destroy").
         */
        dependent?: string | undefined;
        /**
         * - Model class for the related record.
         */
        klass?: typeof VelociousDatabaseRecord | undefined;
        /**
         * - Optional scope callback for the relationship.
         */
        scope?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | undefined;
        /**
         * - Relationship type (e.g. "hasMany", "belongsTo").
         */
        type?: string | undefined;
    }): void;
    /**
     * Runs normalize relationship args.
     * @param {RelationshipScopeCallback | object | undefined} scopeOrOptions - Scope callback or options.
     * @param {object | undefined} options - Options.
     * @returns {{scope: (RelationshipScopeCallback | undefined), relationshipOptions: object}} - Normalized arguments.
     */
    static _normalizeRelationshipArgs(scopeOrOptions: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object | undefined, options: object | undefined): {
        scope: (((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | undefined);
        relationshipOptions: object;
    };
    /**
     * Registers afterCreate, afterSave, and afterDestroy callbacks to sync
     * a counter cache column on the parent model. The column name follows
     * the convention `<childModelPluralCamelCase>Count`.
     * @param {string} relationshipName - The belongsTo relationship name.
     */
    static _registerCounterCacheCallbacks(relationshipName: string): void;
    /**
     * Runs get relationship by name.
     * @param {string} relationshipName - Relationship name.
     * @returns {import("./relationships/base.js").default} - The relationship by name.
     */
    static getRelationshipByName(relationshipName: string): import("./relationships/base.js").default;
    /**
     * Runs get relationships.
     * @returns {Array<import("./relationships/base.js").default>} - The relationships.
     */
    static getRelationships(): Array<import("./relationships/base.js").default>;
    /**
     * Runs get relationships map.
     * @returns {Record<string, import("./relationships/base.js").default>} - Relationship definitions keyed by name.
     */
    static getRelationshipsMap(): Record<string, import("./relationships/base.js").default>;
    /**
     * Runs get relationship names.
     * @returns {Array<string>} - The relationship names.
     */
    static getRelationshipNames(): Array<string>;
    /**
     * Register a consumer-defined queryData entry. The callback receives
     * a grouped query already joined down the relationship chain from the
     * root of `.queryData(...)` to this model, already filtered by the
     * root parent IDs, and with `parent_id` pre-selected — so the fn
     * only needs to add its own SELECT (and optionally joins/where). Any
     * aliases the fn selects are attached to each **root** record via
     * `record.queryData(aliasName)`. Multi-column selects are fine — one
     * alias maps to one queryData key.
     *
     * **Quote AS aliases on PostgreSQL.** PostgreSQL folds unquoted
     * identifiers (including SELECT aliases) to lowercase, so a
     * `... AS manualTasksCount` lands in the result row as
     * `manualtaskscount` while the lookup `record.queryData("manualTasksCount")`
     * never finds it. Use `driver.quoteColumn("manualTasksCount")` for the
     * alias to preserve the case on every supported driver:
     *   query.select(`COUNT(...) AS ${driver.quoteColumn("manualTasksCount")}`)
     * @param {string} name - Identifier used in the `.queryData(...)` spec.
     * @param {import("../query/query-data.js").QueryDataFn} fn - Callback that mutates the query.
     * @returns {void}
     */
    static queryData(name: string, fn: import("../query/query-data.js").QueryDataFn): void;
    /**
     * Runs get query data map.
     * @returns {Record<string, import("../query/query-data.js").QueryDataFn>} - queryData registrations keyed by name.
     */
    static getQueryDataMap(): Record<string, import("../query/query-data.js").QueryDataFn>;
    /**
     * Runs get query data by name.
     * @param {string} name - queryData name.
     * @returns {import("../query/query-data.js").QueryDataFn | null} - Registered fn or null when not found.
     */
    static getQueryDataByName(name: string): import("../query/query-data.js").QueryDataFn | null;
    /**
     * Runs get attachments.
     * @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
     */
    static getAttachments(): Record<string, {
        driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
        type: "hasOne" | "hasMany";
    }>;
    /**
     * Runs get attachment by name.
     * @param {string} attachmentName - Attachment name.
     * @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ?>, type: "hasOne" | "hasMany"}} - Attachment definition.
     */
    static getAttachmentByName(attachmentName: string): {
        driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
        type: "hasOne" | "hasMany";
    };
    /**
     * Adds a belongs-to-relationship to the model.
     * @param {string} relationshipName The name of the relationship.
     * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
     * @param {object} [options] The options for the relationship.
     */
    static belongsTo(relationshipName: string, scopeOrOptions?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object, options?: object): void;
    /**
     * Runs connection.
     * @param {object} [args] - Options.
     * @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
     * @returns {import("../drivers/base.js").default} - The connection.
     */
    static connection({ enforceTenantDatabaseScope, ...restArgs }?: {
        enforceTenantDatabaseScope?: boolean | undefined;
    }): import("../drivers/base.js").default;
    /**
     * Runs create.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {Record<string, ?>} [attributes] - Attributes.
     * @returns {Promise<InstanceType<MC>>} - Resolves with the create.
     */
    static create<MC extends typeof VelociousDatabaseRecord>(this: MC, attributes?: Record<string, unknown>): Promise<InstanceType<MC>>;
    /**
     * Runs get configuration.
     * @returns {import("../../configuration.js").default} - The configuration.
     */
    static _getConfiguration(): import("../../configuration.js").default;
    /**
     * Adds a has-many-relationship to the model class.
     * @param {string} relationshipName The name of the relationship (e.g. "posts")
     * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
     * @param {object} [options] The options for the relationship (e.g. {className: "Post"})
     * @returns {void} - No return value.
     */
    static hasMany(relationshipName: string, scopeOrOptions?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object, options?: object): void;
    /**
     * Rails-style declaration that this model accepts nested-attribute writes
     * for a relationship when saved through a parent. Required — Velocious
     * will refuse nested writes for any relationship not listed here, even
     * if a frontend-model resource permits them.
     *
     * Options:
     *   - allowDestroy: whether `_destroy: true` entries are allowed. Default false.
     *   - limit: optional upper bound on the number of nested entries per request.
     *   - rejectIf: optional predicate `(attributes) => boolean` that silently skips entries.
     *
     * Usage:
     *   class Project extends Record {}
     *   Project.hasMany("tasks")
     *   Project.acceptsNestedAttributesFor("tasks", {allowDestroy: true})
     * @param {string} relationshipName - Relationship name on this model.
     * @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean}} [options] - Policy options.
     * @returns {void}
     */
    static acceptsNestedAttributesFor(relationshipName: string, options?: {
        allowDestroy?: boolean;
        limit?: number;
        rejectIf?: (attributes: Record<string, unknown>) => boolean;
    }): void;
    /**
     * Runs accepted nested attributes for.
     * @param {string} relationshipName - Relationship name.
     * @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ?>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
     */
    static acceptedNestedAttributesFor(relationshipName: string): {
        allowDestroy?: boolean;
        limit?: number;
        rejectIf?: (attributes: Record<string, unknown>) => boolean;
    } | null;
    /**
     * Adds a has-one-relationship to the model class.
     * @param {string} relationshipName The name of the relationship (e.g. "post")
     * @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
     * @param {object} [options] The options for the relationship (e.g. {className: "Post"})
     * @returns {void} - No return value.
     */
    static hasOne(relationshipName: string, scopeOrOptions?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | object, options?: object): void;
    /**
     * Runs define attachment.
     * @param {string} attachmentName - Attachment name.
     * @param {object} args - Attachment args.
     * @param {string | AttachmentDriverConstructor | Record<string, ?>} [args.driver] - Attachment driver name, class, or instance.
     * @param {"hasOne" | "hasMany"} args.type - Attachment type.
     * @returns {void} - No return value.
     */
    static _defineAttachment(attachmentName: string, { driver, type }: {
        driver?: string | Record<string, any> | import("../../configuration-types.js").AttachmentDriverConstructor | undefined;
        type: "hasOne" | "hasMany";
    }): void;
    /**
     * Adds a single attachment helper to the model.
     * @param {string} attachmentName - Attachment name.
     * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ?>}} [args] - Attachment options.
     * @returns {void} - No return value.
     */
    static hasOneAttachment(attachmentName: string, args?: {
        driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
    }): void;
    /**
     * Adds a collection attachment helper to the model.
     * @param {string} attachmentName - Attachment name.
     * @param {{driver?: string | AttachmentDriverConstructor | Record<string, ?>}} [args] - Attachment options.
     * @returns {void} - No return value.
     */
    static hasManyAttachments(attachmentName: string, args?: {
        driver?: string | AttachmentDriverConstructor | Record<string, unknown>;
    }): void;
    /**
     * Runs human attribute name.
     * @param {string} attributeName - Attribute name.
     * @returns {string} - The human attribute name.
     */
    static humanAttributeName(attributeName: string): string;
    /**
     * Runs get database type.
     * @returns {string} - The database type.
     */
    static getDatabaseType(): string;
    /**
     * Runs set eager load record metadata.
     * @param {boolean} eagerLoadRecordMetadata - Whether require-context initialization should load table metadata for this model.
     * @returns {void} - No return value.
     */
    static setEagerLoadRecordMetadata(eagerLoadRecordMetadata: boolean): void;
    /**
     * Runs get eager load record metadata.
     * @returns {boolean} - Whether require-context initialization should load table metadata for this model.
     */
    static getEagerLoadRecordMetadata(): boolean;
    /**
     * Runs reset record metadata.
     * @returns {void} - No return value.
     */
    static resetRecordMetadata(): void;
    /**
     * Registers the model class with a configuration without loading table metadata.
     * @param {object} args - Options object.
     * @param {import("../../configuration.js").default} args.configuration - Configuration instance.
     * @returns {void} - No return value.
     */
    static registerRecordClass({ configuration, ...restArgs }: {
        configuration: import("../../configuration.js").default;
    }): void;
    /**
     * Runs initialize record.
     * @param {object} args - Options object.
     * @param {import("../../configuration.js").default} args.configuration - Configuration instance.
     * @returns {Promise<void>} - Resolves when complete.
     */
    static initializeRecord({ configuration, ...restArgs }: {
        configuration: import("../../configuration.js").default;
    }): Promise<void>;
    /**
     * Initializes the model class the first time an async record API needs table
     * metadata. Concurrent callers share the same initialization promise, and a
     * failed initialization can be retried by a later call.
     * @param {{configuration?: import("../../configuration.js").default}} [args] - Optional configuration override.
     * @returns {Promise<void>} - Resolves when the model class is initialized.
     */
    static ensureInitialized(args?: {
        configuration?: import("../../configuration.js").default;
    }): Promise<void>;
    /**
     * Runs is initialized.
     * @returns {boolean} - Whether initialized.
     */
    static isInitialized(): boolean;
    /**
     * Runs assert has been initialized.
     * @returns {void} - No return value.
     */
    static _assertHasBeenInitialized(): void;
    static _defineTranslationMethods(): Promise<void>;
    /**
     * Runs get configured database identifier.
     * @returns {string} - The configured non-tenant database identifier.
     */
    static getConfiguredDatabaseIdentifier(): string;
    /**
     * Runs get database identifier.
     * @param {object} [args] - Options.
     * @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
     * @returns {string} - The database identifier.
     */
    static getDatabaseIdentifier({ enforceTenantDatabaseScope, ...restArgs }?: {
        enforceTenantDatabaseScope?: boolean | undefined;
    }): string;
    /**
     * Runs set database identifier.
     * @param {string} databaseIdentifier - Database identifier.
     * @returns {void} - No return value.
     */
    static setDatabaseIdentifier(databaseIdentifier: string): void;
    /**
     * Declares a tenant-aware database identifier resolver for this model class.
     * @param {string | ((args: {modelClass: typeof VelociousDatabaseRecord, tenant: ?}) => string | undefined)} databaseIdentifierOrResolver - Static identifier or resolver.
     * @returns {void} - No return value.
     */
    static switchesTenantDatabase(databaseIdentifierOrResolver: string | ((args: {
        modelClass: typeof VelociousDatabaseRecord;
        tenant: unknown;
    }) => string | undefined)): void;
    /**
     * Runs get tenant database identifier.
     * @param {?} [tenant] - Tenant override.
     * @returns {string | undefined} - Tenant-scoped database identifier when configured.
     */
    static getTenantDatabaseIdentifier(tenant?: unknown): string | undefined;
    /**
     * Whether a declared `"boolean"` attribute cast is backed by an integer column (e.g. an MSSQL
     * `bit`), so booleans must be stored as 1/0. A native boolean column (e.g. Postgres `boolean`)
     * returns false and keeps `true`/`false` for the driver.
     * @param {string} attributeName - Attribute name.
     * @returns {boolean} - Whether the declared boolean is stored as an integer.
     */
    static _declaredBooleanStoresAsInteger(attributeName: string): boolean;
    /**
     * Runs get columns.
     * @returns {import("../drivers/base-column.js").default[]} - The columns.
     */
    static getColumns(): import("../drivers/base-column.js").default[];
    /**
     * Runs get columns hash.
     * @returns {Record<string, import("../drivers/base-column.js").default>} - The columns hash.
     */
    static getColumnsHash(): Record<string, import("../drivers/base-column.js").default>;
    /**
     * Runs get column type by name.
     * @param {string} name - Name.
     * @returns {string | undefined} - The column type by name.
     */
    static getColumnTypeByName(name: string): string | undefined;
    /**
     * Runs is date like type.
     * @param {string} type - Type identifier.
     * @returns {boolean} - Whether date like type.
     */
    static _isDateLikeType(type: string): boolean;
    /**
     * Runs get column names.
     * @returns {Array<string>} - The column names.
     */
    static getColumnNames(): Array<string>;
    /**
     * Runs get table.
     * @returns {import("../drivers/base-table.js").default} - The table.
     */
    static _getTable(): import("../drivers/base-table.js").default;
    /**
     * Runs insert multiple.
     * @param {Array<string>} columns - Column names.
     * @param {Array<Array<?>>} rows - Rows to insert.
     * @param {object} [args] - Options object.
     * @param {boolean} [args.cast] - Whether to cast values based on column types.
     * @param {boolean} [args.retryIndividuallyOnFailure] - Retry rows individually if a batch insert fails.
     * @param {boolean} [args.returnResults] - Return succeeded/failed rows instead of throwing when retries fail.
     * @returns {Promise<void | {succeededRows: Array<Array<?>>, failedRows: Array<Array<?>>, errors: Array<{row: Array<?>, error: ?}>}>} - Resolves when complete.
     */
    static insertMultiple(columns: Array<string>, rows: Array<Array<unknown>>, args?: {
        cast?: boolean | undefined;
        retryIndividuallyOnFailure?: boolean | undefined;
        returnResults?: boolean | undefined;
    }): Promise<void | {
        succeededRows: Array<Array<unknown>>;
        failedRows: Array<Array<unknown>>;
        errors: Array<{
            row: Array<unknown>;
            error: unknown;
        }>;
    }>;
    /**
     * Runs normalize insert multiple rows.
     * @param {object} args - Options object.
     * @param {Array<string>} args.columns - Column names.
     * @param {Array<Array<?>>} args.rows - Rows to insert.
     * @returns {Array<Array<?>>} - Normalized rows.
     */
    static _normalizeInsertMultipleRows({ columns, rows }: {
        columns: Array<string>;
        rows: Array<Array<unknown>>;
    }): Array<Array<unknown>>;
    /**
     * Runs safe serialize insert row.
     * @param {Array<?>} row - Row to serialize.
     * @returns {string} - Safe row representation.
     */
    static _safeSerializeInsertRow(row: Array<unknown>): string;
    /**
     * Runs normalize insert value for column.
     * @param {object} args - Options object.
     * @param {string} args.columnName - Column name.
     * @param {?} args.value - Column value.
     * @returns {?} - Normalized value.
     */
    static _normalizeInsertValueForColumn({ columnName, value }: {
        columnName: string;
        value: unknown;
    }): unknown;
    /**
     * Runs is string type.
     * @param {string | undefined} columnType - Column type.
     * @returns {boolean} - Whether string-like type.
     */
    static _isStringType(columnType: string | undefined): boolean;
    /**
     * Runs is numeric type.
     * @param {string} columnType - Column type.
     * @returns {boolean} - Whether numeric-like type.
     */
    static _isNumericType(columnType: string): boolean;
    /**
     * Runs normalize numeric value.
     * @param {object} args - Options object.
     * @param {string} args.columnType - Column type.
     * @param {?} args.value - Value to normalize.
     * @returns {?} - Normalized value.
     */
    static _normalizeNumericValue({ columnType, value }: {
        columnType: string;
        value: unknown;
    }): unknown;
    /**
     * Runs normalize date value for insert.
     * @param {?} value - Value to normalize.
     * @returns {?} - Normalized value.
     */
    static _normalizeDateValueForInsert(value: unknown): unknown;
    /**
     * Runs normalize date string for insert.
     * @param {string} value - Date string value.
     * @returns {string | Date} - Parsed date or original string.
     */
    static _normalizeDateStringForInsert(value: string): string | Date;
    /**
     * Runs normalize sqlite boolean value for insert.
     * @param {object} args - Options object.
     * @param {string | undefined} args.columnType - Column type.
     * @param {?} args.value - Value to normalize.
     * @returns {?} - Normalized value.
     */
    static _normalizeSqliteBooleanValueForInsert({ columnType, value }: {
        columnType: string | undefined;
        value: unknown;
    }): unknown;
    /**
     * Runs next primary key.
     * @returns {Promise<number>} - Resolves with the next primary key.
     */
    static nextPrimaryKey(): Promise<number>;
    /**
     * Runs set primary key.
     * @param {string} primaryKey - Primary key.
     * @returns {void} - No return value.
     */
    static setPrimaryKey(primaryKey: string): void;
    /**
     * Returns this class's own attribute-cast map, creating it on the class itself
     * (never inherited from a parent) so subclasses don't share the same object.
     * @returns {Record<string, string>} - Declared casts keyed by attribute name.
     */
    static getAttributeCastsMap(): Record<string, string>;
    /**
     * Declares a Rails-style per-attribute cast so a column whose introspected type
     * isn't what the app wants (e.g. an MSSQL `bit` mapped to `number`) can be
     * exposed as another type with real runtime conversion. Currently fully
     * implements the `"boolean"` cast (0/1 <-> false/true); other types only record
     * the label so the effective type and generated typings reflect them.
     * @param {string} attributeName - Attribute name (camelCase), e.g. `"sichtbarVVK"`.
     * @param {string} type - Declared type, e.g. `"boolean"`.
     * @returns {void} - No return value.
     */
    static attribute(attributeName: string, type: string): void;
    /**
     * Returns the declared cast type for an attribute, if any.
     * @param {string} attributeName - Attribute name (camelCase).
     * @returns {string | undefined} - Declared cast type, or undefined when none is declared.
     */
    static getAttributeCast(attributeName: string): string | undefined;
    /**
     * Runs primary key.
     * @returns {string} - The primary key.
     */
    static primaryKey(): string;
    /**
     * Whether the model has a single primary key column. `setPrimaryKey(null)` (e.g. composite-key
     * legacy tables) declares no single primary key; `primaryKey()` still falls back to "id" for the
     * default case, so callers that must distinguish "no primary key" use this instead.
     * @returns {boolean} - False only when the primary key was explicitly set to null.
     */
    static hasPrimaryKey(): boolean;
    /**
     * Runs table name.
     * @returns {string} - The table name.
     */
    static tableName(): string;
    /**
     * Runs set table name.
     * @param {string} tableName - Table name.
     * @returns {void} - No return value.
     */
    static setTableName(tableName: string): void;
    /**
     * Runs transaction.
     * @param {function() : Promise<void>} callback - Callback function.
     * @returns {Promise<?>} - Resolves with the transaction.
     */
    static transaction(callback: () => Promise<void>): Promise<unknown>;
    /**
     * Runs the callback while holding a named advisory lock on the current
     * connection. Advisory locks are cooperative and connection-scoped: they
     * serialize callers that opt into the same `name`, without touching row
     * or table locks, so unrelated traffic is free to proceed.
     *
     * The lock is acquired before the callback runs and released in a
     * `finally` block afterwards, so the callback's return value is
     * propagated and thrown errors still release the lock.
     * @template T
     * @param {string} name - Lock name.
     * @param {() => Promise<T>} callback - Callback to invoke while the lock is held.
     * @param {{timeoutMs?: number | null, holdTimeoutMs?: number | null}} [args] - `timeoutMs` caps how long we wait to acquire the lock; `holdTimeoutMs` caps how long the callback may hold it before the lock is released and `AdvisoryLockHoldTimeoutError` is thrown.
     * @returns {Promise<T>} - Resolves with the callback's return value.
     * @throws {AdvisoryLockTimeoutError} - If `timeoutMs` elapses before the lock is granted.
     * @throws {AdvisoryLockHoldTimeoutError} - If `holdTimeoutMs` elapses while the callback holds the lock.
     */
    static withAdvisoryLock<T>(name: string, callback: () => Promise<T>, args?: {
        timeoutMs?: number | null;
        holdTimeoutMs?: number | null;
    }): Promise<T>;
    /**
     * Runs the callback only if the named advisory lock can be acquired
     * immediately. If the lock is already held by any session, throws
     * `AdvisoryLockBusyError` without waiting.
     * Use this when contention is a signal that somebody else is already
     * doing the work and you want to bail out rather than queue up.
     * @template T
     * @param {string} name - Lock name.
     * @param {() => Promise<T>} callback - Callback to invoke while the lock is held.
     * @param {{holdTimeoutMs?: number | null}} [args] - `holdTimeoutMs` caps how long the callback may hold the lock before it is released and `AdvisoryLockHoldTimeoutError` is thrown.
     * @returns {Promise<T>} - Resolves with the callback's return value.
     * @throws {AdvisoryLockBusyError} - If the lock is already held.
     * @throws {AdvisoryLockHoldTimeoutError} - If `holdTimeoutMs` elapses while the callback holds the lock.
     */
    static withAdvisoryLockOrFail<T>(name: string, callback: () => Promise<T>, args?: {
        holdTimeoutMs?: number | null;
    }): Promise<T>;
    /**
     * Runs `callback`, rejecting with `AdvisoryLockHoldTimeoutError` if it has
     * not settled within `holdTimeoutMs`. The caller's `finally` then releases
     * the lock, so a hung holder can't block other sessions forever. The
     * callback is not cancelled — this is a safety net, not cancellation.
     *
     * Uses `awaitery`'s shared `timeout` helper for the hard timeout, then
     * translates its timeout into the typed `AdvisoryLockHoldTimeoutError` so
     * callers can catch it like the other advisory-lock errors. A `callbackSettled`
     * flag distinguishes the timeout from a rejection thrown by the callback
     * itself, which is rethrown unchanged.
     * @template T
     * @param {string} name - Lock name (for the error message).
     * @param {() => Promise<T>} callback - Callback holding the lock.
     * @param {number | null} [holdTimeoutMs] - Max hold time; falsy disables the timeout.
     * @returns {Promise<T>}
     */
    static runWithAdvisoryLockHoldTimeout<T>(name: string, callback: () => Promise<T>, holdTimeoutMs?: number | null): Promise<T>;
    /**
     * Returns true if the named advisory lock is currently held by any
     * session. Primarily useful as a diagnostic; callers that want to act
     * on the result should prefer `withAdvisoryLockOrFail` to avoid a
     * TOCTOU window between the check and the action.
     * @param {string} name - Lock name.
     * @returns {Promise<boolean>} - Whether the advisory lock is currently held.
     */
    static hasAdvisoryLock(name: string): Promise<boolean>;
    /**
     * Runs translates.
     * @param {...string} names - Names.
     * @returns {void} - No return value.
     */
    static translates(...names: string[]): void;
    /**
     * Runs current translation scope.
     * @param {ModelClassQuery} query - Translation query.
     * @returns {ModelClassQuery} - Scoped query.
     */
    static currentTranslationScope(query: ModelClassQuery): ModelClassQuery;
    /**
     * Runs get translation class.
     * @returns {typeof VelociousDatabaseRecord} - The translation class.
     */
    static getTranslationClass(): typeof VelociousDatabaseRecord;
    /**
     * Runs get translations table name.
     * @returns {string} - The translations table name.
     */
    static getTranslationsTableName(): string;
    /**
     * Runs has translations table.
     * @returns {Promise<boolean>} - Resolves with Whether it has translations table.
     */
    static hasTranslationsTable(): Promise<boolean>;
    /**
     * Adds a validation to an attribute.
     * @param {string} attributeName The name of the attribute to validate.
     * @param {Record<string, boolean | Record<string, ?>>} validators The validators to add. Key is the validator name, value is the validator arguments.
     */
    static validates(attributeName: string, validators: Record<string, boolean | Record<string, unknown>>): Promise<void>;
    /**
     * Registers gap-less positional list callbacks for a column scoped by
     * another column. Inserts and moves shift surrounding positions so the
     * list stays compact (1,2,3,...). Destroys close the resulting gap.
     *
     * Callers must ensure a UNIQUE index on (scopeColumn, positionColumn)
     * exists in the database — use `Migration.addActsAsList()` for the
     * schema half.
     * @param {string} positionColumn - camelCase position attribute (e.g. "rowNumber").
     * @param {object} options - Options with a required scope attribute.
     * @param {string} options.scope - camelCase scope attribute (e.g. "boardColumnId").
     */
    static actsAsList(positionColumn: string, options: {
        scope: string;
    }): void;
    /**
     * Runs new query.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @returns {ModelClassQuery<MC>} - The new query.
     */
    static _newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC): ModelClassQuery<MC>;
    /**
     * Runs orderable column.
     * @returns {string} - The orderable column.
     */
    static orderableColumn(): string;
    /**
     * Runs all.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @returns {ModelClassQuery<MC>} - The all.
     */
    static all<MC extends typeof VelociousDatabaseRecord>(this: MC): ModelClassQuery<MC>;
    /**
     * Runs accessible for.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {string} action - Ability action to scope by.
     * @param {import("../../authorization/ability.js").default | undefined} [ability] - Ability instance.
     * @returns {ModelClassQuery<MC>} - Authorized query.
     */
    static accessibleFor<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string, ability?: import("../../authorization/ability.js").default | undefined): ModelClassQuery<MC>;
    /**
     * Runs accessible.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {import("../../authorization/ability.js").default | undefined} [ability] - Ability instance.
     * @returns {ModelClassQuery<MC>} - Authorized query.
     */
    static accessible<MC extends typeof VelociousDatabaseRecord>(this: MC, ability?: import("../../authorization/ability.js").default | undefined): ModelClassQuery<MC>;
    /**
     * Runs accessible by.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {import("../../authorization/ability.js").default} ability - Ability instance.
     * @returns {ModelClassQuery<MC>} - Authorized query.
     */
    static accessibleBy<MC extends typeof VelociousDatabaseRecord>(this: MC, ability: import("../../authorization/ability.js").default): ModelClassQuery<MC>;
    /**
     * Runs count.
     * @returns {Promise<number>} - Resolves with the count.
     */
    static count(): Promise<number>;
    /**
     * Runs group.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {string} group - Group.
     * @returns {ModelClassQuery<MC>} - The group.
     */
    static group<MC extends typeof VelociousDatabaseRecord>(this: MC, group: string): ModelClassQuery<MC>;
    static destroyAll(): Promise<void>;
    /**
     * Runs pluck.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {...string|string[]} columns - Column names.
     * @returns {Promise<Array<?>>} - Resolves with the pluck.
     */
    static pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<unknown>>;
    /**
     * Runs find.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {number|string} recordId - Record id.
     * @returns {Promise<InstanceType<MC>>} - Resolves with the find.
     */
    static find<MC extends typeof VelociousDatabaseRecord>(this: MC, recordId: number | string): Promise<InstanceType<MC>>;
    /**
     * Runs find by.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
     * @returns {Promise<InstanceType<MC> | null>} - Resolves with the by.
     */
    static findBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
        [key: string]: string | number;
    }): Promise<InstanceType<MC> | null>;
    /**
     * Runs find by or fail.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
     * @returns {Promise<InstanceType<MC>>} - Resolves with the by or fail.
     */
    static findByOrFail<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
        [key: string]: string | number;
    }): Promise<InstanceType<MC>>;
    /**
     * Runs find or create by.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
     * @param {function() : void} [callback] - Callback function.
     * @returns {Promise<InstanceType<MC>>} - Resolves with the or create by.
     */
    static findOrCreateBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
        [key: string]: string | number;
    }, callback?: () => void): Promise<InstanceType<MC>>;
    /**
     * Runs find or initialize by.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {Record<string, string | number>} conditions - Conditions.
     * @param {function(InstanceType<MC>) : void} [callback] - Callback function.
     * @returns {Promise<InstanceType<MC>>} - Resolves with the or initialize by.
     */
    static findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (arg0: InstanceType<MC>) => void): Promise<InstanceType<MC>>;
    /**
     * Runs first.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @returns {Promise<InstanceType<MC>>} - Resolves with the first.
     */
    static first<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>>;
    /**
     * Runs joins.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {string | import("../query/join-object.js").JoinObject} join - Join clause or join descriptor.
     * @returns {ModelClassQuery<MC>} - The joins.
     */
    static joins<MC extends typeof VelociousDatabaseRecord>(this: MC, join: string | import("../query/join-object.js").JoinObject): ModelClassQuery<MC>;
    /**
     * Runs last.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @returns {Promise<InstanceType<MC>>} - Resolves with the last.
     */
    static last<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>>;
    /**
     * Runs limit.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {number} value - Value to use.
     * @returns {ModelClassQuery<MC>} - The limit.
     */
    static limit<MC extends typeof VelociousDatabaseRecord>(this: MC, value: number): ModelClassQuery<MC>;
    /**
     * Runs order.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {import("../query/index.js").OrderArgumentType} order - Order.
     * @returns {ModelClassQuery<MC>} - The order.
     */
    static order<MC extends typeof VelociousDatabaseRecord>(this: MC, order: import("../query/index.js").OrderArgumentType): ModelClassQuery<MC>;
    /**
     * Runs distinct.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {boolean} [value] - Value to use.
     * @returns {ModelClassQuery<MC>} - The distinct.
     */
    static distinct<MC extends typeof VelociousDatabaseRecord>(this: MC, value?: boolean): ModelClassQuery<MC>;
    /**
     * Runs preload.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} preload - Preload.
     * @returns {ModelClassQuery<MC>} - The preload.
     */
    static preload<MC extends typeof VelociousDatabaseRecord>(this: MC, preload: import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>): ModelClassQuery<MC>;
    /**
     * Runs select.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {import("../query/index.js").SelectArgumentType} select - Select.
     * @returns {ModelClassQuery<MC>} - The select.
     */
    static select<MC extends typeof VelociousDatabaseRecord>(this: MC, select: import("../query/index.js").SelectArgumentType): ModelClassQuery<MC>;
    /**
     * Runs to array.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @returns {Promise<InstanceType<MC>[]>} - Resolves with the array.
     */
    static toArray<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>[]>;
    /**
     * Runs load.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @returns {Promise<InstanceType<MC>[]>} - Resolves with the array.
     */
    static load<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>[]>;
    /**
     * Runs where.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {import("../query/index.js").WhereArgumentType} where - Where.
     * @returns {ModelClassQuery<MC>} - The where.
     */
    static where<MC extends typeof VelociousDatabaseRecord>(this: MC, where: import("../query/index.js").WhereArgumentType): ModelClassQuery<MC>;
    /**
     * Runs ransack.
     * @template {typeof VelociousDatabaseRecord} MC
     * @this {MC}
     * @param {Record<string, ?>} params - Ransack-style params hash.
     * @returns {ModelClassQuery<MC>} - Query with Ransack filters applied.
     */
    static ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string, unknown>): ModelClassQuery<MC>;
    /**
     * Runs constructor.
     * @param {Record<string, ?>} changes - Changes.
     */
    constructor(changes?: Record<string, unknown>);
    /**
     * Attributes.
      @type {Record<string, ?>} */
    _attributes: Record<string, unknown>;
    /**
     * Changes.
      @type {Record<string, ?>} */
    _changes: Record<string, unknown>;
    /**
     * Columns as hash.
      @type {Record<string, import("../drivers/base-column.js").default>} */
    _columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
    /**
     * Connection.
      @type {import("../drivers/base.js").default | undefined} */
    __connection: import("../drivers/base.js").default | undefined;
    /**
     * Instance relationships.
      @type {Record<string, import("./instance-relationships/base.js").default>} */
    _instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
    /**
     * Attachments.
      @type {Record<string, RecordAttachmentHandle>} */
    _attachments: Record<string, RecordAttachmentHandle>;
    /**
     * Load cohort.
     * @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
     */
    _loadCohort: Array<VelociousDatabaseRecord> | undefined;
    /**
     * Table name.
      @type {string | undefined} */
    __tableName: string | undefined;
    /**
     * Validation errors.
      @type {Record<string, ValidationErrorObjectType[]>} */
    _validationErrors: Record<string, ValidationErrorObjectType[]>;
    /**
     * Runs get relationship by name.
     * @param {string} relationshipName - Relationship name.
     * @returns {import("./instance-relationships/base.js").default} - The relationship by name.
     */
    getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
    /**
     * Preloads relationship(s) onto this already-loaded record. Accepts either a
     * query built via `Model.preload(...).select(...)` or a raw preload spec
     * (string / array / nested object). A relationship that is already preloaded
     * with all the required columns present is left untouched unless `force` is
     * set. Preloading onto the relationship cache lets later accessors reuse the
     * loaded data instead of issuing identical queries.
     * @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
     * @param {{force?: boolean}} [options] - Options.
     * @returns {Promise<void>} - Resolves when preloading completes.
     */
    preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
        force?: boolean;
    }): Promise<void>;
    /**
     * Runs load relationship.
     * @param {string} relationshipName - Relationship name.
     * @returns {Promise<?>} - Loaded relationship value.
     */
    loadRelationship(relationshipName: string): Promise<unknown>;
    /**
     * Runs relationship or load.
     * @param {string} relationshipName - Relationship name.
     * @param {{preloadTranslations?: boolean}} [options] - Load options.
     * @returns {Promise<?>} - Loaded relationship value.
     */
    relationshipOrLoad(relationshipName: string, options?: {
        preloadTranslations?: boolean;
    }): Promise<unknown>;
    /**
     * Preloads translations on a loaded relationship target when explicitly requested.
     * @param {?} loaded - Loaded relationship value.
     * @returns {Promise<?>} - Relationship value after translation preload.
     */
    _preloadLoadedRelationshipTranslations(loaded: unknown): Promise<unknown>;
    /**
     * Runs get attachment by name.
     * @param {string} attachmentName - Attachment name.
     * @returns {RecordAttachmentHandle} - Attachment handle.
     */
    getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
    /**
     * Runs get configuration.
     * @returns {import("../../configuration.js").default} - The configuration.
     */
    _getConfiguration(): import("../../configuration.js").default;
    /**
     * Runs has attribute.
     * @param {?} value - Value to use.
     * @returns {boolean} - Whether attribute.
     */
    _hasAttribute(value: unknown): boolean;
    /**
     * Runs get attribute.
     * @param {string} name - Name.
     * @returns {?} - The attribute.
     */
    getAttribute(name: string): unknown;
    /**
     * Runs get model class.
     * @abstract
     * @returns {typeof VelociousDatabaseRecord} - The model class.
     */
    getModelClass(): typeof VelociousDatabaseRecord;
    /**
     * Runs set attribute.
     * @param {string} name - Name.
     * @param {?} newValue - New value.
     * @returns {void} - No return value.
     */
    setAttribute(name: string, newValue: unknown): void;
    /**
     * Runs set column attribute.
     * @param {string} name - Name.
     * @param {?} newValue - New value.
     */
    _setColumnAttribute(name: string, newValue: unknown): void;
    /**
     * Clears loaded belongs-to caches when callers assign the foreign key directly.
     * @param {string} columnName - Changed database column name.
     * @param {?} normalizedValue - New normalized column value.
     * @returns {void} - No return value.
     */
    _clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: unknown): void;
    /**
     * Runs belongs to relationships for foreign key.
     * @param {string} columnName - Changed database column name.
     * @returns {Array<?>} - Loaded relationship instances that use the changed foreign key.
     */
    _belongsToRelationshipsForForeignKey(columnName: string): Array<unknown>;
    /**
     * Runs belongs to relationship uses foreign key.
     * @param {object} args - Relationship match arguments.
     * @param {string} args.columnName - Changed database column name.
     * @param {?} args.relationship - Relationship instance.
     * @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
     */
    _belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
        columnName: string;
        relationship: unknown;
    }): boolean;
    /**
     * Runs belongs to relationship matches foreign key value.
     * @param {object} args - Relationship cache arguments.
     * @param {?} args.normalizedValue - New normalized column value.
     * @param {?} args.relationship - Relationship instance.
     * @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
     */
    _belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
        normalizedValue: unknown;
        relationship: unknown;
    }): boolean;
    /**
     * Runs clear loaded belongs to relationship.
     * @param {?} relationship - Relationship instance.
     * @returns {void} - No return value.
     */
    _clearLoadedBelongsToRelationship(relationship: unknown): void;
    /**
     * Runs normalize date value.
     * @param {?} value - Value to use.
     * @returns {?} - The date value.
     */
    _normalizeDateValue(value: unknown): unknown;
    /**
     * Runs normalize sqlite boolean value.
     * @param {object} args - Options object.
     * @param {string | undefined} args.columnType - Column type.
     * @param {?} args.value - Value to normalize.
     * @returns {?} - Normalized value.
     */
    _normalizeSqliteBooleanValue({ columnType, value }: {
        columnType: string | undefined;
        value: unknown;
    }): unknown;
    /**
     * Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
     * booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
     * underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
     * so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
     * @param {object} args - Options object.
     * @param {string} args.attributeName - Attribute name being written.
     * @param {string | undefined} args.columnType - Column type.
     * @param {?} args.value - Value to normalize.
     * @returns {?} - Normalized value.
     */
    _normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
        attributeName: string;
        columnType: string | undefined;
        value: unknown;
    }): unknown;
    /**
     * Runs save.
     * @returns {Promise<void>} - Resolves when complete.
     */
    save(): Promise<void>;
    _autoSaveBelongsToRelationships(): Promise<{
        savedCount: number;
    }>;
    _autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
    /**
     * Runs auto save has many and has one relationships.
     * @param {object} args - Options object.
     * @param {boolean} args.isNewRecord - Whether is new record.
     */
    _autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
        isNewRecord: boolean;
    }): Promise<void>;
    /**
     * Runs auto save attachments.
     * @returns {Promise<void>} - Resolves when pending attachments have been saved.
     */
    _autoSaveAttachments(): Promise<void>;
    /**
     * Runs translations loaded.
     * @abstract
     * @returns {TranslationBase[]} - The translations loaded.
     */
    translationsLoaded(): TranslationBase[];
    /**
     * Runs get translated attribute.
     * @param {string} name - Name.
     * @param {string} locale - Locale.
     * @returns {string | undefined} - The translated attribute, if found.
     */
    _getTranslatedAttribute(name: string, locale: string): string | undefined;
    /**
     * Runs get translated attribute with fallback.
     * @param {string} name - Name.
     * @param {string} locale - Locale.
     * @returns {string | undefined} - The translated attribute with fallback, if found.
     */
    _getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
    /**
     * Runs set translated attribute.
     * @param {string} name - Name.
     * @param {string} locale - Locale.
     * @param {?} newValue - New value.
     * @returns {void} - No return value.
     */
    _setTranslatedAttribute(name: string, locale: string, newValue: unknown): void;
    _isNewRecord: boolean;
    /**
     * Runs load existing record.
     * @param {object} attributes - Attributes.
     * @returns {void} - No return value.
     */
    loadExistingRecord(attributes: object): void;
    /**
     * Assigns the given attributes to the record.
     * @param {Record<string, ?>} attributesToAssign - Attributes to assign.
     * @returns {void} - No return value.
     */
    assign(attributesToAssign: Record<string, unknown>): void;
    /**
     * Returns a the current attributes of the record (original attributes from database plus changes)
     * @returns {Record<string, ?>} - The attributes.
     */
    attributes(): Record<string, unknown>;
    /**
     * Returns column-name keyed data (original attributes from database plus changes)
     * @returns {Record<string, ?>} - The raw attributes.
     */
    rawAttributes(): Record<string, unknown>;
    /**
     * Runs connection.
     * @returns {import("../drivers/base.js").default} - The connection.
     */
    _connection(): import("../drivers/base.js").default;
    /**
     * Destroys the record in the database and all of its dependent records.
     * @returns {Promise<void>} - Resolves when complete.
     */
    destroy(): Promise<void>;
    /**
     * Runs run lifecycle callbacks.
     * @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
     * @returns {Promise<void>}
     */
    _runLifecycleCallbacks(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"): Promise<void>;
    /**
     * Runs has changes.
     * @returns {boolean} - Whether changes.
     */
    _hasChanges(): boolean;
    /**
     * Returns true if the model has been changed since it was loaded from the database.
     * @returns {boolean} - Whether changed.
     */
    isChanged(): boolean;
    /**
     * Returns the changes that have been made to this record since it was loaded from the database.
     * @returns {Record<string, Array<?>>} - The changes.
     */
    changes(): Record<string, Array<unknown>>;
    /**
     * Runs table name.
     * @returns {string} - The table name.
     */
    _tableName(): string;
    /**
     * Reads an attribute value from the record. Read dynamically by name, so the value can be any
     * column type and may be overridden by a user-defined getter on the model.
     * @template V
     * @param {string} attributeName The name of the attribute to read. This is the attribute name, not the column name.
     * @returns {V} The attribute value, typed by the caller's accessor contract.
     */
    readAttribute<V>(attributeName: string): V;
    /**
     * Read an association count attached by `.withCount(...)`. Counts are
     * stored on a separate map from the record's `_attributes` so a
     * virtual count like `tasksCount` cannot silently shadow a real
     * column of the same name. Returns the attached number, or 0 when
     * `.withCount(...)` wasn't requested for this attribute.
     * @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom `"activeMembersCount"` from `.withCount({activeMembersCount: {...}})`.
     * @returns {number}
     */
    readCount(attributeName: string): number;
    /**
     * Attach an association count to this record. Internal helper used by
     * the `withCount` runner; outside code should not call this directly.
     * @param {string} attributeName - Attribute name.
     * @param {number} value - Count value.
     * @returns {void}
     */
    _setAssociationCount(attributeName: string, value: number): void;
    /**
     * All attached association counts as a plain object. Used by the
     * frontend-model serializer to ship counts alongside the record
     * attributes on the wire.
     * @returns {Record<string, number>}
     */
    associationCounts(): Record<string, number>;
    /**
     * Read a value attached by `.queryData(...)`. Stored on a dedicated
     * map rather than on `_attributes`, so a virtual queryData key like
     * `transportSecondsSum` cannot silently shadow a real column of the
     * same name. Returns `null` when the key wasn't produced by any
     * registered fn for this record (e.g. no child rows matched the
     * aggregate).
     * @param {string} name - queryData attribute name (matches a SELECT alias from the registered fn).
     * @returns {?}
     */
    queryData(name: string): unknown;
    /**
     * Attach a queryData value to this record. Internal helper used by
     * the `queryData` runner and by frontend-model hydration; outside
     * code should not call this directly.
     * @param {string} name - queryData attribute name.
     * @param {?} value - Value to attach.
     * @returns {void}
     */
    _setQueryData(name: string, value: unknown): void;
    /**
     * All attached queryData values as a plain object. Used by the
     * frontend-model serializer to ship queryData alongside the record
     * attributes on the wire.
     * @returns {Record<string, ?>}
     */
    queryDataValues(): Record<string, unknown>;
    /**
     * Read a per-record ability result attached by `.abilities(...)`. The
     * backend evaluates each requested action against the current ability
     * for this record instance and ships the result alongside the
     * record's attributes. Returns `false` when the action wasn't
     * requested for this record — so UI code can safely branch on
     * `record.can("update")` without first checking whether the ability
     * was loaded.
     * @param {string} action - Ability action name, e.g. `"update"`.
     * @returns {boolean}
     */
    can(action: string): boolean;
    /**
     * Attach a per-record ability result to this record. Internal helper
     * used by the `abilities` runner and by frontend-model hydration;
     * outside code should not call this directly.
     * @param {string} action - Ability action name.
     * @param {boolean} value - Whether the current ability permits the action on this record.
     * @returns {void}
     */
    _setComputedAbility(action: string, value: boolean): void;
    /**
     * All attached per-record ability results as a plain object. Used
     * by the frontend-model serializer to ship results alongside the
     * record attributes on the wire.
     * @returns {Record<string, boolean>}
     */
    computedAbilities(): Record<string, boolean>;
    /**
     * Reads a column value from the record.
     * @param {string} attributeName The name of the column to read. This is the column name, not the attribute name.
     * @returns {?} - The column.
     */
    readColumn(attributeName: string): unknown;
    /**
     * Resolves any declared per-attribute cast for a database column name.
     * @param {string} columnName - Database column name.
     * @returns {string | undefined} - Declared cast type, or undefined when none is declared.
     */
    _declaredAttributeCastForColumn(columnName: string): string | undefined;
    /**
     * Converts a stored value to a real boolean for a declared `"boolean"` cast.
     * Leaves null/undefined untouched; treats 1/true/"1" as true and 0/false/"0" as false.
     * @param {?} value - Stored database value.
     * @returns {?} - Converted boolean, or the original value when not recognized.
     */
    _castDeclaredBooleanForRead(value: unknown): unknown;
    /**
     * Whether a column value is currently loaded on this record (either as a
     * persisted attribute or a pending change). Used to decide whether a preload
     * can be skipped because the required columns are already present.
     * @param {string} columnName - The column name to check.
     * @returns {boolean} - Whether the column is loaded.
     */
    hasLoadedColumn(columnName: string): boolean;
    /**
     * Runs normalize boolean value for read. A declared `"boolean"` attribute cast converts the
     * stored value (e.g. an MSSQL `bit` 0/1) to a real boolean; otherwise the existing
     * introspected-type normalization applies (no behaviour change for non-declared columns).
     * @param {object} args - Options object.
     * @param {string} args.columnName - Database column name being read.
     * @param {string | undefined} args.columnType - Column type.
     * @param {?} args.value - Value to normalize.
     * @returns {?} - Normalized value.
     */
    _normalizeBooleanValueForRead({ columnName, columnType, value }: {
        columnName: string;
        columnType: string | undefined;
        value: unknown;
    }): unknown;
    /**
     * Runs normalize date value for read.
     * @param {?} value - Value from database.
     * @returns {?} - Normalized value.
     */
    _normalizeDateValueForRead(value: unknown): unknown;
    _belongsToChanges(): Record<string, any>;
    /**
     * Runs create new record.
     * @returns {Promise<void>} - Resolves when complete.
     */
    _createNewRecord(): Promise<void>;
    /**
     * Marks only relationships with in-memory loaded values as preloaded after create.
     * @returns {void} - No return value.
     */
    _markLoadedRelationshipsPreloadedAfterCreate(): void;
    /**
     * Applies the database insert response to this record.
     * @param {object} options - Insert result options.
     * @param {Record<string, ?>} options.data - Inserted data.
     * @param {?} options.insertResult - Result returned from the connection.
     * @param {string} options.primaryKey - Primary key column name.
     * @param {string | undefined} options.primaryKeyType - Primary key column type.
     * @returns {Promise<void>} - Resolves when complete.
     */
    _applyInsertResult({ data, insertResult, primaryKey, primaryKeyType }: {
        data: Record<string, unknown>;
        insertResult: unknown;
        primaryKey: string;
        primaryKeyType: string | undefined;
    }): Promise<void>;
    /**
     * Sets timestamp defaults for a new record insert.
     * @param {Record<string, ?>} data - Column-keyed data.
     * @returns {void} - No return value.
     */
    _setDefaultTimestampValues(data: Record<string, unknown>): void;
    /**
     * Runs normalize date values for write.
     * @param {Record<string, ?>} data - Column-keyed data.
     * @returns {void} - No return value.
     */
    _normalizeDateValuesForWrite(data: Record<string, unknown>): void;
    /**
     * Runs update record with changes.
     * @returns {Promise<void>} - Resolves when complete.
     */
    _updateRecordWithChanges(): Promise<void>;
    /**
     * Runs id.
     * @returns {number|string} - The id.
     */
    id(): number | string;
    /**
     * Runs is persisted.
     * @returns {boolean} - Whether persisted.
     */
    isPersisted(): boolean;
    /**
     * Runs is new record.
     * @returns {boolean} - Whether new record.
     */
    isNewRecord(): boolean;
    /**
     * Runs set is new record.
     * @param {boolean} newIsNewRecord - New is new record.
     * @returns {void} - No return value.
     */
    setIsNewRecord(newIsNewRecord: boolean): void;
    /**
     * Runs reload with id.
     * @template {typeof VelociousDatabaseRecord} MC
     * @param {string | number} id - Record identifier.
     * @returns {Promise<void>} - Resolves when complete.
     */
    _reloadWithId<MC extends typeof VelociousDatabaseRecord>(id: string | number): Promise<void>;
    /**
     * Runs reload.
     * @returns {Promise<void>} - Resolves when complete.
     */
    reload(): Promise<void>;
    _runValidations(): Promise<void>;
    /**
     * Runs full error messages.
     * @returns {string[]} - The full error messages.
     */
    fullErrorMessages(): string[];
    /**
     * Assigns the attributes to the record and saves it.
     * @param {object} attributesToAssign - The attributes to assign to the record.
     */
    update(attributesToAssign: object): Promise<void>;
}
import RecordAttachmentHandle from "./attachments/handle.js";
declare class TranslationBase extends VelociousDatabaseRecord {
    /**
     * Runs locale.
     * @abstract
     * @returns {string} - The locale.
     */
    locale(): string;
}
import ModelClassQuery from "../query/model-class-query.js";
//# sourceMappingURL=index.d.ts.map