@replanejs/svelte 0.7.0 → 0.7.2
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/context.d.ts +2 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/stores.d.ts +2 -2
- package/dist/stores.d.ts.map +1 -1
- package/dist/types.d.ts +8 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/context.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import type { ReplaneContextValue } from "./types";
|
|
|
4
4
|
* Set the Replane client in Svelte context.
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare function setReplaneContext<T extends
|
|
7
|
+
export declare function setReplaneContext<T extends Record<string, unknown>>(client: ReplaneClient<T>): void;
|
|
8
8
|
/**
|
|
9
9
|
* Get the Replane context from Svelte context.
|
|
10
10
|
* @internal
|
|
11
11
|
*/
|
|
12
|
-
export declare function getReplaneContext<T extends
|
|
12
|
+
export declare function getReplaneContext<T extends Record<string, unknown> = any>(): ReplaneContextValue<T>;
|
|
13
13
|
/**
|
|
14
14
|
* Check if Replane context is available.
|
|
15
15
|
* @internal
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAInD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAGnG;AAED;;;GAGG;AAEH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAMnG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAO3C"}
|
package/dist/stores.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { ReplaneContextValue, UseConfigOptions } from "./types";
|
|
|
19
19
|
* </script>
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
export declare function useReplane<T extends
|
|
22
|
+
export declare function useReplane<T extends Record<string, unknown> = any>(): ReplaneContextValue<T>;
|
|
23
23
|
/**
|
|
24
24
|
* Create a reactive store for a specific config value.
|
|
25
25
|
*
|
|
@@ -72,5 +72,5 @@ export declare function useConfig<T>(name: string, options?: UseConfigOptions):
|
|
|
72
72
|
* {/if}
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
export declare function createConfigStore<T, C extends
|
|
75
|
+
export declare function createConfigStore<T, C extends Record<string, unknown> = any>(client: ReplaneClient<C>, name: string, options?: UseConfigOptions): Readable<T>;
|
|
76
76
|
//# sourceMappingURL=stores.d.ts.map
|
package/dist/stores.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../src/stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,KAAK,mBAAmB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../src/stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAErE;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAE5F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,CAYlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG,EAC1E,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,QAAQ,CAAC,CAAC,CAAC,CAOb"}
|
package/dist/types.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import type { Snippet } from "svelte";
|
|
|
3
3
|
/**
|
|
4
4
|
* Context value containing the Replane client
|
|
5
5
|
*/
|
|
6
|
-
export interface ReplaneContextValue<T extends
|
|
6
|
+
export interface ReplaneContextValue<T extends Record<string, unknown> = any> {
|
|
7
7
|
client: ReplaneClient<T>;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Props for ReplaneProvider when using a pre-created client.
|
|
11
11
|
*/
|
|
12
|
-
export interface ReplaneProviderWithClientProps<T extends
|
|
12
|
+
export interface ReplaneProviderWithClientProps<T extends Record<string, unknown> = any> {
|
|
13
13
|
/** Pre-created ReplaneClient instance */
|
|
14
14
|
client: ReplaneClient<T>;
|
|
15
15
|
/** Children snippet */
|
|
@@ -18,7 +18,7 @@ export interface ReplaneProviderWithClientProps<T extends object = any> {
|
|
|
18
18
|
/**
|
|
19
19
|
* Props for ReplaneProvider when letting it manage the client internally.
|
|
20
20
|
*/
|
|
21
|
-
export interface ReplaneProviderWithOptionsProps<T extends
|
|
21
|
+
export interface ReplaneProviderWithOptionsProps<T extends Record<string, unknown> = any> {
|
|
22
22
|
/** Options to create the ReplaneClient */
|
|
23
23
|
options: ReplaneClientOptions<T>;
|
|
24
24
|
/** Children snippet */
|
|
@@ -36,7 +36,7 @@ export interface ReplaneProviderWithOptionsProps<T extends object = any> {
|
|
|
36
36
|
/**
|
|
37
37
|
* Props for ReplaneProvider when restoring from a snapshot (SSR/hydration).
|
|
38
38
|
*/
|
|
39
|
-
export interface ReplaneProviderWithSnapshotProps<T extends
|
|
39
|
+
export interface ReplaneProviderWithSnapshotProps<T extends Record<string, unknown> = any> {
|
|
40
40
|
/** Snapshot from server-side rendering */
|
|
41
41
|
snapshot: ReplaneSnapshot<T>;
|
|
42
42
|
/** Optional connection options for live updates */
|
|
@@ -51,19 +51,19 @@ export interface ReplaneProviderWithSnapshotProps<T extends object = any> {
|
|
|
51
51
|
/** Children snippet */
|
|
52
52
|
children: Snippet;
|
|
53
53
|
}
|
|
54
|
-
export type ReplaneProviderProps<T extends
|
|
54
|
+
export type ReplaneProviderProps<T extends Record<string, unknown> = any> = ReplaneProviderWithClientProps<T> | ReplaneProviderWithOptionsProps<T> | ReplaneProviderWithSnapshotProps<T>;
|
|
55
55
|
/**
|
|
56
56
|
* Type guard to check if props contain a pre-created client.
|
|
57
57
|
*/
|
|
58
|
-
export declare function hasClient<T extends
|
|
58
|
+
export declare function hasClient<T extends Record<string, unknown>>(props: ReplaneProviderProps<T>): props is ReplaneProviderWithClientProps<T>;
|
|
59
59
|
/**
|
|
60
60
|
* Type guard to check if props contain options.
|
|
61
61
|
*/
|
|
62
|
-
export declare function hasOptions<T extends
|
|
62
|
+
export declare function hasOptions<T extends Record<string, unknown>>(props: ReplaneProviderProps<T>): props is ReplaneProviderWithOptionsProps<T>;
|
|
63
63
|
/**
|
|
64
64
|
* Type guard to check if props contain a snapshot.
|
|
65
65
|
*/
|
|
66
|
-
export declare function hasSnapshot<T extends
|
|
66
|
+
export declare function hasSnapshot<T extends Record<string, unknown>>(props: ReplaneProviderProps<T>): props is ReplaneProviderWithSnapshotProps<T>;
|
|
67
67
|
/**
|
|
68
68
|
* Options for useConfig
|
|
69
69
|
*/
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC;;GAEG;AAEH,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,GAAG;IAC1E,MAAM,EAAE,aAAa,C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CAAC,CAAC,GAClC,gCAAgC,CAAC,CAAC,CAAC,CAAC;AAExC;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC7B,KAAK,IAAI,8BAA8B,CAAC,CAAC,CAAC,CAE5C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1D,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC7B,KAAK,IAAI,+BAA+B,CAAC,CAAC,CAAC,CAE7C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC7B,KAAK,IAAI,gCAAgC,CAAC,CAAC,CAAC,CAE9C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;CAC5D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replanejs/svelte",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Svelte SDK for Replane - feature flags and remote configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"svelte": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"svelte": ">=4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@replanejs/sdk": "0.7.
|
|
42
|
+
"@replanejs/sdk": "^0.7.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@sveltejs/package": "^2.3.10",
|