@@ -21,23 +21,31 @@ export interface useDocumentPreviewOptions extends DocumentHandle {
21
21
* @category Types
22
22
*/
23
23
export interface useDocumentPreviewResults {
24
- /** The results of resolving the document’s preview values */
24
+ /** The results of inferring the document’s preview values */
25
25
data : PreviewValue
26
- /** True when preview values are being refreshed */
26
+ /** True when inferred preview values are being refreshed */
27
27
isPending : boolean
28
28
}
29
29
30
30
/**
31
31
* @public
32
32
*
33
- * Returns the preview values of a document (specified via a `DocumentHandle`),
33
+ * Attempts to infer preview values of a document (specified via a `DocumentHandle`),
34
34
* including the document’s `title`, `subtitle`, `media`, and `status`. These values are live and will update in realtime.
35
35
* To reduce unnecessary network requests for resolving the preview values, an optional `ref` can be passed to the hook so that preview
36
36
* resolution will only occur if the `ref` is intersecting the current viewport.
37
37
*
38
+ * See remarks below for futher information.
39
+ *
40
+ * @remarks
41
+ * Values returned by this hook may not be as expected. It is currently unable to read preview values as defined in your schema;
42
+ * instead, it attempts to infer these preview values by checking against a basic set of potential fields on your document.
43
+ * We are anticipating being able to significantly improve this hook’s functionality and output in a future release.
44
+ * For now, we recommend using {@link useDocumentProjection} for rendering individual document fields (or projections of those fields).
45
+ *
38
46
* @category Documents
39
- * @param options - The document handle for the document you want to resolve preview values for, and an optional ref
40
- * @returns The preview values for the given document and a boolean to indicate whether the resolution is pending
47
+ * @param options - The document handle for the document you want to infer preview values for, and an optional ref
48
+ * @returns The inferred values for the given document and a boolean to indicate whether the resolution is pending
41
49
*
42
50
* @example Combining with useDocuments to render a collection of document previews
43
51
* ```
0 commit comments