@flagship.io/react-sdk 2.2.0-beta.2 → 2.2.0-beta.6
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/dist/es/FlagshipContext.js +15 -3
- package/dist/es/FlagshipHooks.js +2 -24
- package/dist/es/index.js +1 -1
- package/dist/esm/FlagshipContext.js +15 -3
- package/dist/esm/FlagshipHooks.js +3 -60
- package/dist/esm/index.js +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/FlagshipContext.d.ts +5 -6
- package/dist/types/FlagshipHooks.d.ts +8 -6
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { BucketingDTO, CampaignDTO, IFlagshipConfig, Modification, Visitor } from '@flagship.io/js-sdk';
|
|
3
|
-
export declare type primitive = string | number | boolean;
|
|
2
|
+
import { BucketingDTO, CampaignDTO, IFlagshipConfig, Modification, primitive, Visitor } from '@flagship.io/js-sdk';
|
|
4
3
|
export interface FsStatus {
|
|
5
4
|
/**
|
|
6
5
|
* Boolean. When true, the SDK is still not ready to render your App otherwise it'll use default modifications.
|
|
@@ -16,8 +15,8 @@ export interface FsStatus {
|
|
|
16
15
|
*/
|
|
17
16
|
isVisitorDefined?: boolean;
|
|
18
17
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* String or null. The last update date occurred on the flagship visitor instance.
|
|
19
|
+
*/
|
|
21
20
|
lastRefresh?: string;
|
|
22
21
|
/**
|
|
23
22
|
* String or null. When null no initialization succeed yet. When string contains stringified date of last successful initialization.
|
|
@@ -71,8 +70,8 @@ interface FlagshipProviderProps extends IFlagshipConfig {
|
|
|
71
70
|
initialCampaigns?: CampaignDTO[];
|
|
72
71
|
initialModifications?: Map<string, Modification> | Modification[];
|
|
73
72
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
* If true, it'll automatically call synchronizeModifications when the bucketing file has updated
|
|
74
|
+
*/
|
|
76
75
|
synchronizeOnBucketingUpdated?: boolean;
|
|
77
76
|
}
|
|
78
77
|
export declare const FlagshipContext: React.Context<FsContext>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HitAbstract, IHit, Modification, modificationsRequested, primitive } from '@flagship.io/js-sdk';
|
|
1
|
+
import { HitAbstract, HitShape, IHit, Modification, modificationsRequested, primitive } from '@flagship.io/js-sdk';
|
|
2
2
|
import { FsStatus } from './FlagshipContext';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve a modification value by its key. If no modification match the given key or if the stored value type and default value type do not match, default value will be returned.
|
|
@@ -41,10 +41,8 @@ export declare type UseFlagshipParams<T> = {
|
|
|
41
41
|
export declare type UseFlagshipOutput = {
|
|
42
42
|
modifications: Modification[];
|
|
43
43
|
status: FsStatus;
|
|
44
|
-
getModifications<T>(params: modificationsRequested<T>[], activateAll?: boolean):
|
|
45
|
-
|
|
46
|
-
getModificationInfo(key: string): Promise<Modification | null>;
|
|
47
|
-
getModificationInfoSync(key: string): Modification | null;
|
|
44
|
+
getModifications<T>(params: modificationsRequested<T>[], activateAll?: boolean): Record<string, T>;
|
|
45
|
+
getModificationInfo(key: string): Modification | null;
|
|
48
46
|
synchronizeModifications(): Promise<void>;
|
|
49
47
|
activateModification: {
|
|
50
48
|
(keys: {
|
|
@@ -76,11 +74,15 @@ export declare type UseFlagshipOutput = {
|
|
|
76
74
|
hit: {
|
|
77
75
|
send: {
|
|
78
76
|
(hit: HitAbstract): Promise<void>;
|
|
79
|
-
(hit:
|
|
77
|
+
(hit: IHit): Promise<void>;
|
|
78
|
+
(hit: HitShape): Promise<void>;
|
|
79
|
+
(hit: HitAbstract | IHit | HitShape): Promise<void>;
|
|
80
80
|
};
|
|
81
81
|
sendMultiple: {
|
|
82
82
|
(hit: HitAbstract[]): Promise<void>;
|
|
83
83
|
(hit: IHit[]): Promise<void>;
|
|
84
|
+
(hit: HitShape[]): Promise<void>;
|
|
85
|
+
(hit: HitAbstract[] | IHit[] | HitShape[]): Promise<void>;
|
|
84
86
|
};
|
|
85
87
|
};
|
|
86
88
|
};
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flagship.io/react-sdk",
|
|
3
|
-
"version": "2.2.0-beta.
|
|
3
|
+
"version": "2.2.0-beta.6",
|
|
4
4
|
"description": "Flagship REACT SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@flagship.io/js-sdk": "^2.3.1-beta.
|
|
14
|
+
"@flagship.io/js-sdk": "^2.3.1-beta.9",
|
|
15
15
|
"encoding": "^0.1.13"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|