@backmatter/core 0.0.62 → 0.0.64
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/package.json +1 -1
- package/src/source.ts +5 -2
package/package.json
CHANGED
package/src/source.ts
CHANGED
|
@@ -11,8 +11,11 @@ export type SourceDef<T = unknown> = {
|
|
|
11
11
|
list?: () => Promise<readonly string[]>;
|
|
12
12
|
/** One representative record for template preview. Omit to preview the template with `data: null`. */
|
|
13
13
|
sample?: () => Promise<T | null>;
|
|
14
|
-
/**
|
|
15
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Metadata when the document has no `title`. Method syntax on purpose: a
|
|
16
|
+
* typed `SourceDef<Product>` must still fit `Record<string, SourceDef>`.
|
|
17
|
+
*/
|
|
18
|
+
metadata?(record: T): { title?: string };
|
|
16
19
|
};
|
|
17
20
|
|
|
18
21
|
/** Identity helper that validates the definition and keeps the record type. */
|