@coderline/alphatab 1.7.0-alpha.1582 → 1.7.0-alpha.1584

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.
@@ -2933,31 +2933,867 @@ declare enum AlphaTabSystemExclusiveEvents {
2933
2933
  Rest = 1
2934
2934
  }
2935
2935
 
2936
+ export declare namespace alphaTex {
2937
+ export {
2938
+ AlphaTexAsteriskTokenNode,
2939
+ AlphaTexAstNode,
2940
+ AlphaTexAstNodeLocation,
2941
+ AlphaTexBackSlashTokenNode,
2942
+ AlphaTexBarNode,
2943
+ AlphaTexBeatDurationChangeNode,
2944
+ AlphaTexBeatNode,
2945
+ AlphaTexBraceCloseTokenNode,
2946
+ AlphaTexBraceOpenTokenNode,
2947
+ AlphaTexColonTokenNode,
2948
+ AlphaTexComment,
2949
+ AlphaTexDotTokenNode,
2950
+ AlphaTexDoubleBackSlashTokenNode,
2951
+ AlphaTexIdentifier,
2952
+ AlphaTexMetaDataNode,
2953
+ AlphaTexMetaDataTagNode,
2954
+ AlphaTexNodeType,
2955
+ AlphaTexNoteListNode,
2956
+ AlphaTexNoteNode,
2957
+ AlphaTexNumberLiteral,
2958
+ AlphaTexParenthesisCloseTokenNode,
2959
+ AlphaTexParenthesisOpenTokenNode,
2960
+ AlphaTexPipeTokenNode,
2961
+ AlphaTexPropertiesNode,
2962
+ AlphaTexPropertyNode,
2963
+ AlphaTexScoreNode,
2964
+ AlphaTexStringLiteral,
2965
+ AlphaTexTextNode,
2966
+ AlphaTexTokenNode,
2967
+ AlphaTexValueList,
2968
+ IAlphaTexAstNode,
2969
+ IAlphaTexMetaDataTagPrefixNode,
2970
+ IAlphaTexNoteValueNode,
2971
+ IAlphaTexValueListItem,
2972
+ AlphaTexLexer,
2973
+ AlphaTexParser,
2974
+ AlphaTexAccidentalMode,
2975
+ AlphaTexDiagnostic,
2976
+ AlphaTexDiagnosticBag,
2977
+ AlphaTexDiagnosticCode,
2978
+ AlphaTexDiagnosticsSeverity,
2979
+ IAlphaTexImporter,
2980
+ IAlphaTexImporterState
2981
+ }
2982
+ }
2983
+
2984
+ /**
2985
+ * @public
2986
+ */
2987
+ declare enum AlphaTexAccidentalMode {
2988
+ Auto = 0,
2989
+ Explicit = 1
2990
+ }
2991
+
2992
+ /**
2993
+ * @record
2994
+ * @public
2995
+ */
2996
+ declare interface AlphaTexAsteriskTokenNode extends AlphaTexTokenNode {
2997
+ nodeType: AlphaTexNodeType.Asterisk;
2998
+ }
2999
+
3000
+ /**
3001
+ * The base type for all alphaTex AST nodes
3002
+ * @record
3003
+ * @public
3004
+ */
3005
+ declare interface AlphaTexAstNode extends IAlphaTexAstNode {
3006
+ }
3007
+
3008
+ /**
3009
+ * Maps an AST node into its respective source code location.
3010
+ * @record
3011
+ * @public
3012
+ */
3013
+ declare interface AlphaTexAstNodeLocation {
3014
+ /**
3015
+ * The 1-based line index within the source code.
3016
+ */
3017
+ line: number;
3018
+ /**
3019
+ * The 1-based column index within the source code.
3020
+ */
3021
+ col: number;
3022
+ /**
3023
+ * The 0-based codepoint offset within the source code.
3024
+ */
3025
+ offset: number;
3026
+ }
3027
+
3028
+ /**
3029
+ * @record
3030
+ * @public
3031
+ */
3032
+ declare interface AlphaTexBackSlashTokenNode extends AlphaTexTokenNode, IAlphaTexMetaDataTagPrefixNode {
3033
+ nodeType: AlphaTexNodeType.Backslash;
3034
+ }
3035
+
3036
+ /**
3037
+ * A node describing the bar level contents as written in alphaTex.
3038
+ * @record
3039
+ * @public
3040
+ */
3041
+ declare interface AlphaTexBarNode extends AlphaTexAstNode {
3042
+ nodeType: AlphaTexNodeType.Bar;
3043
+ /**
3044
+ * The metadata tags preceeding the bar contents, might start
3045
+ * new tracks, staves, voices etc.
3046
+ */
3047
+ metaData: AlphaTexMetaDataNode[];
3048
+ /**
3049
+ * The beats contained in this bar.
3050
+ */
3051
+ beats: AlphaTexBeatNode[];
3052
+ /**
3053
+ * The pipe symbol denoting the end of the bar.
3054
+ */
3055
+ pipe?: AlphaTexPipeTokenNode;
3056
+ }
3057
+
3058
+ /**
3059
+ * A note describing a duration change like `:4` or `:4 { tu 3 }`
3060
+ * @record
3061
+ * @public
3062
+ */
3063
+ declare interface AlphaTexBeatDurationChangeNode extends AlphaTexAstNode {
3064
+ nodeType: AlphaTexNodeType.Duration;
3065
+ /**
3066
+ * The colon token marking the duration change node
3067
+ */
3068
+ colon: AlphaTexColonTokenNode;
3069
+ /**
3070
+ * The numeric value describing the duration.
3071
+ */
3072
+ value?: AlphaTexNumberLiteral;
3073
+ /**
3074
+ * Additional duration attributes like tuplets.
3075
+ */
3076
+ properties?: AlphaTexPropertiesNode;
3077
+ }
3078
+
3079
+ /**
3080
+ * A node describing a beat within alphaTex.
3081
+ * @record
3082
+ * @public
3083
+ */
3084
+ declare interface AlphaTexBeatNode extends AlphaTexAstNode {
3085
+ nodeType: AlphaTexNodeType.Beat;
3086
+ /**
3087
+ * An optional marker changing the beat duration via a marker like `:4`
3088
+ */
3089
+ durationChange?: AlphaTexBeatDurationChangeNode;
3090
+ /**
3091
+ * The notes contained in this beat (mutually exclusive with `rest`)
3092
+ */
3093
+ notes?: AlphaTexNoteListNode;
3094
+ /**
3095
+ * The marker indicating that this beat is a rest beat. Currently always an identifier with `r`
3096
+ */
3097
+ rest?: AlphaTexIdentifier;
3098
+ /**
3099
+ * The dot separating the beat content and the postfix beat duration
3100
+ */
3101
+ durationDot?: AlphaTexDotTokenNode;
3102
+ /**
3103
+ * The postfix beat duration.
3104
+ */
3105
+ durationValue?: AlphaTexNumberLiteral;
3106
+ /**
3107
+ * The `*` marker for repeating this beat multiple times. Must have a filled `beatMultiplierValue`
3108
+ */
3109
+ beatMultiplier?: AlphaTexAsteriskTokenNode;
3110
+ /**
3111
+ * The numeric value how often the beat should be repeated.
3112
+ */
3113
+ beatMultiplierValue?: AlphaTexNumberLiteral;
3114
+ /**
3115
+ * The effect list for this beat.
3116
+ */
3117
+ beatEffects?: AlphaTexPropertiesNode;
3118
+ }
3119
+
3120
+ /**
3121
+ * @record
3122
+ * @public
3123
+ */
3124
+ declare interface AlphaTexBraceCloseTokenNode extends AlphaTexTokenNode {
3125
+ nodeType: AlphaTexNodeType.RBrace;
3126
+ }
3127
+
3128
+ /**
3129
+ * @record
3130
+ * @public
3131
+ */
3132
+ declare interface AlphaTexBraceOpenTokenNode extends AlphaTexTokenNode {
3133
+ nodeType: AlphaTexNodeType.LBrace;
3134
+ }
3135
+
3136
+ /**
3137
+ * @record
3138
+ * @public
3139
+ */
3140
+ declare interface AlphaTexColonTokenNode extends AlphaTexTokenNode {
3141
+ nodeType: AlphaTexNodeType.Colon;
3142
+ }
3143
+
3144
+ /**
3145
+ * A comment attached to a node.
3146
+ * @record
3147
+ * @public
3148
+ */
3149
+ declare interface AlphaTexComment {
3150
+ /**
3151
+ * The start of this node when parsed from an input source file.
3152
+ */
3153
+ start?: AlphaTexAstNodeLocation;
3154
+ /**
3155
+ * The end (inclusive) of this node when parsed from an input source file.
3156
+ */
3157
+ end?: AlphaTexAstNodeLocation;
3158
+ /**
3159
+ * Whether the comment is a multiline comment or a single line comment
3160
+ */
3161
+ multiLine: boolean;
3162
+ /**
3163
+ * The comment text excluding the comment start/end markers.
3164
+ */
3165
+ text: string;
3166
+ }
3167
+
3168
+ /**
3169
+ * A diagnostics message for the alphaTex parser.
3170
+ * @record
3171
+ * @public
3172
+ */
3173
+ declare interface AlphaTexDiagnostic {
3174
+ /**
3175
+ * The severity of the diagnostic.
3176
+ */
3177
+ severity: AlphaTexDiagnosticsSeverity;
3178
+ /**
3179
+ * The start location to which the diagnostic message belongs.
3180
+ */
3181
+ start?: AlphaTexAstNodeLocation;
3182
+ /**
3183
+ * The end location to which the diagnostic message belongs.
3184
+ */
3185
+ end?: AlphaTexAstNodeLocation;
3186
+ /**
3187
+ * A technical code describing the diagnostic message.
3188
+ */
3189
+ code: AlphaTexDiagnosticCode;
3190
+ /**
3191
+ * The textual message for the diagnostic.
3192
+ */
3193
+ message: string;
3194
+ }
3195
+
3196
+ /**
3197
+ * @public
3198
+ */
3199
+ declare class AlphaTexDiagnosticBag implements Iterable<AlphaTexDiagnostic> {
3200
+ private _hasErrors;
3201
+ readonly items: AlphaTexDiagnostic[];
3202
+ get errors(): AlphaTexDiagnostic[];
3203
+ get hasErrors(): boolean;
3204
+ push(diagnostic: AlphaTexDiagnostic): void;
3205
+ [Symbol.iterator](): Iterator<AlphaTexDiagnostic>;
3206
+ }
3207
+
3208
+ /**
3209
+ * @public
3210
+ */
3211
+ declare enum AlphaTexDiagnosticCode {
3212
+ /**
3213
+ * Unexpected character at comment start, expected '//' or '/*' but found '/%s'.
3214
+ */
3215
+ AT001 = 1,
3216
+ /**
3217
+ * Missing identifier after meta data start.
3218
+ */
3219
+ AT002 = 2,
3220
+ /**
3221
+ * Unexpected end of file. Need 4 hex characters on a \uXXXX escape sequence.
3222
+ */
3223
+ AT003 = 3,
3224
+ /**
3225
+ * Invalid unicode value. Need 4 hex characters on a \uXXXX escape sequence.
3226
+ */
3227
+ AT004 = 4,
3228
+ /**
3229
+ * Unsupported escape sequence. Expected '\n', '\r', '\t', or '\uXXXX' but found '\%s'.
3230
+ */
3231
+ AT005 = 5,
3232
+ /**
3233
+ * Unexpected end of file. String not closed.
3234
+ */
3235
+ AT006 = 6,
3236
+ /**
3237
+ * Missing beat multiplier value after '*'.
3238
+ */
3239
+ AT200 = 200,
3240
+ /**
3241
+ * Missing duration value after ':'.
3242
+ */
3243
+ AT201 = 201,
3244
+ /**
3245
+ * Unexpected '%s' token. Expected one of following: %s
3246
+ */
3247
+ AT202 = 202,
3248
+ /**
3249
+ * Unexpected end of file.
3250
+ */
3251
+ AT203 = 203,
3252
+ /**
3253
+ * Unrecognized metadata '%s'.
3254
+ */
3255
+ AT204 = 204,
3256
+ /**
3257
+ * Unrecognized property '%s'.
3258
+ */
3259
+ AT205 = 205,
3260
+ /**
3261
+ * Unexpected end of file. Group not closed.
3262
+ */
3263
+ AT206 = 206,
3264
+ /**
3265
+ * Missing string for fretted note.
3266
+ */
3267
+ AT207 = 207,
3268
+ /**
3269
+ * Note string is out of range. Available range: 1-%s
3270
+ */
3271
+ AT208 = 208,
3272
+ /**
3273
+ * Unexpected %s value '%s', expected: %s
3274
+ */
3275
+ AT209 = 209,
3276
+ /**
3277
+ * Missing values. Expected following values: %s
3278
+ */
3279
+ AT210 = 210,
3280
+ /**
3281
+ * Value is out of valid range. Allowed range: %s, Actual Value: %s
3282
+ */
3283
+ AT211 = 211,
3284
+ /**
3285
+ * Unrecogized property '%s', expected one of %s
3286
+ */
3287
+ AT212 = 212,
3288
+ /**
3289
+ * Invalid format for color
3290
+ */
3291
+ AT213 = 213,
3292
+ /**
3293
+ * The '%s' effect needs %s values per item. With %s points, %s values are needed, only %s values found.
3294
+ */
3295
+ AT214 = 214,
3296
+ /**
3297
+ * Cannot use pitched note value '%s' on %s staff, please specify notes using the 'fret.string' syntax.
3298
+ */
3299
+ AT215 = 215,
3300
+ /**
3301
+ * Cannot use pitched note value '%s' on percussion staff, please specify percussion articulations with numbers or names.
3302
+ */
3303
+ AT216 = 216,
3304
+ /**
3305
+ * Unrecognized note value '%s'.
3306
+ */
3307
+ AT217 = 217,
3308
+ /**
3309
+ * Wrong note kind '%s' for staff with note kind '%s'. Do not mix incompatible staves and notes.
3310
+ */
3311
+ AT218 = 218,
3312
+ /**
3313
+ * Expected no values, but found some. Values are ignored.
3314
+ */
3315
+ AT300 = 300,
3316
+ /**
3317
+ * Metadata values should be wrapped into parenthesis.
3318
+ */
3319
+ AT301 = 301,
3320
+ /**
3321
+ * Metadata values should be placed before metadata properties.
3322
+ */
3323
+ AT302 = 302,
3324
+ /**
3325
+ * Property values should be wrapped into parenthesis.
3326
+ */
3327
+ AT303 = 303,
3328
+ /**
3329
+ * The beat multiplier should be specified after the beat effects.
3330
+ */
3331
+ AT304 = 304,
3332
+ /**
3333
+ * This value should be rather specified via the properties.
3334
+ */
3335
+ AT305 = 305,
3336
+ /**
3337
+ * This staff metadata tag should be specified as staff property.
3338
+ */
3339
+ AT306 = 306,
3340
+ /**
3341
+ * The dots separating score metadata, score contents and the sync points can be removed.
3342
+ */
3343
+ AT400 = 400
3344
+ }
3345
+
3346
+ /**
3347
+ * The different severity levels for diagnostics parsing alphaTex.
3348
+ * @public
3349
+ */
3350
+ declare enum AlphaTexDiagnosticsSeverity {
3351
+ Hint = 0,
3352
+ Warning = 1,
3353
+ Error = 2
3354
+ }
3355
+
3356
+ /**
3357
+ * @record
3358
+ * @public
3359
+ */
3360
+ declare interface AlphaTexDotTokenNode extends AlphaTexTokenNode {
3361
+ nodeType: AlphaTexNodeType.Dot;
3362
+ }
3363
+
3364
+ /**
3365
+ * @record
3366
+ * @public
3367
+ */
3368
+ declare interface AlphaTexDoubleBackSlashTokenNode extends AlphaTexTokenNode, IAlphaTexMetaDataTagPrefixNode {
3369
+ nodeType: AlphaTexNodeType.DoubleBackslash;
3370
+ }
3371
+
3372
+ /**
3373
+ * @public
3374
+ */
3375
+ declare class AlphaTexErrorWithDiagnostics extends AlphaTabError {
3376
+ lexerDiagnostics?: AlphaTexDiagnosticBag;
3377
+ parserDiagnostics?: AlphaTexDiagnosticBag;
3378
+ semanticDiagnostics?: AlphaTexDiagnosticBag;
3379
+ iterateDiagnostics(): Generator<AlphaTexDiagnostic, void, unknown>;
3380
+ constructor(message: string, lexerDiagnostics?: AlphaTexDiagnosticBag, parserDiagnostics?: AlphaTexDiagnosticBag, semanticDiagnostics?: AlphaTexDiagnosticBag);
3381
+ toString(): string;
3382
+ private static _diagnosticsToString;
3383
+ private static _locationToString;
3384
+ }
3385
+
2936
3386
  /**
2937
3387
  * This ScoreExporter can write alphaTex strings.
2938
3388
  * @public
2939
3389
  */
2940
3390
  declare class AlphaTexExporter extends ScoreExporter {
2941
- private static readonly _defaultScore;
2942
- private static readonly _defaultTrack;
3391
+ private _handler;
2943
3392
  get name(): string;
2944
3393
  exportToString(score: Score, settings?: Settings | null): string;
2945
3394
  writeScore(score: Score): void;
2946
3395
  scoreToAlphaTexString(score: Score): string;
2947
- private _writeScoreTo;
2948
- private _writeStyleSheetTo;
2949
- private _writeTrackTo;
2950
- private _writeStaffTo;
2951
- private _writeBarTo;
2952
- private _writeStaffMetaTo;
2953
- private _writeChordTo;
2954
- private _writeMasterBarMetaTo;
2955
- private _writeBarMetaTo;
2956
- private _writeVoiceTo;
2957
- private _writeBeatTo;
2958
- private _writeBeatEffectsTo;
2959
- private _writeNoteTo;
2960
- private _writeNoteEffectsTo;
3396
+ private _score;
3397
+ private _track;
3398
+ private _staff;
3399
+ private _voice;
3400
+ private _bar;
3401
+ private _beat;
3402
+ private _beatEffects;
3403
+ private _notes;
3404
+ private _note;
3405
+ private _noteEffects;
3406
+ }
3407
+
3408
+ /**
3409
+ * A node describing an identifier. This is typically a string-like value
3410
+ * but not quoted.
3411
+ * @record
3412
+ * @public
3413
+ */
3414
+ declare interface AlphaTexIdentifier extends AlphaTexTextNode, IAlphaTexValueListItem, IAlphaTexNoteValueNode {
3415
+ nodeType: AlphaTexNodeType.Ident;
3416
+ }
3417
+
3418
+ /**
3419
+ * @public
3420
+ */
3421
+ declare class AlphaTexImporter extends ScoreImporter implements IAlphaTexImporter {
3422
+ private _parser;
3423
+ private _handler;
3424
+ private _state;
3425
+ get state(): IAlphaTexImporterState;
3426
+ get name(): string;
3427
+ get lexerDiagnostics(): AlphaTexDiagnosticBag;
3428
+ get parserDiagnostics(): AlphaTexDiagnosticBag;
3429
+ logErrors: boolean;
3430
+ readonly semanticDiagnostics: AlphaTexDiagnosticBag;
3431
+ addSemanticDiagnostic(diagnostic: AlphaTexDiagnostic): void;
3432
+ initFromString(tex: string, settings: Settings): void;
3433
+ readScore(): Score;
3434
+ private _createDefaultScore;
3435
+ private _newTrack;
3436
+ private _beginStaff;
3437
+ private _bars;
3438
+ private _bar;
3439
+ private _beat;
3440
+ private _beatEffects;
3441
+ private _beatDuration;
3442
+ private _parseDuration;
3443
+ private _note;
3444
+
3445
+ applyStaffNoteKind(staff: Staff, staffNoteKind: StaffNoteKind): void;
3446
+ private _noteEffects;
3447
+ private _handleTransposition;
3448
+ private _detectTuningForStaff;
3449
+ private _barMeta;
3450
+ private _newBar;
3451
+ startNewStaff(): Staff;
3452
+ applyPercussionStaff(staff: Staff): void;
3453
+ startNewTrack(): Track;
3454
+ startNewVoice(): void;
3455
+ }
3456
+
3457
+ /**
3458
+ * @public
3459
+ */
3460
+ declare class AlphaTexLexer {
3461
+ private static readonly _eof;
3462
+ private readonly _codepoints;
3463
+ private _codepoint;
3464
+ private _offset;
3465
+ private _line;
3466
+ private _col;
3467
+ private _fatalError;
3468
+ private _tokenStart;
3469
+ private _leadingComments;
3470
+ private _trailingCommentNode;
3471
+ private _previousToken;
3472
+ private _peekedToken;
3473
+ readonly lexerDiagnostics: AlphaTexDiagnosticBag;
3474
+ constructor(input: string);
3475
+ peekToken(): AlphaTexAstNode | undefined;
3476
+ extendToFloat(peekedNode: AlphaTexNumberLiteral): AlphaTexNumberLiteral;
3477
+ advance(): void;
3478
+ private _nextCodepoint;
3479
+ previousTokenEndLocation(): AlphaTexAstNodeLocation;
3480
+ currentTokenLocation(): AlphaTexAstNodeLocation;
3481
+ private _currentLexerLocation;
3482
+ private _readToken;
3483
+ private _comment;
3484
+ private static _terminalTokens;
3485
+ private _metaCommand;
3486
+ private _token;
3487
+ private _string;
3488
+ private _multiLineComment;
3489
+ private _numberOrIdentifier;
3490
+ private _singleLineComment;
3491
+ private _whitespace;
3492
+ private static _isDigit;
3493
+ private static _buildNonIdentifierChars;
3494
+ private static readonly _nonIdentifierChars;
3495
+ private static _isIdentifierCharacter;
3496
+ private static _isWhiteSpace;
3497
+ }
3498
+
3499
+ /**
3500
+ * A metadata tag with optional values and optional properties like:
3501
+ * `\track "Name" {color "#F00"}` .
3502
+ * @record
3503
+ * @public
3504
+ */
3505
+ declare interface AlphaTexMetaDataNode extends AlphaTexAstNode {
3506
+ nodeType: AlphaTexNodeType.Meta;
3507
+ /**
3508
+ * The tag part of the metadata.
3509
+ */
3510
+ tag: AlphaTexMetaDataTagNode;
3511
+ /**
3512
+ * A value list directly listed after the metadata (not within braces).
3513
+ */
3514
+ values?: AlphaTexValueList;
3515
+ /**
3516
+ * The optional properties attached to the metadata.
3517
+ */
3518
+ properties?: AlphaTexPropertiesNode;
3519
+ /**
3520
+ * Whether the properties are listed before the values (if both are present).
3521
+ */
3522
+ propertiesBeforeValues: boolean;
3523
+ }
3524
+
3525
+ /**
3526
+ * A metadata tag marker like `\title`
3527
+ * @record
3528
+ * @public
3529
+ */
3530
+ declare interface AlphaTexMetaDataTagNode extends AlphaTexAstNode {
3531
+ nodeType: AlphaTexNodeType.Tag;
3532
+ /**
3533
+ * The prefix indicating the start of the tag (e.g. `\` or `\\`)
3534
+ */
3535
+ prefix?: IAlphaTexMetaDataTagPrefixNode;
3536
+ /**
3537
+ * The identifier of the tag (e.g. `title`)
3538
+ */
3539
+ tag: AlphaTexIdentifier;
3540
+ }
3541
+
3542
+ /**
3543
+ * All node types for the alphaTex syntax tree.
3544
+ * @public
3545
+ */
3546
+ declare enum AlphaTexNodeType {
3547
+ Dot = 0,
3548
+ Backslash = 1,
3549
+ DoubleBackslash = 2,
3550
+ Pipe = 3,
3551
+ LBrace = 4,
3552
+ RBrace = 5,
3553
+ LParen = 6,
3554
+ RParen = 7,
3555
+ Colon = 8,
3556
+ Asterisk = 9,
3557
+ Ident = 10,
3558
+ Tag = 11,
3559
+ Meta = 12,
3560
+ Values = 13,
3561
+ Props = 14,
3562
+ Prop = 15,
3563
+ Number = 16,
3564
+ String = 17,
3565
+ Score = 18,
3566
+ Bar = 19,
3567
+ Beat = 20,
3568
+ Duration = 21,
3569
+ NoteList = 22,
3570
+ Note = 23
3571
+ }
3572
+
3573
+ /**
3574
+ * A list of notes for the beat.
3575
+ * @record
3576
+ * @public
3577
+ */
3578
+ declare interface AlphaTexNoteListNode extends AlphaTexAstNode {
3579
+ nodeType: AlphaTexNodeType.NoteList;
3580
+ /**
3581
+ * An open parenthesis token to group multiple notes for a beat.
3582
+ */
3583
+ openParenthesis?: AlphaTexParenthesisOpenTokenNode;
3584
+ /**
3585
+ * The notes contained in this list.
3586
+ */
3587
+ notes: AlphaTexNoteNode[];
3588
+ /**
3589
+ * A close parenthesis token to group multiple notes for a beat.
3590
+ */
3591
+ closeParenthesis?: AlphaTexParenthesisCloseTokenNode;
3592
+ }
3593
+
3594
+ /**
3595
+ * A node describing a single note.
3596
+ * @record
3597
+ * @public
3598
+ */
3599
+ declare interface AlphaTexNoteNode extends AlphaTexAstNode {
3600
+ nodeType: AlphaTexNodeType.Note;
3601
+ /**
3602
+ * The value of the note. Depending on whether it is a fretted, pitched or percussion
3603
+ * note this value varies.
3604
+ */
3605
+ noteValue: IAlphaTexNoteValueNode;
3606
+ /**
3607
+ * The dot separating the note value and the string for fretted/stringed instruments like guitars.
3608
+ */
3609
+ noteStringDot?: AlphaTexDotTokenNode;
3610
+ /**
3611
+ * The string value for fretted/stringed notes like guitars.
3612
+ */
3613
+ noteString?: AlphaTexNumberLiteral;
3614
+ /**
3615
+ * The effect list for this note. Semantically this list might also contain
3616
+ * effects applied to the beat level. This allows specifying beat effects
3617
+ * on a single note beat like `C4{txt "Beat Text" turn}` instead of
3618
+ * `C4{turn}{txt Beat}`
3619
+ */
3620
+ noteEffects?: AlphaTexPropertiesNode;
3621
+ }
3622
+
3623
+ /**
3624
+ * A number literal within alphaTex. Can be a integer or floating point number.
3625
+ * @record
3626
+ * @public
3627
+ */
3628
+ declare interface AlphaTexNumberLiteral extends AlphaTexAstNode, IAlphaTexValueListItem, IAlphaTexNoteValueNode {
3629
+ nodeType: AlphaTexNodeType.Number;
3630
+ /**
3631
+ * The numeric value described by this literal.
3632
+ */
3633
+ value: number;
3634
+ }
3635
+
3636
+ /**
3637
+ * @record
3638
+ * @public
3639
+ */
3640
+ declare interface AlphaTexParenthesisCloseTokenNode extends AlphaTexTokenNode {
3641
+ nodeType: AlphaTexNodeType.RParen;
3642
+ }
3643
+
3644
+ /**
3645
+ * @record
3646
+ * @public
3647
+ */
3648
+ declare interface AlphaTexParenthesisOpenTokenNode extends AlphaTexTokenNode {
3649
+ nodeType: AlphaTexNodeType.LParen;
3650
+ }
3651
+
3652
+ /**
3653
+ * A parser for translating a given alphaTex source into an AST for further use
3654
+ * in the alphaTex importer, editors etc.
3655
+ * @public
3656
+ */
3657
+ declare class AlphaTexParser {
3658
+ readonly lexer: AlphaTexLexer;
3659
+ private _scoreNode;
3660
+ private _metaDataReader;
3661
+ get lexerDiagnostics(): AlphaTexDiagnosticBag;
3662
+ readonly parserDiagnostics: AlphaTexDiagnosticBag;
3663
+ addParserDiagnostic(diagnostics: AlphaTexDiagnostic): void;
3664
+
3665
+ constructor(source: string);
3666
+ read(): AlphaTexScoreNode;
3667
+ private _score;
3668
+ private _bars;
3669
+ private _bar;
3670
+ private _barMetaData;
3671
+ private _barBeats;
3672
+ private _beat;
3673
+ private _beatDuration;
3674
+ private _beatDurationChange;
3675
+ private _beatContent;
3676
+ private _beatMultiplier;
3677
+ private _noteList;
3678
+ private _note;
3679
+ private _metaData;
3680
+ private _properties;
3681
+ private _property;
3682
+ valueList(): AlphaTexValueList | undefined;
3683
+ }
3684
+
3685
+ /**
3686
+ * @record
3687
+ * @public
3688
+ */
3689
+ declare interface AlphaTexPipeTokenNode extends AlphaTexTokenNode {
3690
+ nodeType: AlphaTexNodeType.Pipe;
3691
+ }
3692
+
3693
+ /**
3694
+ * A node describing a list of properties grouped by braces.
3695
+ * Used in contexts like note effects, beat effects
3696
+ * @record
3697
+ * @public
3698
+ */
3699
+ declare interface AlphaTexPropertiesNode extends AlphaTexAstNode {
3700
+ nodeType: AlphaTexNodeType.Props;
3701
+ /**
3702
+ * The open brace grouping the properties (if needed).
3703
+ */
3704
+ openBrace?: AlphaTexBraceOpenTokenNode;
3705
+ /**
3706
+ * The individual properties
3707
+ */
3708
+ properties: AlphaTexPropertyNode[];
3709
+ /**
3710
+ * The close brace grouping the properties (if needed).
3711
+ */
3712
+ closeBrace?: AlphaTexBraceCloseTokenNode;
3713
+ }
3714
+
3715
+ /**
3716
+ * A node describing a property with attached values.
3717
+ * @record
3718
+ * @public
3719
+ */
3720
+ declare interface AlphaTexPropertyNode extends AlphaTexAstNode {
3721
+ nodeType: AlphaTexNodeType.Prop;
3722
+ /**
3723
+ * The identifier describing the property.
3724
+ */
3725
+ property: AlphaTexIdentifier;
3726
+ /**
3727
+ * The values attached to the property.
3728
+ */
3729
+ values?: AlphaTexValueList;
3730
+ }
3731
+
3732
+ /**
3733
+ * A node describing the root of an alphaTex file for a musical score.
3734
+ * @record
3735
+ * @public
3736
+ */
3737
+ declare interface AlphaTexScoreNode extends AlphaTexAstNode {
3738
+ nodeType: AlphaTexNodeType.Score;
3739
+ /**
3740
+ * The bars describing the contents of the song.
3741
+ */
3742
+ bars: AlphaTexBarNode[];
3743
+ }
3744
+
3745
+ /**
3746
+ * A string literal within alphaTex.
3747
+ * @record
3748
+ * @public
3749
+ */
3750
+ declare interface AlphaTexStringLiteral extends AlphaTexTextNode, IAlphaTexValueListItem, IAlphaTexNoteValueNode {
3751
+ nodeType: AlphaTexNodeType.String;
3752
+ }
3753
+
3754
+ /**
3755
+ * A base interface for nodes holding a textual value
3756
+ * like string literals or identifiers.
3757
+ * @record
3758
+ * @public
3759
+ */
3760
+ declare interface AlphaTexTextNode extends AlphaTexAstNode {
3761
+ /**
3762
+ * The text contained in the node.
3763
+ */
3764
+ text: string;
3765
+ }
3766
+
3767
+ /**
3768
+ * A node describing a single token like dots or colons.
3769
+ * @record
3770
+ * @public
3771
+ */
3772
+ declare interface AlphaTexTokenNode extends AlphaTexAstNode {
3773
+ }
3774
+
3775
+ /**
3776
+ * A node holding multiple values optionally grouped by parenthesis.
3777
+ * Whether parenthesis are needed depends on the context.
3778
+ * Used in contexts like bend effects `3.3{b (0 4)}`.
3779
+ * @record
3780
+ * @public
3781
+ */
3782
+ declare interface AlphaTexValueList extends AlphaTexAstNode {
3783
+ nodeType: AlphaTexNodeType.Values;
3784
+ /**
3785
+ * The open parenthesis token grouping the values.
3786
+ */
3787
+ openParenthesis?: AlphaTexParenthesisOpenTokenNode;
3788
+ /**
3789
+ * The list of values.
3790
+ */
3791
+ values: IAlphaTexValueListItem[];
3792
+ /**
3793
+ * The close parenthesis token grouping the values.
3794
+ */
3795
+ closeParenthesis?: AlphaTexParenthesisCloseTokenNode;
3796
+
2961
3797
  }
2962
3798
 
2963
3799
  /**
@@ -7425,6 +8261,7 @@ declare class HeaderFooterStyle {
7425
8261
  */
7426
8262
  textAlign: TextAlign;
7427
8263
  constructor(template?: string, isVisible?: boolean | undefined, textAlign?: TextAlign);
8264
+ static equals(a: HeaderFooterStyle, b: HeaderFooterStyle): boolean;
7428
8265
  buildText(score: Score): string;
7429
8266
  private static readonly _placeholderPattern;
7430
8267
  }
@@ -7662,6 +8499,83 @@ declare interface IAlphaSynthAudioExporter {
7662
8499
  render(milliseconds: number): AudioExportChunk | undefined;
7663
8500
  }
7664
8501
 
8502
+ /**
8503
+ * The base type for all alphaTex AST nodes
8504
+ * @public
8505
+ */
8506
+ declare interface IAlphaTexAstNode {
8507
+ /**
8508
+ * The type of the node.
8509
+ */
8510
+ nodeType: AlphaTexNodeType;
8511
+ /**
8512
+ * The start of this node when parsed from an input source file.
8513
+ */
8514
+ start?: AlphaTexAstNodeLocation;
8515
+ /**
8516
+ * The end (inclusive) of this node when parsed from an input source file.
8517
+ */
8518
+ end?: AlphaTexAstNodeLocation;
8519
+ /**
8520
+ * The comments preceeding this node.
8521
+ */
8522
+ leadingComments?: AlphaTexComment[];
8523
+ /**
8524
+ * The comments after this node (if starting on the same line).
8525
+ */
8526
+ trailingComments?: AlphaTexComment[];
8527
+ }
8528
+
8529
+ /**
8530
+ * @public
8531
+ */
8532
+ declare interface IAlphaTexImporter {
8533
+ readonly state: IAlphaTexImporterState;
8534
+ applyStaffNoteKind(staff: Staff, staffNoteKind: StaffNoteKind): void;
8535
+ startNewVoice(): void;
8536
+ startNewTrack(): Track;
8537
+ startNewStaff(): Staff;
8538
+ addSemanticDiagnostic(diagnostic: AlphaTexDiagnostic): void;
8539
+ }
8540
+
8541
+ /**
8542
+ * @public
8543
+ */
8544
+ declare interface IAlphaTexImporterState {
8545
+ score: Score;
8546
+ accidentalMode: AlphaTexAccidentalMode;
8547
+ currentDynamics: DynamicValue;
8548
+ currentTupletNumerator: number;
8549
+ currentTupletDenominator: number;
8550
+ readonly syncPoints: FlatSyncPoint[];
8551
+ readonly slurs: Map<string, Note>;
8552
+ readonly percussionArticulationNames: Map<string, number>;
8553
+ readonly lyrics: Map<number, Lyrics[]>;
8554
+ readonly staffHasExplicitDisplayTransposition: Set<Staff>;
8555
+ readonly staffHasExplicitTuning: Set<Staff>;
8556
+ readonly staffTuningApplied: Set<Staff>;
8557
+ readonly sustainPedalToBeat: Map<SustainPedalMarker, Beat>;
8558
+ }
8559
+
8560
+ /**
8561
+ * @public
8562
+ */
8563
+ declare interface IAlphaTexMetaDataTagPrefixNode extends IAlphaTexAstNode {
8564
+ }
8565
+
8566
+ /**
8567
+ * @public
8568
+ */
8569
+ declare interface IAlphaTexNoteValueNode extends IAlphaTexAstNode {
8570
+ }
8571
+
8572
+ /**
8573
+ * Defines the possible types for values in a {@link AlphaTexValueList}
8574
+ * @public
8575
+ */
8576
+ declare interface IAlphaTexValueListItem extends IAlphaTexAstNode {
8577
+ }
8578
+
7665
8579
  /**
7666
8580
  * A {@link IBackingTrackSynthOutput} which uses a HTMLAudioElement as playback mechanism.
7667
8581
  * Allows the access to the element for further custom usage.
@@ -8062,6 +8976,9 @@ declare interface IMouseEventArgs {
8062
8976
 
8063
8977
  export declare namespace importer {
8064
8978
  export {
8979
+ AlphaTexErrorWithDiagnostics,
8980
+ AlphaTexImporter,
8981
+ alphaTex,
8065
8982
  ScoreImporter,
8066
8983
  ScoreLoader,
8067
8984
  UnsupportedFormatError
@@ -13775,6 +14692,16 @@ declare class Staff {
13775
14692
  addBar(bar: Bar): void;
13776
14693
  }
13777
14694
 
14695
+ /**
14696
+ * Lists the note kinds we can detect
14697
+ * @public
14698
+ */
14699
+ declare enum StaffNoteKind {
14700
+ Pitched = 0,
14701
+ Fretted = 1,
14702
+ Articulation = 2
14703
+ }
14704
+
13778
14705
  /**
13779
14706
  * Represents the bounds of a staff system.
13780
14707
  * @public
@@ -14388,6 +15315,7 @@ declare class Tuning {
14388
15315
  * @param isStandard if set to`true`[is standard].
14389
15316
  */
14390
15317
  constructor(name?: string, tuning?: number[] | null, isStandard?: boolean);
15318
+ reset(): void;
14391
15319
  /**
14392
15320
  * Tries to detect the name and standard flag of the tuning from a known tuning list based
14393
15321
  * on the string values.