@statsig/react-bindings-on-device-eval 3.0.0-beta.1 → 3.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/NoopOnDeviceEvalClient.d.ts +5 -0
- package/src/StatsigContext.d.ts +7 -0
- package/src/StatsigProviderOnDeviceEval.d.ts +15 -0
- package/src/index.d.ts +14 -0
- package/src/useDynamicConfig.d.ts +3 -0
- package/src/useExperiment.d.ts +3 -0
- package/src/useFeatureGate.d.ts +3 -0
- package/src/useGateValue.d.ts +3 -0
- package/src/useLayer.d.ts +3 -0
- package/src/useOnDeviceClientAsyncInit.d.ts +5 -0
- package/src/useOnDeviceClientBootstrapInit.d.ts +2 -0
- package/src/useStatsigOnDeviceEvalClient.d.ts +7 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statsig/react-bindings-on-device-eval",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.3",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@statsig/client-core": "3.0.0-beta.
|
|
6
|
-
"@statsig/js-on-device-eval-client": "3.0.0-beta.
|
|
5
|
+
"@statsig/client-core": "3.0.0-beta.3",
|
|
6
|
+
"@statsig/js-on-device-eval-client": "3.0.0-beta.3"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
9
|
"react": "^16.6.3 || ^17.0.0 || ^18.0.0"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OnDeviceEvaluationsInterface } from '@statsig/client-core';
|
|
2
|
+
export interface StatsigContext {
|
|
3
|
+
readonly renderVersion: number;
|
|
4
|
+
readonly client: OnDeviceEvaluationsInterface;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("react").Context<StatsigContext>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { StatsigOnDeviceEvalClient, StatsigOptions } from '@statsig/js-on-device-eval-client';
|
|
3
|
+
type WithClient<T extends StatsigOnDeviceEvalClient> = {
|
|
4
|
+
client: T;
|
|
5
|
+
};
|
|
6
|
+
type WithConfiguration = {
|
|
7
|
+
sdkKey: string;
|
|
8
|
+
options?: StatsigOptions;
|
|
9
|
+
};
|
|
10
|
+
export type StatsigProviderOnDeviceEvalProps<T extends StatsigOnDeviceEvalClient> = {
|
|
11
|
+
children: ReactNode | ReactNode[];
|
|
12
|
+
loadingComponent?: ReactNode | ReactNode[];
|
|
13
|
+
} & (WithClient<T> | WithConfiguration);
|
|
14
|
+
export declare function StatsigProviderOnDeviceEval(props: StatsigProviderOnDeviceEvalProps<StatsigOnDeviceEvalClient>): JSX.Element;
|
|
15
|
+
export {};
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import StatsigContext from './StatsigContext';
|
|
2
|
+
import { StatsigProviderOnDeviceEval, StatsigProviderOnDeviceEvalProps } from './StatsigProviderOnDeviceEval';
|
|
3
|
+
import useDynamicConfig from './useDynamicConfig';
|
|
4
|
+
import useExperiment from './useExperiment';
|
|
5
|
+
import useFeatureGate from './useFeatureGate';
|
|
6
|
+
import useGateValue from './useGateValue';
|
|
7
|
+
import useLayer from './useLayer';
|
|
8
|
+
import { useOnDeviceClientAsyncInit } from './useOnDeviceClientAsyncInit';
|
|
9
|
+
import { useOnDeviceClientBootstrapInit } from './useOnDeviceClientBootstrapInit';
|
|
10
|
+
import { useStatsigOnDeviceEvalClient } from './useStatsigOnDeviceEvalClient';
|
|
11
|
+
export type { StatsigProviderOnDeviceEvalProps };
|
|
12
|
+
export * from '@statsig/client-core';
|
|
13
|
+
export * from '@statsig/js-on-device-eval-client';
|
|
14
|
+
export { StatsigContext, StatsigProviderOnDeviceEval, useOnDeviceClientAsyncInit, useOnDeviceClientBootstrapInit, useDynamicConfig, useExperiment, useFeatureGate, useGateValue, useLayer, useStatsigOnDeviceEvalClient, };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DynamicConfig, DynamicConfigEvaluationOptions, StatsigUser } from '@statsig/client-core';
|
|
2
|
+
export type UseDynamicConfigOptions = DynamicConfigEvaluationOptions;
|
|
3
|
+
export default function (configName: string, user: StatsigUser, options?: UseDynamicConfigOptions): DynamicConfig;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { OnDeviceEvaluationsInterface } from '@statsig/client-core';
|
|
2
|
+
type HositedFuncs = Pick<OnDeviceEvaluationsInterface, 'checkGate' | 'getFeatureGate' | 'getDynamicConfig' | 'getExperiment' | 'getLayer' | 'logEvent'>;
|
|
3
|
+
type Output = HositedFuncs & {
|
|
4
|
+
client: OnDeviceEvaluationsInterface;
|
|
5
|
+
};
|
|
6
|
+
export declare function useStatsigOnDeviceEvalClient(): Output;
|
|
7
|
+
export {};
|