@heroiclands/package-build 25.1.0 → 25.1.2

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.
@@ -59,24 +59,11 @@ export function languageNoteFindings(config: {
59
59
  * word's 0-based place in `data.words`, `native` the form's in its `native`.
60
60
  */
61
61
  export function nativeRows(records: Iterable<Record<string, any>>): Array<Record<string, string | number | null>>;
62
- /** Project only conversion-readable language data to a JSON-safe object. */
63
- export function serializeLexicon(lexicon: any): {
64
- language: any;
65
- data: {
66
- grammar?: {
67
- [k: string]: any;
68
- } | undefined;
69
- words: {
70
- [k: string]: any;
71
- }[];
72
- affixes: {
73
- [k: string]: any;
74
- }[];
75
- register: {
76
- [k: string]: any;
77
- }[];
78
- };
79
- } | undefined;
62
+ /**
63
+ * Project only conversion-readable language data to a JSON-safe object. The
64
+ * projection of one lexicon is made once and shared, so it must not be modified.
65
+ */
66
+ export function serializeLexicon(lexicon: any): any;
80
67
  /**
81
68
  * Resolve encoding, face and optional language input without loading files.
82
69
  *
@@ -129,23 +116,7 @@ export function encodingFor(ctx: import("./content-scripts.mjs").RunContext, { e
129
116
  };
130
117
  }>;
131
118
  font: any;
132
- lexicon: {
133
- language: any;
134
- data: {
135
- grammar?: {
136
- [k: string]: any;
137
- } | undefined;
138
- words: {
139
- [k: string]: any;
140
- }[];
141
- affixes: {
142
- [k: string]: any;
143
- }[];
144
- register: {
145
- [k: string]: any;
146
- }[];
147
- };
148
- } | undefined;
119
+ lexicon: any;
149
120
  } | undefined;
150
121
  /** Why a face is incompatible with the selected encoding. */
151
122
  export function fontProblem(encoding: any, font: any): string | undefined;
@@ -14,6 +14,7 @@ export function templateProgram(data: any, options: {
14
14
  fonts: any[];
15
15
  accepts: any[];
16
16
  separator: string;
17
+ roundTrip: string;
17
18
  vowels: any;
18
19
  rows: Readonly<unknown>[];
19
20
  codes: [string, string][];
@@ -12,6 +12,17 @@ export const ENCODING_RULE_FIELDS: readonly ({
12
12
  shape: string;
13
13
  describe: any;
14
14
  fields: any;
15
+ } | {
16
+ name: string;
17
+ kind: string;
18
+ shape: string;
19
+ entries: {
20
+ kind: string;
21
+ shape: string;
22
+ describe: string;
23
+ fields?: undefined;
24
+ };
25
+ describe: string;
15
26
  } | {
16
27
  name: string;
17
28
  kind: string;
@@ -20,13 +31,21 @@ export const ENCODING_RULE_FIELDS: readonly ({
20
31
  entries: {
21
32
  kind: string;
22
33
  shape: string;
23
- fields: {
34
+ fields: ({
35
+ name: any;
36
+ kind: string;
37
+ shape: string;
38
+ describe: any;
39
+ required: boolean;
40
+ } | {
41
+ allowed: string[];
24
42
  name: any;
25
43
  kind: string;
26
44
  shape: string;
27
45
  describe: any;
28
46
  required: boolean;
29
- }[];
47
+ })[];
48
+ describe?: undefined;
30
49
  };
31
50
  })[];
32
51
  /** The additional data keys a document may use to define its encoding. */
@@ -82,6 +101,17 @@ export const ENCODING_NOTE_FIELDS: readonly ({
82
101
  shape: string;
83
102
  describe: any;
84
103
  fields: any;
104
+ } | {
105
+ name: string;
106
+ kind: string;
107
+ shape: string;
108
+ entries: {
109
+ kind: string;
110
+ shape: string;
111
+ describe: string;
112
+ fields?: undefined;
113
+ };
114
+ describe: string;
85
115
  } | {
86
116
  name: string;
87
117
  kind: string;
@@ -90,13 +120,21 @@ export const ENCODING_NOTE_FIELDS: readonly ({
90
120
  entries: {
91
121
  kind: string;
92
122
  shape: string;
93
- fields: {
123
+ fields: ({
124
+ name: any;
125
+ kind: string;
126
+ shape: string;
127
+ describe: any;
128
+ required: boolean;
129
+ } | {
130
+ allowed: string[];
94
131
  name: any;
95
132
  kind: string;
96
133
  shape: string;
97
134
  describe: any;
98
135
  required: boolean;
99
- }[];
136
+ })[];
137
+ describe?: undefined;
100
138
  };
101
139
  })[];
102
140
  describe: string;
@@ -128,7 +128,7 @@ export function encodeText(enc: ReturnType<typeof compileEncoding>, text: string
128
128
  verse?: boolean;
129
129
  }): string;
130
130
  /**
131
- * Decode a note's uniquely decodable output, including nonprefix glyph sequences.
131
+ * Decode exact output or the conventional reading of an explicitly canonical note.
132
132
  * @param {ReturnType<typeof compileEncoding>} enc - Compiled encoding note.
133
133
  * @param {string} text - Native text with optional literal spans.
134
134
  * @param {{font?: string}} [options] - Selected encoding face.
@@ -16,7 +16,9 @@
16
16
  */
17
17
  export function nativeText(natives: unknown, enc: string, font: string | undefined): string | undefined;
18
18
  /**
19
- * The writings of a language's words under one encoding in one face.
19
+ * The writings of a language's words under one encoding in one face. One
20
+ * `data` yields one set of writings per encoding and face, and each word's
21
+ * writing is found once, so `data` must not be modified once it is read here.
20
22
  *
21
23
  * @param {Record<string, any>|undefined} data - The language note's `data`.
22
24
  * @param {string} enc - The encoding's name.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The block tokens of a Markdown source. The array is shared between callers
3
+ * and must not be modified; an `inline` token carries no `children`.
4
+ *
5
+ * @param {unknown} source - Markdown.
6
+ * @returns {readonly import("markdown-it").Token[]} The block tokens, in order.
7
+ */
8
+ export function blockTokens(source: unknown): readonly import("markdown-it").Token[];