configcat-react
Version:
ConfigCat is a configuration as a service that lets you manage your features and configurations without actually deploying new code.
11 lines (10 loc) • 611 B
TypeScript
import type { IConfigCatClient, IUser, SettingTypeOf, SettingValue } from "@configcat/sdk";
import React from "react";
export type GetValueType = <T extends SettingValue>(key: string, defaultValue: T, user?: IUser) => Promise<SettingTypeOf<T>>;
export interface WithConfigCatClientProps {
configCatClient: IConfigCatClient;
getValue: GetValueType;
lastUpdated?: Date;
}
declare function withConfigCatClient<P>(WrappedComponent: React.ComponentType<P & WithConfigCatClientProps>, providerId?: string): React.ComponentType<Omit<P, keyof WithConfigCatClientProps>>;
export default withConfigCatClient;