import React, { Component, PropsWithChildren } from "react"; import { EnhancedComponent, ProviderConfig } from './types'; import { IFbClient } from '@featbit/js-client-sdk'; import { ProviderState } from "./providerState"; import { IFlagBase } from "@featbit/js-client-sdk/dist/esm/evaluation"; /** * The `FbProvider` is a component which accepts a config object which is used to * initialize `@featbit/js-client-sdk`. * * This Provider does three things: * - It initializes the FeatBit instance by calling `@featbit/js-client-sdk` init on `componentDidMount` * - It saves all flags and the FeatBit instance in the context API * - It subscribes to flag changes and propagate them through the context API * * Because the `@featbit/js-client-sdk` is only initialized on `componentDidMount`, your flags and the * FeatBit are only available after your app has mounted. This can result in a flicker due to flag changes at * startup time. * * This component can be used as a standalone provider. However, be mindful to only include the component once * within your application. This provider is used inside the `withFbProviderHOC` and can be used instead to initialize * the `@featbit/js-client-sdk`. For async initialization, check out the `asyncWithFbProvider` function */ declare class FbProvider extends Component, ProviderState> implements EnhancedComponent { readonly state: Readonly; bootstrapFlags?: IFlagBase[]; constructor(props: ProviderConfig); getReactOptions: () => { useCamelCaseFlagKeys: boolean; sendEventsOnFlagRead: boolean; }; subscribeToChanges: (fbClient: IFbClient) => void; onFailed: (fbClient: IFbClient, e: Error) => void; onReady: (fbClient: IFbClient, reactOptions: any) => Promise; prepareFbClient: () => Promise; componentDidMount(): Promise; componentDidUpdate(prevProps: ProviderConfig): Promise; render(): React.JSX.Element; } export default FbProvider;