@ecency/sdk 2.3.62 → 2.3.63
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/browser/index.d.ts
CHANGED
|
@@ -973,6 +973,13 @@ declare const CONFIG: {
|
|
|
973
973
|
/** Current Hive RPC nodes. Reads from the unified hive-tx config. */
|
|
974
974
|
readonly hiveNodes: string[];
|
|
975
975
|
heliusApiKey: string | undefined;
|
|
976
|
+
/**
|
|
977
|
+
* The React Query client all SDK code reads through `getQueryClient()`.
|
|
978
|
+
* Backed by a resolver so an SSR host can scope it per request — see the
|
|
979
|
+
* `queryClientResolver` note above. Assigning replaces the resolver with one
|
|
980
|
+
* that always returns the assigned client, preserving the previous
|
|
981
|
+
* "one client, set once" behaviour for browser and native hosts.
|
|
982
|
+
*/
|
|
976
983
|
queryClient: QueryClient;
|
|
977
984
|
pollsApiHost: string;
|
|
978
985
|
plausibleHost: string;
|
|
@@ -990,6 +997,25 @@ type DmcaListsInput = {
|
|
|
990
997
|
};
|
|
991
998
|
declare namespace ConfigManager {
|
|
992
999
|
function setQueryClient(client: QueryClient): void;
|
|
1000
|
+
/**
|
|
1001
|
+
* Register how the SDK should obtain its React Query client, for hosts where
|
|
1002
|
+
* a single shared instance is wrong — principally SSR, where one process
|
|
1003
|
+
* serves many requests and a shared cache both leaks memory and risks serving
|
|
1004
|
+
* one request's data to another.
|
|
1005
|
+
*
|
|
1006
|
+
* `resolve` is called on every SDK cache access and should return the client
|
|
1007
|
+
* belonging to the request currently being handled. In a Next.js App Router
|
|
1008
|
+
* host that means wrapping the factory in React's `cache()`, which memoises
|
|
1009
|
+
* per request:
|
|
1010
|
+
*
|
|
1011
|
+
* ```ts
|
|
1012
|
+
* ConfigManager.setQueryClientResolver(() => getQueryClient());
|
|
1013
|
+
* ```
|
|
1014
|
+
*
|
|
1015
|
+
* Registering a resolver supersedes any client previously passed to
|
|
1016
|
+
* `setQueryClient`; assigning a client afterwards supersedes the resolver.
|
|
1017
|
+
*/
|
|
1018
|
+
function setQueryClientResolver(resolve: () => QueryClient): void;
|
|
993
1019
|
/**
|
|
994
1020
|
* Set the private API host
|
|
995
1021
|
* @param host - The private API host URL (e.g., "https://ecency.com" or "" for relative URLs)
|
|
@@ -1191,6 +1217,11 @@ declare function isInfoError(error: any): boolean;
|
|
|
1191
1217
|
*/
|
|
1192
1218
|
declare function isNetworkError(error: any): boolean;
|
|
1193
1219
|
|
|
1220
|
+
/**
|
|
1221
|
+
* Builds a client with the SDK's defaults. It is only a factory — request
|
|
1222
|
+
* scoping is the host's job, via `ConfigManager.setQueryClientResolver`, since
|
|
1223
|
+
* only the host knows where one request ends and the next begins.
|
|
1224
|
+
*/
|
|
1194
1225
|
declare function makeQueryClient(): QueryClient;
|
|
1195
1226
|
declare const getQueryClient: () => QueryClient;
|
|
1196
1227
|
declare namespace EcencyQueriesManager {
|