@heroiclands/package-build 22.27.0 → 23.0.0

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.
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Require `data.language` to address a `skill` note whose subType is
3
+ * `language`.
4
+ *
5
+ * An Address that does not resolve is the reference check's to report, so
6
+ * this speaks only about a target that exists and is the wrong kind.
7
+ *
8
+ * @param {object} note
9
+ * @param {{index?: object}} [options]
10
+ * @returns {object[]} The findings.
11
+ */
12
+ export function checkLanguageChoice(note: object, { index }?: {
13
+ index?: object;
14
+ }): object[];
15
+ /**
16
+ * Refuse a literature field on a lore note of any other subType.
17
+ *
18
+ * @param {object} note
19
+ * @returns {object[]} One error per literature key written off `literature`.
20
+ */
21
+ export function checkLiteratureNote(note: object): object[];
22
+ /** The `lore` subType whose notes are works of literature. */
23
+ export const LITERATURE_SUBTYPE: "literature";
24
+ /**
25
+ * The fields a `literature` note may state. Every one is optional.
26
+ *
27
+ * @type {ReadonlyArray<object>}
28
+ */
29
+ export const LITERATURE_FIELDS: ReadonlyArray<object>;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * One local page's node.
3
+ *
4
+ * @param {object} fm - The note's frontmatter.
5
+ * @param {{title: string, url?: string, package?: string}} page
6
+ * @returns {WorksNode|null} Null for a note with no type or shortcode.
7
+ */
8
+ export function worksNode(fm: object, { title, url, package: pkg }: {
9
+ title: string;
10
+ url?: string;
11
+ package?: string;
12
+ }): WorksNode | null;
13
+ /**
14
+ * The works a fetched index carries, as nodes. Only a work can list itself on
15
+ * a page, and only a page of this package can carry the list, so a foreign
16
+ * entry that is not a work is never needed here.
17
+ *
18
+ * @param {Map<string, object>|undefined} foreignIndex
19
+ * @returns {WorksNode[]}
20
+ */
21
+ export function foreignWorksNodes(foreignIndex: Map<string, object> | undefined): WorksNode[];
22
+ /**
23
+ * Invert every work's subjects into the list each subject's page carries.
24
+ *
25
+ * A subject is resolved in its work's own package. A work naming one subject
26
+ * twice lists once; a work naming itself is not listed on its own page.
27
+ * Entries sort by title.
28
+ *
29
+ * @param {Iterable<WorksNode|null>} nodes - Every local page, then any foreign work.
30
+ * @param {object} options
31
+ * @param {ReadonlySet<string>} options.types - Note types an Address may name.
32
+ * @returns {Map<string, {works: WorkEntry[]}>} Keyed by the subject page's URL.
33
+ */
34
+ export function worksPages(nodes: Iterable<WorksNode | null>, { types }: {
35
+ types: ReadonlySet<string>;
36
+ }): Map<string, {
37
+ works: WorkEntry[];
38
+ }>;
39
+ /** The page front-matter key the site build writes. */
40
+ export const WORKS_KEY: "works";
41
+ export type WorkEntry = {
42
+ title: string;
43
+ url?: string;
44
+ form?: string;
45
+ };
46
+ export type WorksNode = {
47
+ /**
48
+ * Own Address, normalized to the `note` system.
49
+ */
50
+ key: string;
51
+ title: string;
52
+ /**
53
+ * Absent for a note that publishes no page.
54
+ */
55
+ url?: string | undefined;
56
+ /**
57
+ * Owning content package.
58
+ */
59
+ package?: string | undefined;
60
+ /**
61
+ * A work's `data.form`.
62
+ */
63
+ form?: string | undefined;
64
+ /**
65
+ * A work's `data.subjects`; empty for any other note.
66
+ */
67
+ subjects: unknown[];
68
+ };
@@ -455,8 +455,8 @@ export type DataFieldSpec = {
455
455
  *
456
456
  * Two types answer **false**, and both are structural: a `folder` note's page
457
457
  * is a generated section index and a `homepage`'s is the site's front door, so
458
- * each is complete with no body at all. An empty body on one of them keeps its
459
- * address and resolves as `full`.
458
+ * an empty body on one of them keeps its address and resolves as `full`.
459
+ * This is classification only: author validation requires a body for every type.
460
460
  */
461
461
  export type TypeVocabulary = {
462
462
  /**