@gondola-lyrics/kit 0.3.0 → 0.5.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.
package/dist/parser.d.ts CHANGED
@@ -1,6 +1,29 @@
1
1
  import { Diagnostic } from '@gondola-lyrics/model/runtime';
2
2
  import { runtime } from '@gondola-lyrics/model';
3
3
 
4
+ export declare const DEFAULT_CREDIT_NAME_SEPARATORS: readonly ["+", ":", "/"];
5
+
6
+ /**
7
+ * Derives emphasis for normal words in lead and background vocals using complete, valid word ranges.
8
+ * The stored word duration must strictly exceed durationThreshold; metadata offset and duration have no effect.
9
+ *
10
+ * Source emphasis, including an explicit false, is preserved; derived emphasis is cleared when a word no longer qualifies.
11
+ *
12
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
13
+ *
14
+ * @throws {RangeError} If durationThreshold is not a non-negative safe integer in milliseconds.
15
+ */
16
+ export declare const deriveWordEmphasis: (lyric: runtime.Lyric, options?: DeriveWordEmphasisOptions) => runtime.Lyric;
17
+
18
+ export declare interface DeriveWordEmphasisOptions {
19
+ /**
20
+ * Word duration must strictly exceed this threshold, expressed as a non-negative safe integer in milliseconds.
21
+ *
22
+ * @default 3000
23
+ */
24
+ durationThreshold?: number;
25
+ }
26
+
4
27
  /**
5
28
  * Recognition reads only the original text; the annotation tracks never decide the format.
6
29
  *
@@ -8,6 +31,193 @@ import { runtime } from '@gondola-lyrics/model';
8
31
  */
9
32
  export declare const detectFormat: (input: unknown) => LyricFormat | undefined;
10
33
 
34
+ /**
35
+ * Extracts colon-prefixed performers and carries them across nonempty normal lines, replacing their existing agent lists.
36
+ * Missing bindings enables legacy name inference; supplied bindings accept exact prefixes and reset propagation on unmatched prefixes.
37
+ * Removing prefixes preserves retained line and word times, but drops prefix-only lines with their attached content.
38
+ *
39
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
40
+ *
41
+ * @throws {TypeError} If bindings reference an agent id absent from lyric.agents.
42
+ */
43
+ export declare const extractAgents: (lyric: runtime.Lyric, options?: ExtractAgentsOptions) => runtime.Lyric;
44
+
45
+ export declare interface ExtractAgentsOptions {
46
+ /**
47
+ * Maps complete, trimmed prefixes to existing agent ids, preserving array order for joint performers.
48
+ * Matching is case-sensitive and preserves internal whitespace; an empty object disables automatic inference.
49
+ * Omitting this option enables legacy name inference; explicit bindings override its clock exclusion.
50
+ */
51
+ bindings?: Readonly<Record<string, string | readonly string[]>>;
52
+ /**
53
+ * Removes matched prefixes and drops lines left with no sung text, including their attached content.
54
+ *
55
+ * @default true
56
+ */
57
+ removePrefixes?: boolean;
58
+ }
59
+
60
+ /**
61
+ * Pulls bracketed background vocals out of the sung lines and attaches them to the line they accompany.
62
+ *
63
+ * A line holding nothing but brackets becomes a background of the line before it and is removed.
64
+ * A bracket opened on one line and closed on a later one joins the line before the opening, and both source lines go.
65
+ * Text outside brackets stays on its line, and a line left with none keeps its place.
66
+ *
67
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
68
+ */
69
+ export declare const extractBackgroundLines: (lyric: runtime.Lyric, options?: ExtractBackgroundLinesOptions) => runtime.Lyric;
70
+
71
+ export declare interface ExtractBackgroundLinesOptions {
72
+ /**
73
+ * Turn a line holding nothing but brackets into a background line of the line before it.
74
+ *
75
+ * @default true
76
+ */
77
+ fullLine?: boolean;
78
+ /**
79
+ * Pull the bracketed runs inside a line out into background lines of that same line.
80
+ *
81
+ * @default true
82
+ */
83
+ inLine?: boolean;
84
+ /**
85
+ * Join a bracket opened on one line and closed on a later one, attaching it to the line before them.
86
+ *
87
+ * @default true
88
+ */
89
+ crossLine?: boolean;
90
+ }
91
+
92
+ /**
93
+ * Preserves source labels and name spelling while matching normalized credit labels in normal lead lines.
94
+ * Merges names by role and original label without inferring their language.
95
+ *
96
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
97
+ */
98
+ export declare const extractCredits: (lyric: runtime.Lyric, options?: ExtractCreditsOptions) => runtime.Lyric;
99
+
100
+ export declare interface ExtractCreditsOptions {
101
+ /**
102
+ * Removes extracted source lines unless they carry background vocals, line annotations, or word translations or romanizations.
103
+ * Ruby annotations alone do not prevent removal.
104
+ *
105
+ * Refreshes language usages and falls back to line timing when no word-level content remains.
106
+ *
107
+ * @default false
108
+ */
109
+ removeSourceLines?: boolean;
110
+ /**
111
+ * Splits names at literal separators and ignores empty strings; an empty list preserves the complete source name.
112
+ * Longer separators take precedence so overlapping delimiters remain predictable.
113
+ *
114
+ * @default DEFAULT_CREDIT_NAME_SEPARATORS
115
+ */
116
+ nameSeparators?: readonly string[];
117
+ }
118
+
119
+ /**
120
+ * Inserts derived instrumental lines into uncovered gaps on the stored timeline, starting at zero.
121
+ * Existing lines and background vocals occupy their full ranges; an unknown end blocks later gaps.
122
+ *
123
+ * An outro requires an explicit endTime; metadata duration and offset do not affect insertion.
124
+ *
125
+ * @returns The input when unchanged, or a new lyric and lines array sharing existing nodes.
126
+ */
127
+ export declare const insertInstrumentalLines: (lyric: runtime.Lyric, options?: InsertInstrumentalLinesOptions) => runtime.Lyric;
128
+
129
+ export declare interface InsertInstrumentalLinesOptions {
130
+ /**
131
+ * Minimum gap duration in milliseconds, including an outro.
132
+ *
133
+ * @default 10000
134
+ */
135
+ minDuration?: number;
136
+ /**
137
+ * Minimum gap duration before the first vocal in milliseconds.
138
+ *
139
+ * @default 5000
140
+ */
141
+ minIntroDuration?: number;
142
+ /**
143
+ * Outro boundary in milliseconds, measured on the same timeline as line ranges.
144
+ * An omitted boundary leaves the outro unknown.
145
+ */
146
+ endTime?: number;
147
+ }
148
+
149
+ /**
150
+ * Inserts the spaces a source left out, so CJK text set against Latin letters, digits or punctuation reads evenly.
151
+ *
152
+ * A word-level line keeps every word's time and annotation: an inserted space becomes its own space word,
153
+ * and a word the rules split yields one word per character, all sharing the original range.
154
+ * A plain-text line and the annotation tracks are rewritten as whole strings.
155
+ *
156
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
157
+ */
158
+ export declare const insertSpacesInLines: (lyric: runtime.Lyric, options?: InsertSpacesOptions) => runtime.Lyric;
159
+
160
+ export declare interface InsertSpacesOptions {
161
+ /**
162
+ * Rules to apply; omitting the list applies all of them.
163
+ */
164
+ rules?: InsertSpacesRule[];
165
+ /**
166
+ * Rewrite the translation and romanization tracks too.
167
+ *
168
+ * @default true
169
+ */
170
+ annotations?: boolean;
171
+ }
172
+
173
+ export declare type InsertSpacesRule = (typeof InsertSpacesRules)[keyof typeof InsertSpacesRules];
174
+
175
+ /**
176
+ * Groups of characters a source may write without a space where one belongs.
177
+ */
178
+ export declare const InsertSpacesRules: {
179
+ /**
180
+ * A CJK character touching a Latin letter, as in `ABC中文`.
181
+ */
182
+ readonly CJK_ENGLISH: "cjkEnglish";
183
+ /**
184
+ * A CJK character touching a digit, as in `2026年`.
185
+ */
186
+ readonly CJK_NUMBER: "cjkNumber";
187
+ /**
188
+ * A comma, semicolon, exclamation mark, question mark or colon touching a character, as in `a,b`; a clock time or thousands separator such as `10:30` stays as written.
189
+ */
190
+ readonly PUNCTUATION: "punctuation";
191
+ /**
192
+ * A quotation mark touching a neighbouring character.
193
+ */
194
+ readonly QUOTE: "quote";
195
+ /**
196
+ * A bracket touching the character outside it.
197
+ */
198
+ readonly BRACKET_OUTSIDE: "bracketOutside";
199
+ /**
200
+ * A plus, equals or ampersand touching a character, as in `a+b`; a compound operator such as `a+=b` stays as written.
201
+ */
202
+ readonly MATH_OPERATOR: "mathOperator";
203
+ /**
204
+ * A hyphen touching a CJK character, as in `中-文`; a compound word such as `well-known` stays as written.
205
+ */
206
+ readonly HYPHEN: "hyphen";
207
+ /**
208
+ * A slash touching a character, as in `and/or`; a fraction such as `1/2` stays as written.
209
+ */
210
+ readonly SLASH: "slash";
211
+ /**
212
+ * Runs of two or more spaces, collapsed to one.
213
+ */
214
+ readonly COMPRESS_SPACES: "compressSpaces";
215
+ /**
216
+ * Spaces just inside a bracket or quotation mark, removed.
217
+ */
218
+ readonly TRIM_INSIDE_SYMBOLS: "trimInsideSymbols";
219
+ };
220
+
11
221
  declare interface LrcContent {
12
222
  original: string;
13
223
  translations?: string;
@@ -22,28 +232,60 @@ export declare interface LrcParseOptions {
22
232
  * Defaults to `0`, which requires an exact match.
23
233
  */
24
234
  annotationTolerance?: number;
235
+ /**
236
+ * Maximum roman token drift outside a matched word, in milliseconds; matched boundaries are adjusted to that word.
237
+ * Original word timing is preserved, and incomplete word matches retain the source line romanization.
238
+ *
239
+ * @default 0
240
+ */
241
+ wordAnnotationTolerance?: number;
242
+ /**
243
+ * Recovers unmatched roman fragments from unique two-kana combination starts or equal-sized gaps between timing anchors.
244
+ * Only a base kana followed by its small kana combines; doubled consonants and long vowels retain the whole line romanization.
245
+ * Recovered token times are clipped to their original word; untimed fragments inherit its range.
246
+ *
247
+ * @default false
248
+ */
249
+ wordAnnotationFallback?: boolean;
25
250
  }
26
251
 
27
252
  /**
28
253
  * Values match the lowercase format names stored in `Lyric.format`.
29
254
  */
30
- export declare type LyricFormat = 'lrc' | 'ttml';
255
+ export declare type LyricFormat = 'lrc' | 'qrc' | 'ttml';
256
+
257
+ /**
258
+ * Categories the bundled filter rules identify, in rule order.
259
+ */
260
+ export declare const NON_LYRIC_CATEGORIES: readonly string[];
31
261
 
32
262
  /**
33
263
  * Unrecognized text returns `null`; a recognized format returns its canonical lyric and diagnostics.
34
264
  * Annotation tracks travel with the source and are attached by the format's parser.
35
265
  */
36
- export declare const parse: (input: unknown, options?: LrcParseOptions & TtmlParseOptions) => ParseResult | null;
266
+ export declare const parse: (input: unknown, options?: LrcParseOptions & QrcParseOptions & TtmlParseOptions) => ParseResult | null;
37
267
 
38
268
  /**
39
- * Source order, empty timed lines, and missing word times are preserved for model validation.
269
+ * Empty timed rows become instrumental lines; source order and missing word times remain for model validation.
40
270
  *
41
271
  * Annotation tracks are read as lines too and attached by timestamp, and rows that match no line are dropped.
272
+ * Complete roman tracks attach to words by timing and optional local recovery; other tracks retain their source line text.
42
273
  *
43
274
  * `INVALID` means no readable timed lines; the returned diagnostics carry whatever the canonical tree breaks.
44
275
  */
45
276
  export declare const parseLrc: (input: string | LrcParseInput, options?: LrcParseOptions) => ParseResult;
46
277
 
278
+ /**
279
+ * Parses plaintext or XML QRC, retaining explicit timing, word romanization, and ruby from kana metadata.
280
+ * Original-track kana supplies ruby and is removed from the returned metadata.
281
+ *
282
+ * @param input Original lyrics with optional translation and romanization tracks.
283
+ * @param options Independent line and word tolerances, with optional local roman recovery.
284
+ *
285
+ * @returns Canonical lyrics and source diagnostics; an empty result has INVALID status.
286
+ */
287
+ export declare const parseQrc: (input: string | QrcParseInput, options?: QrcParseOptions) => ParseResult;
288
+
47
289
  /**
48
290
  * A parsed lyric in canonical form, with every rule it breaks.
49
291
  */
@@ -60,6 +302,75 @@ export declare interface ParseResult {
60
302
  */
61
303
  export declare const parseTtml: (input: TtmlParseInput, options?: TtmlParseOptions) => ParseResult;
62
304
 
305
+ declare interface QrcContent {
306
+ original: string;
307
+ translations?: string;
308
+ romans?: string;
309
+ }
310
+
311
+ export declare type QrcParseInput = QrcContent;
312
+
313
+ export declare interface QrcParseOptions {
314
+ /**
315
+ * Extra tolerance in milliseconds for line annotations left after exact time and row order matching.
316
+ *
317
+ * @default 0
318
+ */
319
+ annotationTolerance?: number;
320
+ /**
321
+ * Extra word-boundary tolerance in milliseconds; native QRC tracks allow at least 1ms for rounding.
322
+ * LRC auxiliary tracks use exact word boundaries by default, and incomplete matches retain the whole line romanization.
323
+ *
324
+ * @default 0
325
+ */
326
+ wordAnnotationTolerance?: number;
327
+ /**
328
+ * Recovers unmatched roman fragments from unique two-kana combination starts or equal-sized gaps between timing anchors.
329
+ * Only a base kana followed by its small kana combines; doubled consonants and long vowels retain the whole line romanization.
330
+ * Recovered token times are clipped to their original word; untimed fragments inherit its range.
331
+ *
332
+ * @default false
333
+ */
334
+ wordAnnotationFallback?: boolean;
335
+ }
336
+
337
+ /**
338
+ * Removes normal lead lines matched by the shared notice rules and, when musicInfo is provided, first-line song information.
339
+ * The first non-empty normal line must have one literal " - " separator and a known title and artist on opposite sides; either order and extra text such as bracketed aliases are accepted.
340
+ * Drops attached annotations and backgrounds, refreshes language usages, and falls back to line timing when no word-level content remains.
341
+ *
342
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
343
+ */
344
+ export declare const removeNonLyricLines: (lyric: runtime.Lyric, options?: RemoveNonLyricLinesOptions) => runtime.Lyric;
345
+
346
+ export declare interface RemoveNonLyricLinesOptions {
347
+ /**
348
+ * Removes lines identified under these categories; an empty list skips the shared rules.
349
+ * First-line music information is selected independently.
350
+ *
351
+ * @default NON_LYRIC_CATEGORIES
352
+ */
353
+ categories?: readonly string[];
354
+ /**
355
+ * Enables first-line music-information matching using these known titles and artists.
356
+ * Omitting this option, or leaving either list empty, skips the check; lyric metadata is not inferred.
357
+ */
358
+ musicInfo?: {
359
+ titles?: readonly string[];
360
+ artists?: readonly string[];
361
+ };
362
+ }
363
+
364
+ /**
365
+ * Removes the brackets some sources wrap around background vocals.
366
+ *
367
+ * One layer is removed from each edge of every background line, leaving a nested pair as `(x)`.
368
+ * A line left with no content is dropped, since a background line must carry something.
369
+ *
370
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
371
+ */
372
+ export declare const stripBackgroundBrackets: (lyric: runtime.Lyric) => runtime.Lyric;
373
+
63
374
  export declare type TtmlParseInput = string;
64
375
 
65
376
  export declare interface TtmlParseOptions {
package/dist/parser.js CHANGED
@@ -1 +1,3 @@
1
- export { detectFormat, parse, parseLrc, parseTtml } from "./formats.js";
1
+ import { detectFormat, parse, parseLrc, parseQrc, parseTtml } from "./formats.js";
2
+ import { DEFAULT_CREDIT_NAME_SEPARATORS, InsertSpacesRules, NON_LYRIC_CATEGORIES, deriveWordEmphasis, extractAgents, extractBackgroundLines, extractCredits, insertInstrumentalLines, insertSpacesInLines, removeNonLyricLines, stripBackgroundBrackets } from "./transforms.js";
3
+ export { DEFAULT_CREDIT_NAME_SEPARATORS, InsertSpacesRules, NON_LYRIC_CATEGORIES, deriveWordEmphasis, detectFormat, extractAgents, extractBackgroundLines, extractCredits, insertInstrumentalLines, insertSpacesInLines, parse, parseLrc, parseQrc, parseTtml, removeNonLyricLines, stripBackgroundBrackets };
@@ -1 +1,257 @@
1
- export {}
1
+ import { runtime } from '@gondola-lyrics/model';
2
+
3
+ export declare const DEFAULT_CREDIT_NAME_SEPARATORS: readonly ["+", ":", "/"];
4
+
5
+ /**
6
+ * Derives emphasis for normal words in lead and background vocals using complete, valid word ranges.
7
+ * The stored word duration must strictly exceed durationThreshold; metadata offset and duration have no effect.
8
+ *
9
+ * Source emphasis, including an explicit false, is preserved; derived emphasis is cleared when a word no longer qualifies.
10
+ *
11
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
12
+ *
13
+ * @throws {RangeError} If durationThreshold is not a non-negative safe integer in milliseconds.
14
+ */
15
+ export declare const deriveWordEmphasis: (lyric: runtime.Lyric, options?: DeriveWordEmphasisOptions) => runtime.Lyric;
16
+
17
+ export declare interface DeriveWordEmphasisOptions {
18
+ /**
19
+ * Word duration must strictly exceed this threshold, expressed as a non-negative safe integer in milliseconds.
20
+ *
21
+ * @default 3000
22
+ */
23
+ durationThreshold?: number;
24
+ }
25
+
26
+ /**
27
+ * Extracts colon-prefixed performers and carries them across nonempty normal lines, replacing their existing agent lists.
28
+ * Missing bindings enables legacy name inference; supplied bindings accept exact prefixes and reset propagation on unmatched prefixes.
29
+ * Removing prefixes preserves retained line and word times, but drops prefix-only lines with their attached content.
30
+ *
31
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
32
+ *
33
+ * @throws {TypeError} If bindings reference an agent id absent from lyric.agents.
34
+ */
35
+ export declare const extractAgents: (lyric: runtime.Lyric, options?: ExtractAgentsOptions) => runtime.Lyric;
36
+
37
+ export declare interface ExtractAgentsOptions {
38
+ /**
39
+ * Maps complete, trimmed prefixes to existing agent ids, preserving array order for joint performers.
40
+ * Matching is case-sensitive and preserves internal whitespace; an empty object disables automatic inference.
41
+ * Omitting this option enables legacy name inference; explicit bindings override its clock exclusion.
42
+ */
43
+ bindings?: Readonly<Record<string, string | readonly string[]>>;
44
+ /**
45
+ * Removes matched prefixes and drops lines left with no sung text, including their attached content.
46
+ *
47
+ * @default true
48
+ */
49
+ removePrefixes?: boolean;
50
+ }
51
+
52
+ /**
53
+ * Pulls bracketed background vocals out of the sung lines and attaches them to the line they accompany.
54
+ *
55
+ * A line holding nothing but brackets becomes a background of the line before it and is removed.
56
+ * A bracket opened on one line and closed on a later one joins the line before the opening, and both source lines go.
57
+ * Text outside brackets stays on its line, and a line left with none keeps its place.
58
+ *
59
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
60
+ */
61
+ export declare const extractBackgroundLines: (lyric: runtime.Lyric, options?: ExtractBackgroundLinesOptions) => runtime.Lyric;
62
+
63
+ export declare interface ExtractBackgroundLinesOptions {
64
+ /**
65
+ * Turn a line holding nothing but brackets into a background line of the line before it.
66
+ *
67
+ * @default true
68
+ */
69
+ fullLine?: boolean;
70
+ /**
71
+ * Pull the bracketed runs inside a line out into background lines of that same line.
72
+ *
73
+ * @default true
74
+ */
75
+ inLine?: boolean;
76
+ /**
77
+ * Join a bracket opened on one line and closed on a later one, attaching it to the line before them.
78
+ *
79
+ * @default true
80
+ */
81
+ crossLine?: boolean;
82
+ }
83
+
84
+ /**
85
+ * Preserves source labels and name spelling while matching normalized credit labels in normal lead lines.
86
+ * Merges names by role and original label without inferring their language.
87
+ *
88
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
89
+ */
90
+ export declare const extractCredits: (lyric: runtime.Lyric, options?: ExtractCreditsOptions) => runtime.Lyric;
91
+
92
+ export declare interface ExtractCreditsOptions {
93
+ /**
94
+ * Removes extracted source lines unless they carry background vocals, line annotations, or word translations or romanizations.
95
+ * Ruby annotations alone do not prevent removal.
96
+ *
97
+ * Refreshes language usages and falls back to line timing when no word-level content remains.
98
+ *
99
+ * @default false
100
+ */
101
+ removeSourceLines?: boolean;
102
+ /**
103
+ * Splits names at literal separators and ignores empty strings; an empty list preserves the complete source name.
104
+ * Longer separators take precedence so overlapping delimiters remain predictable.
105
+ *
106
+ * @default DEFAULT_CREDIT_NAME_SEPARATORS
107
+ */
108
+ nameSeparators?: readonly string[];
109
+ }
110
+
111
+ export declare const INSERT_SPACES_RULES: InsertSpacesRule[];
112
+
113
+ /**
114
+ * Inserts derived instrumental lines into uncovered gaps on the stored timeline, starting at zero.
115
+ * Existing lines and background vocals occupy their full ranges; an unknown end blocks later gaps.
116
+ *
117
+ * An outro requires an explicit endTime; metadata duration and offset do not affect insertion.
118
+ *
119
+ * @returns The input when unchanged, or a new lyric and lines array sharing existing nodes.
120
+ */
121
+ export declare const insertInstrumentalLines: (lyric: runtime.Lyric, options?: InsertInstrumentalLinesOptions) => runtime.Lyric;
122
+
123
+ export declare interface InsertInstrumentalLinesOptions {
124
+ /**
125
+ * Minimum gap duration in milliseconds, including an outro.
126
+ *
127
+ * @default 10000
128
+ */
129
+ minDuration?: number;
130
+ /**
131
+ * Minimum gap duration before the first vocal in milliseconds.
132
+ *
133
+ * @default 5000
134
+ */
135
+ minIntroDuration?: number;
136
+ /**
137
+ * Outro boundary in milliseconds, measured on the same timeline as line ranges.
138
+ * An omitted boundary leaves the outro unknown.
139
+ */
140
+ endTime?: number;
141
+ }
142
+
143
+ /**
144
+ * Inserts the spaces a source left out, so CJK text set against Latin letters, digits or punctuation reads evenly.
145
+ *
146
+ * A word-level line keeps every word's time and annotation: an inserted space becomes its own space word,
147
+ * and a word the rules split yields one word per character, all sharing the original range.
148
+ * A plain-text line and the annotation tracks are rewritten as whole strings.
149
+ *
150
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
151
+ */
152
+ export declare const insertSpacesInLines: (lyric: runtime.Lyric, options?: InsertSpacesOptions) => runtime.Lyric;
153
+
154
+ export declare interface InsertSpacesOptions {
155
+ /**
156
+ * Rules to apply; omitting the list applies all of them.
157
+ */
158
+ rules?: InsertSpacesRule[];
159
+ /**
160
+ * Rewrite the translation and romanization tracks too.
161
+ *
162
+ * @default true
163
+ */
164
+ annotations?: boolean;
165
+ }
166
+
167
+ export declare type InsertSpacesRule = (typeof InsertSpacesRules)[keyof typeof InsertSpacesRules];
168
+
169
+ /**
170
+ * Groups of characters a source may write without a space where one belongs.
171
+ */
172
+ export declare const InsertSpacesRules: {
173
+ /**
174
+ * A CJK character touching a Latin letter, as in `ABC中文`.
175
+ */
176
+ readonly CJK_ENGLISH: "cjkEnglish";
177
+ /**
178
+ * A CJK character touching a digit, as in `2026年`.
179
+ */
180
+ readonly CJK_NUMBER: "cjkNumber";
181
+ /**
182
+ * A comma, semicolon, exclamation mark, question mark or colon touching a character, as in `a,b`; a clock time or thousands separator such as `10:30` stays as written.
183
+ */
184
+ readonly PUNCTUATION: "punctuation";
185
+ /**
186
+ * A quotation mark touching a neighbouring character.
187
+ */
188
+ readonly QUOTE: "quote";
189
+ /**
190
+ * A bracket touching the character outside it.
191
+ */
192
+ readonly BRACKET_OUTSIDE: "bracketOutside";
193
+ /**
194
+ * A plus, equals or ampersand touching a character, as in `a+b`; a compound operator such as `a+=b` stays as written.
195
+ */
196
+ readonly MATH_OPERATOR: "mathOperator";
197
+ /**
198
+ * A hyphen touching a CJK character, as in `中-文`; a compound word such as `well-known` stays as written.
199
+ */
200
+ readonly HYPHEN: "hyphen";
201
+ /**
202
+ * A slash touching a character, as in `and/or`; a fraction such as `1/2` stays as written.
203
+ */
204
+ readonly SLASH: "slash";
205
+ /**
206
+ * Runs of two or more spaces, collapsed to one.
207
+ */
208
+ readonly COMPRESS_SPACES: "compressSpaces";
209
+ /**
210
+ * Spaces just inside a bracket or quotation mark, removed.
211
+ */
212
+ readonly TRIM_INSIDE_SYMBOLS: "trimInsideSymbols";
213
+ };
214
+
215
+ /**
216
+ * Categories the bundled filter rules identify, in rule order.
217
+ */
218
+ export declare const NON_LYRIC_CATEGORIES: readonly string[];
219
+
220
+ /**
221
+ * Removes normal lead lines matched by the shared notice rules and, when musicInfo is provided, first-line song information.
222
+ * The first non-empty normal line must have one literal " - " separator and a known title and artist on opposite sides; either order and extra text such as bracketed aliases are accepted.
223
+ * Drops attached annotations and backgrounds, refreshes language usages, and falls back to line timing when no word-level content remains.
224
+ *
225
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
226
+ */
227
+ export declare const removeNonLyricLines: (lyric: runtime.Lyric, options?: RemoveNonLyricLinesOptions) => runtime.Lyric;
228
+
229
+ export declare interface RemoveNonLyricLinesOptions {
230
+ /**
231
+ * Removes lines identified under these categories; an empty list skips the shared rules.
232
+ * First-line music information is selected independently.
233
+ *
234
+ * @default NON_LYRIC_CATEGORIES
235
+ */
236
+ categories?: readonly string[];
237
+ /**
238
+ * Enables first-line music-information matching using these known titles and artists.
239
+ * Omitting this option, or leaving either list empty, skips the check; lyric metadata is not inferred.
240
+ */
241
+ musicInfo?: {
242
+ titles?: readonly string[];
243
+ artists?: readonly string[];
244
+ };
245
+ }
246
+
247
+ /**
248
+ * Removes the brackets some sources wrap around background vocals.
249
+ *
250
+ * One layer is removed from each edge of every background line, leaving a nested pair as `(x)`.
251
+ * A line left with no content is dropped, since a background line must carry something.
252
+ *
253
+ * @returns The input when unchanged, or a new lyric sharing all unchanged nodes.
254
+ */
255
+ export declare const stripBackgroundBrackets: (lyric: runtime.Lyric) => runtime.Lyric;
256
+
257
+ export { }