@atlaskit/node-data-provider 12.0.13 → 12.0.15
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/CHANGELOG.md +12 -0
- package/find-nodes-to-prefetch/package.json +1 -8
- package/node-data-provider/package.json +1 -8
- package/package.json +2 -2
- package/prefetch-node-data-providers-data/package.json +1 -8
- package/dist/types-ts4.5/entry-points/find-nodes-to-prefetch.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/node-data-provider.d.ts +0 -2
- package/dist/types-ts4.5/entry-points/prefetch-node-data-providers-data.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -4
- package/dist/types-ts4.5/node-data-provider.d.ts +0 -214
- package/dist/types-ts4.5/utils/find-nodes-to-prefetch.d.ts +0 -22
- package/dist/types-ts4.5/utils/prefetch-node-data-providers-data.d.ts +0 -125
package/CHANGELOG.md
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/find-nodes-to-prefetch.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/find-nodes-to-prefetch.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/find-nodes-to-prefetch.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/find-nodes-to-prefetch.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/find-nodes-to-prefetch.d.ts"
|
|
15
8
|
}
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/node-data-provider.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/node-data-provider.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/node-data-provider.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/node-data-provider.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/node-data-provider.d.ts"
|
|
15
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/node-data-provider",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.15",
|
|
4
4
|
"description": "Node data provider for @atlaskit/editor-core plugins and @atlaskit/renderer",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@atlaskit/editor-json-transformer": "^8.33.0",
|
|
23
23
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
24
24
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
25
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
25
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
26
26
|
"@babel/runtime": "^7.0.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/prefetch-node-data-providers-data.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/prefetch-node-data-providers-data.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/prefetch-node-data-providers-data.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/prefetch-node-data-providers-data.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/prefetch-node-data-providers-data.d.ts"
|
|
15
8
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { findNodesToPrefetch } from '../utils/find-nodes-to-prefetch';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { prefetchNodeDataProvidersData } from '../utils/prefetch-node-data-providers-data';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { NodeDataProvider } from './node-data-provider';
|
|
2
|
-
export type { CallbackPayload } from './node-data-provider';
|
|
3
|
-
export { findNodesToPrefetch } from './utils/find-nodes-to-prefetch';
|
|
4
|
-
export { prefetchNodeDataProvidersData } from './utils/prefetch-node-data-providers-data';
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import type { JSONNode } from '@atlaskit/editor-json-transformer';
|
|
2
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the SSR data for a single provider.
|
|
5
|
-
* It's a map where each key is a unique node data key and the value is the prefetched data for that node.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* {
|
|
9
|
-
* 'node-id-1': { value: 'some data' },
|
|
10
|
-
* 'node-id-2': { value: 'other data' }
|
|
11
|
-
* }
|
|
12
|
-
*/
|
|
13
|
-
type SSRData<Data> = {
|
|
14
|
-
[dataKey: string]: Data;
|
|
15
|
-
};
|
|
16
|
-
type CacheRecords<Data> = SSRData<Data>;
|
|
17
|
-
/**
|
|
18
|
-
* Represents the cached data for a Node Data Provider.
|
|
19
|
-
* Each key is a unique node data key, and the value is an object containing:
|
|
20
|
-
* - `source`: Indicates whether the data was fetched from SSR or the network.
|
|
21
|
-
* - `data`: The actual data, which can be either a resolved value or a Promise.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* {
|
|
25
|
-
* 'node-id-1': { source: 'ssr', data: { value: 'some data' } },
|
|
26
|
-
* 'node-id-2': { source: 'network', data: { value: 'other data' } }
|
|
27
|
-
* }
|
|
28
|
-
*/
|
|
29
|
-
type CacheData<Data> = Record<string, {
|
|
30
|
-
data: Data;
|
|
31
|
-
source: 'ssr' | 'network';
|
|
32
|
-
}>;
|
|
33
|
-
/**
|
|
34
|
-
* Represents the payload passed to the callback function when data is fetched.
|
|
35
|
-
* It can either contain an error or the fetched data.
|
|
36
|
-
*/
|
|
37
|
-
export type CallbackPayload<Data> = {
|
|
38
|
-
data?: undefined;
|
|
39
|
-
/** An error that occurred while fetching data. */
|
|
40
|
-
error: Error;
|
|
41
|
-
} | {
|
|
42
|
-
/** Fetched data for the node. */
|
|
43
|
-
data: Data;
|
|
44
|
-
error?: undefined;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* A Node Data Provider is responsible for fetching and caching data associated with specific ProseMirror nodes.
|
|
48
|
-
* It supports a cache-first-then-network strategy, with initial data potentially provided via SSR.
|
|
49
|
-
*
|
|
50
|
-
* @template Node The specific type of JSONNode this provider supports.
|
|
51
|
-
* @template Data The type of data this provider fetches and manages.
|
|
52
|
-
*/
|
|
53
|
-
export declare abstract class NodeDataProvider<Node extends JSONNode, Data> {
|
|
54
|
-
private cacheVersion;
|
|
55
|
-
private cache;
|
|
56
|
-
private readonly networkRequestsInFlight;
|
|
57
|
-
/**
|
|
58
|
-
* A unique name for the provider. Used for identification in SSR.
|
|
59
|
-
*/
|
|
60
|
-
abstract readonly name: string;
|
|
61
|
-
/**
|
|
62
|
-
* A type guard to check if a given JSONNode is supported by this provider.
|
|
63
|
-
* Used to ensure that the provider can handle the node type before attempting to fetch data.
|
|
64
|
-
*
|
|
65
|
-
* @param node The node to check.
|
|
66
|
-
* @returns `true` if the node is of the type supported by this provider, otherwise `false`.
|
|
67
|
-
*/
|
|
68
|
-
abstract isNodeSupported(node: JSONNode): node is Node;
|
|
69
|
-
/**
|
|
70
|
-
* Generates a unique key for a given node to be used for caching.
|
|
71
|
-
*
|
|
72
|
-
* @param node The node for which to generate a data key.
|
|
73
|
-
* @returns A unique string key for the node's data.
|
|
74
|
-
*/
|
|
75
|
-
abstract nodeDataKey(node: Node): string;
|
|
76
|
-
/**
|
|
77
|
-
* Fetches data for a batch of nodes from the network or another asynchronous source.
|
|
78
|
-
*
|
|
79
|
-
* @param nodes An array of nodes for which to fetch data.
|
|
80
|
-
* @returns A promise that resolves to an array of data corresponding to the input nodes.
|
|
81
|
-
*/
|
|
82
|
-
abstract fetchNodesData(nodes: Node[]): Promise<Data[]>;
|
|
83
|
-
protected constructor();
|
|
84
|
-
/**
|
|
85
|
-
* Sets the SSR data for the provider.
|
|
86
|
-
* This pre-populates the cache with data rendered on the server, preventing redundant network requests on the client.
|
|
87
|
-
* Calling this method will invalidate the existing cache.
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* ```
|
|
91
|
-
* const ssrData = window.__SSR_NODE_DATA__ || {};
|
|
92
|
-
* nodeDataProvider.setSSRData(ssrData);
|
|
93
|
-
* ```
|
|
94
|
-
*
|
|
95
|
-
* @param ssrData A map of node data keys to their corresponding data.
|
|
96
|
-
*/
|
|
97
|
-
setSSRData(ssrData?: SSRData<Data>): void;
|
|
98
|
-
/**
|
|
99
|
-
* Clears all cached data.
|
|
100
|
-
* This increments the internal cache version, invalidating any pending network requests.
|
|
101
|
-
*
|
|
102
|
-
* @example
|
|
103
|
-
* ```
|
|
104
|
-
* function useMyNodeDataProvider(contentId: string) {
|
|
105
|
-
* const nodeDataProvider = new MyNodeDataProvider();
|
|
106
|
-
*
|
|
107
|
-
* // Reset the cache when the contentId changes (e.g., when the user navigates to a different page).
|
|
108
|
-
* useEffect(() => {
|
|
109
|
-
* nodeDataProvider.resetCache();
|
|
110
|
-
* }, [contentId]);
|
|
111
|
-
*
|
|
112
|
-
* return nodeDataProvider;
|
|
113
|
-
* }
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
resetCache(): void;
|
|
117
|
-
/**
|
|
118
|
-
* Fetches data for a given node using a cache-first-then-network strategy.
|
|
119
|
-
*
|
|
120
|
-
* The provided callback may be called multiple times:
|
|
121
|
-
* 1. Immediately with data from the SSR cache, if available.
|
|
122
|
-
* 2. Asynchronously with data fetched from the network.
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* ```
|
|
126
|
-
* const nodeDataProvider = new MyNodeDataProvider();
|
|
127
|
-
*
|
|
128
|
-
* nodeDataProvider.getData(node, (data) => {
|
|
129
|
-
* console.log('Node data:', data);
|
|
130
|
-
* });
|
|
131
|
-
* ```
|
|
132
|
-
*
|
|
133
|
-
* @param node The node (or its ProseMirror representation) for which to fetch data.
|
|
134
|
-
* @param callback The callback function to call with the fetched data or an error.
|
|
135
|
-
*/
|
|
136
|
-
getData(node: Node | PMNode, callback: (payload: CallbackPayload<Data>) => void): void;
|
|
137
|
-
protected getDataAsync(node: Node | PMNode, callback: (payload: CallbackPayload<Data>) => void): Promise<void>;
|
|
138
|
-
/**
|
|
139
|
-
* Fetches data for a given node and returns it as a Promise.
|
|
140
|
-
* This is a convenience wrapper around the `data` method for use with async/await.
|
|
141
|
-
*
|
|
142
|
-
* Note: This promise resolves with the *first* available data, which could be from the SSR cache or the network.
|
|
143
|
-
* It may not provide the most up-to-date data if a network fetch is in progress.
|
|
144
|
-
*
|
|
145
|
-
* Note: This method is only for migration purposes. Use {@link getData} in new code instead.
|
|
146
|
-
*
|
|
147
|
-
* @private
|
|
148
|
-
* @deprecated Don't use this method, use {@link getData} method instead.
|
|
149
|
-
* This method is only for migration purposes.
|
|
150
|
-
*
|
|
151
|
-
* @param node The node (or its ProseMirror representation) for which to fetch data.
|
|
152
|
-
* @returns A promise that resolves with the node's data.
|
|
153
|
-
*/
|
|
154
|
-
getDataAsPromise_DO_NOT_USE_OUTSIDE_MIGRATIONS(node: Node | PMNode): Promise<Data>;
|
|
155
|
-
/**
|
|
156
|
-
* Checks the cache for the given node and returns its status.
|
|
157
|
-
*
|
|
158
|
-
* Possible return values:
|
|
159
|
-
* - `false`: No cached data found for the node.
|
|
160
|
-
* - `'ssr'`: Data is cached from server-side rendering (SSR).
|
|
161
|
-
* - `'network'`: Data is cached from a network request.
|
|
162
|
-
*
|
|
163
|
-
* @param node The node (or its ProseMirror representation) to check in the cache.
|
|
164
|
-
* @returns The cache status: `false`, `'ssr'`, or `'network'`.
|
|
165
|
-
*/
|
|
166
|
-
getCacheStatusForNode(node: Node | PMNode): false | 'ssr' | 'network';
|
|
167
|
-
/**
|
|
168
|
-
* Retrieves the cached data for a given node, if available.
|
|
169
|
-
*
|
|
170
|
-
* @param node The node (or its ProseMirror representation) for which to retrieve cached data.
|
|
171
|
-
* @returns The cached data object containing `data` and `source`, or `undefined` if no cache entry exists.
|
|
172
|
-
*/
|
|
173
|
-
getNodeDataFromCache(node: JSONNode | PMNode): CacheData<Data>[string] | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* Returns the keys of the cache.
|
|
176
|
-
*
|
|
177
|
-
* @returns An array of the keys of the cache.
|
|
178
|
-
*/
|
|
179
|
-
getNodeDataCacheKeys(): string[];
|
|
180
|
-
/**
|
|
181
|
-
* Updates the cache with new records using merge or replace strategies.
|
|
182
|
-
* This method should be the only way to modify the cache directly.
|
|
183
|
-
* This allow subclasses to use it when needed. e.g. abstract fetchNodesData implementation.
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```
|
|
187
|
-
* const newRecords = {
|
|
188
|
-
* 'node-id-1': { value: 'updated data' },
|
|
189
|
-
* 'node-id-3': { value: 'new data' }
|
|
190
|
-
* };
|
|
191
|
-
* nodeDataProvider.updateCache(newRecords, { strategy: 'merge', source: 'network' });
|
|
192
|
-
* ```
|
|
193
|
-
*
|
|
194
|
-
* Supports two strategies:
|
|
195
|
-
* - 'merge' (default): Merges new records into the existing cache.
|
|
196
|
-
* - 'replace': Replaces the entire cache with the new records, invalidating any in-flight requests.
|
|
197
|
-
*
|
|
198
|
-
* @param records A map of node data keys to their corresponding data.
|
|
199
|
-
* @param options Optional settings for the update operation.
|
|
200
|
-
* @param options.strategy The strategy to use for updating the cache ('merge' or 'replace'). Defaults to 'merge'.
|
|
201
|
-
* @param options.source The source of the data being added ('ssr' or 'network'). Defaults to 'network'.
|
|
202
|
-
*/
|
|
203
|
-
updateCache(records?: CacheRecords<Data>, options?: {
|
|
204
|
-
source?: 'ssr' | 'network';
|
|
205
|
-
strategy?: 'merge' | 'replace';
|
|
206
|
-
}): void;
|
|
207
|
-
/**
|
|
208
|
-
* Removes one or more entries from the cache.
|
|
209
|
-
*
|
|
210
|
-
* @param keys A single data key or array of data keys to remove from the cache.
|
|
211
|
-
*/
|
|
212
|
-
removeFromCache(keys: string[]): void;
|
|
213
|
-
}
|
|
214
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
2
|
-
import type { NodeDataProvider } from '../node-data-provider';
|
|
3
|
-
interface ProviderWithNodes {
|
|
4
|
-
/** The nodes that are supported by the provider. */
|
|
5
|
-
nodes: JSONNode[];
|
|
6
|
-
/** The provider that supports the nodes. */
|
|
7
|
-
provider: NodeDataProvider<JSONNode, unknown>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Finds nodes in the document that are supported by the given providers, up to a maximum number of nodes.
|
|
11
|
-
* Uses iterative Depth-First Search (DFS) to traverse the document.
|
|
12
|
-
*
|
|
13
|
-
* @param doc The document to search for nodes.
|
|
14
|
-
* @param providers An array of providers with their maximum nodes to prefetch.
|
|
15
|
-
* @param maxNodesToVisit The maximum number of nodes to visit in the document.
|
|
16
|
-
* @returns An array of objects, each containing a provider and the nodes that are supported by that provider.
|
|
17
|
-
*/
|
|
18
|
-
export declare function findNodesToPrefetch(doc: JSONDocNode, providers: {
|
|
19
|
-
maxNodesToPrefetch: number;
|
|
20
|
-
provider: NodeDataProvider<JSONNode, unknown>;
|
|
21
|
-
}[], maxNodesToVisit: number): ProviderWithNodes[];
|
|
22
|
-
export {};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import type { JSONDocNode, JSONNode } from '@atlaskit/editor-json-transformer';
|
|
2
|
-
import type { NodeDataProvider } from '../node-data-provider';
|
|
3
|
-
/**
|
|
4
|
-
* Represents the SSR data for a single provider.
|
|
5
|
-
* It's a map where each key is a unique node data key and the value is the prefetched data for that node.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* {
|
|
9
|
-
* 'node-id-1': { value: 'some data' },
|
|
10
|
-
* 'node-id-2': { value: 'other data' }
|
|
11
|
-
* }
|
|
12
|
-
*/
|
|
13
|
-
type SsrData = {
|
|
14
|
-
[dataKey: string]: unknown;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Represents the aggregated SSR data for all node data providers.
|
|
18
|
-
* Each key is a provider's name, and the value contains the fetch status, duration,
|
|
19
|
-
* and a map of node data keys to their prefetched data.
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```
|
|
23
|
-
* {
|
|
24
|
-
* mentionProvider: {
|
|
25
|
-
* success: true,
|
|
26
|
-
* duration: 220,
|
|
27
|
-
* data: {
|
|
28
|
-
* 'mention-1': { id: '1', name: 'John Doe' }
|
|
29
|
-
* }
|
|
30
|
-
* },
|
|
31
|
-
* emojiProvider: {
|
|
32
|
-
* success: true,
|
|
33
|
-
* duration: 110,
|
|
34
|
-
* data: {
|
|
35
|
-
* 'emoji-123': { shortName: ':smile:', representation: '😊' }
|
|
36
|
-
* }
|
|
37
|
-
* }
|
|
38
|
-
* }
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
type NodeDataProvidersSsrData = {
|
|
42
|
-
[providerName: string]: {
|
|
43
|
-
data: SsrData;
|
|
44
|
-
duration: number;
|
|
45
|
-
success: boolean;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
interface Props {
|
|
49
|
-
/**
|
|
50
|
-
* The document for which to prefetch data.
|
|
51
|
-
*/
|
|
52
|
-
doc: JSONDocNode;
|
|
53
|
-
/**
|
|
54
|
-
* The maximum number of nodes to visit when searching for nodes to prefetch.
|
|
55
|
-
* This is a performance safeguard for very large documents.
|
|
56
|
-
*
|
|
57
|
-
* @default If not specified, the entire document will be traversed.
|
|
58
|
-
*/
|
|
59
|
-
maxNodesToVisit?: number;
|
|
60
|
-
/**
|
|
61
|
-
* A list of node data providers to use for prefetching, along with their
|
|
62
|
-
* individual configurations.
|
|
63
|
-
*/
|
|
64
|
-
providers: {
|
|
65
|
-
/**
|
|
66
|
-
* The maximum number of nodes to prefetch for this specific provider.
|
|
67
|
-
* This helps prevent performance issues with documents containing many
|
|
68
|
-
* nodes of the same type.
|
|
69
|
-
*
|
|
70
|
-
* @default If not specified, all nodes supported by the provider will be prefetched.
|
|
71
|
-
*/
|
|
72
|
-
maxNodesToPrefetch?: number;
|
|
73
|
-
/**
|
|
74
|
-
* The provider instance to use for prefetching.
|
|
75
|
-
*/
|
|
76
|
-
provider: NodeDataProvider<JSONNode, unknown>;
|
|
77
|
-
/**
|
|
78
|
-
* The timeout in milliseconds for the fetch request for this specific provider.
|
|
79
|
-
* If the request takes longer than this, it will be aborted and return no data.
|
|
80
|
-
*
|
|
81
|
-
* @default If not specified, the global timeout will be used.
|
|
82
|
-
*/
|
|
83
|
-
timeout?: number;
|
|
84
|
-
}[];
|
|
85
|
-
/**
|
|
86
|
-
* A global timeout in milliseconds for all fetch requests.
|
|
87
|
-
*
|
|
88
|
-
* Each provider will use the minimum of this value and its own specific timeout.
|
|
89
|
-
*/
|
|
90
|
-
timeout: number;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Fetches data for nodes in the document that are supported by the given providers.
|
|
94
|
-
* This function will traverse the document and call the `fetchData` method for each node that is supported by the providers.
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```
|
|
98
|
-
* const doc = JSON.parse('{"type": "doc", "content": [...] }');
|
|
99
|
-
* const providers = [
|
|
100
|
-
* {
|
|
101
|
-
* provider: new EditorCardProvider(),
|
|
102
|
-
* maxNodesToPrefetch: 10,
|
|
103
|
-
* timeout: 500,
|
|
104
|
-
* },
|
|
105
|
-
* {
|
|
106
|
-
* provider: new EditorMentionsProvider(),
|
|
107
|
-
* maxNodesToPrefetch: 50,
|
|
108
|
-
* timeout: 500,
|
|
109
|
-
* },
|
|
110
|
-
* ];
|
|
111
|
-
*
|
|
112
|
-
* const data = await prefetchNodeDataProvidersData({
|
|
113
|
-
* providers,
|
|
114
|
-
* doc,
|
|
115
|
-
* timeout: 1_000,
|
|
116
|
-
* maxNodesToVisit: 2_000
|
|
117
|
-
* });
|
|
118
|
-
* ```
|
|
119
|
-
*
|
|
120
|
-
* @param props The properties for prefetching node data.
|
|
121
|
-
* @returns Record of provider names to their respective SSR data,
|
|
122
|
-
* success status, and duration of the fetch operation.
|
|
123
|
-
*/
|
|
124
|
-
export declare function prefetchNodeDataProvidersData({ providers, doc, timeout, maxNodesToVisit, }: Props): Promise<NodeDataProvidersSsrData>;
|
|
125
|
-
export {};
|