import { type SQL } from 'drizzle-orm';
/**
 * Builds an RBAC filter condition as a drizzle SQL object.
 * Use this with drizzle query builder.
 *
 * RBAC filter logic:
 * 1. If rbac_teams is NULL -> allow access (no restrictions)
 * 2. If rbac_teams is empty array -> allow access (no restrictions)
 * 3. Otherwise, check if any of user's teams match using json_each
 */
export declare function buildRbacFilter(rbacTeams?: string[], tableAlias?: string): SQL | undefined;
/**
 * Builds an RBAC filter condition as a raw SQL string.
 * Use this when constructing raw SQL queries with sql.raw().
 *
 * Same RBAC filter logic as buildRbacFilter but returns a string for raw SQL usage.
 */
export declare function buildRbacFilterRaw(rbacTeams?: string[], tableAlias?: string): string | null;
/**
 * Builds RBAC JOIN and filter for subqueries that need to join with combined_target_attributes CTE.
 * Returns both the LEFT JOIN clause and the AND filter condition for use in raw SQL subqueries.
 *
 * @param rbacTeams - Array of team names the user belongs to
 * @param entityKeyAlias - The alias for the entity key column (e.g., 'd.key', 'o.key')
 * @returns Object with `join` and `filter` SQL fragments (both empty if no RBAC teams)
 */
export declare function buildSubqueryRbacJoinAndFilter(rbacTeams?: string[], entityKeyAlias?: string): {
    join: SQL;
    filter: SQL;
};
//# sourceMappingURL=build-rbac-filter.d.ts.map