/** * Tenant Context * * Manages tenant context for the current request. */ import type { Tenant, TenantMember } from '../types/index.js'; /** * Tenant context for current request */ export interface TenantContext { /** Current tenant */ tenant: Tenant; /** Current user's membership (if authenticated) */ membership?: TenantMember; /** Is this a system/admin context */ isSystem?: boolean; } /** * Create tenant context for a request */ export declare function createTenantContext(tenant: Tenant, membership?: TenantMember): TenantContext; /** * Get current tenant from context */ export declare function getCurrentTenant(): Tenant | null; /** * Get current tenant context */ export declare function getTenantContext(): TenantContext | null; /** * Run function with tenant context */ export declare function withTenantContext(context: TenantContext, fn: () => T | Promise): Promise; /** * Run function with system context (bypasses tenant checks) */ export declare function withSystemContext(fn: () => T | Promise): Promise; /** * Assert tenant context exists */ export declare function requireTenantContext(): TenantContext; /** * Assert current tenant exists */ export declare function requireTenant(): Tenant; //# sourceMappingURL=tenant-context.d.ts.map