import { ReactNode, ReactElement } from 'react'; export interface PermissionGateProps { /** Content to render when permission check passes */ children: ReactNode; /** * Required permission(s). * Supports wildcard patterns like "project:*" */ permission?: string; /** * Multiple permissions to check. * By default uses OR logic (any permission grants access). * Set requireAll=true for AND logic. */ permissions?: string[]; /** * Require all permissions (AND logic) instead of any (OR logic). * @default false */ requireAll?: boolean; /** * Required role(s). Checked in addition to permissions. */ role?: string; /** * Multiple roles to check. * By default uses OR logic (any role grants access). * Set requireAllRoles=true for AND logic. */ roles?: string[]; /** * Require all roles (AND logic) instead of any (OR logic). * @default false */ requireAllRoles?: boolean; /** * Content to render when permission check fails. * If not provided, nothing is rendered. */ fallback?: ReactNode; /** * Content to render while permissions are loading. * If not provided, nothing is rendered during loading. */ loading?: ReactNode; /** * Invert the permission check (render children when permission is DENIED). * Useful for showing "request access" buttons. * @default false */ invert?: boolean; } /** * PermissionGate - Conditionally render content based on permissions * * Features: * - Single or multiple permission checks * - AND/OR logic for multiple permissions * - Role-based checks * - Wildcard permission support (e.g., "project:*") * - Loading and fallback states * - Invert mode for showing "access denied" content * * @example Basic permission check * ```tsx * * * * ``` * * @example Multiple permissions (OR logic - default) * ```tsx * * * * ``` * * @example Multiple permissions (AND logic) * ```tsx * * * * ``` * * @example With fallback * ```tsx * } * > * * * ``` * * @example Role check * ```tsx * * * * ``` * * @example Inverted (show when permission is denied) * ```tsx * * * * ``` */ export declare function PermissionGate({ children, permission, permissions, requireAll, role, roles, requireAllRoles, fallback, loading, invert, }: PermissionGateProps): ReactElement | null; export interface PermissionButtonProps { /** The button element to wrap */ children: ReactElement; /** * Required permission(s). * Supports wildcard patterns like "project:*" */ permission?: string; /** * Multiple permissions to check. */ permissions?: string[]; /** * Require all permissions (AND logic). * @default false */ requireAll?: boolean; /** * Behavior when permission is denied. * - 'disable': Disable the button (default) * - 'hide': Hide the button completely * - 'tooltip': Show tooltip explaining why button is disabled * @default 'disable' */ deniedBehavior?: 'disable' | 'hide' | 'tooltip'; /** * Tooltip text when permission is denied. * Only used when deniedBehavior='tooltip' */ deniedTooltip?: string; /** * Additional className for the wrapper when using tooltip */ className?: string; } /** * PermissionButton - Wrap a button to disable/hide based on permissions * * @example Disable button when no permission * ```tsx * * * * ``` * * @example Hide button when no permission * ```tsx * * * * ``` */ export declare function PermissionButton({ children, permission, permissions, requireAll, deniedBehavior, deniedTooltip, className, }: PermissionButtonProps): ReactElement | null; export interface PermissionLinkProps { /** The link element to wrap */ children: ReactElement; /** * Required permission(s). */ permission?: string; /** * Multiple permissions to check. */ permissions?: string[]; /** * Require all permissions (AND logic). * @default false */ requireAll?: boolean; /** * Behavior when permission is denied. * - 'disable': Make link non-clickable (default) * - 'hide': Hide the link completely * @default 'disable' */ deniedBehavior?: 'disable' | 'hide'; /** * Custom styles for disabled state */ disabledClassName?: string; } /** * PermissionLink - Wrap a link to disable/hide based on permissions * * @example * ```tsx * * Settings * * ``` */ export declare function PermissionLink({ children, permission, permissions, requireAll, deniedBehavior, disabledClassName, }: PermissionLinkProps): ReactElement | null; //# sourceMappingURL=PermissionGate.d.ts.map