UNPKG

@obelism/improve-sdk-react

Version:
24 lines (21 loc) 1.03 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { ImproveClientSDK } from '@obelism/improve-sdk/client'; import { ImproveSetupArgs } from '@obelism/improve-sdk/types'; type ImproveProviderProps = { children?: React.ReactNode; }; type ImproveContextType = { getFlagValue: ImproveClientSDK['getFlagValue']; getTestValue: ImproveClientSDK['getTestValue']; postAnalytic: ImproveClientSDK['postAnalytic']; }; type ImproveStatus = 'loading' | 'setup' | 'error'; declare const generateImproveProvider: (improveSetupArgs: ImproveSetupArgs) => { ImproveProvider: ({ children }: ImproveProviderProps) => react_jsx_runtime.JSX.Element; useImproveStatus: () => ImproveStatus; usePostAnalytic: (testSlug: string) => (event: string, message?: string) => Promise<Response>; useTestValue: (testSlug: string, fallback?: string) => string; useFlagValue: (flagSlug: string, fallback?: string) => string; }; export { generateImproveProvider }; export type { ImproveContextType, ImproveProviderProps };