@gondola-lyrics/kit 0.4.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/formats.d.ts +109 -4
- package/dist/formats.js +1180 -264
- package/dist/formats.js.map +1 -1
- package/dist/generator.d.ts +7 -3
- package/dist/index.d.ts +154 -4
- package/dist/index.js +3 -3
- package/dist/language.js +117 -0
- package/dist/language.js.map +1 -0
- package/dist/parser.d.ts +148 -2
- package/dist/parser.js +3 -3
- package/dist/transforms.d.ts +87 -0
- package/dist/transforms.js +2291 -32
- package/dist/transforms.js.map +1 -1
- package/package.json +1 -1
package/dist/transforms.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { runtime } from '@gondola-lyrics/model';
|
|
2
2
|
|
|
3
|
+
export declare const DEFAULT_CREDIT_NAME_SEPARATORS: readonly ["+", ":", "/"];
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Derives emphasis for normal words in lead and background vocals using complete, valid word ranges.
|
|
5
7
|
* The stored word duration must strictly exceed durationThreshold; metadata offset and duration have no effect.
|
|
@@ -21,6 +23,32 @@ export declare interface DeriveWordEmphasisOptions {
|
|
|
21
23
|
durationThreshold?: number;
|
|
22
24
|
}
|
|
23
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
|
+
|
|
24
52
|
/**
|
|
25
53
|
* Pulls bracketed background vocals out of the sung lines and attaches them to the line they accompany.
|
|
26
54
|
*
|
|
@@ -53,6 +81,33 @@ export declare interface ExtractBackgroundLinesOptions {
|
|
|
53
81
|
crossLine?: boolean;
|
|
54
82
|
}
|
|
55
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
|
+
|
|
56
111
|
export declare const INSERT_SPACES_RULES: InsertSpacesRule[];
|
|
57
112
|
|
|
58
113
|
/**
|
|
@@ -157,6 +212,38 @@ export declare const InsertSpacesRules: {
|
|
|
157
212
|
readonly TRIM_INSIDE_SYMBOLS: "trimInsideSymbols";
|
|
158
213
|
};
|
|
159
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
|
+
|
|
160
247
|
/**
|
|
161
248
|
* Removes the brackets some sources wrap around background vocals.
|
|
162
249
|
*
|