@rspress/core 2.0.0-beta.33 → 2.0.0-beta.35

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/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AdditionalPage } from '@rspress/shared';
2
2
  import type { Data as Data_2 } from 'unist';
3
+ import { DefaultThemeConfig } from '@rspress/shared';
3
4
  import { getIconUrlPath } from '@rspress/shared/node-utils';
4
5
  import { getNodeAttribute } from '@rspress/shared/node-utils';
5
6
  import { getSidebarDataGroup } from '@rspress/shared';
@@ -8,12 +9,16 @@ import { MarkdownOptions } from '@rspress/shared';
8
9
  import { matchPath } from '@rspress/runtime/server';
9
10
  import { mergeDocConfig } from '@rspress/shared/node-utils';
10
11
  import { Nav } from '@rspress/shared';
12
+ import type { NavItem } from '@rspress/shared';
11
13
  import { NavItemWithLink } from '@rspress/shared';
12
14
  import type { Node as Node_3 } from 'unist';
13
15
  import { normalizeHref } from '@rspress/shared';
14
16
  import { normalizePosixPath } from '@rspress/shared';
17
+ import type { Options as Options_2 } from 'vfile-message';
15
18
  import { PageIndexInfo } from '@rspress/shared';
16
19
  import type { Plugin as Plugin_2 } from 'unified';
20
+ import type { Point } from 'unist';
21
+ import type { Position } from 'unist';
17
22
  import { removeTrailingSlash } from '@rspress/shared';
18
23
  import { RouteMeta } from '@rspress/shared';
19
24
  import type { RsbuildConfig } from '@rsbuild/core';
@@ -27,6 +32,7 @@ import { SidebarGroup } from '@rspress/shared';
27
32
  import { SidebarItem } from '@rspress/shared';
28
33
  import { SidebarSectionHeader } from '@rspress/shared';
29
34
  import { UserConfig } from '@rspress/shared';
35
+ import { VFileMessage } from 'vfile-message';
30
36
  import { withBase } from '@rspress/shared';
31
37
 
32
38
  export declare function build(options: BuildOptions): Promise<void>;
@@ -37,6 +43,49 @@ declare interface BuildOptions {
37
43
  configFilePath: string;
38
44
  }
39
45
 
46
+ /**
47
+ * Things that can be passed to the constructor.
48
+ */
49
+ declare type Compatible = Options | URL | VFile | Value
50
+
51
+ export declare type CustomLinkMeta = {
52
+ type: 'custom-link';
53
+ label: string;
54
+ tag?: string;
55
+ overviewHeaders?: number[];
56
+ context?: string;
57
+ link: string;
58
+ } | {
59
+ type: 'custom-link';
60
+ label: string;
61
+ tag?: string;
62
+ overviewHeaders?: number[];
63
+ context?: string;
64
+ link?: string;
65
+ collapsible?: boolean;
66
+ collapsed?: boolean;
67
+ items: _CustomLinkMetaWithoutTypeField[];
68
+ };
69
+
70
+ declare type _CustomLinkMetaWithoutTypeField = {
71
+ type?: 'custom-link';
72
+ label: string;
73
+ tag?: string;
74
+ overviewHeaders?: number[];
75
+ context?: string;
76
+ link: string;
77
+ } | {
78
+ type?: 'custom-link';
79
+ label: string;
80
+ tag?: string;
81
+ overviewHeaders?: number[];
82
+ context?: string;
83
+ link?: string;
84
+ collapsible?: boolean;
85
+ collapsed?: boolean;
86
+ items: _CustomLinkMetaWithoutTypeField[];
87
+ };
88
+
40
89
  /**
41
90
  * Info associated with mdast nodes by the ecosystem.
42
91
  *
@@ -57,6 +106,30 @@ declare interface BuildOptions {
57
106
  */
58
107
  declare interface Data extends Data_2 {}
59
108
 
109
+ /**
110
+ * Custom info.
111
+ *
112
+ * Known attributes can be added to {@linkcode DataMap}
113
+ */
114
+ declare type Data_3 = Record<string, unknown> & Partial<DataMap>
115
+
116
+ /**
117
+ * This map registers the type of the `data` key of a `VFile`.
118
+ *
119
+ * This type can be augmented to register custom `data` types.
120
+ *
121
+ * @example
122
+ * declare module 'vfile' {
123
+ * interface DataMap {
124
+ * // `file.data.name` is typed as `string`
125
+ * name: string
126
+ * }
127
+ * }
128
+ */
129
+ declare interface DataMap {
130
+ [emptyObjectSymbol]?: never
131
+ }
132
+
60
133
  export declare function defineConfig(config: UserConfig): UserConfig;
61
134
 
62
135
  export declare function dev(options: DevOptions): Promise<ServerInstance>;
@@ -69,6 +142,37 @@ declare interface DevOptions {
69
142
  extraBuilderConfig?: RsbuildConfig;
70
143
  }
71
144
 
145
+ export declare type DirSectionHeaderSideMeta = Omit<DirSideMeta, 'type'> & Omit<SectionHeaderMeta, 'type'> & {
146
+ type: 'dir-section-header';
147
+ };
148
+
149
+ export declare type DirSideMeta = {
150
+ type: 'dir';
151
+ name: string;
152
+ label?: string;
153
+ tag?: string;
154
+ overviewHeaders?: number[];
155
+ context?: string;
156
+ collapsible?: boolean;
157
+ collapsed?: boolean;
158
+ };
159
+
160
+ export declare type DividerSideMeta = {
161
+ type: 'divider';
162
+ dashed?: boolean;
163
+ };
164
+
165
+ declare const emptyObjectSymbol: unique symbol;
166
+
167
+ export declare type FileSideMeta = {
168
+ type: 'file';
169
+ name: string;
170
+ label?: string;
171
+ tag?: string;
172
+ overviewHeaders?: number[];
173
+ context?: string;
174
+ };
175
+
72
176
  export { getIconUrlPath }
73
177
 
74
178
  export { getNodeAttribute }
@@ -83,14 +187,55 @@ declare interface InitOptions {
83
187
 
84
188
  export { logger }
85
189
 
190
+ /**
191
+ * Raw source map.
192
+ *
193
+ * See:
194
+ * <https://github.com/mozilla/source-map/blob/60adcb0/source-map.d.ts#L15-L23>.
195
+ */
196
+ declare interface Map_2 {
197
+ /**
198
+ * The generated file this source map is associated with.
199
+ */
200
+ file: string
201
+ /**
202
+ * A string of base64 VLQs which contain the actual mappings.
203
+ */
204
+ mappings: string
205
+ /**
206
+ * An array of identifiers which can be referenced by individual mappings.
207
+ */
208
+ names: Array<string>
209
+ /**
210
+ * An array of contents of the original source files.
211
+ */
212
+ sourcesContent?: Array<string> | undefined
213
+ /**
214
+ * The URL root from which all sources are relative.
215
+ */
216
+ sourceRoot?: string | undefined
217
+ /**
218
+ * An array of URLs to the original source files.
219
+ */
220
+ sources: Array<string>
221
+ /**
222
+ * Which version of the source map spec this map is following.
223
+ */
224
+ version: number
225
+ }
226
+
86
227
  export { matchPath }
87
228
 
88
229
  export { mergeDocConfig }
89
230
 
231
+ export declare type MetaJson = SideMeta;
232
+
90
233
  export { Nav }
91
234
 
92
235
  export { NavItemWithLink }
93
236
 
237
+ export declare type NavJson = NavItem[];
238
+
94
239
  /**
95
240
  * Abstract mdast node.
96
241
  *
@@ -111,10 +256,61 @@ declare interface Node_2 extends Node_3 {
111
256
  data?: Data | undefined;
112
257
  }
113
258
 
259
+ declare type NodeLike = object & {
260
+ type: string;
261
+ position?: Position | undefined;
262
+ };
263
+
114
264
  export { normalizeHref }
115
265
 
116
266
  export { normalizePosixPath }
117
267
 
268
+ /**
269
+ * Configuration.
270
+ */
271
+ declare interface Options {
272
+ /**
273
+ * Arbitrary fields that will be shallow copied over to the new file.
274
+ */
275
+ [key: string]: unknown
276
+ /**
277
+ * Set `basename` (name).
278
+ */
279
+ basename?: string | null | undefined
280
+ /**
281
+ * Set `cwd` (working directory).
282
+ */
283
+ cwd?: string | null | undefined
284
+ /**
285
+ * Set `data` (associated info).
286
+ */
287
+ data?: Data_3 | null | undefined
288
+ /**
289
+ * Set `dirname` (path w/o basename).
290
+ */
291
+ dirname?: string | null | undefined
292
+ /**
293
+ * Set `extname` (extension with dot).
294
+ */
295
+ extname?: string | null | undefined
296
+ /**
297
+ * Set `history` (paths the file moved between).
298
+ */
299
+ history?: Array<string> | null | undefined
300
+ /**
301
+ * Set `path` (current path).
302
+ */
303
+ path?: URL | string | null | undefined
304
+ /**
305
+ * Set `stem` (name without extension).
306
+ */
307
+ stem?: string | null | undefined
308
+ /**
309
+ * Set `value` (the contents of the file).
310
+ */
311
+ value?: Value | null | undefined
312
+ }
313
+
118
314
  export { PageIndexInfo }
119
315
 
120
316
  /**
@@ -131,6 +327,33 @@ declare interface Parent extends Node_2 {
131
327
  children: RootContent[];
132
328
  }
133
329
 
330
+ export declare class PluginDriver {
331
+ #private;
332
+ haveNavSidebarConfig: boolean;
333
+ static create(config: UserConfig, configFilePath: string, isProd: boolean): Promise<PluginDriver>;
334
+ private constructor();
335
+ getConfigFilePath(): string;
336
+ init(): Promise<void>;
337
+ addPlugin(plugin: RspressPlugin): void;
338
+ getPlugins(): RspressPlugin[];
339
+ clearPlugins(): void;
340
+ removePlugin(pluginName: string): void;
341
+ private normalizeConfig;
342
+ modifyConfig(): Promise<UserConfig<DefaultThemeConfig>>;
343
+ beforeBuild(): Promise<void[]>;
344
+ afterBuild(): Promise<void[]>;
345
+ modifySearchIndexData(pages: PageIndexInfo[]): Promise<void[]>;
346
+ extendPageData(pageData: PageIndexInfo): Promise<void[]>;
347
+ addPages(): Promise<AdditionalPage[]>;
348
+ routeGenerated(routes: RouteMeta[]): Promise<void[]>;
349
+ routeServiceGenerated(routeService: RouteService): Promise<void[]>;
350
+ addRuntimeModules(): Promise<Record<string, string>>;
351
+ globalUIComponents(): (string | [string, object])[];
352
+ globalStyles(): string[];
353
+ _runParallelAsyncHook<H extends RspressPluginHookKeys>(hookName: H, ...args: Parameters<Required<RspressPlugin>[H]>): Promise<Awaited<ReturnType<Required<RspressPlugin>[H]>>[]>;
354
+ _runSerialAsyncHook<H extends RspressPluginHookKeys>(hookName: H, ...args: Parameters<Required<RspressPlugin>[H]>): RspressPlugin;
355
+ }
356
+
134
357
  export declare const remarkFileCodeBlock: Plugin_2<[
135
358
  {
136
359
  filepath: string;
@@ -143,14 +366,13 @@ export declare const remarkFileCodeBlock: Plugin_2<[
143
366
  * 1. add version and lang prefix to the link
144
367
  * 2. checkDeadLinks
145
368
  */
146
- export declare const remarkLink: Plugin_2<[
147
- {
369
+ export declare const remarkLink: ({ cleanUrls, routeService, remarkLinkOptions, lint, __base, }: {
148
370
  cleanUrls: boolean | string;
149
371
  routeService: RouteService | null;
150
- remarkLinkOptions?: MarkdownOptions['link'];
372
+ remarkLinkOptions?: MarkdownOptions["link"];
373
+ lint?: boolean;
151
374
  __base?: string;
152
- }
153
- ], Root>;
375
+ }) => (tree: Root, file: VFile) => void;
154
376
 
155
377
  export { removeTrailingSlash }
156
378
 
@@ -221,12 +443,23 @@ export declare class RouteService {
221
443
  isInDocsDir(absolutePath: string): boolean;
222
444
  absolutePathToRelativePath(absolutePath: string): string;
223
445
  getRoutePageByRoutePath(routePath: string): RoutePage | undefined;
446
+ getDocsDir(): string;
447
+ getLangs(): string[];
448
+ getDefaultLang(): string;
224
449
  }
225
450
 
226
451
  export { RSPRESS_TEMP_DIR }
227
452
 
228
453
  export { RspressPlugin }
229
454
 
455
+ declare type RspressPluginHookKeys = 'beforeBuild' | 'config' | 'afterBuild' | 'addPages' | 'addRuntimeModules' | 'routeGenerated' | 'routeServiceGenerated' | 'extendPageData' | 'modifySearchIndexData';
456
+
457
+ export declare type SectionHeaderMeta = {
458
+ type: 'section-header';
459
+ label: string;
460
+ tag?: string;
461
+ };
462
+
230
463
  export declare function serve(options: ServeOptions): Promise<ReturnType<RsbuildInstance['preview']>>;
231
464
 
232
465
  declare interface ServeOptions {
@@ -250,8 +483,1471 @@ export { SidebarItem }
250
483
 
251
484
  export { SidebarSectionHeader }
252
485
 
486
+ export declare type SideMeta = SideMetaItem[];
487
+
488
+ export declare type SideMetaItem = FileSideMeta | DirSideMeta | DirSectionHeaderSideMeta | DividerSideMeta | SectionHeaderMeta | CustomLinkMeta | string;
489
+
253
490
  export { UserConfig }
254
491
 
492
+ /**
493
+ * Contents of the file.
494
+ *
495
+ * Can either be text or a `Uint8Array` structure.
496
+ */
497
+ declare type Value = Uint8Array | string
498
+
499
+ declare class VFile {
500
+ /**
501
+ * Create a new virtual file.
502
+ *
503
+ * `options` is treated as:
504
+ *
505
+ * * `string` or `Uint8Array` — `{value: options}`
506
+ * * `URL` — `{path: options}`
507
+ * * `VFile` — shallow copies its data over to the new file
508
+ * * `object` — all fields are shallow copied over to the new file
509
+ *
510
+ * Path related fields are set in the following order (least specific to
511
+ * most specific): `history`, `path`, `basename`, `stem`, `extname`,
512
+ * `dirname`.
513
+ *
514
+ * You cannot set `dirname` or `extname` without setting either `history`,
515
+ * `path`, `basename`, or `stem` too.
516
+ *
517
+ * @param {Compatible | null | undefined} [value]
518
+ * File value.
519
+ * @returns
520
+ * New instance.
521
+ */
522
+ constructor(value?: Compatible | null | undefined);
523
+ /**
524
+ * Base of `path` (default: `process.cwd()` or `'/'` in browsers).
525
+ *
526
+ * @type {string}
527
+ */
528
+ cwd: string;
529
+ /**
530
+ * Place to store custom info (default: `{}`).
531
+ *
532
+ * It’s OK to store custom data directly on the file but moving it to
533
+ * `data` is recommended.
534
+ *
535
+ * @type {Data}
536
+ */
537
+ data: Data_3;
538
+ /**
539
+ * List of file paths the file moved between.
540
+ *
541
+ * The first is the original path and the last is the current path.
542
+ *
543
+ * @type {Array<string>}
544
+ */
545
+ history: Array<string>;
546
+ /**
547
+ * List of messages associated with the file.
548
+ *
549
+ * @type {Array<VFileMessage>}
550
+ */
551
+ messages: Array<VFileMessage>;
552
+ /**
553
+ * Raw value.
554
+ *
555
+ * @type {Value}
556
+ */
557
+ value: Value;
558
+ /**
559
+ * Source map.
560
+ *
561
+ * This type is equivalent to the `RawSourceMap` type from the `source-map`
562
+ * module.
563
+ *
564
+ * @type {Map | null | undefined}
565
+ */
566
+ map: Map_2 | null | undefined;
567
+ /**
568
+ * Custom, non-string, compiled, representation.
569
+ *
570
+ * This is used by unified to store non-string results.
571
+ * One example is when turning markdown into React nodes.
572
+ *
573
+ * @type {unknown}
574
+ */
575
+ result: unknown;
576
+ /**
577
+ * Whether a file was saved to disk.
578
+ *
579
+ * This is used by vfile reporters.
580
+ *
581
+ * @type {boolean}
582
+ */
583
+ stored: boolean;
584
+ /**
585
+ * Set basename (including extname) (`'index.min.js'`).
586
+ *
587
+ * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
588
+ * on windows).
589
+ * Cannot be nullified (use `file.path = file.dirname` instead).
590
+ *
591
+ * @param {string} basename
592
+ * Basename.
593
+ * @returns {undefined}
594
+ * Nothing.
595
+ */
596
+ set basename(basename: string);
597
+ /**
598
+ * Get the basename (including extname) (example: `'index.min.js'`).
599
+ *
600
+ * @returns {string | undefined}
601
+ * Basename.
602
+ */
603
+ get basename(): string | undefined;
604
+ /**
605
+ * Set the full path (example: `'~/index.min.js'`).
606
+ *
607
+ * Cannot be nullified.
608
+ * You can set a file URL (a `URL` object with a `file:` protocol) which will
609
+ * be turned into a path with `url.fileURLToPath`.
610
+ *
611
+ * @param {URL | string} path
612
+ * Path.
613
+ * @returns {undefined}
614
+ * Nothing.
615
+ */
616
+ set path(path: string | URL);
617
+ /**
618
+ * Get the full path (example: `'~/index.min.js'`).
619
+ *
620
+ * @returns {string}
621
+ * Path.
622
+ */
623
+ get path(): string;
624
+ /**
625
+ * Set the parent path (example: `'~'`).
626
+ *
627
+ * Cannot be set if there’s no `path` yet.
628
+ *
629
+ * @param {string | undefined} dirname
630
+ * Dirname.
631
+ * @returns {undefined}
632
+ * Nothing.
633
+ */
634
+ set dirname(dirname: string | undefined);
635
+ /**
636
+ * Get the parent path (example: `'~'`).
637
+ *
638
+ * @returns {string | undefined}
639
+ * Dirname.
640
+ */
641
+ get dirname(): string | undefined;
642
+ /**
643
+ * Set the extname (including dot) (example: `'.js'`).
644
+ *
645
+ * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
646
+ * on windows).
647
+ * Cannot be set if there’s no `path` yet.
648
+ *
649
+ * @param {string | undefined} extname
650
+ * Extname.
651
+ * @returns {undefined}
652
+ * Nothing.
653
+ */
654
+ set extname(extname: string | undefined);
655
+ /**
656
+ * Get the extname (including dot) (example: `'.js'`).
657
+ *
658
+ * @returns {string | undefined}
659
+ * Extname.
660
+ */
661
+ get extname(): string | undefined;
662
+ /**
663
+ * Set the stem (basename w/o extname) (example: `'index.min'`).
664
+ *
665
+ * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'`
666
+ * on windows).
667
+ * Cannot be nullified (use `file.path = file.dirname` instead).
668
+ *
669
+ * @param {string} stem
670
+ * Stem.
671
+ * @returns {undefined}
672
+ * Nothing.
673
+ */
674
+ set stem(stem: string);
675
+ /**
676
+ * Get the stem (basename w/o extname) (example: `'index.min'`).
677
+ *
678
+ * @returns {string | undefined}
679
+ * Stem.
680
+ */
681
+ get stem(): string | undefined;
682
+ /**
683
+ * Create a fatal message for `reason` associated with the file.
684
+ *
685
+ * The `fatal` field of the message is set to `true` (error; file not usable)
686
+ * and the `file` field is set to the current file path.
687
+ * The message is added to the `messages` field on `file`.
688
+ *
689
+ * > 🪦 **Note**: also has obsolete signatures.
690
+ *
691
+ * @overload@overload
692
+ * @param {string} reason
693
+ * @param {MessageOptions | null | undefined} [options]
694
+ * @returns {never}
695
+ *
696
+ * @overload@overload
697
+ * @param {string} reason
698
+ * @param {Node | NodeLike | null | undefined} parent
699
+ * @param {string | null | undefined} [origin]
700
+ * @returns {never}
701
+ *
702
+ * @overload@overload
703
+ * @param {string} reason
704
+ * @param {Point | Position | null | undefined} place
705
+ * @param {string | null | undefined} [origin]
706
+ * @returns {never}
707
+ *
708
+ * @overload@overload
709
+ * @param {string} reason
710
+ * @param {string | null | undefined} [origin]
711
+ * @returns {never}
712
+ *
713
+ * @overload@overload
714
+ * @param {Error | VFileMessage} cause
715
+ * @param {Node | NodeLike | null | undefined} parent
716
+ * @param {string | null | undefined} [origin]
717
+ * @returns {never}
718
+ *
719
+ * @overload@overload
720
+ * @param {Error | VFileMessage} cause
721
+ * @param {Point | Position | null | undefined} place
722
+ * @param {string | null | undefined} [origin]
723
+ * @returns {never}
724
+ *
725
+ * @overload@overload
726
+ * @param {Error | VFileMessage} cause
727
+ * @param {string | null | undefined} [origin]
728
+ * @returns {never}
729
+ *
730
+ * @param {Error | VFileMessage | string} causeOrReason
731
+ * Reason for message, should use markdown.
732
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
733
+ * Configuration (optional).
734
+ * @param {string | null | undefined} [origin]
735
+ * Place in code where the message originates (example:
736
+ * `'my-package:my-rule'` or `'my-rule'`).
737
+ * @returns {never}
738
+ * Never.
739
+ * @throws {VFileMessage}
740
+ * Message.
741
+ */
742
+ fail(reason: string, options?: Options_2 | null | undefined): never;
743
+ /**
744
+ * Create a fatal message for `reason` associated with the file.
745
+ *
746
+ * The `fatal` field of the message is set to `true` (error; file not usable)
747
+ * and the `file` field is set to the current file path.
748
+ * The message is added to the `messages` field on `file`.
749
+ *
750
+ * > 🪦 **Note**: also has obsolete signatures.
751
+ *
752
+ * @overload@overload
753
+ * @param {string} reason
754
+ * @param {MessageOptions | null | undefined} [options]
755
+ * @returns {never}
756
+ *
757
+ * @overload@overload
758
+ * @param {string} reason
759
+ * @param {Node | NodeLike | null | undefined} parent
760
+ * @param {string | null | undefined} [origin]
761
+ * @returns {never}
762
+ *
763
+ * @overload@overload
764
+ * @param {string} reason
765
+ * @param {Point | Position | null | undefined} place
766
+ * @param {string | null | undefined} [origin]
767
+ * @returns {never}
768
+ *
769
+ * @overload@overload
770
+ * @param {string} reason
771
+ * @param {string | null | undefined} [origin]
772
+ * @returns {never}
773
+ *
774
+ * @overload@overload
775
+ * @param {Error | VFileMessage} cause
776
+ * @param {Node | NodeLike | null | undefined} parent
777
+ * @param {string | null | undefined} [origin]
778
+ * @returns {never}
779
+ *
780
+ * @overload@overload
781
+ * @param {Error | VFileMessage} cause
782
+ * @param {Point | Position | null | undefined} place
783
+ * @param {string | null | undefined} [origin]
784
+ * @returns {never}
785
+ *
786
+ * @overload@overload
787
+ * @param {Error | VFileMessage} cause
788
+ * @param {string | null | undefined} [origin]
789
+ * @returns {never}
790
+ *
791
+ * @param {Error | VFileMessage | string} causeOrReason
792
+ * Reason for message, should use markdown.
793
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
794
+ * Configuration (optional).
795
+ * @param {string | null | undefined} [origin]
796
+ * Place in code where the message originates (example:
797
+ * `'my-package:my-rule'` or `'my-rule'`).
798
+ * @returns {never}
799
+ * Never.
800
+ * @throws {VFileMessage}
801
+ * Message.
802
+ */
803
+ fail(reason: string, parent: Node_3 | NodeLike | null | undefined, origin?: string | null | undefined): never;
804
+ /**
805
+ * Create a fatal message for `reason` associated with the file.
806
+ *
807
+ * The `fatal` field of the message is set to `true` (error; file not usable)
808
+ * and the `file` field is set to the current file path.
809
+ * The message is added to the `messages` field on `file`.
810
+ *
811
+ * > 🪦 **Note**: also has obsolete signatures.
812
+ *
813
+ * @overload@overload
814
+ * @param {string} reason
815
+ * @param {MessageOptions | null | undefined} [options]
816
+ * @returns {never}
817
+ *
818
+ * @overload@overload
819
+ * @param {string} reason
820
+ * @param {Node | NodeLike | null | undefined} parent
821
+ * @param {string | null | undefined} [origin]
822
+ * @returns {never}
823
+ *
824
+ * @overload@overload
825
+ * @param {string} reason
826
+ * @param {Point | Position | null | undefined} place
827
+ * @param {string | null | undefined} [origin]
828
+ * @returns {never}
829
+ *
830
+ * @overload@overload
831
+ * @param {string} reason
832
+ * @param {string | null | undefined} [origin]
833
+ * @returns {never}
834
+ *
835
+ * @overload@overload
836
+ * @param {Error | VFileMessage} cause
837
+ * @param {Node | NodeLike | null | undefined} parent
838
+ * @param {string | null | undefined} [origin]
839
+ * @returns {never}
840
+ *
841
+ * @overload@overload
842
+ * @param {Error | VFileMessage} cause
843
+ * @param {Point | Position | null | undefined} place
844
+ * @param {string | null | undefined} [origin]
845
+ * @returns {never}
846
+ *
847
+ * @overload@overload
848
+ * @param {Error | VFileMessage} cause
849
+ * @param {string | null | undefined} [origin]
850
+ * @returns {never}
851
+ *
852
+ * @param {Error | VFileMessage | string} causeOrReason
853
+ * Reason for message, should use markdown.
854
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
855
+ * Configuration (optional).
856
+ * @param {string | null | undefined} [origin]
857
+ * Place in code where the message originates (example:
858
+ * `'my-package:my-rule'` or `'my-rule'`).
859
+ * @returns {never}
860
+ * Never.
861
+ * @throws {VFileMessage}
862
+ * Message.
863
+ */
864
+ fail(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined): never;
865
+ /**
866
+ * Create a fatal message for `reason` associated with the file.
867
+ *
868
+ * The `fatal` field of the message is set to `true` (error; file not usable)
869
+ * and the `file` field is set to the current file path.
870
+ * The message is added to the `messages` field on `file`.
871
+ *
872
+ * > 🪦 **Note**: also has obsolete signatures.
873
+ *
874
+ * @overload@overload
875
+ * @param {string} reason
876
+ * @param {MessageOptions | null | undefined} [options]
877
+ * @returns {never}
878
+ *
879
+ * @overload@overload
880
+ * @param {string} reason
881
+ * @param {Node | NodeLike | null | undefined} parent
882
+ * @param {string | null | undefined} [origin]
883
+ * @returns {never}
884
+ *
885
+ * @overload@overload
886
+ * @param {string} reason
887
+ * @param {Point | Position | null | undefined} place
888
+ * @param {string | null | undefined} [origin]
889
+ * @returns {never}
890
+ *
891
+ * @overload@overload
892
+ * @param {string} reason
893
+ * @param {string | null | undefined} [origin]
894
+ * @returns {never}
895
+ *
896
+ * @overload@overload
897
+ * @param {Error | VFileMessage} cause
898
+ * @param {Node | NodeLike | null | undefined} parent
899
+ * @param {string | null | undefined} [origin]
900
+ * @returns {never}
901
+ *
902
+ * @overload@overload
903
+ * @param {Error | VFileMessage} cause
904
+ * @param {Point | Position | null | undefined} place
905
+ * @param {string | null | undefined} [origin]
906
+ * @returns {never}
907
+ *
908
+ * @overload@overload
909
+ * @param {Error | VFileMessage} cause
910
+ * @param {string | null | undefined} [origin]
911
+ * @returns {never}
912
+ *
913
+ * @param {Error | VFileMessage | string} causeOrReason
914
+ * Reason for message, should use markdown.
915
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
916
+ * Configuration (optional).
917
+ * @param {string | null | undefined} [origin]
918
+ * Place in code where the message originates (example:
919
+ * `'my-package:my-rule'` or `'my-rule'`).
920
+ * @returns {never}
921
+ * Never.
922
+ * @throws {VFileMessage}
923
+ * Message.
924
+ */
925
+ fail(reason: string, origin?: string | null | undefined): never;
926
+ /**
927
+ * Create a fatal message for `reason` associated with the file.
928
+ *
929
+ * The `fatal` field of the message is set to `true` (error; file not usable)
930
+ * and the `file` field is set to the current file path.
931
+ * The message is added to the `messages` field on `file`.
932
+ *
933
+ * > 🪦 **Note**: also has obsolete signatures.
934
+ *
935
+ * @overload@overload
936
+ * @param {string} reason
937
+ * @param {MessageOptions | null | undefined} [options]
938
+ * @returns {never}
939
+ *
940
+ * @overload@overload
941
+ * @param {string} reason
942
+ * @param {Node | NodeLike | null | undefined} parent
943
+ * @param {string | null | undefined} [origin]
944
+ * @returns {never}
945
+ *
946
+ * @overload@overload
947
+ * @param {string} reason
948
+ * @param {Point | Position | null | undefined} place
949
+ * @param {string | null | undefined} [origin]
950
+ * @returns {never}
951
+ *
952
+ * @overload@overload
953
+ * @param {string} reason
954
+ * @param {string | null | undefined} [origin]
955
+ * @returns {never}
956
+ *
957
+ * @overload@overload
958
+ * @param {Error | VFileMessage} cause
959
+ * @param {Node | NodeLike | null | undefined} parent
960
+ * @param {string | null | undefined} [origin]
961
+ * @returns {never}
962
+ *
963
+ * @overload@overload
964
+ * @param {Error | VFileMessage} cause
965
+ * @param {Point | Position | null | undefined} place
966
+ * @param {string | null | undefined} [origin]
967
+ * @returns {never}
968
+ *
969
+ * @overload@overload
970
+ * @param {Error | VFileMessage} cause
971
+ * @param {string | null | undefined} [origin]
972
+ * @returns {never}
973
+ *
974
+ * @param {Error | VFileMessage | string} causeOrReason
975
+ * Reason for message, should use markdown.
976
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
977
+ * Configuration (optional).
978
+ * @param {string | null | undefined} [origin]
979
+ * Place in code where the message originates (example:
980
+ * `'my-package:my-rule'` or `'my-rule'`).
981
+ * @returns {never}
982
+ * Never.
983
+ * @throws {VFileMessage}
984
+ * Message.
985
+ */
986
+ fail(cause: Error | VFileMessage, parent: Node_3 | NodeLike | null | undefined, origin?: string | null | undefined): never;
987
+ /**
988
+ * Create a fatal message for `reason` associated with the file.
989
+ *
990
+ * The `fatal` field of the message is set to `true` (error; file not usable)
991
+ * and the `file` field is set to the current file path.
992
+ * The message is added to the `messages` field on `file`.
993
+ *
994
+ * > 🪦 **Note**: also has obsolete signatures.
995
+ *
996
+ * @overload@overload
997
+ * @param {string} reason
998
+ * @param {MessageOptions | null | undefined} [options]
999
+ * @returns {never}
1000
+ *
1001
+ * @overload@overload
1002
+ * @param {string} reason
1003
+ * @param {Node | NodeLike | null | undefined} parent
1004
+ * @param {string | null | undefined} [origin]
1005
+ * @returns {never}
1006
+ *
1007
+ * @overload@overload
1008
+ * @param {string} reason
1009
+ * @param {Point | Position | null | undefined} place
1010
+ * @param {string | null | undefined} [origin]
1011
+ * @returns {never}
1012
+ *
1013
+ * @overload@overload
1014
+ * @param {string} reason
1015
+ * @param {string | null | undefined} [origin]
1016
+ * @returns {never}
1017
+ *
1018
+ * @overload@overload
1019
+ * @param {Error | VFileMessage} cause
1020
+ * @param {Node | NodeLike | null | undefined} parent
1021
+ * @param {string | null | undefined} [origin]
1022
+ * @returns {never}
1023
+ *
1024
+ * @overload@overload
1025
+ * @param {Error | VFileMessage} cause
1026
+ * @param {Point | Position | null | undefined} place
1027
+ * @param {string | null | undefined} [origin]
1028
+ * @returns {never}
1029
+ *
1030
+ * @overload@overload
1031
+ * @param {Error | VFileMessage} cause
1032
+ * @param {string | null | undefined} [origin]
1033
+ * @returns {never}
1034
+ *
1035
+ * @param {Error | VFileMessage | string} causeOrReason
1036
+ * Reason for message, should use markdown.
1037
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1038
+ * Configuration (optional).
1039
+ * @param {string | null | undefined} [origin]
1040
+ * Place in code where the message originates (example:
1041
+ * `'my-package:my-rule'` or `'my-rule'`).
1042
+ * @returns {never}
1043
+ * Never.
1044
+ * @throws {VFileMessage}
1045
+ * Message.
1046
+ */
1047
+ fail(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined): never;
1048
+ /**
1049
+ * Create a fatal message for `reason` associated with the file.
1050
+ *
1051
+ * The `fatal` field of the message is set to `true` (error; file not usable)
1052
+ * and the `file` field is set to the current file path.
1053
+ * The message is added to the `messages` field on `file`.
1054
+ *
1055
+ * > 🪦 **Note**: also has obsolete signatures.
1056
+ *
1057
+ * @overload@overload
1058
+ * @param {string} reason
1059
+ * @param {MessageOptions | null | undefined} [options]
1060
+ * @returns {never}
1061
+ *
1062
+ * @overload@overload
1063
+ * @param {string} reason
1064
+ * @param {Node | NodeLike | null | undefined} parent
1065
+ * @param {string | null | undefined} [origin]
1066
+ * @returns {never}
1067
+ *
1068
+ * @overload@overload
1069
+ * @param {string} reason
1070
+ * @param {Point | Position | null | undefined} place
1071
+ * @param {string | null | undefined} [origin]
1072
+ * @returns {never}
1073
+ *
1074
+ * @overload@overload
1075
+ * @param {string} reason
1076
+ * @param {string | null | undefined} [origin]
1077
+ * @returns {never}
1078
+ *
1079
+ * @overload@overload
1080
+ * @param {Error | VFileMessage} cause
1081
+ * @param {Node | NodeLike | null | undefined} parent
1082
+ * @param {string | null | undefined} [origin]
1083
+ * @returns {never}
1084
+ *
1085
+ * @overload@overload
1086
+ * @param {Error | VFileMessage} cause
1087
+ * @param {Point | Position | null | undefined} place
1088
+ * @param {string | null | undefined} [origin]
1089
+ * @returns {never}
1090
+ *
1091
+ * @overload@overload
1092
+ * @param {Error | VFileMessage} cause
1093
+ * @param {string | null | undefined} [origin]
1094
+ * @returns {never}
1095
+ *
1096
+ * @param {Error | VFileMessage | string} causeOrReason
1097
+ * Reason for message, should use markdown.
1098
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1099
+ * Configuration (optional).
1100
+ * @param {string | null | undefined} [origin]
1101
+ * Place in code where the message originates (example:
1102
+ * `'my-package:my-rule'` or `'my-rule'`).
1103
+ * @returns {never}
1104
+ * Never.
1105
+ * @throws {VFileMessage}
1106
+ * Message.
1107
+ */
1108
+ fail(cause: Error | VFileMessage, origin?: string | null | undefined): never;
1109
+ /**
1110
+ * Create an info message for `reason` associated with the file.
1111
+ *
1112
+ * The `fatal` field of the message is set to `undefined` (info; change
1113
+ * likely not needed) and the `file` field is set to the current file path.
1114
+ * The message is added to the `messages` field on `file`.
1115
+ *
1116
+ * > 🪦 **Note**: also has obsolete signatures.
1117
+ *
1118
+ * @overload@overload
1119
+ * @param {string} reason
1120
+ * @param {MessageOptions | null | undefined} [options]
1121
+ * @returns {VFileMessage}
1122
+ *
1123
+ * @overload@overload
1124
+ * @param {string} reason
1125
+ * @param {Node | NodeLike | null | undefined} parent
1126
+ * @param {string | null | undefined} [origin]
1127
+ * @returns {VFileMessage}
1128
+ *
1129
+ * @overload@overload
1130
+ * @param {string} reason
1131
+ * @param {Point | Position | null | undefined} place
1132
+ * @param {string | null | undefined} [origin]
1133
+ * @returns {VFileMessage}
1134
+ *
1135
+ * @overload@overload
1136
+ * @param {string} reason
1137
+ * @param {string | null | undefined} [origin]
1138
+ * @returns {VFileMessage}
1139
+ *
1140
+ * @overload@overload
1141
+ * @param {Error | VFileMessage} cause
1142
+ * @param {Node | NodeLike | null | undefined} parent
1143
+ * @param {string | null | undefined} [origin]
1144
+ * @returns {VFileMessage}
1145
+ *
1146
+ * @overload@overload
1147
+ * @param {Error | VFileMessage} cause
1148
+ * @param {Point | Position | null | undefined} place
1149
+ * @param {string | null | undefined} [origin]
1150
+ * @returns {VFileMessage}
1151
+ *
1152
+ * @overload@overload
1153
+ * @param {Error | VFileMessage} cause
1154
+ * @param {string | null | undefined} [origin]
1155
+ * @returns {VFileMessage}
1156
+ *
1157
+ * @param {Error | VFileMessage | string} causeOrReason
1158
+ * Reason for message, should use markdown.
1159
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1160
+ * Configuration (optional).
1161
+ * @param {string | null | undefined} [origin]
1162
+ * Place in code where the message originates (example:
1163
+ * `'my-package:my-rule'` or `'my-rule'`).
1164
+ * @returns {VFileMessage}
1165
+ * Message.
1166
+ */
1167
+ info(reason: string, options?: Options_2 | null | undefined): VFileMessage;
1168
+ /**
1169
+ * Create an info message for `reason` associated with the file.
1170
+ *
1171
+ * The `fatal` field of the message is set to `undefined` (info; change
1172
+ * likely not needed) and the `file` field is set to the current file path.
1173
+ * The message is added to the `messages` field on `file`.
1174
+ *
1175
+ * > 🪦 **Note**: also has obsolete signatures.
1176
+ *
1177
+ * @overload@overload
1178
+ * @param {string} reason
1179
+ * @param {MessageOptions | null | undefined} [options]
1180
+ * @returns {VFileMessage}
1181
+ *
1182
+ * @overload@overload
1183
+ * @param {string} reason
1184
+ * @param {Node | NodeLike | null | undefined} parent
1185
+ * @param {string | null | undefined} [origin]
1186
+ * @returns {VFileMessage}
1187
+ *
1188
+ * @overload@overload
1189
+ * @param {string} reason
1190
+ * @param {Point | Position | null | undefined} place
1191
+ * @param {string | null | undefined} [origin]
1192
+ * @returns {VFileMessage}
1193
+ *
1194
+ * @overload@overload
1195
+ * @param {string} reason
1196
+ * @param {string | null | undefined} [origin]
1197
+ * @returns {VFileMessage}
1198
+ *
1199
+ * @overload@overload
1200
+ * @param {Error | VFileMessage} cause
1201
+ * @param {Node | NodeLike | null | undefined} parent
1202
+ * @param {string | null | undefined} [origin]
1203
+ * @returns {VFileMessage}
1204
+ *
1205
+ * @overload@overload
1206
+ * @param {Error | VFileMessage} cause
1207
+ * @param {Point | Position | null | undefined} place
1208
+ * @param {string | null | undefined} [origin]
1209
+ * @returns {VFileMessage}
1210
+ *
1211
+ * @overload@overload
1212
+ * @param {Error | VFileMessage} cause
1213
+ * @param {string | null | undefined} [origin]
1214
+ * @returns {VFileMessage}
1215
+ *
1216
+ * @param {Error | VFileMessage | string} causeOrReason
1217
+ * Reason for message, should use markdown.
1218
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1219
+ * Configuration (optional).
1220
+ * @param {string | null | undefined} [origin]
1221
+ * Place in code where the message originates (example:
1222
+ * `'my-package:my-rule'` or `'my-rule'`).
1223
+ * @returns {VFileMessage}
1224
+ * Message.
1225
+ */
1226
+ info(reason: string, parent: Node_3 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
1227
+ /**
1228
+ * Create an info message for `reason` associated with the file.
1229
+ *
1230
+ * The `fatal` field of the message is set to `undefined` (info; change
1231
+ * likely not needed) and the `file` field is set to the current file path.
1232
+ * The message is added to the `messages` field on `file`.
1233
+ *
1234
+ * > 🪦 **Note**: also has obsolete signatures.
1235
+ *
1236
+ * @overload@overload
1237
+ * @param {string} reason
1238
+ * @param {MessageOptions | null | undefined} [options]
1239
+ * @returns {VFileMessage}
1240
+ *
1241
+ * @overload@overload
1242
+ * @param {string} reason
1243
+ * @param {Node | NodeLike | null | undefined} parent
1244
+ * @param {string | null | undefined} [origin]
1245
+ * @returns {VFileMessage}
1246
+ *
1247
+ * @overload@overload
1248
+ * @param {string} reason
1249
+ * @param {Point | Position | null | undefined} place
1250
+ * @param {string | null | undefined} [origin]
1251
+ * @returns {VFileMessage}
1252
+ *
1253
+ * @overload@overload
1254
+ * @param {string} reason
1255
+ * @param {string | null | undefined} [origin]
1256
+ * @returns {VFileMessage}
1257
+ *
1258
+ * @overload@overload
1259
+ * @param {Error | VFileMessage} cause
1260
+ * @param {Node | NodeLike | null | undefined} parent
1261
+ * @param {string | null | undefined} [origin]
1262
+ * @returns {VFileMessage}
1263
+ *
1264
+ * @overload@overload
1265
+ * @param {Error | VFileMessage} cause
1266
+ * @param {Point | Position | null | undefined} place
1267
+ * @param {string | null | undefined} [origin]
1268
+ * @returns {VFileMessage}
1269
+ *
1270
+ * @overload@overload
1271
+ * @param {Error | VFileMessage} cause
1272
+ * @param {string | null | undefined} [origin]
1273
+ * @returns {VFileMessage}
1274
+ *
1275
+ * @param {Error | VFileMessage | string} causeOrReason
1276
+ * Reason for message, should use markdown.
1277
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1278
+ * Configuration (optional).
1279
+ * @param {string | null | undefined} [origin]
1280
+ * Place in code where the message originates (example:
1281
+ * `'my-package:my-rule'` or `'my-rule'`).
1282
+ * @returns {VFileMessage}
1283
+ * Message.
1284
+ */
1285
+ info(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage;
1286
+ /**
1287
+ * Create an info message for `reason` associated with the file.
1288
+ *
1289
+ * The `fatal` field of the message is set to `undefined` (info; change
1290
+ * likely not needed) and the `file` field is set to the current file path.
1291
+ * The message is added to the `messages` field on `file`.
1292
+ *
1293
+ * > 🪦 **Note**: also has obsolete signatures.
1294
+ *
1295
+ * @overload@overload
1296
+ * @param {string} reason
1297
+ * @param {MessageOptions | null | undefined} [options]
1298
+ * @returns {VFileMessage}
1299
+ *
1300
+ * @overload@overload
1301
+ * @param {string} reason
1302
+ * @param {Node | NodeLike | null | undefined} parent
1303
+ * @param {string | null | undefined} [origin]
1304
+ * @returns {VFileMessage}
1305
+ *
1306
+ * @overload@overload
1307
+ * @param {string} reason
1308
+ * @param {Point | Position | null | undefined} place
1309
+ * @param {string | null | undefined} [origin]
1310
+ * @returns {VFileMessage}
1311
+ *
1312
+ * @overload@overload
1313
+ * @param {string} reason
1314
+ * @param {string | null | undefined} [origin]
1315
+ * @returns {VFileMessage}
1316
+ *
1317
+ * @overload@overload
1318
+ * @param {Error | VFileMessage} cause
1319
+ * @param {Node | NodeLike | null | undefined} parent
1320
+ * @param {string | null | undefined} [origin]
1321
+ * @returns {VFileMessage}
1322
+ *
1323
+ * @overload@overload
1324
+ * @param {Error | VFileMessage} cause
1325
+ * @param {Point | Position | null | undefined} place
1326
+ * @param {string | null | undefined} [origin]
1327
+ * @returns {VFileMessage}
1328
+ *
1329
+ * @overload@overload
1330
+ * @param {Error | VFileMessage} cause
1331
+ * @param {string | null | undefined} [origin]
1332
+ * @returns {VFileMessage}
1333
+ *
1334
+ * @param {Error | VFileMessage | string} causeOrReason
1335
+ * Reason for message, should use markdown.
1336
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1337
+ * Configuration (optional).
1338
+ * @param {string | null | undefined} [origin]
1339
+ * Place in code where the message originates (example:
1340
+ * `'my-package:my-rule'` or `'my-rule'`).
1341
+ * @returns {VFileMessage}
1342
+ * Message.
1343
+ */
1344
+ info(reason: string, origin?: string | null | undefined): VFileMessage;
1345
+ /**
1346
+ * Create an info message for `reason` associated with the file.
1347
+ *
1348
+ * The `fatal` field of the message is set to `undefined` (info; change
1349
+ * likely not needed) and the `file` field is set to the current file path.
1350
+ * The message is added to the `messages` field on `file`.
1351
+ *
1352
+ * > 🪦 **Note**: also has obsolete signatures.
1353
+ *
1354
+ * @overload@overload
1355
+ * @param {string} reason
1356
+ * @param {MessageOptions | null | undefined} [options]
1357
+ * @returns {VFileMessage}
1358
+ *
1359
+ * @overload@overload
1360
+ * @param {string} reason
1361
+ * @param {Node | NodeLike | null | undefined} parent
1362
+ * @param {string | null | undefined} [origin]
1363
+ * @returns {VFileMessage}
1364
+ *
1365
+ * @overload@overload
1366
+ * @param {string} reason
1367
+ * @param {Point | Position | null | undefined} place
1368
+ * @param {string | null | undefined} [origin]
1369
+ * @returns {VFileMessage}
1370
+ *
1371
+ * @overload@overload
1372
+ * @param {string} reason
1373
+ * @param {string | null | undefined} [origin]
1374
+ * @returns {VFileMessage}
1375
+ *
1376
+ * @overload@overload
1377
+ * @param {Error | VFileMessage} cause
1378
+ * @param {Node | NodeLike | null | undefined} parent
1379
+ * @param {string | null | undefined} [origin]
1380
+ * @returns {VFileMessage}
1381
+ *
1382
+ * @overload@overload
1383
+ * @param {Error | VFileMessage} cause
1384
+ * @param {Point | Position | null | undefined} place
1385
+ * @param {string | null | undefined} [origin]
1386
+ * @returns {VFileMessage}
1387
+ *
1388
+ * @overload@overload
1389
+ * @param {Error | VFileMessage} cause
1390
+ * @param {string | null | undefined} [origin]
1391
+ * @returns {VFileMessage}
1392
+ *
1393
+ * @param {Error | VFileMessage | string} causeOrReason
1394
+ * Reason for message, should use markdown.
1395
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1396
+ * Configuration (optional).
1397
+ * @param {string | null | undefined} [origin]
1398
+ * Place in code where the message originates (example:
1399
+ * `'my-package:my-rule'` or `'my-rule'`).
1400
+ * @returns {VFileMessage}
1401
+ * Message.
1402
+ */
1403
+ info(cause: Error | VFileMessage, parent: Node_3 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
1404
+ /**
1405
+ * Create an info message for `reason` associated with the file.
1406
+ *
1407
+ * The `fatal` field of the message is set to `undefined` (info; change
1408
+ * likely not needed) and the `file` field is set to the current file path.
1409
+ * The message is added to the `messages` field on `file`.
1410
+ *
1411
+ * > 🪦 **Note**: also has obsolete signatures.
1412
+ *
1413
+ * @overload@overload
1414
+ * @param {string} reason
1415
+ * @param {MessageOptions | null | undefined} [options]
1416
+ * @returns {VFileMessage}
1417
+ *
1418
+ * @overload@overload
1419
+ * @param {string} reason
1420
+ * @param {Node | NodeLike | null | undefined} parent
1421
+ * @param {string | null | undefined} [origin]
1422
+ * @returns {VFileMessage}
1423
+ *
1424
+ * @overload@overload
1425
+ * @param {string} reason
1426
+ * @param {Point | Position | null | undefined} place
1427
+ * @param {string | null | undefined} [origin]
1428
+ * @returns {VFileMessage}
1429
+ *
1430
+ * @overload@overload
1431
+ * @param {string} reason
1432
+ * @param {string | null | undefined} [origin]
1433
+ * @returns {VFileMessage}
1434
+ *
1435
+ * @overload@overload
1436
+ * @param {Error | VFileMessage} cause
1437
+ * @param {Node | NodeLike | null | undefined} parent
1438
+ * @param {string | null | undefined} [origin]
1439
+ * @returns {VFileMessage}
1440
+ *
1441
+ * @overload@overload
1442
+ * @param {Error | VFileMessage} cause
1443
+ * @param {Point | Position | null | undefined} place
1444
+ * @param {string | null | undefined} [origin]
1445
+ * @returns {VFileMessage}
1446
+ *
1447
+ * @overload@overload
1448
+ * @param {Error | VFileMessage} cause
1449
+ * @param {string | null | undefined} [origin]
1450
+ * @returns {VFileMessage}
1451
+ *
1452
+ * @param {Error | VFileMessage | string} causeOrReason
1453
+ * Reason for message, should use markdown.
1454
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1455
+ * Configuration (optional).
1456
+ * @param {string | null | undefined} [origin]
1457
+ * Place in code where the message originates (example:
1458
+ * `'my-package:my-rule'` or `'my-rule'`).
1459
+ * @returns {VFileMessage}
1460
+ * Message.
1461
+ */
1462
+ info(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage;
1463
+ /**
1464
+ * Create an info message for `reason` associated with the file.
1465
+ *
1466
+ * The `fatal` field of the message is set to `undefined` (info; change
1467
+ * likely not needed) and the `file` field is set to the current file path.
1468
+ * The message is added to the `messages` field on `file`.
1469
+ *
1470
+ * > 🪦 **Note**: also has obsolete signatures.
1471
+ *
1472
+ * @overload@overload
1473
+ * @param {string} reason
1474
+ * @param {MessageOptions | null | undefined} [options]
1475
+ * @returns {VFileMessage}
1476
+ *
1477
+ * @overload@overload
1478
+ * @param {string} reason
1479
+ * @param {Node | NodeLike | null | undefined} parent
1480
+ * @param {string | null | undefined} [origin]
1481
+ * @returns {VFileMessage}
1482
+ *
1483
+ * @overload@overload
1484
+ * @param {string} reason
1485
+ * @param {Point | Position | null | undefined} place
1486
+ * @param {string | null | undefined} [origin]
1487
+ * @returns {VFileMessage}
1488
+ *
1489
+ * @overload@overload
1490
+ * @param {string} reason
1491
+ * @param {string | null | undefined} [origin]
1492
+ * @returns {VFileMessage}
1493
+ *
1494
+ * @overload@overload
1495
+ * @param {Error | VFileMessage} cause
1496
+ * @param {Node | NodeLike | null | undefined} parent
1497
+ * @param {string | null | undefined} [origin]
1498
+ * @returns {VFileMessage}
1499
+ *
1500
+ * @overload@overload
1501
+ * @param {Error | VFileMessage} cause
1502
+ * @param {Point | Position | null | undefined} place
1503
+ * @param {string | null | undefined} [origin]
1504
+ * @returns {VFileMessage}
1505
+ *
1506
+ * @overload@overload
1507
+ * @param {Error | VFileMessage} cause
1508
+ * @param {string | null | undefined} [origin]
1509
+ * @returns {VFileMessage}
1510
+ *
1511
+ * @param {Error | VFileMessage | string} causeOrReason
1512
+ * Reason for message, should use markdown.
1513
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1514
+ * Configuration (optional).
1515
+ * @param {string | null | undefined} [origin]
1516
+ * Place in code where the message originates (example:
1517
+ * `'my-package:my-rule'` or `'my-rule'`).
1518
+ * @returns {VFileMessage}
1519
+ * Message.
1520
+ */
1521
+ info(cause: Error | VFileMessage, origin?: string | null | undefined): VFileMessage;
1522
+ /**
1523
+ * Create a message for `reason` associated with the file.
1524
+ *
1525
+ * The `fatal` field of the message is set to `false` (warning; change may be
1526
+ * needed) and the `file` field is set to the current file path.
1527
+ * The message is added to the `messages` field on `file`.
1528
+ *
1529
+ * > 🪦 **Note**: also has obsolete signatures.
1530
+ *
1531
+ * @overload@overload
1532
+ * @param {string} reason
1533
+ * @param {MessageOptions | null | undefined} [options]
1534
+ * @returns {VFileMessage}
1535
+ *
1536
+ * @overload@overload
1537
+ * @param {string} reason
1538
+ * @param {Node | NodeLike | null | undefined} parent
1539
+ * @param {string | null | undefined} [origin]
1540
+ * @returns {VFileMessage}
1541
+ *
1542
+ * @overload@overload
1543
+ * @param {string} reason
1544
+ * @param {Point | Position | null | undefined} place
1545
+ * @param {string | null | undefined} [origin]
1546
+ * @returns {VFileMessage}
1547
+ *
1548
+ * @overload@overload
1549
+ * @param {string} reason
1550
+ * @param {string | null | undefined} [origin]
1551
+ * @returns {VFileMessage}
1552
+ *
1553
+ * @overload@overload
1554
+ * @param {Error | VFileMessage} cause
1555
+ * @param {Node | NodeLike | null | undefined} parent
1556
+ * @param {string | null | undefined} [origin]
1557
+ * @returns {VFileMessage}
1558
+ *
1559
+ * @overload@overload
1560
+ * @param {Error | VFileMessage} cause
1561
+ * @param {Point | Position | null | undefined} place
1562
+ * @param {string | null | undefined} [origin]
1563
+ * @returns {VFileMessage}
1564
+ *
1565
+ * @overload@overload
1566
+ * @param {Error | VFileMessage} cause
1567
+ * @param {string | null | undefined} [origin]
1568
+ * @returns {VFileMessage}
1569
+ *
1570
+ * @param {Error | VFileMessage | string} causeOrReason
1571
+ * Reason for message, should use markdown.
1572
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1573
+ * Configuration (optional).
1574
+ * @param {string | null | undefined} [origin]
1575
+ * Place in code where the message originates (example:
1576
+ * `'my-package:my-rule'` or `'my-rule'`).
1577
+ * @returns {VFileMessage}
1578
+ * Message.
1579
+ */
1580
+ message(reason: string, options?: Options_2 | null | undefined): VFileMessage;
1581
+ /**
1582
+ * Create a message for `reason` associated with the file.
1583
+ *
1584
+ * The `fatal` field of the message is set to `false` (warning; change may be
1585
+ * needed) and the `file` field is set to the current file path.
1586
+ * The message is added to the `messages` field on `file`.
1587
+ *
1588
+ * > 🪦 **Note**: also has obsolete signatures.
1589
+ *
1590
+ * @overload@overload
1591
+ * @param {string} reason
1592
+ * @param {MessageOptions | null | undefined} [options]
1593
+ * @returns {VFileMessage}
1594
+ *
1595
+ * @overload@overload
1596
+ * @param {string} reason
1597
+ * @param {Node | NodeLike | null | undefined} parent
1598
+ * @param {string | null | undefined} [origin]
1599
+ * @returns {VFileMessage}
1600
+ *
1601
+ * @overload@overload
1602
+ * @param {string} reason
1603
+ * @param {Point | Position | null | undefined} place
1604
+ * @param {string | null | undefined} [origin]
1605
+ * @returns {VFileMessage}
1606
+ *
1607
+ * @overload@overload
1608
+ * @param {string} reason
1609
+ * @param {string | null | undefined} [origin]
1610
+ * @returns {VFileMessage}
1611
+ *
1612
+ * @overload@overload
1613
+ * @param {Error | VFileMessage} cause
1614
+ * @param {Node | NodeLike | null | undefined} parent
1615
+ * @param {string | null | undefined} [origin]
1616
+ * @returns {VFileMessage}
1617
+ *
1618
+ * @overload@overload
1619
+ * @param {Error | VFileMessage} cause
1620
+ * @param {Point | Position | null | undefined} place
1621
+ * @param {string | null | undefined} [origin]
1622
+ * @returns {VFileMessage}
1623
+ *
1624
+ * @overload@overload
1625
+ * @param {Error | VFileMessage} cause
1626
+ * @param {string | null | undefined} [origin]
1627
+ * @returns {VFileMessage}
1628
+ *
1629
+ * @param {Error | VFileMessage | string} causeOrReason
1630
+ * Reason for message, should use markdown.
1631
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1632
+ * Configuration (optional).
1633
+ * @param {string | null | undefined} [origin]
1634
+ * Place in code where the message originates (example:
1635
+ * `'my-package:my-rule'` or `'my-rule'`).
1636
+ * @returns {VFileMessage}
1637
+ * Message.
1638
+ */
1639
+ message(reason: string, parent: Node_3 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
1640
+ /**
1641
+ * Create a message for `reason` associated with the file.
1642
+ *
1643
+ * The `fatal` field of the message is set to `false` (warning; change may be
1644
+ * needed) and the `file` field is set to the current file path.
1645
+ * The message is added to the `messages` field on `file`.
1646
+ *
1647
+ * > 🪦 **Note**: also has obsolete signatures.
1648
+ *
1649
+ * @overload@overload
1650
+ * @param {string} reason
1651
+ * @param {MessageOptions | null | undefined} [options]
1652
+ * @returns {VFileMessage}
1653
+ *
1654
+ * @overload@overload
1655
+ * @param {string} reason
1656
+ * @param {Node | NodeLike | null | undefined} parent
1657
+ * @param {string | null | undefined} [origin]
1658
+ * @returns {VFileMessage}
1659
+ *
1660
+ * @overload@overload
1661
+ * @param {string} reason
1662
+ * @param {Point | Position | null | undefined} place
1663
+ * @param {string | null | undefined} [origin]
1664
+ * @returns {VFileMessage}
1665
+ *
1666
+ * @overload@overload
1667
+ * @param {string} reason
1668
+ * @param {string | null | undefined} [origin]
1669
+ * @returns {VFileMessage}
1670
+ *
1671
+ * @overload@overload
1672
+ * @param {Error | VFileMessage} cause
1673
+ * @param {Node | NodeLike | null | undefined} parent
1674
+ * @param {string | null | undefined} [origin]
1675
+ * @returns {VFileMessage}
1676
+ *
1677
+ * @overload@overload
1678
+ * @param {Error | VFileMessage} cause
1679
+ * @param {Point | Position | null | undefined} place
1680
+ * @param {string | null | undefined} [origin]
1681
+ * @returns {VFileMessage}
1682
+ *
1683
+ * @overload@overload
1684
+ * @param {Error | VFileMessage} cause
1685
+ * @param {string | null | undefined} [origin]
1686
+ * @returns {VFileMessage}
1687
+ *
1688
+ * @param {Error | VFileMessage | string} causeOrReason
1689
+ * Reason for message, should use markdown.
1690
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1691
+ * Configuration (optional).
1692
+ * @param {string | null | undefined} [origin]
1693
+ * Place in code where the message originates (example:
1694
+ * `'my-package:my-rule'` or `'my-rule'`).
1695
+ * @returns {VFileMessage}
1696
+ * Message.
1697
+ */
1698
+ message(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage;
1699
+ /**
1700
+ * Create a message for `reason` associated with the file.
1701
+ *
1702
+ * The `fatal` field of the message is set to `false` (warning; change may be
1703
+ * needed) and the `file` field is set to the current file path.
1704
+ * The message is added to the `messages` field on `file`.
1705
+ *
1706
+ * > 🪦 **Note**: also has obsolete signatures.
1707
+ *
1708
+ * @overload@overload
1709
+ * @param {string} reason
1710
+ * @param {MessageOptions | null | undefined} [options]
1711
+ * @returns {VFileMessage}
1712
+ *
1713
+ * @overload@overload
1714
+ * @param {string} reason
1715
+ * @param {Node | NodeLike | null | undefined} parent
1716
+ * @param {string | null | undefined} [origin]
1717
+ * @returns {VFileMessage}
1718
+ *
1719
+ * @overload@overload
1720
+ * @param {string} reason
1721
+ * @param {Point | Position | null | undefined} place
1722
+ * @param {string | null | undefined} [origin]
1723
+ * @returns {VFileMessage}
1724
+ *
1725
+ * @overload@overload
1726
+ * @param {string} reason
1727
+ * @param {string | null | undefined} [origin]
1728
+ * @returns {VFileMessage}
1729
+ *
1730
+ * @overload@overload
1731
+ * @param {Error | VFileMessage} cause
1732
+ * @param {Node | NodeLike | null | undefined} parent
1733
+ * @param {string | null | undefined} [origin]
1734
+ * @returns {VFileMessage}
1735
+ *
1736
+ * @overload@overload
1737
+ * @param {Error | VFileMessage} cause
1738
+ * @param {Point | Position | null | undefined} place
1739
+ * @param {string | null | undefined} [origin]
1740
+ * @returns {VFileMessage}
1741
+ *
1742
+ * @overload@overload
1743
+ * @param {Error | VFileMessage} cause
1744
+ * @param {string | null | undefined} [origin]
1745
+ * @returns {VFileMessage}
1746
+ *
1747
+ * @param {Error | VFileMessage | string} causeOrReason
1748
+ * Reason for message, should use markdown.
1749
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1750
+ * Configuration (optional).
1751
+ * @param {string | null | undefined} [origin]
1752
+ * Place in code where the message originates (example:
1753
+ * `'my-package:my-rule'` or `'my-rule'`).
1754
+ * @returns {VFileMessage}
1755
+ * Message.
1756
+ */
1757
+ message(reason: string, origin?: string | null | undefined): VFileMessage;
1758
+ /**
1759
+ * Create a message for `reason` associated with the file.
1760
+ *
1761
+ * The `fatal` field of the message is set to `false` (warning; change may be
1762
+ * needed) and the `file` field is set to the current file path.
1763
+ * The message is added to the `messages` field on `file`.
1764
+ *
1765
+ * > 🪦 **Note**: also has obsolete signatures.
1766
+ *
1767
+ * @overload@overload
1768
+ * @param {string} reason
1769
+ * @param {MessageOptions | null | undefined} [options]
1770
+ * @returns {VFileMessage}
1771
+ *
1772
+ * @overload@overload
1773
+ * @param {string} reason
1774
+ * @param {Node | NodeLike | null | undefined} parent
1775
+ * @param {string | null | undefined} [origin]
1776
+ * @returns {VFileMessage}
1777
+ *
1778
+ * @overload@overload
1779
+ * @param {string} reason
1780
+ * @param {Point | Position | null | undefined} place
1781
+ * @param {string | null | undefined} [origin]
1782
+ * @returns {VFileMessage}
1783
+ *
1784
+ * @overload@overload
1785
+ * @param {string} reason
1786
+ * @param {string | null | undefined} [origin]
1787
+ * @returns {VFileMessage}
1788
+ *
1789
+ * @overload@overload
1790
+ * @param {Error | VFileMessage} cause
1791
+ * @param {Node | NodeLike | null | undefined} parent
1792
+ * @param {string | null | undefined} [origin]
1793
+ * @returns {VFileMessage}
1794
+ *
1795
+ * @overload@overload
1796
+ * @param {Error | VFileMessage} cause
1797
+ * @param {Point | Position | null | undefined} place
1798
+ * @param {string | null | undefined} [origin]
1799
+ * @returns {VFileMessage}
1800
+ *
1801
+ * @overload@overload
1802
+ * @param {Error | VFileMessage} cause
1803
+ * @param {string | null | undefined} [origin]
1804
+ * @returns {VFileMessage}
1805
+ *
1806
+ * @param {Error | VFileMessage | string} causeOrReason
1807
+ * Reason for message, should use markdown.
1808
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1809
+ * Configuration (optional).
1810
+ * @param {string | null | undefined} [origin]
1811
+ * Place in code where the message originates (example:
1812
+ * `'my-package:my-rule'` or `'my-rule'`).
1813
+ * @returns {VFileMessage}
1814
+ * Message.
1815
+ */
1816
+ message(cause: Error | VFileMessage, parent: Node_3 | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage;
1817
+ /**
1818
+ * Create a message for `reason` associated with the file.
1819
+ *
1820
+ * The `fatal` field of the message is set to `false` (warning; change may be
1821
+ * needed) and the `file` field is set to the current file path.
1822
+ * The message is added to the `messages` field on `file`.
1823
+ *
1824
+ * > 🪦 **Note**: also has obsolete signatures.
1825
+ *
1826
+ * @overload@overload
1827
+ * @param {string} reason
1828
+ * @param {MessageOptions | null | undefined} [options]
1829
+ * @returns {VFileMessage}
1830
+ *
1831
+ * @overload@overload
1832
+ * @param {string} reason
1833
+ * @param {Node | NodeLike | null | undefined} parent
1834
+ * @param {string | null | undefined} [origin]
1835
+ * @returns {VFileMessage}
1836
+ *
1837
+ * @overload@overload
1838
+ * @param {string} reason
1839
+ * @param {Point | Position | null | undefined} place
1840
+ * @param {string | null | undefined} [origin]
1841
+ * @returns {VFileMessage}
1842
+ *
1843
+ * @overload@overload
1844
+ * @param {string} reason
1845
+ * @param {string | null | undefined} [origin]
1846
+ * @returns {VFileMessage}
1847
+ *
1848
+ * @overload@overload
1849
+ * @param {Error | VFileMessage} cause
1850
+ * @param {Node | NodeLike | null | undefined} parent
1851
+ * @param {string | null | undefined} [origin]
1852
+ * @returns {VFileMessage}
1853
+ *
1854
+ * @overload@overload
1855
+ * @param {Error | VFileMessage} cause
1856
+ * @param {Point | Position | null | undefined} place
1857
+ * @param {string | null | undefined} [origin]
1858
+ * @returns {VFileMessage}
1859
+ *
1860
+ * @overload@overload
1861
+ * @param {Error | VFileMessage} cause
1862
+ * @param {string | null | undefined} [origin]
1863
+ * @returns {VFileMessage}
1864
+ *
1865
+ * @param {Error | VFileMessage | string} causeOrReason
1866
+ * Reason for message, should use markdown.
1867
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1868
+ * Configuration (optional).
1869
+ * @param {string | null | undefined} [origin]
1870
+ * Place in code where the message originates (example:
1871
+ * `'my-package:my-rule'` or `'my-rule'`).
1872
+ * @returns {VFileMessage}
1873
+ * Message.
1874
+ */
1875
+ message(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage;
1876
+ /**
1877
+ * Create a message for `reason` associated with the file.
1878
+ *
1879
+ * The `fatal` field of the message is set to `false` (warning; change may be
1880
+ * needed) and the `file` field is set to the current file path.
1881
+ * The message is added to the `messages` field on `file`.
1882
+ *
1883
+ * > 🪦 **Note**: also has obsolete signatures.
1884
+ *
1885
+ * @overload@overload
1886
+ * @param {string} reason
1887
+ * @param {MessageOptions | null | undefined} [options]
1888
+ * @returns {VFileMessage}
1889
+ *
1890
+ * @overload@overload
1891
+ * @param {string} reason
1892
+ * @param {Node | NodeLike | null | undefined} parent
1893
+ * @param {string | null | undefined} [origin]
1894
+ * @returns {VFileMessage}
1895
+ *
1896
+ * @overload@overload
1897
+ * @param {string} reason
1898
+ * @param {Point | Position | null | undefined} place
1899
+ * @param {string | null | undefined} [origin]
1900
+ * @returns {VFileMessage}
1901
+ *
1902
+ * @overload@overload
1903
+ * @param {string} reason
1904
+ * @param {string | null | undefined} [origin]
1905
+ * @returns {VFileMessage}
1906
+ *
1907
+ * @overload@overload
1908
+ * @param {Error | VFileMessage} cause
1909
+ * @param {Node | NodeLike | null | undefined} parent
1910
+ * @param {string | null | undefined} [origin]
1911
+ * @returns {VFileMessage}
1912
+ *
1913
+ * @overload@overload
1914
+ * @param {Error | VFileMessage} cause
1915
+ * @param {Point | Position | null | undefined} place
1916
+ * @param {string | null | undefined} [origin]
1917
+ * @returns {VFileMessage}
1918
+ *
1919
+ * @overload@overload
1920
+ * @param {Error | VFileMessage} cause
1921
+ * @param {string | null | undefined} [origin]
1922
+ * @returns {VFileMessage}
1923
+ *
1924
+ * @param {Error | VFileMessage | string} causeOrReason
1925
+ * Reason for message, should use markdown.
1926
+ * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace]
1927
+ * Configuration (optional).
1928
+ * @param {string | null | undefined} [origin]
1929
+ * Place in code where the message originates (example:
1930
+ * `'my-package:my-rule'` or `'my-rule'`).
1931
+ * @returns {VFileMessage}
1932
+ * Message.
1933
+ */
1934
+ message(cause: Error | VFileMessage, origin?: string | null | undefined): VFileMessage;
1935
+ /**
1936
+ * Serialize the file.
1937
+ *
1938
+ * > **Note**: which encodings are supported depends on the engine.
1939
+ * > For info on Node.js, see:
1940
+ * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
1941
+ *
1942
+ * @param {string | null | undefined} [encoding='utf8']
1943
+ * Character encoding to understand `value` as when it’s a `Uint8Array`
1944
+ * (default: `'utf-8'`).
1945
+ * @returns {string}
1946
+ * Serialized file.
1947
+ */
1948
+ toString(encoding?: string | null | undefined): string;
1949
+ }
1950
+
255
1951
  export { withBase }
256
1952
 
257
1953
  export { }