import { ModifyCtx } from '../../../index.js';
import { PropDef, SchemaTypeDef } from '@based/schema/def';
import { ModifyState } from '../ModifyRes.js';
import { ModifyErr, ModifyOp } from '../types.js';
export type RefModifyOpts = {
    id?: number | ModifyState;
    $index?: number;
} & Record<`$${string}`, any>;
export type RefModify = ModifyState | RefModifyOpts | number;
export type Refs = RefModify[] | {
    add?: RefModify[] | RefModify;
    delete?: RefModify[] | RefModify;
    upsert: RefModify[] | RefModify;
};
export declare function writeReferences(value: any, ctx: ModifyCtx, schema: SchemaTypeDef, def: PropDef, res: ModifyState, mod: ModifyOp): ModifyErr;
export declare const dbUpdateFromUpsert: (ctx: ModifyCtx, schema: SchemaTypeDef, def: PropDef, res: ModifyState, promise: Promise<any>) => void;
