/** Error raised when reading an attribute that was not selected in query payloads. */
export class AttributeNotSelectedError extends Error {
    /**
     * Runs constructor.
     * @param {string} modelName - Model class name.
     * @param {string} attributeName - Attribute that was requested.
     */
    constructor(modelName: string, attributeName: string);
}
/**
 * Lightweight singular relationship state holder for frontend model instances.
 * @template {typeof FrontendModelBase} S
 * @template {typeof FrontendModelBase} T
 */
export class FrontendModelSingularRelationship<S extends typeof FrontendModelBase, T extends typeof FrontendModelBase> {
    /**
     * Runs constructor.
     * @param {InstanceType<S>} model - Parent model.
     * @param {string} relationshipName - Relationship name.
     * @param {T | null} targetModelClass - Target model class.
     */
    constructor(model: InstanceType<S>, relationshipName: string, targetModelClass: T | null);
    model: InstanceType<S>;
    relationshipName: string;
    targetModelClass: T | null;
    _preloaded: boolean;
    _loadedValue: any;
    /**
     * Runs set loaded.
     * @param {?} loadedValue - Loaded relationship value.
     * @returns {void}
     */
    setLoaded(loadedValue: unknown): void;
    /**
     * Runs get preloaded.
     * @returns {boolean} - Whether relationship is preloaded.
     */
    getPreloaded(): boolean;
    /**
     * Runs loaded.
     * @returns {?} - Loaded relationship value.
     */
    loaded(): unknown;
    /**
     * Runs build.
     * @param {Record<string, ?>} [attributes] - New model attributes.
     * @returns {InstanceType<T>} - Built model.
     */
    build(attributes?: Record<string, unknown>): InstanceType<T>;
}
/**
 * Lightweight has-many relationship state holder for frontend model instances.
 * @template {typeof FrontendModelBase} S
 * @template {typeof FrontendModelBase} T
 */
export class FrontendModelHasManyRelationship<S extends typeof FrontendModelBase, T extends typeof FrontendModelBase> {
    /**
     * Runs constructor.
     * @param {InstanceType<S>} model - Parent model.
     * @param {string} relationshipName - Relationship name.
     * @param {T | null} targetModelClass - Target model class.
     */
    constructor(model: InstanceType<S>, relationshipName: string, targetModelClass: T | null);
    /**
     * Narrows the runtime value to the documented type.
      @type {Array<InstanceType<T>>} */
    _loadedValue: Array<InstanceType<T>>;
    model: InstanceType<S>;
    relationshipName: string;
    targetModelClass: T | null;
    _preloaded: boolean;
    /**
     * Runs set loaded.
     * @param {Array<InstanceType<T>>} loadedValue - Loaded relationship value.
     * @returns {void}
     */
    setLoaded(loadedValue: Array<InstanceType<T>>): void;
    /**
     * Runs get preloaded.
     * @returns {boolean} - Whether relationship is preloaded.
     */
    getPreloaded(): boolean;
    /**
     * Runs loaded.
     * @returns {Array<InstanceType<T>>} - Loaded relationship values.
     */
    loaded(): Array<InstanceType<T>>;
    /**
     * Runs add to loaded.
     * @param {Array<InstanceType<T>>} models - Models to append.
     * @returns {void}
     */
    addToLoaded(models: Array<InstanceType<T>>): void;
    /**
     * Runs build.
     * @param {Record<string, ?>} [attributes] - New model attributes.
     * @returns {InstanceType<T>} - Built model.
     */
    build(attributes?: Record<string, unknown>): InstanceType<T>;
    /**
     * Force-reload the relationship. When the parent record was loaded as part
     * of a batch, siblings that have not preloaded this relationship get
     * batched into one request via the cohort preloader. The scoped query path
     * (`Model.where(...).preload([name]).toArray()` directly from user code)
     * bypasses cohort batching by design.
     * @returns {Promise<Array<InstanceType<T>>>} - Loaded relationship models.
     */
    load(): Promise<Array<InstanceType<T>>>;
    /**
     * Runs to array.
     * @returns {Promise<Array<InstanceType<T>>>} - Loaded relationship models.
     */
    toArray(): Promise<Array<InstanceType<T>>>;
}
/**
 * Downloaded frontend-model attachment payload wrapper.
 */
export class FrontendModelAttachmentDownload {
    /**
     * Runs constructor.
     * @param {object} args - Options.
     * @param {string} args.id - Attachment id.
     * @param {string} args.filename - Filename.
     * @param {string | null} args.contentType - Content type.
     * @param {number} args.byteSize - File size in bytes.
     * @param {Uint8Array} args.content - File content bytes.
     * @param {string | null} [args.url] - Resolvable attachment URL.
     */
    constructor({ byteSize, content, contentType, filename, id, url }: {
        id: string;
        filename: string;
        contentType: string | null;
        byteSize: number;
        content: Uint8Array;
        url?: string | null | undefined;
    });
    idValue: string;
    filenameValue: string;
    contentTypeValue: string | null;
    byteSizeValue: number;
    contentValue: Uint8Array<ArrayBufferLike>;
    urlValue: string | null;
    /**
     * Runs byte size.
     * @returns {number} - File size in bytes.
     */
    byteSize(): number;
    /**
     * Runs content.
     * @returns {Uint8Array} - File content bytes.
     */
    content(): Uint8Array;
    /**
     * Runs content type.
     * @returns {string | null} - Content type.
     */
    contentType(): string | null;
    /**
     * Runs filename.
     * @returns {string} - Filename.
     */
    filename(): string;
    /**
     * Runs id.
     * @returns {string} - Attachment id.
     */
    id(): string;
    /**
     * Runs url.
     * @returns {string | null} - Resolvable attachment URL.
     */
    url(): string | null;
}
/**
 * Frontend-model attachment helper for one attachment name.
 */
export class FrontendModelAttachmentHandle {
    /**
     * Runs constructor.
     * @param {object} args - Options.
     * @param {FrontendModelBase} args.model - Model instance.
     * @param {string} args.attachmentName - Attachment name.
     */
    constructor({ attachmentName, model }: {
        model: FrontendModelBase;
        attachmentName: string;
    });
    model: FrontendModelBase;
    attachmentName: string;
    /**
     * Runs attach.
     * @param {?} input - Attachment input.
     * @returns {Promise<void>} - Resolves when attached.
     */
    attach(input: unknown): Promise<void>;
    /**
     * Runs download.
     * @param {string} [attachmentId] - Optional attachment id for has-many attachments.
     * @returns {Promise<FrontendModelAttachmentDownload | null>} - Downloaded attachment payload.
     */
    download(attachmentId?: string): Promise<FrontendModelAttachmentDownload | null>;
    /**
     * Runs url.
     * @param {string} [attachmentId] - Optional attachment id for has-many attachments.
     * @returns {Promise<string | null>} - Resolvable attachment URL.
     */
    url(attachmentId?: string): Promise<string | null>;
    /**
     * Runs download url.
     * @returns {string} - Download URL for this attachment on the configured backend.
     */
    downloadUrl(): string;
}
/** Base class for generated frontend model classes. */
export default class FrontendModelBase {
    /**
     * Narrows the runtime value to the documented type.
      @type {string | undefined} */
    static modelName: string | undefined;
    /**
     * Autoload.
     * @type {boolean} - Global auto-batch-preload toggle. Apps can opt out via FrontendModelBase.setAutoload(false).
     */
    static _autoload: boolean;
    /**
     * Runs get autoload.
     * @returns {boolean} Whether auto-batch-preload of relationships on lazy access is enabled globally.
     */
    static getAutoload(): boolean;
    /**
     * Runs set autoload.
     * @param {boolean} newValue - Whether auto-batch-preload of relationships is enabled.
     * @returns {void}
     */
    static setAutoload(newValue: boolean): void;
    /**
     * Runs ensure generated attachment methods.
     * @this {typeof FrontendModelBase}
     * @returns {void} - Ensures attachment helper methods exist on the prototype.
     */
    static ensureGeneratedAttachmentMethods(this: typeof FrontendModelBase): void;
    /**
     * Runs resource config.
     * @returns {FrontendModelResourceConfig} - Resource configuration.
     */
    static resourceConfig(): FrontendModelResourceConfig;
    /**
     * Runs relationship model classes.
     * @this {typeof FrontendModelBase}
     * @returns {Record<string, typeof FrontendModelBase | string>} - Relationship model classes (or class name strings) keyed by relationship name.
     */
    static relationshipModelClasses(this: typeof FrontendModelBase): Record<string, typeof FrontendModelBase | string>;
    /**
     * Register a frontend model class so it can be resolved by name in relationship lookups.
     * @param {typeof FrontendModelBase} modelClass - Model class to register.
     * @returns {void}
     */
    static registerModel(modelClass: typeof FrontendModelBase): void;
    /**
     * Runs define scope.
     * @param {(...args: Array<?>) => ?} callback - Scope callback.
     * @returns {((...args: Array<?>) => import("./query.js").default<typeof FrontendModelBase>) & {scope: (...args: Array<?>) => import("../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
     */
    static defineScope(callback: (...args: Array<unknown>) => unknown): ((...args: Array<unknown>) => import("./query.js").default<typeof FrontendModelBase>) & {
        scope: (...args: Array<unknown>) => import("../utils/model-scope.js").ModelScopeDescriptor;
    };
    /**
     * Resolve a relationship model class value that may be a class reference or a string name.
     * @param {typeof FrontendModelBase | string | null | undefined} value - Class or class name.
     * @returns {typeof FrontendModelBase | null} - Resolved model class.
     */
    static resolveModelClass(value: typeof FrontendModelBase | string | null | undefined): typeof FrontendModelBase | null;
    /**
     * Runs relationship definitions.
     * @this {typeof FrontendModelBase}
     * @returns {Record<string, {type: "belongsTo" | "hasOne" | "hasMany", autoload?: boolean}>} - Relationship definitions keyed by relationship name.
     */
    static relationshipDefinitions(this: typeof FrontendModelBase): Record<string, {
        type: "belongsTo" | "hasOne" | "hasMany";
        autoload?: boolean;
    }>;
    /**
     * Runs attachment definitions.
     * @this {typeof FrontendModelBase}
     * @returns {Record<string, FrontendModelAttachmentDefinition>} - Attachment definitions keyed by attachment name.
     */
    static attachmentDefinitions(this: typeof FrontendModelBase): Record<string, FrontendModelAttachmentDefinition>;
    /**
     * Runs attachment definition.
     * @this {typeof FrontendModelBase}
     * @param {string} attachmentName - Attachment name.
     * @returns {FrontendModelAttachmentDefinition | null} - Attachment definition.
     */
    static attachmentDefinition(this: typeof FrontendModelBase, attachmentName: string): FrontendModelAttachmentDefinition | null;
    /**
     * Runs relationship definition.
     * @this {typeof FrontendModelBase}
     * @param {string} relationshipName - Relationship name.
     * @returns {{type: "belongsTo" | "hasOne" | "hasMany", autoload?: boolean} | null} - Relationship definition.
     */
    static relationshipDefinition(this: typeof FrontendModelBase, relationshipName: string): {
        type: "belongsTo" | "hasOne" | "hasMany";
        autoload?: boolean;
    } | null;
    /**
     * Runs relationship model class.
     * @this {typeof FrontendModelBase}
     * @param {string} relationshipName - Relationship name.
     * @returns {typeof FrontendModelBase | null} - Target relationship model class.
     */
    static relationshipModelClass(this: typeof FrontendModelBase, relationshipName: string): typeof FrontendModelBase | null;
    /**
     * Runs primary key.
     * @this {typeof FrontendModelBase}
     * @returns {string} - Primary key name.
     */
    static primaryKey(this: typeof FrontendModelBase): string;
    /**
     * Runs resource path.
     * @this {typeof FrontendModelBase}
     * @returns {string} - Derived resource path.
     */
    static resourcePath(this: typeof FrontendModelBase): string;
    /**
     * Runs command name.
     * @this {typeof FrontendModelBase}
     * @param {FrontendModelCommandType} commandType - Command type.
     * @returns {string} - Resolved command name.
     */
    static commandName(this: typeof FrontendModelBase, commandType: FrontendModelCommandType): string;
    /**
     * Runs normalize custom command payload arguments.
     * @this {typeof FrontendModelBase}
     * @param {Array<?>} args - Command arguments.
     * @returns {Record<string, ?>} - Command payload.
     */
    static normalizeCustomCommandPayloadArguments(this: typeof FrontendModelBase, args: Array<unknown>): Record<string, unknown>;
    /**
     * 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`.
     * @this {typeof FrontendModelBase}
     * @returns {string} - The model name.
     */
    static getModelName(this: typeof FrontendModelBase): string;
    /**
     * Runs configure transport.
     * @param {FrontendModelTransportConfig} config - Frontend model transport configuration.
     * @returns {void} - No return value.
     */
    static configureTransport(config: FrontendModelTransportConfig): void;
    /**
     * Connect the internal WebSocket and enable auto-reconnect.
     * @returns {Promise<void>} - Resolves when connected.
     */
    static connectWebsocket(): Promise<void>;
    /**
     * Disconnect the internal WebSocket and disable auto-reconnect.
     * @returns {Promise<void>} - Resolves when closed.
     */
    static disconnectWebsocket(): Promise<void>;
    /**
     * Waits until queued and active frontend-model transport requests finish.
     * @param {FrontendModelIdleWaitArgs} [args] - Wait options.
     * @returns {Promise<void>} - Resolves when transport is idle.
     */
    static waitForIdle(args?: FrontendModelIdleWaitArgs): Promise<void>;
    /**
     * Returns the current WebSocket connection state.
     * @returns {{disconnectedSince: number | null, hasClient: boolean, isOpen: boolean, listenerCount: number}} - Snapshot of the managed websocket connection state.
     */
    static websocketState(): {
        disconnectedSince: number | null;
        hasClient: boolean;
        isOpen: boolean;
        listenerCount: number;
    };
    /**
     * Close the raw WebSocket without disabling auto-reconnect. Used by tests to
     * simulate an unexpected network drop and verify reconnection behavior.
     * @returns {Promise<void>} - Resolves when the socket has closed.
     */
    static dropWebsocket(): Promise<void>;
    /**
     * Sets global metadata on the WebSocket connection. Sent to the server immediately
     * over WebSocket and exposed to WebSocket-borne requests as request metadata.
     * @param {string} key - Metadata key.
     * @param {?} value - Metadata value (null to clear).
     * @returns {void}
     */
    static setWebsocketMetadata(key: string, value: unknown): void;
    /**
     * Opens a managed connection that auto-opens, auto-closes, and
     * auto-reconnects based on `shouldConnect()` and `params()`.
     * Call `handle.sync()` whenever the inputs that drive those
     * functions change (e.g. current-user sign-in/out). The handle
     * retries when the WS client isn't ready and reopens on close.
     * @param {string} connectionType - Connection class name registered on the server.
     * @param {{shouldConnect: () => boolean, params: () => Record<string, ?>, onMessage?: (body: ?) => void}} options - Connection lifecycle and payload callbacks.
     * @returns {{sync: () => void, close: () => void}} - Handle used to resync or close the managed connection.
     */
    static openManagedConnection(connectionType: string, options: {
        shouldConnect: () => boolean;
        params: () => Record<string, unknown>;
        onMessage?: (body: unknown) => void;
    }): {
        sync: () => void;
        close: () => void;
    };
    /**
     * Opens a 1:1 `WebsocketConnection` of the given type. Thin
     * convenience wrapper around the internal WS client's
     * `openConnection`. Apps use this for per-session state/messaging
     * that doesn't fit the pub/sub Channel model (locale, presence).
     * @param {string} connectionType - Name the server registered the class under.
     * @param {{params?: Record<string, ?>, onConnect?: () => void, onMessage?: (body: ?) => void, onDisconnect?: () => void, onResume?: () => void, onClose?: (reason: string) => void}} [options] - Connection options and event handlers.
     * @returns {?} - VelociousWebsocketClientConnection handle (typed loosely to avoid a cross-module import cycle).
     */
    static openWebsocketConnection(connectionType: string, options?: {
        params?: Record<string, unknown>;
        onConnect?: () => void;
        onMessage?: (body: unknown) => void;
        onDisconnect?: () => void;
        onResume?: () => void;
        onClose?: (reason: string) => void;
    }): unknown;
    /**
     * Subscribes to a pub/sub `WebsocketChannel`. Thin wrapper around
     * the internal client's `subscribeChannel`.
     * @param {string} channelType - Channel class name registered on the server.
     * @param {{params?: Record<string, ?>, onMessage?: (body: ?) => void, onDisconnect?: () => void, onResume?: () => void, onClose?: (reason: string) => void}} [options] - Channel subscription options and event handlers.
     * @returns {?} - Websocket channel handle from the configured client.
     */
    static subscribeWebsocketChannel(channelType: string, options?: {
        params?: Record<string, unknown>;
        onMessage?: (body: unknown) => void;
        onDisconnect?: () => void;
        onResume?: () => void;
        onClose?: (reason: string) => void;
    }): unknown;
    /**
     * Installs WebSocket lifecycle hooks on globalThis for system test access.
     * Tests can call `globalThis.__velocious_websocket_hooks.connect()` etc.
     * @returns {void}
     */
    static installWebsocketTestHooks(): void;
    /**
     * Runs attributes from response.
     * @this {typeof FrontendModelBase}
     * @param {object} response - Response payload.
     * @returns {Record<string, ?>} - Attributes from payload.
     */
    static attributesFromResponse(this: typeof FrontendModelBase, response: object): Record<string, unknown>;
    /**
     * Runs model data from response.
     * @this {typeof FrontendModelBase}
     * @param {object} response - Response payload.
     * @returns {{abilities: Record<string, boolean>, attributes: Record<string, ?>, associationCounts: Record<string, number>, queryData: Record<string, ?>, preloadedRelationships: Record<string, ?>, selectedAttributes: Set<string>}} - Attributes, preloaded relationships, association counts, queryData, abilities, and the selected-attributes set.
     */
    static modelDataFromResponse(this: typeof FrontendModelBase, response: object): {
        abilities: Record<string, boolean>;
        attributes: Record<string, unknown>;
        associationCounts: Record<string, number>;
        queryData: Record<string, unknown>;
        preloadedRelationships: Record<string, unknown>;
        selectedAttributes: Set<string>;
    };
    /**
     * Runs apply preloaded relationships.
     * @this {typeof FrontendModelBase}
     * @param {FrontendModelBase} model - Model instance.
     * @param {Record<string, ?>} preloadedRelationships - Preloaded relationship payload.
     * @returns {void}
     */
    static applyPreloadedRelationships(this: typeof FrontendModelBase, model: FrontendModelBase, preloadedRelationships: Record<string, unknown>): void;
    /**
     * Runs instantiate relationship value.
     * @this {typeof FrontendModelBase}
     * @param {?} relationshipPayload - Relationship payload value.
     * @param {typeof FrontendModelBase | null} targetModelClass - Target model class.
     * @returns {?} - Instantiated relationship value.
     */
    static instantiateRelationshipValue(this: typeof FrontendModelBase, relationshipPayload: unknown, targetModelClass: typeof FrontendModelBase | null): unknown;
    /**
     * Runs instantiate from response.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?> | InstanceType<T>} response - Response payload, or an already-hydrated instance of this class.
     * @returns {InstanceType<T>} - New model instance, or the same instance unchanged if it was already hydrated.
     */
    static instantiateFromResponse<T extends typeof FrontendModelBase>(this: T, response: Record<string, unknown> | InstanceType<T>): InstanceType<T>;
    /**
     * Runs find.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {number | string} id - Record identifier.
     * @returns {Promise<InstanceType<T>>} - Resolved model.
     */
    static find<T extends typeof FrontendModelBase>(this: T, id: number | string): Promise<InstanceType<T>>;
    /**
     * Runs find by.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} conditions - Attribute match conditions.
     * @returns {Promise<InstanceType<T> | null>} - Found model or null.
     */
    static findBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): Promise<InstanceType<T> | null>;
    /**
     * Runs find by or fail.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} conditions - Attribute match conditions.
     * @returns {Promise<InstanceType<T>>} - Found model.
     */
    static findByOrFail<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): Promise<InstanceType<T>>;
    /**
     * Runs to array.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {Promise<InstanceType<T>[]>} - Loaded model instances.
     */
    static toArray<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T>[]>;
    /**
     * Runs load.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {Promise<InstanceType<T>[]>} - Loaded model instances.
     */
    static load<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T>[]>;
    /**
     * Runs all.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {FrontendModelQuery<T>} - Query builder.
     */
    static all<T extends typeof FrontendModelBase>(this: T): FrontendModelQuery<T>;
    /**
     * Runs where.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} conditions - Root-model where conditions.
     * @returns {import("./query.js").default<T>} - Query with where conditions.
     */
    static where<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): import("./query.js").default<T>;
    /**
     * Runs joins.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?> | Array<Record<string, ?>>} joins - Relationship descriptor joins.
     * @returns {import("./query.js").default<T>} - Query with joins.
     */
    static joins<T extends typeof FrontendModelBase>(this: T, joins: Record<string, unknown> | Array<Record<string, unknown>>): import("./query.js").default<T>;
    /**
     * Runs limit.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {number} value - Maximum number of records.
     * @returns {import("./query.js").default<T>} - Query with limit.
     */
    static limit<T extends typeof FrontendModelBase>(this: T, value: number): import("./query.js").default<T>;
    /**
     * Runs offset.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {number} value - Number of records to skip.
     * @returns {import("./query.js").default<T>} - Query with offset.
     */
    static offset<T extends typeof FrontendModelBase>(this: T, value: number): import("./query.js").default<T>;
    /**
     * Runs page.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {number} pageNumber - 1-based page number.
     * @returns {import("./query.js").default<T>} - Query with page applied.
     */
    static page<T extends typeof FrontendModelBase>(this: T, pageNumber: number): import("./query.js").default<T>;
    /**
     * Runs per page.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {number} value - Number of records per page.
     * @returns {import("./query.js").default<T>} - Query with page size.
     */
    static perPage<T extends typeof FrontendModelBase>(this: T, value: number): import("./query.js").default<T>;
    /**
     * Runs count.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {Promise<number>} - Number of loaded model instances.
     */
    static count<T extends typeof FrontendModelBase>(this: T): Promise<number>;
    /**
     * Class-level hook fired when any record of this model is created.
     * Subscribe-time authorization only — once a subscription is
     * accepted, future `create` events for this model are delivered
     * without re-checking per-record visibility. Query options can still
     * narrow which events reach this callback.
     * @this {typeof FrontendModelBase}
     * @param {(payload: {id: string, model: InstanceType<typeof FrontendModelBase>}) => void} callback - Event callback.
     * @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
     * @returns {Promise<() => void>} - Unsubscribe callback.
     */
    static onCreate(this: typeof FrontendModelBase, callback: (payload: {
        id: string;
        model: InstanceType<typeof FrontendModelBase>;
    }) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
    /**
     * Class-level hook fired when any record of this model is updated.
     * @this {typeof FrontendModelBase}
     * @param {(payload: {id: string, model: InstanceType<typeof FrontendModelBase>}) => void} callback - Event callback.
     * @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
     * @returns {Promise<() => void>} - Unsubscribe callback.
     */
    static onUpdate(this: typeof FrontendModelBase, callback: (payload: {
        id: string;
        model: InstanceType<typeof FrontendModelBase>;
    }) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
    /**
     * Class-level hook fired when any record of this model is destroyed.
     * @this {typeof FrontendModelBase}
     * @param {(payload: {id: string}) => void} callback - Event callback.
     * @param {import("./query.js").FrontendModelEventOptions} [options] - Accepted for API symmetry; destroy events carry ids only.
     * @returns {Promise<() => void>} - Unsubscribe callback.
     */
    static onDestroy(this: typeof FrontendModelBase, callback: (payload: {
        id: string;
    }) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
    /**
     * Runs pluck.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {...(string | string[] | Record<string, ?> | Array<Record<string, ?>>)} columns - Pluck definition(s).
     * @returns {Promise<Array<?>>} - Plucked values.
     */
    static pluck<T extends typeof FrontendModelBase>(this: T, ...columns: (string | string[] | Record<string, unknown> | Array<Record<string, unknown>>)[]): Promise<Array<unknown>>;
    /**
     * Runs search.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {string[]} path - Relationship path.
     * @param {string} column - Column or attribute name.
     * @param {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<="} operator - Search operator.
     * @param {?} value - Search value.
     * @returns {FrontendModelQuery<T>} - Query builder with search filter.
     */
    static search<T extends typeof FrontendModelBase>(this: T, path: string[], column: string, operator: "eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<=", value: unknown): FrontendModelQuery<T>;
    /**
     * Runs ransack.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} params - Ransack-style params hash.
     * @returns {FrontendModelQuery<T>} - Query builder with Ransack filters applied.
     */
    static ransack<T extends typeof FrontendModelBase>(this: T, params: Record<string, unknown>): FrontendModelQuery<T>;
    /**
     * Runs sort.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {string | string[] | [string, string] | Array<[string, string]> | Record<string, ?> | Array<Record<string, ?>>} sort - Sort definition(s).
     * @returns {FrontendModelQuery<T>} - Query builder with sort definitions.
     */
    static sort<T extends typeof FrontendModelBase>(this: T, sort: string | string[] | [string, string] | Array<[string, string]> | Record<string, unknown> | Array<Record<string, unknown>>): FrontendModelQuery<T>;
    /**
     * Runs order.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {string | string[] | [string, string] | Array<[string, string]> | Record<string, ?> | Array<Record<string, ?>>} sort - Sort definition(s).
     * @returns {FrontendModelQuery<T>} - Query builder with sort definitions.
     */
    static order<T extends typeof FrontendModelBase>(this: T, sort: string | string[] | [string, string] | Array<[string, string]> | Record<string, unknown> | Array<Record<string, unknown>>): FrontendModelQuery<T>;
    /**
     * Runs group.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {string | string[] | Record<string, ?> | Array<Record<string, ?>>} group - Group definition(s).
     * @returns {FrontendModelQuery<T>} - Query builder with group definitions.
     */
    static group<T extends typeof FrontendModelBase>(this: T, group: string | string[] | Record<string, unknown> | Array<Record<string, unknown>>): FrontendModelQuery<T>;
    /**
     * Runs distinct.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {boolean} [value] - Whether to request distinct rows.
     * @returns {FrontendModelQuery<T>} - Query builder with distinct flag.
     */
    static distinct<T extends typeof FrontendModelBase>(this: T, value?: boolean): FrontendModelQuery<T>;
    /**
     * Runs query.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {FrontendModelQuery<T>} - Query builder.
     */
    static query<T extends typeof FrontendModelBase>(this: T): FrontendModelQuery<T>;
    /**
     * Runs preload.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>} preload - Preload graph.
     * @returns {FrontendModelQuery<T>} - Query with preload.
     */
    static preload<T extends typeof FrontendModelBase>(this: T, preload: import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>): FrontendModelQuery<T>;
    /**
     * Runs select.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, string[] | string> | string | string[]} select - Model-aware attribute select map or root-model shorthand.
     * @returns {FrontendModelQuery<T>} - Query with selected attributes.
     */
    static select<T extends typeof FrontendModelBase>(this: T, select: Record<string, string[] | string> | string | string[]): FrontendModelQuery<T>;
    /**
     * Runs selects extra.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, string[] | string> | string | string[]} select - Extra attributes to load in addition to the defaults, keyed by model name or root-model shorthand.
     * @returns {FrontendModelQuery<T>} - Query with extra selected attributes.
     */
    static selectsExtra<T extends typeof FrontendModelBase>(this: T, select: Record<string, string[] | string> | string | string[]): FrontendModelQuery<T>;
    /**
     * Runs first.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {Promise<InstanceType<T> | null>} - First model or null.
     */
    static first<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T> | null>;
    /**
     * Runs last.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @returns {Promise<InstanceType<T> | null>} - Last model or null.
     */
    static last<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T> | null>;
    /**
     * Runs find or initialize by.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} conditions - Attribute match conditions.
     * @returns {Promise<InstanceType<T>>} - Existing or initialized model.
     */
    static findOrInitializeBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): Promise<InstanceType<T>>;
    /**
     * Runs find or create by.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} conditions - Attribute match conditions.
     * @param {(model: InstanceType<T>) => Promise<void> | void} [callback] - Optional callback before save when created.
     * @returns {Promise<InstanceType<T>>} - Existing or newly created model.
     */
    static findOrCreateBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>, callback?: (model: InstanceType<T>) => Promise<void> | void): Promise<InstanceType<T>>;
    /**
     * Runs create.
     * @template {typeof FrontendModelBase} T
     * @this {T}
     * @param {Record<string, ?>} [attributes] - Initial attributes.
     * @returns {Promise<InstanceType<T>>} - Persisted model.
     */
    static create<T extends typeof FrontendModelBase>(this: T, attributes?: Record<string, unknown>): Promise<InstanceType<T>>;
    /**
     * Runs assert find by conditions.
     * @this {typeof FrontendModelBase}
     * @param {Record<string, ?>} conditions - findBy conditions.
     * @returns {void}
     */
    static assertFindByConditions(this: typeof FrontendModelBase, conditions: Record<string, unknown>): void;
    /**
     * Runs matches find by conditions.
     * @this {typeof FrontendModelBase}
     * @param {FrontendModelBase} model - Candidate model.
     * @param {Record<string, ?>} conditions - Match conditions.
     * @returns {boolean} - Whether the model matches all conditions.
     */
    static matchesFindByConditions(this: typeof FrontendModelBase, model: FrontendModelBase, conditions: Record<string, unknown>): boolean;
    /**
     * Runs find by condition value matches.
     * @this {typeof FrontendModelBase}
     * @param {?} actualValue - Actual model value.
     * @param {?} expectedValue - Expected find condition value.
     * @returns {boolean} - Whether values match.
     */
    static findByConditionValueMatches(this: typeof FrontendModelBase, actualValue: unknown, expectedValue: unknown): boolean;
    /**
     * Runs find by primitive values match.
     * @this {typeof FrontendModelBase}
     * @param {?} actualValue - Actual model value.
     * @param {?} expectedValue - Expected find condition value.
     * @returns {boolean} - Whether primitive values match after safe coercion.
     */
    static findByPrimitiveValuesMatch(this: typeof FrontendModelBase, actualValue: unknown, expectedValue: unknown): boolean;
    /**
     * Runs find by numeric string matches number.
     * @this {typeof FrontendModelBase}
     * @param {string} numericString - Numeric string value.
     * @param {number} expectedNumber - Number value.
     * @returns {boolean} - Whether values represent the same number.
     */
    static findByNumericStringMatchesNumber(this: typeof FrontendModelBase, numericString: string, expectedNumber: number): boolean;
    /**
     * Runs execute command.
     * @this {typeof FrontendModelBase}
     * @param {FrontendModelCommandType} commandType - Command type.
     * @param {Record<string, ?>} payload - Command payload.
     * @returns {Promise<Record<string, ?>>} - Parsed JSON response.
     */
    static executeCommand(this: typeof FrontendModelBase, commandType: FrontendModelCommandType, payload: Record<string, unknown>): Promise<Record<string, unknown>>;
    /**
     * Runs execute custom command.
     * @this {typeof FrontendModelBase}
     * @param {object} args - Command arguments.
     * @param {string} args.commandName - Raw command path segment.
     * @param {FrontendModelRequestCommandType} args.commandType - Logical command type for error handling.
     * @param {string | number | null} [args.memberId] - Optional member id for member-scoped commands.
     * @param {Record<string, ?>} args.payload - Request payload.
     * @param {string} args.resourcePath - Direct resource path.
     * @returns {Promise<Record<string, ?>>} - Decoded response payload.
     */
    static executeCustomCommand(this: typeof FrontendModelBase, { commandName, commandType, memberId, payload, resourcePath }: {
        commandName: string;
        commandType: FrontendModelRequestCommandType;
        memberId?: string | number | null | undefined;
        payload: Record<string, unknown>;
        resourcePath: string;
    }): Promise<Record<string, unknown>>;
    /**
     * Runs throw on error frontend model response.
     * @this {typeof FrontendModelBase}
     * @param {object} args - Arguments.
     * @param {FrontendModelRequestCommandType} args.commandType - Command type.
     * @param {Record<string, ?>} args.response - Decoded response.
     * @returns {void}
     */
    static throwOnErrorFrontendModelResponse(this: typeof FrontendModelBase, { commandType, response }: {
        commandType: FrontendModelRequestCommandType;
        response: Record<string, unknown>;
    }): void;
    /**
     * Runs configured frontend model attribute names.
     * @this {typeof FrontendModelBase}
     * @returns {Set<string>} - Configured frontend model attribute names.
     */
    static configuredFrontendModelAttributeNames(this: typeof FrontendModelBase): Set<string>;
    /**
     * Runs constructor.
     * @param {Record<string, ?>} [attributes] - Initial attributes.
     */
    constructor(attributes?: Record<string, unknown>);
    /**
     * Narrows the runtime value to the documented type.
      @type {Record<string, ?>} */
    _attributes: Record<string, unknown>;
    /**
     * Narrows the runtime value to the documented type.
      @type {Record<string, FrontendModelHasManyRelationship<typeof FrontendModelBase, typeof FrontendModelBase> | FrontendModelSingularRelationship<typeof FrontendModelBase, typeof FrontendModelBase>>} */
    _relationships: Record<string, FrontendModelHasManyRelationship<typeof FrontendModelBase, typeof FrontendModelBase> | FrontendModelSingularRelationship<typeof FrontendModelBase, typeof FrontendModelBase>>;
    /**
     * Narrows the runtime value to the documented type.
      @type {Record<string, FrontendModelAttachmentHandle>} */
    _attachments: Record<string, FrontendModelAttachmentHandle>;
    /**
     * Narrows the runtime value to the documented type.
      @type {Set<string> | null} */
    _selectedAttributes: Set<string> | null;
    /**
     * Narrows the runtime value to the documented type.
      @type {boolean} */
    _isNewRecord: boolean;
    /**
     * Narrows the runtime value to the documented type.
      @type {boolean} */
    _markedForDestruction: boolean;
    /**
     * Narrows the runtime value to the documented type.
      @type {Record<string, ?>} */
    _persistedAttributes: Record<string, unknown>;
    /**
     * Narrows the runtime value to the documented type.
     * @type {Array<FrontendModelBase> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-batch-preload.
     */
    _loadCohort: Array<FrontendModelBase> | undefined;
    /**
     * Runs attributes.
     * @returns {Record<string, ?>} - Attributes hash.
     */
    attributes(): Record<string, unknown>;
    /**
     * Runs is new record.
     * @returns {boolean} - Whether this model has not yet been persisted.
     */
    isNewRecord(): boolean;
    /**
     * Runs is persisted.
     * @returns {boolean} - Whether this model has been persisted.
     */
    isPersisted(): boolean;
    /**
     * Runs set is new record.
     * @param {boolean} newIsNewRecord - New persisted-state flag.
     * @returns {void}
     */
    setIsNewRecord(newIsNewRecord: boolean): void;
    /**
     * Marks this record for destruction when its parent is next saved through
     * nested-attribute support. The record is not removed from the parent's
     * relationship collection until the server confirms the delete.
     * @returns {void} - No return value.
     */
    markForDestruction(): void;
    /**
     * Runs marked for destruction.
     * @returns {boolean} - Whether this record is queued for nested destruction on next parent save.
     */
    markedForDestruction(): boolean;
    /**
     * Runs changes.
     * @returns {Record<string, Array<?>>} - Changed attributes as `[oldValue, newValue]`.
     */
    changes(): Record<string, Array<unknown>>;
    /**
     * Runs is changed.
     * @returns {boolean} - Whether any tracked attribute has changed.
     */
    isChanged(): boolean;
    /**
     * Runs get relationship by name.
     * @param {string} relationshipName - Relationship name.
     * @returns {FrontendModelHasManyRelationship<typeof FrontendModelBase, typeof FrontendModelBase> | FrontendModelSingularRelationship<typeof FrontendModelBase, typeof FrontendModelBase>} - Relationship state object.
     */
    getRelationshipByName(relationshipName: string): FrontendModelHasManyRelationship<typeof FrontendModelBase, typeof FrontendModelBase> | FrontendModelSingularRelationship<typeof FrontendModelBase, typeof FrontendModelBase>;
    /**
     * Runs get attachment by name.
     * @param {string} attachmentName - Attachment name.
     * @returns {FrontendModelAttachmentHandle} - Attachment helper.
     */
    getAttachmentByName(attachmentName: string): FrontendModelAttachmentHandle;
    /**
     * Runs load relationship.
     * @param {string} relationshipName - Relationship name.
     * @returns {Promise<?>} - Loaded relationship value.
     */
    loadRelationship(relationshipName: string): Promise<unknown>;
    /**
     * 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). Relationships already preloaded with the
     * required columns present are left untouched unless `force` is set. Carries
     * the query's preload graph, select, selectsExtra, withCount, abilities, and
     * queryData when re-fetching.
     * @param {import("./query.js").default<typeof FrontendModelBase> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
     * @param {{force?: boolean}} [options] - Options.
     * @returns {Promise<void>} - Resolves when preloading completes.
     */
    preload(queryOrSpec: import("./query.js").default<typeof FrontendModelBase> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>, options?: {
        force?: boolean;
    }): Promise<void>;
    /**
     * Runs relationship or load.
     * @param {string} relationshipName - Relationship name.
     * @returns {Promise<?>} - Loaded relationship value.
     */
    relationshipOrLoad(relationshipName: string): Promise<unknown>;
    /**
     * Attempts to batch-load `relationshipName` across cohort siblings via a
     * single `preload([name]).where({pk: [ids]}).toArray()` request, then copies
     * the preloaded relationship state onto each sibling. Returns true when a
     * batch ran, false when autoload is off, there is no cohort, or no batch
     * candidates remain. Siblings whose relationship state is already set
     * (preloaded or locally manipulated via `build` / `setRelationship`) are
     * skipped so their cached/edited value is preserved.
     * @param {string} relationshipName - Relationship name.
     * @returns {Promise<boolean>} - Whether a cohort batch preload ran.
     */
    _tryCohortPreload(relationshipName: string): Promise<boolean>;
    /**
     * Runs set relationship.
     * @param {string} relationshipName - Relationship name.
     * @param {?} relationshipValue - Relationship value.
     * @returns {?} - Assigned relationship value.
     */
    setRelationship(relationshipName: string, relationshipValue: unknown): unknown;
    /**
     * Runs assign attributes.
     * @param {Record<string, ?>} attributes - Attributes to assign.
     * @returns {void} - No return value.
     */
    assignAttributes(attributes: Record<string, unknown>): void;
    /**
     * Runs clear relationship cache.
     * @returns {void} - Clears cached relationship state.
     */
    clearRelationshipCache(): void;
    /**
     * Runs primary key value.
     * @returns {number | string} - Primary key value.
     */
    primaryKeyValue(): number | string;
    /**
     * Runs read attribute.
     * @param {string} attributeName - Attribute name.
     * @returns {?} - Attribute value.
     */
    readAttribute(attributeName: string): unknown;
    /**
     * Whether an attribute value is currently loaded on this record. Used by the
     * preloader to decide whether a relationship can be skipped because the
     * requested columns are already present.
     * @param {string} attributeName - Attribute name.
     * @returns {boolean} - Whether the attribute is loaded.
     */
    hasLoadedAttribute(attributeName: string): boolean;
    /**
     * Read an association count attached by `.withCount(...)`. Counts
     * live on a dedicated map separate from the record's attributes so
     * a virtual count like `tasksCount` can't silently shadow a real
     * column of the same name. Returns the attached value, or 0 when
     * `.withCount(...)` wasn't requested for this attribute.
     * @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom name from `.withCount({customName: {...}})`.
     * @returns {number}
     */
    readCount(attributeName: string): number;
    /**
     * Internal setter called by `instantiateFromResponse` when hydrating
     * association counts that rode along with the record payload.
     * @param {string} attributeName - Attribute name.
     * @param {number} value - Count value.
     * @returns {void}
     */
    _setAssociationCount(attributeName: string, value: number): void;
    /**
     * 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 (or the ability denied it), 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;
    /**
     * Internal setter called by `instantiateFromResponse` when hydrating
     * per-record ability results that rode along with the record
     * payload.
     * @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;
    /**
     * Read a consumer-defined value attached by `.queryData(...)`. Stored
     * on a dedicated map rather than `_attributes`, so a virtual alias
     * like `tasksCount` cannot silently shadow a real column of the same
     * name. Returns `null` when no registered fn produced that alias for
     * this record (e.g. no child rows matched the aggregate).
     * @param {string} name - queryData alias name.
     * @returns {?}
     */
    queryData(name: string): unknown;
    /**
     * Internal setter used by `instantiateFromResponse` when hydrating
     * queryData values that rode along with the record payload.
     * @param {string} name - queryData alias name.
     * @param {?} value - Attached value.
     * @returns {void}
     */
    _setQueryData(name: string, value: unknown): void;
    /**
     * Runs set attribute.
     * @param {string} attributeName - Attribute name.
     * @param {?} newValue - New value.
     * @returns {?} - Assigned value.
     */
    setAttribute(attributeName: string, newValue: unknown): unknown;
    /**
     * Invalidates any cached belongsTo relationship whose foreign key matches the
     * changed attribute. HasMany / hasOne relationships are left untouched because
     * their foreign key lives on the child, not on this model, and blanket-clearing
     * them would destroy nested-save state and preloaded children the caller never
     * asked to invalidate.
     *
     * Foreign keys are inferred when not declared: for belongsTo `projectId` is
     * inferred from relationship name `project`. Explicit `foreignKey` on the
     * relationship definition takes precedence.
     * @param {string} attributeName - Attribute name that changed.
     * @returns {void}
     */
    _invalidateRelationshipsForAttribute(attributeName: string): void;
    /**
     * Instance-level hook fired when THIS record is updated. The
     * instance's attributes are auto-merged with the broadcast payload
     * before the callback runs, so callers can read fresh values via
     * `this.someAttr()` without re-fetching.
     * @param {(payload: {id: string, model: InstanceType<typeof FrontendModelBase>}) => void} callback - Event callback.
     * @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
     * @returns {Promise<() => void>} - Unsubscribe callback.
     */
    onUpdate(callback: (payload: {
        id: string;
        model: InstanceType<typeof FrontendModelBase>;
    }) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
    /**
     * Instance-level hook fired when THIS record is destroyed.
     * @param {(payload: {id: string}) => void} callback - Event callback.
     * @param {import("./query.js").FrontendModelEventOptions} [options] - Accepted for API symmetry; destroy events carry ids only.
     * @returns {Promise<() => void>} - Unsubscribe callback.
     */
    onDestroy(callback: (payload: {
        id: string;
    }) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
    /**
     * Runs update.
     * @param {Record<string, ?>} [newAttributes] - New values to assign before update.
     * @returns {Promise<this>} - Updated model.
     */
    update(newAttributes?: Record<string, unknown>): Promise<this>;
    /**
     * Runs attach.
     * @param {?} attachmentInput - Attachment input or named attachment payload.
     * @returns {Promise<void>} - Resolves when attached.
     */
    attach(attachmentInput: unknown): Promise<void>;
    /**
     * Runs save.
     * @returns {Promise<this>} - Saved model.
     */
    save(): Promise<this>;
    /**
     * Returns the subset of `_attributes` whose value has diverged from
     * `_persistedAttributes`. Used by `save()` so the server receives only the
     * fields the caller actually changed — avoiding strict permit rejections on
     * framework-managed fields like `id`, `createdAt`, `updatedAt`, or owner
     * foreign keys that the resource never lists in `permittedParams`.
     * @returns {Record<string, ?>} - Changed attributes hash.
     */
    _changedAttributesForSave(): Record<string, unknown>;
    /**
     * Marks the current value for an attribute as already persisted so the next
     * save does not send it unless the caller changes it again.
     * @param {string} attributeName - Attribute to mark unchanged.
     * @returns {void}
     */
    markAttributeUnchanged(attributeName: string): void;
    /**
     * Runs destroy.
     * @returns {Promise<void>} - Resolves when destroyed on backend.
     */
    destroy(): Promise<void>;
    /**
     * Walks relationships declared in this resource's `nestedAttributes` config
     * and builds the per-relationship payload of dirty children for a parent save.
     *
     * Included children:
     *   - new records (isNewRecord()) → create entry with attributes
     *   - records marked for destruction (markedForDestruction()) → destroy entry
     *   - records with changed attributes (isChanged()) → update entry with attributes
     *   - records with dirty descendants in their own nestedAttributes → recurse
     *
     * Loaded but untouched records are omitted so nested save preserves Rails-style
     * "children not referenced in payload are left alone" semantics.
     * @returns {Record<string, Array<Record<string, ?>>>} - Per-relationship list of nested-attribute entries.
     */
    _buildNestedAttributesPayload(): Record<string, Array<Record<string, unknown>>>;
    /**
     * Builds the payload entry for this child when walked by a parent's
     * `_buildNestedAttributesPayload`. Returns `null` when the child has no
     * dirty state and no dirty descendants, so the parent can omit it.
     * @returns {Record<string, ?> | null} - Nested-attribute entry or null if clean.
     */
    _nestedAttributesEntryForParentSave(): Record<string, unknown> | null;
    /**
     * After a parent save with `nestedAttributes`, the server response includes
     * preloaded versions of the affected relationships. This replaces the local
     * `_loadedValue` for each nested-writable relationship with the server's
     * authoritative set, so destroyed children are dropped and newly-created
     * children get their server-assigned ids + persisted state.
     * @param {Record<string, ?>} response - Command response payload.
     * @returns {void}
     */
    _reconcileNestedAttributesFromResponse(response: Record<string, unknown>): void;
}
/**
 * Defines this typedef.
 */
export type FrontendModelModelEventCallbackEntry = {
    callback: (payload: {
        id: string;
        model: InstanceType<typeof FrontendModelBase>;
    }) => void;
    eventFilterKey: string | null;
    eventFilterPayload: import("./query.js").FrontendModelEventFilterPayload | null;
    projectionPayload: import("./query.js").FrontendModelProjectionPayload;
};
/**
 * Defines this typedef.
 */
export type FrontendModelDestroyEventCallbackEntry = {
    callback: (payload: {
        id: string;
    }) => void;
};
/**
 * FrontendModelCommandType type.
 */
export type FrontendModelCommandType = "create" | "find" | "index" | "update" | "destroy" | "attach" | "download" | "url";
/**
 * FrontendModelRequestCommandType type.
 */
export type FrontendModelRequestCommandType = FrontendModelCommandType | string;
/**
 * Defines this typedef.
 */
export type FrontendModelAttachmentDefinition = {
    type: "hasOne" | "hasMany";
};
/**
 * Defines this typedef.
 */
export type FrontendModelResourceConfig = {
    attributes?: string[];
    builtInCollectionCommands?: string[];
    builtInMemberCommands?: string[];
    collectionCommands?: string[];
    commands?: string[];
    memberCommands?: string[];
    attachments?: Record<string, FrontendModelAttachmentDefinition>;
    modelName?: string;
    nestedAttributes?: Record<string, {
        allowDestroy?: boolean;
        limit?: number;
    }>;
    primaryKey?: string;
    relationships?: string[];
};
/**
 * FrontendModelTransportConfig type.
 */
export type FrontendModelTransportConfig = {
    /**
     * - Optional frontend-model URL. This should be the shared endpoint (for example `"/frontend-models"` or `"https://example.com/frontend-models"`).
     */
    url?: string | (() => string | undefined | null) | undefined;
    /**
     * - Deprecated shared-endpoint flag retained for compatibility. Frontend-model CRUD/custom commands use the shared frontend-model API envelope by default.
     */
    shared?: boolean | undefined;
    /**
     * - Optional websocket URL. When set, Velocious creates and manages its own websocket client internally. Subscriptions use the websocket; CRUD uses HTTP and falls back gracefully. Example: `"ws://localhost:3006/websocket"`.
     */
    websocketUrl?: string | (() => string | undefined | null) | undefined;
    /**
     * - Optional websocket client for shared frontend-model API requests and subscriptions.
     */
    websocketClient?: {
        post: (path: string, body?: unknown, options?: {
            headers?: Record<string, string>;
        }) => Promise<{
            json: () => unknown;
        }>;
        subscribe: (channel: string, options: {
            params?: Record<string, unknown>;
        }, callback: (payload: unknown) => void) => (() => void);
        subscribeAndWait?: (channel: string, options: {
            params?: Record<string, unknown>;
        }, callback: (payload: unknown) => void) => Promise<(() => void)>;
    } | undefined;
    /**
     * - Extra HTTP/WS headers to attach to every frontend-model API request. Pass a function to compute them at request time (for example to include the current locale).
     */
    requestHeaders?: Record<string, string> | (() => Record<string, string>) | undefined;
    /**
     * - Optional sessionId persistence hook forwarded to the internal `VelociousWebsocketClient` so WS sessions can be resumed across page reloads / app restarts.
     */
    sessionStore?: {
        get: () => string | null | undefined | Promise<string | null | undefined>;
        set: (sessionId: string) => void | Promise<void>;
        clear: () => void | Promise<void>;
    } | undefined;
};
/**
 * FrontendModelIdleWaitArgs type.
 */
export type FrontendModelIdleWaitArgs = {
    /**
     * - Milliseconds the transport must stay idle before resolving.
     */
    quietMs?: number | undefined;
    /**
     * - Timeout in milliseconds.
     */
    timeout?: number | undefined;
};
import FrontendModelQuery from "./query.js";
//# sourceMappingURL=base.d.ts.map