@skylabs-digital/react-identity-access
Version:
A comprehensive React library for multi-tenancy, authentication, authorization, roles, session management, and settings management
23 lines (22 loc) • 823 B
TypeScript
import { ReactNode } from 'react';
import { FeatureFlagItem } from '../types/api';
export interface FeatureFlagConfig {
refreshInterval?: number;
onError?: (error: Error) => void;
}
export interface FeatureFlagContextValue {
featureFlags: FeatureFlagItem[];
loading: boolean;
error: string | null;
isEnabled: (flagName: string) => boolean;
getFlag: (flagName: string) => FeatureFlagItem | undefined;
refresh: () => Promise<void>;
}
interface FeatureFlagProviderProps {
config?: FeatureFlagConfig;
children: ReactNode;
}
export declare function FeatureFlagProvider({ config, children }: FeatureFlagProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useFeatureFlags(): FeatureFlagContextValue;
export {};
//# sourceMappingURL=FeatureFlagProvider.d.ts.map