-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathtypes.d.ts
966 lines (933 loc) · 21.8 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
import type {
Parents,
PhrasingContent,
TableCell,
TableRow,
Association,
Nodes
} from 'mdast'
import type {Point} from 'unist'
/**
* Get an identifier from an association to match it to others.
*
* Associations are nodes that match to something else through an ID:
* <https://github.com/syntax-tree/mdast#association>.
*
* The `label` of an association is the string value: character escapes and
* references work, and casing is intact.
* The `identifier` is used to match one association to another:
* controversially, character escapes and references don’t work in this
* matching: `©` does not match `©`, and `\+` does not match `+`.
*
* But casing is ignored (and whitespace) is trimmed and collapsed: ` A\nb`
* matches `a b`.
* So, we do prefer the label when figuring out how we’re going to serialize:
* it has whitespace, casing, and we can ignore most useless character
* escapes and all character references.
*
* @param node
* Node that includes an association.
* @returns
* ID.
*/
export type AssociationId = (node: Association) => string
/**
* Compile an unsafe pattern to a regex.
*
* @param info
* Pattern.
* @returns
* Regex.
*/
export type CompilePattern = (info: Unsafe) => RegExp
/**
* Interface of registered constructs.
*
* When working on extensions that use new constructs, extend the corresponding
* interface to register its name:
*
* ```ts
* declare module 'mdast-util-to-markdown' {
* interface ConstructNameMap {
* // Register a new construct name (value is used, key should match it).
* gfmStrikethrough: 'gfmStrikethrough'
* }
* }
* ```
*/
export interface ConstructNameMap {
/**
* Whole autolink.
*
* ```markdown
* > | <https://example.com> and <admin@example.com>
* ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
* ```
*/
autolink: 'autolink'
/**
* Whole block quote.
*
* ```markdown
* > | > a
* ^^^
* > | b
* ^
* ```
*/
blockquote: 'blockquote'
/**
* Whole code (indented).
*
* ```markdown
* ␠␠␠␠console.log(1)
* ^^^^^^^^^^^^^^^^^^
* ```
*/
codeIndented: 'codeIndented'
/**
* Whole code (fenced).
*
* ````markdown
* > | ```js
* ^^^^^
* > | console.log(1)
* ^^^^^^^^^^^^^^
* > | ```
* ^^^
* ````
*/
codeFenced: 'codeFenced'
/**
* Code (fenced) language, when fenced with grave accents.
*
* ````markdown
* > | ```js
* ^^
* | console.log(1)
* | ```
* ````
*/
codeFencedLangGraveAccent: 'codeFencedLangGraveAccent'
/**
* Code (fenced) language, when fenced with tildes.
*
* ````markdown
* > | ~~~js
* ^^
* | console.log(1)
* | ~~~
* ````
*/
codeFencedLangTilde: 'codeFencedLangTilde'
/**
* Code (fenced) meta string, when fenced with grave accents.
*
* ````markdown
* > | ```js eval
* ^^^^
* | console.log(1)
* | ```
* ````
*/
codeFencedMetaGraveAccent: 'codeFencedMetaGraveAccent'
/**
* Code (fenced) meta string, when fenced with tildes.
*
* ````markdown
* > | ~~~js eval
* ^^^^
* | console.log(1)
* | ~~~
* ````
*/
codeFencedMetaTilde: 'codeFencedMetaTilde'
/**
* Whole definition.
*
* ```markdown
* > | [a]: b "c"
* ^^^^^^^^^^
* ```
*/
definition: 'definition'
/**
* Destination (literal) (occurs in definition, image, link).
*
* ```markdown
* > | [a]: <b> "c"
* ^^^
* > | a  e
* ^^^
* ```
*/
destinationLiteral: 'destinationLiteral'
/**
* Destination (raw) (occurs in definition, image, link).
*
* ```markdown
* > | [a]: b "c"
* ^
* > | a  e
* ^
* ```
*/
destinationRaw: 'destinationRaw'
/**
* Emphasis.
*
* ```markdown
* > | *a*
* ^^^
* ```
*/
emphasis: 'emphasis'
/**
* Whole heading (atx).
*
* ```markdown
* > | # alpha
* ^^^^^^^
* ```
*/
headingAtx: 'headingAtx'
/**
* Whole heading (setext).
*
* ```markdown
* > | alpha
* ^^^^^
* > | =====
* ^^^^^
* ```
*/
headingSetext: 'headingSetext'
/**
* Whole image.
*
* ```markdown
* > | 
* ^^^^^^^
* > | ![c]
* ^^^^
* ```
*/
image: 'image'
/**
* Whole image reference.
*
* ```markdown
* > | ![a]
* ^^^^
* ```
*/
imageReference: 'imageReference'
/**
* Label (occurs in definitions, image reference, image, link reference,
* link).
*
* ```markdown
* > | [a]: b "c"
* ^^^
* > | a [b] c
* ^^^
* > | a ![b][c] d
* ^^^^
* > | a [b](c) d
* ^^^
* ```
*/
label: 'label'
/**
* Whole link.
*
* ```markdown
* > | [a](b)
* ^^^^^^
* > | [c]
* ^^^
* ```
*/
link: 'link'
/**
* Whole link reference.
*
* ```markdown
* > | [a]
* ^^^
* ```
*/
linkReference: 'linkReference'
/**
* List.
*
* ```markdown
* > | * a
* ^^^
* > | 1. b
* ^^^^
* ```
*/
list: 'list'
/**
* List item.
*
* ```markdown
* > | * a
* ^^^
* > | 1. b
* ^^^^
* ```
*/
listItem: 'listItem'
/**
* Paragraph.
*
* ```markdown
* > | a b
* ^^^
* > | c.
* ^^
* ```
*/
paragraph: 'paragraph'
/**
* Phrasing (occurs in headings, paragraphs, etc).
*
* ```markdown
* > | a
* ^
* ```
*/
phrasing: 'phrasing'
/**
* Reference (occurs in image, link).
*
* ```markdown
* > | [a][]
* ^^
* ```
*/
reference: 'reference'
/**
* Strong.
*
* ```markdown
* > | **a**
* ^^^^^
* ```
*/
strong: 'strong'
/**
* Title using single quotes (occurs in definition, image, link).
*
* ```markdown
* > | [a](b 'c')
* ^^^
* ```
*/
titleApostrophe: 'titleApostrophe'
/**
* Title using double quotes (occurs in definition, image, link).
*
* ```markdown
* > | [a](b "c")
* ^^^
* ```
*/
titleQuote: 'titleQuote'
}
/**
* Construct names for things generated by `mdast-util-to-markdown`.
*
* This is an enum of strings, each being a semantic label, useful to know when
* serializing whether we’re for example in a double (`"`) or single (`'`)
* quoted title.
*/
export type ConstructName = ConstructNameMap[keyof ConstructNameMap]
/**
* Serialize the children of a parent that contains flow children.
*
* These children will typically be joined by blank lines.
* What they are joined by exactly is defined by `Join` functions.
*
* @param parent
* Parent of flow nodes.
* @param info
* Info on where we are in the document we are generating.
* @returns
* Serialized children, joined by (blank) lines.
*/
export type ContainerFlow = (parent: FlowParents, info: TrackFields) => string
/**
* Serialize the children of a parent that contains phrasing children.
*
* These children will be joined flush together.
*
* @param parent
* Parent of phrasing nodes.
* @param info
* Info on where we are in the document we are generating.
* @returns
* Serialized children, joined together.
*/
export type ContainerPhrasing = (parent: PhrasingParents, info: Info) => string
/**
* Track positional info in the output.
*
* This info isn’t used yet but such functionality will allow line wrapping,
* source maps, etc.
*
* @param info
* Info on where we are in the document we are generating.
* @returns
* Tracker.
*/
export type CreateTracker = (info: TrackFields) => Tracker
/**
* Whether to encode things — with fields representing the surrounding of a
* whole.
*/
export interface EncodeSurrounding {
/**
* Whether to encode after.
*/
after: boolean
/**
* Whether to encode before.
*/
before: boolean
}
/**
* Whether to encode things — with fields representing the relationship to a
* whole.
*/
export interface EncodeSides {
/**
* Whether to encode inside.
*/
inside: boolean
/**
* Whether to encode before.
*/
outside: boolean
}
/**
* Enter something.
*
* @param name
* Label, more similar to a micromark event than an mdast node type.
* @returns
* Revert.
*/
export type Enter = (name: ConstructName) => Exit
/**
* Exit something.
*
* @returns
* Nothing.
*/
export type Exit = () => undefined
/**
* Children of flow nodes.
*/
export type FlowChildren = FlowParents extends {
children: Array<infer T>
}
? T
: never
/**
* Parents that are not phrasing,
* or similar.
*/
export type FlowParents = Exclude<
Parents,
PhrasingContent | TableCell | TableRow
>
/**
* Handle particular nodes.
*
* Each key is a node type, each value its corresponding handler.
*/
export type Handlers = Record<Nodes['type'], Handle>
/**
* Handle a particular node.
*
* @param node
* Expected mdast node.
* @param parent
* Parent of `node`.
* @param state
* Info passed around about the current state.
* @param Info
* Info on the surrounding of the node that is serialized.
* @returns
* Serialized markdown representing `node`.
*/
export type Handle = (
// type-coverage:ignore-next-line
node: any,
parent: Parents | undefined,
state: State,
Info: Info
) => string
/**
* Pad serialized markdown.
*
* @param value
* Whole fragment of serialized markdown.
* @param map
* Map function.
* @returns
* Padded value.
*/
export type IndentLines = (value: string, map: Map) => string
/**
* Info on the surrounding of the node that is serialized.
*/
export interface Info extends SafeFields, TrackFields {}
/**
* How to join two blocks.
*
* “Blocks” are typically joined by one blank line.
* Sometimes it’s nicer to have them flush next to each other, yet other
* times they cannot occur together at all.
*
* Join functions receive two adjacent siblings and their parent and what
* they return defines how many blank lines to use between them.
*
* @param left
* First of two adjacent siblings.
* @param right
* Second of two adjacent siblings.
* @param parent
* Parent of the two siblings.
* @param state
* Info passed around about the current state.
* @returns
* How many blank lines to use between the siblings.
*
* Where `true` is as passing `1` and `false` means the nodes cannot be
* joined by a blank line, such as two adjacent block quotes or indented code
* after a list, in which case a comment will be injected to break them up:
*
* ```markdown
* > Quote 1
*
* <!---->
*
* > Quote 2
* ```
*
* > 👉 **Note**: abusing this feature will break markdown.
* > One such example is when returning `0` for two paragraphs, which will
* > result in the text running together, and in the future to be seen as
* > one paragraph.
*/
export type Join = (
left: FlowChildren,
right: FlowChildren,
parent: FlowParents,
state: State
) => boolean | number | null | undefined | void
/**
* Map function to pad a single line.
*
* @param value
* A single line of serialized markdown.
* @param line
* Line number relative to the fragment.
* @param blank
* Whether the line is considered blank in markdown.
* @returns
* Padded line.
*/
export type Map = (value: string, line: number, blank: boolean) => string
/**
* Configuration (optional).
*/
export interface Options {
/**
* Marker to use in certain cases where the primary bullet doesn’t work
* (default: `'-'` when `bullet` is `'*'`, `'*'` otherwise).
*
* Cannot be equal to `bullet`.
*/
bulletOther?: '*' | '+' | '-' | null | undefined
/**
* Marker to use for bullets of items in ordered lists (default: `'.'`).
*
* There is one case where the primary bullet for ordered items cannot be
* used:
*
* * when two ordered lists appear next to each other: `1. a\n2) b`; to
* solve
* that, `'.'` will be used when `bulletOrdered` is `')'`, and `'.'`
* otherwise
*/
bulletOrdered?: '.' | ')' | null | undefined
/**
* Marker to use for bullets of items in unordered lists (default: `'*'`).
*
* There are three cases where the primary bullet cannot be used:
*
* * when three or more list items are on their own, the last one is empty,
* and `bullet` is also a valid `rule`: `* - +`; this would turn into a
* thematic break if serialized with three primary bullets; `bulletOther`
* is used for the last item
* * when a thematic break is the first child of a list item and `bullet` is
* the same character as `rule`: `- ***`; this would turn into a single
* thematic break if serialized with primary bullets; `bulletOther` is used
* for the item
* * when two unordered lists appear next to each other: `* a\n- b`;
* `bulletOther` is used for such lists
*/
bullet?: '*' | '+' | '-' | null | undefined
/**
* Whether to add the same number of number signs (`#`) at the end of an ATX
* heading as the opening sequence (default: `false`).
*/
closeAtx?: boolean | null | undefined
/**
* Marker to use for emphasis (default: `'*'`).
*/
emphasis?: '*' | '_' | null | undefined
/**
* List of extensions to include (optional).
*
* Each `ToMarkdownExtension` is an object with the same interface as
* `Options` here.
*/
extensions?: Array<Options> | null | undefined
/**
* Whether to use fenced code always (default: `true`).
*
* The default is to use fenced code if there is a language defined, if the
* code is empty, or if it starts or ends in blank lines.
*/
fences?: boolean | null | undefined
/**
* Marker to use for fenced code (default: ``'`'``).
*/
fence?: '`' | '~' | null | undefined
/**
* Handle particular nodes (optional).
*
* Each key is a node type, each value its corresponding handler.
*/
handlers?: Partial<Handlers> | null | undefined
/**
* Whether to increment the counter of ordered lists items (default: `true`).
*/
incrementListMarker?: boolean | null | undefined
/**
* How to join blocks (optional).
*/
join?: Array<Join> | null | undefined
/**
* How to indent the content of list items (default: `'one'`).
*
* Either with the size of the bullet plus one space (when `'one'`), a tab
* stop (`'tab'`), or depending on the item and its parent list (`'mixed'`,
* uses `'one'` if the item and list are tight and `'tab'` otherwise).
*/
listItemIndent?: 'mixed' | 'one' | 'tab' | null | undefined
/**
* Marker to use for titles (default: `'"'`).
*/
quote?: '"' | "'" | null | undefined
/**
* Whether to always use resource links (default: `false`).
*
* The default is to use autolinks (`<https://example.com>`) when possible
* and resource links (`[text](url)`) otherwise.
*/
resourceLink?: boolean | null | undefined
/**
* Number of markers to use for thematic breaks (default: `3`).
*/
ruleRepetition?: number | null | undefined
/**
* Whether to add spaces between markers in thematic breaks (default:
* `false`).
*/
ruleSpaces?: boolean | null | undefined
/**
* Marker to use for thematic breaks (default: `'*'`).
*/
rule?: '*' | '-' | '_' | null | undefined
/**
* Whether to use setext headings when possible (default: `false`).
*
* The default is to always use ATX headings (`# heading`) instead of setext
* headings (`heading\n=======`).
* Setext headings cannot be used for empty headings or headings with a rank
* of three or more.
*/
setext?: boolean | null | undefined
/**
* Marker to use for strong (default: `'*'`).
*/
strong?: '*' | '_' | null | undefined
/**
* Whether to join definitions without a blank line (default: `false`).
*
* The default is to add blank lines between any flow (“block”) construct.
* Turning this option on is a shortcut for a join function like so:
*
* ```js
* function joinTightDefinitions(left, right) {
* if (left.type === 'definition' && right.type === 'definition') {
* return 0
* }
* }
* ```
*/
tightDefinitions?: boolean | null | undefined
/**
* Schemas that define when characters cannot occur (optional).
*/
unsafe?: Array<Unsafe> | null | undefined
}
/**
* Parent of phrasing nodes.
*/
export type PhrasingParents = Parents extends {
children: Array<infer T>
}
? PhrasingContent extends T
? Parents
: never
: never
/**
* Configuration for `safe`
*/
export interface SafeConfig extends SafeFields {
/**
* Extra characters that *must* be encoded (as character references) instead
* of escaped (character escapes) (optional).
*
* Only ASCII punctuation will use character escapes, so you never need to
* pass non-ASCII-punctuation here.
*/
encode?: Array<string> | null | undefined
}
/**
* Info on the characters that are around the current thing we are generating.
*/
export interface SafeFields {
/**
* Characters after this (guaranteed to be one, can be more).
*/
after: string
/**
* Characters before this (guaranteed to be one, can be more).
*/
before: string
}
/**
* Make a string safe for embedding in markdown constructs.
*
* In markdown, almost all punctuation characters can, in certain cases,
* result in something.
* Whether they do is highly subjective to where they happen and in what
* they happen.
*
* To solve this, `mdast-util-to-markdown` tracks:
*
* * Characters before and after something;
* * What “constructs” we are in.
*
* This information is then used by this function to escape or encode
* special characters.
*
* @param input
* Raw value to make safe.
* @param config
* Configuration.
* @returns
* Serialized markdown safe for embedding.
*/
export type Safe = (
input: string | null | undefined,
config: SafeConfig
) => string
/**
* Info passed around about the current state.
*/
export interface State {
/**
* Get an identifier from an association to match it to others.
*/
associationId: AssociationId
/**
* Info on whether to encode the surrounding of *attention*.
*
* Whether attention (emphasis, strong, strikethrough) forms
* depends on the characters inside and outside them.
* The characters inside can be handled by *attention* itself.
* However the outside characters are already handled.
* Or handled afterwards.
* This field can be used to signal from *attention* that some parent
* function (practically `containerPhrasing`) has to handle the surrounding.
*/
attentionEncodeSurroundingInfo: EncodeSurrounding | undefined
/**
* List marker currently in use.
*/
bulletCurrent: string | undefined
/**
* List marker previously in use.
*/
bulletLastUsed: string | undefined
/**
* Compile an unsafe pattern to a regex.
*/
compilePattern: CompilePattern
/**
* Serialize the children of a parent that contains phrasing children.
*/
containerPhrasing: ContainerPhrasing
/**
* Serialize the children of a parent that contains flow children.
*/
containerFlow: ContainerFlow
/**
* Track positional info in the output.
*/
createTracker: CreateTracker
/**
* Enter a construct (returns a corresponding exit function).
*/
enter: Enter
/**
* Applied handlers.
*/
handlers: Handlers
/**
* Call the configured handler for the given node.
*/
handle: Handle
/**
* Pad serialized markdown.
*/
indentLines: IndentLines
/**
* Positions of child nodes in their parents.
*/
indexStack: Array<number>
/**
* Applied join handlers.
*/
join: Array<Join>
/**
* Applied user configuration.
*/
options: Options
/**
* Serialize the children of a parent that contains flow children.
*/
safe: Safe
/**
* Stack of constructs we’re in.
*/
stack: Array<ConstructName>
/**
* Applied unsafe patterns.
*/
unsafe: Array<Unsafe>
}
/**
* Get current tracked info.
*
* @returns
* Current tracked info.
*/
export type TrackCurrent = () => TrackFields
/**
* Info on where we are in the document we are generating.
*/
export interface TrackFields {
/**
* Number of columns each line will be shifted by wrapping nodes.
*/
lineShift: number
/**
* Current point.
*/
now: Point
}
/**
* Move past some generated markdown.
*
* @param value
* Generated markdown.
* @returns
* Given markdown.
*/
export type TrackMove = (value: string | null | undefined) => string
/**
* Define a relative increased line shift (the typical indent for lines).
*
* @param value
* Relative increment in how much each line will be padded.
* @returns
* Nothing.
*/
export type TrackShift = (value: number) => undefined
/**
* Track positional info in the output.
*
* This info isn’t used yet but such functionality will allow line wrapping,
* source maps, etc.
*/
export interface Tracker {
/**
* Get the current tracked info.
*/
current: TrackCurrent
/**
* Move past some generated markdown.
*/
move: TrackMove
/**
* Define an increased line shift (the typical indent for lines).
*/
shift: TrackShift
}
/**
* Schema that defines when a character cannot occur.
*/
export interface Unsafe {
/**
* The unsafe pattern (this whole object) compiled as a regex (do not use).
*
* This is internal and must not be defined.
*/
_compiled?: RegExp | null | undefined
/**
* `character` is bad when this is after it (optional).
*/
after?: string | null | undefined
/**
* `character` is bad at a break (cannot be used together with `before`) (optional).
*/
atBreak?: boolean | null | undefined
/**
* `character` is bad when this is before it (cannot be used together with
* `atBreak`) (optional).
*/
before?: string | null | undefined
/**
* Single unsafe character.
*/
character: string
/**
* Constructs where this is bad (optional).
*/
inConstruct?: Array<ConstructName> | ConstructName | null | undefined
/**
* Constructs where this is fine again (optional).
*/
notInConstruct?: Array<ConstructName> | ConstructName | null | undefined
}