import type { Schema } from '../../zero-schema/src/builder/schema-builder.ts';
import type { ServerSchema } from '../../zero-schema/src/server-schema.ts';
import type { DBTransaction, SchemaCRUD, SchemaQuery, TransactionBase } from '../../zql/src/mutate/custom.ts';
interface ServerTransaction<S extends Schema, TWrappedTransaction> extends TransactionBase<S> {
    readonly location: 'server';
    readonly reason: 'authoritative';
    readonly dbTransaction: DBTransaction<TWrappedTransaction>;
}
export type CustomMutatorDefs<TDBTransaction> = {
    [namespaceOrKey: string]: {
        [key: string]: CustomMutatorImpl<TDBTransaction>;
    } | CustomMutatorImpl<TDBTransaction>;
};
export type CustomMutatorImpl<TDBTransaction, TArgs = any> = (tx: TDBTransaction, args: TArgs) => Promise<void>;
export declare class TransactionImpl<S extends Schema, TWrappedTransaction> implements ServerTransaction<S, TWrappedTransaction> {
    readonly location = "server";
    readonly reason = "authoritative";
    readonly dbTransaction: DBTransaction<TWrappedTransaction>;
    readonly clientID: string;
    readonly mutationID: number;
    readonly mutate: SchemaCRUD<S>;
    readonly query: SchemaQuery<S>;
    constructor(dbTransaction: DBTransaction<TWrappedTransaction>, clientID: string, mutationID: number, mutate: SchemaCRUD<S>, query: SchemaQuery<S>);
}
export declare function makeServerTransaction<S extends Schema, TWrappedTransaction>(dbTransaction: DBTransaction<TWrappedTransaction>, clientID: string, mutationID: number, schema: S, mutate: (dbTransaction: DBTransaction<TWrappedTransaction>, serverSchema: ServerSchema) => SchemaCRUD<S>, query: (dbTransaction: DBTransaction<TWrappedTransaction>, serverSchema: ServerSchema) => SchemaQuery<S>): Promise<TransactionImpl<S, TWrappedTransaction>>;
export declare function makeSchemaCRUD<S extends Schema>(schema: S): (dbTransaction: DBTransaction<unknown>, serverSchema: ServerSchema) => SchemaCRUD<S>;
export {};
//# sourceMappingURL=custom.d.ts.map