import { toStaticParam, type Condition, type Parameter } from '../../zero-protocol/src/ast.ts';
import type { ExpressionBuilder } from '../../zql/src/query/expression.ts';
import type { Query } from '../../zql/src/query/query.ts';
import type { Schema } from './builder/schema-builder.ts';
import type { PermissionsConfig as CompiledPermissionsConfig } from './compiled-permissions.ts';
export declare const ANYONE_CAN: ((_: unknown, eb: ExpressionBuilder<Schema, never>) => Condition)[];
/**
 * @deprecated Use {@link ANYONE_CAN} instead.
 */
export declare const ANYONE_CAN_DO_ANYTHING: {
    row: {
        select: ((_: unknown, eb: ExpressionBuilder<Schema, never>) => Condition)[];
        insert: ((_: unknown, eb: ExpressionBuilder<Schema, never>) => Condition)[];
        update: {
            preMutation: ((_: unknown, eb: ExpressionBuilder<Schema, never>) => Condition)[];
            postMutation: ((_: unknown, eb: ExpressionBuilder<Schema, never>) => Condition)[];
        };
        delete: ((_: unknown, eb: ExpressionBuilder<Schema, never>) => Condition)[];
    };
};
export declare const NOBODY_CAN: never[];
export type Anchor = 'authData' | 'preMutationRow';
export type Queries<TSchema extends Schema> = {
    [K in keyof TSchema['tables']]: Query<Schema, K & string>;
};
export type PermissionRule<TAuthDataShape, TSchema extends Schema, TTable extends keyof TSchema['tables'] & string> = (authData: TAuthDataShape, eb: ExpressionBuilder<TSchema, TTable>) => Condition;
export type AssetPermissions<TAuthDataShape, TSchema extends Schema, TTable extends keyof TSchema['tables'] & string> = {
    select?: PermissionRule<TAuthDataShape, TSchema, TTable>[] | undefined;
    /**
     * @deprecated Use Mutators instead.
     * @see {@link https://zero.rocicorp.dev/docs/writing-data}
     */
    insert?: PermissionRule<TAuthDataShape, TSchema, TTable>[] | undefined;
    /**
     * @deprecated Use Mutators instead.
     * @see {@link https://zero.rocicorp.dev/docs/writing-data}
     */
    update?: {
        preMutation?: PermissionRule<TAuthDataShape, TSchema, TTable>[];
        postMutation?: PermissionRule<TAuthDataShape, TSchema, TTable>[];
    } | undefined;
    /**
     * @deprecated Use Mutators instead.
     * @see {@link https://zero.rocicorp.dev/docs/writing-data}
     */
    delete?: PermissionRule<TAuthDataShape, TSchema, TTable>[] | undefined;
};
export type PermissionsConfig<TAuthDataShape, TSchema extends Schema> = {
    [K in keyof TSchema['tables']]?: {
        row?: AssetPermissions<TAuthDataShape, TSchema, K & string> | undefined;
        cell?: {
            [C in keyof TSchema['tables'][K]['columns']]?: Omit<AssetPermissions<TAuthDataShape, TSchema, K & string>, 'cell'>;
        } | undefined;
    };
};
export declare function definePermissions<TAuthDataShape, TSchema extends Schema>(schema: TSchema, definer: () => Promise<PermissionsConfig<TAuthDataShape, TSchema>> | PermissionsConfig<TAuthDataShape, TSchema>): Promise<CompiledPermissionsConfig | undefined>;
export declare const authDataRef: {
    [toStaticParam]: () => Parameter;
};
export declare const preMutationRowRef: {
    [toStaticParam]: () => Parameter;
};
export declare function staticParam(anchorClass: 'authData' | 'preMutationRow', field: string | string[]): Parameter;
//# sourceMappingURL=permissions.d.ts.map